diff --git a/.jshintignore b/.jshintignore index bb4654421..8f9a6096e 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,4 +1,4 @@ -td/public/libs/ -td/public/app/threatdragon.js -td/public/app/*.min.js +td.site/libs/ +td.site/app/threatdragon.js +td.site/app/*.min.js td.tests/ \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index b53428e0a..fc2e700e0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -14,9 +14,9 @@ module.exports = function (config) { // list of files / patterns to load in the browser files: [ - 'td/public/app/app.js', + 'td.site/app/app.js', 'td.tests/clientspec/**/*.js', - 'td/public/app/**/*.html' + 'td.site/app/**/*.html' ], // list of files to exclude @@ -26,8 +26,8 @@ module.exports = function (config) { // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { - 'td/public/app/**/*.html': ['ng-html2js'], - 'td/public/app/app.js': ['browserify'], + 'td.site/app/**/*.html': ['ng-html2js'], + 'td.site/app/app.js': ['browserify'], 'td.tests/clientspec/test.js': ['browserify'] }, diff --git a/package.json b/package.json index 34bd0dbec..ed6687c1d 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,21 @@ "private": false, "scripts": { "build": "npm run-script bundle && npm run-script bundle-minify && npm run-script bundle-css && npm run-script bundle-minify-css && npm run-script copy-fonts", - "build-templates": "browserify -t [browserify-ng-html2js --module templates] ./td/public/app/templates.build.js -o ./td/public/app/templates.js", - "copy-fonts": "./node_modules/.bin/copyfiles -f ./node_modules/font-awesome/fonts/*.* ./node_modules/bootstrap/dist/fonts/*.* ./td/public/fonts", - "bundle-css": "./node_modules/.bin/rework-npm ./td/public/content/app.css -o ./td/public/content/threatdragon.css", - "minify-css": "./node_modules/.bin/uglifycss ./td/public/content/threatdragon.css > ./td/public/content/threatdragon.min.css", + "build-templates": "browserify -t [browserify-ng-html2js --module templates] ./td.site/app/templates.build.js -o ./td.site/app/templates.js", + "copy-fonts": "./node_modules/.bin/copyfiles -f ./node_modules/font-awesome/fonts/*.* ./node_modules/bootstrap/dist/fonts/*.* ./td.site/fonts", + "bundle-css": "./node_modules/.bin/rework-npm ./td.site/content/app.css -o ./td.site/content/threatdragon.css", + "minify-css": "./node_modules/.bin/uglifycss ./td.site/content/threatdragon.css > ./td.site/content/threatdragon.min.css", "bundle-minify-css": "npm run-script bundle-css && npm run-script minify-css", - "bundle": "browserify --debug ./td/public/app/app.js -o ./td/public/app/threatdragon.js", - "bundle-minify": "browserify ./td/public/app/app.js -d -p [minifyify --map ./td/public/app/threatdragon.js.map --output ./td/public/app/threatdragon.js.map ] > ./td/public/app/threatdragon.min.js", + "bundle": "browserify --debug ./td.site/app/app.js -o ./td.site/app/threatdragon.js", + "bundle-minify": "browserify ./td.site/app/app.js -d -p [minifyify --map ./td.site/app/threatdragon.js.map --output ./td.site/app/threatdragon.js.map ] > ./td.site/app/threatdragon.min.js", "start": "node server.js", - "pretest": "node ./node_modules/jshint/bin/jshint --verbose --show-non-errors td", + "pretest": "node ./node_modules/jshint/bin/jshint --verbose --show-non-errors td.server td.site", "test": "npm run-script test-client-firefox && npm run-script test-server", "test-client-phantomjs": "./node_modules/.bin/karma start --single-run --browsers PhantomJS", "test-client-firefox": "./node_modules/.bin/karma start --single-run --browsers Firefox", "test-client-chrome": "./node_modules/.bin/karma start --single-run --browsers Chrome", "test-client-ie": "./node_modules/.bin/karma start --single-run --browsers IE", - "test-server": "istanbul cover --include-all-sources -x public/** --root ./td/ --dir ./coverage/Server/ ./td.tests/serverspec/support/jasmine-runner.js", + "test-server": "istanbul cover --include-all-sources -x ./td.site --root ./td.server/ --dir ./coverage/Server/ ./td.tests/serverspec/support/jasmine-runner.js", "test-local": "npm run-script pretest && npm run-script test-client-chrome && npm run-script test-client-ie && npm run-script test-client-phantomjs && npm run-script test-client-firefox && npm run-script test-server", "citest": "./node_modules/.bin/karma start --single-run false --browsers Firefox", "codecov": "./node_modules/.bin/codecov" diff --git a/server.js b/server.js index 26067b4c0..21545007c 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,5 @@ var debug = require('debug')('OWASP Threat Dragon'); -var app = require('./td/app'); +var app = require('./td.server/app'); app.set('port', process.env.PORT || 3000); diff --git a/td/app.js b/td.server/app.js similarity index 80% rename from td/app.js rename to td.server/app.js index 76c928b0f..5004ef1bf 100644 --- a/td/app.js +++ b/td.server/app.js @@ -3,17 +3,19 @@ var path = require('path'); var favicon = require('serve-favicon'); var bunyan = require('bunyan'); +var upDir = '..' + path.sep; + try { var app = express(); app.set('trust proxy', true); - app.set('views', './td/views'); + app.set('views', path.join(__dirname, upDir, 'td.site', 'views')); app.set('view engine', 'pug'); // environment configuration require('./config/env.config').tryLoadDotEnv(); //static content - app.use('/public', express.static(path.join(__dirname, 'public'))); + app.use('/public', express.static(path.join(__dirname, upDir, 'td.site'))); //security headers require('./config/securityheaders.config')(app); @@ -25,7 +27,7 @@ try { require('./config/passport.config')(app); //favicon - app.use(favicon(__dirname + '/public/favicon.ico')); + app.use(favicon(path.join(__dirname, upDir, 'td.site', 'favicon.ico'))); //logging require('./config/loggers.config').config(app); diff --git a/td/config/env.config.js b/td.server/config/env.config.js similarity index 100% rename from td/config/env.config.js rename to td.server/config/env.config.js diff --git a/td/config/loggers.config.js b/td.server/config/loggers.config.js similarity index 100% rename from td/config/loggers.config.js rename to td.server/config/loggers.config.js diff --git a/td/config/parsers.config.js b/td.server/config/parsers.config.js similarity index 100% rename from td/config/parsers.config.js rename to td.server/config/parsers.config.js diff --git a/td/config/passport.config.js b/td.server/config/passport.config.js similarity index 100% rename from td/config/passport.config.js rename to td.server/config/passport.config.js diff --git a/td/config/routes.config.js b/td.server/config/routes.config.js similarity index 100% rename from td/config/routes.config.js rename to td.server/config/routes.config.js diff --git a/td/config/securityheaders.config.js b/td.server/config/securityheaders.config.js similarity index 100% rename from td/config/securityheaders.config.js rename to td.server/config/securityheaders.config.js diff --git a/td/config/session.config.js b/td.server/config/session.config.js similarity index 100% rename from td/config/session.config.js rename to td.server/config/session.config.js diff --git a/td/controllers/githublogincontroller.js b/td.server/controllers/githublogincontroller.js similarity index 100% rename from td/controllers/githublogincontroller.js rename to td.server/controllers/githublogincontroller.js diff --git a/td/controllers/homecontroller.js b/td.server/controllers/homecontroller.js similarity index 93% rename from td/controllers/homecontroller.js rename to td.server/controllers/homecontroller.js index 591385c3e..e96bb63e7 100644 --- a/td/controllers/homecontroller.js +++ b/td.server/controllers/homecontroller.js @@ -14,7 +14,7 @@ homeController.index = function (req, res) { } res.cookie('XSRF-TOKEN', req.csrfToken(), cookieOptions); - res.sendFile(path.join(__dirname, '../', 'index.html')); + res.sendFile(path.join(__dirname, '..' + path.sep, '..' + path.sep, 'td.site', 'index.html')); }; homeController.login = function (req, res) { diff --git a/td/controllers/threatmodelcontroller.js b/td.server/controllers/threatmodelcontroller.js similarity index 100% rename from td/controllers/threatmodelcontroller.js rename to td.server/controllers/threatmodelcontroller.js diff --git a/td/helpers/encryption.helper.js b/td.server/helpers/encryption.helper.js similarity index 100% rename from td/helpers/encryption.helper.js rename to td.server/helpers/encryption.helper.js diff --git a/td/repositories/threatmodelrepository.js b/td.server/repositories/threatmodelrepository.js similarity index 100% rename from td/repositories/threatmodelrepository.js rename to td.server/repositories/threatmodelrepository.js diff --git a/td/public/app/.jshintrc b/td.site/app/.jshintrc similarity index 100% rename from td/public/app/.jshintrc rename to td.site/app/.jshintrc diff --git a/td/public/app/app.js b/td.site/app/app.js similarity index 100% rename from td/public/app/app.js rename to td.site/app/app.js diff --git a/td/public/app/config.exceptionHandler.js b/td.site/app/config.exceptionHandler.js similarity index 100% rename from td/public/app/config.exceptionHandler.js rename to td.site/app/config.exceptionHandler.js diff --git a/td/public/app/config.route.js b/td.site/app/config.route.js similarity index 100% rename from td/public/app/config.route.js rename to td.site/app/config.route.js diff --git a/td/public/app/layout/index.js b/td.site/app/layout/index.js similarity index 100% rename from td/public/app/layout/index.js rename to td.site/app/layout/index.js diff --git a/td/public/app/layout/shell.html b/td.site/app/layout/shell.html similarity index 100% rename from td/public/app/layout/shell.html rename to td.site/app/layout/shell.html diff --git a/td/public/app/layout/shell.js b/td.site/app/layout/shell.js similarity index 100% rename from td/public/app/layout/shell.js rename to td.site/app/layout/shell.js diff --git a/td/public/app/layout/topnav.html b/td.site/app/layout/topnav.html similarity index 100% rename from td/public/app/layout/topnav.html rename to td.site/app/layout/topnav.html diff --git a/td/public/app/services/datacontext.js b/td.site/app/services/datacontext.js similarity index 100% rename from td/public/app/services/datacontext.js rename to td.site/app/services/datacontext.js diff --git a/td/public/app/services/index.js b/td.site/app/services/index.js similarity index 100% rename from td/public/app/services/index.js rename to td.site/app/services/index.js diff --git a/td/public/app/services/threatmodellocator.js b/td.site/app/services/threatmodellocator.js similarity index 100% rename from td/public/app/services/threatmodellocator.js rename to td.site/app/services/threatmodellocator.js diff --git a/td/public/app/threatdragon.js b/td.site/app/threatdragon.js similarity index 71% rename from td/public/app/threatdragon.js rename to td.site/app/threatdragon.js index ae945a06b..4774de917 100644 --- a/td/public/app/threatdragon.js +++ b/td.site/app/threatdragon.js @@ -1,7 +1,7 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i - * It is not possible to whitelist specific URLs/paths. The `path`, `query` and `fragment` parts + * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts * of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be * treated as `https://foo.com`, meaning that **all** requests to URLs starting with * `https://foo.com/` will include the XSRF token. @@ -28575,9 +28617,9 @@ function $HttpProvider() { * ```js * // App served from `https://example.com/`. * angular. - * module('xsrfWhitelistedOriginsExample', []). + * module('xsrfTrustedOriginsExample', []). * config(['$httpProvider', function($httpProvider) { - * $httpProvider.xsrfWhitelistedOrigins.push('https://api.example.com'); + * $httpProvider.xsrfTrustedOrigins.push('https://api.example.com'); * }]). * run(['$http', function($http) { * // The XSRF token will be sent. @@ -28588,7 +28630,27 @@ function $HttpProvider() { * }]); * ``` */ - var xsrfWhitelistedOrigins = this.xsrfWhitelistedOrigins = []; + var xsrfTrustedOrigins = this.xsrfTrustedOrigins = []; + + /** + * @ngdoc property + * @name $httpProvider#xsrfWhitelistedOrigins + * @description + * + * @deprecated + * sinceVersion="1.8.1" + * + * This property is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins} + * instead. + */ + Object.defineProperty(this, 'xsrfWhitelistedOrigins', { + get: function() { + return this.xsrfTrustedOrigins; + }, + set: function(origins) { + this.xsrfTrustedOrigins = origins; + } + }); this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce', function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) { @@ -28616,7 +28678,7 @@ function $HttpProvider() { /** * A function to check request URLs against a list of allowed origins. */ - var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfWhitelistedOrigins); + var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfTrustedOrigins); /** * @ngdoc service @@ -28990,16 +29052,16 @@ function $HttpProvider() { * The header will — by default — **not** be set for cross-domain requests. This * prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining * access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you - * want to, you can whitelist additional origins to also receive the XSRF token, by adding them - * to {@link ng.$httpProvider#xsrfWhitelistedOrigins xsrfWhitelistedOrigins}. This might be + * want to, you can trust additional origins to also receive the XSRF token, by adding them + * to {@link ng.$httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}. This might be * useful, for example, if your application, served from `example.com`, needs to access your API * at `api.example.com`. - * See {@link ng.$httpProvider#xsrfWhitelistedOrigins $httpProvider.xsrfWhitelistedOrigins} for + * See {@link ng.$httpProvider#xsrfTrustedOrigins $httpProvider.xsrfTrustedOrigins} for * more details. * *
* **Warning**
- * Only whitelist origins that you have control over and make sure you understand the + * Only trusted origins that you have control over and make sure you understand the * implications of doing so. *
* @@ -29126,8 +29188,8 @@ function $HttpProvider() { angular.module('httpExample', []) .config(['$sceDelegateProvider', function($sceDelegateProvider) { - // We must whitelist the JSONP endpoint that we are using to show that we trust it - $sceDelegateProvider.resourceUrlWhitelist([ + // We must add the JSONP endpoint that we are using to the trusted list to show that we trust it + $sceDelegateProvider.trustedResourceUrlList([ 'self', 'https://angularjs.org/**' ]); @@ -29384,8 +29446,8 @@ function $HttpProvider() { * * Note that, since JSONP requests are sensitive because the response is given full access to the browser, * the url must be declared, via {@link $sce} as a trusted resource URL. - * You can trust a URL by adding it to the whitelist via - * {@link $sceDelegateProvider#resourceUrlWhitelist `$sceDelegateProvider.resourceUrlWhitelist`} or + * You can trust a URL by adding it to the trusted resource URL list via + * {@link $sceDelegateProvider#trustedResourceUrlList `$sceDelegateProvider.trustedResourceUrlList`} or * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}. * * You should avoid generating the URL for the JSONP request from user provided data. @@ -36121,12 +36183,12 @@ function $RootScopeProvider() { */ function $$SanitizeUriProvider() { - var aHrefSanitizationWhitelist = /^\s*(https?|s?ftp|mailto|tel|file):/, - imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/; + var aHrefSanitizationTrustedUrlList = /^\s*(https?|s?ftp|mailto|tel|file):/, + imgSrcSanitizationTrustedUrlList = /^\s*((https?|ftp|file|blob):|data:image\/)/; /** * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * Retrieves or overrides the default regular expression that is used for determining trusted safe * urls during a[href] sanitization. * * The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links. @@ -36135,27 +36197,27 @@ function $$SanitizeUriProvider() { * the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)` * which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL. * - * If the URL matches the `aHrefSanitizationWhitelist` regular expression, it is returned unchanged. + * If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged. * * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written * to the DOM it is inactive and potentially malicious code will not be executed. * - * @param {RegExp=} regexp New regexp to whitelist urls with. + * @param {RegExp=} regexp New regexp to trust urls with. * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for * chaining otherwise. */ - this.aHrefSanitizationWhitelist = function(regexp) { + this.aHrefSanitizationTrustedUrlList = function(regexp) { if (isDefined(regexp)) { - aHrefSanitizationWhitelist = regexp; + aHrefSanitizationTrustedUrlList = regexp; return this; } - return aHrefSanitizationWhitelist; + return aHrefSanitizationTrustedUrlList; }; /** * @description - * Retrieves or overrides the default regular expression that is used for whitelisting of safe + * Retrieves or overrides the default regular expression that is used for determining trusted safe * urls during img[src] sanitization. * * The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links. @@ -36165,27 +36227,28 @@ function $$SanitizeUriProvider() { * `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize * the potentially malicious URL. * - * If the URL matches the `aImgSanitizationWhitelist` regular expression, it is returned unchanged. + * If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned + * unchanged. * * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written * to the DOM it is inactive and potentially malicious code will not be executed. * - * @param {RegExp=} regexp New regexp to whitelist urls with. + * @param {RegExp=} regexp New regexp to trust urls with. * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for * chaining otherwise. */ - this.imgSrcSanitizationWhitelist = function(regexp) { + this.imgSrcSanitizationTrustedUrlList = function(regexp) { if (isDefined(regexp)) { - imgSrcSanitizationWhitelist = regexp; + imgSrcSanitizationTrustedUrlList = regexp; return this; } - return imgSrcSanitizationWhitelist; + return imgSrcSanitizationTrustedUrlList; }; this.$get = function() { return function sanitizeUri(uri, isMediaUrl) { // if (!uri) return uri; - var regex = isMediaUrl ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist; + var regex = isMediaUrl ? imgSrcSanitizationTrustedUrlList : aHrefSanitizationTrustedUrlList; var normalizedVal = urlResolve(uri && uri.trim()).href; if (normalizedVal !== '' && !normalizedVal.match(regex)) { return 'unsafe:' + normalizedVal; @@ -36313,10 +36376,10 @@ function adjustMatchers(matchers) { * The default instance of `$sceDelegate` should work out of the box with little pain. While you * can override it completely to change the behavior of `$sce`, the common case would * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting - * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as - * templates. Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist - * $sceDelegateProvider.resourceUrlWhitelist} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist} + * your own trusted and banned resource lists for trusting URLs used for loading AngularJS resources + * such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList + * $sceDelegateProvider.trustedResourceUrlList} and {@link + * ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList} */ /** @@ -36329,12 +36392,12 @@ function adjustMatchers(matchers) { * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}. * - * The `$sceDelegateProvider` allows one to get/set the whitelists and blacklists used to ensure - * that the URLs used for sourcing AngularJS templates and other script-running URLs are safe (all - * places that use the `$sce.RESOURCE_URL` context). See - * {@link ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} - * and - * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}, + * The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and + * `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularJS templates and + * other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See + * {@link ng.$sceDelegateProvider#trustedResourceUrlList + * $sceDelegateProvider.trustedResourceUrlList} and + * {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}, * * For the general details about this service in AngularJS, read the main page for {@link ng.$sce * Strict Contextual Escaping (SCE)}. @@ -36350,98 +36413,139 @@ function adjustMatchers(matchers) { * * ``` * angular.module('myApp', []).config(function($sceDelegateProvider) { - * $sceDelegateProvider.resourceUrlWhitelist([ + * $sceDelegateProvider.trustedResourceUrlList([ * // Allow same origin resource loads. * 'self', * // Allow loading from our assets domain. Notice the difference between * and **. * 'http://srv*.assets.example.com/**' * ]); * - * // The blacklist overrides the whitelist so the open redirect here is blocked. - * $sceDelegateProvider.resourceUrlBlacklist([ + * // The banned resource URL list overrides the trusted resource URL list so the open redirect + * // here is blocked. + * $sceDelegateProvider.bannedResourceUrlList([ * 'http://myapp.example.com/clickThru**' * ]); * }); * ``` - * Note that an empty whitelist will block every resource URL from being loaded, and will require + * Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates * requested by {@link ng.$templateRequest $templateRequest} that are present in * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism * to populate your templates in that cache at config time, then it is a good idea to remove 'self' - * from that whitelist. This helps to mitigate the security impact of certain types of issues, like - * for instance attacker-controlled `ng-includes`. + * from the trusted resource URL lsit. This helps to mitigate the security impact of certain types + * of issues, like for instance attacker-controlled `ng-includes`. */ function $SceDelegateProvider() { this.SCE_CONTEXTS = SCE_CONTEXTS; // Resource URLs can also be trusted by policy. - var resourceUrlWhitelist = ['self'], - resourceUrlBlacklist = []; + var trustedResourceUrlList = ['self'], + bannedResourceUrlList = []; /** * @ngdoc method - * @name $sceDelegateProvider#resourceUrlWhitelist + * @name $sceDelegateProvider#trustedResourceUrlList * @kind function * - * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored. + * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with + * the value provided. This must be an array or null. A snapshot of this array is used so + * further changes to the array are ignored. * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items * allowed in this array. * - * @return {Array} The currently set whitelist array. + * @return {Array} The currently set trusted resource URL array. * * @description - * Sets/Gets the whitelist of trusted resource URLs. + * Sets/Gets the list trusted of resource URLs. * - * The **default value** when no whitelist has been explicitly set is `['self']` allowing only - * same origin resource requests. + * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']` + * allowing only same origin resource requests. * *
- * **Note:** the default whitelist of 'self' is not recommended if your app shares its origin - * with other apps! It is a good idea to limit it to only your application's directory. + * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares + * its origin with other apps! It is a good idea to limit it to only your application's directory. *
*/ - this.resourceUrlWhitelist = function(value) { + this.trustedResourceUrlList = function(value) { if (arguments.length) { - resourceUrlWhitelist = adjustMatchers(value); + trustedResourceUrlList = adjustMatchers(value); } - return resourceUrlWhitelist; + return trustedResourceUrlList; }; /** * @ngdoc method - * @name $sceDelegateProvider#resourceUrlBlacklist + * @name $sceDelegateProvider#resourceUrlWhitelist * @kind function * - * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value - * provided. This must be an array or null. A snapshot of this array is used so further - * changes to the array are ignored.

+ * @deprecated + * sinceVersion="1.8.1" + * + * This method is deprecated. Use {@link $sceDelegateProvider#trustedResourceUrlList + * trustedResourceUrlList} instead. + */ + Object.defineProperty(this, 'resourceUrlWhitelist', { + get: function() { + return this.trustedResourceUrlList; + }, + set: function(value) { + this.trustedResourceUrlList = value; + } + }); + + /** + * @ngdoc method + * @name $sceDelegateProvider#bannedResourceUrlList + * @kind function + * + * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with + * the value provided. This must be an array or null. A snapshot of this array is used so + * further changes to the array are ignored.

* Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items * allowed in this array.

- * The typical usage for the blacklist is to **block + * The typical usage for the `bannedResourceUrlList` is to **block * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as * these would otherwise be trusted but actually return content from the redirected domain. *

- * Finally, **the blacklist overrides the whitelist** and has the final say. + * Finally, **the banned resource URL list overrides the trusted resource URL list** and has + * the final say. * - * @return {Array} The currently set blacklist array. + * @return {Array} The currently set `bannedResourceUrlList` array. * * @description - * Sets/Gets the blacklist of trusted resource URLs. + * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs. * - * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there - * is no blacklist.) + * The **default value** when no trusted resource URL list has been explicitly set is the empty + * array (i.e. there is no `bannedResourceUrlList`.) */ - - this.resourceUrlBlacklist = function(value) { + this.bannedResourceUrlList = function(value) { if (arguments.length) { - resourceUrlBlacklist = adjustMatchers(value); + bannedResourceUrlList = adjustMatchers(value); } - return resourceUrlBlacklist; + return bannedResourceUrlList; }; + /** + * @ngdoc method + * @name $sceDelegateProvider#resourceUrlBlacklist + * @kind function + * + * @deprecated + * sinceVersion="1.8.1" + * + * This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList + * bannedResourceUrlList} instead. + */ + Object.defineProperty(this, 'resourceUrlBlacklist', { + get: function() { + return this.bannedResourceUrlList; + }, + set: function(value) { + this.bannedResourceUrlList = value; + } + }); + this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) { var htmlSanitizer = function htmlSanitizer(html) { @@ -36465,17 +36569,17 @@ function $SceDelegateProvider() { function isResourceUrlAllowedByPolicy(url) { var parsedUrl = urlResolve(url.toString()); var i, n, allowed = false; - // Ensure that at least one item from the whitelist allows this url. - for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) { - if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) { + // Ensure that at least one item from the trusted resource URL list allows this url. + for (i = 0, n = trustedResourceUrlList.length; i < n; i++) { + if (matchUrl(trustedResourceUrlList[i], parsedUrl)) { allowed = true; break; } } if (allowed) { - // Ensure that no item from the blacklist blocked this url. - for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) { - if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) { + // Ensure that no item from the banned resource URL list has blocked this url. + for (i = 0, n = bannedResourceUrlList.length; i < n; i++) { + if (matchUrl(bannedResourceUrlList[i], parsedUrl)) { allowed = false; break; } @@ -36596,9 +36700,9 @@ function $SceDelegateProvider() { * The contexts that can be sanitized are $sce.MEDIA_URL, $sce.URL and $sce.HTML. The first two are available * by default, and the third one relies on the `$sanitize` service (which may be loaded through * the `ngSanitize` module). Furthermore, for $sce.RESOURCE_URL context, a plain string may be - * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#resourceUrlWhitelist - * `$sceDelegateProvider.resourceUrlWhitelist`} and {@link ng.$sceDelegateProvider#resourceUrlBlacklist - * `$sceDelegateProvider.resourceUrlBlacklist`} accepts that resource. + * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#trustedResourceUrlList + * `$sceDelegateProvider.trustedResourceUrlList`} and {@link ng.$sceDelegateProvider#bannedResourceUrlList + * `$sceDelegateProvider.bannedResourceUrlList`} accepts that resource. * * This function will throw if the safe type isn't appropriate for this context, or if the * value given cannot be accepted in the context (which might be caused by sanitization not @@ -36692,9 +36796,9 @@ function $SceDelegateProvider() { * * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically - * run security checks on them (sanitizations, whitelists, depending on context), or throw when it - * cannot guarantee the security of the result. That behavior depends strongly on contexts: HTML - * can be sanitized, but template URLs cannot, for instance. + * run security checks on them (sanitizations, trusted URL resource, depending on context), or throw + * when it cannot guarantee the security of the result. That behavior depends strongly on contexts: + * HTML can be sanitized, but template URLs cannot, for instance. * * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML: * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it @@ -36773,8 +36877,8 @@ function $SceDelegateProvider() { * By default, AngularJS only loads templates from the same domain and protocol as the application * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or - * protocols, you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist - * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value. + * protocols, you may either add them to the {@link ng.$sceDelegateProvider#trustedResourceUrlList + * trustedResourceUrlList} or {@link ng.$sce#trustAsResourceUrl wrap them} into trusted values. * * *Please note*: * The browser's @@ -36802,8 +36906,8 @@ function $SceDelegateProvider() { * templates in `ng-include` from your application's domain without having to even know about SCE. * It blocks loading templates from other domains or loading templates over http from an https * served document. You can change these by setting your own custom {@link - * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link - * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs. + * ng.$sceDelegateProvider#trustedResourceUrlList trusted resource URL list} and {@link + * ng.$sceDelegateProvider#bannedResourceUrlList banned resource URL list} for matching such URLs. * * This significantly reduces the overhead. It is far easier to pay the small overhead and have an * application that's secure and can be audited to verify that with much more ease than bolting @@ -36818,7 +36922,7 @@ function $SceDelegateProvider() { * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. | * | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. | * | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.| - * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)

Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required.

The {@link $sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider#resourceUrlWhitelist()} and {@link $sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider#resourceUrlBlacklist()} can be used to restrict trusted origins for `RESOURCE_URL` | + * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)

Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required.

The {@link $sceDelegateProvider#trustedResourceUrlList $sceDelegateProvider#trustedResourceUrlList()} and {@link $sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider#bannedResourceUrlList()} can be used to restrict trusted origins for `RESOURCE_URL` | * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. | * * @@ -36836,7 +36940,7 @@ function $SceDelegateProvider() { * There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs` * functions aren't useful yet. This might evolve. * - * ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} + * ### Format of items in {@link ng.$sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList}/{@link ng.$sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList} * * Each element in these arrays must be one of the following: * @@ -36850,7 +36954,7 @@ function $SceDelegateProvider() { * match themselves. * - `*`: matches zero or more occurrences of any character other than one of the following 6 * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use - * in a whitelist. + * for matching resource URL lists. * - `**`: matches zero or more occurrences of *any* character. As such, it's not * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g. * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might @@ -37654,10 +37758,10 @@ function $TemplateRequestProvider() { handleRequestFn.totalPendingRequests++; // We consider the template cache holds only trusted templates, so - // there's no need to go through whitelisting again for keys that already - // are included in there. This also makes AngularJS accept any script - // directive, no matter its name. However, we still need to unwrap trusted - // types. + // there's no need to go through adding the template again to the trusted + // resources for keys that already are included in there. This also makes + // AngularJS accept any script directive, no matter its name. However, we + // still need to unwrap trusted types. if (!isString(tpl) || isUndefined($templateCache.get(tpl))) { tpl = $sce.getTrustedResourceUrl(tpl); } @@ -38062,20 +38166,20 @@ function urlIsSameOriginAsBaseUrl(requestUrl) { } /** - * Create a function that can check a URL's origin against a list of allowed/whitelisted origins. + * Create a function that can check a URL's origin against a list of allowed/trusted origins. * The current location's origin is implicitly trusted. * - * @param {string[]} whitelistedOriginUrls - A list of URLs (strings), whose origins are trusted. + * @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted. * * @returns {Function} - A function that receives a URL (string or parsed URL object) and returns * whether it is of an allowed origin. */ -function urlIsAllowedOriginFactory(whitelistedOriginUrls) { - var parsedAllowedOriginUrls = [originUrl].concat(whitelistedOriginUrls.map(urlResolve)); +function urlIsAllowedOriginFactory(trustedOriginUrls) { + var parsedAllowedOriginUrls = [originUrl].concat(trustedOriginUrls.map(urlResolve)); /** * Check whether the specified URL (string or parsed URL object) has an origin that is allowed - * based on a list of whitelisted-origin URLs. The current location's origin is implicitly + * based on a list of trusted-origin URLs. The current location's origin is implicitly * trusted. * * @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be @@ -45822,9 +45926,9 @@ var ngIfDirective = ['$animate', '$compile', function($animate, $compile) { * By default, the template URL is restricted to the same domain and protocol as the * application document. This is done by calling {@link $sce#getTrustedResourceUrl * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols - * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or - * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to AngularJS's {@link - * ng.$sce Strict Contextual Escaping}. + * you may either add them to your {@link ng.$sceDelegateProvider#trustedResourceUrlList trusted + * resource URL list} or {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to + * AngularJS's {@link ng.$sce Strict Contextual Escaping}. * * In addition, the browser's * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest) @@ -54774,9 +54878,7 @@ function fromByteArray (uint8) { // go through the array every three bytes, we'll deal with trailing stuff later for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) } // pad the end with zeros, but make sure to not forget the extra bytes @@ -59215,531 +59317,6 @@ function numberIsNaN (obj) { }).call(this)}).call(this,require("buffer").Buffer) },{"base64-js":12,"buffer":27,"ieee754":90}],28:[function(require,module,exports){ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var objectCreate = Object.create || objectCreatePolyfill -var objectKeys = Object.keys || objectKeysPolyfill -var bind = Function.prototype.bind || functionBindPolyfill - -function EventEmitter() { - if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { - this._events = objectCreate(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; -} -module.exports = EventEmitter; - -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; - -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._maxListeners = undefined; - -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; - -var hasDefineProperty; -try { - var o = {}; - if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); - hasDefineProperty = o.x === 0; -} catch (err) { hasDefineProperty = false } -if (hasDefineProperty) { - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - // check whether the input is a positive number (whose value is zero or - // greater and not a NaN). - if (typeof arg !== 'number' || arg < 0 || arg !== arg) - throw new TypeError('"defaultMaxListeners" must be a positive number'); - defaultMaxListeners = arg; - } - }); -} else { - EventEmitter.defaultMaxListeners = defaultMaxListeners; -} - -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || isNaN(n)) - throw new TypeError('"n" argument must be a positive number'); - this._maxListeners = n; - return this; -}; - -function $getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; -} - -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return $getMaxListeners(this); -}; - -// These standalone emit* functions are used to optimize calling of event -// handlers for fast cases because emit() itself often has a variable number of -// arguments and can be deoptimized because of that. These functions always have -// the same number of arguments and thus do not get deoptimized, so the code -// inside them can execute faster. -function emitNone(handler, isFn, self) { - if (isFn) - handler.call(self); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self); - } -} -function emitOne(handler, isFn, self, arg1) { - if (isFn) - handler.call(self, arg1); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1); - } -} -function emitTwo(handler, isFn, self, arg1, arg2) { - if (isFn) - handler.call(self, arg1, arg2); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2); - } -} -function emitThree(handler, isFn, self, arg1, arg2, arg3) { - if (isFn) - handler.call(self, arg1, arg2, arg3); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].call(self, arg1, arg2, arg3); - } -} - -function emitMany(handler, isFn, self, args) { - if (isFn) - handler.apply(self, args); - else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - listeners[i].apply(self, args); - } -} - -EventEmitter.prototype.emit = function emit(type) { - var er, handler, len, args, i, events; - var doError = (type === 'error'); - - events = this._events; - if (events) - doError = (doError && events.error == null); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - if (arguments.length > 1) - er = arguments[1]; - if (er instanceof Error) { - throw er; // Unhandled 'error' event - } else { - // At least give some kind of context to the user - var err = new Error('Unhandled "error" event. (' + er + ')'); - err.context = er; - throw err; - } - return false; - } - - handler = events[type]; - - if (!handler) - return false; - - var isFn = typeof handler === 'function'; - len = arguments.length; - switch (len) { - // fast cases - case 1: - emitNone(handler, isFn, this); - break; - case 2: - emitOne(handler, isFn, this, arguments[1]); - break; - case 3: - emitTwo(handler, isFn, this, arguments[1], arguments[2]); - break; - case 4: - emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); - break; - // slower - default: - args = new Array(len - 1); - for (i = 1; i < len; i++) - args[i - 1] = arguments[i]; - emitMany(handler, isFn, this, args); - } - - return true; -}; - -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = target._events; - if (!events) { - events = target._events = objectCreate(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (!existing) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - } else { - // If we've already got an array, just append. - if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - } - - // Check for listener leak - if (!existing.warned) { - m = $getMaxListeners(target); - if (m && m > 0 && existing.length > m) { - existing.warned = true; - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' "' + String(type) + '" listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit.'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - if (typeof console === 'object' && console.warn) { - console.warn('%s: %s', w.name, w.message); - } - } - } - } - - return target; -} - -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; - -EventEmitter.prototype.on = EventEmitter.prototype.addListener; - -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - -function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - switch (arguments.length) { - case 0: - return this.listener.call(this.target); - case 1: - return this.listener.call(this.target, arguments[0]); - case 2: - return this.listener.call(this.target, arguments[0], arguments[1]); - case 3: - return this.listener.call(this.target, arguments[0], arguments[1], - arguments[2]); - default: - var args = new Array(arguments.length); - for (var i = 0; i < args.length; ++i) - args[i] = arguments[i]; - this.listener.apply(this.target, args); - } - } -} - -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = bind.call(onceWrapper, state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} - -EventEmitter.prototype.once = function once(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.on(type, _onceWrap(this, type, listener)); - return this; -}; - -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - if (typeof listener !== 'function') - throw new TypeError('"listener" argument must be a function'); - - events = this._events; - if (!events) - return this; - - list = events[type]; - if (!list) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else - spliceOne(list, position); - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (!events) - return this; - - // not listening for removeListener, no need to emit - if (!events.removeListener) { - if (arguments.length === 0) { - this._events = objectCreate(null); - this._eventsCount = 0; - } else if (events[type]) { - if (--this._eventsCount === 0) - this._events = objectCreate(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = objectKeys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = objectCreate(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - -function _listeners(target, type, unwrap) { - var events = target._events; - - if (!events) - return []; - - var evlistener = events[type]; - if (!evlistener) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); -} - -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; - -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; - -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; - -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; - - if (events) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener) { - return evlistener.length; - } - } - - return 0; -} - -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; -}; - -// About 1.5x faster than the two-arg version of Array#splice(). -function spliceOne(list, index) { - for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) - list[i] = list[k]; - list.pop(); -} - -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} - -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; -} - -function objectCreatePolyfill(proto) { - var F = function() {}; - F.prototype = proto; - return new F; -} -function objectKeysPolyfill(obj) { - var keys = []; - for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { - keys.push(k); - } - return k; -} -function functionBindPolyfill(context) { - var fn = this; - return function () { - return fn.apply(context, arguments); - }; -} - -},{}],29:[function(require,module,exports){ (function (Buffer){(function (){ var clone = (function() { 'use strict'; @@ -60001,7 +59578,7 @@ if (typeof module === 'object' && module.exports) { }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":27}],30:[function(require,module,exports){ +},{"buffer":27}],29:[function(require,module,exports){ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : @@ -60107,7 +59684,7 @@ if (typeof module === 'object' && module.exports) { })); -},{}],31:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ 'use strict' /*! @@ -60151,7 +59728,7 @@ function curry2 (fn, self) { return out } -},{"fast-bind":63}],32:[function(require,module,exports){ +},{"fast-bind":63}],31:[function(require,module,exports){ /* Copyright (c) 2012-2014 Chris Pettitt @@ -60186,7 +59763,7 @@ module.exports = { version: require("./lib/version") }; -},{"./lib/debug":37,"./lib/graphlib":38,"./lib/layout":40,"./lib/util":60,"./lib/version":61}],33:[function(require,module,exports){ +},{"./lib/debug":36,"./lib/graphlib":37,"./lib/layout":39,"./lib/util":59,"./lib/version":60}],32:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -60255,7 +59832,7 @@ function undo(g) { }); } -},{"./greedy-fas":39,"./lodash":41}],34:[function(require,module,exports){ +},{"./greedy-fas":38,"./lodash":40}],33:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -60295,7 +59872,7 @@ function addBorderNode(g, prop, prefix, sg, sgNode, rank) { } } -},{"./lodash":41,"./util":60}],35:[function(require,module,exports){ +},{"./lodash":40,"./util":59}],34:[function(require,module,exports){ "use strict"; var _ = require("./lodash"); @@ -60369,7 +59946,7 @@ function swapXYOne(attrs) { attrs.y = x; } -},{"./lodash":41}],36:[function(require,module,exports){ +},{"./lodash":40}],35:[function(require,module,exports){ /* * Simple doubly linked list implementation derived from Cormen, et al., * "Introduction to Algorithms". @@ -60427,7 +60004,7 @@ function filterOutLinks(k, v) { } } -},{}],37:[function(require,module,exports){ +},{}],36:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"), Graph = require("./graphlib").Graph; @@ -60463,7 +60040,7 @@ function debugOrdering(g) { return h; } -},{"./graphlib":38,"./lodash":41,"./util":60}],38:[function(require,module,exports){ +},{"./graphlib":37,"./lodash":40,"./util":59}],37:[function(require,module,exports){ /* global window */ var graphlib; @@ -60480,7 +60057,7 @@ if (!graphlib) { module.exports = graphlib; -},{"graphlib":64}],39:[function(require,module,exports){ +},{"graphlib":64}],38:[function(require,module,exports){ var _ = require("./lodash"), Graph = require("./graphlib").Graph, List = require("./data/list"); @@ -60600,7 +60177,7 @@ function assignBucket(buckets, zeroIdx, entry) { } } -},{"./data/list":36,"./graphlib":38,"./lodash":41}],40:[function(require,module,exports){ +},{"./data/list":35,"./graphlib":37,"./lodash":40}],39:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -60994,7 +60571,7 @@ function canonicalize(attrs) { return newAttrs; } -},{"./acyclic":33,"./add-border-segments":34,"./coordinate-system":35,"./graphlib":38,"./lodash":41,"./nesting-graph":42,"./normalize":43,"./order":48,"./parent-dummy-chains":53,"./position":55,"./rank":57,"./util":60}],41:[function(require,module,exports){ +},{"./acyclic":32,"./add-border-segments":33,"./coordinate-system":34,"./graphlib":37,"./lodash":40,"./nesting-graph":41,"./normalize":42,"./order":47,"./parent-dummy-chains":52,"./position":54,"./rank":56,"./util":59}],40:[function(require,module,exports){ /* global window */ var lodash; @@ -61011,7 +60588,7 @@ if (!lodash) { module.exports = lodash; -},{"lodash":109}],42:[function(require,module,exports){ +},{"lodash":109}],41:[function(require,module,exports){ var _ = require("./lodash"), util = require("./util"); @@ -61145,7 +60722,7 @@ function cleanup(g) { }); } -},{"./lodash":41,"./util":60}],43:[function(require,module,exports){ +},{"./lodash":40,"./util":59}],42:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -61237,7 +60814,7 @@ function undo(g) { }); } -},{"./lodash":41,"./util":60}],44:[function(require,module,exports){ +},{"./lodash":40,"./util":59}],43:[function(require,module,exports){ var _ = require("../lodash"); module.exports = addSubgraphConstraints; @@ -61292,7 +60869,7 @@ function addSubgraphConstraints(g, cg, vs) { */ } -},{"../lodash":41}],45:[function(require,module,exports){ +},{"../lodash":40}],44:[function(require,module,exports){ var _ = require("../lodash"); module.exports = barycenter; @@ -61322,7 +60899,7 @@ function barycenter(g, movable) { } -},{"../lodash":41}],46:[function(require,module,exports){ +},{"../lodash":40}],45:[function(require,module,exports){ var _ = require("../lodash"), Graph = require("../graphlib").Graph; @@ -61397,7 +60974,7 @@ function createRootNode(g) { return v; } -},{"../graphlib":38,"../lodash":41}],47:[function(require,module,exports){ +},{"../graphlib":37,"../lodash":40}],46:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -61469,7 +61046,7 @@ function twoLayerCrossCount(g, northLayer, southLayer) { return cc; } -},{"../lodash":41}],48:[function(require,module,exports){ +},{"../lodash":40}],47:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -61550,7 +61127,7 @@ function assignOrder(g, layering) { }); } -},{"../graphlib":38,"../lodash":41,"../util":60,"./add-subgraph-constraints":44,"./build-layer-graph":46,"./cross-count":47,"./init-order":49,"./sort-subgraph":51}],49:[function(require,module,exports){ +},{"../graphlib":37,"../lodash":40,"../util":59,"./add-subgraph-constraints":43,"./build-layer-graph":45,"./cross-count":46,"./init-order":48,"./sort-subgraph":50}],48:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -61590,7 +61167,7 @@ function initOrder(g) { return layers; } -},{"../lodash":41}],50:[function(require,module,exports){ +},{"../lodash":40}],49:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -61715,7 +61292,7 @@ function mergeEntries(target, source) { source.merged = true; } -},{"../lodash":41}],51:[function(require,module,exports){ +},{"../lodash":40}],50:[function(require,module,exports){ var _ = require("../lodash"), barycenter = require("./barycenter"), resolveConflicts = require("./resolve-conflicts"), @@ -61793,7 +61370,7 @@ function mergeBarycenters(target, other) { } } -},{"../lodash":41,"./barycenter":45,"./resolve-conflicts":50,"./sort":52}],52:[function(require,module,exports){ +},{"../lodash":40,"./barycenter":44,"./resolve-conflicts":49,"./sort":51}],51:[function(require,module,exports){ var _ = require("../lodash"), util = require("../util"); @@ -61852,7 +61429,7 @@ function compareWithBias(bias) { }; } -},{"../lodash":41,"../util":60}],53:[function(require,module,exports){ +},{"../lodash":40,"../util":59}],52:[function(require,module,exports){ var _ = require("./lodash"); module.exports = parentDummyChains; @@ -61940,7 +61517,7 @@ function postorder(g) { return result; } -},{"./lodash":41}],54:[function(require,module,exports){ +},{"./lodash":40}],53:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -62361,7 +61938,7 @@ function width(g, v) { return g.node(v).width; } -},{"../graphlib":38,"../lodash":41,"../util":60}],55:[function(require,module,exports){ +},{"../graphlib":37,"../lodash":40,"../util":59}],54:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -62393,7 +61970,7 @@ function positionY(g) { } -},{"../lodash":41,"../util":60,"./bk":54}],56:[function(require,module,exports){ +},{"../lodash":40,"../util":59,"./bk":53}],55:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -62484,7 +62061,7 @@ function shiftRanks(t, g, delta) { }); } -},{"../graphlib":38,"../lodash":41,"./util":59}],57:[function(require,module,exports){ +},{"../graphlib":37,"../lodash":40,"./util":58}],56:[function(require,module,exports){ "use strict"; var rankUtil = require("./util"), @@ -62534,7 +62111,7 @@ function networkSimplexRanker(g) { networkSimplex(g); } -},{"./feasible-tree":56,"./network-simplex":58,"./util":59}],58:[function(require,module,exports){ +},{"./feasible-tree":55,"./network-simplex":57,"./util":58}],57:[function(require,module,exports){ "use strict"; var _ = require("../lodash"), @@ -62770,7 +62347,7 @@ function isDescendant(tree, vLabel, rootLabel) { return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim; } -},{"../graphlib":38,"../lodash":41,"../util":60,"./feasible-tree":56,"./util":59}],59:[function(require,module,exports){ +},{"../graphlib":37,"../lodash":40,"../util":59,"./feasible-tree":55,"./util":58}],58:[function(require,module,exports){ "use strict"; var _ = require("../lodash"); @@ -62835,7 +62412,7 @@ function slack(g, e) { return g.node(e.w).rank - g.node(e.v).rank - g.edge(e).minlen; } -},{"../lodash":41}],60:[function(require,module,exports){ +},{"../lodash":40}],59:[function(require,module,exports){ "use strict"; var _ = require("./lodash"), @@ -63073,10 +62650,10 @@ function notime(name, fn) { return fn(); } -},{"./graphlib":38,"./lodash":41}],61:[function(require,module,exports){ +},{"./graphlib":37,"./lodash":40}],60:[function(require,module,exports){ module.exports = "0.8.2"; -},{}],62:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ 'use strict' var toString = Object.prototype.toString @@ -63160,6 +62737,531 @@ function todots (string) { module.exports = dotsplit +},{}],62:[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var objectCreate = Object.create || objectCreatePolyfill +var objectKeys = Object.keys || objectKeysPolyfill +var bind = Function.prototype.bind || functionBindPolyfill + +function EventEmitter() { + if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { + this._events = objectCreate(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; + +var hasDefineProperty; +try { + var o = {}; + if (Object.defineProperty) Object.defineProperty(o, 'x', { value: 0 }); + hasDefineProperty = o.x === 0; +} catch (err) { hasDefineProperty = false } +if (hasDefineProperty) { + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + // check whether the input is a positive number (whose value is zero or + // greater and not a NaN). + if (typeof arg !== 'number' || arg < 0 || arg !== arg) + throw new TypeError('"defaultMaxListeners" must be a positive number'); + defaultMaxListeners = arg; + } + }); +} else { + EventEmitter.defaultMaxListeners = defaultMaxListeners; +} + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || isNaN(n)) + throw new TypeError('"n" argument must be a positive number'); + this._maxListeners = n; + return this; +}; + +function $getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} + +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); +}; + +// These standalone emit* functions are used to optimize calling of event +// handlers for fast cases because emit() itself often has a variable number of +// arguments and can be deoptimized because of that. These functions always have +// the same number of arguments and thus do not get deoptimized, so the code +// inside them can execute faster. +function emitNone(handler, isFn, self) { + if (isFn) + handler.call(self); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self); + } +} +function emitOne(handler, isFn, self, arg1) { + if (isFn) + handler.call(self, arg1); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1); + } +} +function emitTwo(handler, isFn, self, arg1, arg2) { + if (isFn) + handler.call(self, arg1, arg2); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2); + } +} +function emitThree(handler, isFn, self, arg1, arg2, arg3) { + if (isFn) + handler.call(self, arg1, arg2, arg3); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2, arg3); + } +} + +function emitMany(handler, isFn, self, args) { + if (isFn) + handler.apply(self, args); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].apply(self, args); + } +} + +EventEmitter.prototype.emit = function emit(type) { + var er, handler, len, args, i, events; + var doError = (type === 'error'); + + events = this._events; + if (events) + doError = (doError && events.error == null); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + if (arguments.length > 1) + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Unhandled "error" event. (' + er + ')'); + err.context = er; + throw err; + } + return false; + } + + handler = events[type]; + + if (!handler) + return false; + + var isFn = typeof handler === 'function'; + len = arguments.length; + switch (len) { + // fast cases + case 1: + emitNone(handler, isFn, this); + break; + case 2: + emitOne(handler, isFn, this, arguments[1]); + break; + case 3: + emitTwo(handler, isFn, this, arguments[1], arguments[2]); + break; + case 4: + emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); + break; + // slower + default: + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + emitMany(handler, isFn, this, args); + } + + return true; +}; + +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = target._events; + if (!events) { + events = target._events = objectCreate(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (!existing) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + } else { + // If we've already got an array, just append. + if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + } + + // Check for listener leak + if (!existing.warned) { + m = $getMaxListeners(target); + if (m && m > 0 && existing.length > m) { + existing.warned = true; + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' "' + String(type) + '" listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit.'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + if (typeof console === 'object' && console.warn) { + console.warn('%s: %s', w.name, w.message); + } + } + } + } + + return target; +} + +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + +function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + switch (arguments.length) { + case 0: + return this.listener.call(this.target); + case 1: + return this.listener.call(this.target, arguments[0]); + case 2: + return this.listener.call(this.target, arguments[0], arguments[1]); + case 3: + return this.listener.call(this.target, arguments[0], arguments[1], + arguments[2]); + default: + var args = new Array(arguments.length); + for (var i = 0; i < args.length; ++i) + args[i] = arguments[i]; + this.listener.apply(this.target, args); + } + } +} + +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = bind.call(onceWrapper, state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} + +EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.on(type, _onceWrap(this, type, listener)); + return this; +}; + +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = this._events; + if (!events) + return this; + + list = events[type]; + if (!list) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else + spliceOne(list, position); + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (!events) + return this; + + // not listening for removeListener, no need to emit + if (!events.removeListener) { + if (arguments.length === 0) { + this._events = objectCreate(null); + this._eventsCount = 0; + } else if (events[type]) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = objectKeys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = objectCreate(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + +function _listeners(target, type, unwrap) { + var events = target._events; + + if (!events) + return []; + + var evlistener = events[type]; + if (!evlistener) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +} + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } +}; + +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; + + if (events) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener) { + return evlistener.length; + } + } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; +}; + +// About 1.5x faster than the two-arg version of Array#splice(). +function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) + list[i] = list[k]; + list.pop(); +} + +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; +} + +function objectCreatePolyfill(proto) { + var F = function() {}; + F.prototype = proto; + return new F; +} +function objectKeysPolyfill(obj) { + var keys = []; + for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { + keys.push(k); + } + return k; +} +function functionBindPolyfill(context) { + var fn = this; + return function () { + return fn.apply(context, arguments); + }; +} + },{}],63:[function(require,module,exports){ 'use strict'; module.exports = function(boundThis) { @@ -64404,8 +64506,8 @@ function read(json) { } },{"./graph":79,"./lodash":82}],82:[function(require,module,exports){ -arguments[4][41][0].apply(exports,arguments) -},{"dup":41,"lodash":109}],83:[function(require,module,exports){ +arguments[4][40][0].apply(exports,arguments) +},{"dup":40,"lodash":109}],83:[function(require,module,exports){ module.exports = '2.1.5'; },{}],84:[function(require,module,exports){ @@ -64413,19 +64515,13 @@ module.exports = '2.1.5'; "use strict"; exports.__esModule = true; -exports.UNPARSEABLE_TAGS = exports.TYPEDARRAY_TAGS = exports.TOSTRING_TAGS = exports.SELF_TAGS = exports.PRIMITIVE_TAGS = exports.ITERABLE_TAGS = exports.OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_MAP = exports.OBJECT_CLASSES = exports.SVG_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = exports.HAS_UINT16ARRAY_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = exports.CIRCULAR_VALUE = void 0; +exports.UNPARSEABLE_TAGS = exports.TYPEDARRAY_TAGS = exports.TOSTRING_TAGS = exports.SELF_TAGS = exports.PRIMITIVE_TAGS = exports.ITERABLE_TAGS = exports.OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_MAP = exports.SVG_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = exports.HAS_UINT16ARRAY_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = void 0; var _SELF_TAGS, _TOSTRING_TAGS, _TYPEDARRAY_TAGS, _UNPARSEABLE_TAGS; -/** - * @constant {string} CIRCULAR_VALUE - */ -var CIRCULAR_VALUE = '~'; /** * @constant {boolean} HAS_BUFFER_FROM_SUPPORT */ - -exports.CIRCULAR_VALUE = CIRCULAR_VALUE; var HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function'; /** * @constant {boolean} HAS_UINT16ARRAY_SUPPORT @@ -64455,7 +64551,6 @@ var OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView' * @constant {Object} OBJECT_CLASS_MAP */ -exports.OBJECT_CLASSES = OBJECT_CLASSES; var OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) { objectClasses["[object " + type + "]"] = type; return objectClasses; @@ -64543,15 +64638,11 @@ hash.is = (0, _curriable.curry)(function (object, otherObject) { * @returns {boolean} are the objects equal */ -hash.is.all = (0, _curriable.curry)(function () { - for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) { - objects[_key] = arguments[_key]; - } - - var isEqual = hash.is(objects.shift()); +hash.is.all = (0, _curriable.curry)(function (objectBasis) { + var isEqual = hash.is(objectBasis); - for (var index = 0; index < objects.length; index++) { - if (!isEqual(objects[index])) { + for (var index = 1; index < arguments.length; ++index) { + if (!isEqual(arguments[index])) { return false; } } @@ -64568,15 +64659,11 @@ hash.is.all = (0, _curriable.curry)(function () { * @returns {boolean} are the objects equal */ -hash.is.any = (0, _curriable.curry)(function () { - for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - objects[_key2] = arguments[_key2]; - } +hash.is.any = (0, _curriable.curry)(function (objectBasis) { + var isEqual = hash.is(objectBasis); - var isEqual = hash.is(objects.shift()); - - for (var index = 0; index < objects.length; index++) { - if (isEqual(objects[index])) { + for (var index = 1; index < arguments.length; index++) { + if (isEqual(arguments[index])) { return true; } } @@ -64598,7 +64685,7 @@ hash.is.not = (0, _curriable.curry)(function (object, otherObject) { }); var _default = hash; exports.default = _default; -},{"./utils":86,"curriable":30}],86:[function(require,module,exports){ +},{"./utils":86,"curriable":29}],86:[function(require,module,exports){ (function (Buffer){(function (){ "use strict"; @@ -64609,7 +64696,7 @@ exports.getSortedEvent = getSortedEvent; exports.shouldSort = shouldSort; exports.shouldSortPair = shouldSortPair; exports.sort = sort; -exports.getSortedIterablePairs = getSortedIterablePairs; +exports.getSortedIterable = getSortedIterable; exports.getSortedObject = getSortedObject; exports.getStringifiedArrayBufferFallback = getStringifiedArrayBufferFallback; exports.getStringifiedArrayBufferModern = getStringifiedArrayBufferModern; @@ -64623,10 +64710,7 @@ exports.getStringifiedArrayBuffer = void 0; var _constants = require("./constants"); -// external dependencies -// constants -var SEPARATOR = '|'; -var charCodeAt = String.prototype.charCodeAt; +var FUNCTION_NAME_REGEX = /^\s*function\s*([^(]*)/i; var toString = Object.prototype.toString; var keys = Object.keys; /** @@ -64640,7 +64724,7 @@ var keys = Object.keys; */ function getFunctionName(fn) { - return fn.name || (fn.toString().match(/^\s*function\s*([^\(]*)/i) || [])[1] || 'anonymous'; + return fn.name || (fn.toString().match(FUNCTION_NAME_REGEX) || [])[1] || 'anonymous'; } /** * @function getIntegerHashValue @@ -64662,7 +64746,7 @@ function getIntegerHashValue(string) { charCode; while (index--) { - charCode = charCodeAt.call(string, index); + charCode = string.charCodeAt(index); hashA = hashA * 33 ^ charCode; hashB = hashB * 33 ^ charCode; } @@ -64733,7 +64817,7 @@ function shouldSort(valueA, valueB) { function shouldSortPair(pairA, pairB) { - return shouldSort(pairA[0], pairB[0]); + return pairA[0] > pairB[0]; } /** * @function sort @@ -64750,10 +64834,10 @@ function shouldSortPair(pairA, pairB) { function sort(array, fn) { var subIndex, value; - for (var index = 0; index < array.length; index++) { + for (var index = 0; index < array.length; ++index) { value = array[index]; - for (subIndex = index - 1; ~subIndex && fn(array[subIndex], value); subIndex--) { + for (subIndex = index - 1; ~subIndex && fn(array[subIndex], value); --subIndex) { array[subIndex + 1] = array[subIndex]; } @@ -64773,35 +64857,33 @@ function sort(array, fn) { */ -function getSortedIterablePairs(iterable, cache, keys) { +function getSortedIterable(iterable, cache, keys) { var isMap = typeof iterable.get === 'function'; - var pairs = []; + var entries = []; if (isMap) { iterable.forEach(function (value, key) { - // eslint-disable-next-line no-use-before-define - pairs.push([stringify(key, cache, keys), stringify(value, cache, keys)]); + entries.push([// eslint-disable-next-line no-use-before-define + stringify(key, cache, keys), // eslint-disable-next-line no-use-before-define + stringify(value, cache, keys)]); }); + sort(entries, shouldSortPair); } else { iterable.forEach(function (value) { // eslint-disable-next-line no-use-before-define - pairs.push([stringify(value, cache, keys)]); + entries.push(stringify(value, cache, keys)); }); + sort(entries, shouldSort); } - sort(pairs, shouldSortPair); - var length = pairs.length; - var lastIndex = length - 1; - var _final = '['; - var pair; + var _final = getFunctionName(iterable.constructor) + "|["; - for (var index = 0; index < length; index++) { - pair = pairs[index]; - _final += isMap ? '[' + pair[0] + ',' + pair[1] + ']' : pair[0]; - _final += index === lastIndex ? ']' : ','; + for (var index = 0, length = entries.length, entry; index < length; ++index) { + entry = entries[index]; + _final += "" + (index ? ',' : '') + (isMap ? "[" + entry[0] + "," + entry[1] + "]" : entry); } - return getFunctionName(iterable.constructor) + SEPARATOR + _final; + return _final + "]"; } /** * @function getSortedObject @@ -64819,7 +64901,7 @@ function getSortedObject(object) { var newObject = {}; var key; - for (var index = 0; index < objectKeys.length; index++) { + for (var index = 0; index < objectKeys.length; ++index) { key = objectKeys[index]; newObject[key] = object[key]; } @@ -64906,7 +64988,7 @@ function getStringifiedDocumentFragment(fragment) { var children = fragment.children; var innerHTML = ''; - for (var index = 0; index < children.length; index++) { + for (var index = 0; index < children.length; ++index) { innerHTML += children[index].outerHTML; } @@ -64926,7 +65008,7 @@ function getStringifiedDocumentFragment(fragment) { function getCutoffIndex(array, value) { - for (var index = 0; index < array.length; index++) { + for (var index = 0; index < array.length; ++index) { if (array[index] === value) { return index + 1; } @@ -64952,11 +65034,11 @@ function getNormalizedValue(value, cache, keys, passedTag) { var type = typeof value; if (type === 'string' || _constants.PRIMITIVE_TAGS[type]) { - return type + SEPARATOR + value; + return type + "|" + value; } if (value === null) { - return 'null' + SEPARATOR + value; + return "null|" + value; } } @@ -64971,19 +65053,19 @@ function getNormalizedValue(value, cache, keys, passedTag) { } if (_constants.TOSTRING_TAGS[tag]) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.toString(); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.toString(); } if (_constants.ITERABLE_TAGS[tag]) { - return getSortedIterablePairs(value, cache, keys); + return getSortedIterable(value, cache, keys); } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DATE) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.getTime(); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.getTime(); } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.ERROR) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.stack; + return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.stack; } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.EVENT) { @@ -64991,27 +65073,27 @@ function getNormalizedValue(value, cache, keys, passedTag) { } if (_constants.UNPARSEABLE_TAGS[tag]) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + 'NOT_ENUMERABLE'; + return _constants.OBJECT_CLASS_MAP[tag] + "|NOT_ENUMERABLE"; } if (_constants.HTML_ELEMENT_REGEXP.test(tag) || _constants.SVG_ELEMENT_REGEXP.test(tag)) { - return tag.slice(8, -1) + SEPARATOR + value.outerHTML; + return tag.slice(8, -1) + "|" + value.outerHTML; } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DOCUMENTFRAGMENT) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedDocumentFragment(value); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedDocumentFragment(value); } if (_constants.TYPEDARRAY_TAGS[tag]) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + value.join(','); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + value.join(','); } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.ARRAYBUFFER) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedArrayBuffer(value); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedArrayBuffer(value); } if (tag === _constants.OBJECT_CLASS_TYPE_MAP.DATAVIEW) { - return _constants.OBJECT_CLASS_MAP[tag] + SEPARATOR + getStringifiedArrayBuffer(value.buffer); + return _constants.OBJECT_CLASS_MAP[tag] + "|" + getStringifiedArrayBuffer(value.buffer); } return value; @@ -65052,8 +65134,7 @@ function createReplacer(cache, keys) { var valueCutoff = getCutoffIndex(cache, value); if (valueCutoff !== 0) { - var ref = keys.slice(0, valueCutoff).join('.') || '.'; - return "[~" + ref + "]"; + return "[~" + (keys.slice(0, valueCutoff).join('.') || '.') + "]"; } cache.push(value); @@ -65098,10 +65179,10 @@ function stringify(value, cache, keys) { },{"./constants":84,"buffer":27}],87:[function(require,module,exports){ /*! - * hotkeys-js v3.8.1 + * hotkeys-js v3.8.3 * A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies. * - * Copyright (c) 2020 kenny wong + * Copyright (c) 2021 kenny wong * http://jaywcjlove.github.io/hotkeys * * Licensed under the MIT license. @@ -65168,7 +65249,7 @@ var _keyMap = { tab: 9, clear: 12, enter: 13, - return: 13, + "return": 13, esc: 27, escape: 27, space: 32, @@ -65177,7 +65258,7 @@ var _keyMap = { right: 39, down: 40, del: 46, - delete: 46, + "delete": 46, ins: 45, insert: 45, home: 36, @@ -65185,6 +65266,22 @@ var _keyMap = { pageup: 33, pagedown: 34, capslock: 20, + num_0: 96, + num_1: 97, + num_2: 98, + num_3: 99, + num_4: 100, + num_5: 101, + num_6: 102, + num_7: 103, + num_8: 104, + num_9: 105, + num_multiply: 106, + num_add: 107, + num_enter: 108, + num_subtract: 109, + num_decimal: 110, + num_divide: 111, '⇪': 20, ',': 188, '.': 190, @@ -65657,8 +65754,8 @@ if (typeof window !== 'undefined') { module.exports = hotkeys; },{}],88:[function(require,module,exports){ -/*! hotkeys-js v3.8.1 | MIT (c) 2020 kenny wong | http://jaywcjlove.github.io/hotkeys */ -"use strict";var isff="undefined"!=typeof navigator&&0 | http://jaywcjlove.github.io/hotkeys */ +"use strict";var isff="undefined"!=typeof navigator&&0 */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -65825,7 +65923,7 @@ if("object"==typeof exports)var graphlib=require("graphlib"),dagre=require("dagr })); -},{"backbone":11,"dagre":32,"graphlib":64,"jquery":92,"lodash":93}],92:[function(require,module,exports){ +},{"backbone":11,"dagre":31,"graphlib":64,"jquery":92,"lodash":93}],92:[function(require,module,exports){ /*! * jQuery JavaScript Library v3.3.1 * https://jquery.com/ @@ -93305,17 +93403,17 @@ return jQuery; },{}],94:[function(require,module,exports){ /*! - * jQuery JavaScript Library v3.5.1 + * jQuery JavaScript Library v3.6.0 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * - * Copyright JS Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * - * Date: 2020-05-04T22:49Z + * Date: 2021-03-02T17:08Z */ ( function( global, factory ) { @@ -93382,12 +93480,16 @@ var support = {}; var isFunction = function isFunction( obj ) { - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 + // Plus for old WebKit, typeof returns "function" for HTML collections + // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) + return typeof obj === "function" && typeof obj.nodeType !== "number" && + typeof obj.item !== "function"; + }; var isWindow = function isWindow( obj ) { @@ -93453,7 +93555,7 @@ function toType( obj ) { var - version = "3.5.1", + version = "3.6.0", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -93707,7 +93809,7 @@ jQuery.extend( { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? - [ arr ] : arr + [ arr ] : arr ); } else { push.call( ret, arr ); @@ -93802,9 +93904,9 @@ if ( typeof Symbol === "function" ) { // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( _i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); + function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + } ); function isArrayLike( obj ) { @@ -93824,14 +93926,14 @@ function isArrayLike( obj ) { } var Sizzle = /*! - * Sizzle CSS Selector Engine v2.3.5 + * Sizzle CSS Selector Engine v2.3.6 * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://js.foundation/ * - * Date: 2020-03-14 + * Date: 2021-02-16 */ ( function( window ) { var i, @@ -94414,8 +94516,8 @@ support = Sizzle.support = {}; * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { - var namespace = elem.namespaceURI, - docElem = ( elem.ownerDocument || elem ).documentElement; + var namespace = elem && elem.namespaceURI, + docElem = elem && ( elem.ownerDocument || elem ).documentElement; // Support: IE <=8 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes @@ -96330,9 +96432,9 @@ var rneedsContext = jQuery.expr.match.needsContext; function nodeName( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); -}; +} var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); @@ -97303,8 +97405,8 @@ jQuery.extend( { resolveContexts = Array( i ), resolveValues = slice.call( arguments ), - // the master Deferred - master = jQuery.Deferred(), + // the primary Deferred + primary = jQuery.Deferred(), // subordinate callback factory updateFunc = function( i ) { @@ -97312,30 +97414,30 @@ jQuery.extend( { resolveContexts[ i ] = this; resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( !( --remaining ) ) { - master.resolveWith( resolveContexts, resolveValues ); + primary.resolveWith( resolveContexts, resolveValues ); } }; }; // Single- and empty arguments are adopted like Promise.resolve if ( remaining <= 1 ) { - adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, !remaining ); // Use .then() to unwrap secondary thenables (cf. gh-3000) - if ( master.state() === "pending" || + if ( primary.state() === "pending" || isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { - return master.then(); + return primary.then(); } } // Multiple arguments are aggregated like Promise.all array elements while ( i-- ) { - adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); } - return master.promise(); + return primary.promise(); } } ); @@ -97486,8 +97588,8 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { for ( ; i < len; i++ ) { fn( elems[ i ], key, raw ? - value : - value.call( elems[ i ], i, fn( elems[ i ], key ) ) + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } @@ -98395,10 +98497,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) { } -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; +var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; @@ -98693,8 +98792,8 @@ jQuery.event = { event = jQuery.event.fix( nativeEvent ), handlers = ( - dataPriv.get( this, "events" ) || Object.create( null ) - )[ event.type ] || [], + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event @@ -98818,12 +98917,12 @@ jQuery.event = { get: isFunction( hook ) ? function() { if ( this.originalEvent ) { - return hook( this.originalEvent ); + return hook( this.originalEvent ); } } : function() { if ( this.originalEvent ) { - return this.originalEvent[ name ]; + return this.originalEvent[ name ]; } }, @@ -98962,7 +99061,13 @@ function leverageNative( el, type, expectSync ) { // Cancel the outer synthetic event event.stopImmediatePropagation(); event.preventDefault(); - return result.value; + + // Support: Chrome 86+ + // In Chrome, if an element having a focusout handler is blurred by + // clicking outside of it, it invokes the handler synchronously. If + // that handler calls `.remove()` on the element, the data is cleared, + // leaving `result` undefined. We need to guard against this. + return result && result.value; } // If this is an inner synthetic event for an event with a bubbling surrogate @@ -99127,34 +99232,7 @@ jQuery.each( { targetTouches: true, toElement: true, touches: true, - - which: function( event ) { - var button = event.button; - - // Add which for key events - if ( event.which == null && rkeyEvent.test( event.type ) ) { - return event.charCode != null ? event.charCode : event.keyCode; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { - if ( button & 1 ) { - return 1; - } - - if ( button & 2 ) { - return 3; - } - - if ( button & 4 ) { - return 2; - } - - return 0; - } - - return event.which; - } + which: true }, jQuery.event.addProp ); jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { @@ -99180,6 +99258,12 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp return true; }, + // Suppress native focus or blur as it's already being fired + // in leverageNative. + _default: function() { + return true; + }, + delegateType: delegateType }; } ); @@ -99847,6 +99931,10 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); // set in CSS while `offset*` properties report correct values. // Behavior in IE 9 is more subtle than in newer versions & it passes // some versions of this test; make sure not to make it pass there! + // + // Support: Firefox 70+ + // Only Firefox includes border widths + // in computed dimensions. (gh-4529) reliableTrDimensions: function() { var table, tr, trChild, trStyle; if ( reliableTrDimensionsVal == null ) { @@ -99854,17 +99942,32 @@ var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); tr = document.createElement( "tr" ); trChild = document.createElement( "div" ); - table.style.cssText = "position:absolute;left:-11111px"; + table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; + tr.style.cssText = "border:1px solid"; + + // Support: Chrome 86+ + // Height set through cssText does not get applied. + // Computed height then comes back as 0. tr.style.height = "1px"; trChild.style.height = "9px"; + // Support: Android 8 Chrome 86+ + // In our bodyBackground.html iframe, + // display for all div elements is set to "inline", + // which causes a problem only in Android 8 Chrome 86. + // Ensuring the div is display: block + // gets around this issue. + trChild.style.display = "block"; + documentElement .appendChild( table ) .appendChild( tr ) .appendChild( trChild ); trStyle = window.getComputedStyle( tr ); - reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + + parseInt( trStyle.borderTopWidth, 10 ) + + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; documentElement.removeChild( table ); } @@ -100328,10 +100431,10 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) { // Running getBoundingClientRect on a disconnected node // in IE throws an error. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? - swap( elem, cssShow, function() { - return getWidthOrHeight( elem, dimension, extra ); - } ) : - getWidthOrHeight( elem, dimension, extra ); + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); } }, @@ -100390,7 +100493,7 @@ jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) - ) + "px"; + ) + "px"; } } ); @@ -100529,7 +100632,7 @@ Tween.propHooks = { if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( - jQuery.cssHooks[ tween.prop ] || + jQuery.cssHooks[ tween.prop ] || tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { @@ -100774,7 +100877,7 @@ function defaultPrefilter( elem, props, opts ) { anim.done( function() { - /* eslint-enable no-loop-func */ + /* eslint-enable no-loop-func */ // The final step of a "hide" animation is actually hiding the element if ( !hidden ) { @@ -100894,7 +100997,7 @@ function Animation( elem, properties, options ) { tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, - animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, @@ -101067,7 +101170,8 @@ jQuery.fn.extend( { anim.stop( true ); } }; - doAnimation.finish = doAnimation; + + doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : @@ -101707,8 +101811,8 @@ jQuery.fn.extend( { if ( this.setAttribute ) { this.setAttribute( "class", className || value === false ? - "" : - dataPriv.get( this, "__className__" ) || "" + "" : + dataPriv.get( this, "__className__" ) || "" ); } } @@ -101723,7 +101827,7 @@ jQuery.fn.extend( { while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { - return true; + return true; } } @@ -102013,9 +102117,7 @@ jQuery.extend( jQuery.event, { special.bindType || type; // jQuery handler - handle = ( - dataPriv.get( cur, "events" ) || Object.create( null ) - )[ event.type ] && + handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && dataPriv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); @@ -102162,7 +102264,7 @@ var rquery = ( /\?/ ); // Cross-browser xml parsing jQuery.parseXML = function( data ) { - var xml; + var xml, parserErrorElem; if ( !data || typeof data !== "string" ) { return null; } @@ -102171,12 +102273,17 @@ jQuery.parseXML = function( data ) { // IE throws on parseFromString with invalid input. try { xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); - } catch ( e ) { - xml = undefined; - } + } catch ( e ) {} - if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); + parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; + if ( !xml || parserErrorElem ) { + jQuery.error( "Invalid XML: " + ( + parserErrorElem ? + jQuery.map( parserErrorElem.childNodes, function( el ) { + return el.textContent; + } ).join( "\n" ) : + data + ) ); } return xml; }; @@ -102277,16 +102384,14 @@ jQuery.fn.extend( { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; - } ) - .filter( function() { + } ).filter( function() { var type = this.type; // Use .is( ":disabled" ) so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); - } ) - .map( function( _i, elem ) { + } ).map( function( _i, elem ) { var val = jQuery( this ).val(); if ( val == null ) { @@ -102339,7 +102444,8 @@ var // Anchor tag for parsing the document origin originAnchor = document.createElement( "a" ); - originAnchor.href = location.href; + +originAnchor.href = location.href; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { @@ -102720,8 +102826,8 @@ jQuery.extend( { // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? - jQuery( callbackContext ) : - jQuery.event, + jQuery( callbackContext ) : + jQuery.event, // Deferreds deferred = jQuery.Deferred(), @@ -103033,8 +103139,10 @@ jQuery.extend( { response = ajaxHandleResponses( s, jqXHR, responses ); } - // Use a noop converter for missing script - if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + // Use a noop converter for missing script but not if jsonp + if ( !isSuccess && + jQuery.inArray( "script", s.dataTypes ) > -1 && + jQuery.inArray( "json", s.dataTypes ) < 0 ) { s.converters[ "text script" ] = function() {}; } @@ -103772,12 +103880,6 @@ jQuery.offset = { options.using.call( elem, props ); } else { - if ( typeof props.top === "number" ) { - props.top += "px"; - } - if ( typeof props.left === "number" ) { - props.left += "px"; - } curElem.css( props ); } } @@ -103946,8 +104048,11 @@ jQuery.each( [ "top", "left" ], function( _i, prop ) { // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { - jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, - function( defaultExtra, funcName ) { + jQuery.each( { + padding: "inner" + name, + content: type, + "": "outer" + name + }, function( defaultExtra, funcName ) { // Margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { @@ -104032,7 +104137,8 @@ jQuery.fn.extend( { } } ); -jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + +jQuery.each( + ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), function( _i, name ) { @@ -104043,7 +104149,8 @@ jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + this.on( name, null, data, fn ) : this.trigger( name ); }; - } ); + } +); @@ -104352,7 +104459,7 @@ var Almanac = function () { }(); exports.default = Almanac; -},{"./debug":97,"./errors":101,"./fact":102,"lodash.isobjectlike":108,"selectn":136}],96:[function(require,module,exports){ +},{"./debug":97,"./errors":101,"./fact":102,"lodash.isobjectlike":108,"selectn":135}],96:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -104554,7 +104661,7 @@ function debug(message) { } }).call(this)}).call(this,require('_process')) -},{"_process":135}],98:[function(require,module,exports){ +},{"_process":134}],98:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -104953,7 +105060,7 @@ var Engine = function (_EventEmitter) { }(_events.EventEmitter); exports.default = Engine; -},{"./almanac":95,"./debug":97,"./engine-default-operators":98,"./engine-facts":99,"./fact":102,"./operator":105,"./rule":107,"events":28}],101:[function(require,module,exports){ +},{"./almanac":95,"./debug":97,"./engine-default-operators":98,"./engine-facts":99,"./fact":102,"./operator":105,"./rule":107,"events":62}],101:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -105264,7 +105371,7 @@ var RuleResult = function () { }(); exports.default = RuleResult; -},{"clone":29}],107:[function(require,module,exports){ +},{"clone":28}],107:[function(require,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -105621,7 +105728,7 @@ var Rule = function (_EventEmitter) { }(_events.EventEmitter); exports.default = Rule; -},{"./condition":96,"./debug":97,"./rule-result":106,"events":28}],108:[function(require,module,exports){ +},{"./condition":96,"./debug":97,"./rule-result":106,"events":62}],108:[function(require,module,exports){ /** * lodash 4.0.0 (Custom Build) * Build: `lodash modularize exports="npm" -o ./` @@ -105676,14 +105783,15 @@ module.exports = isObjectLike; var undefined; /** Used as the semantic version number. */ - var VERSION = '4.17.20'; + var VERSION = '4.17.21'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function'; + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -105816,10 +105924,11 @@ module.exports = isObjectLike; var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); - /** Used to match leading and trailing whitespace. */ - var reTrim = /^\s+|\s+$/g, - reTrimStart = /^\s+/, - reTrimEnd = /\s+$/; + /** Used to match leading whitespace. */ + var reTrimStart = /^\s+/; + + /** Used to match a single whitespace character. */ + var reWhitespace = /\s/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, @@ -105829,6 +105938,18 @@ module.exports = isObjectLike; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + /** + * Used to validate the `validate` option in `_.template` variable. + * + * Forbids characters which could potentially change the meaning of the function argument definition: + * - "()," (modification of function parameters) + * - "=" (default value) + * - "[]{}" (destructuring of function parameters) + * - "/" (beginning of a comment) + * - whitespace + */ + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; @@ -106657,6 +106778,19 @@ module.exports = isObjectLike; }); } + /** + * The base implementation of `_.trim`. + * + * @private + * @param {string} string The string to trim. + * @returns {string} Returns the trimmed string. + */ + function baseTrim(string) { + return string + ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') + : string; + } + /** * The base implementation of `_.unary` without support for storing metadata. * @@ -106990,6 +107124,21 @@ module.exports = isObjectLike; : asciiToArray(string); } + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace + * character of `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the index of the last non-whitespace character. + */ + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + return index; + } + /** * Used by `_.unescape` to convert HTML entities to characters. * @@ -118158,7 +118307,7 @@ module.exports = isObjectLike; if (typeof value != 'string') { return value === 0 ? value : +value; } - value = value.replace(reTrim, ''); + value = baseTrim(value); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) @@ -120530,6 +120679,12 @@ module.exports = isObjectLike; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } + // Throw an error if a forbidden character was found in `variable`, to prevent + // potential command injection attacks. + else if (reForbiddenIdentifierChars.test(variable)) { + throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); + } + // Cleanup code by stripping empty strings. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) .replace(reEmptyStringMiddle, '$1') @@ -120643,7 +120798,7 @@ module.exports = isObjectLike; function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { - return string.replace(reTrim, ''); + return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; @@ -120678,7 +120833,7 @@ module.exports = isObjectLike; function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { - return string.replace(reTrimEnd, ''); + return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; @@ -122827,160 +122982,6 @@ module.exports = isObjectLike; }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],110:[function(require,module,exports){ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd'; - } - if (ms >= h) { - return Math.round(ms / h) + 'h'; - } - if (ms >= m) { - return Math.round(ms / m) + 'm'; - } - if (ms >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) { - return; - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name; - } - return Math.ceil(ms / n) + ' ' + name + 's'; -} - -},{}],111:[function(require,module,exports){ /** * @license AngularJS v1.7.9 * (c) 2010-2018 Google, Inc. http://angularjs.org @@ -124248,9 +124249,9 @@ function ngViewFillContentFactory($compile, $controller, $route) { })(window, window.angular); -},{}],112:[function(require,module,exports){ +},{}],111:[function(require,module,exports){ arguments[4][4][0].apply(exports,arguments) -},{"./angular-route":111,"dup":4}],113:[function(require,module,exports){ +},{"./angular-route":110,"dup":4}],112:[function(require,module,exports){ 'use strict'; var commonConfig = function () { @@ -124296,14 +124297,14 @@ var common = function ($q, $rootScope, commonConfig, logger) { }; module.exports = {commonModule: common, commonConfig: commonConfig}; -},{}],114:[function(require,module,exports){ +},{}],113:[function(require,module,exports){ 'use strict'; var commonModule = angular.module('common', []); commonModule.provider('commonConfig', [require('./common').commonConfig]); commonModule.factory('common', ['$q', '$rootScope', 'commonConfig', 'logger', require('./common').commonModule]); commonModule.factory('logger', ['$log', require('./logger')]); -},{"./common":113,"./logger":115}],115:[function(require,module,exports){ +},{"./common":112,"./logger":114}],114:[function(require,module,exports){ 'use strict'; var toastr = require('toastr'); @@ -124373,7 +124374,7 @@ function logger($log) { } module.exports = logger; -},{"toastr":139}],116:[function(require,module,exports){ +},{"toastr":139}],115:[function(require,module,exports){ 'use strict'; var core = angular.module('owasp-threat-dragon-core'); @@ -124408,7 +124409,7 @@ core.config(['$logProvider', function ($logProvider) { core.config(['commonConfigProvider', function (cfg) { cfg.config.controllerActivateSuccessEvent = config.events.controllerActivateSuccess; }]); -},{"toastr":139}],117:[function(require,module,exports){ +},{"toastr":139}],116:[function(require,module,exports){ 'use strict'; var _ = require('lodash'); @@ -124909,7 +124910,7 @@ function diagram($scope, $document, $location, $routeParams, $timeout, dialogs, module.exports = diagram; -},{"lodash":109}],118:[function(require,module,exports){ +},{"lodash":109}],117:[function(require,module,exports){ 'use strict'; var $ = require('jquery'); @@ -125169,7 +125170,7 @@ var diagram = function (common, diagramming) { module.exports = { stencil: stencil, diagram: diagram }; -},{"jquery":94}],119:[function(require,module,exports){ +},{"jquery":94}],118:[function(require,module,exports){ 'use strict'; var $ = require('jquery'); @@ -125360,7 +125361,7 @@ module.exports = { elementThreats: elementThreats }; -},{"jquery":94}],120:[function(require,module,exports){ +},{"jquery":94}],119:[function(require,module,exports){ 'use strict'; var core = angular.module('owasp-threat-dragon-core'); @@ -125374,7 +125375,7 @@ core.directive('tmtElementProperties', [elementPropertyDirectives.elementPropert core.directive('tmtElementThreats', ['$routeParams', '$location', 'common', 'dialogs', elementPropertyDirectives.elementThreats]); core.controller('diagram', ['$scope', '$document', '$location', '$routeParams', '$timeout', 'dialogs', 'common', 'datacontext', 'threatengine', 'diagramming', 'threatmodellocator', 'hotkeys', diagram]); -},{"./diagram":117,"./diagramdirectives":118,"./elementpropdirectives":119}],121:[function(require,module,exports){ +},{"./diagram":116,"./diagramdirectives":117,"./elementpropdirectives":118}],120:[function(require,module,exports){ 'use strict'; window.jQuery = require('jquery'); require('bootstrap'); @@ -125389,7 +125390,7 @@ require('./services'); require('./diagrams'); require('./layout'); require('./threatmodels'); -},{"./common":114,"./config":116,"./diagrams":120,"./layout":123,"./services":127,"./services/joint.shapes.tm":128,"./templates":131,"./threatmodels":132,"angular-route":112,"angular-ui-bootstrap":6,"bootstrap":13,"jquery":94}],122:[function(require,module,exports){ +},{"./common":113,"./config":115,"./diagrams":119,"./layout":122,"./services":126,"./services/joint.shapes.tm":127,"./templates":130,"./threatmodels":131,"angular-route":111,"angular-ui-bootstrap":6,"bootstrap":13,"jquery":94}],121:[function(require,module,exports){ 'use strict'; var pager = function() { @@ -125417,11 +125418,11 @@ var pager = function() { }; module.exports = pager; -},{}],123:[function(require,module,exports){ +},{}],122:[function(require,module,exports){ var core = angular.module('owasp-threat-dragon-core'); var directives = require('./directives'); core.directive('tmtPager', [directives]); -},{"./directives":122}],124:[function(require,module,exports){ +},{"./directives":121}],123:[function(require,module,exports){ 'use strict'; var joint = require('jointjs'); @@ -125592,7 +125593,7 @@ function diagramming() { module.exports = diagramming; -},{"jointjs":91}],125:[function(require,module,exports){ +},{"jointjs":91}],124:[function(require,module,exports){ 'use strict'; var _ = require('lodash'); @@ -125640,7 +125641,7 @@ function confirmController($scope, $uibModalInstance, ok, cancel, parameter) { } module.exports = controllers; -},{"lodash":109}],126:[function(require,module,exports){ +},{"lodash":109}],125:[function(require,module,exports){ 'use strict'; function dialogs($location, $modal) { @@ -125698,7 +125699,7 @@ function dialogs($location, $modal) { } module.exports = dialogs; -},{}],127:[function(require,module,exports){ +},{}],126:[function(require,module,exports){ var core = angular.module('owasp-threat-dragon-core'); require('angular-ui-bootstrap'); core.factory('routemediator', ['$rootScope', '$location', 'config', 'logger', require('./routemediator')]); @@ -125709,7 +125710,7 @@ core.factory('dialogs', ['$location', '$uibModal', require('./dialogs')]); core.factory('diagramming', [require('./diagramming')]); core.value('hotkeys', require('hotkeys-js')); -},{"./diagramming":124,"./dialogControllers":125,"./dialogs":126,"./routemediator":129,"./threatengine":130,"angular-ui-bootstrap":6,"hotkeys-js":89}],128:[function(require,module,exports){ +},{"./diagramming":123,"./dialogControllers":124,"./dialogs":125,"./routemediator":128,"./threatengine":129,"angular-ui-bootstrap":6,"hotkeys-js":89}],127:[function(require,module,exports){ 'use strict'; var joint = require('jointjs'); @@ -126117,7 +126118,7 @@ if (typeof exports === 'object') { module.exports = joint.shapes.tm; } -},{"jointjs":91}],129:[function(require,module,exports){ +},{"jointjs":91}],128:[function(require,module,exports){ 'use strict'; function routemediator($rootScope, $location, config, logger) { @@ -126161,7 +126162,7 @@ function routemediator($rootScope, $location, config, logger) { } module.exports = routemediator; -},{}],130:[function(require,module,exports){ +},{}],129:[function(require,module,exports){ 'use strict'; var Engine = require('json-rules-engine').Engine; @@ -126854,7 +126855,7 @@ function threatengine() { module.exports = threatengine; -},{"json-rules-engine":103}],131:[function(require,module,exports){ +},{"json-rules-engine":103}],130:[function(require,module,exports){ angular.module('templates', []) .run(['$templateCache', function($templateCache) { $templateCache.put('diagrams/CiaEditPane.html', @@ -127841,7 +127842,7 @@ angular.module('templates', []) }]); -},{}],132:[function(require,module,exports){ +},{}],131:[function(require,module,exports){ 'use strict'; var core = angular.module('owasp-threat-dragon-core'); @@ -127850,7 +127851,7 @@ var threatModelDirectives = require('./threatmodeldirectives'); core.directive('tmtThreatModelReport', ['$location', '$routeParams', 'threatmodellocator', 'diagramming', threatModelDirectives.threatModelReport]); core.controller('threatmodel', ['$scope', '$location', '$routeParams', 'dialogs', 'common', 'datacontext', 'threatmodellocator', threatmodel]); -},{"./threatmodel":133,"./threatmodeldirectives":134}],133:[function(require,module,exports){ +},{"./threatmodel":132,"./threatmodeldirectives":133}],132:[function(require,module,exports){ 'use strict'; var _ = require('lodash'); @@ -128093,7 +128094,7 @@ function threatModel($scope, $location, $routeParams, dialogs, common, dataconte module.exports = threatModel; -},{"lodash":109}],134:[function(require,module,exports){ +},{"lodash":109}],133:[function(require,module,exports){ 'use strict'; var _ = require('lodash'); @@ -128202,7 +128203,7 @@ module.exports = { threatModelReport: threatModelReport }; -},{"lodash":109}],135:[function(require,module,exports){ +},{"lodash":109}],134:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -128388,7 +128389,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],136:[function(require,module,exports){ +},{}],135:[function(require,module,exports){ 'use strict' var curry2 = require('curry2') @@ -128434,7 +128435,7 @@ function selectn (path, object) { return typeof ref === 'function' ? ref() : ref } -},{"brackets2dots":26,"curry2":31,"debug":137,"dotsplit.js":62}],137:[function(require,module,exports){ +},{"brackets2dots":26,"curry2":30,"debug":136,"dotsplit.js":61}],136:[function(require,module,exports){ (function (process){(function (){ /** * This is the web browser implementation of `debug()`. @@ -128624,7 +128625,7 @@ function localstorage() { }).call(this)}).call(this,require('_process')) -},{"./debug":138,"_process":135}],138:[function(require,module,exports){ +},{"./debug":137,"_process":134}],137:[function(require,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -128828,7 +128829,161 @@ function coerce(val) { return val; } -},{"ms":110}],139:[function(require,module,exports){ +},{"ms":138}],138:[function(require,module,exports){ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isNaN(val) === false) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + if (ms >= d) { + return Math.round(ms / d) + 'd'; + } + if (ms >= h) { + return Math.round(ms / h) + 'h'; + } + if (ms >= m) { + return Math.round(ms / m) + 'm'; + } + if (ms >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + return plural(ms, d, 'day') || + plural(ms, h, 'hour') || + plural(ms, m, 'minute') || + plural(ms, s, 'second') || + ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) { + return; + } + if (ms < n * 1.5) { + return Math.floor(ms / n) + ' ' + name; + } + return Math.ceil(ms / n) + ' ' + name + 's'; +} + +},{}],139:[function(require,module,exports){ /* * Toastr * Copyright 2012-2015 @@ -130906,7 +131061,7 @@ app.run(['editableOptions', function (editableOptions) { editableOptions.theme = 'bs3'; }]); -},{"./config.route":142,"./layout":143,"./services":146,"./threatmodels":149,"./welcome":151,"angular":10,"angular-animate":2,"angular-route":4,"angular-ui-bootstrap":6,"angular-xeditable":8,"jquery":94,"owasp-threat-dragon-core":121}],142:[function(require,module,exports){ +},{"./config.route":142,"./layout":143,"./services":146,"./threatmodels":149,"./welcome":151,"angular":10,"angular-animate":2,"angular-route":4,"angular-ui-bootstrap":6,"angular-xeditable":8,"jquery":94,"owasp-threat-dragon-core":120}],142:[function(require,module,exports){ 'use strict'; var app = require('angular').module('app'); @@ -131532,4 +131687,4 @@ function welcome($location, common, commonConfig) { module.exports = welcome; },{}]},{},[141]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1hbmltYXRlL2FuZ3VsYXItYW5pbWF0ZS5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLWFuaW1hdGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1yb3V0ZS9hbmd1bGFyLXJvdXRlLmpzIiwibm9kZV9tb2R1bGVzL2FuZ3VsYXItcm91dGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci11aS1ib290c3RyYXAvZGlzdC91aS1ib290c3RyYXAtdHBscy5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXVpLWJvb3RzdHJhcC9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXhlZGl0YWJsZS9kaXN0L2pzL3hlZGl0YWJsZS5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXhlZGl0YWJsZS9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyL2FuZ3VsYXIuanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9iYWNrYm9uZS9iYWNrYm9uZS5qcyIsIm5vZGVfbW9kdWxlcy9iYXNlNjQtanMvaW5kZXguanMiLCJub2RlX21vZHVsZ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mxvY2tpbmcoZHVyYXRpb24pIHtcbiAgICAgICAgaWYgKGZsYWdzLmJsb2NrVHJhbnNpdGlvbikge1xuICAgICAgICAgIGhlbHBlcnMuYmxvY2tUcmFuc2l0aW9ucyhub2RlLCBkdXJhdGlvbik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZmxhZ3MuYmxvY2tLZXlmcmFtZUFuaW1hdGlvbikge1xuICAgICAgICAgIGJsb2NrS2V5ZnJhbWVBbmltYXRpb25zKG5vZGUsICEhZHVyYXRpb24pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNsb3NlQW5kUmV0dXJuTm9vcEFuaW1hdG9yKCkge1xuICAgICAgICBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKHtcbiAgICAgICAgICBlbmQ6IGVuZEZuLFxuICAgICAgICAgIGNhbmNlbDogY2FuY2VsRm5cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gc2hvdWxkIGZsdXNoIHRoZSBjYWNoZSBhbmltYXRpb25cbiAgICAgICAgd2FpdFVudGlsUXVpZXQobm9vcCk7XG4gICAgICAgIGNsb3NlKCk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAkJHdpbGxBbmltYXRlOiBmYWxzZSxcbiAgICAgICAgICBzdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gcnVubmVyO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZW5kOiBlbmRGblxuICAgICAgICB9O1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBvbkFuaW1hdGlvblByb2dyZXNzKGV2ZW50KSB7XG4gICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICB2YXIgZXYgPSBldmVudC5vcmlnaW5hbEV2ZW50IHx8IGV2ZW50O1xuXG4gICAgICAgIGlmIChldi50YXJnZXQgIT09IG5vZGUpIHtcbiAgICAgICAgICAvLyBTaW5j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HR5cGVvZiBvcHRpb25zLmRlbGF5ICE9PSAnYm9vbGVhbicgJiYgdHJ1dGh5VGltaW5nVmFsdWUob3B0aW9ucy5kZWxheSlcbiAgICAgICAgICAgICAgICAgID8gcGFyc2VGbG9hdChvcHRpb25zLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZURlbGF5O1xuXG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgdGltaW5ncy5hbmltYXRpb25EZWxheSA9IHJlbGF0aXZlRGVsYXk7XG4gICAgICAgICAgICBkZWxheVN0eWxlID0gZ2V0Q3NzRGVsYXlTdHlsZShyZWxhdGl2ZURlbGF5LCB0cnVlKTtcbiAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKGRlbGF5U3R5bGUpO1xuICAgICAgICAgICAgbm9kZS5zdHlsZVtkZWxheVN0eWxlWzBdXSA9IGRlbGF5U3R5bGVbMV07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWF4RGVsYXlUaW1lID0gbWF4RGVsYXkgKiBPTkVfU0VDT05EO1xuICAgICAgICAgIG1heER1cmF0aW9uVGltZSA9IG1heER1cmF0aW9uICogT05FX1NFQ09ORDtcblxuICAgICAgICAgIGlmIChvcHRpb25zLmVhc2luZykge1xuICAgICAgICAgICAgdmFyIGVhc2VQcm9wLCBlYXNlVmFsID0gb3B0aW9ucy5lYXNpbmc7XG4gICAgICAgICAgICBpZiAoZmxhZ3MuaGFzVHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBUUkFOU0lUSU9OX1BST1AgKyBUSU1JTkdfS0VZO1xuICAgICAgICAgICAgICB0ZW1wb3JhcnlTdHlsZXMucHVzaChbZWFzZVByb3AsIGVhc2VWYWxdKTtcbiAgICAgICAgICAgICAgbm9kZS5zdHlsZVtlYXNlUHJvcF0gPSBlYXNlVmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZsYWdzLmhhc0FuaW1hdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBBTklNQVRJT05fUFJPUCArIFRJTUlOR19LRVk7XG4gICAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKFtlYXNlUHJvcCwgZWFzZVZhbF0pO1xuICAgICAgICAgICAgICBub2RlLnN0eWxlW2Vhc2VQcm9wXSA9IGVhc2VWYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uKSB7XG4gICAgICAgICAgICBldmVudHMucHVzaChUUkFOU0lUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodGltaW5ncy5hbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgZXZlbnRzLnB1c2goQU5JTUFUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgIHZhciB0aW1lclRpbWUgPSBtYXhEZWxheVRpbWUgKyBDTE9TSU5HX1RJTUVfQlVGRkVSICogbWF4RHVyYXRpb25UaW1lO1xuICAgICAgICAgIHZhciBlbmRUaW1lID0gc3RhcnRUaW1lICsgdGltZXJUaW1lO1xuXG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKSB8fCBbXTtcbiAgICAgICAgICB2YXIgc2V0dXBGYWxsYmFja1RpbWVyID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoYW5pbWF0aW9uc0RhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY3VycmVudFRpbWVyRGF0YSA9IGFuaW1hdGlvbnNEYXRhWzBdO1xuICAgICAgICAgICAgc2V0dXBGYWxsYmFja1RpbWVyID0gZW5kVGltZSA+IGN1cnJlbnRUaW1lckRhdGEuZXhwZWN0ZWRFbmRUaW1lO1xuICAgICAgICAgICAgaWYgKHNldHVwRmFsbGJhY2tUaW1lcikge1xuICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoY3VycmVudFRpbWVyRGF0YS50aW1lcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhbmltYXRpb25zRGF0YS5wdXNoKGNsb3NlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc2V0dXBGYWxsYmFja1RpbWVyKSB7XG4gICAgICAgICAgICB2YXIgdGltZXIgPSAkdGltZW91dChvbkFuaW1hdGlvbkV4cGlyZWQsIHRpbWVyVGltZSwgZmFsc2UpO1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGFbMF0gPSB7XG4gICAgICAgICAgICAgIHRpbWVyOiB0aW1lcixcbiAgICAgICAgICAgICAgZXhwZWN0ZWRFbmRUaW1lOiBlbmRUaW1lXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGEucHVzaChjbG9zZSk7XG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoQU5JTUFURV9USU1FUl9LRVksIGFuaW1hdGlvbnNEYXRhKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZXZlbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgZWxlbWVudC5vbihldmVudHMuam9pbignICcpLCBvbkFuaW1hdGlvblByb2dyZXNzKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob3B0aW9ucy50bykge1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICAgICAgICByZWdpc3RlclJlc3RvcmFibGVTdHlsZXMocmVzdG9yZVN0eWxlcywgbm9kZSwgT2JqZWN0LmtleXMob3B0aW9ucy50bykpO1xuICAgICAgICA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3IgdmljZS12ZXJzYS5cbiAgICAgIC8vIEluIGVpdGhlciBjYXNlIHdlIHNob3VsZCBhbGxvdyB0aGlzIGFuZCBub3QgYXNzdW1lIHRoZVxuICAgICAgLy8gYW5pbWF0aW9uIGlzIG92ZXIgdW5sZXNzIGJvdGggYW5pbWF0aW9ucyBhcmUgbm90IHVzZWQuXG4gICAgICBpZiAoIWFuaW1hdG9yT3V0KSB7XG4gICAgICAgIGFuaW1hdG9ySW4gPSBwcmVwYXJlSW5BbmltYXRpb24oKTtcbiAgICAgICAgaWYgKCFhbmltYXRvckluKSB7XG4gICAgICAgICAgcmV0dXJuIGVuZCgpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHZhciBzdGFydGluZ0FuaW1hdG9yID0gYW5pbWF0b3JPdXQgfHwgYW5pbWF0b3JJbjtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBydW5uZXI7XG5cbiAgICAgICAgICB2YXIgY3VycmVudEFuaW1hdGlvbiA9IHN0YXJ0aW5nQW5pbWF0b3Iuc3RhcnQoKTtcbiAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIGlmICghYW5pbWF0b3JJbikge1xuICAgICAgICAgICAgICBhbmltYXRvckluID0gcHJlcGFyZUluQW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgIGlmIChhbmltYXRvckluKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbiA9IGFuaW1hdG9ySW4uc3RhcnQoKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGVuZCgpO1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnRBbmltYXRpb247XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGluIHRoZSBldmVudCB0aGF0IHRoZXJlIGlzIG5vIGBpbmAgYW5pbWF0aW9uXG4gICAgICAgICAgICBlbmQoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICBlbmQ6IGVuZEZuLFxuICAgICAgICAgICAgY2FuY2VsOiBlbmRGblxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEZuKCkge1xuICAgICAgICAgICAgaWYgKGN1cnJlbnRBbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbi5lbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGNhbGN1bGF0ZUFuY2hvclN0eWxlcyhhbmNob3IpIHtcbiAgICAgICAgdmFyIHN0eWxlcyA9IHt9O1xuXG4gICAgICAgIHZhciBjb29yZHMgPSBnZXREb21Ob2RlKGFuY2hvcikuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7XG5cbiAgICAgICAgLy8gd2UgaXRlcmF0ZSBkaXJlY3RseSBzaW5jZSBzYWZhcmkgbWVzc2VzIHVwIGFuZCBkb2Vzbid0IHJldHVyblxuICAgICAgICAvLyBhbGwgdGhlIGtleXMgZm9yIHRoZSBjb29yZHMgb2JqZWN0IHdoZW4gaXRlcmF0ZW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Fpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGFwcGx5T3B0aW9ucygpO1xuICAgICAgICAgICAgICBmbih0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhcHBseU9wdGlvbnMoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoYWZ0ZXIpIHtcbiAgICAgICAgICAgIGNoYWluLnB1c2goZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgICAgICAgY2xvc2VBY3RpdmVBbmltYXRpb25zID0gYWZ0ZXIoZm4pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyLnNldEhvc3Qoe1xuICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZW5kQW5pbWF0aW9ucygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGVuZEFuaW1hdGlvbnModHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuY2hhaW4oY2hhaW4sIG9uQ29tcGxldGUpO1xuICAgICAgICAgIHJldHVybiBydW5uZXI7XG5cbiAgICAgICAgICBmdW5jdGlvbiBvbkNvbXBsZXRlKHN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIGNsb3NlKHN1Y2Nlc3MpO1xuICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKHN1Y2Nlc3MpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEFuaW1hdGlvbnMoY2FuY2VsbGVkKSB7XG4gICAgICAgICAgICBpZiAoIWFuaW1hdGlvbkNsb3NlZCkge1xuICAgICAgICAgICAgICAoY2xvc2VBY3RpdmVBbmltYXRpb25zIHx8IG5vb3ApKGNhbmNlbGxlZCk7XG4gICAgICAgICAgICAgIG9uQ29tcGxldGUoY2FuY2VsbGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGV4ZWN1dGVBbmltYXRpb25GbihmbiwgZWxlbWVudCwgZXZlbnQsIG9wdGlvbnMsIG9uRG9uZSkge1xuICAgICAgICB2YXIgYXJncztcbiAgICAgICAgc3dpdGNoIChldmVudCkge1xuICAgICAgICAgIGNhc2UgJ2FuaW1hdGUnOlxuICAgICAgICAgICAgYXJncyA9IFtlbGVtZW50LCBvcHRpb25zLmZyb20sIG9wdGlvbnMudG8sIG9uRG9uZV07XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ3NldENsYXNzJzpcbiAgICAgICAgICAgIGFyZ3MgPSBbZWxlbWVudCwgY2xhc3Nlc1RvQWRkLCBjbGFzc2VzVG9SZW1vdmUsIG9uRG9uZV07XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGNhc2UgJ2FkZENsYXNzJzpcbiAgICAgICAgICAgIGFyZ3MgPSBbZWxlbWVudCwgY2xhc3Nlc1RvQWRkLCBvbkRvbmVdO1xuICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICBjYXNlICdyZW1vdmVDbGFzcyc6XG4gICAgICAgICAgICBhcmdzID0gW2VsZW1lbnQsIGNsYXNzZXNUb1JlbW92ZSwgb25Eb25lXTtcbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgIGFyZ3MgPSBbZWxlbWVudCwgb25Eb25lXTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgYXJncy5wdXNoKG9wdGlvbnMpO1xuXG4gICAgICAgIHZhciB2YWx1ZSA9IGZuLmFwcGx5KGZuLCBhcmdzKTtcbiAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24odmFsdWUuc3RhcnQpKSB7XG4gICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnN0YXJ0KCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHZhbHVlIGluc3RhbmNlb2YgJCRBbmltYXRlUnVubmVyKSB7XG4gICAgICAgICAgICB2YWx1ZS5kb25lKG9uRG9uZSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChpc0Z1bmN0aW9uKHZhbHVlKSkge1xuICAgICAgICAgICAgLy8gb3B0aW9uYWwgb25FbmQgLyBvbkNhbmNlbCBjYWxsYmFja1xuICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub29wO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsIGV2ZW50LCBvcHRpb25zLCBhbmltYXRpb25zLCBmbk5hbWUpIHtcbiAgICAgICAgdmFyIG9wZXJhdGlvbnMgPSBbXTtcbiAgICAgICAgZm9yRWFjaChhbmltYXRpb25zLCBmdW5jdGlvbihhbmkpIHtcbiAgICAgICAgICB2YXIgYW5pbWF0aW9uID0gYW5pW2ZuTmFtZV07XG4gICAgICAgICAgaWYgKCFhbmltYXRpb24pIHJldHVybjtcblxuICAgICAgICAgIC8vIG5vdGUgdGhhdCBhbGwgb2YgdGhlc2UgYW5pbWF0aW9ucyB3aWxsIHJ1biBpbiBwYXJhbGxlbFxuICAgICAgICAgIG9wZXJhdGlvbnMucHVzaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBydW5uZXI7XG4gICAgICAgICAgICB2YXIgZW5kUHJvZ3Jlc3NDYjtcblxuICAgICAgICAgICAgdmFyIHJlc29sdmVkID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgb25BbmltYXRpb25Db21wbGV0ZSA9IGZ1bmN0aW9uKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmICghcmVzb2x2ZWQpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgKGVuZFByb2dyZXNzQ2IgfHwgbm9vcCkocmVqZWN0ZWQpO1xuICAgICAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSghcmVqZWN0ZWQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKHtcbiAgICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBvbkFuaW1hdGlvbkNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgb25BbmltYXRpb25Db21wbGV0ZSh0cnVlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGVuZFByb2dyZXNzQ2IgPSBleGVjdXRlQW5pbWF0aW9uRm4oYW5pbWF0aW9uLCBlbGVtZW50LCBldmVudCwgb3B0aW9ucywgZnVuY3Rpb24ocmVzdWx0KSB7XG4gICAgICAgICAgICAgIHZhciBjYW5jZWxsZWQgPSByZXN1bHQgPT09IGZhbHNlO1xuICAgICAgICAgICAgICBvbkFuaW1hdGlvbkNvbXBsZXRlKGNhbmNlbGxlZCk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgcmV0dXJuIG9wZXJhdGlvbnM7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHBhY2thZ2VBbmltYXRpb25zKGVsZW1lbnQsIGV2ZW50LCBvcHRpb25zLCBhbmltYXRpb25zLC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AgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbnMubGVuZ3RoID09PSAwKSByZXR1cm47XG5cbiAgICAgICAgLy8gVE9ETyhtYXRza28pOiBhZGQgZG9jdW1lbnRhdGlvblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gc3RhcnRBbmltYXRpb24oY2FsbGJhY2spIHtcbiAgICAgICAgICB2YXIgcnVubmVycyA9IFtdO1xuICAgICAgICAgIGlmIChvcGVyYXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgICAgZm9yRWFjaChvcGVyYXRpb25zLCBmdW5jdGlvbihhbmltYXRlRm4pIHtcbiAgICAgICAgICAgICAgcnVubmVycy5wdXNoKGFuaW1hdGVGbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgJCRBbmltYXRlUnVubmVyLmFsbChydW5uZXJzLCBjYWxsYmFjayk7XG4gICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBlbmRGbihyZWplY3QpIHtcbiAgICAgICAgICAgIGZvckVhY2gocnVubmVycywgZnVuY3Rpb24ocnVubmVyKSB7XG4gICAgICAgICAgICAgIGlmIChyZWplY3QpIHtcbiAgICAgICAgICAgICAgICBydW5uZXIuY2FuY2VsKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBsb29rdXBBbmltYXRpb25zKGNsYXNzZXMpIHtcbiAgICAgIGNsYXNzZXMgPSBpc0FycmF5KGNsYXNzZXMpID8gY2xhc3NlcyA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wYXJlQW5pbWF0aW9uKGFuaW1hdGlvbkRldGFpbHMuZnJvbSk7XG4gICAgICAgIHZhciB0b0FuaW1hdGlvbiA9IHByZXBhcmVBbmltYXRpb24oYW5pbWF0aW9uRGV0YWlscy50byk7XG4gICAgICAgIGlmICghZnJvbUFuaW1hdGlvbiAmJiAhdG9BbmltYXRpb24pIHJldHVybjtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHN0YXJ0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBhbmltYXRpb25SdW5uZXJzID0gW107XG5cbiAgICAgICAgICAgIGlmIChmcm9tQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICAgIGFuaW1hdGlvblJ1bm5lcnMucHVzaChmcm9tQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVycy5wdXNoKHRvQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuYWxsKGFuaW1hdGlvblJ1bm5lcnMsIGRvbmUpO1xuXG4gICAgICAgICAgICB2YXIgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICAgIGVuZDogZW5kRm5GYWN0b3J5KCksXG4gICAgICAgICAgICAgIGNhbmNlbDogZW5kRm5GYWN0b3J5KClcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gcnVubmVyO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBlbmRGbkZhY3RvcnkoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmb3JFYWNoKGFuaW1hdGlvblJ1bm5lcnMsIGZ1bmN0aW9uKHJ1bm5lcikge1xuICAgICAgICAgICAgICAgICA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YmICFpc1N0cmluZyhhcmd1bWVudHNbMF0pKSB7XG4gICAgICAgICAgY29udGFpbmVyID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50VHlwZSBpbiBjYWxsYmFja1JlZ2lzdHJ5KSB7XG4gICAgICAgICAgICBjYWxsYmFja1JlZ2lzdHJ5W2V2ZW50VHlwZV0gPSBmaWx0ZXJGcm9tUmVnaXN0cnkoY2FsbGJhY2tSZWdpc3RyeVtldmVudFR5cGVdLCBjb250YWluZXIpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlbnRyaWVzID0gY2FsbGJhY2tSZWdpc3RyeVtldmVudF07XG4gICAgICAgIGlmICghZW50cmllcykgcmV0dXJuO1xuXG4gICAgICAgIGNhbGxiYWNrUmVnaXN0cnlbZXZlbnRdID0gYXJndW1lbnRzLmxlbmd0aCA9PT0gMVxuICAgICAgICAgICAgPyBudWxsXG4gICAgICAgICAgICA6IGZpbHRlckZyb21SZWdpc3RyeShlbnRyaWVzLCBjb250YWluZXIsIGNhbGxiYWNrKTtcbiAgICAgIH0sXG5cbiAgICAgIHBpbjogZnVuY3Rpb24oZWxlbWVudCwgcGFyZW50RWxlbWVudCkge1xuICAgICAgICBhc3NlcnRBcmcoaXNFbGVtZW50KGVsZW1lbnQpLCAnZWxlbWVudCcsICdub3QgYW4gZWxlbWVudCcpO1xuICAgICAgICBhc3NlcnRBcmcoaXNFbGVtZW50KHBhcmVudEVsZW1lbnQpLCAncGFyZW50RWxlbWVudCcsICdub3QgYW4gZWxlbWVudCcpO1xuICAgICAgICBlbGVtZW50LmRhdGEoTkdfQU5JTUFURV9QSU5fREFUQSwgcGFyZW50RWxlbWVudCk7XG4gICAgICB9LFxuXG4gICAgICBwdXNoOiBmdW5jdGlvbihlbGVtZW50LCBldmVudCwgb3B0aW9ucywgZG9tT3BlcmF0aW9uKSB7XG4gICAgICAgIG9wdGlv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gICAgdmFyIHBhcmVudEVudHJ5O1xuICAgICAgICB3aGlsZSAocGFyZW50Tm9kZSkge1xuICAgICAgICAgIHBhcmVudEVudHJ5ID0gbG9va3VwLmdldChwYXJlbnROb2RlKTtcbiAgICAgICAgICBpZiAocGFyZW50RW50cnkpIHtcbiAgICAgICAgICAgIGlmICghcGFyZW50RW50cnkucHJvY2Vzc2VkKSB7XG4gICAgICAgICAgICAgIHBhcmVudEVudHJ5ID0gcHJvY2Vzc05vZGUocGFyZW50RW50cnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhcmVudE5vZGUgPSBwYXJlbnROb2RlLnBhcmVudE5vZGU7XG4gICAgICAgIH1cblxuICAgICAgICAocGFyZW50RW50cnkgfHwgdHJlZSkuY2hpbGRyZW4ucHVzaChlbnRyeSk7XG4gICAgICAgIHJldHVybiBlbnRyeTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZmxhdHRlbih0cmVlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgICAgdmFyIHF1ZXVlID0gW107XG4gICAgICAgIHZhciBpO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0cmVlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgcXVldWUucHVzaCh0cmVlLmNoaWxkcmVuW2ldKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciByZW1haW5pbmdMZXZlbEVudHJpZXMgPSBxdWV1ZS5sZW5ndGg7XG4gICAgICAgIHZhciBuZXh0TGV2ZWxFbnRyaWVzID0gMDtcbiAgICAgICAgdmFyIHJvdyA9IFtdO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIHZhciBlbnRyeSA9IHF1ZXVlW2ldO1xuICAgICAgICAgIGlmIChyZW1haW5pbmdMZXZlbEVudHJ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RlYCBDU1MgY2xhc3MgYW5kIHRoZVxuICAgICAgICAgICAgICAvLyB0ZW1wb3JhcnkgY2xhc3NlcyBiZWZvcmUgd2UgZG8gYW55IGRyaXZlciBpbnZva2luZyBzaW5jZSB0aGVzZVxuICAgICAgICAgICAgICAvLyBDU1MgY2xhc3NlcyBtYXkgYmUgcmVxdWlyZWQgZm9yIHByb3BlciBDU1MgZGV0ZWN0aW9uLlxuICAgICAgICAgICAgICBhbmltYXRpb25FbnRyeS5iZWZvcmVTdGFydCgpO1xuXG4gICAgICAgICAgICAgIC8vIGluIHRoZSBldmVudCB0aGF0IHRoZSBlbGVtZW50IHdhcyByZW1vdmVkIGJlZm9yZSB0aGUgZGlnZXN0IHJ1bnMgb3JcbiAgICAgICAgICAgICAgLy8gZHVyaW5nIHRoZSBSQUYgc2VxdWVuY2luZyB0aGVuIHdlIHNob3VsZCBub3QgdHJpZ2dlciB0aGUgYW5pbWF0aW9uLlxuICAgICAgICAgICAgICB2YXIgdGFyZ2V0RWxlbWVudCA9IGFuaW1hdGlvbkVudHJ5LmFuY2hvcnNcbiAgICAgICAgICAgICAgICAgID8gKGFuaW1hdGlvbkVudHJ5LmZyb20uZWxlbWVudCB8fCBhbmltYXRpb25FbnRyeS50by5lbGVtZW50KVxuICAgICAgICAgICAgICAgICAgOiBhbmltYXRpb25FbnRyeS5lbGVtZW50O1xuXG4gICAgICAgICAgICAgIGlmIChnZXRSdW5uZXIodGFyZ2V0RWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRW50cnkpO1xuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uRm4gPSBvcGVyYXRpb24uc3RhcnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKCFzdGFydEFuaW1hdGlvbkZuKSB7XG4gICAgICAgICAgICAgICAgY2xvc2VGbigpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhbmltYXRpb25SdW5uZXIgPSBzdGFydEFuaW1hdGlvbkZuKCk7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVyLmRvbmUoZnVuY3Rpb24oc3RhdHVzKSB7XG4gICAgICAgICAgICAgICAgICBjbG9zZUZuKCFzdGF0dXMpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHVwZGF0ZUFuaW1hdGlvblJ1bm5lcnMoYW5pbWF0aW9uRW50cnksIGFuaW1hdGlvblJ1bm5lcik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gd2UgbmVlZCB0byBzb3J0IGVhY2ggb2YgdGhlIGFuaW1hdGlvbnMgaW4gb3JkZXIgb2YgcGFyZW50IHRvIGNoaWxkXG4gICAgICAgIC8vIHJlbGF0aW9uc2hpcHMuIFRoaXMgZW5zdXJlcyB0aGF0IHRoZSBjaGlsZCBjbGFzc2VzIGFyZSBhcHBsaWVkIGF0IHRoZVxuICAgICAgICAvLyByaWdodCB0aW1lLlxuICAgICAgICB2YXIgZmluYWxBbmltYXRpb25zID0gc29ydEFuaW1hdGlvbnModG9CZVNvcnRlZEFuaW1hdGlvbnMpO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZpbmFsQW5pbWF0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIHZhciBpbm5lckFycmF5ID0gZmluYWxBbmltYXRpb25zW2ldO1xuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgaW5uZXJBcnJheS5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdmFyIGVudHJ5ID0gaW5uZXJBcnJheVtqXTtcbiAgICAgICAgICAgIHZhciB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pbmRleE9mKGV2ZW50KSA+PSAwO1xuICAgICAgICAgIHZhciBhbmNob3JOb2RlcyA9IGFuaW1hdGlvbi5zdHJ1Y3R1cmFsID8gZ2V0QW5jaG9yTm9kZXMobm9kZSkgOiBbXTtcblxuICAgICAgICAgIGlmIChhbmNob3JOb2Rlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciBkaXJlY3Rpb24gPSBlbnRlck9yTW92ZSA/ICd0bycgOiAnZnJvbSc7XG5cbiAgICAgICAgICAgIGZvckVhY2goYW5jaG9yTm9kZXMsIGZ1bmN0aW9uKGFuY2hvcikge1xuICAgICAgICAgICAgICB2YXIga2V5ID0gYW5jaG9yLmdldEF0dHJpYnV0ZShOR19BTklNQVRFX1JFRl9BVFRSKTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV0gPSByZWZMb29rdXBba2V5XSB8fCB7fTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV1bZGlyZWN0aW9uXSA9IHtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25JRDogaW5kZXgsXG4gICAgICAgICAgICAgICAgZWxlbWVudDoganFMaXRlKGFuY2hvcilcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChhbmltYXRpb24pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIHVzZWRJbmRpY2VzTG9va3VwID0ge307XG4gICAgICAgIHZhciBhbmNob3JHcm91cHMgPSB7fTtcbiAgICAgICAgZm9yRWFjaChyZWZMb29rdXAsIGZ1bmN0aW9uKG9wZXJhdGlvbnMsIGtleSkge1xuICAgICAgICAgIHZhciBmcm9tID0gb3BlcmF0aW9ucy5mcm9tO1xuICAgICAgICAgIHZhciB0byA9IG9wZXJhdGlvbnMudG87XG5cbiAgICAgICAgICBpZiAoIWZyb20gfHwgIXRvKSB7XG4gICAgICAgICAgICAvLyBvbmx5IG9uZSBvZiB0aGVzZSBpcyBzZXQgdGhlcmVmb3JlIHdlIGNhbid0IGhhdmUgYW5cbiAgICAgICAgICAgIC8vIGFuY2hvciBhbmltYXRpb24gc2luY2UgYWxsIHRocmVlIHBpZWNlcyBhcmUgcmVxdWlyZWRcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGZyb20gPyBmcm9tLmFuaW1hdGlvbklEIDogdG8uYW5pbWF0aW9uSUQ7XG4gICAgICAgICAgICB2YXIgaW5kZXhLZXkgPSBpbmRleC50b1N0cmluZygpO1xuICAgICAgICAgICAgaWYgKCF1c2VkSW5kaWNlc0xvb2t1cFtpbmRleEtleV0pIHtcbiAgICAgICAgICAgICAgdXNlZEluZGljZXNMb29rdXBbaW5kZXhLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2goYW5pbWF0aW9uc1tpbmRleF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBmcm9tQW5pbWF0aW9uID0gYW5pbWF0aW9uc1tmcm9tLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgdG9BbmltYXRpb24gPSBhbmltYXRpb25zW3RvLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgbG9va3VwS2V5ID0gZnJvbS5hbmltYXRpb25JRC50b1N0cmluZygpO1xuICAgICAgICAgIGlmICghYW5jaG9yR3JvdXBzW2xvb2t1cEtleV0pIHtcbiAgICAgICAgICAgIHZhciBncm91cCA9IGFuY2hvckdyb3Vwc1tsb29rdXBLZXldID0ge1xuICAgICAgICAgICAgICBzdHJ1Y3R1cmFsOiB0cnVlLFxuICAgICAgICAgICAgICBiZWZvcmVTdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgZnJvbUFuaW1hdGlvbi5iZWZvcmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIHRvQW5pbWF0aW9uLmJlZm9yZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmcm9tQW5pbWF0aW9uLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgdG9BbmltYXRpb24uY2xvc2UoKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgY2xhc3NlczogY3NzQ2xhc3Nlc0ludGVyc2VjdGlvbihmcm9tQW5pbWF0aW9uLmNsYXNzZXMsIHRvQW5pbWF0aW9uLmNsYXNzZXMpLFxuICAgICAgICAgICAgICBmcm9tOiBmcm9tQW5pbWF0aW9uLFxuICAgICAgICAgICAgICB0bzogdG9BbmltYXRpb24sXG4gICAgICAgICAgICAgIGFuY2hvcnM6IFtdIC8vIFRPRE8obWF0c2tvKTogY2hhbmdlIHRvIHJlZmVyZW5jZSBub2Rlc1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gdGhlIGFuY2hvciBhbmltYXRpb25zIHJlcXVpcmUgdGhhdCB0aGUgZnJvbSBhbmQgdG8gZWxlbWVudHMgYm90aCBoYXZlIGF0IGxlYXN0XG4gICAgICAgICAgICAvLyBvbmUgc2hhcmVkIENTUyBjbGFzcyB3aGljaCBlZmZlY3RpdmVseSBtYXJyaWVzIHRoZSB0d28gZWxlbWVudHMgdG9nZXRoZXIgdG8gdXNlXG4gICAgICAgICAgICAvLyB0aGUgc2FtZSBhbmltYXRpb24gZHJpdmVyIGFuZCB0byBwcm9wZXJseSBzZXF1ZW5jZSB0aGUgYW5jaG9yIGFuaW1hdGlvbi5cbiAgICAgICAgICAgIGlmIChncm91cC5jbGFzc2VzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChncm91cCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChmcm9tQW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2godG9BbmltYXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGFuY2hvckdyb3Vwc1tsb29rdXBLZXldLmFuY2hvcnMucHVzaCh7XG4gICAgICAgICAgICAnb3V0JzogZnJvbS5lbGVtZW50LCAnaW4nOiB0by5lbGVtZW50XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcmVwYXJlZEFuaW1hdGlvbnM7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNzc0NsYXNzZXNJbnRlcnNlY3Rpb24oYSxiKSB7XG4gICAgICAgIGEgPSBhLnNwbGl0KCcgJyk7XG4gICAgICAgIGIgPSBiLnNwbGl0KCcgJyk7XG4gICAgICAgIHZhciBtYXRjaGVzID0gW107XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgdmFyIGFhID0gYVtpXTtcbiAgICAgICAgICBpZiAoYWEuc3Vic3RyaW5nKDAsMykgPT09ICduZy0nKSBjb250aW51ZTtcblxuICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgYi5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgaWYgKGFhID09PSBiW2pdKSB7XG4gICAgICAgICAgICAgIG1hdGNoZXMucHVzaChhYSk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtYXRjaGVzLmpvaW4oJyAnKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgICAvLyB3ZSBsb29wIGluIHJldmVyc2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cGxlJywgWyduZ0FuaW1hdGUnXSlcbiAqICAgICAgIC5jb250cm9sbGVyKCdBcHBDdHJsJywgWyckc2NvcGUnLCAnJGludGVydmFsJywgZnVuY3Rpb24oJHNjb3BlLCAkaW50ZXJ2YWwpIHtcbiAqICAgICAgICAgJHNjb3BlLm51bWJlciA9IDA7XG4gKiAgICAgICAgICRpbnRlcnZhbChmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICAkc2NvcGUubnVtYmVyKys7XG4gKiAgICAgICAgIH0sIDEwMDApO1xuICpcbiAqICAgICAgICAgdmFyIGNvbG9ycyA9IFsncmVkJywnYmx1ZScsJ2dyZWVuJywneWVsbG93Jywnb3JhbmdlJ107XG4gKiAgICAgICAgICRzY29wZS5jb2xvckNsYXNzID0gZnVuY3Rpb24obnVtYmVyKSB7XG4gKiAgICAgICAgICAgcmV0dXJuIGNvbG9yc1tudW1iZXIgJSBjb2xvcnMubGVuZ3RoXTtcbiAqICAgICAgICAgfTtcbiAqICAgICAgIH1dKTtcbiAqICAgPC9maWxlPlxuICogIDxmaWxlIG5hbWU9XCJhbmltYXRpb25zLmNzc1wiPlxuICogIC5jb250YWluZXIge1xuICogICAgaGVpZ2h0OjI1MHB4O1xuICogICAgd2lkdGg6MjUwcHg7XG4gKiAgICBwb3NpdGlvbjpyZWxhdGl2ZTtcbiAqICAgIG92ZXJmbG93OmhpZGRlbjtcbiAqICAgIGJvcmRlcjoycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5jb250YWluZXIgLmNlbGwge1xuICogICAgZm9udC1zaXplOjE1MHB4O1xuICogICAgdGV4dC1hbGlnbjpjZW50ZXI7XG4gKiAgICBsaW5lLWhlaWdodDoyNTBweDtcbiAqICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICogICAgdG9wOjA7XG4gKiAgICBsZWZ0OjA7XG4gKiAgICByaWdodDowO1xuICogICAgYm9yZGVyLWJvdHRvbToycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5zd2F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MgYXJlIFwiYW5pbWF0aW9uIGF3YXJlXCI6XG4gKlxuICogfCBEaXJlY3RpdmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFN1cHBvcnRlZCBBbmltYXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jYW5pbWF0aW9ucyBmb3JtIC8gbmdGb3JtfSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgICAgfFxuICogfCB7QGxpbmsgbmdBbmltYXRlLmRpcmVjdGl2ZTpuZ0FuaW1hdGVTd2FwI2FuaW1hdGlvbnMgbmdBbmltYXRlU3dhcH0gICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3MjYW5pbWF0aW9ucyBuZ0NsYXNzIC8ge3tjbGFzcyYjMTI1OyYjODIwMzsmIzEyNTt9ICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NFdmVuI2FuaW1hdGlvbnMgbmdDbGFzc0V2ZW59ICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NPZGQjYW5pbWF0aW9ucyBuZ0NsYXNzT2RkfSAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSGlkZSNhbmltYXRpb25zIG5nSGlkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSWYjYW5pbWF0aW9ucyBuZ0lmfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSW5jbHVkZSNhbmltYXRpb25zIG5nSW5jbHVkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2UgLyBuZ01lc3NhZ2VFeHB9ICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2VzfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWFjdGl2ZWAvYG5nLWluYWN0aXZlYCBjbGFzc2VzKSAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjYW5pbWF0aW9ucyBuZ01vZGVsfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nUmVwZWF0I2FuaW1hdGlvbnMgbmdSZXBlYXR9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyLCBsZWF2ZSwgYW5kIG1vdmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU2hvdyNhbmltYXRpb25zIG5nU2hvd30gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU3dpdGNoI2FuaW1hdGlvbnMgbmdTd2l0Y2h9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgIC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aXNwbGF5OmJsb2NrO1xuICAgICAgICBmb250LXNpemU6MjBweDtcbiAgICAgIH1cbiAgICAgIC5wcm9maWxlIHtcbiAgICAgICAgYmFja2dyb3VuZDpibGFjaztcbiAgICAgICAgY29sb3I6d2hpdGU7XG4gICAgICAgIGZvbnQtc2l6ZToxMDBweDtcbiAgICAgIH1cbiAgICAgIC52aWV3LWNvbnRhaW5lciB7XG4gICAgICAgIHBvc2l0aW9uOnJlbGF0aXZlO1xuICAgICAgfVxuICAgICAgLnZpZXctY29udGFpbmVyID4gLnZpZXcubmctYW5pbWF0ZSB7XG4gICAgICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICAgICAgICB0b3A6MDtcbiAgICAgICAgbGVmdDowO1xuICAgICAgICB3aWR0aDoxMDAlO1xuICAgICAgICBtaW4taGVpZ2h0OjUwMHB4O1xuICAgICAgfVxuICAgICAgLnZpZXcubmctZW50ZXIsIC52aWV3Lm5nLWxlYXZlLFxuICAgICAgLnJlY29yZC5uZy1hbmNob3Ige1xuICAgICAgICB0cmFuc2l0aW9uOjAuNXMgbGluZWFyIGFsbDtcbiAgICAgIH1cbiAgICAgIC52aWV3Lm5nLWVudGVyIHtcbiAgICAgICAgdHJhbnNmb3JtOnRyYW5zbGF0ZVgoMTAwJSk7XG4gICAgICB9XG4gICAgICAudmlldy5uZy1lbnRlci5uZy1lbnRlci1hY3RpdmUsIC52aWV3Lm5nLWxlYXZlIHtcbiAgICAgICAgdHJhbnNmb3JtOnRyYW5zbGF0ZVgoMCUpO1xuICAgICAgfVxuICAgICAgLnZpZXcubmctbGVhdmUubmctbGVhdmUtYWN0aXZlIHtcbiAgICAgICAgdHJhbnNmb3JtOnRyYW5zbGF0ZVgoLTEwMCUpO1xuICAgICAgfVxuICAgICAgLnJlY29yZC5uZy1hbmNob3Itb3V0IHtcbiAgICAgICAgYmFja2dyb3VuZDpyZWQ7XG4gICAgICB9XG4gICAgPC9maWxlPlxuICA8L2V4YW1wbGU+XG4gKlxuICogIyM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GhlIGN1cnJlbnQgdmFsdWUgb2YgdGhlIGBlYWdlckluc3RhbnRpYXRpb25FbmFibGVkYCBmbGFnIGlmIHVzZWQgYXMgYSBnZXR0ZXIgb3JcbiAgICogICAgIGl0c2VsZiAoZm9yIGNoYWluaW5nKSBpZiB1c2VkIGFzIGEgc2V0dGVyLlxuICAgKi9cbiAgaXNFYWdlckluc3RhbnRpYXRpb25FbmFibGVkID0gdHJ1ZTtcbiAgdGhpcy5lYWdlckluc3RhbnRpYXRpb25FbmFibGVkID0gZnVuY3Rpb24gZWFnZXJJbnN0YW50aWF0aW9uRW5hYmxlZChlbmFibGVkKSB7XG4gICAgaWYgKGlzRGVmaW5lZChlbmFibGVkKSkge1xuICAgICAgaXNFYWdlckluc3RhbnRpYXRpb25FbmFibGVkID0gZW5hYmxlZDtcbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH1cblxuICAgIHJldHVybiBpc0VhZ2VySW5zdGFudGlhdGlvbkVuYWJsZWQ7XG4gIH07XG5cblxuICB0aGlzLiRnZXQgPSBbJyRyb290U2NvcGUnLFxuICAgICAgICAgICAgICAgJyRsb2NhdGlvbicsXG4gICAgICAgICAgICAgICAnJHJvdXRlUGFyYW1zJyxcbiAgICAgICAgICAgICAgICckcScsXG4gICAgICAgICAgICAgICAnJGluamVjdG9yJyxcbiAgICAgICAgICAgICAgICckdGVtcGxhdGVSZXF1ZXN0JyxcbiAgICAgICAgICAgICAgICckc2NlJyxcbiAgICAgICAgICAgICAgICckYnJvd3NlcicsXG4gICAgICBmdW5jdGlvbigkcm9vdFNjb3BlLCAkbG9jYXRpb24sICRyb3V0ZVBhcmFtcywgJHEsICRpbmplY3RvciwgJHRlbXBsYXRlUmVxdWVzdCwgJHNjZSwgJGJyb3dzZXIpIHtcblxuICAgIC8qKlxuICAgICAqIEBuZ2RvYyBzZXJ2aWNlXG4gICAgICogQG5hbWUgJHJvdXRlXG4gICAgICogQHJlcXVpcmVzICRsb2NhdGlvblxuICAgICAqIEByZXF1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xvY2F0aW9uKSB7XG4gICAgICogICAgICAgICAgJHNjb3BlLiRyb3V0ZSA9ICRyb3V0ZTtcbiAgICAgKiAgICAgICAgICAkc2NvcGUuJGxvY2F0aW9uID0gJGxvY2F0aW9uO1xuICAgICAqICAgICAgICAgICRzY29wZS4kcm91dGVQYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignQm9va0NvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZVBhcmFtcykge1xuICAgICAqICAgICAgICAgICRzY29wZS5uYW1lID0gJ0Jvb2tDb250cm9sbGVyJztcbiAgICAgKiAgICAgICAgICAkc2NvcGUucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAqICAgICAgfSlcbiAgICAgKlxuICAgICAqICAgICAgLmNvbnRyb2xsZXIoJ0NoYXB0ZXJDb250cm9sbGVyJywgZnVuY3Rpb24oJHNjb3BlLCAkcm91dGVQYXJhbXMpIHtcbiAgICAgKiAgICAgICAgICAkc2NvcGUubmFtZSA9ICdDaGFwdGVyQ29udHJvbGxlcic7XG4gICAgICogICAgICAgICAgJHNjb3BlLnBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgKiAgICAgIH0pXG4gICAgICpcbiAgICAgKiAgICAgLmNvbmZpZyhmdW5jdGlvbigkcm91dGVQcm92aWRlciwgJGxvY2F0aW9uUHJvdmlkZXIpIHtcbiAgICAgKiAgICAgICAkcm91dGVQcm92aWRlclxuICAgICAqICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZCcsIHtcbiAgICAgKiAgICAgICAgIHRlbXBsYXRlVXJsOiAnYm9vay5odG1sJyxcbiAgICAgKiAgICAgICAgIGNvbnRyb2xsZXI6ICdCb29rQ29udHJvbGxlcicsXG4gICAgICogICAgICAgICByZXNvbHZlOiB7XG4gICAgICogICAgICAgICAgIC8vIEkgd2lsbCBjYXVzZSBhIDEgc2Vjb25kIGRlbGF5XG4gICAgICogICAgICAgICAgIGRlbGF5OiBmdW5jdGlvbigkcSwgJHRpbWVvdXQpIHtcbiAgICAgKiAgICAgICAgICAgICB2YXIgZGVsYXkgPSAkcS5kZWZlcigpO1xuICAgICAqICAgICAgICAgICAgICR0aW1lb3V0KGRlbGF5LnJlc29sdmUsIDEwMDApO1xuICAgICAqICAgICAgICAgICAgIHJldHVybiBkZWxheS5wcm9taXNlO1xuICAgICAqICAgICAgICAgICB9XG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgfSlcbiAgICAgKiAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZC9jaC86Y2hhcHRlcklkJywge1xuICAgICAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdjaGFwdGVyLmh0bWwnLFxuICAgICAqICAgICAgICAgY29udHJvbGxlcjogJ0NoYXB0ZXJDb250cm9sbGVyJ1xuICAgICAqICAgICAgIH0pO1xuICAgICAqXG4gICAgICogICAgICAgLy8gY29uZmlndXJlIGh0bWw1IHRvIGdldCBsaW5rcyB3b3JraW5nIG9uIGpzZmlkZGxlXG4gICAgICogICAgICAgJGxvY2F0aW9uUHJvdmlkZXIuaHRtbDVNb2RlKHRydWUpO1xuICAgICAqICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICogICAgIGl0KCdzaG91bGQgbG9hZCBhbmQgY29tcGlsZSBjb3JyZWN0IHRlbXBsYXRlJywgZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgZWxlbWVudChieS5saW5rVGV4dCgnTW9ieTogQ2gxJykpLmNsaWNrKCk7XG4gICAgICogICAgICAgdmFyIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQ2hhcHRlckNvbnRyb2xsZXIvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogTW9ieS8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9DaGFwdGVyIElkOiAxLyk7XG4gICAgICpcbiAgICAgKiAgICAgICBlbGVtZW50KGJ5LnBhcnRpYWxMaW5rVGV4dCgnU2NhcmxldCcpKS5jbGljaygpO1xuICAgICAqXG4gICAgICogICAgICAgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzKCdbbmctdmlld10nKSkuZ2V0VGV4dCgpO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9jb250cm9sbGVyOiBCb29rQ29udHJvbGxlci8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9Cb29rIElkOiBTY2FybGV0Lyk7XG4gICAgICogICAgIH0pO1xuICAgICAqICAgPC9maWxlPlxuICAgICAqIDwvZXhhbXBsZT5cbiAgICAgKi9cblxuICAgIC8qKlxuICAgICAqIEBuZ2RvYyBldmVudFxuICAgICAqIEBuYW1lICRyb3V0ZSMkcm91dGVDaGFuZ2VTdGFydFxuICAgICAqIEBldmVudFR5cGUgYnJvYWRjYXN0IG9uIHJvb3Qgc2NvcGVcbiAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgKiBCcm9hZGNhc3RlZCBiZWZvcmUgYSByb3V0ZSBjaGFuZ2UuIEF0IHRoaXMgIHBvaW50IHRoZSByb3V0ZSBzZXJ2aWNlcyBzdGFydHNcbiAgICAgKiByZXNvbHZpbmcgYWxsIG9mIHRoZSBkZXBlbmRlbmNpZXMgbmVlZGVkIGZvciB0aGUgcm91dGUgY2hhbmdlIHRvIG9jY3VyLlxuICAgICAqIFR5cGljYWxseSB0aGlzIGludm9sdmVzIGZldGNoaW5nIHRoZSB2aWV3IHRlbXBsYX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xcbiAgICAgICAgcHJlcGFyZWRSb3V0ZSxcbiAgICAgICAgcHJlcGFyZWRSb3V0ZUlzVXBkYXRlT25seSxcbiAgICAgICAgJHJvdXRlID0ge1xuICAgICAgICAgIHJvdXRlczogcm91dGVzLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lICRyb3V0ZSNyZWxvYWRcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIENhdXNlcyBgJHJvdXRlYCBzZXJ2aWNlIHRvIHJlbG9hZCB0aGUgY3VycmVudCByb3V0ZSBldmVuIGlmXG4gICAgICAgICAgICoge0BsaW5rIG5nLiRsb2NhdGlvbiAkbG9jYXRpb259IGhhc24ndCBjaGFuZ2VkLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQXMgYSByZXN1bHQgb2YgdGhhdCwge0BsaW5rIG5nUm91dGUuZGlyZWN0aXZlOm5nVmlldyBuZ1ZpZXd9XG4gICAgICAgICAgICogY3JlYXRlcyBuZXcgc2NvcGUgYW5kIHJlaW5zdGFudGlhdGVzIHRoZSBjb250cm9sbGVyLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHJlbG9hZDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBmb3JjZVJlbG9hZCA9IHRydWU7XG5cbiAgICAgICAgICAgIHZhciBmYWtlTG9jYXRpb25FdmVudCA9IHtcbiAgICAgICAgICAgICAgZGVmYXVsdFByZXZlbnRlZDogZmFsc2UsXG4gICAgICAgICAgICAgIHByZXZlbnREZWZhdWx0OiBmdW5jdGlvbiBmYWtlUHJldmVudERlZmF1bHQoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5kZWZhdWx0UHJldmVudGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBmb3JjZVJlbG9hZCA9IGZhbHNlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgIC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ge1xuICAgICAgICAgICAgZGF0YS5wYXRoID0gaW50ZXJwb2xhdGUocm91dGUucmVkaXJlY3RUbywgcm91dGUucGFyYW1zKTtcbiAgICAgICAgICAgIGRhdGEuc2VhcmNoID0gcm91dGUucGFyYW1zO1xuICAgICAgICAgICAgZGF0YS5oYXNSZWRpcmVjdGlvbiA9IHRydWU7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBvbGRQYXRoID0gJGxvY2F0aW9uLnBhdGgoKTtcbiAgICAgICAgICAgIHZhciBvbGRTZWFyY2ggPSAkbG9jYXRpb24uc2VhcmNoKCk7XG4gICAgICAgICAgICB2YXIgbmV3VXJsID0gcm91dGUucmVkaXJlY3RUbyhyb3V0ZS5wYXRoUGFyYW1zLCBvbGRQYXRoLCBvbGRTZWFyY2gpO1xuXG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobmV3VXJsKSkge1xuICAgICAgICAgICAgICBkYXRhLnVybCA9IG5ld1VybDtcbiAgICAgICAgICAgICAgZGF0YS5oYXNSZWRpcmVjdGlvbiA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHJvdXRlLnJlc29sdmVSZWRpcmVjdFRvKSB7XG4gICAgICAgICAgcmV0dXJuICRxLlxuICAgICAgICAgICAgcmVzb2x2ZSgkaW5qZWN0b3IuaW52b2tlKHJvdXRlLnJlc29sdmVSZWRpcmVjdFRvKSkuXG4gICAgICAgICAgICB0aGVuKGZ1bmN0aW9uKG5ld1VybCkge1xuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobmV3VXJsKSkge1xuICAgICAgICAgICAgICAgIGRhdGEudXJsID0gbmV3VXJsO1xuICAgICAgICAgICAgICAgIGRhdGEuaGFzUmVkaXJlY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIGRhdGE7XG4gICAgIC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oge3tjaGFwdGVyLm5hbWV9fTxiciAvPlxuICAgICAgICAgIEJvb2sgSWQ6IHt7Y2hhcHRlci5wYXJhbXMuYm9va0lkfX08YnIgLz5cbiAgICAgICAgICBDaGFwdGVyIElkOiB7e2NoYXB0ZXIucGFyYW1zLmNoYXB0ZXJJZH19XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9maWxlPlxuXG4gICAgICA8ZmlsZSBuYW1lPVwiYW5pbWF0aW9ucy5jc3NcIj5cbiAgICAgICAgLnZpZXctYW5pbWF0ZS1jb250YWluZXIge1xuICAgICAgICAgIHBvc2l0aW9uOnJlbGF0aXZlO1xuICAgICAgICAgIGhlaWdodDoxMDBweCFpbXBvcnRhbnQ7XG4gICAgICAgICAgYmFja2dyb3VuZDp3aGl0ZTtcbiAgICAgICAgICBib3JkZXI6MXB4IHNvbGlkIGJsYWNrO1xuICAgICAgICAgIGhlaWdodDo0MHB4O1xuICAgICAgICAgIG92ZXJmbG93OmhpZGRlbjtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUge1xuICAgICAgICAgIHBhZGRpbmc6MTBweDtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctZW50ZXIsIC52aWV3LWFuaW1hdGUubmctbGVhdmUge1xuICAgICAgICAgIHRyYW5zaXRpb246YWxsIGN1YmljLWJlemllcigwLjI1MCwgMC40NjAsIDAuNDUwLCAwLjk0MCkgMS41cztcblxuICAgICAgICAgIGRpc3BsYXk6YmxvY2s7XG4gICAgICAgICAgd2lkdGg6MTAwJTtcbiAgICAgICAgICBib3JkZXItbGVmdDoxcHggc29saWQgYmxhY2s7XG5cbiAgICAgICAgICBwb3NpdGlvbjphYnNvbHV0ZTtcbiAgICAgICAgICB0b3A6MDtcbiAgICAgICAgICBsZWZ0OjA7XG4gICAgICAgICAgcmlnaHQ6MDtcbiAgICAgICAgICBib3R0b206MDtcbiAgICAgICAgICBwYWRkaW5nOjEwcHg7XG4gICAgICAgIH1cblxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWVudGVyIHtcbiAgICAgICAgICBsZWZ0OjEwMCU7XG4gICAgICAgIH1cbiAgICAgICAgLnZpZXctYW5pbWF0ZS5uZy1lbnRlci5uZy1lbnRlci1hY3RpdmUge1xuICAgICAgICAgIGxlZnQ6MDtcbiAgICAgICAgfVxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWxlYXZlLm5nLWxlYXZlLWFjdGl2ZSB7XG4gICAgICAgICAgbGVmdDotMTAwJTtcbiAgICAgICAgfVxuICAgICAgPC9maWxlPlxuXG4gICAgICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICAgIGFuZ3VsYXIubW9kdWxlKCduZ1ZpZXdFeGFtcGxlJywgWyduZ1JvdXRlJywgJ25nQW5pbWF0ZSddKVxuICAgICAgICAgIC5jb25maWcoWyckcm91dGVQcm92aWRlcicsICckbG9jYXRpb25Qcm92aWRlcicsXG4gICAgICAgICAgICBmdW5jdGlvbigkcm91dGVQcm92aWRlciwgJGxvY2F0aW9uUHJvdmlkZXIpIHtcbiAgICAgICAgICAgICAgJHJvdXRlUHJvdmlkZXJcbiAgICAgICAgICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZCcsIHtcbiAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYm9vay5odG1sJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdCb29rQ3RybCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyQXM6ICdib29rJ1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQvY2gvOmNoYXB0ZXJJZCcsIHtcbiAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnY2hhcHRlci5odG1sJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdDaGFwdGVyQ3RybCcsXG4gICAgICAgICAgICAgICA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gICAgICAgICAgY3VycmVudFNjb3BlID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGN1cnJlbnRFbGVtZW50KSB7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gJGFuaW1hdGUubGVhdmUoY3VycmVudEVsZW1lbnQpO1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbi5kb25lKGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPT0gZmFsc2UpIHByZXZpb3VzTGVhdmVBbmltYXRpb24gPSBudWxsO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gdXBkYXRlKCkge1xuICAgICAgICAgIHZhciBsb2NhbHMgPSAkcm91dGUuY3VycmVudCAmJiAkcm91dGUuY3VycmVudC5sb2NhbHMsXG4gICAgICAgICAgICAgIHRlbXBsYXRlID0gbG9jYWxzICYmIGxvY2Fscy4kdGVtcGxhdGU7XG5cbiAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQodGVtcGxhdGUpKSB7XG4gICAgICAgICAgICB2YXIgbmV3U2NvcGUgPSBzY29wZS4kbmV3KCk7XG4gICAgICAgICAgICB2YXIgY3VycmVudCA9ICRyb3V0ZS5jdXJyZW50O1xuXG4gICAgICAgICAgICAvLyBOb3RlOiBUaGlzIHdpbGwgYWxzbyBsaW5rIGFsbCBjaGlsZHJlbiBvZiBuZy12aWV3IHRoYXQgd2VyZSBjb250YWluZWQgaW4gdGhlIG9yaWdpbmFsXG4gICAgICAgICAgICAvLyBodG1sLiBJZiB0aGF0IGNvbnRlbnQgY29udGFpbnMgY29udHJvbGxlcnMsIC4uLiB0aGV5IGNvdWxkIHBvbGx1dGUvY2hhbmdlIHRoZSBzY29wZS5cbiAgICA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sYXBzaW5nKSxcbiAgICAgICAgICBjb2xsYXBzZWRFeHByID0gJHBhcnNlKGF0dHJzLmNvbGxhcHNlZCksXG4gICAgICAgICAgaG9yaXpvbnRhbCA9IGZhbHNlLFxuICAgICAgICAgIGNzcyA9IHt9LFxuICAgICAgICAgIGNzc1RvID0ge307XG5cbiAgICAgICAgaW5pdCgpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGluaXQoKSB7XG4gICAgICAgICAgaG9yaXpvbnRhbCA9ICEhKCdob3Jpem9udGFsJyBpbiBhdHRycyk7XG4gICAgICAgICAgaWYgKGhvcml6b250YWwpIHtcbiAgICAgICAgICAgIGNzcyA9IHtcbiAgICAgICAgICAgICAgd2lkdGg6ICcnXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY3NzVG8gPSB7d2lkdGg6ICcwJ307XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNzcyA9IHtcbiAgICAgICAgICAgICAgaGVpZ2h0OiAnJ1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGNzc1RvID0ge2hlaWdodDogJzAnfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFzY29wZS4kZXZhbChhdHRycy51aWJDb2xsYXBzZSkpIHtcbiAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2luJylcbiAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWV4cGFuZGVkJywgdHJ1ZSlcbiAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtaGlkZGVuJywgZmFsc2UpXG4gICAgICAgICAgICAgIC5jc3MoY3NzKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBnZXRTY3JvbGxGcm9tRWxlbWVudChlbGVtZW50KSB7XG4gICAgICAgICAgaWYgKGhvcml6b250YWwpIHtcbiAgICAgICAgICAgIHJldHVybiB7d2lkdGg6IGVsZW1lbnQuc2Nyb2xsV2lkdGggKyAncHgnfTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHtoZWlnaHQ6IGVsZW1lbnQuc2Nyb2xsSGVpZ2h0ICsgJ3B4J307XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBleHBhbmQoKSB7XG4gICAgICAgICAgaWYgKGVsZW1lbnQuaGFzQ2xhc3MoJ2NvbGxhcHNlJykgJiYgZWxlbWVudC5oYXNDbGFzcygnaW4nKSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgICRxLnJlc29sdmUoZXhwYW5kaW5nRXhwcihzY29wZSkpXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcygnY29sbGFwc2UnKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcygnY29sbGFwc2luZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCB0cnVlKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWhpZGRlbicsIGZhbHNlKTtcblxuICAgICAgICAgICAgICBpZiAoJGFuaW1hdGVDc3MpIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZUNzcyhlbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICBhZGRDbGFzczogJ2luJyxcbiAgICAgICAgICAgICAgICAgIGVhc2luZzogJ2Vhc2UnLFxuICAgICAgICAgICAgICAgICAgY3NzOiB7XG4gICAgICAgICAgICAgICAgICAgIG92ZXJmbG93OiAnaGlkZGVuJ1xuICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgIHRvOiBnZXRTY3JvbGxGcm9tRWxlbWVudChlbGVtZW50WzBdKVxuICAgICAgICAgICAgICAgIH0pLnN0YXJ0KClbJ2ZpbmFsbHknXShleHBhbmREb25lKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5hZGRDbGFzcyhlbGVtZW50LCAnaW4nLCB7XG4gICAgICAgICAgICAgICAgICBjc3M6IHtcbiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgdG86IGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnRbMF0pXG4gICAgICAgICAgICAgICAgfSkudGhlbihleHBhbmREb25lKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSwgYW5ndWxhci5ub29wKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4cGFuZERvbmUoKSB7XG4gICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcygnY29sbGFwc2luZycpXG4gICAgICAgICAgICAuYWRkQ2xhc3MoJ2NvbGxhcHNlJylcbiAgICAgICAgICAgIC5jc3MoY3NzKTtcbiAgICAgICAgICBleHBhbmRlZEV4cHIoc2NvcGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gY29sbGFwc2UoKSB7XG4gICAgICAgICAgaWYgKCFlbGVtZW50Lmhhc0NsYXNzKCdjb2xsYXBzZScpICYmICFlbGVtZW50Lmhhc0NsYXNzKCdpbicpKSB7XG4gICAgICAgICAgICByZXR1cm4gY29sbGFwc2VEb25lKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgJHEucmVzb2x2ZShjb2xsYXBzaW5nRXhwcihzY29wZSkpXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZWxlbWVudFxuICAgICAgICAgICAgICAvLyBJTVBPUlRBTlQ6IFRoZSB3aWR0aCBtdXN0IGJlIHNldCBiZWZvcmUgYWRkaW5nIFwiY29sbGFwc2luZ1wiIGNsYXNzLlxuICAgICAgICAgICAgICAvLyBPdGhlcndpc2UsIHRoZSBicm93c2VyIGF0dGVtcHRzIHRvIGFuaW1hdGUgZnJvbSB3aWR0aCAwIChpblxuICAgICAgICAgICAgICAvLyBjb2xsYXBzaW5nIGNsYXNzKSB0byB0aGUgZ2l2ZW4gd2lkdGggaGVyZS5cbiAgICAgICAgICAgICAgICAuY3NzKGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnRbMF0pKVxuICAgICAgICAgICAgICAgIC8vIGluaXRpYWxseSBhbGwgcGFuZWwgY29sbGFwc2UgaGF2ZSB0aGUgY29sbGFwc2UgY2xhc3MsIHRoaXMgcmVtb3ZhbFxuICAgICAgICAgICAgICAgIC8vIHByZXZlbnRzIHRoZSBhbmltYXRpb24gZnJvbSBqdW1waW5nIHRvIGNvbGxhcHNlZCBzdGF0ZVxuICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcygnY29sbGFwc2UnKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcygnY29sbGFwc2luZycpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCBmYWxzZSlcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1oaWRkZW4nLCB0cnVlKTtcblxuICAgICAgICAgICAgICBpZiAoJGFuaW1hdGVDc3MpIHtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZUNzcyhlbGVtZW50LCB7XG4gICAgICAgICAgICAgICAgICByZW1vdmVDbGFzczogJ2luJyxcbiAgICAgICAgICAgICAgICAgIHRvOiBjc3NUb1xuICAgICAgICAgICAgICAgIH0pLnN0YXJ0KClbJ2ZpbmFsbHknXShjb2xsYXBzZURvbmUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKGVsZW1lbnQsICdpbicsIHtcbiAgICAgICAgICAgICAgICAgIHRvOiBjc3NUb1xuICAgICAgICAgICAgICAgIH0pLnRoZW4oY29sbGFwc2VEb25lKTtcbiAgICAgICAg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gICAgIGZvcm1hdHRlcjogZnVuY3Rpb24oZGF0ZSkgeyByZXR1cm4gZGF0ZUZpbHRlcihkYXRlLCAncycpOyB9XG4gICAgICB9LFxuICAgICAge1xuICAgICAgICBrZXk6ICdhJyxcbiAgICAgICAgcmVnZXg6ICRsb2NhbGUuREFURVRJTUVfRk9STUFUUy5BTVBNUy5qb2luKCd8JyksXG4gICAgICAgIGFwcGx5OiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgIGlmICh0aGlzLmhvdXJzID09PSAxMikge1xuICAgICAgICAgICAgdGhpcy5ob3VycyA9IDA7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHZhbHVlID09PSAnUE0nKSB7XG4gICAgICAgICAgICB0aGlzLmhvdXJzICs9IDEyO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZm9ybWF0dGVyOiBmdW5jdGlvbihkYXRlKSB7IHJldHVybiBkYXRlRmlsdGVyKGRhdGUsICdhJyk7IH1cbiAgICAgIH0sXG4gICAgICB7XG4gICAgICAgIGtleTogJ1onLFxuICAgICAgICByZWdleDogJ1srLV1cXFxcZHs0fScsXG4gICAgICAgIGFwcGx5OiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgIHZhciBtYXRjaGVzID0gdmFsdWUubWF0Y2goLyhbKy1dKShcXGR7Mn0pKFxcZHsyfSkvKSxcbiAgICAgICAgICAgIHNpZ24gPSBtYXRjaGVzWzFdLFxuICAgICAgICAgICAgaG91cnMgPSBtYXRjaGVzWzJdLFxuICAgICAgICAgICAgbWludXRlcyA9IG1hdGNoZXNbM107XG4gICAgICAgICAgdGhpcy5ob3VycyArPSB0b0ludChzaWduICsgaG91cnMpO1xuICAgICAgICAgIHRoaXMubWludXRlcyArPSB0b0ludChzaWduICsgbWludXRlcyk7XG4gICAgICAgIH0sXG4gICAgICAgIGZvcm1hdHRlcjogZnVuY3Rpb24oZGF0ZSkge1xuICAgICAgICAgIHJldHVybiBkYX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cbiAgICAgICAgICAgICAgcmVnZXhbaV0gPSAnJztcbiAgICAgICAgICAgICAgaW5MaXRlcmFsID0gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGZvcm1hdFtpXSA9ICckJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZm9ybWF0W2ldID09PSAnXFwnJykgeyAvLyBzdGFydCBvZiBsaXRlcmFsXG4gICAgICAgICAgICBmb3JtYXRbaV0gPSAnJCc7XG4gICAgICAgICAgICByZWdleFtpXSA9ICcnO1xuICAgICAgICAgICAgaW5MaXRlcmFsID0gdHJ1ZTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZm9ybWF0ID0gZm9ybWF0LmpvaW4oJycpO1xuICAgIH1cblxuICAgIGFuZ3VsYXIuZm9yRWFjaChmb3JtYXRDb2RlVG9SZWdleCwgZnVuY3Rpb24oZGF0YSkge1xuICAgICAgdmFyIGluZGV4ID0gZm9ybWF0LmluZGV4T2YoZGF0YS5rZXkpO1xuXG4gICAgICBpZiAoaW5kZXggPiAtMSkge1xuICAgICAgICBmb3JtYXQgPSBmb3JtYXQuc3BsaXQoJycpO1xuXG4gICAgICAgIHJlZ2V4W2luZGV4XSA9ICcoJyArIGRhdGEucmVnZXggKyAnKSc7XG4gICAgICAgIGZvcm1hdFtpbmRleF0gPSAnJCc7IC8vIEN1c3RvbSBzeW1ib2wgdG8gZGVmaW5lIGNvbnN1bWVkIHBhcnQgb2YgZm9ybWF0XG4gICAgICAgIGZvciAodmFyIGkgPSBpbmRleCArIDEsIG4gPSBpbmRleCArIGRhdGEua2V5Lmxlbmd0aDsgaSA8IG47IGkrKykge1xuICAgICAgICAgIHJlZ2V4W2ldID0gJyc7XG4gICAgICAgICAgZm9ybWF0W2ldID0gJyQnO1xuICAgICAgICB9XG4gICAgICAgIGZvcm1hdCA9IGZvcm1hdC5qb2luKCcnKTtcblxuICAgICAgICBtYX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F0YVtleHBdO1xuICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICB2YXIgd2F0Y2hGbiA9IGZ1bmN0aW9uKGNvbXBhcmVXaXRoVmFsKSB7XG4gICAgICAgICAgICB2YXIgbmV3QWN0aXZhdGVkID0gbnVsbDtcbiAgICAgICAgICAgIGluc3RhbmNlcy5zb21lKGZ1bmN0aW9uKGluc3RhbmNlKSB7XG4gICAgICAgICAgICAgIHZhciB0aGlzVmFsID0gaW5zdGFuY2Uuc2NvcGUuJGV2YWwob25FeHApO1xuICAgICAgICAgICAgICBpZiAodGhpc1ZhbCA9PT0gY29tcGFyZVdpdGhWYWwpIHtcbiAgICAgICAgICAgICAgICBuZXdBY3RpdmF0ZWQgPSBpbnN0YW5jZTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoZGF0YS5sYXN0QWN0aXZhdGVkICE9PSBuZXdBY3RpdmF0ZWQpIHtcbiAgICAgICAgICAgICAgaWYgKGRhdGEubGFzdEFjdGl2YXRlZCkge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKGRhdGEubGFzdEFjdGl2YXRlZC5lbGVtZW50LCBjbGF6eik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgaWYgKG5ld0FjdGl2YXRlZCkge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmFkZENsYXNzKG5ld0FjdGl2YXRlZC5lbGVtZW50LCBjbGF6eik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgZGF0YS5sYXN0QWN0aXZhdGVkID0gbmV3QWN0aXZhdGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgICAgZXhwVG9EYXRhW2V4cF0gPSBkYXRhID0ge1xuICAgICAgICAgICAgbGFzdEFjdGl2YXRlZDogbnVsbCxcbiAgICAgICAgICAgIHNjb3BlOiBzY29wZSxcbiAgICAgICAgICAgIHdhdGNoRm46IHdhdGNoRm4sXG4gICAgICAgICAgICBjb21wYXJlV2l0aEV4cDogY29tcGFyZVdpdGhFeHAsXG4gICAgICAgICAgICB3YXRjaGVyOiBzY29wZS4kd2F0Y2goY29tcGFyZVdpdGhFeHAsIHdhdGNoRm4pXG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBkYXRhLndhdGNoRm4oc2NvcGUuJGV2YWwoY29tcGFyZVdpdGhFeHApKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gcmVtb3ZlU2NvcGUoZSkge1xuICAgICAgICB2YXIgcmVtb3ZlZFNjb3BlID0gZS50YXJnZXRTY29wZTtcbiAgICAgICAgdmFyIGluZGV4ID0gbGlua2VkU2NvcGVzLmluZGV4T2YocmVtb3ZlZFNjb3BlKTtcbiAgICAgICAgbGlua2VkU2NvcGVzLnNwbGljZShpbmRleCwgMSk7XG4gICAgICAgIGluc3RhbmNlcy5zcGxpY2UoaW5kZXgsIDEpO1xuICAgICAgICBpZiAobGlua2VkU2NvcGVzLmxlbmd0aCkge1xuICAgICAgICAgIHZhciBuZXdXYXRjaFNjb3BlID0gbGlua2VkU2NvcGVzWzBdO1xuICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChleHBUb0RhdGEsIGZ1bmN0aW9uKGRhdGEpIHtcbiAgICAgICAgICAgIGlmIChkYXRhLnNjb3BlID09PSByZW1vdmVkU2NvcGUpIHtcbiAgICAgICAgICAgICAgZGF0YS53YXRjaGVyID0gbmV3V2F0Y2hTY29wZS4kd2F0Y2goZGF0YS5jb21wYXJlV2l0aEV4cCwgZGF0YS53YXRjaEZuKTtcbiAgICAgICAgICAgICAgZGF0YS5zY29wZSA9IG5ld1dhdGNoU2NvcGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgZXhwVG9EYXRhID0ge307XG4gICAgICA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kdGggPD0gdmlld3BvcnRPZmZzZXQubGVmdCkge1xuICAgICAgICAgICAgICAgIHBsYWNlbWVudFsxXSA9ICdyaWdodCc7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHZhciB5T3ZlcmZsb3cgPSBob3N0RWxlbVBvcy5oZWlnaHQgLyAyIC0gYWRqdXN0ZWRTaXplLmhlaWdodCAvIDI7XG4gICAgICAgICAgICAgIGlmICh2aWV3cG9ydE9mZnNldC50b3AgKyB5T3ZlcmZsb3cgPCAwICYmIGFkanVzdGVkU2l6ZS5oZWlnaHQgLSBob3N0RWxlbVBvcy5oZWlnaHQgPD0gdmlld3BvcnRPZmZzZXQuYm90dG9tKSB7XG4gICAgICAgICAgICAgICAgcGxhY2VtZW50WzFdID0gJ3RvcCc7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodmlld3BvcnRPZmZzZXQuYm90dG9tICsgeU92ZXJmbG93IDwgMCAmJiBhZGp1c3RlZFNpemUuaGVpZ2h0IC0gaG9zdEVsZW1Qb3MuaGVpZ2h0IDw9IHZpZXdwb3J0T2Zmc2V0LnRvcCkge1xuICAgICAgICAgICAgICAgIHBsYWNlbWVudFsxXSA9ICdib3R0b20nO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgc3dpdGNoIChwbGFjZW1lbnRbMF0pIHtcbiAgICAgICAgICBjYXNlICd0b3AnOlxuICAgICAgICAgICAgdGFyZ2V0RWxlbVBvcy50b3AgPSBob3N0RWxlbVBvcy50b3AgLSB0YXJnZXRIZWlnaHQ7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdib3R0b20nOlxuICAgICAgICAgICAgdGFyZ2V0RWxlbVBvcy50b3AgPSBob3N0RWxlbVBvcy50b3AgKyBob3N0RWxlbVBvcy5oZWlnaHQ7XG4gICAgICAgICAgICBicmVhaztcb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XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBlbnRyaWVzOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhtYXApLm1hcChmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgICAgICAgICB2YWx1ZTogbWFwW2tleV1cbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBtYXBba2V5XTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGhhc0tleTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICByZXR1cm4gISFtYXBba2V5XTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGtleXM6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKG1hcCk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBwdXQ6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIGlmICghbWFwW2tleV0pIHtcbiAgICAgICAgICAgICAgbWFwW2tleV0gPSBbXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbWFwW2tleV0ucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICByZW1vdmU6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBtYXBba2V5XTtcblxuICAgICAgICAgICAgaWYgKCF2YWx1ZXMpIHtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgaWR4ID0gdmFsdWVzLmluZGV4T2YodmFsdWUpO1xuXG4gICAgICAgICAgICBpZiAoaWR4ICE9PS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G8sIHtcbiAgICAgICAgICBzY29wZTogZHJvcGRvd25TY29wZVxuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgb3BlbmVkQ29udGFpbmVycy5wdXQoYXBwZW5kVG8sIHtcbiAgICAgICAgc2NvcGU6IGRyb3Bkb3duU2NvcGVcbiAgICAgIH0pO1xuICAgIH1cbiAgfTtcblxuICB0aGlzLmNsb3NlID0gZnVuY3Rpb24oZHJvcGRvd25TY29wZSwgZWxlbWVudCwgYXBwZW5kVG8pIHtcbiAgICBpZiAob3BlblNjb3BlID09PSBkcm9wZG93blNjb3BlKSB7XG4gICAgICAkZG9jdW1lbnQub2ZmKCdjbGljaycsIGNsb3NlRHJvcGRvd24pO1xuICAgICAgJGRvY3VtZW50Lm9mZigna2V5ZG93bicsIHRoaXMua2V5YmluZEZpbHRlcik7XG4gICAgICBvcGVuU2NvcGUgPSBudWxsO1xuICAgIH1cblxuICAgIGlmICghYXBwZW5kVG8pIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICB2YXIgb3BlbmVkRHJvcGRvd25zID0gb3BlbmVkQ29udGFpbmVycy5nZXQoYXBwZW5kVG8pO1xuICAgIGlmIChvcGVuZWREcm9wZG93bnMpIHtcbiAgICAgIHZhciBkcm9wZG93blRvQ2xvc2UgPSBvcGVuZWREcm9wZG93bnMucmVkdWNlKGZ1bmN0aW9uKHRvQ2xvc2UsIGRyb3Bkb3duKSB7XG4gICAgICAgIGlmIChkcm9wZG93bi5zY29wZSA9PT0gZHJvcGRvd25TY29wZSkge1xuICAgICAgICAgIHJldHVybiBkcm9wZG93bjtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0b0Nsb3NlO1xuICAgICAgfSwge30pO1xuICAgICAgaWYgKGRyb3Bkb3duVG9DbG9zZSkge1xuICAgICAgICBvcGVuZWRDb250YWluZXJzLnJlbW92ZShhcHBlbmRUbywgZHJvcGRvd25Ub0Nsb3NlKTtcbiAgICAgIH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gICAgIH0pO1xuICAgIH1cbiAgfTtcbn0pO1xuXG5hbmd1bGFyLm1vZHVsZSgndWkuYm9vdHN0cmFwLnN0YWNrZWRNYXAnLCBbXSlcbi8qKlxuICogQSBoZWxwZXIsIGludGVybmFsIGRhdGEgc3RydWN0dXJlIHRoYXQgYWN0cyBhcyBhIG1hcCBidXQgYWxzbyBhbGxvd3MgZ2V0dGluZyAvIHJlbW92aW5nXG4gKiBlbGVtZW50cyBpbiB0aGUgTElGTyBvcmRlclxuICovXG4gIC5mYWN0b3J5KCckJHN0YWNrZWRNYXAnLCBmdW5jdGlvbigpIHtcbiAgICByZXR1cm4ge1xuICAgICAgY3JlYXRlTmV3OiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHN0YWNrID0gW107XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBhZGQ6IGZ1bmN0aW9uKGtleSwgdmFsdWUpIHtcbiAgICAgICAgICAgIHN0YWNrLnB1c2goe1xuICAgICAgICAgICAgICBrZXk6IGtleSxcbiAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGdldDogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0YWNrW2ldLmtleSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBzdGFja1tpXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAga2V5czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIga2V5cyA9IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGFjay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICBrZXlzLnB1c2goc3RhY2tbaV0ua2V5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBrZXlzO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgdG9wOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHJldHVybiBzdGFja1tzdGFjay5sZW5ndGggLSAxXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICB2YXIgaWR4ID0gLTE7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0YWNrW2ldLmtleSkge1xuICAgICAgICAgICAgICAgIGlkeCA9IGk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBzdGFjay5zcGxpY2UoaWR4LCAxKVswXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZVRvcDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RhY2sucG9wKCk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBsZW5ndGg6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHN0YWNrLmxlbmd0aDtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfTtcbiAgfSk7XG5hbmd1bGFyLm1vZHVsZSgndWkuYm9vdHN0cmFwLm1vZGFsJywgWyd1aS5ib290c3RyYXAubXVsdGlNYXAnLCAndWkuYm9vdHN0cmFwLnN0YWNrZWRNYXAnLCAndWkuYm9vdHN0cmFwLnBvc2l0aW9uJ10pXG4vKipcbiAqIFBsdWdnYWJsZSByZXNvbHZlIG1lY2hhbmlzbSBmb3IgdGhlIG1vZGFsIHJlc29sdmUgcmVzb2x1dGlvblxuICogU3VwcG9ydHMgVUkgUm91dGVyJ3MgJHJlc29sdmUgc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IHNjb3BlLiRicm9hZGNhc3QoJG1vZGFsU3RhY2suTk9XX0NMT1NJTkdfRVZFTlQsIHNldElzQXN5bmMpO1xuXG4gICAgICAgIC8vIE5vdGUgdGhhdCBpdCdzIGludGVudGlvbmFsIHRoYXQgYXN5bmNQcm9taXNlIG1pZ2h0IGJlIG51bGwuXG4gICAgICAgIC8vIFRoYXQncyB3aGVuIHNldElzQXN5bmMgaGFzIG5vdCBiZWVuIGNhbGxlZCBkdXJpbmcgdGhlXG4gICAgICAgIC8vIE5PV19DTE9TSU5HX0VWRU5UIGJyb2FkY2FzdC5cbiAgICAgICAgcmV0dXJuICRxLndoZW4oYXN5bmNQcm9taXNlKS50aGVuKGFmdGVyQW5pbWF0aW5nKTtcblxuICAgICAgICBmdW5jdGlvbiBhZnRlckFuaW1hdGluZygpIHtcbiAgICAgICAgICBpZiAoYWZ0ZXJBbmltYXRpbmcuZG9uZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICBhZnRlckFuaW1hdGluZy5kb25lID0gdHJ1ZTtcblxuICAgICAgICAgICRhbmltYXRlLmxlYXZlKGRvbUVsKS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHtcbiAgICAgICAgICAgICAgZG9uZSgpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBkb21FbC5yZW1vdmUoKTtcbiAgICAgICAgICAgIGlmIChjbG9zZWREZWZlcnJlZCkge1xuICAgICAgICAgICAgICBjbG9zZWREZWZlcnJlZC5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBzY29wZS4kZGVzdHJveSgpO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgICRkb2N1bWVudC5vbigna2V5ZG93bicsIGtleWRvd25MaXN0ZW5lcik7XG5cbiAgICAgICRyb290U2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAkZG9jdW1lbnQub2ZmKCdrZXlkb3duJywga2V5ZG93bkxpc3RlbmVyKTtcbiAgICAgIH0pO1xuXG4gICAgICBmdW5jdGlvbiBrZXlkb3duTGlzdGVuZXIoZXZ0KSB7XG4gICAgICAgIGlmIChldnQuaXNEZWZhdWx0UHJldmVudGVkKCkpIHtcbiAgICAgICAgICByZXR1cm4gZXZ0O1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIG1vZGFsID0gb3BlbmVkV2luZG93cy50b3AoKTtcbiAgICAgICAgaWYgKG1vZGFsKSB7XG4gICAgICAgICAgc3dpdGNoIChldnQud2hpY2gpIHtcbiAgICAgICAgICAgIGNhc2UgMjc6IHtcbiAgICAgICAgICAgICAgaWYgKG1vZGFsLnZhbHVlLmtleWJvYXJkKSB7XG4gICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSwgJ2VzY2FwZSBrZXkgcHJlc3MnKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhc2UgOToge1xuICAgICAgICAgICAgICB2YXIgbGlzdCA9ICRtb2RhbFN0YWNrLmxvYWRGb2N1c0VsZW1lbnRMaXN0KG1vZGFsKTtcbiAgICAgICAgICAgICAgdmFyIGZvY3VzQ2hhbmdlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICBpZiAoZXZ0LnNoaWZ0S2V5KSB7XG4gICAgICAgICAgICAgICAgaWYgKCRtb2RhbFN0YWNrLmlzRm9jdXNJbkZpcnN0SXRlbShldnQsIGxpc3QpIHx8ICRtb2RhbFN0YWNrLmlzTW9kYWxGb2N1c2VkKGV2dCwgbW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RbMF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgfTtcblxuICAgICAgJG1vZGFsU3RhY2suaXNGb2N1c0luTGFzdEl0ZW0gPSBmdW5jdGlvbihldnQsIGxpc3QpIHtcbiAgICAgICAgaWYgKGxpc3QubGVuZ3RoID4gMCkge1xuICAgICAgICAgIHJldHVybiAoZXZ0LnRhcmdldCB8fCBldnQuc3JjRWxlbWVudCkgPT09IGxpc3RbbGlzdC5sZW5ndGggLSAxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9O1xuXG4gICAgICAkbW9kYWxTdGFjay5sb2FkRm9jdXNFbGVtZW50TGlzdCA9IGZ1bmN0aW9uKG1vZGFsV2luZG93KSB7XG4gICAgICAgIGlmIChtb2RhbFdpbmRvdykge1xuICAgICAgICAgIHZhciBtb2RhbERvbUUxID0gbW9kYWxXaW5kb3cudmFsdWUubW9kYWxEb21FbDtcbiAgICAgICAgICBpZiAobW9kYWxEb21FMSAmJiBtb2RhbERvbUUxLmxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIGVsZW1lbnRzID0gbW9kYWxEb21FMVswXS5xdWVyeVNlbGVjdG9yQWxsKHRhYmJhYmxlU2VsZWN0b3IpO1xuICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnRzID9cbiAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLmZpbHRlci5jYWxsKGVsZW1lbnRzLCBmdW5jdGlvbihlbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGlzVmlzaWJsZShlbGVtZW50KTtcbiAgICAgICAgICAgICAgfSkgOiBlbGVtZW50cztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHJldHVybiAkbW9kYWxTdGFjaztcbiAgICB9XSlcblxuICAucHJvdmlkZXIoJyR1aWJNb2RhbCcsIGZ1bmN0aW9uKCkge1xuICAgIHZhciAkbW9kY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vZGFsT3B0aW9ucykge1xuICAgICAgICAgICAgdmFyIG1vZGFsUmVzdWx0RGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuICAgICAgICAgICAgdmFyIG1vZGFsT3BlbmVkRGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuICAgICAgICAgICAgdmFyIG1vZGFsQ2xvc2VkRGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuICAgICAgICAgICAgdmFyIG1vZGFsUmVuZGVyRGVmZXJyZWQgPSAkcS5kZWZlcigpO1xuXG4gICAgICAgICAgICAvL3ByZXBhcmUgYW4gaW5zdGFuY2Ugb2YgYSBtb2RhbCB0byBiZSBpbmplY3RlZCBpbnRvIGNvbnRyb2xsZXJzIGFuZCByZXR1cm5lZCB0byBhIGNhbGxlclxuICAgICAgICAgICAgdmFyIG1vZGFsSW5zdGFuY2UgPSB7XG4gICAgICAgICAgICAgIHJlc3VsdDogbW9kYWxSZXN1bHREZWZlcnJlZC5wcm9taXNlLFxuICAgICAgICAgICAgICBvcGVuZWQ6IG1vZGFsT3BlbmVkRGVmZXJyZWQucHJvbWlzZSxcbiAgICAgICAgICAgICAgY2xvc2VkOiBtb2RhbENsb3NlZERlZmVycmVkLnByb21pc2UsXG4gICAgICAgICAgICAgIHJlbmRlcmVkOiBtb2RhbFJlbmRlckRlZmVycmVkLnByb21pc2UsXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbiAocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICRtb2RhbFN0YWNrLmNsb3NlKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRpc21pc3M6IGZ1bmN0aW9uIChyZWFzb24pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJG1vZGFsU3RhY2suZGlzbWlzcyhtb2RhbEluc3RhbmNlLCByZWFzb24pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gIC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Jlc29sdmVXaXRoVGVtcGxhdGUsIHJlc29sdmVXaXRoVGVtcGxhdGUpXG4gICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIHJlc29sdmVTdWNjZXNzKHRwbEFuZFZhcnMpIHtcbiAgICAgICAgICAgICAgICB2YXIgcHJvdmlkZWRTY29wZSA9IG1vZGFsT3B0aW9ucy5zY29wZSB8fCAkcm9vdFNjb3BlO1xuXG4gICAgICAgICAgICAgICAgdmFyIG1vZGFsU2NvcGUgPSBwcm92aWRlZFNjb3BlLiRuZXcoKTtcbiAgICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRjbG9zZSA9IG1vZGFsSW5zdGFuY2UuY2xvc2U7XG4gICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kZGlzbWlzcyA9IG1vZGFsSW5zdGFuY2UuZGlzbWlzcztcblxuICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgaWYgKCFtb2RhbFNjb3BlLiQkdWliRGVzdHJ1Y3Rpb25TY2hlZHVsZWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kZGlzbWlzcygnJHVpYlVuc2NoZWR1bGVkRGVzdHJ1Y3Rpb24nKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHZhciBtb2RhbCA9IHtcbiAgICAgICAgICAgICAgICAgIHNjb3BlOiBtb2RhbFNjb3BlLFxuICAgICAgICAgICAgICAgICAgZGVmZXJyZWQ6IG1vZGFsUmVzdWx0RGVmZXJyZWQsXG4gICAgICAgICAgICAgICAgICByZW5kZXJEZWZlcnJlZDogbW9kYWxSZW5kZXJEZWZlcnJlZCxcbiAgICAgICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkOiBtb2RhbENsb3NlZERlZmVycmVkLFxuICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBtb2RhbE9wdGlvbnMuYW5pbWF0aW9uLFxuICAgICAgICAgICAgICAgICAgYmFja2Ryb3A6IG1vZGFsT3B0aW9ucy5iYWNrZHJvcCxcbiAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBtb2RhbE9wdGlvbnMua2V5Ym9hcmQsXG4gICAgICAgICAgICAgICAgICBiYWNrZHJvcENsYXNzOiBtb2RhbE9wdGlvbnMuYmFja2Ryb3BDbGFzcyxcbiAgICAgICAgICAgICAgICAgIHdpbmRvd1RvcENsYXNzOiBtb2RhbE9wdGlvbnMud2luZG93VG9wQ2xhc3MsXG4gICAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogbW9kYWxPcHRpb25zLndpbmRvd0NsYXNzLFxuICAgICAgICAgICAgICAgICAgd2luZG93VGVtcGxhdGVVcmw6IG1vZGFsT3B0aW9ucy53aW5kb3dUZW1wbGF0ZVVybCxcbiAgICAgICAgICAgICAgICAgIGFyaWFMYWJlbGxlZEJ5OiBtb2RhbE9wdGlvbnMuYXJpYUxhYmVsbGVkQnksXG4gICAgICAgICAgICAgICAgICBhcmlhRGVzY3JpYmVkQnk6IG1vZGFsT3B0aW9ucy5hcmlhRGVzY3JpYmVkQnksXG4gICAgICAgICAgICAgICAgICBzaXplOiBtb2RhbE9wdGlvbnMuc2l6ZSxcbiAgICAgICAgICAgICAgICAgIG9wZW5lZENsYXNzOiBtb2RhbE9wdGlvbnMub3BlbmVkQ2xhc3MsXG4gICAgICAgICAgICAgICAgICBhcHBlbmRUbzogbW9kYWxPcHRpb25zLmFwcGVuZFRvXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHZhciBjb21wb25lbnQgPSB7fTtcbiAgICAgICAgICAgICAgICB2YXIgY3RybEluc3RhbmNlLCBjdHJsSW5zdGFudGlhdGUsIGN0cmxMb2NhbHMgPSB7fTtcblxuICAgICAgICAgICAgICAgIGlmIChtb2RhbE9wdGlvbnMuY29tcG9uZW50KSB7XG4gICA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RybEluc3RhbmNlLiRkaXNtaXNzID0gbW9kYWxTY29wZS4kZGlzbWlzcztcbiAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoY3RybEluc3RhbmNlLCB7XG4gICAgICAgICAgICAgICAgICAgICAgJHJlc29sdmU6IGN0cmxMb2NhbHMuJHNjb3BlLiRyZXNvbHZlXG4gICAgICAgICAgICAgICAgICAgIH0sIHByb3ZpZGVkU2NvcGUpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSBjdHJsSW5zdGFudGlhdGUoKTtcblxuICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihjdHJsSW5zdGFuY2UuJG9uSW5pdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY3RybEluc3RhbmNlLiRvbkluaXQoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIW1vZGFsT3B0aW9ucy5jb21wb25lbnQpIHtcbiAgICAgICAgICAgICAgICAgIG1vZGFsLmNvbnRlbnQgPSB0cGxBbmRWYXJzWzBdO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLm9wZW4obW9kYWxJbnN0YW5jZSwgbW9kYWwpO1xuICAgICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVzb2x2ZSh0cnVlKTtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNvbnN0cnVjdExvY2FscyhvYmosIHRlbXBsYXRlLCBpbnN0YW5jZU9uU2NvcGUsIGluamVjdGFibGUpIHtcbiAgICAgICAgICAgICAgICAgIG9iai4kc2NvcGUgPSBtb2RhbFNjb3BlO1xuICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZS4kcmVzb2x2ZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgaWYgKGluc3RhbmNlT25TY29wZSkge1xuICAgICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiR1aWJNb2RhbEluc3RhbmNlID0gbW9kYWxJbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9iai4kdWliTW9kYWxJbnN0YW5jZSA9IG1vZGFsSW5zdGFuY2U7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIHZhciByZXNvbHZlcyA9IHRlbXBsYXRlID8gdHBsQW5kVmFyc1sxXSA6IHRwbEFuZFZhcnM7XG4gICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gocmVzb2x2ZXMsIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluamVjdGFibGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICBvYmpba2V5XSA9IHZhbHVlO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZS4kcmVzb2x2ZVtrZXldID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBmdW5jdGlvbiByZXNvbHZlRXJyb3IocmVhc29uKSB7XG4gICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVqZWN0KHJlYXNvbik7XG4gICAgICAgICAgICAgIG1vZGFsUmVzdWx0RGVmZXJyZWQucmVqZWN0KHJlYXNvbik7XG4gICAgICAgICAgICB9KVsnZmluYWxseSddKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAocHJvbWlzZUNoYWluID09PSBzYW1lUHJvbWlzZSkge1xuICAgICAgICAgICAgICAgIHByb21pc2VDaGFpbiA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gbW9kYWxJbnN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F0aW9uLWNsYXNzPVwiZmFkZVwiJyArXG4gICAgICAgICAgJ3VpYi10b29sdGlwLWNsYXNzZXMgJyArXG4gICAgICAgICAgJ25nLWNsYXNzPVwieyBpbjogaXNPcGVuIH1cIiAnICtcbiAgICAgICAgICAnPicgK1xuICAgICAgICAnPC9kaXY+JztcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgY29tcGlsZTogZnVuY3Rpb24odEVsZW0sIHRBdHRycykge1xuICAgICAgICAgIHZhciB0b29sdGlwTGlua2VyID0gJGNvbXBpbGUodGVtcGxhdGUpO1xuXG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIGxpbmsoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCB0b29sdGlwQ3RybCkge1xuICAgICAgICAgICAgdmFyIHRvb2x0aXA7XG4gICAgICAgICAgICB2YXIgdG9vbHRpcExpbmtlZFNjb3BlO1xuICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25UaW1lb3V0O1xuICAgICAgICAgICAgdmFyIHNob3dUaW1lb3V0O1xuICAgICAgICAgICAgdmFyIGhpZGVUaW1lb3V0O1xuICAgICAgICAgICAgdmFyIHBvc2l0aW9uVGltZW91dDtcbiAgICAgICAgICAgIHZhciBhZGp1c3RtZW50VGltZW91dDtcbiAgICAgICAgICAgIHZhciBhcHBlbmRUb0JvZHkgPSBhbmd1bGFyLmlzRGVmaW5lZChvcHRpb25zLmFwcGVuZFRvQm9keSkgPyBvcHRpb25zLmFwcGVuZFRvQm9keSA6IGZhbHNlO1xuICAgICAgICAgICAgdmFyIHRyaWdnZXJzID0gZ2V0VHJpZ2dlcnModW5kZWZpbmVkKTtcbiAgICAgICAgICAgIHZhciBoYXNFbmFibGVFeHAgPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRyc1twcmVmaXggKyAnRW5hYmxlJ10pO1xuICAgICAgICAgICAgdmFyIHR0U2NvcGUgPSBzY29wZS4kbmV3KHRydWUpO1xuICAgICAgICAgICAgdmFyIHJlc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AgICB2YXIgZWxlbWVudFBvcyA9IGFwcGVuZFRvQm9keSA/ICRwb3NpdGlvbi5vZmZzZXQoZWxlbWVudCkgOiAkcG9zaXRpb24ucG9zaXRpb24oZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICB0b29sdGlwLmNzcyh7IHRvcDogdHRQb3NpdGlvbi50b3AgKyAncHgnLCBsZWZ0OiB0dFBvc2l0aW9uLmxlZnQgKyAncHgnIH0pO1xuICAgICAgICAgICAgICAgICAgdmFyIHBsYWNlbWVudENsYXNzZXMgPSB0dFBvc2l0aW9uLnBsYWNlbWVudC5zcGxpdCgnLScpO1xuXG4gICAgICAgICAgICAgICAgICBpZiAoIXRvb2x0aXAuaGFzQ2xhc3MocGxhY2VtZW50Q2xhc3Nlc1swXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmVDbGFzcyhsYXN0UGxhY2VtZW50LnNwbGl0KCctJylbMF0pO1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmFkZENsYXNzKHBsYWNlbWVudENsYXNzZXNbMF0pO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBpZiAoIXRvb2x0aXAuaGFzQ2xhc3Mob3B0aW9ucy5wbGFjZW1lbnRDbGFzc1ByZWZpeCArIHR0UG9zaXRpb24ucGxhY2VtZW50KSkge1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZUNsYXNzKG9wdGlvbnMucGxhY2VtZW50Q2xhc3NQcmVmaXggKyBsYXN0UGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5hZGRDbGFzcyhvcHRpb25zLnBsYWNlbWVudENsYXNzUHJlZml4ICsgdHRQb3NpdGlvbi5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICBhZGp1c3RtZW50VGltZW91dCA9ICR0aW1lb3V0KGZ1bmN0aW9uKCkge1xuICA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WFzdXJlJyk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxhc3RQbGFjZW1lbnQgIT09IHR0UG9zaXRpb24ucGxhY2VtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICRwb3NpdGlvbi5wb3NpdGlvbkFycm93KHRvb2x0aXAsIHR0UG9zaXRpb24ucGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGxhc3RQbGFjZW1lbnQgPSB0dFBvc2l0aW9uLnBsYWNlbWVudDtcblxuICAgICAgICAgICAgICAgICAgcG9zaXRpb25UaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgICB9LCAwLCBmYWxzZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIC8vIFNldCB1cCB0aGUgY29ycmVjdCBzY29wZSB0byBhbGxvdyB0cmFuc2NsdXNpb24gbGF0ZXJcbiAgICAgICAgICAgIHR0U2NvcGUub3JpZ1Njb3BlID0gc2NvcGU7XG5cbiAgICAgICAgICAgIC8vIEJ5IGRlZmF1bHQsIHRoZSB0b29sdGlwIGlzIG5vdCBvcGVuLlxuICAgICAgICAgICAgLy8gVE9ETyBhZGQgYWJpbGl0eSB0byBzdGFydCB0b29sdGlwIG9wZW5lZFxuICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSBmYWxzZTtcblxuICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVG9vbHRpcEJpbmQoKSB7XG4gICAgICAgICAgICAgIGlmICghdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICBzaG93VG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBTaG93IHRoZSB0b29sdGlwIHdpdGggZGVsYXkgaWYgc3BlY2lmaWVkLCBvdGhlcndpc2Ugc2hvdyBpdCBpbW1lZGlhdGVseVxuICAgICAgICAgICAgZnVuY3Rpb24gc2hvd1Rvb2x0aXBCaW5kKCkge1xuICAgICAgICAgICAgICBpZiAoaGFzRW5hYmxlRXhwICYmICFzY29wZS4kZXZhbChhdHRyc1twcmVmaXggKyAnRW5hYmxlJ10pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuICAgICAgICAgICAgICBwcmVwYXJlVG9vbHRpcCgpO1xuXG4gICAgICAgICAgICAgIGlmICh0dFNjb3BlLnBvcHVwRGVsYXkpIHtcbiAgICAgICAgICAgICAgICAvLyBEbyBub3RoaW5nIGlmIHRoZSB0b29sdGlwIHdhcyBhbHJlYWR5IHNjaGVkdWxlZCB0byBwb3AtdXAuXG4gICAgICAgICAgICAgICAgLy8gVGhpcyBoYXBwZW5zIGlmIHNob3cgaXMgdHJpZ2dlcmVkIG11bHRpcGxlIHRpbWVzIGJlZm9yZSBhbnkgaGlkZSBpcyB0cmlnZ2VyZWQuXG4gICAgICAgICAgICAgICAgaWYgKCFzaG93VGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgc2hvd1RpbWVvdXQgPSAkdGltZW91dChzaG93LCB0dFNjb3BlLnBvcHVwRGVsYXksIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc2hvdygpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVUb29sdGlwQmluZCgpIHtcbiAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuXG4gICAgICAgICAgICAgIGlmICh0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSkge1xuICAgICAgICAgICAgICAgIGlmICghaGlkZVRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAgIGhpZGVUaW1lb3V0ID0gJHRpbWVvdXQoaGlkZSwgdHRTY29wZS5wb3B1cENsb3NlRGVsYXksIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHNob3coKSB7XG4gICAgICAgICAgICAgIGNhbmNlbFNob3coKTtcbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuXG4gICAgICAgICAgICAgIC8vIERvbid0IHNob3cgZW1wdHkgdG9vbHRpcHMuXG4gICAgICAgICAgICAgIGlmICghdHRTY29wZS5jb250ZW50KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGFuZ3VsYXIubm9vcDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGNyZWF0ZVRvb2x0aXAoKTtcblxuICAgICAgICAgICAgICAvLyBBbmQgc2hvdyB0aGUgdG9vbHRpcC5cbiAgICAgICAgICAgICAgdHRTY29wZS4kZXZhbEFzeW5jKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuaXNPcGVuID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBhc3NpZ25Jc09wZW4odHJ1ZSk7XG4gICAgICAgICAgICAgICAgcG9zaXRpb25Ub29sdGlwKCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjYW5jZWxTaG93KCkge1xuICAgICAgICAgICAgICBpZiAoc2hvd1RpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoc2hvd1RpbWVvdXQpO1xuICAgICAgICAgICAgICAgIHNob3dUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmIChwb3NpdGlvblRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwocG9zaXRpb25UaW1lb3V0KTtcbiAgICAgICAgICAgICAgICBwb3NpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEhpZGUgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGUoKSB7XG4gICAgICAgICAgICAgIGlmICghdHRTY29wZSkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8vIEZpcnN0IHRoaW5ncyBmaXJzdDogd2UgZG9uJ3Qgc2hvdyBpdCBhbnltb3JlLlxuICAgICAgICAgICAgICB0dFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUpIHtcbiAgICAgICAgICAgICAgICAgIHR0U2NvcGUuaXNPcGVuID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICBhc3NpZ25Jc09wZW4oZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgLy8gQW5kIG5vdyB3ZSByZW1vdmUgaXQgZnJvbSB0aGUgRE9NLiBIb3dldmVyLCBpZiB3ZSBoYXZlIGFuaW1hdGlvbiwgd2VcbiAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gZXhwaXJlIGJlZm9yZWhhbmQuXG4gICAgICAgICAgICAgICAgICAvLyBGSVhNRTogdGhpcyBpcyBhIHBsYWNlaG9sZGVyIGZvciBhIHBvcnQgb2YgdGhlIHRyYW5zaXRpb25zIGxpYnJhcnkuXG4gICAgICAgICAgICAgICAgICAvLyBUaGUgZmFkZSB0cmFuc2l0aW9uIGluIFRXQlMgaXMgMTUwbXMuXG4gICAgICAgICAgICAgICAgICBpZiAodHRTY29wZS5hbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0cmFuc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UaW1lb3V0ID0gJHRpbWVvdXQocmVtb3ZlVG9vbHRpcCwgMTUwLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjYW5jZWxIaWRlKCkge1xuICAgICAgICAgICAgICBpZiAoaGlkZVRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoaGlkZVRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIGhpZGVUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0cmFuc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbCh0cmFuc2l0aW9uVGltZW91dCk7XG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNyZWF0ZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIC8vIFRoZXJlIGNhbiBvbmx5IGJlIG9uZSB0b29sdGlwIGVsZW1lbnQgcGVyIGRpcmVjdGl2ZSBzaG93biBhdCBvbmNlLlxuICAgICAgICAgICAgICBpZiAodG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZSA9IHR0U2NvcGUuJG5ldygpO1xuICAgICAgICAgICAgICB0b29sdGlwID0gdG9vbHRpcExpbmtlcih0b29sdGlwTGlua2VkU2NvcGUsIGZ1bmN0aW9uKHRvb2x0aXApIHtcbiAgICAgICAgICAgICAgICBpZiAoYXBwZW5kVG9Cb2R5KSB7XG4gICAgICAgICAgICAgICAgICAkZG9jdW1lbnQuZmluZCgnYm9keScpLmFwcGVuZCh0b29sdGlwKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZnRlcih0b29sdGlwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIG9wZW5lZFRvb2x0aXBzLmFkZCh0dFNjb3BlLCB7XG4gICAgICAgICAgICAgICAgY2xvc2U6IGhpZGVcbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgcHJlcE9ic2VydmVycygpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVUb29sdGlwKCkge1xuICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG4gICAgICAgICAgICAgIGNhbmNlbEhpZGUoKTtcbiAgICAgICAgICAgICAgdW5yZWdpc3Rlck9ic2VydmVycygpO1xuXG4gICAgICAgICAgICAgIGlmICh0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICB0b29sdGlwID0gbnVsbDtcbiAgICAgICAgICAgICAgICBpZiAoYWRqdXN0bWVudFRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChhZGp1c3RtZW50VGltZW91dCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgb3BlbmVkVG9vbHRpcHMucmVtb3ZlKHR0U2NvcGUpO1xuICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgaWYgKHRvb2x0aXBMaW5rZWRTY29wZSkge1xuICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZSA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBTZXQgdGhlIGluaXRpYWwgc2NvcGUgdmFsdWVzLiBPbmNlXG4gICAgICAgICAgICAgKiB0aGUgdG9vbHRpcCBpcyBjcmVhdGVkLCB0aGUgb2JzZXJ2ZXJzXG4gICAgICAgICAgICAgKiB3aWxsIGJlIGFkZGVkIHRvIGtlZXAgdGhpbmdzIGluIHN5bmMuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBhcmVUb29sdGlwKCkge1xuICAgICAgICAgICAgICB0dFNjb3BlLnRpdGxlID0gYXR0cnNbcHJlZml4ICsgJ1RpdGxlJ107XG4gICAgICAgICAgICAgIGlmIChjb250ZW50UGFyc2UpIHtcbiAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSBjb250ZW50UGFyc2Uoc2NvcGUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IGF0dHJzW3R0VHlwZV07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0dFNjb3BlLnBvcHVwQ2xhc3MgPSBhdHRyc1twcmVmaXggKyAnQ2xhc3MnXTtcbiAgICAgICAgICAgICAgdHRTY29wZS5wbGFjZW1lbnQgPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRyc1twcmVmaXggKyAnUGxhY2VtZW50J10pID8gYXR0cnNbcHJlZml4ICsgJ1BsYWNlbWVudCddIDogb3B0aW9ucy5wbGFjZW1lbnQ7XG4gICAgICAgICAgICAgIHZhciBwbGFjZW1lbnQgPSAkcG9zaXRpb24ucGFyc2VQbGFjZW1lbnQodHRTY29wZS5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICBsYXN0UGxhY2VtZW50ID0gcGxhY2VtZW50WzFdID8gcGxhY2VtZW50WzBdICsgJy0nICsgcGxhY2VtZW50WzFdIDogcGxhY2VtZW50WzBdO1xuXG4gICAgICAgICAgICAgIHZhciBkZWxheSA9IHBhcnNlSW50KGF0dHJzW3ByZWZpeCArICdQb3B1cERlbGF5J10sIDEwKTtcbiAgICAgICAgICAgICAgdmFyIGNsb3NlRGVsYXkgPSBwYXJzZUludChhdHRyc1twcmVmaXggKyAnUG9wdXBDbG9zZURlbGF5J10sIDEwKTtcbiAgICAgICAgICAgICAgdHRTY29wZS5wb3B1cERlbGF5ID0gIWlzTmFOKGRlbGF5KSA/IGRlbGF5IDogb3B0aW9ucy5wb3B1cERlbGF5O1xuICAgICAgICAgICAgICB0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSA9ICFpc05hTihjbG9zZURlbGF5KSA/IGNsb3NlRGVsYXkgOiBvcHRpb25zLnBvcHVwQ2xvc2VEZWxheTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gYXNzaWduSXNPcGVuKGlzT3Blbikge1xuICAgICAgICAgICAgICBpZiAoaXNPcGVuUGFyc2UgJiYgYW5ndWxhci5pc0Z1bmN0aW9uKGlzT3BlblBhcnNlLmFzc2lnbikpIHtcbiAgICAgICAgICAgICAgICBpc09wZW5QYXJzZS5hc3NpZ24oc2NvcGUsIGlzT3Blbik7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdHRTY29wZS5jb250ZW50RXhwID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJldHVybiB0dFNjb3BlLmNvbnRlbnQ7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIE9ic2VydmUgdGhlIHJlbGV2YW50IGF0dHJpYnV0ZXMuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGF0dHJzLiRvYnNlcnZlKCdkaXNhYmxlZCcsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICBpZiAodmFsKSB7XG4gICAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHZhbCAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgIGhpZGUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChpc09wZW5QYXJzZSkge1xuICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goaXNPcGVuUGFyc2UsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlICYmICF2YWwgPT09IHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICB0b2dnbGVUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBPYnNlcnZlcnMoKSB7XG4gICAgICAgICAgICAgIG9ic2VydmVycy5sZW5ndGggPSAwO1xuXG4gICAgICAgICAgICAgIGlmIChjb250ZW50UGFyc2UpIHtcbiAgICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChjb250ZW50UGFyc2UsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSB2YWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kd2F0Y2goZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVwb3NpdGlvblNjaGVkdWxlZCkge1xuICAgICAgICAgICAgICAgICAgICAgIHJlcG9zaXRpb25TY2hlZHVsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBMaW5rZWRTY29wZS4kJHBvc3REaWdlc3QoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXBvc2l0aW9uU2NoZWR1bGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHRTY29wZSAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUodHRUeXBlLCBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgICAgdHRTY29wZS5jb250ZW50ID0gdmFsO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbCAmJiB0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1RpdGxlJywgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICB0dFNjb3BlLnRpdGxlID0gdmFsO1xuICAgICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1BsYWNlbWVudCcsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgdHRTY29wZS5wbGFjZW1lbnQgPSB2YWwgPyB2YWwgOiBvcHRpb25zLnBsYWNlbWVudDtcbiAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiB1bnJlZ2lzdGVyT2JzZXJ2ZXJzKCkge1xuICAgICAgICAgICAgICBpZiAob2JzZXJ2ZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvYnNlcnZlcnMsIGZ1bmN0aW9uKG9ic2VydmVyKSB7XG4gICAgICAgICAgICAgICAgICBvYnNlcnZlcigpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5sZW5ndGggPSAwO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGhpZGUgdG9vbHRpcHMvcG9wb3ZlcnMgZm9yIG91dHNpZGVDbGljayB0cmlnZ2VyXG4gICAgICAgICAgICBmdW5jdGlvbiBib2R5SGlkZVRvb2x0aXBCaW5kKGUpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlIHx8ICF0dFNjb3BlLmlzT3BlbiB8fCAhdG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgdGhlIHRvb2x0aXAvcG9wb3ZlciBsaW5rIG9yIHRvb2wgdG9vbHRpcC9wb3BvdmVyIGl0c2VsZiB3ZXJlIG5vdCBjbGlja2VkXG4gICAgICAgICAgICAgIGlmICghZWxlbWVudFswXS5jb250YWlucyhlLnRhcmdldCkgJiYgIXRvb2x0aXBbMF0uY29udGFpbnMoZS50YXJnZXQpKSB7XG4gICAgICAgICAgICAgICAgaGlkZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gS2V5Ym9hcmRFdmVudCBoYW5kbGVyIHRvIGhpZGUgdGhlIHRvb2x0aXAgb24gRXNjYXBlIGtleSBwcmVzc1xuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZU9uRXNjYXBlS2V5KGUpIHtcbiAgICAgICAgICAgICAgaWYgKGUud2hpY2ggPT09IDI3KSB7XG4gICAgICAgICAgICAgICAgaGlkZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHVucmVnaXN0ZXJUcmlnZ2VycyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB0cmlnZ2Vycy5zaG93LmZvckVhY2goZnVuY3Rpb24odHJpZ2dlcikge1xuICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYoJ2NsaWNrJywgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZih0cmlnZ2VyLCBzaG93VG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYodHJpZ2dlciwgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZigna2V5cHJlc3MnLCBoaWRlT25Fc2NhcGVLZXkpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgdHJpZ2dlcnMuaGlkZS5mb3JFYWNoKGZ1bmN0aW9uKHRyaWdnZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAodHJpZ2dlciA9PT0gJ291dHNpZGVDbGljaycpIHtcbiAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5vZmYoJ2NsaWNrJywgYm9keUhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKHRyaWdnZXIsIGhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHByZXBUcmlnZ2VycygpIHtcbiAgICAgICAgICAgICAgdmFyIHNob3dUcmlnZ2VycyA9IFtdLCBoaWRlVHJpZ2dlcnMgPSBbXTtcbiAgICAgICAgICAgICAgdmFyIHZhbCA9IHNjb3BlLiRldmFsKGF0dHJzW3ByZWZpeCArICdUcmlnZ2VyJ10pO1xuICAgICAgICAgICAgICB1bnJlZ2lzdGVyVHJpZ2dlcnMoKTtcblxuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc09iamVjdCh2YWwpKSB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXModmFsKS5mb3JFYWNoKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICAgICAgc2hvd1RyaWdnZXJzLnB1c2goa2V5KTtcbiAgICAgICAgICAgICAgICAgIGhpZGVUcmlnZ2Vycy5wdXNoKHZhbFtrZXldKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB0cmlnZ2VycyA9IHtcbiAgICAgICAgICAgICAgICAgIHNob3c6IHNob3dUcmlnZ2VycyxcbiAgICAgICAgICAgICAgICAgIGhpZGU6IGhpZGVUcmlnZ2Vyc1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlcnMgPSBnZXRUcmlnZ2Vycyh2YWwpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHRyaWdnZXJzLnNob3cgIT09ICdub25lJykge1xuICAgICAgICAgICAgICAgIHRyaWdnZXJzLnNob3cuZm9yRWFjaChmdW5jdGlvbih0cmlnZ2VyLCBpZHgpIHtcbiAgICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKCdjbGljaycsIHRvZ2dsZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdjbGljaycsIGJvZHlIaWRlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0cmlnZ2VyID09PSB0cmlnZ2Vycy5oaWRlW2lkeF0pIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5vbih0cmlnZ2VyLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRyaWdnZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5vbih0cmlnZ2VyLCBzaG93VG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKHRyaWdnZXJzLmhpZGVbaWR4XSwgaGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub24oJ2tleXByZXNzJywgaGlkZU9uRXNjYXBlS2V5KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBwcmVwVHJpZ2dlcnMoKTtcblxuICAgICAgICAgICAgdmFyIGFuaW1hdGlvbiA9IHNjb3BlLiRldmFsKGF0dHJzW3ByZWZpeCArICdBbmltYXRpb24nXSk7XG4gICAgICAgICAgICB0dFNjb3BlLmFuaW1hdGlvbiA9IGFuZ3VsYXIuaXNEZWZpbmVkKGFuaW1hdGlvbikgPyAhIWFuaW1hdGlvbiA6IG9wdGlvbnMuYW5pbWF0aW9uO1xuXG4gICAgICAgICAgICB2YXIgYXBwZW5kVG9Cb2R5VmFsO1xuICAgICAgICAgICAgdmFyIGFwcGVuZEtleSA9IHByZWZpeCArICdBcHBlbmRUb0JvZHknO1xuICAgICAgICAgICAgaWYgKGFwcGVuZEtleSBpbiBhdHRycyAmJiBhdHRyc1thcHBlbmRLZXldID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgYXBwZW5kVG9Cb2R5VmFsID0gdHJ1ZTtcbiAgICAgICAgICAgIH0gZW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lU2NvcGUpO1xuXG4gICAgICB2YXIgY2hhbmdlQ291bnRlciA9IDAsXG4gICAgICAgIGN1cnJlbnRTY29wZSxcbiAgICAgICAgcHJldmlvdXNFbGVtZW50LFxuICAgICAgICBjdXJyZW50RWxlbWVudDtcblxuICAgICAgdmFyIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKHByZXZpb3VzRWxlbWVudCkge1xuICAgICAgICAgIHByZXZpb3VzRWxlbWVudC5yZW1vdmUoKTtcbiAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGN1cnJlbnRTY29wZSkge1xuICAgICAgICAgIGN1cnJlbnRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAkYW5pbWF0ZS5sZWF2ZShjdXJyZW50RWxlbWVudCkudGhlbihmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gY3VycmVudEVsZW1lbnQ7XG4gICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBudWxsO1xuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBzY29wZS4kd2F0Y2goJHNjZS5wYXJzZUFzUmVzb3VyY2VVcmwoYXR0cnMudWliVG9vbHRpcFRlbXBsYXRlVHJhbnNjbHVkZSksIGZ1bmN0aW9uKHNyYykge1xuICAgICAgICB2YXIgdGhpc0NoYW5nZUlkID0gKytjaGFuZ2VDb3VudGVyO1xuXG4gICAgICAgIGlmIChzcmMpIHtcbiAgICAgICAgICAvL3NldCB0aGUgMm5kIHBhcmFtIHRvIHRydWUgdG8gaWdub3JlIHRoZSB0ZW1wbGF0ZSByZXF1ZXN0IGVycm9yIHNvIHRoYXQgdGhlIGlubmVyXG4gICAgICAgICAgLy9jb250ZW50cyBhbmQgc2NvcGUgY2FuIGJlIGNsZWFuZWQgdXAuXG4gICAgICAgICAgJHRlbXBsYXRlUmVxdWVzdChzcmMsIHRydWUpLnRoZW4oZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICh0aGlzQ2hhbmdlSWQgIT09IGNoYW5nZUNvdW50ZXIpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICB2YXIgbmV3U2NvcGUgPSBvcmlnU2NvcGUuJG5ldygpO1xuICAgICAgICAgICAgdmFyIHRlbXBsYXRlID0gcmVzcG9uc2U7XG5cbiAgICAgICAgICAgIHZhciBjbG9uZSA9ICRjb21waWxlKHRlbXBsYXRlKShuZXdTY29wZSwgZnVuY3Rpb24oY2xvbmUpIHtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpO1xuICAgICAgICAgICAgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgZWxlbSk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY3VycmVudFNjb3BlID0gbmV3U2NvcGU7XG4gICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IGNsb25lO1xuXG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGVtaXQoJyRpbmNsdWRlQ29udGVudExvYWRlZCcsIHNyYyk7XG4gICAgICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAodGhpc0NoYW5nZUlkID09PSBjaGFuZ2VDb3VudGVyKSB7XG4gICAgICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTtcbiAgICAgICAgICAgICAgc2NvcGUuJGVtaXQoJyRpbmNsdWRlQ29udGVudEVycm9yJywgc3JjKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgIC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biAgICAgICAgfSk7XG4gICAgICB9XG5cbiAgICAgIGlmIChhbmd1bGFyLmlzVW5kZWZpbmVkKGF0dHJzLmluZGV4KSkge1xuICAgICAgICBpZiAodGFic2V0Q3RybC50YWJzICYmIHRhYnNldEN0cmwudGFicy5sZW5ndGgpIHtcbiAgICAgICAgICBzY29wZS5pbmRleCA9IE1hdGgubWF4LmFwcGx5KG51bGwsIHRhYnNldEN0cmwudGFicy5tYXAoZnVuY3Rpb24odCkgeyByZXR1cm4gdC5pbmRleDsgfSkpICsgMTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBzY29wZS5pbmRleCA9IDA7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKGFuZ3VsYXIuaXNVbmRlZmluZWQoYXR0cnMuY2xhc3NlcykpIHtcbiAgICAgICAgc2NvcGUuY2xhc3NlcyA9ICcnO1xuICAgICAgfVxuXG4gICAgICBzY29wZS5zZWxlY3QgPSBmdW5jdGlvbihldnQpIHtcbiAgICAgICAgaWYgKCFzY29wZS5kaXNhYmxlZCkge1xuICAgICAgICAgIHZhciBpbmRleDtcbiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRhYnNldEN0cmwudGFicy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHRhYnNldEN0cmwudGFic1tpXS50YWIgPT09IHNjb3BlKSB7XG4gICAgICAgICAgICAgIGluZGV4ID0gaTtcbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGFic2V0Q3RybC5zZWxlY3QoaW5kZXgsIGV2dCk7XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHRhYnNldEN0cmwuYWRkVGFiKHNjb3BlKTtcbiAgICAgIHNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHtcbiAgICAgICAgdGFic2V0Q3RybC5yZW1vdmVUYWIoc2NvcGUpO1xu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XG4gICAgICB9XG4gICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgfSk7XG4gIH07XG5cbiAgLy8gUmVzcG9uZCBvbiB1cC9kb3duIGFycm93a2V5c1xuICB0aGlzLnNldHVwQXJyb3drZXlFdmVudHMgPSBmdW5jdGlvbihob3Vyc0lucHV0RWwsIG1pbnV0ZXNJbnB1dEVsLCBzZWNvbmRzSW5wdXRFbCkge1xuICAgIGhvdXJzSW5wdXRFbC5vbigna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgIGlmICghZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKGUud2hpY2ggPT09IDM4KSB7IC8vIHVwXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5pbmNyZW1lbnRIb3VycygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfSBlbHNlIGlmIChlLndoaWNoID09PSA0MCkgeyAvLyBkb3duXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5kZWNyZW1lbnRIb3VycygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgbWludXRlc0lucHV0RWwub24oJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICBpZiAoIWRpc2FibGVkKSB7XG4gICAgICAgIGlmIChlLndoaWNoID09PSAzOCkgeyAvLyB1cFxuICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAkc2NvcGUuaW5jcmVtZW50TWludXRlcygpO1xuICAgICAgICAgICRzY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfSBlbHNlIGlmIChlLndoaWNoID09PSA0MCkgeyAvLyBkb3duXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5kZWNyZW1l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AgaWYgKHNob3dIaW50KSB7XG4gICAgICBpbnB1dHNDb250YWluZXIgPSBhbmd1bGFyLmVsZW1lbnQoJzxkaXY+PC9kaXY+Jyk7XG4gICAgICBpbnB1dHNDb250YWluZXIuY3NzKCdwb3NpdGlvbicsICdyZWxhdGl2ZScpO1xuICAgICAgZWxlbWVudC5hZnRlcihpbnB1dHNDb250YWluZXIpO1xuICAgICAgaGludElucHV0RWxlbSA9IGVsZW1lbnQuY2xvbmUoKTtcbiAgICAgIGhpbnRJbnB1dEVsZW0uYXR0cigncGxhY2Vob2xkZXInLCAnJyk7XG4gICAgICBoaW50SW5wdXRFbGVtLmF0dHIoJ3RhYmluZGV4JywgJy0xJyk7XG4gICAgICBoaW50SW5wdXRFbGVtLnZhbCgnJyk7XG4gICAgICBoaW50SW5wdXRFbGVtLmNzcyh7XG4gICAgICAgICdwb3NpdGlvbic6ICdhYnNvbHV0ZScsXG4gICAgICAgICd0b3AnOiAnMHB4JyxcbiAgICAgICAgJ2xlZnQnOiAnMHB4JyxcbiAgICAgICAgJ2JvcmRlci1jb2xvcic6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgICdib3gtc2hhZG93JzogJ25vbmUnLFxuICAgICAgICAnb3BhY2l0eSc6IDEsXG4gICAgICAgICdiYWNrZ3JvdW5kJzogJ25vbmUgMCUgMCUgLyBhdXRvIHJlcGVhdCBzY3JvbGwgcGFkZGluZy1ib3ggYm9yZGVyLWJveCByZ2IoMjU1LCAyNTUsIDI1NSknLFxuICAgICAgICAnY29sb3InOiAnIzk5OSdcbiAgICAgIH0pO1xuICAgICAgZWxlbWVudC5jc3Moe1xuICAgICAgICAncG9zaXRpb24nOiAncmVsYXRpdmUnLFxuICAgICAgICAndmVydGljYWwtYWxpZ24nOiAndG9wJyxcbiAgICAgICAgJ2JhY2tncm91bmQtY29sb3InOiAndHJhbnNwYXJlbnQnXG4gICAgICB9KTtcblxuICAgICAgaWYgKGhpbnRJbnB1dEVsZW0uYXR0cignaWQnKSkge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ICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoc2hvd0hpbnQpIHtcbiAgICAgICAgICAgICAgdmFyIGZpcnN0TGFiZWwgPSBzY29wZS5tYXRjaGVzWzBdLmxhYmVsO1xuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc1N0cmluZyhpbnB1dFZhbHVlKSAmJlxuICAgICAgICAgICAgICAgIGlucHV0VmFsdWUubGVuZ3RoID4gMCAmJlxuICAgICAgICAgICAgICAgIGZpcnN0TGFiZWwuc2xpY2UoMCwgaW5wdXRWYWx1ZS5sZW5ndGgpLnRvVXBwZXJDYXNlKCkgPT09IGlucHV0VmFsdWUudG9VcHBlckNhc2UoKSkge1xuICAgICAgICAgICAgICAgIGhpbnRJbnB1dEVsZW0udmFsKGlucHV0VmFsdWUgKyBmaXJzdExhYmVsLnNsaWNlKGlucHV0VmFsdWUubGVuZ3RoKSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGludElucHV0RWxlbS52YWwoJycpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlc2V0TWF0Y2hlcygpO1xuICAgICAgICAgICAgaXNOb1Jlc3VsdHNTZXR0ZXIob3JpZ2luYWxTY29wZSwgdHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvbkN1cnJlbnRSZXF1ZXN0KSB7XG4gICAgICAgICAgaXNMb2FkaW5nU2V0dGVyKG9yaWdpbmFsU2NvcGUsIGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgIHJlc2V0TWF0Y2hlcygpO1xuICAgICAgICBpc0xvYWRpbmdTZXR0ZXIob3JpZ2luYWxTY29wZSwgZmFsc2UpO1xuICAgICAgICBpc05vUmVzdWx0c1NldHRlcihvcmlnaW5hbFNjb3BlLCB0cnVlKTtcbiAgICAgIH0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VwaWNrZXJQb3B1cENvbmZpZy5kYXRlcGlja2VyUG9wdXAgKTtcbiAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cigneWVhci1yYW5nZScsIGF0dHJzLmVZZWFyUmFuZ2UgfHwgMjApO1xuICAgICAgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKCduZy1yZWFkb25seScsIGF0dHJzLmVSZWFkb25seSB8fCBmYWxzZSk7XG5cbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gcG9wdXBBdHRyTmFtZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHBvcHVwQXR0ciA9IGF0dHJzW3BvcHVwQXR0ck5hbWVzW2ldWzBdXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb3B1cEF0dHIgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cihwb3B1cEF0dHJOYW1lc1tpXVsxXSwgcG9wdXBBdHRyKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lTmdDaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ25nLWNoYW5nZScsIGF0dHJzLmVOZ0NoYW5nZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCduZy1jaGFuZ2UnKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoYXR0cnMuZVN0eWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKCdzdHlsZScsIGF0dHJzLmVTdHlsZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCdzdHlsZScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBkYXRlT3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICAgICAgbWF4RGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZU1heERhdGUpIHx8IHVpYkRhdGVwaWNrZXJDb25maWcubWF4RGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgbWluRGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZU1pbkRhdGUpIHx8IHVpYkRhdGVwaWNrZXJDb25maWcubWluRGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgc2hvd1dlZWtzOiBhdHRycy5lU2hvd1dlZWtzID8gYXR0cnMuZVNob3dXZWVrcy50b0xvd2VyQ2FzZSgpID09PSAndHJ1ZScgOiB1aWJEYXRlcGlja2VyQ29uZmlnLnNob3dXZWVrcyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRpbmdEYXk6IGF0dHJzLmVTdGFydGluZ0RheSB8fCAwLFxuICAgICAgICAgICAgICAgICAgICBpbml0RGF0ZTogc2NvcGUuJGV2YWwoYXR0cnMuZUluaXREYXRlKSB8fCBuZXcgRGF0ZSgpXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lRGF0ZXBpY2tlck9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVEYXRlcGlja2VyT3B0aW9ucyA9ICRwYXJzZShhdHRycy5lRGF0ZXBpY2tlck9wdGlvbnMpKHNjb3BlKTtcbiAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoZGF0ZU9wdGlvbnMsIGVEYXRlcGlja2VyT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZm9yICh2YXIgeiA9IGRhdGVPcHRpb25zTmFtZXMubGVuZ3RoIC0gMTsgeiA+PSAwOyB6LS0pIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRvQXR0ciA9IGF0dHJzW2RhdGVPcHRpb25zTmFtZXNbel1bMF1dO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGRvQXR0ciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGVPcHRpb25zW2RhdGVPcHRpb25zTmFtZXNbel1bMV1dID0gZG9BdHRyO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgc2NvcGUuZGF0ZU9wdGlvbnMgPSBkYXRlT3B0aW9ucztcblxuICAgICAgICAgICAgICAgIHZhciBzaG93Q2FsZW5kYXJCdXR0b24gPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRycy5lU2hvd0NhbGVuZGFyQnV0dG9uKSA/IGF0dHJzLmVTaG93Q2FsZW5kYXJCdXR0b24gOiBcInRydWVcIjtcblxuICAgICAgICAgICAgICAgIC8vU2VlIGlmIGNhbGVuZGFyIGJ1dHRvbiBzaG91bGQgYmUgZGlzcGxheWVkXG4gICAgICAgICAgICAgICAgaWYgKHNob3dDYWxlbmRhckJ1dHRvbiA9PT0gXCJ0cnVlXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJ1dHRvbkRhdGVQaWNrZXIgPSBhbmd1bGFyLmVsZW1lbnQoJzxidXR0b24gdHlwZT1cImJ1dHRvblwiIGNsYXNzPVwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGhlbWUuY2FsZW5kYXJCdXR0b25DbGFzcyArICdcIj48aSBjbGFzcz1cIicgK1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmljb25fc2V0LmNhbGVuZGFyICsgJ1wiPjwvaT48L2J1dHRvbj4nKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJ1dHRvbldyYXBwZXIgPSBhbmd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gICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCdkYXRlcGlja2VyLXBvcHVwJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ3JlcXVpcmVkJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25nLW1vZGVsJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2RhdGUtcGlja2VyLWFwcGVuZC10by1ib2R5Jyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25hbWUnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwuYXR0cignY2xhc3MnLCdpbnB1dC1ncm91cCcpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGF1dG9zdWJtaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgnY2hhbmdlJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LCA1MDApO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vc3VibWl0IG9uIHRhYlxuICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXl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QoKS5wcmVwZW5kKGxhYmVsKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucGFyZW50KCkucHJlcGVuZChsYWJlbCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gQWRkIGNsYXNzZXMgdG8gdGhlIGZvcm1cbiAgICAgICAgICAgIGlmIChhdHRycy5lRm9ybWNsYXNzKSB7XG4gICAgICAgICAgICAgIHRoaXMuZWRpdG9yRWwuYWRkQ2xhc3MoYXR0cnMuZUZvcm1jbGFzcyk7XG4gICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5yZW1vdmVBdHRyKCdmb3JtY2xhc3MnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIGF1dG9zdWJtaXQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgLy9zdWJtaXQgb24gdGFiXG4gICAgICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0gOSAmJiBzZWxmLmVkaXRvckVsLmF0dHIoJ2JsdXInKSA9PT0gJ3N1Ym1pdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XSk7XG4gIH0pO1xuXG4gIC8vYHJhbmdlYCBpcyBiaXQgc3BlY2lmaWNcbiAgYW5ndWxhci5tb2R1bGUoJ3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AgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2NoYW5nZScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSwgNTAwKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICAgICAgICAvL3N1Ym1pdCBvbiB0YWJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0gOSAmJiBzZWxmLmVkaXRvckVsLmF0dHIoJ2JsdXInKSA9PT0gJ3N1Ym1pdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIGxpbmtPcmcgPSBkaXIubGluaztcblxuICAgICAgICBkaXIubGluayA9IGZ1bmN0aW9uIChzY29wZSwgZWwsIGF0dHJzLCBjdHJsKSB7XG4gICAgICAgICAgICB2YXIgbWF0Y2hFbCA9IGVsLmZpbmQoJ2VkaXRhYmxlLXVpLXNlbGVjdC1tYXRjaCcpO1xuICAgICAgICAgICAgdmFyIGNob2ljZ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XR0aW5ncyBmb3Igc2luZ2xlIGFuZCBub24tc2luZ2xlXG4gICAgICAgICAgaWYgKCFzZWxmLnNpbmdsZSkge1xuICAgICAgICAgICAgLy8gaGlkZSBidXR0b25zIGZvciBub24tc2luZ2xlXG4gICAgICAgICAgICBzZWxmLmJ1dHRvbnMgPSAnbm8nO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzZWxmLmJ1dHRvbnMgPSBzZWxmLmF0dHJzLmJ1dHRvbnMgfHwgZWRpdGFibGVPcHRpb25zLmJ1dHRvbnM7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy9pZiBuYW1lIGRlZmluZWQgLS0+IHdhdGNoIGNoYW5nZXMgYW5kIHVwZGF0ZSAkZGF0YSBpbiBmb3JtXG4gICAgICAgICAgaWYgKCRhdHRycy5lTmFtZSkge1xuICAgICAgICAgICAgc2VsZi5zY29wZS4kd2F0Y2goJyRkYXRhJywgZnVuY3Rpb24gKG5ld1ZhbCkge1xuICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRkYXRhWyRhdHRycy5lTmFtZV0gPSBuZXdWYWw7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIHNob3duLlxuICAgICAgICAgICAqIFNlZSBbZGVtb10oI3NlbGVjdC1yZW1vdGUpLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25zaG93XG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uc2hvdykge1xuICAgICAgICAgICAgc2VsZi5vbnNob3cgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBzZWxmLmNhdGNoRXJyb3IoJHBhcnNlKCRhdHRycy5vbnNob3cpKCRzY29wZSkpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIGhpZGRlbiBhZnRlciBib3RoIHNhdmUgb3IgY2FuY2VsLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25oaWRlXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uaGlkZSkge1xuICAgICAgICAgICAgc2VsZi5vbmhpZGUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgIHJldHVybiAkcGFyc2UoJGF0dHJzLm9uaGlkZSkoJHNjb3BlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQ2FsbGVkIHdoZW4gY29udHJvbCBpcyBjYW5jZWxsZWQuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmNhbmNlbFxuICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1lbGVtZW50XG4gICAgICAgICAgICovXG4gICAgICAgICAgaWYgKCRhdHRycy5vbmNhbmNlbCkge1xuICAgICAgICAgICAgc2VsZi5vbmNhbmNlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZSgkYXR0cnMub25jYW5jZWwpKCRzY29wZSk7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIENhbGxlZCBkdXJpbmcgc3VibWl0IGJlZm9yZSB2YWx1ZSBpcyBzYXZlZCB0byBtb2RlbC5cbiAgICAgICAgICAgKiBTZWUgW2RlbW9dKCNvbm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XG5cbiAgICAgICAgICAvLyB0cmFuc2ZlciBgZS0qfGRhdGEtZS0qfHgtZS0qYCBhdHRyaWJ1dGVzXG4gICAgICAgICAgZm9yICh2YXIgayBpbiAkYXR0cnMuJGF0dHIpIHtcbiAgICAgICAgICAgIGlmIChrLmxlbmd0aCA8PSAxKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHRyYW5zZmVyQXR0ciA9IGZhbHNlO1xuICAgICAgICAgICAgdmFyIG5leHRMZXR0ZXIgPSBrLnN1YnN0cmluZygxLCAyKTtcblxuICAgICAgICAgICAgLy8gaWYgc3RhcnRzIHdpdGggYGVgICsgdXBwZXJjYXNlIGxldHRlclxuICAgICAgICAgICAgaWYgKGsuc3Vic3RyaW5nKDAsIDEpID09PSAnZScgJiYgbmV4dExldHRlciA9PT0gbmV4dExldHRlci50b1VwcGVyQ2FzZSgpKSB7XG4gICAgICAgICAgICAgIHRyYW5zZmVyQXR0ciA9IGsuc3Vic3RyaW5nKDEpOyAvLyBjdXQgYGVgXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gZXhjbHVkZSBgZm9ybWAgYW5kIGBuZy1zdWJtaXRgLFxuICAgICAgICAgICAgaWYgKHRyYW5zZmVyQXR0ciA9PT0gJ0Zvcm0nIHx8IHRyYW5zZmVyQXR0ciA9PT0gJ05nU3VibWl0Jykge1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIGZpcnN0TGV0dGVyID0gdHJhbnNmZXJBdHRyLnN1YnN0cmluZygwLCAxKTtcbiAgICAgICAgICAgIHZhciBzZWNvbmRMZXR0ZXIgPSB0cmFuc2ZlckF0dHIuc3Vic3RyaW5nKDEsIDIpO1xuXG4gICAgICAgICAgICAvLyBjb252ZXJ0IGJhY2s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vdmVyKSB7XG4gICAgICAgICAgICAkdGVtcGxhdGVDYWNoZS5yZW1vdmUoJ3BvcG92ZXIuaHRtbCcpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIG9uaGlkZVxuICAgICAgICAgIHJldHVybiBzZWxmLm9uaGlkZSgpO1xuICAgICAgICB9O1xuXG4gICAgICAgIC8vIGNhbmNlbFxuICAgICAgICBzZWxmLmNhbmNlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAvLyBvbmNhbmNlbFxuICAgICAgICAgIHNlbGYub25jYW5jZWwoKTtcbiAgICAgICAgICAvLyBkb24ndCBjYWxsIGhpZGUoKSBoZXJlIGFzIGl0IGNhbGxlZCBpbiBmb3JtJ3MgY29kZVxuICAgICAgICB9O1xuXG4gICAgICAgIC8qXG4gICAgICAgIENhbGxlZCBhZnRlciBzaG93IHRvIGF0dGFjaCBsaXN0ZW5lcnNcbiAgICAgICAgKi9cbiAgICAgICAgc2VsZi5hZGRMaXN0ZW5lcnMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgLy8gYmluZCBrZXl1cCBmb3IgYGVzY2FwZWBcbiAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5dXAnLCBmdW5jdGlvbiAoZSkge1xuICAgICAgICAgICAgaWYgKCFzZWxmLnNpbmdsZSkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIHRvZG86IG1vdmUgdGhpcyB0byBlZGl0YWJsZS1mb3JtIVxuICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUpIHtcbiAgICAgICAgICAgICAgLy8gaGlkZSBvbiBgZXNjYXBlYCBwcmVzc1xuICAgICAgICAgICAgICBjYXNlIDI3OlxuICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJGNhbmNlbCgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgLy8gYXV0b3N1Ym1pdCB3aGVuIGBubyBidXR0b25zYFxuICAgICAgICAgIGlmIChzZWxmLnNpbmdsZSAmJiBzZWxmLmJ1dHRvbnMgPT09ICdubycpIHtcbiAgICAgICAgICAgIHNlbGYuYXV0b3N1Ym1pdCgpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGNsaWNrIC0gbWFyayBlbGVtZW50IGFzIGNsaWNrZWQgdG8gZXhjbHVkZSBpbiBkb2N1bWVudCBjbGljayBoYW5kbGVyXG4gICAgICAgICAgc2VsZi5lZGl0b3JFbC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICAgICAgaWYgKGUud2hpY2ggJiYgZS53aGljaCAhPT0gMSkge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzZWxmLnNjb3BlLiRmb3JtLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uX2NsaWNrZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIC8vIHNldFdhaXRpbmdcbiAgICAgICAgc2VsZi5zZXRXYWl0aW5nID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAvLyBwYXJ0aWNpcGF0ZSBpbiB3YWl0aW5nIG9ubHkgaWYgbm90IGRpc2FibGVkXG4gICAgICAgICAgICBpbldhaXRpbmcgPSAhc2VsZi5pbnB1dEVsLmF0dHIoJ2Rpc2FibGVkJykgJiZcbiAgICAgICAgICAgICAgIXNlbGYuaW5wdXRFbC5hdHRyKCduZy1kaXNhYmxlZCcpICYmXG4gICAgICAgICAgICAgICFzZWxmLmlucHV0RWwuYXR0cignbmctZW5hYmxlZCcpO1xuICAgICAgICAgICAgaWYgKGluV2FpdGluZykge1xuICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKTtcbiAgICAgICAgICAgICAgaWYgKHNlbGYuYnV0dG9uc0VsKSB7XG4gICAgICAgICAgICAgICAgc2VsZi5idXR0b25zRWwuZmluZCgnYnV0dG9uJykuYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoaW5XYWl0aW5nKSB7XG4gICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpO1xuICAgICAgICAgICAgICBpZiAoc2VsZi5idXR0b25zRWwpIHtcbiAgICAgICAgICAgICAgICBzZWxmLmJ1dHRvbnNFbC5maW5kKCdidXR0b24nKS5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHNlbGYuYWN0aXZhdGUgPSBmdW5jdGlvbiAoc3RhcnQsIGVuZCkge1xuICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGVsID0gc2VsZi5pbnB1dEVsWzBdO1xuXG4gICAgICAgICAgICBpZiAoZWRpdGFibGVPcHRpb25zLmFjdGl2YXRlID09PSAnZm9jdXMnICYmIGVsLmZvY3VzKSB7XG4gICAgICAgICAgICAgIGlmIChzdGFydCAhPT0gdW5kZWZpbmVkICYmIHN0YXJ0ICE9PSBcIlwiICYmIGVsLnNldFNlbGVjdGlvblJhbmdlKSB7XG4gICAgICAgICAgICAgICAgZW5kID0gZW5kIHx8IHN0YXJ0O1xuICAgICAgICAgICAgICAgIGVsLm9uZm9jdXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFNlbGVjdGlvblJhbmdlKHN0YXJ0LCBlbmQpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy9kbyBub3RoaW5nLCB0aGlzIGlucHV0IGRvZXNuJ3Qgc3VwcG9ydCBzZXRTZWxlY3Rpb25SYW5nZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoc2VsZi5kaXJlY3RpdmVOYW1lID09ICdlZGl0YWJsZVJhZGlvbGlzdCcgfHwgc2VsZi5kaXJlY3RpdmVOYW1lID09ICdlZGl0YWJsZUNoZWNrbGlzdCcgfHxcbiAgICAgICAgICAgICAgICBzZWxmLmRpcmVjdGl2ZU5hbWUgPT0gJ2VkaXRhYmxlQnNkYXRlJyB8fCBzZWxmLmRpcmVjdGl2ZU5hbWUgPT0gJ2VkaXRhYmxlVGFnc0lucHV0Jykge1xuICAgICAgICAgICAgICAgIC8vU2V0IGZvY3VzIHRvIGZpcnN0IHByaXN0aW5lIGVsZW1lbnQgaW4gdGhlIGxpc3RcbiAgICAgICAgICAgICAgICBlbC5xdWVyeVNlbGVjdG9yKCcubmctcHJpc3RpbmUnKS5mb2N1cygpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZWRpdGFibGVPcHRpb25zLmFjdGl2YXRlID09PSAnc2VsZWN0Jykge1xuICAgICAgICAgICAgICBpZiAoZWwuc2VsZWN0KSB7XG4gICAgICAgICAgICAgICAgZWwuc2VsZWN0KCk7XG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoZWwuZm9jdXMpIHtcbiAgICAgICAgICAgICAgICBlbC5mb2N1cygpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSwgMCk7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2VsZi5zZXRFcnJvciA9IGZ1bmN0aW9uIChtc2cpIHtcbiAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNPYmplY3QobXNnKSkge1xuICAgICAgICAgICAgJHNjb3BlLiRlcnJvciA9ICRzY2UudHJ1c3RBc0h0bWwobXNnKTtcbiAgICAgICAgICAgIHNlbGYuZXJyb3IgPSBtc2c7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIC8qXG4gICAgICAgIENoZWNrcyB0aGF0IHJlc3VsdCBpcyBzdHJpbmcgb3IgcHJvbWlzZSByZXR1cm5lZCBzdHJpbmcgYW5kIHNob3dzIGl0IGFzIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgQXBwbGllZCB0byBvbnNob3csIG9uYmVmb3Jlc2F2ZSwgb25hZnRlcnNhdmVcbiAgICAgICAgKi9cbiAgICAgICAgc2VsZi5jYXRjaEVycm9yID0gZnVuY3Rpb24gKHJlc3VsdCwgbm9Qcm9taXNlKSB7XG4gICAgICAgICAgaWYgKGFuZ3VsYXIuaXNPYmplY3QocmVzdWx0KSAmJiBub1Byb21pc2UgIT09IHRydWUpIHtcbiAgICAgICAgICAgICRxLndoZW4ocmVzdWx0KS50aGVuKFxuICAgICAgICAgICAgICAvL3N1Y2Nlc3MgYW5kIGZhaWwgaGFuZGxlcnMgYXJlIGVxdWFsXG4gICAgICAgICAgICAgIGFuZ3VsYXIuYmluZCh0aGlzLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgIHRoaXMuY2F0Y2hFcnJvcihyLCB0cnVlKTtcbiAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgIGFuZ3VsYXIuYmluZCh0aGlzLCBmdW5jdGlvbiAocikge1xuICAgICAgICAgICAgICAgIHRoaXMuY2F0Y2hFcnJvcihyLCB0cnVlKTtcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICAvL2NoZWNrICRodHRwIGVycm9yXG4gICAgICAgICAgfSBlbHNlIGlmIChub1Byb21pc2UgJiYgYW5ndWxhci5pc09iamVjdChyZXN1bHQpICYmIHJlc3VsdC5zdGF0dXMgJiZcbiAgICAgICAgICAgIChyZXN1bHQuc3RhdHVzICE9PSAyMDApICYmIHJlc3VsdC5kYXRhICYmIGFuZ3VsYXIuaXNTdHJpbmcocmVzdWx0LmRhdGEpKSB7XG4gICAgICAgICAgICB0aGlzLnNldEVycm9yKHJlc3VsdC5kYXRhKTtcbiAgICAgICAgICAgIC8vc2V0IHJlc3VsdCB0byBzdHJpbmc6IHRvIGxldCBmb3JtIGtub3cgdGhhdCB0aGVyZSB3YXMgZXJyb3JcbiAgICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdC5kYXRhO1xuICAgICAgICAgIH0gZWxzZSBpZiAoYW5ndWxhci5pc1N0cmluZyhyZXN1bHQpKSB7XG4gICAgICAgICAgICB0aGlzLnNldEVycm9yKHJlc3VsdCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2VsZi5zYXZlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIHZhbHVlR2V0dGVyLmFzc2lnbigkc2NvcGUuJHBhcmVudCxcbiAgICAgICAgICAgIHNlbGYudXNlQ29weSA/IGFuZ3VsYXIuY29weShzZWxmLnNjb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gkZG9jdW1lbnRbMF0uZm9ybXNbaV0ubmFtZSA9PT0gYXR0cnMuZUZvcm0pIHtcbiAgICAgICAgICAgICAgICAvLyBmb3JtIGlzIGJlbG93IGFuZCBub3QgcHJvY2Vzc2VkIHlldFxuICAgICAgICAgICAgICAgIGVGb3JtQ3RybCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaGFzRm9ybSA9IHRydWU7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICAvKlxuICAgICAgICBpZihoYXNGb3JtICYmICFhdHRycy5lTmFtZSkge1xuICAgICAgICAgIHRocm93ICdZb3Ugc2hvdWxkIHByb3ZpZGUgYGUtbmFtZWAgZm9yIGVkaXRhYmxlIGVsZW1lbnQgaW5zaWRlIGZvcm0hJztcbiAgICAgICAgfVxuICAgICAgICAqL1xuXG4gICAgICAgIC8vY2hlY2sgZm9yIGBlZGl0YWJsZS1mb3JtYCBhdHRyIGluIGZvcm1cbiAgICAgICAgLypcbiAgICAgICAgaWYoZUZvcm1DdHJsICYmICkge1xuICAgICAgICAgIHRocm93ICdZb3Ugc2hvdWxkIHByb3ZpZGUgYGUtbmFtZWAgZm9yIGVkaXRhYmxlIGVsZW1lbnQgaW5zaWRlIGZvcm0hJztcbiAgICAgICAgfVxuICAgICAgICAqL1xuXG4gICAgICAgIC8vIHN0b3JlIG9yaWdpbmFsIHByb3BzIHRvIGBwYXJlbnRgIGJlZm9yZSBtZXJnZVxuICAgICAgICBhbmd1bGFyLmZvckVhY2gob3ZlcndyaXRlcywgZnVuY3Rpb24odiwgaykge1xuICAgICAgICAgIGlmKGVDdHJsW2tdICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIGVDdHJsLnBhcmVudFtrXSA9IGVDdHJsW2tdO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gbWVyZ2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pbiBzY29wZVxuICAgICAgICAgIGlmKGF0dHJzLmVGb3JtKSB7XG4gICAgICAgICAgICAoJHBhcnNlKGF0dHJzLmVGb3JtKS5hc3NpZ24gfHwgYW5ndWxhci5ub29wKShzY29wZS4kcGFyZW50LCBzY29wZS4kZm9ybSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gYmluZCBjbGljayAtIGlmIG5vIGV4dGVybmFsIGZvcm0gZGVmaW5lZFxuICAgICAgICAgIGlmKCFhdHRycy5lRm9ybSB8fCBhdHRycy5lQ2xpY2thYmxlKSB7XG4gICAgICAgICAgICBlbGVtLmFkZENsYXNzKCdlZGl0YWJsZS1jbGljaycpO1xuICAgICAgICAgICAgZWxlbS5iaW5kKGVkaXRhYmxlT3B0aW9ucy5hY3RpdmF0aW9uRXZlbnQsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICBlLmVkaXRhYmxlID0gZUN0cmw7XG4gICAgICAgICAgICAgIGlmKCFpc19kaXNhYmxlZCgpKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICAgICAgICBzY29wZS4kZm9ybS4kc2hvdygpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgfVxuICAgIH07XG4gIH07XG59XSk7XG5cbi8qXG5SZXR1cm5zIGVkaXRhYmxlRm9ybSBjb250cm9sbGVyXG4qL1xuYW5ndWxhci5tb2R1bGUoJ3hlZGl0YWJsZScpLmZhY3RvcnkoJ2VkaXRhYmxlRm9ybUNvbnRyb2xsZXInLFxuICBbJyRwYXJzZScsICckZG9jdW1lbnQnLCAnJHJvb3RTY29wZScsICdlZGl0YWJsZVByb21pc2VDb2xsZWN0aW9uJywgJ2VkaXRhYmxlVXR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uXG4gICAgICB2YXIgaXNCbHVyID0gZnVuY3Rpb24gKHNob3duLCBldmVudCkge1xuICAgICAgICB2YXIgaXNCbHVyID0gdHJ1ZTtcblxuICAgICAgICB2YXIgZWRpdGFibGVzID0gc2hvd24uJGVkaXRhYmxlcztcbiAgICAgICAgYW5ndWxhci5mb3JFYWNoKGVkaXRhYmxlcywgZnVuY3Rpb24gKHYpIHtcbiAgICAgICAgICB2YXIgZWxlbWVudCA9IHYuZWRpdG9yRWxbMF07XG4gICAgICAgICAgaWYgKGlzU2VsZk9yRGVzY2VuZGFudChlbGVtZW50LCBldmVudC50YXJnZXQpKVxuICAgICAgICAgICAgaXNCbHVyID0gZmFsc2U7XG5cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiBpc0JsdXI7XG4gICAgICB9O1xuXG4gICAgICB2YXIgY2xpY2tIYW5kbGVyID0gZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgLy8gaWdub3JlIHJpZ2h0L21pZGRsZSBidXR0b24gY2xpY2tcbiAgICAgICAgaWYgKGUud2hpY2ggJiYgZS53aGljaCAhPT0gMSkge1xuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciB0b0NhbmNlbCA9IFtdO1xuICAgICAgICB2YXIgdG9TdWJtaXQgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaG93bi5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIC8vIGNvbnNvbGUubG9nKFwiaW4gZm9yXCIsIHNob3duW2ldKTtcbiAgICAgICAgICAvLyBleGNsdWRlIGNsaWNrZWRcbiAgICAgICAgICBpZiAoc2hvd25baV0uX2NsaWNrZWQpIHtcbiAgICAgICAgICAgIHNob3duW2ldLl9jbGlja2VkID0gZmFsc2U7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBleGNsdWRlIHdhaXRpbmdcbiAgICAgICAgICBpZiAoc2hvd25baV0uJHdhaXRpbmcpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzaG93bltpXS5fYmx1ciA9PT0gJ2NhbmNlbCcgJiYgaXNCbHVyKHNob3duW2ldLCBlKSkge1xuICAgICAgICAgICAgdG9DYW5jZWwucHVzaChzaG93bltpXSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNob3duW2ldLl9ibHVyID09PSAnc3VibWl0JyAmJiBpc0JsdXIoc2hvd25baV0sIGUpKSB7XG4gICAgICAgICAgICB0b1N1Ym1pdC5wdXNoKHNob3duW2ldKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodG9DYW5jZWwubGVuZ3RoIHx8IHRvU3VibWl0Lmxlbmd0aCkge1xuICAgICAgICAgICRyb290U2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0b0NhbmNlbCwgZnVuY3Rpb24gKHYpIHsgdi4kY2FuY2VsKCk7IH0pO1xuICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRvU3VibWl0LCBmdW5jdGlvbiAodikgeyB2LiRzdWJtaXQoKTsgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH07XG5cblxuXG4gICAgICAkcm9vdFNjb3BlLiRvbignY2xvc2VFZGl0JywgZnVuY3Rpb24gKCkge1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNob3duLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgc2hvd25baV0uJGhpZGUoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHZhciBiYXNlID0ge1xuICAgICAgICAkYWRkRWRpdGFibGU6IGZ1bmN0aW9uIChlZGl0YWJsZSkge1xuICAgICAgICAgIC8vY29uc29sZS5sb2coJ2FkZCBlZGl0YWJsZScsIGVkaXRhYmxlL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ICAgICAgICAgICAgIHRoaXMuJGVkaXRhYmxlcy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFNob3dzIGZvcm0gd2l0aCBlZGl0YWJsZSBjb250cm9scy5cbiAgICAgICAgICpcbiAgICAgICAgICogQG1ldGhvZCAkc2hvdygpXG4gICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAqL1xuICAgICAgICAkc2hvdzogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGlmICh0aGlzLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy4kdmlzaWJsZSA9IHRydWU7XG5cbiAgICAgICAgICB2YXIgcGMgPSBlZGl0YWJsZVByb21pc2VDb2xsZWN0aW9uKCk7XG5cbiAgICAgICAgICAvL293biBzaG93XG4gICAgICAgICAgcGMud2hlbih0aGlzLiRvbnNob3coKSk7XG5cbiAgICAgICAgICAvL2NsZWFyIGVycm9yc1xuICAgICAgICAgIHRoaXMuJHNldEVycm9yKG51bGwsICcnKTtcblxuICAgICAgICAgIC8vY2hpbGRyZW4gc2hvd1xuICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLiRlZGl0YWJsZXMsIGZ1bmN0aW9uIChlZGl0YWJsZSkge1xuICAgICAgICAgICAgcGMud2hlbihlZGl0YWJsZS5zaG93KCkpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgLy93YWl0IHByb21pc2VzIGFuZCBhY3RpdmF0ZVxuICAgICAgICAgIHBjLnRoZW4oe1xuICAgICAgICAgICAgb25XYWl0OiBhbmd1bGFyLmJpbmQodGhpcywgdGhpcy4kc2V0V2FpdGluZyksXG4gICAgICAgICAgICBvblRydWU6IGFuZ3VsYXIuYmluZ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VswXS5zZWxlY3Rpb25FbmQgP1xuICAgICAgICAgICAgICB0aGlzLiRlZGl0YWJsZXNbMF0uZWxlbVswXS5zZWxlY3Rpb25FbmQgOlxuICAgICAgICAgICAgICB0aGlzLiRlZGl0YWJsZXNbMF0uZWxlbVswXS50ZXh0ID8gdGhpcy4kZWRpdGFibGVzWzBdLmVsZW1bMF0udGV4dC5sZW5ndGggOlxuICAgICAgICAgICAgICAgIHRoaXMuJGVkaXRhYmxlc1swXS5lbGVtWzBdLmlubmVySFRNTCA/IHRoaXMuJGVkaXRhYmxlc1swXS5lbGVtWzBdLmlubmVySFRNTC5sZW5ndGggOiAwO1xuICAgICAgICAgICAgdGhpcy4kZWRpdGFibGVzWzBdLmFjdGl2YXRlKHNlbGVjdGlvblN0YXJ0LCBzZWxlY3Rpb25FbmQpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogSGlkZXMgZm9ybSB3aXRoIGVkaXRhYmxlIGNvbnRyb2xzIHdpdGhvdXQgc2F2aW5nLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRoaWRlKClcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRoaWRlOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKCF0aGlzLiR2aXNpYmxlKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuJHZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgICAvLyBzZWxmIGhpZGVcbiAgICAgICAgICB0aGlzLiRvbmhpZGUoKTtcbiAgICAgICAgICAvLyBjaGlsZHJlbidzIGhpZGVcbiAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLmhpZGUoKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIC8vIHJlbW92ZSBmcm9tIGludGVybmFsIGxpc3Qgb2Ygc2hvd24gZm9ybXNcbiAgICAgICAgICBlZGl0YWJsZVV0aWxzLmFycmF5UmVtb3ZlKHNob3duLCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogVHJpZ2dlcnMgYG9uY2FuY2VsYCBldmVudCBhbmQgY2FsbHMgYCRoaWRlKClgLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRjYW5jZWwoKVxuICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgKi9cbiAgICAgICAgJGNhbmNlbDogZnVuY3Rpb24gKCkge1xuICAgICAgICAgIGlmICghdGhpcy4kdmlzaWJsZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyBzZWxmIGNhbmNlbFxuICAgICAgICAgIHRoaXMuJG9uY2FuY2VsKCk7XG4gICAgICAgICAgLy8gY2hpbGRyZW4ncyBjYW5jZWxcbiAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLmNhbmNlbCgpO1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIC8vIHNlbGYgaGlkZVxuICAgICAgICAgIHRoaXMuJGhpZGUoKTtcbiAgICAgICAgfSxcblxuICAgICAgICAkc2V0V2FpdGluZzogZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgdGhpcy4kd2FpdGluZyA9ICEhdmFsdWU7XG4gICAgICAgICAgLy8gd2UgY2FuJ3QganVzdCBzZXQgJHdhaXRpbmcgdmFyaWFibGUgYW5kIHVzZSBpdCB2aWEgbmctZGlzYWJsZWQgaW4gY2hpbGRyZW5cbiAgICAgICAgICAvLyBiZWNhdXNlIGluIGV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ICAgICAgICAgb25hZnRlcnNhdmUgcmVzdWx0OlxuICAgICAgICAgIC0gdHJ1ZS91bmRlZmluZWQvZmFsc2U6IGp1c3QgY2xvc2UgZm9ybVxuICAgICAgICAgIC0gc3RyaW5nOiBrZWVwIGZvcm0gb3BlbiBhbmQgc2hvdyBlcnJvclxuICAgICAgICAgICovXG4gICAgICAgICAgcGMudGhlbih7XG4gICAgICAgICAgICBvbldhaXQ6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRzZXRXYWl0aW5nKSxcbiAgICAgICAgICAgIG9uVHJ1ZTogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGhpZGUpLFxuICAgICAgICAgICAgb25GYWxzZTogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGhpZGUpLFxuICAgICAgICAgICAgb25TdHJpbmc6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRhY3RpdmF0ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAkb25zaG93OiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmNhbmNlbDogYW5ndWxhci5ub29wLFxuICAgICAgICAkb25oaWRlOiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmJlZm9yZXNhdmU6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uYWZ0ZXJzYXZlOiBhbmd1bGFyLm5vb3BcbiAgICAgIH07XG5cbiAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiBhbmd1bGFyLmV4dGVuZCh7XG4gICAgICAgICAgJGVkaXRhYmxlczogW10sXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogRm9ybSB2aXNpYmlsaXR5IGZsYWcuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHtib29sfSAkdmlzaWJsZVxuICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICovXG4g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ICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBlRm9ybSA9IGN0cmxbMF07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ2FsbGVkIHdoZW4gZm9ybSBpcyBzaG93bi5cbiAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25zaG93IFxuICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYoYXR0cnMub25zaG93KSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRvbnNob3cgPSBhbmd1bGFyLmJpbmQoZUZvcm0sICRwYXJzZShhdHRycy5vbnNob3cpLCBzY29wZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQ2FsbGVkIHdoZW4gZm9ybSBoaWRlcyBhZnRlciBib3RoIHNhdmUgb3IgY2FuY2VsLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmhpZGUgXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5vbmhpZGUpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uaGlkZSA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uaGlkZSksIHNjb3BlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGlzIGNhbmNlbGxlZC5cbiAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25jYW5jZWxcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLm9uY2FuY2VsKSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRvbmNhbmNlbCA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uY2FuY2VsKSwgc2NvcGUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZXRoZXIgZm9ybSBpbml0aWFsbHkgcmVuZGVyZWQgaW4gc2hvd24gc3RhdGUuXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogQHZhciB7Ym9vbHxhdHRyaWJ1dGV9IHNob3duXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5zaG93biAmJiAkcGFyc2UoYXR0cnMuc2hvd24pKHNjb3BlKSkge1xuICAgICAgICAgICAgICBlRm9ybS4kc2hvdygpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIEFjdGlvbiB3aGVuIGZvcm0gbG9zc2VzIGZvY3VzLiBWYWx1ZXM6IGBjYW5jZWx8c3VibWl0fGlnbm9yZWAuXG4gICAgICAgICAgICAgKiBEZWZhdWx0IGlzIGBpZ25vcmVgLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHtzdHJpbmd8YXR0cmlidXRlfSBibHVyXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBlRm9ybS5fYmx1ciA9IGF0dHJzLmJsdXIgfHwgZWRpdGFibGVPcHRpb25zLmJsdXJGb3JtO1xuXG4gICAgICAgICAgICAvLyBvbmJlZm9yZXNhdmUsIG9uYWZ0ZXJzYXZlXG4gICAgICAgICAgICBpZighYXR0cnMubmdTdWJtaXQgJiYgIWF0dHJzLnN1Ym1pdCkge1xuICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICogQ2FsbGVkIGFmdGVyIGFsbCBjaGlsZHJlbiBgb25iZWZvcmVzYXZlYCBjYWxsYmFja3MgYnV0IGJlZm9yZSBzYXZpbmcgZm9ybSB2YWx1ZXNcbiAgICAgICAgICAgICAgICogdG8gbW9kZWwuICBcbiAgICAgICAgICAgICAgICogSWYgYXQgbGVhc3Qgb25lIGNoaWxkcmVuIGNhbGxiYWNrIHJldHVybnMgYG5vbi1zdHJpbmdgIC0gaXQgd2lsbCBub3Qgbm90IGJlIGNhbGxlZC4gIFxuICAgICAgICAgICAgICAgKiBTZWUgW2VkaXRhYmxlLWZvcm0gZGVtb10oI2VkaXRhYmxlLWZvcm0pIGZvciBkZXRhaWxzLlxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25iZWZvcmVzYXZlXG4gICAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgaWYoYXR0cnMub25iZWZvcmVzYXZlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uJG9uYmVmb3Jlc2F2ZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZShhdHRycy5vbmJlZm9yZXNhdmUpKHNjb3BlLCB7JGRhdGE6IGVGb3JtLiRkYXRhfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIHZhbHVlcyBhcmUgc2F2ZWQgdG8gbW9kZWwuICBcbiAgICAgICAgICAgICAgICogU2VlIFtlZGl0YWJsZS1mb3JtIGRlbW9dKCNlZGl0YWJsZS1mb3JtKSBmb3IgZGV0YWlscy5cbiAgICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uYWZ0ZXJzYXZlIFxuICAgICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICovXG4gICAgICAgICAgICAgIGlmKGF0dHJzLm9uYWZ0ZXJzYXZlKSB7XG4gICAgICAgICAgICAgICAgZUZvcm0uJG9uYWZ0ZXJzYXZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKGF0dHJzLm9uYWZ0ZXJzYXZlKShzY29wZSwgeyRkYXRhOiBlRm9ybS4kZGF0YX0pO1xuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBlbGVtLmJpbmQoJ3N1Ym1pdCcsIGZ1bmN0aW9uKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBlRm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG5cbiAgICAgICAgICAgIC8vIGNsaWNrIC0gbWFyayBmb3JtIGFzIGNsaWNrZWQgdG8gZXhjbHVkZSBpbiBkb2N1bWVudCBjbGljayBoYW5kbGVyXG4gICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oZSkge1xuICAgICAgICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICA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ICAgb25XYWl0KHRydWUpO1xuICAgICAgICAgICRxLmFsbCh0aGlzLnByb21pc2VzKS50aGVuKFxuICAgICAgICAgICAgLy9hbGwgcmVzb2x2ZWQgICAgICAgXG4gICAgICAgICAgICBmdW5jdGlvbihyZXN1bHRzKSB7XG4gICAgICAgICAgICAgIG9uV2FpdChmYWxzZSk7XG4gICAgICAgICAgICAgIC8vY2hlY2sgYWxsIHJlc3VsdHMgdmlhIHNhbWUgYHdoZW5gIG1ldGhvZCAod2l0aG91dCBjaGVja2luZyBwcm9taXNlcylcbiAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHJlc3VsdHMsIGZ1bmN0aW9uKHJlc3VsdCkge1xuICAgICAgICAgICAgICAgIHNlbGYud2hlbihyZXN1bHQsIHRydWUpOyAgXG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBhcHBseUNhbGxiYWNrKCk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy9zb21lIHJlamVjdGVkXG4gICAgICAgICAgICBmdW5jdGlvbihlcnJvcikgeyBcbiAgICAgICAgICAgICAgb25XYWl0KGZhbHNlKTtcbiAgICAgICAgICAgICAgb25TdHJpbmcoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYXBwbHlDYWxsYmFjaygpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYXBwbHlDYWxsYmFjaygpIHtcbiAgICAgICAgICBpZiAoIXNlbGYuaGFzU3RyaW5nICYmICFzZWxmLmhhc0ZhbHNlKSB7XG4gICAgICAgICAgICBvblRydWUoKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKCFzZWxmLmhhc1N0cmluZyAmJiBzZWxmLmhhc0ZhbHNlKSB7XG4gICAgICAgICAgICBvbkZhbHNlKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9uU3RyaW5nKCk7XG4gICAgICAg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gfVxuICAgICAgICB9XG5cbiAgICAgICAgYW5ndWxhci5mb3JFYWNoKHZhbHVlcywgZnVuY3Rpb24odiwgaykge1xuICAgICAgICAgIC8vY2FsbCB2YWwoKSBmb3IgZWFjaCBleGlzdGluZyBjb21ibywgZS5nLiB0aGlzLiRob3VyLnZhbCgpXG4gICAgICAgICAgaWYodGhhdFsnJCcra10pIHtcblxuICAgICAgICAgICAgaWYoayA9PT0gJ21pbnV0ZScgJiYgdGhhdC5vcHRpb25zLm1pbnV0ZVN0ZXAgPiAxICYmIHRoYXQub3B0aW9ucy5yb3VuZFRpbWUpIHtcbiAgICAgICAgICAgICB2ID0gZ2V0TmVhcmVzdCh0aGF0WyckJytrXSwgdik7XG4gICAgICAgICAgIH1cbiAgICAgICAgICAgXG4gICAgICAgICAgIGlmKGsgPT09ICdzZWNvbmQnICYmIHRoYXQub3B0aW9ucy5zZWNvbmRTdGVwID4gMSAmJiB0aGF0Lm9wdGlvbnMucm91bmRUaW1lKSB7XG4gICAgICAgICAgICAgdiA9IGdldE5lYXJlc3QodGhhdFsnJCcra10sIHYpO1xuICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgXG4gICAgICAgICAgIHRoYXRbJyQnK2tdLnZhbCh2KTtcbiAgICAgICAgIH1cbiAgICAgICB9KTtcblxuICAgICAgICAvLyB1cGRhdGUgZGF5cyBjb3VudFxuICAgICAgICBpZiAodGhpcy5vcHRpb25zLnNtYXJ0RGF5cykge1xuICAgICAgICAgIHRoaXMuZmlsbENvbWJvKCdkYXknKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMuJGVsZW1lbnQudmFsKGR0LmZvcm1hdCh0aGlzLm9wdGlvbnMuZm9ybWF0KSkudHJpZ2dlckhhbmRsZXIoJ2NoYW5nZScpO1xuICAgICAgfVxuICAgIH0sXG4gICAgXG4gICAgLypcbiAgICAgaGlnaGxpZ2h0IGNvbWJvcyBpZiBkYXRlIGlzIGludmFsaWRcb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Gl0YWJsZVBhc3N3b3JkJzpcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVEYXRldGltZUxvY2FsJzpcbiAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hZGRDbGFzcygnZm9ybS1jb250cm9sJyk7XG4gICAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwuYXR0cignbmctY2xhc3MnLCBcInsnaXMtaW52YWxpZCc6ICRlcnJvcn1cIik7XG4gICAgICAgICAgICAgICAgICBpZiAodGhpcy50aGVtZS5pbnB1dENsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gZG9uYHQgYXBwbHkgYGZvcm0tY29udHJvbC1zbWAgYW5kIGBmb3JtLWNvbnRyb2wtbGdgIHRvIHNlbGVjdCBtdWx0aXBsZVxuICAgICAgICAgICAgICAgICAgICAgIC8vIHNob3VsZCBiZSBmaXhlZCBpbiBicyBpdHNlbGYhXG4gICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5pbnB1dEVsLmF0dHIoJ211bHRpcGxlJykgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKHRoaXMudGhlbWUuaW5wdXRDbGFzcyA9PT0gJ2Zvcm0tY29udHJvbC1zbScgfHwgdGhpcy50aGVtZS5pbnB1dENsYXNzID09PSAnZm9ybS1jb250cm9sLWxnJykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hZGRDbGFzcyh0aGlzLnRoZW1lLmlucHV0Q2xhc3MpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgIGNhc2UgJ2VkaXRhYmxlQ2hlY2tib3gnOlxuICAgICAgICAgICAgICAgICAgdGhpcy5lZGl0b3JFbC5hZGRDbGFzcygnZm9ybS1jaGVjaycpO1xuICAgICAgICAgIH1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ICAgaWYgKCFpc09iamVjdChvYmopICYmICFpc0Z1bmN0aW9uKG9iaikpIGNvbnRpbnVlO1xuICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICBmb3IgKHZhciBqID0gMCwgamogPSBrZXlzLmxlbmd0aDsgaiA8IGpqOyBqKyspIHtcbiAgICAgIHZhciBrZXkgPSBrZXlzW2pdO1xuICAgICAgdmFyIHNyYyA9IG9ialtrZXldO1xuXG4gICAgICBpZiAoZGVlcCAmJiBpc09iamVjdChzcmMpKSB7XG4gICAgICAgIGlmIChpc0RhdGUoc3JjKSkge1xuICAgICAgICAgIGRzdFtrZXldID0gbmV3IERhdGUoc3JjLnZhbHVlT2YoKSk7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNSZWdFeHAoc3JjKSkge1xuICAgICAgICAgIGRzdFtrZXldID0gbmV3IFJlZ0V4cChzcmMpO1xuICAgICAgICB9IGVsc2UgaWYgKHNyYy5ub2RlTmFtZSkge1xuICAgICAgICAgIGRzdFtrZXldID0gc3JjLmNsb25lTm9kZSh0cnVlKTtcbiAgICAgICAgfSBlbHNlIGlmIChpc0VsZW1lbnQoc3JjKSkge1xuICAgICAgICAgIGRzdFtrZXldID0gc3JjLmNsb25lKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGtleSAhPT0gJ19fcHJvdG9fXycpIHtcbiAgICAgICAgICAgIGlmICghaXNPYmplY3QoZHN0W2tleV0pKSBkc3Rba2V5XSA9IGlzQXJyYXkoc3JjKSA/IFtdIDoge307XG4gICAgICAgICAgICBiYXNlRXh0ZW5kKGRzdFtrZXldLCBbc3JjXSwgdHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkc3Rba2V5XSA9IHNyYztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICBzZXRIYXNoS2V5KGRzdCwgaCk7XG4gIHJldHVybiBkc3Q7XG59XG5cbi8q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biAgICAgICAgICAkc2NvcGUubGVhZGVyID0ge307XG5cbiAgICAgICAgICAkc2NvcGUucmVzZXQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIC8vIEV4YW1wbGUgd2l0aCAxIGFyZ3VtZW50XG4gICAgICAgICAgICAkc2NvcGUudXNlciA9IGFuZ3VsYXIuY29weSgkc2NvcGUubGVhZGVyKTtcbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgJHNjb3BlLnVwZGF0ZSA9IGZ1bmN0aW9uKHVzZXIpIHtcbiAgICAgICAgICAgIC8vIEV4YW1wbGUgd2l0aCAyIGFyZ3VtZW50c1xuICAgICAgICAgICAgYW5ndWxhci5jb3B5KHVzZXIsICRzY29wZS5sZWFkZXIpO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICAkc2NvcGUucmVzZXQoKTtcbiAgICAgICAgfV0pO1xuICAgIDwvZmlsZT5cbiAgPC9leGFtcGxlPlxuICovXG5mdW5jdGlvbiBjb3B5KHNvdXJjZSwgZGVzdGluYXRpb24sIG1heERlcHRoKSB7XG4gIHZhciBzdGFja1NvdXJjZSA9IFtdO1xuICB2YXIgc3RhY2tEZXN0ID0gW107XG4gIG1heERlcHRoID0gaXNWYWxpZE9iamVjdE1heERlcHRoKG1heERlcHRoKSA/IG1heERlcHRoIDogTmFOO1xuXG4gIGlmIChkZXN0aW5hdGlvbikge1xuICAgIGlmIChpc1R5cGVkQXJyYXkoZGVzdGluYXRpb24pIHx8IGlzQXJyYXlCdWZmZXIoZGVzdGluYXRpb24pKSB7XG4gICAgICB0aHJvdyBuZ01pbkVycignY3B0YScsICdDYW5cXCd0IGNvcHkhIFR5cGVkQXJyYXkgZGVzdGluYXRpb24gY2Fubm90IGJlIG11dGF0ZWQuJyk7XG4gICAgfVxuICAgIGlmIChzb3VyY2UgPT09IGRlc3RpbmF0aW9uKSB7XG4gICAgICB0aHJvdyBuZ01pbkVycignY3BpJywgJ0NhblxcJ3QgY29weSEgU291cmNlIGFuZCB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2xsZXIxXCI+XG4gICAgICAgICAgIEkgY2FuIGFkZDoge3thfX0gKyB7e2J9fSA9ICB7eyBhK2IgfX1cblxuICAgICAgICAgICA8cD5UaGlzIHJlbmRlcnMgYmVjYXVzZSB0aGUgY29udHJvbGxlciBkb2VzIG5vdCBmYWlsIHRvXG4gICAgICAgICAgICAgIGluc3RhbnRpYXRlLCBieSB1c2luZyBleHBsaWNpdCBhbm5vdGF0aW9uIHN0eWxlIChzZWVcbiAgICAgICAgICAgICAgc2NyaXB0LmpzIGZvciBkZXRhaWxzKVxuICAgICAgICAgICA8L3A+XG4gICAgICAgPC9kaXY+XG5cbiAgICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9XCJHb29kQ29udHJvbGxlcjJcIj5cbiAgICAgICAgICAgTmFtZTogPGlucHV0IG5nLW1vZGVsPVwibmFtZVwiPjxiciAvPlxuICAgICAgICAgICBIZWxsbywge3tuYW1lfX0hXG5cbiAgICAgICAgICAgPHA+VGhpcyByZW5kZXJzIGJlY2F1c2UgdGhlIGNvbnRyb2xsZXIgZG9lcyBub3QgZmFpbCB0b1xuICAgICAgICAgICAgICBpbnN0YW50aWF0ZSwgYnkgdXNpbmcgZXhwbGljaXQgYW5ub3RhdGlvbiBzdHlsZVxuICAgICAgICAgICAgICAoc2VlIHNjcmlwdC5qcyBmb3IgZGV0YWlscylcbiAgICAgICAgICAgPC9wPlxuICAgICAgIDwvZGl2PlxuXG4gICAgICAgPGRpdiBuZy1jb250cm9sbGVyPVwiQmFkQ29udHJvbGxlclwiPlxuICAgICAgICAgICBJIGNhbiBhZGQ6IHt7YX19ICsge3tifX0gPSAge3sgYStiIH19XG5cbiAgICAgICAgICAgPHA+VGhlIGNvbnRyb2xsZXIgY291bGQgbm90IGJlIGluc3RhbnRpYXRlZCwgZHVlIHRvIHJlbHlpbmdcbiAgICAgICAgICAgICAgb24gYXV0b21hdGljIGZ1bmN0aW9uIGFubm90YXRpb25zICh3aGljaCBhcmUgZGlzYWJsZWQgaW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IG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2luZm9cbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdD19IGluZm8gSW5mb3JtYXRpb24gYWJvdXQgdGhlIG1vZHVsZVxuICAgICAgICAgICAqIEByZXR1cm5zIHtPYmplY3R8TW9kdWxlfSBUaGUgY3VycmVudCBpbmZvIG9iamVjdCBmb3IgdGhpcyBtb2R1bGUgaWYgY2FsbGVkIGFzIGEgZ2V0dGVyLFxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBvciBgdGhpc2AgaWYgY2FsbGVkIGFzIGEgc2V0dGVyLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogUmVhZCBhbmQgd3JpdGUgY3VzdG9tIGluZm9ybWF0aW9uIGFib3V0IHRoaXMgbW9kdWxlLlxuICAgICAgICAgICAqIEZvciBleGFtcGxlIHlvdSBjb3VsZCBwdXQgdGhlIHZlcnNpb24gb2YgdGhlIG1vZHVsZSBpbiBoZXJlLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogYGBganNcbiAgICAgICAgICAgKiBhbmd1bGFyLm1vZHVsZSgnbXlNb2R1bGUnLCBbXSkuaW5mbyh7IHZlcnNpb246ICcxLjAuMCcgfSk7XG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBUaGUgdmVyc2lvbiBjb3VsZCB0aGVuIGJlIHJlYWQgYmFjayBvdXQgYnkgYWNjZXNzaW5nIHRoZSBtb2R1bGUgZWxzZXdoZXJlOlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICogdmFyIHZlcnNpb24gPSBhbmd1bGFyLm1vZHVsZSgnbXlNb2R1bGUnKS5pbmZvKCkudmVyc2lvbjtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFlvdSBjYW4gYWxzbyByZXRyaWV2ZSB0aGlzIGluZm9ybWF0aW9uIGR1cmluZyBydW50aW1lIHZpYSB0aGVcbiAgICAgICAgICAgKiB7QGxpbmsgJGluamVjdG9yI21vZHVsZXMgYCRpbmplY3Rvci5tb2R1bGVzYH0gcHJvcGVydHk6XG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIHZhciB2ZXJzaW9uID0gJGluamVjdG9yLm1vZHVsZXNbJ215TW9kdWxlJ10uaW5mbygpLnZlcnNpb247XG4gICAgICAgICAgICogYGBgXG4gICAgICAgICAgICovXG4gICAgICAgICAgaW5mbzogZnVuY3Rpb24odmFsdWUpIHtcbiAgICAgICAgICAgIGlmIChpc0RlZmluZWQodmFsdWUpKSB7XG4gICAgICAgICAgICAgIGlmICghaXNPYmplY3QodmFsdWUpKSB0aHJvdyBuZ01pbkVycignYW9iaicsICdBcmd1bWVudCBcXCd7MH1cXCcgbXVzdCBiZSBhbiBvYmplY3QnLCAndmFsdWUnKTtcbiAgICAgICAgICAgICAgaW5mbyA9IHZhbHVlO1xuICAgICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbmZvO1xuICAgICAgICAgIH0sXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgcHJvcGVydHlcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNyZXF1aXJlc1xuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIEhvbGRzIHRoZSBsaXN0IG9mIG1vZHVsZXMgd2hpY2ggdGhlIGluamVjdG9yIHdpbGwgbG9hZCBiZWZvcmUgdGhlIGN1cnJlbnQgbW9kdWxlIGlzXG4gICAgICAgICAgICogbG9hZGVkLlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHJlcXVpcmVzOiByZXF1aXJlcyxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBwcm9wZXJ0eVxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI25hbWVcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBOYW1lIG9mIHRoZSBtb2R1bGUuXG4gICAgICAgICAgICovXG4gICAgICAgICAgbmFtZTogbmFtZSxcblxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3Byb3ZpZGVyXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIHNlcnZpY2UgbmFtZVxuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IHByb3ZpZGVyVHlwZSBDb25zdHJ1Y3Rpb24gZnVuY3Rpb24gZm9yIGNyZWF0aW5nIG5ldyBpbnN0YW5jZSBvZiB0aGVcbiAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VydmljZS5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBTZWUge0BsaW5rIGF1dG8uJHByb3ZpZGUjcHJvdmlkZXIgJHByb3ZpZGUucHJvdmlkZXIoKX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgcHJvdmlkZXI6IGludm9rZUxhdGVyQW5kU2V0TW9kdWxlTmFtZSgnJHByb3ZpZGUnLCAncHJvdmlkZXInKSxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICAgKiBAbmFtZ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gICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjdmFsdWVcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHsqfSBvYmplY3QgU2VydmljZSBpbnN0YW5jZSBvYmplY3QuXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI3ZhbHVlICRwcm92aWRlLnZhbHVlKCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIHZhbHVlOiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAndmFsdWUnKSxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNjb25zdGFudFxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBjb25zdGFudCBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHsqfSBvYmplY3QgQ29uc3RhbnQgdmFsdWUuXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogQmVjYXVzZSB0aGUgY29uc3RhbnRzIGFyZSBmaXhlZCwgdGhleSBnZXQgYXBwbGllZCBiZWZvcmUgb3RoZXIgcHJvdmlkZSBtZXRob2RzLlxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNjb25zdGFudCAkcHJvdmlkZS5jb25zdGFudCgpfS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBjb25zdGFudDogaW52b2tlTGF0ZXIoJyRwcm92aWRlJywgJ2NvbnN0YW50JywgJ3Vuc2hpZnQnKSxcblxuICAgICAgICAgICAvKip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iBhblxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqXG4gICAgICAgICAgICogKipOT1RFKio6IGFuaW1hdGlvbnMgdGFrZSBlZmZlY3Qgb25seSBpZiB0aGUgKipuZ0FuaW1hdGUqKiBtb2R1bGUgaXMgbG9hZGVkLlxuICAgICAgICAgICAqXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBEZWZpbmVzIGFuIGFuaW1hdGlvbiBob29rIHRoYXQgY2FuIGJlIGxhdGVyIHVzZWQgd2l0aFxuICAgICAgICAgICAqIHtAbGluayAkYW5pbWF0ZSAkYW5pbWF0ZX0gc2VydmljZSBhbmQgZGlyZWN0aXZlcyB0aGF0IHVzZSB0aGlzIHNlcnZpY2UuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIG1vZHVsZS5hbmltYXRpb24oJy5hbmltYXRpb24tbmFtZScsIGZ1bmN0aW9uKCRpbmplY3QxLCAkaW5qZWN0Mikge1xuICAgICAgICAgICAqICAgcmV0dXJuIHtcbiAgICAgICAgICAgKiAgICAgZXZlbnROYW1lIDogZnVuY3Rpb24oZWxlbWVudCwgZG9uZSkge1xuICAgICAgICAgICAqICAgICAgIC8vY29kZSB0byBydW4gdGhlIGFuaW1hdGlvblxuICAgICAgICAgICAqICAgICAgIC8vb25jZSBjb21wbGV0ZSwgdGhlbiBydW4gZG9uZSgpXG4gICAgICAgICAgICogICAgICAgcmV0dXJuIGZ1bmN0aW9uIGNhbmNlbGxhdGlvbkZ1bmN0aW9uKGVsZW1lbnQpIHtcbiAgICAgICAgICAgKiAgICAgICAgIC8vY29kZSB0byBjYW5jZWwgdGhlIGFuaW1hdGlvblxuICAgICAgICAgICAqICAgICAgIH1cbiAgICAgICAgICAgKiAgICAgfVxuICAgICAgICAgICAqICAgfVxuICAgICAgICAgIC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ICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3J1blxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBpbml0aWFsaXphdGlvbkZuIEV4ZWN1dGUgdGhpcyBmdW5jdGlvbiBhZnRlciBpbmplY3RvciBjcmVhdGlvbi5cbiAgICAgICAgICAgKiAgICBVc2VmdWwgZm9yIGFwcGxpY2F0aW9uIGluaXRpYWxpemF0aW9uLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFVzZSB0aGlzIG1ldGhvZCB0byByZWdpc3RlciB3b3JrIHdoaWNoIHNob3VsZCBiZSBwZXJmb3JtZWQgd2hlbiB0aGUgaW5qZWN0b3IgaXMgZG9uZVxuICAgICAgICAgICAqIGxvYWRpbmcgYWxsIG1vZHVsZXMuXG4gICAgICAgICAgICovXG4gICAgICAgICAgcnVuOiBmdW5jdGlvbihibG9jaykge1xuICAgICAgICAgICAgcnVuQmxvY2tzLnB1c2goYmxvY2spO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChjb25maWdGbikge1xuICAgICAgICAgIGNvbmZpZyhjb25maWdGbik7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbW9kdWxlSW5zdGFuY2U7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBwcm92aWRlclxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbWV0aG9kXG4gICAgICAgICAqIEBwYXJhbSB7U3RyaW5nPX0gaW5zZXJ0TWV0aG9kXG4gICAgICAgICAqIEByZXR1cm5zIHthbmd1bGFyLk1vZHVsZX1cbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGludm9rZUxhdGVyKHByb3ZpZGVyLCBtZXRob2QsIGluc2VydE1ldGhvZCwgcXVldWU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cmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgamF2YXNjcmlwdCB0byBiZSBleGVjdXRlZD8gKlxuICogICAgT3IgYWxsb3dzIGZvciBzb21lb25lIHRvIGNoYW5nZSB0aGUgcHJvdG90eXBlIG9mIGJ1aWx0LWluIG9iamVjdHM/ICAgKlxuICogICAgIE9yIGdpdmVzIHVuZGVzaXJlZCBhY2Nlc3MgdG8gdmFyaWFibGVzIGxpa2VzIGRvY3VtZW50IG9yIHdpbmRvdz8gICAgKlxuICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKi9cblxuLyogZ2xvYmFsXG4gIEpRTGl0ZVByb3RvdHlwZTogdHJ1ZSxcbiAgQk9PTEVBTl9BVFRSOiB0cnVlLFxuICBBTElBU0VEX0FUVFI6IHRydWVcbiovXG5cbi8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy9cbi8vSlFMaXRlXG4vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vXG5cbi8qKlxuICogQG5nZG9jIGZ1bmN0aW9uXG4gKiBAbmFtZSBhbmd1bGFyLmVsZW1lbnRcbiAqIEBtb2R1bGUgbmdcbiAqIEBraW5kIGZ1bmN0aW9uXG4gKlxuICogQGRlc2NyaXB0aW9uXG4gKiBXcmFwcy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gICAgICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICAgICBhbmd1bGFyLm1vZHVsZSgnYW5jaG9yU2Nyb2xsRXhhbXBsZScsIFtdKVxuICAgICAgICAgICAuY29udHJvbGxlcignU2Nyb2xsQ29udHJvbGxlcicsIFsnJHNjb3BlJywgJyRsb2NhdGlvbicsICckYW5jaG9yU2Nyb2xsJyxcbiAgICAgICAgICAgICBmdW5jdGlvbigkc2NvcGUsICRsb2NhdGlvbiwgJGFuY2hvclNjcm9sbCkge1xuICAgICAgICAgICAgICAgJHNjb3BlLmdvdG9Cb3R0b20gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgLy8gc2V0IHRoZSBsb2NhdGlvbi5oYXNoIHRvIHRoZSBpZCBvZlxuICAgICAgICAgICAgICAgICAvLyB0aGUgZWxlbWVudCB5b3Ugd2lzaCB0byBzY3JvbGwgdG8uXG4gICAgICAgICAgICAgICAgICRsb2NhdGlvbi5oYXNoKCdib3R0b20nKTtcblxuICAgICAgICAgICAgICAgICAvLyBjYWxsICRhbmNob3JTY3JvbGwoKVxuICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7XG4gICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgIH1dKTtcbiAgICAgICA8L2ZpbGU+XG4gICAgICAgPGZpbGUgbmFtZT1cInN0eWxlLmNzc1wiPlxuICAgICAgICAgI3Njcm9sbEFyZWEge1xuICAgICAgICAgICBoZWlnaHQ6IDI4MHB4O1xuICAgICAgICAgICBvdmVyZmxvdzogYXV0bztcbiAgICAgICAgIH1cblxuICAgICAgICAgI2JvdHRvbSB7XG4gICAgICAgICAgIGRpc3BsYXk6IGJsb2NrO1xuICAgICAgICAgICBtYXJnaW4tdG9wOiAyMDAwcHg7XG4gICAgICAgICB9XG4gICAgICAgPC9maWxlPlxuICAgICA8L2V4YW1wbGU+XG4gICAqXG4gICAqIDxociAvPlxuICAgKiBUaGUgZXhhbXBsZSBi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yb2xsKSB7XG4gICAgICAgICAgICAgJGFuY2hvclNjcm9sbC55T2Zmc2V0ID0gNTA7ICAgLy8gYWx3YXlzIHNjcm9sbCBieSA1MCBleHRyYSBwaXhlbHNcbiAgICAgICAgICAgfV0pXG4gICAgICAgICAgIC5jb250cm9sbGVyKCdoZWFkZXJDdHJsJywgWyckYW5jaG9yU2Nyb2xsJywgJyRsb2NhdGlvbicsICckc2NvcGUnLFxuICAgICAgICAgICAgIGZ1bmN0aW9uKCRhbmNob3JTY3JvbGwsICRsb2NhdGlvbiwgJHNjb3BlKSB7XG4gICAgICAgICAgICAgICAkc2NvcGUuZ290b0FuY2hvciA9IGZ1bmN0aW9uKHgpIHtcbiAgICAgICAgICAgICAgICAgdmFyIG5ld0hhc2ggPSAnYW5jaG9yJyArIHg7XG4gICAgICAgICAgICAgICAgIGlmICgkbG9jYXRpb24uaGFzaCgpICE9PSBuZXdIYXNoKSB7XG4gICAgICAgICAgICAgICAgICAgLy8gc2V0IHRoZSAkbG9jYXRpb24uaGFzaCB0byBgbmV3SGFzaGAgYW5kXG4gICAgICAgICAgICAgICAgICAgLy8gJGFuY2hvclNjcm9sbCB3aWxsIGF1dG9tYXRpY2FsbHkgc2Nyb2xsIHRvIGl0XG4gICAgICAgICAgICAgICAgICAgJGxvY2F0aW9uLmhhc2goJ2FuY2hvcicgKyB4KTtcbiAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAvLyBjYWxsICRhbmNob3JTY3JvbGwoKSBleHBsaWNpdGx5LFxuICAgICAgICAgICAgICAgICAgIC8vIHNpbmNlICRsb2NhdGlvbi5oYXNoIGhhc24ndCBjaGFuZ2VkXG4gICAgICAgICAgICAgICAgICAgJGFuY2hvclNjcm9sbCgpO1xuICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgIH1cbiAgICAgICAgICAgXSk7XG4gICAgICAgPC9maWxlPlxuICAgICAgIDxmaWxlIG5h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GVtZW50KTtcbiAgICAgICAgaWYgKGRhdGEpIHtcbiAgICAgICAgICB2YXIgZXhpc3RpbmcgPSBzcGxpdENsYXNzZXMoZWxlbWVudC5hdHRyKCdjbGFzcycpKTtcbiAgICAgICAgICB2YXIgdG9BZGQgPSAnJztcbiAgICAgICAgICB2YXIgdG9SZW1vdmUgPSAnJztcbiAgICAgICAgICBmb3JFYWNoKGRhdGEsIGZ1bmN0aW9uKHN0YXR1cywgY2xhc3NOYW1lKSB7XG4gICAgICAgICAgICB2YXIgaGFzQ2xhc3MgPSAhIWV4aXN0aW5nW2NsYXNzTmFtZV07XG4gICAgICAgICAgICBpZiAoc3RhdHVzICE9PSBoYXNDbGFzcykge1xuICAgICAgICAgICAgICBpZiAoc3RhdHVzKSB7XG4gICAgICAgICAgICAgICAgdG9BZGQgKz0gKHRvQWRkLmxlbmd0aCA/ICcgJyA6ICcnKSArIGNsYXNzTmFtZTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0b1JlbW92ZSArPSAodG9SZW1vdmUubGVuZ3RoID8gJyAnIDogJycpICsgY2xhc3NOYW1lO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBmb3JFYWNoKGVsZW1lbnQsIGZ1bmN0aW9uKGVsbSkge1xuICAgICAgICAgICAgaWYgKHRvQWRkKSB7XG4gICAgICAgICAgICAgIGpxTGl0ZUFkZENsYXNzKGVsbSwgdG9BZGQpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRvUmVtb3ZlKSB7XG4gICAgICAgICAgICAgIGpxTGl0ZVJlbW92ZUNsYXNzKGVsbSwgdG9SZW1vdmUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHBvc3REaWdlc3RRdWV1ZS5kZWxldGUoZWxlbWVudCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgcG9zdERpZ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cGxhdGUuaHRtbCcsXG4gICAgICAgICAgICAgIGNvbnRyb2xsZXI6IGZ1bmN0aW9uKCRlbGVtZW50LCAkYW5pbWF0ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMucnVubmVyID0gbnVsbDtcblxuICAgICAgICAgICAgICAgIHRoaXMuYWRkQ2xhc3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyID0gJGFuaW1hdGUuYWRkQ2xhc3MoJGVsZW1lbnQuZmluZCgnZGl2JyksICdyZWQnKTtcbiAgICAgICAgICAgICAgICAgIHZhciBjdHJsID0gdGhpcztcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyLmZpbmFsbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGN0cmwucnVubmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUNsYXNzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLnJ1bm5lciA9ICRhbmltYXRlLnJlbW92ZUNsYXNzKCRlbGVtZW50LmZpbmQoJ2RpdicpLCAncmVkJyk7XG4gICAgICAgICAgICAgICAgICB2YXIgY3RybCA9IHRoaXM7XG4gICAgICAgICAgICAgICAgICB0aGlzLnJ1bm5lci5maW5hbGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBjdHJsLnJ1bm5lciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdGhpcy5jYW5jZWwgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICRhbmltYXRlLmNhbmNlbCh0aGlzLnJ1bm5lcik7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICA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bmN0aW9uKCkge1xuICAgICAgICBpZiAoIXRoaXMucHJvbWlzZSkge1xuICAgICAgICAgIHZhciBzZWxmID0gdGhpcztcbiAgICAgICAgICB0aGlzLnByb21pc2UgPSAkcShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHNlbGYuZG9uZShmdW5jdGlvbihzdGF0dXMpIHtcbiAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICByZWplY3QoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnByb21pc2U7XG4gICAgICB9LFxuXG4gICAgICB0aGVuOiBmdW5jdGlvbihyZXNvbHZlSGFuZGxlciwgcmVqZWN0SGFuZGxlcikge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXRQcm9taXNlKCkudGhlbihyZXNvbHZlSGFuZGxlciwgcmVqZWN0SGFuZGxlcik7XG4gICAgICB9LFxuXG4gICAgICAnY2F0Y2gnOiBmdW5jdGlvbihoYW5kbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb21pc2UoKVsnY2F0Y2gnXShoYW5kbGVyKTtcbiAgICAgIH0sXG5cbiAgICAgICdmaW5hbGx5JzogZnVuY3Rpb24oaGFuZGxlcikge1xuICAgICAgICByZXR1cm4gdGhpcy5nZXRQcm9taXNlKClbJ2ZpbmFsbHknXShoYW5kbGVyKTtcbiAgICAgIH0sXG5cbiAgICAgIHBhdXNlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgaWYgKHRoaXMuaG9zdC5wYXVzZSkge1xuICAgICAgICAgIHRoaXMuaG9zdC5wYXVzZSgpO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICByZXN1bWU6IGZ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B0aGUgdmFsdWUgc3RvcmVkLlxuICAgICAgICAgKi9cbiAgICAgICAgcHV0OiBmdW5jdGlvbihrZXksIHZhbHVlKSB7XG4gICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHZhbHVlKSkgcmV0dXJuO1xuICAgICAgICAgIGlmIChjYXBhY2l0eSA8IE51bWJlci5NQVhfVkFMVUUpIHtcbiAgICAgICAgICAgIHZhciBscnVFbnRyeSA9IGxydUhhc2hba2V5XSB8fCAobHJ1SGFzaFtrZXldID0ge2tleToga2V5fSk7XG5cbiAgICAgICAgICAgIHJlZnJlc2gobHJ1RW50cnkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICghKGtleSBpbiBkYXRhKSkgc2l6ZSsrO1xuICAgICAgICAgIGRhdGFba2V5XSA9IHZhbHVlO1xuXG4gICAgICAgICAgaWYgKHNpemUgPiBjYXBhY2l0eSkge1xuICAgICAgICAgICAgdGhpcy5yZW1vdmUoc3RhbGVFbmQua2V5KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNnZXRcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIFJldHJpZXZlcyBuYW1lZCBkYXRhIHN0b3JlZCBpbiB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9IG9iamVjdC5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSB0aGUga2V5IG9mIHRoZSBkYXRhIHRvIGJlIHJldHJpZXZlZFxuICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHZhbHVlIHN0b3JlZC5cbiAgICAgICAgICovXG4gICAgICAgIGdldDogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkge1xuICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47XG5cbiAgICAgICAgICAgIHJlZnJlc2gobHJ1RW50cnkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBkYXRhW2tleV07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZVxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmVtb3ZlcyBhbiBlbnRyeSBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgb2YgdGhlIGVudHJ5IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgICovXG4gICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkge1xuICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47XG5cbiAgICAgICAgICAgIGlmIChscnVFbnRyeSA9PT0gZnJlc2hFbmQpIGZyZXNoRW5kID0gbHJ1RW50cnkucDtcbiAgICAgICAgICAgIGlmIChscnVFbnRyeSA9PT0gc3RhbGVFbmQpIHN0YWxlRW5kID0gbHJ1RW50cnkubjtcbiAgICAgICAgICAgIGxpbmsobHJ1RW50cnkubixscnVFbnRyeS5wKTtcblxuICAgICAgICAgICAgZGVsZXRlIGxydUhhc2hba2V5XTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIShrZXkgaW4gZGF0YSkpIHJldHVybjtcblxuICAgICAgICAgIGRlbGV0ZSBkYXRhW2tleV07XG4gICAgICAgICAgc2l6ZS0tO1xuICAgICAgICB9LFxuXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNyZW1vdmVBbGxcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIENsZWFycyB0aGUgY2FjaGUgb2JqZWN0IG9mIGFueSBlbnRyaWVzLlxuICAgICAgICAgKi9cbiAgICAgICAgcmVtb3ZlQWxsOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBkYXRhID0gY3JlYXRlTWFwKCk7XG4gICAgICAgICAgc2l6ZSA9IDA7XG4gICAgICAgICAgbHJ1SGFzaCA9IGNyZWF0ZU1hcCgpO1xuICAgICAgICAgIGZyZXNoRW5kID0gc3RhbGVFbmQgPSBudWxsO1xuICAgICAgICB9LFxuXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNkZXN0cm95XG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgKiBEZXN0cm95cyB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9IG9iamVjdCBlbnRpcmVseSxcbiAgICAgICAgICogcmVtb3ZpbmcgaXQgZnJvbSB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkgJGNhY2hlRmFjdG9yeX0gc2V0LlxuICAgICAgICAgKi9cbiAgICAgICAgZGVzdHJveTogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgZGF0YSA9IG51bGw7XG4gICAgICAgICAgc3RhdHMgPSBudWxsO1xuICAgICAgICAgIGxydUhhc2ggPSBudWxsO1xuICAgICAgICAgIGRlbGV0ZSBjYWNoZXNbY2FjaGVJZF07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2luZm9cbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIFJldHJpZXZlIGluZm9ybWF0aW9uIHJlZ2FyZGluZyBhIHBhcnRpY3VsYXIge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcmV0dXJucyB7b2JqZWN0fSBhbiBvYmplY3Qgd2l0aCB0aGUgZm9sbG93aW5nIHByb3BlcnRpZXM6XG4gICAgICAgICAqICAgPHVsPlxuICAgICAgICAgKiAgICAgPGxpPioqaWQqKjogdGhlIGlkIG9mIHRoZSBjYWNoZSBpbnN0YW5jZTwvbGk+XG4gICAgICAgICAqICAgICA8bGk+KipzaXplKio6IHRoZSBudW1iZXIgb2YgZW50cmllcyBrZXB0IGluIHRoZSBjYWNoZSBpbnN0YW5jZTwvbGk+XG4gICAgICAgICAqICAgICA8bGk+KiouLi4qKjogYW55IGFkZGl0aW9uYWwgcHJvcGVydGllcyBmcm9tIHRoZSBvcHRpb25zIG9iamVjdCB3aGVuIGNyZWF0aW5nIHRoZVxuICAgICAgICAgKiAgICAgICBjYWNoZS48L2xpPlxuICAgICAgICAgKiAgIDwvdWw+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UuJHdhdGNoKFxuICAgICAgICAgICAgICBmdW5jdGlvbihzY29wZSkge1xuICAgICAgICAgICAgICAgIC8vIFdhdGNoIHRoZSAnY29tcGlsZScgZXhwcmVzc2lvbiBmb3IgY2hhbmdlcy5cbiAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuJGV2YWwoYXR0cnMuY29tcGlsZSk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgLy8gV2hlbiB0aGUgJ2NvbXBpbGUnIGV4cHJlc3Npb24gY2hhbmdlc1xuICAgICAgICAgICAgICAgIC8vIGFzc2lnbiBpdCBpbnRvIHRoZSBjdXJyZW50IERPTS5cbiAgICAgICAgICAgICAgICBlbGVtZW50Lmh0bWwodmFsdWUpO1xuXG4gICAgICAgICAgICAgICAgLy8gQ29tcGlsZSB0aGUgbmV3IERPTSBhbmQgbGluayBpdCB0byB0aGUgY3VycmVudCBzY29wZS5cbiAgICAgICAgICAgICAgICAvLyBOT1RFOiB3ZSBvbmx5IGNvbXBpbGUgJy5jaGlsZE5vZGVzJyBzbyB0aGF0IHdlXG4gICAgICAgICAgICAgICAgLy8gZG9uJ3QgZ2V0IGludG8gYW4gaW5maW5pdGUgbG9vcCBjb21waWxpbmcgb3Vyc2VsdmVzLlxuICAgICAgICAgICAgICAgICRjb21waWxlKGVsZW1lbnQuY29udGVudHMoKSkoc2NvcGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICApO1xuICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgICAgfSlcbiAgICAgIC5jb250cm9sbGVyKCdHcmVldGVyQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICRzY29wZS5uYW1lID0gJ0FuZ3VsYXJKUyc7XG4gICAgICAgICRzY29wZS5odG1sID0gJ0hlbGxvIHt7bmFtZX19JztcbiAgICAgIH1dKTt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oJ2V4YW1wbGVOZ09uJywgW10pXG4gKiAgICAgICAuY29tcG9uZW50KCdtYWluJywge1xuICogICAgICAgICB0ZW1wbGF0ZVVybDogJ21haW4uaHRtbCcsXG4gKiAgICAgICAgIGNvbnRyb2xsZXI6IGZ1bmN0aW9uKCkge1xuICogICAgICAgICAgIHRoaXMuZXZlbnRMb2cgPSAnJztcbiAqXG4gKiAgICAgICAgICAgdGhpcy5saXN0ZW5lciA9IGZ1bmN0aW9uKCRldmVudCkge1xuICogICAgICAgICAgICAgdGhpcy5ldmVudExvZyA9ICdFdmVudCB3aXRoIHR5cGUgXCInICsgJGV2ZW50LnR5cGUgKyAnXCIgZmlyZWQgYXQgJyArICRldmVudC5kZXRhaWw7XG4gKiAgICAgICAgICAgfTtcbiAqICAgICAgICAgfVxuICogICAgICAgfSlcbiAqICAgICAgIC5jb21wb25lbnQoJ2NoaWxkQ29tcG9uZW50Jywge1xuICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoaWxkLmh0bWwnLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigkZWxlbWVudCkge1xuICogICAgICAgICAgIHRoaXMuZmlyZUV2ZW50ID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgICB2YXIgZXZlbnQgPSBuZXcgQ3VzdG9tRXZlbnQoJ2N1c3RvbXR5cGUnLCB7IGRldGFpbDogbmV3IERhdGUoKX0pO1xuICpcbiAqICAgICAgICAgICAgICRlbGVtZW50WzBdLmRpc3BhdGNoRXZlbnQoZXZlbnQpO1xuICogICAgICAgICAgIH07XG4gKiAgICAgICAgIH1cbiAqICAgICAgIH0pO1xuICogICA8L2ZpbGU+XG4gKiAgIDxmaWxlIG5hbWU9XCJtYWluLmh0bWxcIj5cbiAqICAgICA8Y2hpbGQtY29tcG9uZW50IG5nLW9uLWN1c3RvbXR5cGU9XCIkY3RybC5saXN0ZW5lcigkZXZlbnQpXCI+PC9jaGlsZC1jb21wb25lbnQ+PGJyPlxuICogIC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yZWF0ZUNvbW1lbnQoY29udGVudCk7XG4gICAgfTtcblxuICAgIHJldHVybiBjb21waWxlO1xuXG4gICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gICAgZnVuY3Rpb24gY29tcGlsZSgkY29tcGlsZU5vZGVzLCB0cmFuc2NsdWRlRm4sIG1heFByaW9yaXR5LCBpZ25vcmVEaXJlY3RpdmUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c0NvbXBpbGVDb250ZXh0KSB7XG4gICAgICBpZiAoISgkY29tcGlsZU5vZGVzIGluc3RhbmNlb2YganFMaXRlKSkge1xuICAgICAgICAvLyBqcXVlcnkgYWx3YXlzIHJld3JhcHMsIHdoZXJlYXMgd2UgbmVlZCB0byBwcmVzZXJ2ZSB0aGUgb3JpZ2luYWwgc2VsZWN0b3Igc28gdGhhdCB3ZSBjYW5cbiAgICAgICAgLy8gbW9kaWZ5IGl0LlxuICAgICAgICAkY29tcGlsZU5vZGVzID0ganFMaXRlKCRjb21waWxlTm9kZXMpO1xuICAgICAgfVxuICAgICAgdmFyIGNvbXBvc2l0ZUxpbmtGbiA9XG4gICAgICAgICAgICAgIGNvbXBpbGVOb2RlcygkY29tcGlsZU5vZGVzLCB0cmFuc2NsdWRlRm4sICRjb21waWxlTm9kZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhQcmlvcml0eSwgaWdub3JlRGlyZWN0aXZlLCBwcmV2aW91c0NvbXBpbGVDb250ZXh0KTtcbiAgICAgIGNvbXBpbGUuJCRhZGRTY29wZUNsYXNzKCRjb21waWxlTm9kZXMpO1xuICAgICAgdmFyIG5hbWVzcGFjZSA9IG51bGw7XG4gICAgICByZXR1cm4gZnVuY3Rpb24gcHVibGljTGlua0ZuKHNjb3BlLCBjbG9uZUNvbm5lY3RGbiwgb3B0aW9ucykge1xuICAgICAgICBpZiAoISRjb21waWxlTm9kZXMpIHtcbiAgICAgICAgICB0aHJvdyAkY29tcGlsZU1p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b3BlIGFyZ3VtZW50IGlzIGF1dG8tZ2VuZXJhdGVkIHRvIHRoZSBuZXdcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQgb2YgdGhlIHRyYW5zY2x1ZGVkIHBhcmVudCBzY29wZS5cbiAgICAgKiBAcGFyYW0ge0pRTGl0ZX0ganFDb2xsZWN0aW9uIElmIHdlIGFyZSB3b3JraW5nIG9uIHRoZSByb290IG9mIHRoZSBjb21waWxlIHRyZWUgdGhlbiB0aGlzXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmd1bWVudCBoYXMgdGhlIHJvb3QganFMaXRlIGFycmF5IHNvIHRoYXQgd2UgY2FuIHJlcGxhY2Ugbm9kZXNcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uIGl0LlxuICAgICAqIEBwYXJhbSB7T2JqZWN0PX0gb3JpZ2luYWxSZXBsYWNlRGlyZWN0aXZlIEFuIG9wdGlvbmFsIGRpcmVjdGl2ZSB0aGF0IHdpbGwgYmUgaWdub3JlZCB3aGVuXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcGlsaW5nIHRoZSB0cmFuc2NsdXNpb24uXG4gICAgICogQHBhcmFtIHtBcnJheS48RnVuY3Rpb24+fSBwcmVMaW5rRm5zXG4gICAgICogQHBhcmFtIHtBcnJheS48RnVuY3Rpb24+fSBwb3N0TGlua0Zuc1xuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBwcmV2aW91c0NvbXBpbGVDb250ZXh0IENvbnRleHQgdXNlZCBmb3IgcHJldmlvdXMgY29tcGlsYXRpb24gb2YgdGhlIGN1cnJlbnRcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlXG4gICAgICogQHJldHVybnMge0Z1bmN0aW9ufSBsaW5rRm5cbiAgICAgKi9cbiAgICBmdW5jd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c2NsdXNpb25FcnJvciwgJHRlbXBsYXRlLCB0cmFuc2NsdWRlRm4sIHRlcm1pbmFsUHJpb3JpdHksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZURpcmVjdGl2ZSAmJiByZXBsYWNlRGlyZWN0aXZlLm5hbWUsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHBhc3MgaW46XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIGNvbnRyb2xsZXJEaXJlY3RpdmVzIC0gb3RoZXJ3aXNlIHdlJ2xsIGNyZWF0ZSBkdXBsaWNhdGVzIGNvbnRyb2xsZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIG5ld0lzb2xhdGVTY29wZURpcmVjdGl2ZSBvciB0ZW1wbGF0ZURpcmVjdGl2ZSAtIGNvbWJpbmluZyB0ZW1wbGF0ZXMgd2l0aFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICBlbGVtZW50IHRyYW5zY2x1c2lvbiBkb2Vzbid0IG1ha2Ugc2Vuc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgbmVlZCBvbmx5IG5vblRsYlRyYW5zY2x1ZGVEaXJlY3RpdmUgc28gdGhhdCB3ZSBwcmV2ZW50IHB1dHRpbmcgdHJhbnNjbHVzaW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiB0aGUgc2FtZSBlbGVtZW50IG1vcmUgdGhhbiBvbmNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZTogbm9uVGxiVHJhb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UpIHtcbiAgICAgICAgICAgICAgICB2YXIgc2xvdE5hbWUgPSBzbG90TWFwW2RpcmVjdGl2ZU5vcm1hbGl6ZShub2RlTmFtZV8obm9kZSkpXTtcbiAgICAgICAgICAgICAgICBpZiAoc2xvdE5hbWUpIHtcbiAgICAgICAgICAgICAgICAgIGZpbGxlZFNsb3RzW3Nsb3ROYW1lXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICBzbG90c1tzbG90TmFtZV0gPSBzbG90c1tzbG90TmFtZV0gfHwgd2luZG93LmRvY3VtZW50LmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKTtcbiAgICAgICAgICAgICAgICAgIHNsb3RzW3Nsb3ROYW1lXS5hcHBlbmRDaGlsZChub2RlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgJHRlbXBsYXRlLmFwcGVuZENoaWxkKG5vZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgLy8gQ2hlY2sgZm9yIHJlcXVpcmVkIHNsb3RzIHRoYXQgd2VyZSBub3QgZmlsbGVkXG4gICAgICAgICAgICAgIGZvckVhY2goZmlsbGVkU2xvdHMsIGZ1bmN0aW9uKGZpbGxlZCwgc2xvdE5hbWUpIHtcbiAgICAgICAgICAgICAgICBpZiAoIWZpbGxlZCkge1xuICAgICAgICAgICAgICAgICAgdGhyb3cgJGNvbXBpbGVNaW5FcnIoJ3JlcXNsb3QnLCAnUmVxdWlyZWQgdHJhbnNjbHVzaW9uIHNsb3QgYHswfWAgd2FzIG5vdCBmaWxsZWQuJywgc2xvdE5hbWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgZm9yICh2YXIgc2xvdE5hbWUgaW4gc2xvdHMpIHtcbiAgICAgICAgICAgICAgICBpZiAoc2xvdHNbc2xvdE5hbWVdKSB7XG4gICAgICAgICAgICAgIC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AgICAgICAgZm9yRWFjaChlbGVtZW50Q29udHJvbGxlcnMsIGZ1bmN0aW9uKGNvbnRyb2xsZXIpIHtcbiAgICAgICAgICB2YXIgY29udHJvbGxlckluc3RhbmNlID0gY29udHJvbGxlci5pbnN0YW5jZTtcbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJG9uQ2hhbmdlcykpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXJJbnN0YW5jZS4kb25DaGFuZ2VzKGNvbnRyb2xsZXIuYmluZGluZ0luZm8uaW5pdGlhbENoYW5nZXMpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3RhbmNlLiRvbkluaXQpKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBjb250cm9sbGVySW5zdGFuY2UuJG9uSW5pdCgpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKSkge1xuICAgICAgICAgICAgY29udHJvbGxlclNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsgY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKCk7IH0pO1xuICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRkb0NoZWNrKCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRyb2xsZXJJbnN0YW5jZS4kb25EZXN0cm95KSkge1xuICAgICAgICAgICAgY29udHJvbGxlcl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0gY29udHJvbGxlci5pbnN0YW5jZTtcbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJHBvc3RMaW5rKSkge1xuICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRwb3N0TGluaygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgLy8gVGhpcyBpcyB0aGUgZnVuY3Rpb24gdGhhdCBpcyBpbmplY3RlZCBhcyBgJHRyYW5zY2x1ZGVgLlxuICAgICAgICAvLyBOb3RlOiBhbGwgYXJndW1lbnRzIGFyZSBvcHRpb25hbCFcbiAgICAgICAgZnVuY3Rpb24gY29udHJvbGxlcnNCb3VuZFRyYW5zY2x1ZGUoc2NvcGUsIGNsb25lQXR0YWNoRm4sIGZ1dHVyZVBhcmVudEVsZW1lbnQsIHNsb3ROYW1lKSB7XG4gICAgICAgICAgdmFyIHRyYW5zY2x1ZGVDb250cm9sbGVycztcbiAgICAgICAgICAvLyBObyBzY29wZSBwYXNzZWQgaW46XG4gICAgICAgICAgaWYgKCFpc1Njb3BlKHNjb3BlKSkge1xuICAgICAgICAgICAgc2xvdE5hbWUgPSBmdXR1cmVQYXJlbnRFbGVtZW50O1xuICAgICAgICAgICAgZnV0dXJlUGFyZW50RWxlbWVudCA9IGNsb25lQXR0YWNoRm47XG4gICAgICAgICAgICBjbG9uZUF0dGFjaEZuID0gc2NvcGU7XG4gICAgICAgICAgICBzY29wZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoaGFzRWxlbWVudFRyYW5zY2x1ZGVEaXJlY3RpdmUpIHtcbiAgICAgICAgICAgIHRyYW5zY2x1ZGVDb250cm9sbGVycyA9IGVsZW1lbnRDb250cm9sbGVycztcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKCFmdXR1cmVQYXJlbnRFbGVtZW50KSB7XG4gICAgICAgICAgICBmdXR1cmVQYXJlbnRFbGVtZW50ID0ga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IGorKywgajIrKykge1xuICAgICAgICAgICAgICBpZiAoajIgPCBqaikge1xuICAgICAgICAgICAgICAgICRyb290RWxlbWVudFtqXSA9ICRyb290RWxlbWVudFtqMl07XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlICRyb290RWxlbWVudFtqXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgJHJvb3RFbGVtZW50Lmxlbmd0aCAtPSByZW1vdmVDb3VudCAtIDE7XG5cbiAgICAgICAgICAgIC8vIElmIHRoZSByZXBsYWNlZCBlbGVtZW50IGlzIGFsc28gdGhlIGpRdWVyeSAuY29udGV4dCB0aGVuIHJlcGxhY2UgaXRcbiAgICAgICAgICAgIC8vIC5jb250ZXh0IGlzIGEgZGVwcmVjYXRlZCBqUXVlcnkgYXBpLCBzbyB3ZSBzaG91bGQgc2V0IGl0IG9ubHkgd2hlbiBqUXVlcnkgc2V0IGl0XG4gICAgICAgICAgICAvLyBodHRwOi8vYXBpLmpxdWVyeS5jb20vY29udGV4dC9cbiAgICAgICAgICAgIGlmICgkcm9vdEVsZW1lbnQuY29udGV4dCA9PT0gZmlyc3RFbGVtZW50VG9SZW1vdmUpIHtcbiAgICAgICAgICAgICAgJHJvb3RFbGVtZW50LmNvbnRleHQgPSBuZXdOb2RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIGlmIChwYXJlbnQpIHtcbiAgICAgICAgcGFyZW50LnJlcGxhY2VDaGlsZChuZXdOb2RlLCBmaXJzdEVsZW1lbnRUb1JlbW92ZSk7XG4gICAgICB9XG5cbiAgICAgIC8vIEFwcGVuZCBhbGwgdGhlIGBlbGVtZW50c1RvUmVtb3ZlYCB0byBhIGZyYWdtZW50LiBUaGlzIHdpbGwuLi5cbiAgICAgIC8vIC0gcmVtb3ZlIHRoZW0gZnJvbS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icmVhaztcbiAgICAgICAgICAgICAgc3RyaWN0QmluZGluZ3NDaGVjayhhdHRyTmFtZSwgZGlyZWN0aXZlLm5hbWUpO1xuICAgICAgICAgICAgICBhdHRyc1thdHRyTmFtZV0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob3B0aW9uYWwgJiYgIWF0dHJzW2F0dHJOYW1lXSkgYnJlYWs7XG5cbiAgICAgICAgICAgIHBhcmVudEdldCA9ICRwYXJzZShhdHRyc1thdHRyTmFtZV0pO1xuICAgICAgICAgICAgaWYgKHBhcmVudEdldC5saXRlcmFsKSB7XG4gICAgICAgICAgICAgIGNvbXBhcmUgPSBlcXVhbHM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBjb21wYXJlID0gc2ltcGxlQ29tcGFyZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmVudFNldCA9IHBhcmVudEdldC5hc3NpZ24gfHwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIC8vIHJlc2V0IHRoZSBjaGFuZ2UsIG9yIHdlIHdpbGwgdGhyb3cgdGhpcyBleGNlcHRpb24gb24gZXZlcnkgJGRpZ2VzdFxuICAgICAgICAgICAgICBsYXN0VmFsdWUgPSBkZXN0aW5hdGlvbltzY29wZU5hbWVdID0gcGFyZW50R2V0KHNjb3BlKTtcbiAgICAgICAgICAgICAgdGhyb3cgJGNvbXBpbGVNaW5FcnIoJ25vbmFzc2lnbicsXG4gICAgICAgICAgICAgICAgICAnRXhwcmVzc2lvbiBcXCd7MH1cXCcgaW4gYXR0cmlidXRlIFxcJ3sxfVxcJyB1c2VkIHdpdGggZGlyZWN0aXZlIFxcJ3syfVxcJyBpcyBub24tYXNzaWduYWJsZSEnLFxuICAgICAgICAgICAgICAgICAgYXR0cnNbYXR0ck5hbWVdLCBhdHRyTmFtZSwgZGlyZWN0aXZlLm5hbWUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxhc3RWYWx1ZSA9IGRlc3RpbmF0aW9uW3Njb3BlTmFtZV0gPSBwYXJlbnRHZXQoc2NvcGUpO1xuICAgICAgICAgICAgdmFyIHBhcmVudFZhbHVlV2F0Y2ggPSBmdW5jdGlvbiBwYXJlbnRWYWx1ZVdhdGNoKHBhcmVudFZhbHVlKSB7XG4gICAgICAgICAgICAgIGlmICghY29tcGFyZShwYXJlbnRWYWx1ZSwgZGVzdGluYXRpb25bc2NvcGVOYW1lXSkpIHtcbiAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgb3V0IG9mIHN5bmMgYW5kIG5lZWQgdG8gY29weVxuICAgICAgICAgICAgICAgIGlmICghY29tcGFyZShwYXJlbnRWYWx1ZSwgbGFzdFZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgLy8gcGFyZW50IGNoYW5nZWQgYW5kIGl0IGhhcyBwcmVjZWRlbmNlXG4gICAgICAgICAgICAgICAgICBkZXN0aW5hdGlvbltzY29wZU5hbWVdID0gcGFyZW50VmFsdWU7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBwYXJlbnQgY2FuIGJlIGFzc2lnbmVkIHRoZW4gZG8gc29cbiAgICAgICAgICAgICAgICAgIHBhcmVudFNldChzY29wZSwgcGFyZW50VmFsdWUgPSBkZXN0aW5hdGlvbltzY29wZU5hbWVdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgbGFzdFZhbHVlID0gcGFyZW50VmFsdWU7XG4gICAgICAgICAgICAgIHJldHVybiBsYXN0VmFsdWU7XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcGFyZW50VmFsdWVXYXRjaC4kc3RhdGVmdWwgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKGRlZmluaXRpb24uY29sbGVjdGlvbikge1xuICAgICAgICAgICAgICByZW1vdmVXYXRjaCA9IHNjb3BlLiR3YXR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RwOi8vanNwZXJmLmNvbS9jcmVhdGUtY29uc3RydWN0b3IvMlxuICAgICAgICB2YXIgY29udHJvbGxlclByb3RvdHlwZSA9IChpc0FycmF5KGV4cHJlc3Npb24pID9cbiAgICAgICAgICBleHByZXNzaW9uW2V4cHJlc3Npb24ubGVuZ3RoIC0gMV0gOiBleHByZXNzaW9uKS5wcm90b3R5cGU7XG4gICAgICAgIGluc3RhbmNlID0gT2JqZWN0LmNyZWF0ZShjb250cm9sbGVyUHJvdG90eXBlIHx8IG51bGwpO1xuXG4gICAgICAgIGlmIChpZGVudGlmaWVyKSB7XG4gICAgICAgICAgYWRkSWRlbnRpZmllcihsb2NhbHMsIGlkZW50aWZpZXIsIGluc3RhbmNlLCBjb25zdHJ1Y3RvciB8fCBleHByZXNzaW9uLm5hbWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbiAkY29udHJvbGxlckluaXQoKSB7XG4gICAgICAgICAgdmFyIHJlc3VsdCA9ICRpbmplY3Rvci5pbnZva2UoZXhwcmVzc2lvbiwgaW5zdGFuY2UsIGxvY2FscywgY29uc3RydWN0b3IpO1xuICAgICAgICAgIGlmIChyZXN1bHQgIT09IGluc3RhbmNlICYmIChpc09iamVjdChyZXN1bHQpIHx8IGlzRnVuY3Rpb24ocmVzdWx0KSkpIHtcbiAgICAgICAgICAgIGluc3RhbmNlID0gcmVzdWx0O1xuICAgICAgICAgICAgaWYgKGlkZW50aWZpZXIpIHtcbiAgICAgICAgICAgICAgLy8gSWYgcmVzdWx0IGNoYW5nZWQsIHJlLWFzc2lnbiBjb250cm9sbGVyQXMgdmFsdWUgdG8gc2NvcGUuXG4gICAgICAgICAgICAgIGFkZElkZW50aWZpZXIobG9jYWxzLCBpZGVudGlmaWVyLCBpbnN0YW5jZSwgY29uc3RydWN0b3IgfHwgZXhwcmVzc2lvbi5uYW1lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcm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AgfSk7XG4gICAqXG4gICAqIH0pO1xuICAgKiBgYGBcbiAgICpcbiAgICovXG4gIHRoaXMuJGdldCA9IGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiBmdW5jdGlvbiBqUXVlcnlMaWtlUGFyYW1TZXJpYWxpemVyKHBhcmFtcykge1xuICAgICAgaWYgKCFwYXJhbXMpIHJldHVybiAnJztcbiAgICAgIHZhciBwYXJ0cyA9IFtdO1xuICAgICAgc2VyaWFsaXplKHBhcmFtcywgJycsIHRydWUpO1xuICAgICAgcmV0dXJuIHBhcnRzLmpvaW4oJyYnKTtcblxuICAgICAgZnVuY3Rpb24gc2VyaWFsaXplKHRvU2VyaWFsaXplLCBwcmVmaXgsIHRvcExldmVsKSB7XG4gICAgICAgIGlmIChpc0FycmF5KHRvU2VyaWFsaXplKSkge1xuICAgICAgICAgIGZvckVhY2godG9TZXJpYWxpemUsIGZ1bmN0aW9uKHZhbHVlLCBpbmRleCkge1xuICAgICAgICAgICAgc2VyaWFsaXplKHZhbHVlLCBwcmVmaXggKyAnWycgKyAoaXNPYmplY3QodmFsdWUpID8gaW5kZXggOiAnJykgKyAnXScpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KHRvU2VyaWFsaXplKSAmJiAhaXNEYXRlKHRvU2VyaWFsaXplKSkge1xuICAgICAgICAgIGZvckVhY2hTb3J0ZWQodG9TZXJpYWxpemUsIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHtcbiAgICAgICAgICAgIHNlcmlhbGl6ZSh2YWx1ZSwgcHJlZml4ICtcbiAgICAgICAgICAgICAgICAodG9wTGV2ZWwgPyAnJyA6ICdbJykgK1xuICAgICAgICAgICAgICAgIGtleSArXG4gICAgICAgICAgICAgICAgKHRvcExldmVsID8gJycgOiAnXScpKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbih0b1NlcmlhbGl6Z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AgICogICAgICAgJ3JlcXVlc3QnOiBmdW5jdGlvbihjb25maWcpIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzXG4gICAgICogICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXF1ZXN0RXJyb3InOiBmdW5jdGlvbihyZWplY3Rpb24pIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvclxuICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVqZWN0aW9uKSkge1xuICAgICAqICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VPck5ld1Byb21pc2VcbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVqZWN0aW9uKTtcbiAgICAgKiAgICAgICB9LFxuICAgICAqXG4gICAgICpcbiAgICAgKlxuICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZFxuICAgICAqICAgICAgICdyZXNwb25zZSc6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gc3VjY2Vzc1xuICAgICAqICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXNwb25zZUVycm9yJzogZnVuY3Rpb24ocmVqZWN0aW9uKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gZXJyb3JcbiAgICAgKiAgICAgICAgIGlmIChjYW5SZWNvdmVyKHJlamVjdGlvbikpIHtcbiAgICAgKiAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlT3JOZXdQcm9taXNlXG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgICByZXR1cm4gJHEucmVqZWN0KHJlamVjdGlvbik7XG4gICAgICogICAgICAgfVxuICAgICAqICAgICB9O1xuICAgICAqICAgfSk7XG4gICAgICpcbiAgICAgKiAgICRodHRwUHJvdmlkZXIuaW50ZXJjZXB0b3JzLnB1c2goJ215SHR0cEludGVyY2VwdG9yJyk7XG4gICAgICpcbiAgICAgKlxuICAgICAqICAgLy8gYWx0ZXJuYXRpdmVseSwgcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIHZpYSBhbiBhbm9ueW1vdXMgZmFjdG9yeVxuICAgICAqICAgJGh0dHBQcm92aWRlci5pbnRlcmNlcHRvcnMucHVzaChmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAgIHJldHVybiB7XG4gICAgICogICAgICAncmVxdWVzdCc6IGZ1bmN0aW9uKGNvbmZpZykge1xuICAgICAqICAgICAgICAgIC8vIHNhbWUgYXMgYWJvdmVcbiAgICAgKiAgICAgICB9LFxuICAgICAqXG4gICAgICogICAgICAgJ3Jlc3BvbnNlJzogZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgKiAgICAgICAgICAvLyBzYW1lIGFzIGFib3ZlXG4gICAgICogICAgICAgfVxuICAgICAqICAgICB9O1xuICAgICAqICAgfSk7XG4gICAgICogYGBgXG4gICAgICpcbiAgICAgKiAjIyBTZWN1cml0eSBDb25zaWRlcmF0aW9uc1xuICAgICAqXG4gICAgICogV2hlbiBkZXNpZ25pbmcgd2ViIGFwcGxpY2F0aW9ucywgY29uc2lkZXIgc2VjdXJpdHkgdGhyZWF0cyBmcm9tOlxuICAgICAqXG4gICAgICogLSBbSlNPTiB2dWxuZXJhYmlsaXR5XShodHRwOi8vaGFhY2tlZC5jb20vYXJjaGl2ZS8yMDA4LzExLzIwL2FuYXRvbXktb2YtYS1zdWJ0bGUtanNvbi12dWxuZXJhYmlsaXR5LmFzcHgpXG4gICA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AnY29udGVudC10eXBlJykge1xuICAgICAgICAgICAgICBkZWxldGUgaGVhZGVyc1toZWFkZXJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbmZpZy53aXRoQ3JlZGVudGlhbHMpICYmICFpc1VuZGVmaW5lZChkZWZhdWx0cy53aXRoQ3JlZGVudGlhbHMpKSB7XG4gICAgICAgICAgY29uZmlnLndpdGhDcmVkZW50aWFscyA9IGRlZmF1bHRzLndpdGhDcmVkZW50aWFscztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNlbmQgcmVxdWVzdFxuICAgICAgICByZXR1cm4gc2VuZFJlcShjb25maWcsIHJlcURhdGEpLnRoZW4odHJhbnNmb3JtUmVzcG9uc2UsIHRyYW5zZm9ybVJlc3BvbnNlKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gdHJhbnNmb3JtUmVzcG9uc2UocmVzcG9uc2UpIHtcbiAgICAgICAgLy8gbWFrZSBhIGNvcHkgc2luY2UgdGhlIHJlc3BvbnNlIG11c3QgYmUgY2FjaGVhYmxlXG4gICAgICAgIHZhciByZXNwID0gZXh0ZW5kKHt9LCByZXNwb25zZSk7XG4gICAgICAgIHJlc3AuZGF0YSA9IHRyYW5zZm9ybURhdGEocmVzcG9uc2UuZGF0YSwgcmVzcG9uc2UuaGVhZGVycywgcmVzcG9uc2Uuc3RhdHVzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy50cmFuc2Zvcm1SZXNwb25zZSk7XG4gICAgICAgIHJldHVybiAoaXNTdWNjZXNzKHJlc3BvbnNlLnN0YXR1cykpXG4gICAgICAgICAgPyByZXNwXG4gICAgICAgICAgOiAkcS5yZWplY3QocmVzcCk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgJGh0dHAucGVuZGluZ1JlcXVlc3RzID0gW107XG5cbiAgICAvKipcbiAgICAgKiBAb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jdGlvbnMgYWJvdmUuXG4gICAgICAgICAqL1xuICAgICRodHRwLmRlZmF1bHRzID0gZGVmYXVsdHM7XG5cblxuICAgIHJldHVybiAkaHR0cDtcblxuXG4gICAgZnVuY3Rpb24gY3JlYXRlU2hvcnRNZXRob2RzKG5hbWVzKSB7XG4gICAgICBmb3JFYWNoKGFyZ3VtZW50cywgZnVuY3Rpb24obmFtZSkge1xuICAgICAgICAkaHR0cFtuYW1lXSA9IGZ1bmN0aW9uKHVybCwgY29uZmlnKSB7XG4gICAgICAgICAgcmV0dXJuICRodHRwKGV4dGVuZCh7fSwgY29uZmlnIHx8IHt9LCB7XG4gICAgICAgICAgICBtZXRob2Q6IG5hbWUsXG4gICAgICAgICAgICB1cmw6IHVybFxuICAgICAgICAgIH0pKTtcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH1cblxuXG4gICAgZnVuY3Rpb24gY3JlYXRlU2hvcnRNZXRob2RzV2l0aERhdGEobmFtZSkge1xuICAgICAgZm9yRWFjaChhcmd1bWVudHMsIGZ1bmN0aW9uKG5hbWUpIHtcbiAgICAgICAgJGh0dHBbbmFtZV0gPSBmdW5jdGlvbih1cmwsIGRhdGEsIGNvbmZpZykge1xuICAgICAgICAgIHJldHVybiAkaHR0cChleHRlbmQoe30sIGNvbmZpZyB8fCB7fSwge1xuICAgICAgICAgICAgbWV0aG9kOiBuYW1lLFxuICAgICAgICAgICAgdXJsOiB1cmwsXG4gICAgICAgICAgICBkYXRhOiBkYXRhXG4gICAgICAgICAgfSkpO1xuICAgICAgICB9O1xuICAgICAgfSk7XG4gICAgfVxuXG5cbiAgICAvKipcbiAgICAgKiBNYWtlcyB0aGUgcmVxdWVzdC5cbiAgICAgKlxuICAgICAqICEhISBBQ0NFU1NFUyBDTE9TVVJFIFZBUlM6XG4gICAgICogJGh0dHBCYWNrZW5kLCBkZWZhdWx0cywgJGxvZywgJHJvb3RTY29wZSwgZGVmYXVsdENhY2hlLCAkaHR0cC5wZW5kaW5nUm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hc2UpIHtcbiAgICAgICAgICAgICAgICBjYWxsRXZlbnRIYW5kbGVyKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoY2FsbEV2ZW50SGFuZGxlcik7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBmdW5jdGlvbiBjYWxsRXZlbnRIYW5kbGVyKCkge1xuICAgICAgICAgICAgICAgIGV2ZW50SGFuZGxlcihldmVudCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcmV0dXJuIGFwcGx5SGFuZGxlcnM7XG4gICAgICAgIH1cbiAgICAgIH1cblxuXG4gICAgICAvKipcbiAgICAgICAqIENhbGxiYWNrIHJlZ2lzdGVyZWQgdG8gJGh0dHBCYWNrZW5kKCk6XG4gICAgICAgKiAgLSBjYWNoZXMgdGhlIHJlc3BvbnNlIGlmIGRlc2lyZWRcbiAgICAgICAqICAtIHJlc29sdmVzIHRoZSByYXcgJGh0dHAgcHJvbWlzZVxuICAgICAgICogIC0gY2FsbHMgJGFwcGx5XG4gICAgICAgKi9cbiAgICAgIGZ1bmN0aW9uIGRvbmUoc3RhdHVzLCByZXNwb25zZSwgaGVhZGVyc1N0cmluZywgc3RhdHVzVGV4dCwgeGhyU3RhdHVzKSB7XG4gICAgICAgIGlmIChjYWNoZSkge1xuICAgICAgICAgIGlmIChpc1N1Y2Nlc3Moc3RhdHVzKSkge1xuICAgICAgICAgICAgY2FjaGUucHV0KHVybCwgW3N0YXR1cywgcmVzcG9uc2UsIHBhcnNlSGVhZGVycyhoZWFkZXJzU3RyaW5nKSwgc3RhdHVzVGV4dCwgeGhyU3RhdHVzXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHJlbW92ZSBwcm9taXNlIGZyb20gdGhlIGNhY2hlXG4gICAgICAgICAgICBjYWNoZS5yZW1vdmUodXJsKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZXNvbHZlSHR0cFByb21pc2UoKSB7XG4gICAgICAgICAgcmVzb2x2ZVByb21pc2UocmVzcG9uc2UsIHN0YXR1cywgaGVhZGVyc1N0cmluZywgc3RhdHVzVGV4dCwgeGhyU3RhdHVzKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh1c2VBcHBseUFzeW5jKSB7XG4gICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHlBc3luYyhyZXNvbHZlSHR0cFByb21pc2UpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJlc29sdmVIdHRwUHJvbWlzZSgpO1xuICAgICAgICAgIGlmICghJHJvb3RTY29wZS4kJHBoYXNlKSAkcm9vdFNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9XG4gICAgICB9XG5cblxuICAgICAgLyoqXG4gICAgICAgKiBSZXNvbHZlcyB0aGUgcmF3ICRodHRwIHByb21pc2UuXG4gICAgICAgKi9cbiAgICAgIGZ1bmN0aW9uIHJlc29sdmVQcm9taXNlKHJlc3BvbnNlLCBzdGF0dXMsIGhlYWRlcnMsIHN0YXR1c1RleHQsIHhoclN0YXR1cykge1xuICAgICAgICAvL3N0YXR1czogSFRUUCByZXNwb25zZSBzdGF0dXMgY29kZSwgMCwgLTEgKGFib3J0ZWQgYnkgdGltZW91dCAvIHByb21pc2UpXG4gICAgICAgIHN0YXR1cyA9IHN0YXR1cyA+PSAtMSA/IHN0YXR1cyA6IDA7XG5cbiAgICAgICAgKGlzU3VjY2VzcyhzdGF0dXMpID8gZGVmZXJyZWQucmVzb2x2ZSA6IGRlZmVycmVkLnJlamVjdCkoe1xuICAgICAgICAgIGRhdGE6IHJlc3BvbnNlLFxuICAgICAgICAgIHN0YXR1czogc3RhdHVzLFxuICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnNHZXR0ZXIoaGVhZGVycyksXG4gICAgICAgICAgY29uZmlnO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m4gJHNjZS5nZXRUcnVzdGVkKHRydXN0ZWRDb250ZXh0LCBzaW5nbGVFeHByZXNzaW9uID8gY29uY2F0WzBdIDogY29uY2F0LmpvaW4oJycpKTtcbiAgICAgICAgICB9IGVsc2UgaWYgKHRydXN0ZWRDb250ZXh0ICYmIGNvbmNhdC5sZW5ndGggPiAxKSB7XG4gICAgICAgICAgICAvLyBUaGlzIGNvbnRleHQgZG9lcyBub3QgYWxsb3cgbW9yZSB0aGFuIG9uZSBwYXJ0LCBlLmcuIGV4cHIgKyBzdHJpbmcgb3IgZXhwICsgZXhwLlxuICAgICAgICAgICAgJGludGVycG9sYXRlTWluRXJyLnRocm93Tm9jb25jYXQodGV4dCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vIEluIGFuIHVucHJpdmlsZWdlZCBjb250ZXh0IG9yIG9ubHkgb25lIHBhcnQ6IGp1c3QgY29uY2F0ZW5hdGUgYW5kIHJldHVybi5cbiAgICAgICAgICByZXR1cm4gY29uY2F0LmpvaW4oJycpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24gaW50ZXJwb2xhdGlvbkZuKGNvbnRleHQpIHtcbiAgICAgICAgICAgIHZhciBpID0gMDtcbiAgICAgICAgICAgIHZhciBpaSA9IGV4cHJlc3Npb25zLmxlbmd0aDtcbiAgICAgICAgICAgIHZhciB2YWx1ZXMgPSBuZXcgQXJyYXkoaWkpO1xuXG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBmb3IgKDsgaSA8IGlpOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YWx1ZXNbaV0gPSBwYXJzZUZuc1tpXShjb250ZXh0KTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBjb21wdXRlKHZhbHVlcyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoJGludGVycG9s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IG5vdGlmaWVkIG9uIGVhY2ggaXRlcmF0aW9uLiBJdCB3aWxsIHJlc29sdmUgb25jZSBhbGwgaXRlcmF0aW9ucyBvZiB0aGUgaW50ZXJ2YWwgY29tcGxldGUuXG4gICAgICpcbiAgICAgKiBAZXhhbXBsZVxuICAgICAqIDxleGFtcGxlIG1vZHVsZT1cImludGVydmFsRXhhbXBsZVwiIG5hbWU9XCJpbnRlcnZhbC1zZXJ2aWNlXCI+XG4gICAgICogPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgKiAgIDxzY3JpcHQ+XG4gICAgICogICAgIGFuZ3VsYXIubW9kdWxlKCdpbnRlcnZhbEV4YW1wbGUnLCBbXSlcbiAgICAgKiAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsICckaW50ZXJ2YWwnLFxuICAgICAqICAgICAgICAgZnVuY3Rpb24oJHNjb3BlLCAkaW50ZXJ2YWwpIHtcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmZvcm1hdCA9ICdNL2QveXkgaDptbTpzcyBhJztcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAxMDA7XG4gICAgICogICAgICAgICAgICRzY29wZS5ibG9vZF8yID0gMTIwO1xuICAgICAqXG4gICAgICogICAgICAgICAgIHZhciBzdG9wO1xuICAgICAqICAgICAgICAgICAkc2NvcGUuZmlnaHQgPSBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAvLyBEb24ndCBzdGFydCBhIG5ldyBmaWdodCBpZiB3ZSBhcmUgYWxyZWFkeSBmaWdodGluZ1xuICAgICAqICAgICAgICAgICAgIGlmICggYW5ndWxhci5pc0RlZmluZWQoc3RvcCkgKSByZXR1cm47XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICBzdG9wID0gJGludGVydmFsKGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgICAgaWYgKCRzY29wZS5ibG9vZF8xID4gMCAmJiAkc2NvcGUuYmxvb2RfMiA+IDApIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAkc2NvcGUuYmxvb2RfMSAtIDM7XG4gICAgICogICAgICAgICAgICAgICAgICRzY29wZS5ibG9vZF8yID0gJHNjb3BlLmJsb29kXzIgLSA0O1xuICAgICAqICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCgpO1xuICAgICAqICAgICAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgICAgIH0sIDEwMCk7XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCA9IGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzdG9wKSkge1xuICAgICAqICAgICAgICAgICAgICAgJGludGVydmFsLmNhbmNlbChzdG9wKTtcbiAgICAgKiAgICAgICAgICAgICAgIHN0b3AgPSB1bmRlZmluZWQ7XG4gICAgICogICAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgICB9O1xuICAgICAqXG4gICAgICogICAgICAgICAgICRzY29wZS5yZXNldEZpZ2h0ID0gZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAxMDA7XG4gICAgICogICAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAxMjA7XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCB0aGUgaW50ZXJ2YWwgaXMgZGVzdHJveWVkIHRvb1xuICAgICAqICAgICAgICAgICAgICRzY29wZS5zdG9wRmlnaHQoKTtcbiAgICAgKiA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SBvbiBjaGFuZ2UuXG4gICAgICogICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGF0dHJzLm15Q3VycmVudFRpbWUsIGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICogICAgICAgICAgICAgICBmb3JtYXQgPSB2YWx1ZTtcbiAgICAgKiAgICAgICAgICAgICAgIHVwZGF0ZVRpbWUoKTtcbiAgICAgKiAgICAgICAgICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAgIHN0b3BUaW1lID0gJGludGVydmFsKHVwZGF0ZVRpbWUsIDEwMDApO1xuICAgICAqXG4gICAgICogICAgICAgICAgICAgLy8gbGlzdGVuIG9uIERPTSBkZXN0cm95IChyZW1vdmFsKSBldmVudCwgYW5kIGNhbmNlbCB0aGUgbmV4dCBVSSB1cGRhdGVcbiAgICAgKiAgICAgICAgICAgICAvLyB0byBwcmV2ZW50IHVwZGF0aW5nIHRpbWUgYWZ0ZXIgdGhlIERPTSBlbGVtZW50IHdhcyByZW1vdmVkLlxuICAgICAqICAgICAgICAgICAgIGVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgICAkaW50ZXJ2YWwuY2FuY2VsKHN0b3BUaW1lKTtcbiAgICAgKiAgICAgICAgICAgICB9KTtcbiAgICAgKiAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgfV0pO1xuICAgICAqICAgPC9zY3JpcHQ+XG4gICAgICpcbiAgICAgKiAgIDxkaXY+XG4gICAgICogICAgIDxkaXYgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICogICAgICAgPGxhYmVsPkRhdGUgZm9ybWF0OiA8aW5wdXQgbmctbW9kZWw9XCJmb3JtYXRcIj48L2xhYmVsPiA8aHIvPlxuICAgICAqICAgICAgIEN1cnJlbnQgdGltZSBpczogPHNwYW4gbXktY3VycmVudC10aW1lPVwiZm9ybWF0XCI+PC9zcGFuPlxuICAgICAqIC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xJywgJyRyb290U2NvcGUnLFxuICAgICAgIGZ1bmN0aW9uKCRicm93c2VyLCAgICRxLCAgICQkcSwgICAkcm9vdFNjb3BlKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIGludGVydmFsRmFjdG9yeShzZXRJbnRlcnZhbEZuLCBjbGVhckludGVydmFsRm4pIHtcbiAgICAgIHJldHVybiBmdW5jdGlvbiBpbnRlcnZhbEZuKGZuLCBkZWxheSwgY291bnQsIGludm9rZUFwcGx5KSB7XG4gICAgICAgIHZhciBoYXNQYXJhbXMgPSBhcmd1bWVudHMubGVuZ3RoID4gNCxcbiAgICAgICAgICAgIGFyZ3MgPSBoYXNQYXJhbXMgPyBzbGljZUFyZ3MoYXJndW1lbnRzLCA0KSA6IFtdLFxuICAgICAgICAgICAgaXRlcmF0aW9uID0gMCxcbiAgICAgICAgICAgIHNraXBBcHBseSA9IGlzRGVmaW5lZChpbnZva2VBcHBseSkgJiYgIWludm9rZUFwcGx5LFxuICAgICAgICAgICAgZGVmZXJyZWQgPSAoc2tpcEFwcGx5ID8gJCRxIDogJHEpLmRlZmVyKCksXG4gICAgICAgICAgICBwcm9taXNlID0gZGVmZXJyZWQucHJvbWlzZTtcblxuICAgICAgICBjb3VudCA9IGlzRGVmaW5lZChjb3VudCkgPyBjb3VudCA6IDA7XG5cbiAgICAgICAgZnVuY3Rpb24gY2FsbGJhY2soKSB7XG4gICAgICAgICAgaWYgKCFoYXNQYXJhbXMpIHtcbiAgICAgICAgICAgIGZuKGl0ZXJhdGlvbik7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGZuLmFwcGx5KG51bGwsIGFyZ3MpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHRpY2soKSB7XG4gICAgICAgICAgaWYgKHNraXBBcHBseSkge1xuICAgICAgICAgICAgJGJyb3dzZXIuZGVmZXIoY2FsbGJhY2spO1xuICAgICAgICAgIH0gZWxzZSB7XG4g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SxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkbG9nI2Vycm9yXG4gICAgICAgKlxuICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgKiBXcml0ZSBhbiBlcnJvciBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgIGVycm9yOiBjb25zb2xlTG9nKCdlcnJvcicpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjZGVidWdcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGEgZGVidWcgbWVzc2FnZVxuICAgICAgICovXG4gICAgICBkZWJ1ZzogKGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgZm4gPSBjb25zb2xlTG9nKCdkZWJ1ZycpO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAoZGVidWcpIHtcbiAgICAgICAgICAgIGZuLmFwcGx5KHNlbGYsIGFyZ3VtZW50cyk7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgfSkoKVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBmb3JtYXRFcnJvcihhcmcpIHtcbiAgICAgIGlmIChpc0Vycm9yKGFyZykpIHtcbiAgICAgICAgaWYgKGFyZy5zdGFjayAmJiBmb3JtYXRTdGFja1RyYWNlKSB7XG4gICAgICAgICAgYXJnID0gKGFyZy5tZXNzYWdlICYmIGFyZy5zdGFjay5pbmRleE9mKGFyZy5tZXNzYWdlKSA9PT0gLTEpXG4gICAgICAgICAgICAgID8gJ0Vycm9yOiAnICsgYXJnLm1lc3NhZ2UgKyAnXFxuJyArIGFyZy5zdGFja1xuICAgICAgICAgICAgICA6IGFyZy5zdGFjaztcbiAgICAgICAgfSBlbHNlIGlmIChhcmcuc291cmNlVVJMKSB7XG4gICAgICAgICAgYXJnID0gYXJnLm1lc3NhZ2UgKyAnXFxuJyArIGFyZy5zb3VyY2VVUkwgKyAnOicgKyBhcmcubGluZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFyZztcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBjb25zb2xlTG9nKHR5cGUpIHtcbiAgICAgIHZhciBjb25zb2xlID0gJHdpbmRvdy5jb25zb2xlIHx8IHt9LFxuICAgICAgICAgIGxvZ0ZuID0gY29uc29sZVt0eXBlXSB8fCBjb25zb2xlLmxvZyB8fCBub29wO1xuXG4gICAgICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgICAgIHZhciBhcmdzID0gW107XG4gICAgICAgIGZvckVhY2goYXJndW1lbnRzLCBmdW5jdGlvbihhcmcpIHtcbiAgICAgICAgICBhcmdzLnB1c2goZm9ybWF0RXJyb3IoYXJnKSk7XG4gICAgICAgIH0pO1xuICAgICAgICAvLyBTdXBwb3J0OiBJRSA5IG9ubHlcbiAgICAgICAgLy8gY29uc29sZSBtZXRob2RzIGRvbid0IGluaGVyaXQgZnJvbSBGdW5jdGlvbi5wcm90b3R5cGUgaW4gSUUgOSBzbyB3ZSBjYW4ndFxuICAgICAgICAvLyBjYWxsIGBsb2dGbi5hcHBseShjb25zb2xlLCBhcmdzKWAgZGlyZWN0bHkuXG4gICAgICAgIHJldHVybiBGdW5jdGlvbi5wcm90b3R5cGUuYXBwbHkuY2FsbChsb2dGbiwgY29uc29sZSwgYXJncyk7XG4gICAgICB9O1xuICAgIH1cbiAgfV07XG59XG5cbi8qICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICpcbiAqICAgICBBbnkgY29tbWl0cyB0byB0aGlzIGZpbGUgc2hvdWxkIGJlIHJldmlld2VkIHdpdGggc2VjdXJpdHkgaW4gbWluZC4gICpcbiAqICAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgY2FuIHBvdGVudGl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HZhciBwZWVrQ2ggPSB0aGlzLnBlZWsoKTtcbiAgICAgICAgaWYgKGNoID09PSAnZScgJiYgdGhpcy5pc0V4cE9wZXJhdG9yKHBlZWtDaCkpIHtcbiAgICAgICAgICBudW1iZXIgKz0gY2g7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5pc0V4cE9wZXJhdG9yKGNoKSAmJlxuICAgICAgICAgICAgcGVla0NoICYmIHRoaXMuaXNOdW1iZXIocGVla0NoKSAmJlxuICAgICAgICAgICAgbnVtYmVyLmNoYXJBdChudW1iZXIubGVuZ3RoIC0gMSkgPT09ICdlJykge1xuICAgICAgICAgIG51bWJlciArPSBjaDtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLmlzRXhwT3BlcmF0b3IoY2gpICYmXG4gICAgICAgICAgICAoIXBlZWtDaCB8fCAhdGhpcy5pc051bWJlcihwZWVrQ2gpKSAmJlxuICAgICAgICAgICAgbnVtYmVyLmNoYXJBdChudW1iZXIubGVuZ3RoIC0gMSkgPT09ICdlJykge1xuICAgICAgICAgIHRoaXMudGhyb3dFcnJvcignSW52YWxpZCBleHBvbmVudCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICB0aGlzLmluZGV4Kys7XG4gICAgfVxuICAgIHRoaXMudG9rZW5zLnB1c2goe1xuICAgICAgaW5kZXg6IHN0YXJ0LFxuICAgICAgdGV4dDogbnVtYmVyLFxuICAgICAgY29uc3RhbnQ6IHRydWUsXG4gICAgICB2YWx1ZTogTnVtYmVyKG51bWJlcilcbiAgICB9KTtcbiAgfSxcblxuICByZWFkSWRlbnQ6IGZ1bmN0aW9uKCkge1xuICAgIHZhciBzdGFydCA9IHRoaXMuaW5kZXg7XG4gICAgdGhpcy5pbmRleCArPSB0aGlzLnBlZWtNdWx0aWNoYXIoKS5sZW5ndGg7XG4gICAgd2hpbGUgKHRoaXMuaW5kZXggPCB0aGlzLnRleHQubG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IGlmICh0aGlzLnBlZWsoJ10nKSkge1xuICAgICAgICAgIC8vIFN1cHBvcnQgdHJhaWxpbmcgY29tbWFzIHBlciBFUzUuMS5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBlbGVtZW50cy5wdXNoKHRoaXMuZXhwcmVzc2lvbigpKTtcbiAgICAgIH0gd2hpbGUgKHRoaXMuZXhwZWN0KCcsJykpO1xuICAgIH1cbiAgICB0aGlzLmNvbnN1bWUoJ10nKTtcblxuICAgIHJldHVybiB7IHR5cGU6IEFTVC5BcnJheUV4cHJlc3Npb24sIGVsZW1lbnRzOiBlbGVtZW50cyB9O1xuICB9LFxuXG4gIG9iamVjdDogZnVuY3Rpb24oKSB7XG4gICAgdmFyIHByb3BlcnRpZXMgPSBbXSwgcHJvcGVydHk7XG4gICAgaWYgKHRoaXMucGVla1Rva2VuKCkudGV4dCAhPT0gJ30nKSB7XG4gICAgICBkbyB7XG4gICAgICAgIGlmICh0aGlzLnBlZWsoJ30nKSkge1xuICAgICAgICAgIC8vIFN1cHBvcnQgdHJhaWxpbmcgY29tbWFzIHBlciBFUzUuMS5cbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBwcm9wZXJ0eSA9IHt0eXBlOiBBU1QuUHJvcGVydHksIGtpbmQ6ICdpbml0J307XG4gICAgICAgIGlmICh0aGlzLnBlZWsoKS5jb25zdGFudCkge1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuY29uc3RhbnQoKTtcbiAgICAgICAgICBwcm9wZXJ0eS5jb21wdXRlZCA9IGZhbHNlO1xuICAgICAgICAgIHRoaXMuY29uc3VtZSgnOicpO1xuICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gdGhpcy5leHByZXNzaW9uKCk7XG4gICAgICAgIH0gZWxzZSBpZiAodGhpcy5wZWVrKCkuaWRlbnRpZmllcikge1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuaWRlbnRpZmllcigpO1xuICAgICAgICAgIHByb3BlcnR5LmNvbXB1dGVkID0gZmFsc2U7XG4gICAgICAgICAgaWYgKHRoaXMucGVlaygnOicpKSB7XG4gICAgICAgICAgICB0aGlzLmNvbnN1bWUoJzonKTtcbiAgICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gdGhpcy5leHByZXNzaW9uKCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByb3BlcnR5LnZhbHVlID0gcHJvcGVydHkua2V5O1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnBlZWsoJ1snKSkge1xuICAgICAgICAgIHRoaXMuY29uc3VtZSgnWycpO1xuICAgICAgICAgIHByb3BlcnR5LmtleSA9IHRoaXMuZXhwcmVzc2lvbigpO1xuICAgICAgICAgIHRoaXMuY29uc3VtZSgnXScpO1xuICAgICAgICAgIHByb3BlcnR5LmNvbXB1dGVkID0gdHJ1ZTtcbiAgICAgICAgICB0aGlzLmNvbnN1bWUoJzonKTtcbiAgICAgICAgICBwcm9wZXJ0eS52YWx1ZSA9IHRoaXMuZXhwcmVzc2lvbigpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHRoaXMudGhyb3dFcnJvcignaW52YWxpZCBrZXknLCB0aGlzLnBlZWsoKSk7XG4gICAgICAgIH1cbiAgICAgICAgcHJvcGVydGllcy5wdXNoKHByb3BlcnR5KTtcbiAgICAgIH0gd2hpbGUgKHRoaXMuZXhwZWN0KCcsJykpO1xuICAgIH1cbiAgICB0aGlzLmNvbnN1bWUoJ30nKTtcblxuICAgIHJldHVybiB7dHlwZTogQVNULk9iamVjdEV4cHJlc3Npb24sIHByb3BlcnRpZXM6IHByb3BlcnRpZXMgfTtcbiAgfSxcblxuICB0aHJvd0Vycm9yOiBmdW5jdGlvbihtc2csIHRva2VuKSB7XG4gICAgdGhyb3cgJHBhcnNlTWluRXJyKCdzeW50YXgnLFxuICAgICAgICAnU3ludGF4IEVycm9yOiBUb2t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yKGxlZnQsIGFzdC5wcm9wZXJ0eS5uYW1lKTtcbiAgICAgICAgICAgIHNlbGYuYXNzaWduKGludG9JZCwgZXhwcmVzc2lvbik7XG4gICAgICAgICAgICBpZiAobmFtZUlkKSB7XG4gICAgICAgICAgICAgIG5hbWVJZC5jb21wdXRlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICBuYW1lSWQubmFtZSA9IGFzdC5wcm9wZXJ0eS5uYW1lO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSwgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCAndW5kZWZpbmVkJyk7XG4gICAgICAgIH0pO1xuICAgICAgICByZWN1cnNpb25GbihpbnRvSWQpO1xuICAgICAgfSwgISFjcmVhdGUpO1xuICAgICAgYnJlYWs7XG4gICAgY2FzZSBBU1QuQ2FsbEV4cHJlc3Npb246XG4gICAgICBpbnRvSWQgPSBpbnRvSWQgfHwgdGhpcy5uZXh0SWQoKTtcbiAgICAgIGlmIChhc3QuZmlsdGVyKSB7XG4gICAgICAgIHJpZ2h0ID0gc2VsZi5maWx0ZXIoYXN0LmNhbGxlZS5uYW1lKTtcbiAgICAgICAgYXJncyA9IFtdO1xuICAgICAgICBmb3JFYWNoKGFzdC5hcmd1bWVudHMsIGZ1bmN0aW9uKGV4cHIpIHtcbiAgICAgICAgICB2YXIgYXJndW1lbnQgPSBzZWxmLm5leHRJZCgpO1xuICAgICAgICAgIHNlbGYucmVjdXJzZShleHByLCBhcmd1bWVudCk7XG4gICAgICAgICAgYXJncy5wdXNoKGFyZ3VtZW50KTtcbiAgICAgICAgfSk7XG4gICAgICAgIGV4cHJlc3Npb24gPSByaWdodCArICcoJyArIGFyZ3Muam9pbignLCcpICsgJyknO1xuICAgICAgICBzZWxmLmFzc2lnbihpbnRvSWQsIGV4cHJlc3Npb24pO1xuICAgICAgICByZWN1cnNpb25GbihpbnRvSWQpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmlnaHQgPSBzZWxmLm5leHRJZCgpO1xuICAgICAgICBsZWZ0ID0ge307XG4gICAgICAgIGFyZ3MgPSBbXTtcbiAgICAgICAgc2VsZi5yZWN1cnNlKGFzdC5jYWxsZWUsIHJpZ2h0LCBsZWZ0LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBzZWxmLmlmXyhzZWxmLm5vdE51bGwocmlnaHQpLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGZvckVhY2goYXN0LmFyZ3VtZW50cywgZnVuY3Rpb24oZXhwcikge1xuICAgICAgICAgICAgICBzZWxmLnJlY3Vyc2UoZXhwciwgYXN0LmNvbnN0YW50ID8gdW5kZWZpbmVkIDogc2VsZi5uZXh0SWQoKSwgdW5kZWZpbmVkLCBmdW5jdGlvbihhcmd1bWVudCkge1xuICAgICAgICAgICAgICAgIGFyZ3MucHVzaChhcmd1bWVudCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAobGVmdC5uYW1lKSB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24gPSBzZWxmLm1lbWJlcihsZWZ0LmNvbnRleHQsIGxlZnQubmFtZSwgbGVmdC5jb21wdXRlZCkgKyAnKCcgKyBhcmdzLmpvaW4oJywnKSArICcpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGV4cHJlc3Npb24gPSByaWdodCArICcoJyArIGFyZ3Muam9pbignLCcpICsgJyknO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCBleHByZXNzaW9uKTtcbiAgICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHNlbGYuYXNzaWduKGludG9JZCwgJ3VuZGVmaW5lZCcpO1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCk7XG4gICAgICAgIH0pO1xuICAgICAgf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biAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCB8fCBleHByZXNzaW9uKTtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgQVNULk9iamVjdEV4cHJlc3Npb246XG4gICAgICBhcmdzID0gW107XG4gICAgICBjb21wdXRlZCA9IGZhbHNlO1xuICAgICAgZm9yRWFjaChhc3QucHJvcGVydGllcywgZnVuY3Rpb24ocHJvcGVydHkpIHtcbiAgICAgICAgaWYgKHByb3BlcnR5LmNvbXB1dGVkKSB7XG4gICAgICAgICAgY29tcHV0ZWQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIGlmIChjb21wdXRlZCkge1xuICAgICAgICBpbnRvSWQgPSBpbnRvSWQgfHwgdGhpcy5uZXh0SWQoKTtcbiAgICAgICAgdGhpcy5hc3NpZ24oaW50b0lkLCAne30nKTtcbiAgICAgICAgZm9yRWFjaChhc3QucHJvcGVydGllcywgZnVuY3Rpb24ocHJvcGVydHkpIHtcbiAgICAgICAgICBpZiAocHJvcGVydHkuY29tcHV0ZWQpIHtcbiAgICAgICAgICAgIGxlZnQgPSBzZWxmLm5leHRJZCgpO1xuICAgICAgICAgICAgc2VsZi5yZWN1cnNlKHByb3BlcnR5LmtleSwgbGVmdCk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxlZnQgPSBwcm9wZXJ0eS5rZXkudHlwZSA9PT0gQVNULklkZW50aWZpZXIgP1xuICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eS5rZXkubmFtZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICgnJyArIHByb3BlcnR5LmtleS52YWx1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJpZ2h0ID0gc2VsZi5uZXh0SWQoKTtcbiAgICAgICAgICBzZWxmLnJlY3Vyc2UocHJvcGVydHkudmFsdWUsIHJpZ2h0KTtcbiAgICAgICAgICBzZWxmLmFzc2lnbihzZWxmLm1lbWJlcihpbnRvSWQsIG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jb250ZXh0ID8ge3ZhbHVlOiB2YWx1ZX0gOiB2YWx1ZTtcbiAgICAgIH07XG4gICAgY2FzZSBBU1QuT2JqZWN0RXhwcmVzc2lvbjpcbiAgICAgIGFyZ3MgPSBbXTtcbiAgICAgIGZvckVhY2goYXN0LnByb3BlcnRpZXMsIGZ1bmN0aW9uKHByb3BlcnR5KSB7XG4gICAgICAgIGlmIChwcm9wZXJ0eS5jb21wdXRlZCkge1xuICAgICAgICAgIGFyZ3MucHVzaCh7a2V5OiBzZWxmLnJlY3Vyc2UocHJvcGVydHkua2V5KSxcbiAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVkOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHNlbGYucmVjdXJzZShwcm9wZXJ0eS52YWx1ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBhcmdzLnB1c2goe2tleTogcHJvcGVydHkua2V5LnR5cGUgPT09IEFTVC5JZGVudGlmaWVyID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydHkua2V5Lm5hbWUgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAoJycgKyBwcm9wZXJ0eS5rZXkudmFsdWUpLFxuICAgICAgICAgICAgICAgICAgICAgY29tcHV0ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHNlbGYucmVjdXJzZShwcm9wZXJ0eS52YWx1ZSlcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGxvY2FscywgYXNzaWduLCBpbnB1dHMpIHtcbiAgICAgICAgdmFyIHZhbHVlID0ge307XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJncy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgIGlmIChhcmdzW2ldLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB2YWx1ZVthc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jb3BlLCBsb2NhbHMsIGFzc2lnbiwgaW5wdXRzKTtcbiAgICAgIHZhciByaHM7XG4gICAgICB2YXIgdmFsdWU7XG4gICAgICBpZiAobGhzICE9IG51bGwpIHtcbiAgICAgICAgcmhzID0gcmlnaHQoc2NvcGUsIGxvY2FscywgYXNzaWduLCBpbnB1dHMpO1xuICAgICAgICByaHMgPSBnZXRTdHJpbmdWYWx1ZShyaHMpO1xuICAgICAgICBpZiAoY3JlYXRlICYmIGNyZWF0ZSAhPT0gMSkge1xuICAgICAgICAgIGlmIChsaHMgJiYgIShsaHNbcmhzXSkpIHtcbiAgICAgICAgICAgIGxoc1tyaHNdID0ge307XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHZhbHVlID0gbGhzW3Joc107XG4gICAgICB9XG4gICAgICBpZiAoY29udGV4dCkge1xuICAgICAgICByZXR1cm4ge2NvbnRleHQ6IGxocywgbmFtZTogcmhzLCB2YWx1ZTogdmFsdWV9O1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgfVxuICAgIH07XG4gIH0sXG4gIG5vbkNvbXB1dGVkTWVtYmVyOiBmdW5jdGlvbihsZWZ0LCByaWdodCwgY29udGV4dCwgY3JlYXRlKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uKHNjb3BlLCBsb2NhbHMsIGFzc2lnbiwgaW5wdXRzKSB7XG4gICAgICB2YXIgbGhzID0gbGVmdChzY29wZSwgbG9jYWxzLCBhc3NpZ24sIGlucHV0cyk7XG4gICAgICBpZiAoY3JlYXRlICYmIGNyZWF0ZSAhPT0gMSkge1xuICAgICAgICBpZiAobGhzICYmIGxoc1tyaWdodF0gPT0gbnVsbCkge1xuICAgICAgICAgIGxoc1tyaWdodF0gPSB7fTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgdmFyIHZhbHVlID0gbGhzICE9IG51bGwgPyBsaHNbcmlnaHRdIDogdW5kZWZpbmVkO1xuICAgICA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gKiAgIGZ1bmN0aW9uIGFzeW5jR3JlZXQobmFtZSkge1xuICogICAgIC8vIHBlcmZvcm0gc29tZSBhc3luY2hyb25vdXMgb3BlcmF0aW9uLCByZXNvbHZlIG9yIHJlamVjdCB0aGUgcHJvbWlzZSB3aGVuIGFwcHJvcHJpYXRlLlxuICogICAgIHJldHVybiAkcShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAqICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgIGlmIChva1RvR3JlZXQobmFtZSkpIHtcbiAqICAgICAgICAgICByZXNvbHZlKCdIZWxsbywgJyArIG5hbWUgKyAnIScpO1xuICogICAgICAgICB9IGVsc2Uge1xuICogICAgICAgICAgIHJlamVjdCgnR3JlZXRpbmcgJyArIG5hbWUgKyAnIGlzIG5vdCBhbGxvd2VkLicpO1xuICogICAgICAgICB9XG4gKiAgICAgICB9LCAxMDAwKTtcbiAqICAgICB9KTtcbiAqICAgfVxuICpcbiAqICAgdmFyIHByb21pc2UgPSBhc3luY0dyZWV0KCdSb2JpbiBIb29kJyk7XG4gKiAgIHByb21pc2UudGhlbihmdW5jdGlvbihncmVldGluZykge1xuICogICAgIGFsZXJ0KCdTdWNjZXNzOiAnICsgZ3JlZXRpbmcpO1xuICogICB9LCBmdW5jdGlvbihyZWFzb24pIHtcbiAqICAgICBhbGVydCgnRmFpbGVkOiAnICsgcmVhc29uKTtcbiAqICAgfSk7XG4gKiBgYGBcbiAqXG4gKiBOb3RlOiBwcm9ncmVzcy9ub3RpZnkgY2FsbGJhY2tzIGFyZSBub3QgY3VycmVudGx5IHN1cHBvcnRlZCB2aWEgdGhlIEVTNi1zdHlsZSBpbnRlcmZhY2UuXG4gKlxuICogTm90ZTogdW5saWtlIEVTNiBiZWhhdmlvciwgYW4gZXhjZXB0aW9uIHRocm93biBpbiB0aGUgY29uc3RydWN0b3IgZnVuY3Rpb24gd2lsbCBOT1QgaW1wbGljaXRseSByZWplY3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cm9taXNlcykge1xuICAgIHZhciByZXN1bHQgPSBuZXcgUHJvbWlzZSgpLFxuICAgICAgICBjb3VudGVyID0gMCxcbiAgICAgICAgcmVzdWx0cyA9IGlzQXJyYXkocHJvbWlzZXMpID8gW10gOiB7fTtcblxuICAgIGZvckVhY2gocHJvbWlzZXMsIGZ1bmN0aW9uKHByb21pc2UsIGtleSkge1xuICAgICAgY291bnRlcisrO1xuICAgICAgd2hlbihwcm9taXNlKS50aGVuKGZ1bmN0aW9uKHZhbHVlKSB7XG4gICAgICAgIHJlc3VsdHNba2V5XSA9IHZhbHVlO1xuICAgICAgICBpZiAoISgtLWNvdW50ZXIpKSByZXNvbHZlUHJvbWlzZShyZXN1bHQsIHJlc3VsdHMpO1xuICAgICAgfSwgZnVuY3Rpb24ocmVhc29uKSB7XG4gICAgICAgIHJlamVjdFByb21pc2UocmVzdWx0LCByZWFzb24pO1xuICAgICAgfSk7XG4gICAgfSk7XG5cbiAgICBpZiAoY291bnRlciA9PT0gMCkge1xuICAgICAgcmVzb2x2ZVByb21pc2UocmVzdWx0LCByZXN1bHRzKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbiAgLyoqXG4gICAqIEBuZ2RvYyBtZXRob2RcbiAgICogQG5hbWUgJHEjcmFjZVxuICAgKiBAa2luZCBmdW5jdGlvblxuICAgKlxuICAgKiBAZGVzY3JpcHRpb25cbiAgICogUmV0dXJucyBhIHByb21pc2UgdGhhdCByZXNvbHZlcyBvciByZWplY3RzIGFzIHNvb24gYXMgb25lIG9mIHRob3NlIHByb21pc2VzXG4gICAqIHJlc29sdmVzIG9yIHJlamVjdHMsIHdpdGggdGhlIHZhbHVlIG9yIHJlYXNvbiBmcm9tIHRoYXQgcHJvbWlzZS5cbiAgICpcbiAgICogQHBhcmFtIHtBcnJheS48UHJvbWlzZT58T2JqZWN0LjxQcm9taXNlPn0gcHJvbWlzZXMgQW4gYXJyYXkgb3IgaGFzaCBvZiBwcm9taXNl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cbiAgICAgICAgIGV4cGVjdChwYXJlbnQuc2FsdXRhdGlvbikudG9FcXVhbCgnSGVsbG8nKTtcbiAgICAgKiBgYGBcbiAgICAgKlxuICAgICAqIFdoZW4gaW50ZXJhY3Rpbmcgd2l0aCBgU2NvcGVgIGluIHRlc3RzLCBhZGRpdGlvbmFsIGhlbHBlciBtZXRob2RzIGFyZSBhdmFpbGFibGUgb24gdGhlXG4gICAgICogaW5zdGFuY2VzIG9mIGBTY29wZWAgdHlwZS4gU2VlIHtAbGluayBuZ01vY2suJHJvb3RTY29wZS5TY29wZSBuZ01vY2sgU2NvcGV9IGZvciBhZGRpdGlvbmFsXG4gICAgICogZGV0YWlscy5cbiAgICAgKlxuICAgICAqXG4gICAgICogQHBhcmFtIHtPYmplY3QuPHN0cmluZywgZnVuY3Rpb24oKT49fSBwcm92aWRlcnMgTWFwIG9mIHNlcnZpY2UgZmFjdG9yeSB3aGljaCBuZWVkIHRvIGJlXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm92aWRlZCBmb3IgdGhlIGN1cnJlbnQgc2NvcGUuIERlZmF1bHRzIHRvIHtAbGluayBuZ30uXG4gICAgICogQHBhcmFtIHtPYmplY3QuPHN0cmluZywgKj49fSBpbnN0YW5jZUNhY2hlIFByb3ZpZGVzIHByZS1pbnN0YW50aWF0ZWQgc2VydmljZXMgd2hpY2ggc2hvdWxkXG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmQvb3ZlcnJpZGUgc2VydmljZXMgcHJvdmlkZWQgYnkgYHByb3ZpZGVyc2AuIFRoaXMgaXMgaGFuZHlcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoZW4gdW5pdC10ZXN0aW5nIGFuZCBoYXZpbmcgdGhlIG5lZWQgdG8gb3ZlcnJpZGUgYSBkZWZhdWx0XG4gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlLlxuICAg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ZS5sZW5ndGg7XG5cbiAgICAgICAgICAgIGlmIChvbGRMZW5ndGggIT09IG5ld0xlbmd0aCkge1xuICAgICAgICAgICAgICAvLyBpZiBsZW5ndGhzIGRvIG5vdCBtYXRjaCB3ZSBuZWVkIHRvIHRyaWdnZXIgY2hhbmdlIG5vdGlmaWNhdGlvblxuICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICBvbGRWYWx1ZS5sZW5ndGggPSBvbGRMZW5ndGggPSBuZXdMZW5ndGg7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBjb3B5IHRoZSBpdGVtcyB0byBvbGRWYWx1ZSBhbmQgbG9vayBmb3IgY2hhbmdlcy5cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmV3TGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgb2xkSXRlbSA9IG9sZFZhbHVlW2ldO1xuICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3VmFsdWVbaV07XG5cbiAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgICAgICAgICAgICBib3RoTmFOID0gKG9sZEl0ZW0gIT09IG9sZEl0ZW0pICYmIChuZXdJdGVtICE9PSBuZXdJdGVtKTtcbiAgICAgICAgICAgICAgaWYgKCFib3RoTmFOICYmIChvbGRJdGVtICE9PSBuZXdJdGVtKSkge1xuICAgICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7XG4gICAgICAgICAgICAgICAgb2xkVmFsdWVbaV0gPSBuZXdJdGVtO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChvbGRWYWx1ZSAhPT0gaW50ZXJuYWxPYmplY3QpIHtcbiAgICAgICAgICAgICAgLy8gd2UgYXJlIHRyYW5zaXRpb25pbmcgZnJvbSBzb21ldGhpbmcgd2hpY2ggd2FzIG5vdCBhbiBvYmplY3QgaW50byBvYmplY3QuXG4gICAgICAgICAgICAgIG9sZFZhbHVlID0gaW50ZXJuYWxPYmplY3QgPSB7fTtcbiAgICAgICAgICAgICAgb2xkTGVuZ3RoID0gMDtcbiAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0ZWQrKztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGNvcHkgdGhlIGl0ZW1zIHRvIG9sZFZhbHVlIGFuZCBsb29rIGZvciBjaGFuZ2VzLlxuICAgICAgICAgICAgbmV3TGVuZ3RoID0gMDtcbiAgICAgICAgICAgIGZvciAoa2V5IGluIG5ld1ZhbHVlKSB7XG4gICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKG5ld1ZhbHVlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgbmV3TGVuZ3RoKys7XG4gICAgICAgICAgICAgICAgbmV3SXRlbSA9IG5ld1ZhbHVlW2tleV07XG4gICAgICAgICAgICAgICAgb2xkSXRlbSA9IG9sZFZhbHVlW2tleV07XG5cbiAgICAgICAgICAgICAgICBpZiAoa2V5IGluIG9sZFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gICAgICAgICAgICAgICAgICBib3RoTmFOID0gKG9sZEl0ZW0gIT09IG9sZEl0ZW0pICYmIChuZXdJdGVtICE9PSBuZXdJdGVtKTtcbiAgICAgICAgICAgICAgICAgIGlmICghYm90aE5hTiAmJiAob2xkSXRlbSAhPT0gbmV3SXRlbSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0ZWQrKztcbiAgICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIG9sZExlbmd0aCsrO1xuICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld0l0ZW07XG4gICAgICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKG9sZExlbmd0aCA+IG5ld0xlbmd0aCkge1xuICAgICAgICAgICAgICAvLyB3ZSB1c2VkIHRvIGhhdmUgbW9yZSBrZXlzLCBuZWVkIHRvIGZpbmQgdGhlbSBhbmQgZGVzdHJveSB0aGVtLlxuICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICBmb3IgKGtleSBpbiBvbGRWYWx1ZSkge1xuICAgICAgICAgICAgICAgIGlmICghaGFzT3duUHJvcGVydHkuY2FsbChuZXdWYWx1ZSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgb2xkTGVuZ3RoLS07XG4gICAgICAgICAgICAgICAgICBkZWxldGUgb2xkVmFsdWVba2V5XTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYW5nZURldGVjdGVkO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gJHdhdGNoQ29sbGVjdGlvbkFjdGlvbigpIHtcbiAgICAgICAgICBpZiAoaW5pdFJ1bikge1xuICAgICAgICAgICAgaW5pdFJ1biA9IGZhbHNlO1xuICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWUsIG5ld1ZhbHVlLCBzZWxmKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWUsIHZlcnlPbGRWYWx1ZSwgc2VsZik7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gbWFrZSBhIGNvcHkgZm9yIHRoZSBuZXh0IHRpbWUgYSBjb2xsZWN0aW9uIGlzIGNoYW5nZWRcbiAgICAgICAgICBpZiAodHJhY2tWZXJ5T2xkVmFsdWUpIHtcbiAgICAgICAgICAgIGlmICghaXNPYmplY3QobmV3VmFsdWUpKSB7XG4gICAgICAgICAgICAgIC8vcHJpbWl0aXZlXG4gICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZSA9IG5ld1ZhbHVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpc0FycmF5TGlrZShuZXdWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlID0gbmV3IEFycmF5KG5ld1ZhbHVlLmxlbmd0aCk7XG4gICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmV3VmFsdWUubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2ZXJ5T2xkVmFsdWVbaV0gPSBuZXdWYWx1ZVtpXTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHsgLy8gaWYgb2JqZWN0XG4gICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZSA9IHt9O1xuICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gbmV3VmFsdWUpIHtcbiAgICAgICAgICAgICAgICBpZiAoaGFzT3duUHJvcGVydHkuY2FsbChuZXdWYWx1ZSwga2V5KSkge1xuICAgICAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlW2tleV0gPSBuZXdWYWx1ZVtrZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLiR3YXRjaChjaGFuZ2VEZXRlY3RvciwgJHdhdGNoQ29sbGVjdGlvbkFjdGlvbik7XG4gICAgICB9LFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lIC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JzW3dhdGNoZXJzLiQkZGlnZXN0V2F0Y2hJbmRleF07XG4gICAgICAgICAgICAgICAgICAvLyBNb3N0IGNvbW1vbiB3YXRjaGVzIGFyZSBvbiBwcmltaXRpdmVzLCBpbiB3aGljaCBjYXNlIHdlIGNhbiBzaG9ydFxuICAgICAgICAgICAgICAgICAgLy8gY2lyY3VpdCBpdCB3aXRoID09PSBvcGVyYXRvciwgb25seSB3aGVuID09PSBmYWlscyBkbyB3ZSB1c2UgLmVxdWFsc1xuICAgICAgICAgICAgICAgICAgaWYgKHdhdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgIGdldCA9IHdhdGNoLmdldDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh2YWx1ZSA9IGdldChjdXJyZW50KSkgIT09IChsYXN0ID0gd2F0Y2gubGFzdCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICEod2F0Y2guZXFcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGVxdWFscyh2YWx1ZSwgbGFzdClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IChpc051bWJlck5hTih2YWx1ZSkgJiYgaXNOdW1iZXJOYU4obGFzdCkpKSkge1xuICAgICAgICAgICAgICAgICAgICAgIGRpcnR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICBsYXN0RGlydHlXYXRjaCA9IHdhdGNoO1xuICAgICAgICAgICAgICAgICAgICAgIHdhdGNoLmxhc3QgPSB3YXRjaC5lcSA/IGNvcHkodmFsdWUsIG51bGwpIDogdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgICAgZm4gPSB3YXRjaC5mbjtcbiAgICAgICAgICAgICAgICAgICAgICBmbih2YWx1ZSwgKChsYXN0ID09PSBpbml0V2F0Y2hWYWwpID8gdmFsdWUgOiBsYXN0KSwgY3VycmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHR0bCA8IDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvZ0lkeCA9IDQgLSB0dGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXdhdGNoTG9nW2xvZ0lkeF0pIHdhdGNoTG9nW2xvZ0lkeF0gPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhdGNoTG9nW2xvZ0lkeF0ucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIG1zZzogaXNGdW5jdGlvbih3YXRjaC5leHApID8gJ2ZuOiAnICsgKHdhdGNoLmV4cC5uYW1lIHx8IHdhdGNoLmV4cC50b1N0cmluZygpKSA6IHdhdGNoLmV4cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsOiB2YWx1ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkVmFsOiBsYXN0XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2F0Y2ggPT09IGxhc3REaXJ0eVdhdGNoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIG1vc3QgcmVjZW50bHkgZGlydHkgd2F0Y2hlciBpcyBub3cgY2xlYW4sIHNob3J0IGNpcmN1aXQgc2luY2UgdGhlIHJlbWFpbmluZyB3YXRjaGVyc1xuICAgICAgICAgICAgICAgICAgICAgIC8vIGhhdmUgYWxyZWFkeSBiZWVuIHRlc3RlZC5cbiAgICAgICAgICAgICAgICAgICAgICBkaXJ0eSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRyYXZlcnNlU2NvcGVzTG9vcDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICA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CBjdXJyZW50IGBzY29wZWAgcGFyYW1ldGVyLlxuICAgICAgICovXG4gICAgICAkYXBwbHlBc3luYzogZnVuY3Rpb24oZXhwcikge1xuICAgICAgICB2YXIgc2NvcGUgPSB0aGlzO1xuICAgICAgICBpZiAoZXhwcikge1xuICAgICAgICAgIGFwcGx5QXN5bmNRdWV1ZS5wdXNoKCRhcHBseUFzeW5jRXhwcmVzc2lvbik7XG4gICAgICAgIH1cbiAgICAgICAgZXhwciA9ICRwYXJzZShleHByKTtcbiAgICAgICAgc2NoZWR1bGVBcHBseUFzeW5jKCk7XG5cbiAgICAgICAgZnVuY3Rpb24gJGFwcGx5QXN5bmNFeHByZXNzaW9uKCkge1xuICAgICAgICAgIHNjb3BlLiRldmFsKGV4cHIpO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRyb290U2NvcGUuU2NvcGUjJG9uXG4gICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogTGlzdGVucyBvbiBldmVudHMgb2YgYSBnaXZlbiB0eXBlLiBTZWUge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJGVtaXQgJGVtaXR9IGZvclxuICAgICAgICogZGlzY3Vzc2lvbiBvZiBldmVudCBsaWZlIGN5Y2xlLlxuICAgICAgICpcbiAgICAgICAqIFRoZSBldmVudCBsaXN0ZW5lciBmdW5jdGlvbiBmb3JtYXQgaXM6IGBmdW5jdGlvbihldmVudCwgYXJncy4uLilgLiBUaGUgYGV2ZW50YCBvYmplY3RcbiAgICAgICAqIHBhc3NlZCBpbnRvIHRoZSBsaXN0ZW5lciBoYXMgdGhlIGZvbGxvd2luZyBhdHRyaWJ1dGVzOlxuICAgICAgICpcbiAgICAgICAqICAgLSBgdGFyZ2V0U2NvcGVgIC0gYHtTY29wZX1gOiB0aGUgc2Nvc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AgICAgICAgICAgIGV2ZW50ID0ge1xuICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxuICAgICAgICAgICAgICB0YXJnZXRTY29wZTogc2NvcGUsXG4gICAgICAgICAgICAgIHN0b3BQcm9wYWdhdGlvbjogZnVuY3Rpb24oKSB7c3RvcFByb3BhZ2F0aW9uID0gdHJ1ZTt9LFxuICAgICAgICAgICAgICBwcmV2ZW50RGVmYXVsdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgZXZlbnQuZGVmYXVsdFByZXZlbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGRlZmF1bHRQcmV2ZW50ZWQ6IGZhbHNlXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbGlzdGVuZXJBcmdzID0gY29uY2F0KFtldmVudF0sIGFyZ3VtZW50cywgMSksXG4gICAgICAgICAgICBpLCBsZW5ndGg7XG5cbiAgICAgICAgZG8ge1xuICAgICAgICAgIG5hbWVkTGlzdGVuZXJzID0gc2NvcGUuJCRsaXN0ZW5lcnNbbmFtZV0gfHwgZW1wdHk7XG4gICAgICAgICAgZXZlbnQuY3VycmVudFNjb3BlID0gc2NvcGU7XG4gICAgICAgICAgZm9yIChpID0gMCwgbGVuZ3RoID0gbmFtZWRMaXN0ZW5lcnMubGVuZ3RoOyBpIDwgbGVuZ3RoOyBpKyspIHtcblxuICAgICAgICAgICAgLy8gaWYgbGlzdGVuZXJzIHdlcmUgZGVyZWdpc3RlcmVkLCBkZWZyYWdtZW50IHRoZSBhcnJheVxuICAgICAgICAgICAgaWYgKCFuYW1lZExpc3RlbmVyc1tpXSkge1xuICAgICAgICAgICAgICBuYW1lZExpc3RlbmVycy5zcGxpY2UoaSwgMSk7XG4gICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgbGVuZ3RoLS07XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgLy9hbGxvdyBhbGwgbGlzdGVuZXJzIGF0dGFjaGVkIHRvIHRoZSBjdXJyZW50IHNjb3BlIHRvIHJ1blxuICAgICAgICAgICAgICBuYW1lZExpc3RlbmVyc1tpXS5hcHBseShudWxsLCBsaXN0ZW5lckFyZ3MpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgLy9pZiBhbnkgbGlzdGVuZXIgb24gdGhlIGN1cnJlbnQgc2NvcGUgc3RvcHMgcHJvcGFnYXRpb24sIHByZXZlbnQgYnViYmxpbmdcbiAgICAgICAgICBpZiAoc3RvcFByb3BhZ2F0aW9uKSB7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgICAgLy90cmF2ZXJzZSB1cHdhcmRzXG4gICAgICAgICAgc2NvcGUgPSBzY29wZS4kcGFyZW50O1xuICAgICAgICB9IHdoaWxlIChzY29wZSk7XG5cbiAgICAgICAgZXZlbnQuY3VycmVudFNjb3BlID0gbnVsbDtcblxuICAgICAgICByZXR1cm4gZXZlbnQ7XG4gICAgICB9LFxuXG5cbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkYnJvYWRjYXN0XG4gICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogRGlzcGF0Y2hlcyBhbiBldmVudCBgbmFtZWAgZG93bndhcmRzIHRvIGFsbCBjaGlsZCBzY29wZXMgKGFuZCB0aGVpciBjaGlsZHJlbikgbm90aWZ5aW5nIHRoZVxuICAgICAgICogcmVnaXN0ZXJlZCB7QGxpbmsgbmcuJHJvb3RTY29wZS5TY29wZSMkb259IGxpc3RlbmVycy5cbiAgIC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nLiRyb290U2NvcGUuU2NvcGUjJG9ufVxuICAgICAgICovXG4gICAgICAkYnJvYWRjYXN0OiBmdW5jdGlvbihuYW1lLCBhcmdzKSB7XG4gICAgICAgIHZhciB0YXJnZXQgPSB0aGlzLFxuICAgICAgICAgICAgY3VycmVudCA9IHRhcmdldCxcbiAgICAgICAgICAgIG5leHQgPSB0YXJnZXQsXG4gICAgICAgICAgICBldmVudCA9IHtcbiAgICAgICAgICAgICAgbmFtZTogbmFtZSxcbiAgICAgICAgICAgICAgdGFyZ2V0U2NvcGU6IHRhcmdldCxcbiAgICAgICAgICAgICAgcHJldmVudERlZmF1bHQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIGV2ZW50LmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICBkZWZhdWx0UHJldmVudGVkOiBmYWxzZVxuICAgICAgICAgICAgfTtcblxuICAgICAgICBpZiAoIXRhcmdldC4kJGxpc3RlbmVyQ291bnRbbmFtZV0pIHJldHVybiBldmVudDtcblxuICAgICAgICB2YXIgbGlzdGVuZXJBcmdzID0gY29uY2F0KFtldmVudF0sIGFyZ3VtZW50cywgMSksXG4gICAgICAgICAgICBsaXN0ZW5lcnMsIGksIGxlbmd0aDtcblxuICAgICAgICAvL2Rvd24gd2hpbGUgeW91IGNhbiwgdGhlbiB1cCBhbmQgbmV4dCBzaWJsaW5nIG9yIHVwIGFuZCBuZXh0IHNpYmxpbmcgdW50aWwgYmFjayBhdCByb290XG4gICAgICAgIHdoaWxlICgoY3VycmVudCA9IG5leHQpKSB7XG4gICAgICAgICAgZXZlbnQuY3VycmVudFNjb3BlID0gY3VycmVudDtcbiAgICAgICAgICBsaXN0ZW5lcnMgPSBjdXJyZW50LiQkbGlzdGVuZXJzW25hbWVdIHx8IFtdO1xuICAgICAgICAgIGZvciAoaSA9IDAsIGxlbmd0aCA9IGxpc3RlbmVycy5sZW5ndGg7IGkgPCBs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BpbWdTcmNTYW5pdGl6YXRpb25XaGl0ZWxpc3QgOiBhSHJlZlNhbml0aXphdGlvbldoaXRlbGlzdDtcbiAgICAgIHZhciBub3JtYWxpemVkVmFsID0gdXJsUmVzb2x2ZSh1cmkgJiYgdXJpLnRyaW0oKSkuaHJlZjtcbiAgICAgIGlmIChub3JtYWxpemVkVmFsICE9PSAnJyAmJiAhbm9ybWFsaXplZFZhbC5tYXRjaChyZWdleCkpIHtcbiAgICAgICAgcmV0dXJuICd1bnNhZmU6JyArIG5vcm1hbGl6ZWRWYWw7XG4gICAgICB9XG4gICAgICByZXR1cm4gdXJpO1xuICAgIH07XG4gIH07XG59XG5cbi8qICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICpcbiAqICAgICBBbnkgY29tbWl0cyB0byB0aGlzIGZpbGUgc2hvdWxkIGJlIHJldmlld2VkIHdpdGggc2VjdXJpdHkgaW4gbWluZC4gICpcbiAqICAgQ2hhbmdlcyB0byB0aGlzIGZpbGUgY2FuIHBvdGVudGlhbGx5IGNyZWF0ZSBzZWN1cml0eSB2dWxuZXJhYmlsaXRpZXMuICpcbiAqICAgICAgICAgIEFuIGFwcHJvdmFsIGZyb20gMiBDb3JlIG1lbWJlcnMgd2l0aCBoaXN0b3J5IG9mIG1vZGlmeWluZyAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgZmlsZSBpcyByZXF1aXJlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpcbiAqICBEb2VzIHRoZSBjaGFuZ2Ugc29tZWhvdyBhbGxvdyBmb3IgYXJiaXRyYXJ5IGphdmFzY3JpcHQgdG8gYmUgZXhlY3V0ZWQ/ICpcbiAqICAgIE9yIGFsbG93cyBmb3Igc29tZW9uZSB0by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ZvciB0aGUgZXhwcmVzc2lvbi4gRmlsdGVycyBhbmQgd2hpdGVzcGFjZSBhcmUgaWdub3JlZC5cbiAgICAgKi9cbiAgICB0ZXN0YWJpbGl0eS5maW5kQmluZGluZ3MgPSBmdW5jdGlvbihlbGVtZW50LCBleHByZXNzaW9uLCBvcHRfZXhhY3RNYXRjaCkge1xuICAgICAgdmFyIGJpbmRpbmdzID0gZWxlbWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCduZy1iaW5kaW5nJyk7XG4gICAgICB2YXIgbWF0Y2hlcyA9IFtdO1xuICAgICAgZm9yRWFjaChiaW5kaW5ncywgZnVuY3Rpb24oYmluZGluZykge1xuICAgICAgICB2YXIgZGF0YUJpbmRpbmcgPSBhbmd1bGFyLmVsZW1lbnQoYmluZGluZykuZGF0YSgnJGJpbmRpbmcnKTtcbiAgICAgICAgaWYgKGRhdGFCaW5kaW5nKSB7XG4gICAgICAgICAgZm9yRWFjaChkYXRhQmluZGluZywgZnVuY3Rpb24oYmluZGluZ05hbWUpIHtcbiAgICAgICAgICAgIGlmIChvcHRfZXhhY3RNYXRjaCkge1xuICAgICAgICAgICAgICB2YXIgbWF0Y2hlciA9IG5ldyBSZWdFeHAoJyhefFxcXFxzKScgKyBlc2NhcGVGb3JSZWdleHAoZXhwcmVzc2lvbikgKyAnKFxcXFxzfFxcXFx8fCQpJyk7XG4gICAgICAgICAgICAgIGlmIChtYXRjaGVyLnRlc3QoYmluZGluZ05hbWUpKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKGJpbmRpbmcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBpZiAoYmluZGluZ05hbWUuaW5kZXhPZihleHByZXNzaW9uKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICBtYXRjaGVzLnB1c2goYmluZGluZyk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgIC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mFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICA8c2NyaXB0PlxuICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ2xpbWl0VG9FeGFtcGxlJywgW10pXG4gICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICAgJHNjb3BlLm51bWJlcnMgPSBbMSwyLDMsNCw1LDYsNyw4LDldO1xuICAgICAgICAgICAgICRzY29wZS5sZXR0ZXJzID0gXCJhYmNkZWZnaGlcIjtcbiAgICAgICAgICAgICAkc2NvcGUubG9uZ051bWJlciA9IDIzNDU0MzIzNDI7XG4gICAgICAgICAgICAgJHNjb3BlLm51bUxpbWl0ID0gMztcbiAgICAgICAgICAgICAkc2NvcGUubGV0dGVyTGltaXQgPSAzO1xuICAgICAgICAgICAgICRzY29wZS5sb25nTnVtYmVyTGltaXQgPSAzO1xuICAgICAgICAgICB9XSk7XG4gICAgICAgPC9zY3JpcHQ+XG4gICAgICAgPGRpdiBuZy1jb250cm9sbGVyPVwiRXhhbXBsZUNvbnRyb2xsZXJcIj5cbiAgICAgICAgIDxsYWJlbD5cbiAgICAgICAgICAgIExpbWl0IHt7bnVtYmVyc319IHRvOlxuICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJudW1iZXJcIiBzdGVwPVwiMVwiIG5nLW1vZGVsPVwibnVtTGltaXRcIj5cbiAgICAgICAgIDwvbGFiZWw+XG4gICAgICAgICA8cD5PdXRwdXQgbnVtYmVyczoge3sgbnVtYmVycyB8IGxpbWl0VG86bnVtTGltaXQgfX08L3A+XG4gICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgICBMaW1pdCB7e2xldHRlcnN9fSB0bzpcbiAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwibnVtYmVyXCIgc3RlcD1cIjFcIiBuZy1tb2RlbD1cImxldHRlckxpbWl0XCI+XG4gICAgICAgICA8L2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uZCBpbiBmcmllbmRzIHwgb3JkZXJCeTonLWFnZSdcIj5cbiAgICAgICAgICAgICA8dGQ+e3tmcmllbmQubmFtZX19PC90ZD5cbiAgICAgICAgICAgICA8dGQ+e3tmcmllbmQucGhvbmV9fTwvdGQ+XG4gICAgICAgICAgICAgPHRkPnt7ZnJpZW5kLmFnZX19PC90ZD5cbiAgICAgICAgICAgPC90cj5cbiAgICAgICAgIDwvdGFibGU+XG4gICAgICAgPC9kaXY+XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cInNjcmlwdC5qc1wiPlxuICAgICAgIGFuZ3VsYXIubW9kdWxlKCdvcmRlckJ5RXhhbXBsZTEnLCBbXSlcbiAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICRzY29wZS5mcmllbmRzID0gW1xuICAgICAgICAgICAgIHtuYW1lOiAnSm9obicsICAgcGhvbmU6ICc1NTUtMTIxMicsICBhZ2U6IDEwfSxcbiAgICAgICAgICAgICB7bmFtZTogJ01hcnknLCAgIHBob25lOiAnNTU1LTk4NzYnLCAgYWdlOiAxOX0sXG4gICAgICAgICAgICAge25hbWU6ICdNaWtlJywgICBwaG9uZTogJzU1NS00MzIxJywgIGFnZTogMjF9LFxuICAgICAgICAgICAgIHtuYW1lOiAnQWRhbScsICAgcGhvbmU6ICc1NTUtNTY3OCcsICBhZ2U6IDM1fSxcbiAgICAgICAgICAgICB7bmFtZTogJ0p1bGllJywgIHBob25lOiAnNTU1LTg3NjUnLCAgYWdlOiAyOX1cbiAgICAgICAgICAgXTtcbiAgICAgICAgIH1dKTtcbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwic3R5bGUuY3NzXCI+XG4gICAgICAgLmZyaWVuZHMge1xuICAgICAgICAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTtcbiAgICAgICB9XG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XCJzY3JpcHQuanNcIj5cbiAgICAgICBhbmd1bGFyLm1vZHVsZSgnb3JkZXJCeUV4YW1wbGUyJywgW10pXG4gICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICB2YXIgZnJpZW5kcyA9IFtcbiAgICAgICAgICAgICB7bmFtZTogJ0pvaG4nLCAgIHBob25lOiAnNTU1LTEyMTInLCAgYWdlOiAxMH0sXG4gICAgICAgICAgICAge25hbWU6ICdNYXJ5JywgICBwaG9uZTogJzU1NS05ODc2JywgIGFnZTogMTl9LFxuICAgICAgICAgICAgIHtuYW1lOiAnTWlrZScsICAgcGhvbmU6ICc1NTUtNDMyMScsICBhZ2U6IDIxfSxcbiAgICAgICAgICAgICB7bmFtZTogJ0FkYW0nLCAgIHBob25lOiAnNTU1LTU2NzgnLCAgYWdlOiAzNX0sXG4gICAgICAgICAgICAge25hbWU6ICdKdWxpZScsICBwaG9uZTogJzU1NS04NzY1JywgIGFnZTogMjl9XG4gICAgICAgICAgIF07XG5cbiAgICAgICAgICAgJHNjb3BlLnByb3BlcnR5TmFtZSA9ICdhZ2UnO1xuICAgICAgICAgICAkc2NvcGUucmV2ZXJzZSA9IHRydWU7XG4gICAgICAgICAgICRzY29wZS5mcmllbmRzID0gZnJpZW5kcztcblxuICAgICAgICAgICAkc2NvcGUuc29ydEJ5ID0gZnVuY3Rpb24ocHJvcGVydHlOYW1lKSB7XG4gICAgICAgICAgICAgJHNjb3BlLnJldmVyc2UgPSAoJHNjb3BlLnByb3BlcnR5TmFtZSA9PT0gcHJvcGVydHlOYW1lKSA/ICEkc2NvcGUucmV2ZXJzZSA6IGZhbHNlO1xuICAgICAgICAgICAgICRzY29wZS5wcm9wZXJ0eU5hbWUgPSBwcm9wZXJ0eU5hbWU7XG4gICAgICAgICAgIH07XG4gICAgICAgICB9XSk7XG4gICAgIDwvZmlsZT5cbiAgICAgP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SB7XG4gICAgICAgICAgICAgJHNjb3BlLnJldmVyc2UgPSAocHJvcGVydHlOYW1lICE9PSBudWxsICYmICRzY29wZS5wcm9wZXJ0eU5hbWUgPT09IHByb3BlcnR5TmFtZSlcbiAgICAgICAgICAgICAgICAgPyAhJHNjb3BlLnJldmVyc2UgOiBmYWxzZTtcbiAgICAgICAgICAgICAkc2NvcGUucHJvcGVydHlOYW1lID0gcHJvcGVydHlOYW1lO1xuICAgICAgICAgICAgICRzY29wZS5mcmllbmRzID0gb3JkZXJCeShmcmllbmRzLCAkc2NvcGUucHJvcGVydHlOYW1lLCAkc2NvcGUucmV2ZXJzZSk7XG4gICAgICAgICAgIH07XG4gICAgICAgICB9XSk7XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cInN0eWxlLmNzc1wiPlxuICAgICAgIC5mcmllbmRzIHtcbiAgICAgICAgIGJvcmRlci1jb2xsYXBzZTogY29sbGFwc2U7XG4gICAgICAgfVxuXG4gICAgICAgLmZyaWVuZHMgdGgge1xuICAgICAgICAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkO1xuICAgICAgIH1cbiAgICAgICAuZnJpZW5kcyB0ZCwgLmZyaWVuZHMgdGgge1xuICAgICAgICAgYm9yZGVyLWxlZnQ6IDFweCBzb2xpZDtcbiAgICAgICAgIHBhZGRpbmc6IDVweCAxMHB4O1xuICAgICAgIH1cbiAgICAgICAuZnJpZW5kcyB0ZDpmaXJzdC1jaGlsZCwgLmZyaWVuZHMgdGg6Zmlyc3QtY2hpbGQge1xuICAgICAgICAgYm9yZGVyLWxlZnQ6IG5vbmU7XG4gICAgICAgfVxuXG4gICAgICAgLnNvcnRvcmRlcjphZnRlciB7XG4gICAgICAgICBjb250ZW50OiAnXFwyNWIyJzsgICAvLyBCTEFDSyBVUC1QT0lOVElORyBUUklBTkdMRVxuICAgICAgIH1cbiAgICAgICAuc29ydG9yZGVyLnJldmVyc2U6YWZ0ZXIge1xuICAgICAgICAgY29udGV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uXG4gICAgICAgICAgICBpZiAobmFtZUF0dHIpIHtcbiAgICAgICAgICAgICAgc2V0dGVyKHNjb3BlLCBjb250cm9sbGVyKTtcbiAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZShuYW1lQXR0ciwgZnVuY3Rpb24obmV3VmFsdWUpIHtcbiAgICAgICAgICAgICAgICBpZiAoY29udHJvbGxlci4kbmFtZSA9PT0gbmV3VmFsdWUpIHJldHVybjtcbiAgICAgICAgICAgICAgICBzZXR0ZXIoc2NvcGUsIHVuZGVmaW5lZCk7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci4kJHBhcmVudEZvcm0uJCRyZW5hbWVDb250cm9sKGNvbnRyb2xsZXIsIG5ld1ZhbHVlKTtcbiAgICAgICAgICAgICAgICBzZXR0ZXIgPSBnZXRTZXR0ZXIoY29udHJvbGxlci4kbmFtZSk7XG4gICAgICAgICAgICAgICAgc2V0dGVyKHNjb3BlLCBjb250cm9sbGVyKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmb3JtRWxlbWVudC5vbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlci4kJHBhcmVudEZvcm0uJHJlbW92ZUNvbnRyb2woY29udHJvbGxlcik7XG4gICAgICAgICAgICAgIHNldHRlcihzY29wZSwgdW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgZXh0ZW5kKGNvbnRyb2xsZXIsIG51bGxGb3JtQ3RybCk7IC8vc3RvcCBwcm9wYWdhdGluZyBjaGlsZCBkZXN0cnVjdGlvbiBoYW5kbGVycyB1cHdhcmRzXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9XG4gICAgfTtcblxuICAgIHJldHVybiBmb3JtRGlyZWN0aXZlO1xuXG4gICAgZnVuY3Rpb24gZ2V0U2V0dGVyKGV4cHJlc3Npb24pIHtcbiAgICAgIGlmIChle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jxici8+XG4gICAgICAgICAgPC9mb3JtPlxuICAgICAgICA8L2ZpbGU+XG4gICAgICAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAgICAgICAgICB2YXIgdGV4dCA9IGVsZW1lbnQoYnkuYmluZGluZygndXJsLnRleHQnKSk7XG4gICAgICAgICAgdmFyIHZhbGlkID0gZWxlbWVudChieS5iaW5kaW5nKCdteUZvcm0uaW5wdXQuJHZhbGlkJykpO1xuICAgICAgICAgIHZhciBpbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ3VybC50ZXh0JykpO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBpbml0aWFsaXplIHRvIG1vZGVsJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvQ29udGFpbignaHR0cDovL2dvb2dsZS5jb20nKTtcbiAgICAgICAgICAgIGV4cGVjdCh2YWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIGVtcHR5JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpbnB1dC5jbGVhcigpO1xuICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJycpO1xuXG4gICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvRXF1YWwoJ3RleHQgPScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG5vdCB1cmwnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7XG4gICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnYm94Jyk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Jyb3IucmVxdWlyZWQgPSB7eyEhbXlGb3JtLiRlcnJvci5yZXF1aXJlZH19PC90dD48YnIvPlxuICAgICAgICAgICAgIDx0dD5teUZvcm0uJGVycm9yLmVtYWlsID0ge3shIW15Rm9ybS4kZXJyb3IuZW1haWx9fTwvdHQ+PGJyLz5cbiAgICAgICAgICAgPC9mb3JtPlxuICAgICAgICAgPC9maWxlPlxuICAgICAgICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICAgICAgdmFyIHRleHQgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ2VtYWlsLnRleHQnKSk7XG4gICAgICAgICAgdmFyIHZhbGlkID0gZWxlbWVudChieS5iaW5kaW5nKCdteUZvcm0uaW5wdXQuJHZhbGlkJykpO1xuICAgICAgICAgIHZhciBpbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ2VtYWlsLnRleHQnKSk7XG5cbiAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGV4cGVjdCh0ZXh0LmdldFRleHQoKSkudG9Db250YWluKCdtZUBleGFtcGxlLmNvbScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgZW1wdHknLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7XG4gICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnJyk7XG4gICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvRXF1YWwoJ3RleHQgPScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1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KVxuICAgICAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICAgICAgICRzY29wZS52YWx1ZSA9IDc1O1xuICAgICAgICAgICAgICAgICRzY29wZS5taW4gPSAxMDtcbiAgICAgICAgICAgICAgICAkc2NvcGUubWF4ID0gOTA7XG4gICAgICAgICAgICAgIH1dKTtcbiAgICAgICAgICA8L3NjcmlwdD5cbiAgICAgICAgICA8Zm9ybSBuYW1lPVwibXlGb3JtXCIgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgICBNb2RlbCBhcyByYW5nZTogPGlucHV0IHR5cGU9XCJyYW5nZVwiIG5hbWU9XCJyYW5nZVwiIG5nLW1vZGVsPVwidmFsdWVcIiBuZy1taW49XCJtaW5cIiBuZy1tYXg9XCJtYXhcIj5cbiAgICAgICAgICAgIDxocj5cbiAgICAgICAgICAgIE1vZGVsIGFzIG51bWJlcjogPGlucHV0IHR5cGU9XCJudW1iZXJcIiBuZy1tb2RlbD1cInZhbHVlXCI+PGJyPlxuICAgICAgICAgICAgTWluOiA8aW5wdXQgdHlwZT1cIm51bWJlclwiIG5nLW1vZGVsPVwibWluXCI+PGJyPlxuICAgICAgICAgICAgTWF4OiA8aW5wdXQgdHlwZT1cIm51bWJlclwiIG5nLW1vZGVsPVwibWF4XCI+PGJyPlxuICAgICAgICAgICAgdmFsdWUgPSA8Y29kZT57e3ZhbHVlfX08L2NvZGU+PGJyLz5cbiAgICAgICAgICAgIG15Rm9ybS5yYW5nZS4kdmFsaWQgPSA8Y29kZT57e215Rm9ybS5yYW5nZS4kdmFsaWR9fTwvY29kZT48YnIvPlxuICAgICAgICAgICAgbXlGb3JtLnJhbmdlLiRlcnJvciA9IDxjb2RlPnt7bXlGb3JtLnJhbmdlLiRlcnJvcn19PC9jb2RlPlxuICAgICAgICAgIDwvZm9ybT5c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sZSBuYW1lPVwiaW5kZXguaHRtbFwiPlxuICAgICAgICAgPHNjcmlwdD5cbiAgICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ2NoZWNrYm94RXhhbXBsZScsIFtdKVxuICAgICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICAgICAkc2NvcGUuY2hlY2tib3hNb2RlbCA9IHtcbiAgICAgICAgICAgICAgICB2YWx1ZTEgOiB0cnVlLFxuICAgICAgICAgICAgICAgIHZhbHVlMiA6ICdZRVMnXG4gICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgfV0pO1xuICAgICAgICAgPC9zY3JpcHQ+XG4gICAgICAgICA8Zm9ybSBuYW1lPVwibXlGb3JtXCIgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgIDxsYWJlbD5WYWx1ZTE6XG4gICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJjaGVja2JveFwiIG5nLW1vZGVsPVwiY2hlY2tib3hNb2RlbC52YWx1ZTFcIj5cbiAgICAgICAgICAgPC9sYWJlbD48YnIvPlxuICAgICAgICAgICA8bGFiZWw+VmFsdWUyOlxuICAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBuZy1tb2RlbD1cImNoZWNrYm94TW9kZWwudmFsdWUyXCJcbiAgICAgICAgICAgICAgICAgICAgbmctdHJ1ZS12YWx1ZT1cIidZRVMnXCIgbmctZmFsc2UtdmFsdWU9XCInTk8nXCI+XG4gICAgICAgICAgICA8L2xhYmVsPjxici8+XG4gICAgICAgICAgIDx0dD52YWx1ZTEgPSB7e2NoZWNrYm94TW9kZWwudmFsdWUxfX08L3R0Pjxici8+XG4gICAgICAgICAgIDx0dD52YWx1ZTIgPSB7e2NoZWNrYm94TW9kZWwudmFsdWUyfX08L3R0Pjxici8+XG4gIC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Vtb3ZlKSB7XG4gKiAgICAgdmFyIGluZGV4ID0gdGhpcy5jb250YWN0cy5pbmRleE9mKGNvbnRhY3RUb1JlbW92ZSk7XG4gKiAgICAgIHRoaXMuY29udGFjdHMuc3BsaWNlKGluZGV4LCAxKTtcbiAqICAgIH07XG4gKlxuICogICAgU2V0dGluZ3NDb250cm9sbGVyMS5wcm90b3R5cGUuY2xlYXJDb250YWN0ID0gZnVuY3Rpb24oY29udGFjdCkge1xuICogICAgICBjb250YWN0LnR5cGUgPSAncGhvbmUnO1xuICogICAgICBjb250YWN0LnZhbHVlID0gJyc7XG4gKiAgICB9O1xuICogICA8L2ZpbGU+XG4gKiAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAqICAgICBpdCgnc2hvdWxkIGNoZWNrIGNvbnRyb2xsZXIgYXMnLCBmdW5jdGlvbigpIHtcbiAqICAgICAgIHZhciBjb250YWluZXIgPSBlbGVtZW50KGJ5LmlkKCdjdHJsLWFzLWV4bXBsJykpO1xuICogICAgICAgICBleHBlY3QoY29udGFpbmVyLmVsZW1lbnQoYnkubW9kZWwoJ3NldHRpbmdzLm5hbWUnKSlcbiAqICAgICAgICAgICAuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKS50b0JlKCdKb2huIFNtaXRoJyk7XG4gKlxuICogICAgICAgdmFyIGZpcnN0UmVwZWF0ID1cbiAqICAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBzZXR0aW5ncy5jb250YWN0cycpLnJvdygwKSk7XG4gKiAgICAgICB2YXIgc2Vjb25kUmVwZWF0ID1cbiAqICAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBzZXR0aW5ncy5jb250YWN0cycpLnJvdygxKSk7XG4gKlxuICogICAgICAgZXhwZWN0KGZpcnN0UmVwZWF0LmVsZW1lbnQoYnkubW9kZWw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2NvcGUuY2xlYXJDb250YWN0ID0gZnVuY3Rpb24oY29udGFjdCkge1xuICogICAgICAgY29udGFjdC50eXBlID0gJ3Bob25lJztcbiAqICAgICAgIGNvbnRhY3QudmFsdWUgPSAnJztcbiAqICAgICB9O1xuICogICB9XG4gKiAgPC9maWxlPlxuICogIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAqICAgIGl0KCdzaG91bGQgY2hlY2sgY29udHJvbGxlcicsIGZ1bmN0aW9uKCkge1xuICogICAgICB2YXIgY29udGFpbmVyID0gZWxlbWVudChieS5pZCgnY3RybC1leG1wbCcpKTtcbiAqXG4gKiAgICAgIGV4cGVjdChjb250YWluZXIuZWxlbWVudChieS5tb2RlbCgnbmFtZScpKVxuICogICAgICAgICAgLmdldEF0dHJpYnV0ZSgndmFsdWUnKSkudG9CZSgnSm9obiBTbWl0aCcpO1xuICpcbiAqICAgICAgdmFyIGZpcnN0UmVwZWF0ID1cbiAqICAgICAgICAgIGNvbnRhaW5lci5lbGVtZW50KGJ5LnJlcGVhdGVyKCdjb250YWN0IGluIGNvbnRhY3RzJykucm93KDApKTtcbiAqICAgICAgdmFyIHNlY29uZFJlcGVhdCA9XG4gKiAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBjb250YWN0cycpLnJvdygxKSk7XG4gKlxuICogICAgICBleHBlY3QoZmlyc3RSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpXG4gKiAgICAgICAgICAudG9CZSgnNDA4IDU1NSAxMjEyJyk7XG4gKiAgICAgIGV4cGVjdChzZWNvbmRSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpXG4gKiAgICAgICAgICAudG9CZSgnam9obi5zbWl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BlO1xuICAgICAgICAgICAgICAgIGNsb25lW2Nsb25lLmxlbmd0aCsrXSA9ICRjb21waWxlLiQkY3JlYXRlQ29tbWVudCgnZW5kIG5nSWYnLCAkYXR0ci5uZ0lmKTtcbiAgICAgICAgICAgICAgICAvLyBOb3RlOiBXZSBvbmx5IG5lZWQgdGhlIGZpcnN0L2xhc3Qgbm9kZSBvZiB0aGUgY2xvbmVkIG5vZGVzLlxuICAgICAgICAgICAgICAgIC8vIEhvd2V2ZXIsIHdlIG5lZWQgdG8ga2VlcCB0aGUgcmVmZXJlbmNlIHRvIHRoZSBqcWxpdGUgd3JhcHBlciBhcyBpdCBtaWdodCBiZSBjaGFuZ2VkIGxhdGVyXG4gICAgICAgICAgICAgICAgLy8gYnkgYSBkaXJlY3RpdmUgd2l0aCB0ZW1wbGF0ZVVybCB3aGVuIGl0cyB0ZW1wbGF0ZSBhcnJpdmVzLlxuICAgICAgICAgICAgICAgIGJsb2NrID0ge1xuICAgICAgICAgICAgICAgICAgY2xvbmU6IGNsb25lXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgJGVsZW1lbnQucGFyZW50KCksICRlbGVtZW50KTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChwcmV2aW91c0VsZW1lbnRzKSB7XG4gICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMucmVtb3ZlKCk7XG4gICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNoaWxkU2NvcGUpIHtcbiAgICAgICAgICAgICAgY2hpbGRTY29wZS4kZGVzdHJveSgpO1xuICAgICAgICAgICAgICBjaGlsZFNjb3BlID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChibG9jaykge1xuICAgIC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ICAgIHByaW9yaXR5OiA0MDAsXG4gICAgdGVybWluYWw6IHRydWUsXG4gICAgdHJhbnNjbHVkZTogJ2VsZW1lbnQnLFxuICAgIGNvbnRyb2xsZXI6IGFuZ3VsYXIubm9vcCxcbiAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50LCBhdHRyKSB7XG4gICAgICB2YXIgc3JjRXhwID0gYXR0ci5uZ0luY2x1ZGUgfHwgYXR0ci5zcmMsXG4gICAgICAgICAgb25sb2FkRXhwID0gYXR0ci5vbmxvYWQgfHwgJycsXG4gICAgICAgICAgYXV0b1Njcm9sbEV4cCA9IGF0dHIuYXV0b3Njcm9sbDtcblxuICAgICAgcmV0dXJuIGZ1bmN0aW9uKHNjb3BlLCAkZWxlbWVudCwgJGF0dHIsIGN0cmwsICR0cmFuc2NsdWRlKSB7XG4gICAgICAgIHZhciBjaGFuZ2VDb3VudGVyID0gMCxcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSxcbiAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudCxcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50O1xuXG4gICAgICAgIHZhciBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgaWYgKHByZXZpb3VzRWxlbWVudCkge1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50LnJlbW92ZSgpO1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGN1cnJlbnRTY29wZSkge1xuICAgICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAgICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KS5kb25lKGZ1bmN0aW9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AgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgbnVsbCwgJGVsZW1lbnQpLmRvbmUoYWZ0ZXJBbmltYXRpb24pO1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBuZXdTY29wZTtcbiAgICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBjbG9uZTtcblxuICAgICAgICAgICAgICBjdXJyZW50U2NvcGUuJGVtaXQoJyRpbmNsdWRlQ29udGVudExvYWRlZCcsIHNyYyk7XG4gICAgICAgICAgICAgIHNjb3BlLiRldmFsKG9ubG9hZEV4cCk7XG4gICAgICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgaWYgKHNjb3BlLiQkZGVzdHJveWVkKSByZXR1cm47XG5cbiAgICAgICAgICAgICAgaWYgKHRoaXNDaGFuZ2VJZCA9PT0gY2hhbmdlQ291bnRlcikge1xuICAgICAgICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTtcbiAgICAgICAgICAgICAgICBzY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50RXJyb3InLCBzcmMpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHNjb3BlLiRlbWl0KCckaW5jbHVkZUNvbnRlbnRSZXF1ZXN0ZWQnLCBzcmMpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50KCk7XG4gICAgICAgICAgICBjdHJsLnRlbXBsYXRlID0gbnVsbDtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfTtcbiAgICB9XG4gIH07XG59XTtcblxuLy8gVGhpcyBkaXJlY3RpdmUgaXMgY2FsbGVkIGR1cmluZyB0aGUgJHRyYW5zY2x1ZGUgY2FsbCBvZiB0aGUgZmlyc3QgYG5nSW5jbHVkZWAgZGlyZWN0aXZlLlxuLy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ZSB8fCAnJykpO1xuICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgY2hhbmdlIGV2ZW50cyB0byBlbmFibGUgYmluZGluZ1xuICAgICAgICAgICAgICBlbGVtZW50Lm9uKCdibHVyIGtleXVwIGNoYW5nZScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHNjb3BlLiRldmFsQXN5bmMocmVhZCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICByZWFkKCk7IC8vIGluaXRpYWxpemVcblxuICAgICAgICAgICAgICAvLyBXcml0ZSBkYXRhIHRvIHRoZSBtb2RlbFxuICAgICAgICAgICAgICBmdW5jdGlvbiByZWFkKCkge1xuICAgICAgICAgICAgICAgIHZhciBodG1sID0gZWxlbWVudC5odG1sKCk7XG4gICAgICAgICAgICAgICAgLy8gV2hlbiB3ZSBjbGVhciB0aGUgY29udGVudCBlZGl0YWJsZSB0aGUgYnJvd3NlciBsZWF2ZXMgYSA8YnI+IGJlaGluZFxuICAgICAgICAgICAgICAgIC8vIElmIHN0cmlwLWJyIGF0dHJpYnV0ZSBpcyBwcm92aWRlZCB0aGVuIHdlIHN0cmlwIHRoaXMgb3V0XG4gICAgICAgICAgICAgICAgaWYgKGF0dHJzLnN0cmlwQnIgJiYgaHRtbCA9PT0gJzxicj4nKSB7XG4gICAgICAgICAgICAgICAgICBodG1sID0gJyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG5nTW9kZWwuJHNldFZpZXdWYWx1ZShodG1sKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH07XG4gICAgICAgIH1dKTtcbiAgICA8L2ZpbGU+XG4gICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgIDxmb3JtIG5hbWU9XCJteUZvcm1cIj5cbiAgICAgICA8ZGl2IGNvbnRlbnRlZGl0YWJsZVxuICAgICAgICAgICAg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bigpIHtcbiAgICAgICAgICAgICAgbmdNb2RlbCA9ICRlbGVtZW50LmZpbmQoJ2lucHV0JykuY29udHJvbGxlcignbmdNb2RlbCcpO1xuXG4gICAgICAgICAgICAgIG5nTW9kZWwuJGZvcm1hdHRlcnMucHVzaChmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAodmFsdWUgJiYgdmFsdWUubmFtZSkgfHwgdmFsdWU7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIG5nTW9kZWwuJHBhcnNlcnMucHVzaChmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgICAgIHZhciBtYXRjaCA9IHZhbHVlO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhhdC5pdGVtcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgaWYgKHRoYXQuaXRlbXNbaV0ubmFtZSA9PT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2ggPSB0aGF0Lml0ZW1zW2ldO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbWF0Y2g7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdGhhdC5zZWxlY3RJdGVtID0gZnVuY3Rpb24oaXRlbSkge1xuICAgICAgICAgICAgICBuZ01vZGVsLiRzZXRWaWV3VmFsdWUoaXRlbSk7XG4gICAgICAgICAgICAgIG5nTW9kZWwuJHByb2Nlc3NNb2RlbFZhbHVlKCk7XG4gICAgICAgICAgICAgIHRoYXQub25TZWxlY3Qoe2l0ZW06IGl0ZW19KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwiYXV0b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ICAgICAgICAgICAgICAgIG5nLW1vZGVsPVwidXNlci5uYW1lXCJcbiAgICAgICAgICAgICAgICAgICAgbmctbW9kZWwtb3B0aW9ucz1cInsgZ2V0dGVyU2V0dGVyOiB0cnVlIH1cIiAvPlxuICAgICAgICAgICA8L2xhYmVsPlxuICAgICAgICAgPC9mb3JtPlxuICAgICAgICAgPHByZT51c2VyLm5hbWUgPSA8c3BhbiBuZy1iaW5kPVwidXNlci5uYW1lKClcIj48L3NwYW4+PC9wcmU+XG4gICAgICAgPC9kaXY+XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cImFwcC5qc1wiPlxuICAgICAgIGFuZ3VsYXIubW9kdWxlKCdnZXR0ZXJTZXR0ZXJFeGFtcGxlJywgW10pXG4gICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICB2YXIgX25hbWUgPSAnQnJpYW4nO1xuICAgICAgICAgICAkc2NvcGUudXNlciA9IHtcbiAgICAgICAgICAgICBuYW1lOiBmdW5jdGlvbihuZXdOYW1lKSB7XG4gICAgICAgICAgICAgIC8vIE5vdGUgdGhhdCBuZXdOYW1lIGNhbiBiZSB1bmRlZmluZWQgZm9yIHR3byByZWFzb25zOlxuICAgICAgICAgICAgICAvLyAxLiBCZWNhdXNlIGl0IGlzIGNhbGxlZCBhcyBhIGdldHRlciBhbmQgdGh1cyBjYWxsZWQgd2l0aCBubyBhcmd1bWVudHNcbiAgICAgICAgICAgICAgLy8gMi4gQmVjYXVzZSB0aGUgcHJvcGVydHkgc2hvdWxkIGFjdHVhbGx5IGJlIHNldCB0byB1bmRlZmluZWQuIFRoaXMgaGFwcGVucyBlLmcuIGlmIHRoZVxuICAgICAgICAgICAgICAvLyAgICBpbnB1dCBpcyBpbnZhbGlkXG4gICAgICAgICAgICAgIHJldHVybiBhcmd1bWVudHMubGVuZ3RoID8gKF9uYW1l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XRlT246ICdkZWZhdWx0IGJsdXIgY2xpY2snLFxuICAgICAgICAgICAgICBkZWJvdW5jZToge1xuICAgICAgICAgICAgICAgIGRlZmF1bHQ6IDIwMDAsXG4gICAgICAgICAgICAgICAgYmx1cjogMCxcbiAgICAgICAgICAgICAgICAnKic6IDEwMDBcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdGhpcy51cGRhdGVFdmVudHMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIGV2ZW50TGlzdCA9IHRoaXMub3B0aW9ucy51cGRhdGVPbi5zcGxpdCgnICcpO1xuICAgICAgICAgICAgICBldmVudExpc3QucHVzaCgnKicpO1xuICAgICAgICAgICAgICB2YXIgZXZlbnRzID0ge307XG5cbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBldmVudExpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBldmVudHNbZXZlbnRMaXN0W2ldXSA9IHRoaXMub3B0aW9ucy5kZWJvdW5jZVtldmVudExpc3RbaV1dO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdGhpcy5ldmVudHMgPSBldmVudHM7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB0aGlzLnVwZGF0ZU9wdGlvbnMgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh0aGlzLm9wdGlvbnMsIHtcbiAgICAgICAgICAgICAgICB1cGRhdGVPbjogT2JqZWN0LmtleXModGhpcy5ldmVudHMpLmpvaW4oJyAnKS5yZXBsYWNlKCcqJywgJycpLFxuICAgICAgICAgICAgICAgIGRlYm91bmNlOiB0aGlzLmV2ZW50c1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICB0aGlzLmZvcm0uaW5wdXQuJG92ZXJyaWRlTW9kZWxPcHRpb25zKG9wdGlvbn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Y29tcG9uZW50KCd0aW1lRXhhbXBsZScsIHtcbiAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGltZUV4YW1wbGUuaHRtbCcsXG4gICAgICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdGhpcy50aW1lID0gbmV3IERhdGUoMTk3MCwgMCwgMSwgMTQsIDU3LCAwKTtcblxuICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgdGltZVNlY29uZHNGb3JtYXQ6ICdzcycsXG4gICAgICAgICAgICAgICAgdGltZVN0cmlwWmVyb1NlY29uZHM6IHRydWVcbiAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICB0aGlzLm9wdGlvbkNoYW5nZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgIHRoaXMudGltZUZvcm0udGltZUZvcm1hdHRlZC4kb3ZlcnJpZGVNb2RlbE9wdGlvbnModGhpcy5vcHRpb25zKTtcbiAgICAgICAgICAgICAgICB0aGlzLnRpbWUgPSBuZXcgRGF0ZSh0aGlzLnRpbWUpO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICA8L2ZpbGU+XG4gICAgIDxmaWxlIG5hbWU9XCJ0aW1lRXhhbXBsZS5odG1sXCI+XG4gICAgICAgPGZvcm0gbmFtZT1cIiRjdHJsLnRpbWVGb3JtXCI+XG4gICAgICAgICA8c3Ryb25nPkRlZmF1bHQ8L3N0cm9uZz46XG4gICAgICAgICA8aW5wdXQgdHlwZT1cInRpbWVcIiBuZy1tb2RlbD1cIiRjdHJsLnRpbWVcIiBzdGVwPVwiYW55XCIgLz48YnI+XG4gICAgICAgICA8c3Ryb25nPldpdGggb3B0aW9uczwvc3Ryb25nPjpcbiAgICAgICAgIDxpbnB1dCB0eXBlPVwidGltZVwiIG5hbWU9XCJ0aW1lRm9ybWF0dGVkXCIgbmctbW9kZWw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G5vdEFuT3B0aW9uOiBmYWxzZX1cbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICAkc2NvcGUubXlDb2xvciA9ICRzY29wZS5jb2xvcnNbMl07IC8vIHJlZFxuICAgICAgICAgIH1dKTtcbiAgICAgICAgPC9zY3JpcHQ+XG4gICAgICAgIDxkaXYgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgPHVsPlxuICAgICAgICAgICAgPGxpIG5nLXJlcGVhdD1cImNvbG9yIGluIGNvbG9yc1wiPlxuICAgICAgICAgICAgICA8bGFiZWw+TmFtZTogPGlucHV0IG5nLW1vZGVsPVwiY29sb3IubmFtZVwiPjwvbGFiZWw+XG4gICAgICAgICAgICAgIDxsYWJlbD48aW5wdXQgdHlwZT1cImNoZWNrYm94XCIgbmctbW9kZWw9XCJjb2xvci5ub3RBbk9wdGlvblwiPiBEaXNhYmxlZD88L2xhYmVsPlxuICAgICAgICAgICAgICA8YnV0dG9uIG5nLWNsaWNrPVwiY29sb3JzLnNwbGljZSgkaW5kZXgsIDEpXCIgYXJpYS1sYWJlbD1cIlJlbW92ZVwiPlg8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvbGk+XG4gICAgICAgICAgICA8bGk+XG4gICAgICAgICAgICAgIDxidXR0b24gbmctY2xpY2s9XCJjb2xvcnMucHVzaCh7fSlcIj5hZGQ8L2J1dHRvbj5cbiAgICAgICAgICAgIDwvbGk+XG4gICAgICAgICAgPC91bD5cbiAgICAgICAgICA8aHIvPlxuICAgICAgICAgIDxsYWJlbD5Db2xvciAobnVsbCBub3QgYWxsb3dlZCk6XG4gICAgICAgICAgICA8c2VsZWN0IG5nLW1vZGVsPVwibXlDb2xvclwiIG5nLW9wdGlvbnM9XCJjb2xvci5uYW1lIGZvciBjb2xvciBpbiBjb2xvcnNcIj48L3NlbGVjdD5cbiAgICAgICAgICA8L2xhYmVsPjxici8+XG4gICAgICAgICAgPGxhYmVsPkNvbG9yIChudW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gIDxuZy1wbHVyYWxpemUgY291bnQ9XCJwZXJzb25Db3VudFwiXG4gICAgICAgICAgICAgICAgICAgICAgICB3aGVuPVwieycwJzogJ05vYm9keSBpcyB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ29uZSc6ICcxIHBlcnNvbiBpcyB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ290aGVyJzogJ3t9IHBlb3BsZSBhcmUgdmlld2luZy4nfVwiPlxuICAgICAgICAgIDwvbmctcGx1cmFsaXplPjxicj5cblxuICAgICAgICAgIDwhLS0tIEV4YW1wbGUgd2l0aCBvZmZzZXQgLS0tPlxuICAgICAgICAgIFdpdGggT2Zmc2V0KDIpOlxuICAgICAgICAgIDxuZy1wbHVyYWxpemUgY291bnQ9XCJwZXJzb25Db3VudFwiIG9mZnNldD0yXG4gICAgICAgICAgICAgICAgICAgICAgICB3aGVuPVwieycwJzogJ05vYm9keSBpcyB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJzEnOiAne3twZXJzb24xfX0gaXMgdmlld2luZy4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcyJzogJ3t7cGVyc29uMX19IGFuZCB7e3BlcnNvbjJ9fSBhcmUgdmlld2luZy4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvbmUnOiAne3twZXJzb24xfX0sIHt7cGVyc29uMn19IGFuZCBvbmUgb3RoZXIgcGVyc29uIGFyZSB2aWV3aW5nLicsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ290aGVyJzogJ3t7cGVyc29uMX19LCB7e3BlcnNvbjJ9fSBhbmQge30gb3RoZXIgcGVvcGxlIGFyZSB2aWV3aW5nLid9XCI+XG4gICAgICAgICAgPC9uZy1wbHVyYWxpemU+XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9maWxlPlxuICAgICAgPGZpbGUgbmFtZT1cInByb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ICAgICA8ZGl2Pm91dGVyVG9nZ2xlLmlzT3BlbigpOiB7eyRjdHJsLm91dGVyVG9nZ2xlLmlzT3BlbigpIHwganNvbn19PC9kaXY+XG4gKiAgICAgPC9kaXY+XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cInN0eWxlcy5jc3NcIj5cbiAqICAgICB1bCB7XG4gKiAgICAgICBsaXN0LXN0eWxlOiBub25lO1xuICogICAgICAgcGFkZGluZy1sZWZ0OiAwO1xuICogICAgIH1cbiAqXG4gKiAgICAgbGlbbmctcmVwZWF0XSB7XG4gKiAgICAgICBiYWNrZ3JvdW5kOiBsaWdodGdyZWVuO1xuICogICAgICAgcGFkZGluZzogOHB4O1xuICogICAgICAgbWFyZ2luOiA4cHg7XG4gKiAgICAgfVxuICpcbiAqICAgICBbbmctaWZdIHtcbiAqICAgICAgIGJhY2tncm91bmQ6IGxpZ2h0Z3JleTtcbiAqICAgICAgIHBhZGRpbmc6IDhweDtcbiAqICAgICB9XG4gKlxuICogICAgIG15LXJvb3Qge1xuICogICAgICAgYmFja2dyb3VuZDogbGlnaHRnb2xkZW5yb2R5ZWxsb3c7XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKlxuICogICAgIG15LXdyYXBwZXIge1xuICogICAgICAgYmFja2dyb3VuZDogbGlnaHRzYWxtb247XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKlxuICogICAgIG15LXRvZ2dsZSB7XG4gKiAgICAgICBiYWNrZ3JvdW5kOiBsaWdodGJsdWU7XG4gKiAgICAgICBwYWRkaW5nOiA4cHg7XG4gKiAgICAgICBkaXNwbGF5OiBibG9jaztcbiAqICAgICB9XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJ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GluZyBhbmltYXRpb24sIG1hcmsgaXQgYXMgZGVsZXRlZFxuICAgICAgICAgICAgICAvLyBzbyB0aGF0IHdlIGNhbiBpZ25vcmUgaXQgbGF0ZXJcbiAgICAgICAgICAgICAgZm9yIChpbmRleCA9IDAsIGxlbmd0aCA9IGVsZW1lbnRzVG9SZW1vdmUubGVuZ3RoOyBpbmRleCA8IGxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAgICAgIGVsZW1lbnRzVG9SZW1vdmVbaW5kZXhdW05HX1JFTU9WRURdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYmxvY2suc2NvcGUuJGRlc3Ryb3koKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyB3ZSBhcmUgbm90IHVzaW5nIGZvckVhY2ggZm9yIHBlcmYgcmVhc29ucyAodHJ5aW5nIHRvIGF2b2lkICNjYWxsKVxuICAgICAgICAgIGZvciAoaW5kZXggPSAwOyBpbmRleCA8IGNvbGxlY3Rpb25MZW5ndGg7IGluZGV4KyspIHtcbiAgICAgICAgICAgIGtleSA9IChjb2xsZWN0aW9uID09PSBjb2xsZWN0aW9uS2V5cykgPyBpbmRleCA6IGNvbGxlY3Rpb25LZXlzW2luZGV4XTtcbiAgICAgICAgICAgIHZhbHVlID0gY29sbGVjdGlvbltrZXldO1xuICAgICAgICAgICAgYmxvY2sgPSBuZXh0QmxvY2tPcmRlcltpbmRleF07XG5cbiAgICAgICAgICAgIGlmIChibG9jay5zY29wZSkge1xuICAgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIGFscmVhZHkgc2VlbiB0aGlzIG9iamVjdCwgdGhlbiB3ZSBuZWVkIHRvIHJldXNlIHRoZVxuICAgICAgICAgICAgICAvLyBhc3NvY2lhdGVkIHNjb3BlL2VsZW1lbnRcblxuICAgICAgICAgICAgICBuZXh0Tm9kZSA9IHByZXZpb3VzTm9kZTtcblxuICAgICAgICAgICAgICAvLyBza2lwIG5vZGVzIHRoYXQgYXJlIGFscmVhZHkgcGVuZGluZyByZW1vdmFsIHZpYSBsZWF2ZSBhbmltYXRpb25cbiAgICAgICAgICAgICAgZG8ge1xuICAgICAgICAgICAgICAgIG5leHROb2RlID0gbmV4dE5vZGUubmV4dFNpYmxpbmc7XG4gICAgICAgICAgICAgIH0gd2hpbGUgKG5leHROb2RlICYmIG5leHROb2RlW05HX1JFTU9WRURdKTtcblxuICAgICAgICAgICAgICBpZiAoZ2V0QmxvY2tTdGFydChibG9jaykgIT09IG5leHROb2RlKSB7XG4gICAgICAgICAgICAgICAgLy8gZXhpc3RpbmcgaXRlbSB3aGljaCBnb3QgbW92ZWRcbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5tb3ZlKGdldEJsb2NrTm9kZXMoYmxvY2suY2xvbmUpLCBudWxsLCBwcmV2aW91c05vZGUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHByZXZpb3VzTm9kZSA9IGdldEJsb2NrRW5kKGJsb2NrKTtcbiAgICAgICAgICAgICAgdXBkYXRlU2NvcGUoYmxvY2suc2NvcGUsIGluZGV4LCB2YWx1ZUlkZW50aWZpZXIsIHZhbHVlLCBrZXlJZGVudGlmaWVyLCBrZXksIGNvbGxlY3Rpb25MZW5ndGgpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgLy8gbmV3IGl0ZW0gd2hpY2ggd2UgZG9uJ3Qga25vdyBhYm91dFxuICAgICAgICAgICAgICAkdHJhbnNjbHVkZShmdW5jdGlvbiBuZ1JlcGVhdFRyYW5zY2x1ZGUoY2xvbmUsIHNjb3BlKSB7XG4gICAgICAgICAgICAgICAgYmxvY2suc2NvcGUgPSBzY29wZTtcbiAgICAgICAgICAgICAgICAvLyBodHRwOi8vanNwZXJmLmNvbS9jbG9uZS12cy1jcmVhdGVjb21tZW50XG4gICAgICAgICAgICAgICAgdmFyIGVuZE5vZGUgPSBuZ1JlcGVhdEVuZENv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ZGVFeGFtcGxlXCI+XG4gKiAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gKiAgICAgPHNjcmlwdD5cbiAqICAgICAgIGFuZ3VsYXIubW9kdWxlKCd0cmFuc2NsdWRlRXhhbXBsZScsIFtdKVxuICogICAgICAgIC5kaXJlY3RpdmUoJ3BhbmUnLCBmdW5jdGlvbigpe1xuICogICAgICAgICAgIHJldHVybiB7XG4gKiAgICAgICAgICAgICByZXN0cmljdDogJ0UnLFxuICogICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSxcbiAqICAgICAgICAgICAgIHNjb3BlOiB7IHRpdGxlOidAJyB9LFxuICogICAgICAgICAgICAgdGVtcGxhdGU6ICc8ZGl2IHN0eWxlPVwiYm9yZGVyOiAxcHggc29saWQgYmxhY2s7XCI+JyArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAnPGRpdiBzdHlsZT1cImJhY2tncm91bmQtY29sb3I6IGdyYXlcIj57e3RpdGxlfX08L2Rpdj4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICc8bmctdHJhbnNjbHVkZT48L25nLXRyYW5zY2x1ZGU+JyArXG4gKiAgICAgICAgICAgICAgICAgICAgICAgJzwvZGl2PidcbiAqICAgICAgICAgICB9O1xuICogICAgICAgfSlcbiAqICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gKiAgICAgICAgICRzY29wZS50aXRsZSA9ICdMb3JlbSBJcHN1bSc7XG4gKiAgICAgICAgICRzY29wZS50ZXh0ID0gJ05lcXVlIHBvcnJvIHF1aXNxdWFtIGVzdCBxdWkgZG9sb3JlbSBpcHN1bSBxdWlhIGRvbG9yLi4uJztcbiAqICAgICAgIH1dKTtcbiAqICAgICA8L3NjcmlwdD5cbiAqICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9XCJFeGFtcGxlQ29udHJvbGxlclwi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cmUoKSB0aGlzIGZpbGUgaW4gYSBDb21tb25KUyBlbnZpcm9ubWVudC5cbnJlcXVpcmUoJy4uLy4uL2pzL3RyYW5zaXRpb24uanMnKVxucmVxdWlyZSgnLi4vLi4vanMvYWxlcnQuanMnKVxucmVxdWlyZSgnLi4vLi4vanMvYnV0dG9uLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2Nhcm91c2VsLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2NvbGxhcHNlLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2Ryb3Bkb3duLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL21vZGFsLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL3Rvb2x0aXAuanMnKVxucmVxdWlyZSgnLi4vLi4vanMvcG9wb3Zlci5qcycpXG5yZXF1aXJlKCcuLi8uLi9qcy9zY3JvbGxzcHkuanMnKVxucmVxdWlyZSgnLi4vLi4vanMvdGFiLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2FmZml4LmpzJykiLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWZmaXguanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWZmaXhcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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0cnVjdG9yID0gQWZmaXhcblxuXG4gIC8vIEFGRklYIE5PIENPTkZMSUNUXG4gIC8vID09PT09PT09PT09PT09PT09XG5cbiAgJC5mbi5hZmZpeC5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICQuZm4uYWZmaXggPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cblxuICAvLyBBRkZJWCBEQVRBLUFQSVxuICAvLyA9PT09PT09PT09PT09PVxuXG4gICQod2luZG93KS5vbignbG9hZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAkKCdbZGF0YS1zcHk9XCJhZmZpeFwiXScpLmVhY2goZnVuY3Rpb24gKCkge1xuICAgICAgdmFyICRzcHkgPSAkKHRoaXMpXG4gICAgICB2YXIgZGF0YSA9ICRzcHkuZGF0YSgpXG5cbiAgICAgIGRhdGEub2Zmc2V0ID0gZGF0YS5vZmZzZXQgfHwge31cblxuICAgICAgaWYgKGRhdGEub2Zmc2V0Qm90dG9tICE9IG51bGwpIGRhdGEub2Zmc2V0LmJvdHRvbSA9IGRhdGEub2Zmc2V0Qm90dG9tXG4gICAgICBpZiAoZGF0YS5vZmZzZXRUb3AgICAgIT0gbnVsbCkgZGF0YS5vZmZzZXQudG9wICAgID0gZGF0YS5vZmZzZXRUb3BcblxuICAgICAgUGx1Z2luLmNhbGwoJHNweSwgZGF0YSlcbiAgICB9KVxuICB9KVxuXG59KGpRdWVyeSk7XG4iLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWxlcnQuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWxlcnRzXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHl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KCdicy5hbGVydCcpXG5cbiAgICAgIGlmICghZGF0YSkgJHRoaXMuZGF0YSgnYnMuYWxlcnQnLCAoZGF0YSA9IG5ldyBBbGVydCh0aGlzKSkpXG4gICAgICBpZiAodHlwZW9mIG9wdGlvbiA9PSAnc3RyaW5nJykgZGF0YVtvcHRpb25dLmNhbGwoJHRoaXMpXG4gICAgfSlcbiAgfVxuXG4gIHZhciBvbGQgPSAkLmZuLmFsZXJ0XG5cbiAgJC5mbi5hbGVydCAgICAgICAgICAgICA9IFBsdWdpblxuICAkLmZuLmFsZXJ0LkNvbnN0cnVjdG9yID0gQWxlcnRcblxuXG4gIC8vIEFMRVJUIE5PIENPTkZMSUNUXG4gIC8vID09PT09PT09PT09PT09PT09XG5cbiAgJC5mbi5hbGVydC5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICQuZm4uYWxlcnQgPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cblxuICAvLyBBTEVSVCBEQVRBLUFQSVxuICAvLyA9PT09PT09PT09PT09PVxuXG4gICQoZG9jdW1lbnQpLm9uKCdjbGljay5icy5hbGVydC5kYXRhLWFwaScsIGRpc21pc3MsIEFsZXJ0LnByb3RvdHlwZS5jbG9zZSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGJ1dHRvbi5qcyB2My40LjFcbiAqIGh0dHBzOi8vZ2V0Ym9vdHN0cmFwLmNvbS9kb2NzLzMuNC9qYXZhc2NyaXB0LyNidXR0b25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdG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dGhlIGZvY3VzXG4gICAgICAgIGlmICgkYnRuLmlzKCdpbnB1dCxidXR0b24nKSkgJGJ0bi50cmlnZ2VyKCdmb2N1cycpXG4gICAgICAgIGVsc2UgJGJ0bi5maW5kKCdpbnB1dDp2aXNpYmxlLGJ1dHRvbjp2aXNpYmxlJykuZmlyc3QoKS50cmlnZ2VyKCdmb2N1cycpXG4gICAgICB9XG4gICAgfSlcbiAgICAub24oJ2ZvY3VzLmJzLmJ1dHRvbi5kYXRhLWFwaSBibHVyLmJzLmJ1dHRvbi5kYXRhLWFwaScsICdbZGF0YS10b2dnbGVePVwiYnV0dG9uXCJdJywgZnVuY3Rpb24gKGUpIHtcbiAgICAgICQoZS50YXJnZXQpLmNsb3Nlc3QoJy5idG4nKS50b2dnbGVDbGFzcygnZm9jdXMnLCAvXmZvY3VzKGluKT8kLy50ZXN0KGUudHlwZSkpXG4gICAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNhcm91c2VsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2Nhcm91c2VsXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7X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c2VcblxuICAgIFBsdWdpbi5jYWxsKCR0YXJnZXQsIG9wdGlvbnMpXG5cbiAgICBpZiAoc2xpZGVJbmRleCkge1xuICAgICAgJHRhcmdldC5kYXRhKCdicy5jYXJvdXNlbCcpLnRvKHNsaWRlSW5kZXgpXG4gICAgfVxuXG4gICAgZS5wcmV2ZW50RGVmYXVsdCgpXG4gIH1cblxuICAkKGRvY3VtZW50KVxuICAgIC5vbignY2xpY2suYnMuY2Fyb3VzZWwuZGF0YS1hcGknLCAnW2RhdGEtc2xpZGVdJywgY2xpY2tIYW5kbGVyKVxuICAgIC5vbignY2xpY2suYnMuY2Fyb3VzZWwuZGF0YS1hcGknLCAnW2RhdGEtc2xpZGUtdG9dJywgY2xpY2tIYW5kbGVyKVxuXG4gICQod2luZG93KS5vbignbG9hZCcsIGZ1bmN0aW9uICgpIHtcbiAgICAkKCdbZGF0YS1yaWRlPVwiY2Fyb3VzZWxcIl0nKS5lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgIHZhciAkY2Fyb3VzZWwgPSAkKHRoaXMpXG4gICAgICBQbHVnaW4uY2FsbCgkY2Fyb3VzZWwsICRjYXJvdXNlbC5kYXRhKCkpXG4gICAgfSlcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNvbGxhcHNlLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2NvbGxhcHNlXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy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R0aGlzKVxuICAgIHZhciBkYXRhICAgID0gJHRhcmdldC5kYXRhKCdicy5jb2xsYXBzZScpXG4gICAgdmFyIG9wdGlvbiAgPSBkYXRhID8gJ3RvZ2dsZScgOiAkdGhpcy5kYXRhKClcblxuICAgIFBsdWdpbi5jYWxsKCR0YXJnZXQsIG9wdGlvbilcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGRyb3Bkb3duLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2Ryb3Bkb3duc1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIERST1BET1dOIENMQVNTIERFRklOSVRJT05cbiAgLy8gPT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBiYWNrZHJvcCA9ICcuZHJvcGRvd24tYmFja2Ryb3AnXG4gIHZhciB0b2dnbGUgICA9ICdbZGF0YS10b2dnbGU9XCJkcm9wZG93blwiXSdcbiAgdmFyIERyb3Bkb3duID0gZnVuY3Rpb24gKGVsZW1lbnQpIHtcbiAgICAkKGVsZW1lbnQpLm9uKCdj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3R5cGUua2V5ZG93bilcbiAgICAub24oJ2tleWRvd24uYnMuZHJvcGRvd24uZGF0YS1hcGknLCAnLmRyb3Bkb3duLW1lbnUnLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bilcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IG1vZGFsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI21vZGFsc1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIE1PREFMIENMQVNTIERFRklOSVRJT05cbiAgLy8gPT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBNb2RhbCA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgdGhpcy5vcHRpb25zID0gb3B0aW9uc1xuICAgIHRoaXMuJGJvZHkgPSAkKGRvY3VtZW50LmJvZHkpXG4gICAgdGhpcy4kZWxlbWVudCA9ICQoZWxlbWVudClcbiAgICB0aGlzLiRkaWFsb2cgPSB0aGlzLiRlbGVtZW50LmZpbmQoJy5tb2RhbC1kaWFsb2cnKVxuICAgIHRoaXM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KVxuXG4gICAgaWYgKCR0aGlzLmlzKCdhJykpIGUucHJldmVudERlZmF1bHQoKVxuXG4gICAgJHRhcmdldC5vbmUoJ3Nob3cuYnMubW9kYWwnLCBmdW5jdGlvbiAoc2hvd0V2ZW50KSB7XG4gICAgICBpZiAoc2hvd0V2ZW50LmlzRGVmYXVsdFByZXZlbnRlZCgpKSByZXR1cm4gLy8gb25seSByZWdpc3RlciBmb2N1cyByZXN0b3JlciBpZiBtb2RhbCB3aWxsIGFjdHVhbGx5IGdldCBzaG93blxuICAgICAgJHRhcmdldC5vbmUoJ2hpZGRlbi5icy5tb2RhbCcsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgJHRoaXMuaXMoJzp2aXNpYmxlJykgJiYgJHRoaXMudHJpZ2dlcignZm9jdXMnKVxuICAgICAgfSlcbiAgICB9KVxuICAgIFBsdWdpbi5jYWxsKCR0YXJnZXQsIG9wdGlvbiwgdGhpcylcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IHBvcG92ZXIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jcG9wb3ZlcnNcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cblxuK2Z1bm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cHRpb25zKSkpXG4gICAgICBpZiAodHlwZW9mIG9wdGlvbiA9PSAnc3RyaW5nJykgZGF0YVtvcHRpb25dKClcbiAgICB9KVxuICB9XG5cbiAgdmFyIG9sZCA9ICQuZm4uc2Nyb2xsc3B5XG5cbiAgJC5mbi5zY3JvbGxzcHkgICAgICAgICAgICAgPSBQbHVnaW5cbiAgJC5mbi5zY3JvbGxzcHkuQ29uc3RydWN0b3IgPSBTY3JvbGxTcHlcblxuXG4gIC8vIFNDUk9MTFNQWSBOTyBDT05GTElDVFxuICAvLyA9PT09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLnNjcm9sbHNweS5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICQuZm4uc2Nyb2xsc3B5ID0gb2xkXG4gICAgcmV0dXJuIHRoaXNcbiAgfVxuXG5cbiAgLy8gU0NST0xMU1BZIERBVEEtQVBJXG4gIC8vID09PT09PT09PT09PT09PT09PVxuXG4gICQod2luZG93KS5vbignbG9hZC5icy5zY3JvbGxzcHkuZGF0YS1hcGknLCBmdW5jdGlvbiAoKSB7XG4gICAgJCgnW2RhdGEtc3B5PVwic2Nyb2xsXCJdJykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgJHNweSA9ICQodGhpcylcbiAgICAgIFBsdWdpbi5jYWxsKCRzcHksICRzcHkuZGF0YSgpKVxuICAgIH0pXG4gIH0pXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0YWIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jdGFic1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaH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XG5cbiAgJC5mbi50YWIgICAgICAgICAgICAgPSBQbHVnaW5cbiAgJC5mbi50YWIuQ29uc3RydWN0b3IgPSBUYWJcblxuXG4gIC8vIFRBQiBOTyBDT05GTElDVFxuICAvLyA9PT09PT09PT09PT09PT1cblxuICAkLmZuLnRhYi5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICQuZm4udGFiID0gb2xkXG4gICAgcmV0dXJuIHRoaXNcbiAgfVxuXG5cbiAgLy8gVEFCIERBVEEtQVBJXG4gIC8vID09PT09PT09PT09PVxuXG4gIHZhciBjbGlja0hhbmRsZXIgPSBmdW5jdGlvbiAoZSkge1xuICAgIGUucHJldmVudERlZmF1bHQoKVxuICAgIFBsdWdpbi5jYWxsKCQodGhpcyksICdzaG93JylcbiAgfVxuXG4gICQoZG9jdW1lbnQpXG4gICAgLm9uKCdjbGljay5icy50YWIuZGF0YS1hcGknLCAnW2RhdGEtdG9nZ2xlPVwidGFiXCJdJywgY2xpY2tIYW5kbGVyKVxuICAgIC5vbignY2xpY2suYnMudGFiLmRhdGEtYXBpJywgJ1tkYXRhLXRvZ2dsZT1cInBpbGxcIl0nLCBjbGlja0hhbmRsZXIpXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0b29sdGlwLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3Rvb2x0aXBcbiAqIEluc3BpcmVkIGJ5IHRoZSBvcmlnaW5hbCBqUXVlcnkudGlwc3kgYnkgSmFzb24gRnJhbWVcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCB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gICA9IFBsdWdpblxuICAkLmZuLnRvb2x0aXAuQ29uc3RydWN0b3IgPSBUb29sdGlwXG5cblxuICAvLyBUT09MVElQIE5PIENPTkZMSUNUXG4gIC8vID09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLnRvb2x0aXAubm9Db25mbGljdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAkLmZuLnRvb2x0aXAgPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0cmFuc2l0aW9uLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3RyYW5zaXRpb25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQ1NTIFRSQU5TSVRJT04gU1VQUE9SVCAoU2hvdXRvdXQ6IGh0dHBzOi8vbW9kZXJuaXpyLmNvbS8pXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIGZ1bmN0aW9uIHRyYW5zaXRpb25FbmQoKSB7XG4gICAgdmFyIGVsID0g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GFyYW0gZm4gdGhlIGZ1bmN0aW9uIHRvIGN1cnJ5XHJcbiAgICogQHBhcmFtIGFyaXR5IHRoZSBsZW5ndGggb2YgdGhlIGZ1bmN0aW9uIHRvIGN1cnJ5IHVudGlsXHJcbiAgICogQHBhcmFtIGFyZ3MgdGhlIGV4aXN0aW5nIGFyZ3VtZW50c1xyXG4gICAqIEByZXR1cm5zIHRoZSByZXN1bHQgb2YgdGhlIGZ1bmN0aW9uIGNhbGxcclxuICAgKi9cclxuICBmdW5jdGlvbiBnZXRDdXJyaWVkKGZuLCBhcml0eSkge1xyXG4gICAgICBmdW5jdGlvbiBfY3VycmllZChhcmdzKSB7XHJcbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgIHZhciBsZW5ndGggPSBhcmdzLmxlbmd0aDtcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJncyA9IGFyZ3VtZW50cztcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJnc0xlbmd0aCA9IG5ld0FyZ3MubGVuZ3RoO1xyXG4gICAgICAgICAgICAgIHZhciBjb21iaW5lZCA9IFtdO1xyXG4gICAgICAgICAgICAgIHZhciBuZXdBcmdzSW5kZXggPSAwO1xyXG4gICAgICAgICAgICAgIHZhciByZW1haW5pbmcgPSBhcml0eTtcclxuICAgICAgICAgICAgICB2YXIgdmFsdWU7XHJcbiAgICAgICAgICAgICAgaWYgKGxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAtMTtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2luZGV4XSA9IHZhbHVlID1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdzW2luZGV4XSA9PT0gX18gJiYgbmV3QXJnc0luZGV4IDwgbmV3QXJnc0xlbmd0aFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG5ld0FyZ3NbbmV3QXJnc0luZGV4KytdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYXJnc1tpbmRleF07XHJcbiAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IF9fKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLS1yZW1haW5pbmc7XHJcbiAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgaWYgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2NvbWJpbmVkLmxlbmd0aF0gPSB2YWx1ZSA9IG5ld0FyZ3NbbmV3QXJnc0luZGV4XTtcclxuICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gX18gJiYgbmV3QXJnc0luZGV4IDwgYXJpdHkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAtLXJlbWFpbmluZztcclxuICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICsrbmV3QXJnc0luZGV4O1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHJldHVybiByZW1haW5pbmcgPiAwID8gX2N1cnJpZWQoY29tYmluZWQpIDogZm4uYXBwbHkodGhpcywgY29tYmluZWQpO1xyXG4gICAgICAgICAgfTtcclxuICAgICAgfVxyXG4gICAgICByZXR1cm4gX2N1cnJpZWQoW10pO1xyXG4gIH1cblxuICAvLyB1dGlsc1xyXG4gIGZ1bmN0aW9uIGN1cnJ5KGZuLCBhcml0eU92ZXJyaWRlKSB7XHJcbiAgICAgIHZhciBhcml0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AgIF9kb3duS2V5cy5wdXNoKGtleU51bSk7XG4gICAgfSBlbHNlIGlmICghZXZlbnRba2V5TmFtZV0gJiYgX2Rvd25LZXlzLmluZGV4T2Yoa2V5TnVtKSA+IC0xKSB7XG4gICAgICBfZG93bktleXMuc3BsaWNlKF9kb3duS2V5cy5pbmRleE9mKGtleU51bSksIDEpO1xuICAgIH0gZWxzZSBpZiAoa2V5TmFtZSA9PT0gJ21ldGFLZXknICYmIGV2ZW50W2tleU5hbWVdICYmIF9kb3duS2V5cy5sZW5ndGggPT09IDMpIHtcbiAgICAgIC8qKlxuICAgICAgICogRml4IGlmIENvbW1hbmQgaXMgcHJlc3NlZDpcbiAgICAgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICAgICAqL1xuICAgICAgaWYgKCEoZXZlbnQuY3RybEtleSB8fCBldmVudC5zaGlmdEtleSB8fCBldmVudC5hbHRLZXkpKSB7XG4gICAgICAgIF9kb3duS2V5cyA9IF9kb3duS2V5cy5zbGljZShfZG93bktleXMuaW5kZXhPZihrZXlOdW0pKTtcbiAgICAgIH1cbiAgICB9XG4gIH0pO1xuICAvKipcbiAgICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgKi9cblxuICBpZiAoa2V5IGluIF9tb2RzKSB7XG4gICAgX21vZHNba2V5XSA9IHRydWU7IC8vIOWwhueJueauiuWtl+espueahGtleeazqOWGjOWIsCBob3RrZXlzIOS4ilxuXG4gICAgZm9yICh2YXIgayBpbiBfbW9kaWZpZXIpIHtcbiAgICAgIGlmIChfbW9kaWZpZXJba10gPT09IGtleSkgaG90a2V5c1trXSA9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFhc3RlcmlzaykgcmV0dXJuO1xuICB9IC8vIOWwhiBtb2RpZmllck1hcCDph4zpnaLnmoTkv67ppbDplK7nu5HlrprliLAgZXZlbnQg5LitXG5cblxuICBmb3IgKHZhciBlIGluIF9tb2RzKSB7XG4gICAga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2YXRlXG4gICAgICogQG5hbWUgZGVsZXRlXG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIHRoZSBlbnRyeSB3YXMgcmVtb3ZlZCwgZWxzZSBgZmFsc2VgLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIG1hcENhY2hlRGVsZXRlKGtleSkge1xuICAgICAgdmFyIHJlc3VsdCA9IGdldE1hcERhdGEodGhpcywga2V5KVsnZGVsZXRlJ10oa2V5KTtcbiAgICAgIHRoaXMuc2l6ZSAtPSByZXN1bHQgPyAxIDogMDtcbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogR2V0cyB0aGUgbWFwIHZhbHVlIGZvciBga2V5YC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQG5hbWUgZ2V0XG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG9mIHRoZSB2YWx1ZSB0byBnZXQuXG4gICAgICogQHJldHVybnMgeyp9IFJldHVybnMgdGhlIGVudHJ5IHZhbHVlLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIG1hcENhY2hlR2V0KGtleSkge1xuICAgICAgcmV0dXJuIGdldE1hcERhdGEodGhpcywga2V5KS5nZXQoa2V5KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDaGVja3MgaWYgYSBtYXAgdmFsdWUgZm9yIGBrZXlgIGV4aXN0cy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQG5hbWUgaGFzXG4gICAgICogQG1lbWJlck9mIE1hcENhY2hlXG4gICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSBUaGUga2V5IG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nRzLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gbnVtYmVyIFRoZSBudW1iZXIgdG8gY2xhbXAuXG4gICAgICogQHBhcmFtIHtudW1iZXJ9IFtsb3dlcl0gVGhlIGxvd2VyIGJvdW5kLlxuICAgICAqIEBwYXJhbSB7bnVtYmVyfSB1cHBlciBUaGUgdXBwZXIgYm91bmQuXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgY2xhbXBlZCBudW1iZXIuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZUNsYW1wKG51bWJlciwgbG93ZXIsIHVwcGVyKSB7XG4gICAgICBpZiAobnVtYmVyID09PSBudW1iZXIpIHtcbiAgICAgICAgaWYgKHVwcGVyICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBudW1iZXIgPSBudW1iZXIgPD0gdXBwZXIgPyBudW1iZXIgOiB1cHBlcjtcbiAgICAgICAgfVxuICAgICAgICBpZiAobG93ZXIgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIG51bWJlciA9IG51bWJlciA+PSBsb3dlciA/IG51bWJlciA6IGxvd2VyO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gbnVtYmVyO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmNsb25lYCBhbmQgYF8uY2xvbmVEZWVwYCB3aGljaCB0cmFja3NcbiAgICAgKiB0cmF2ZXJzZWQgb2JqZWN0cy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gY2xvbmUuXG4gICAgICogQHBhcmFtIHtib29sZWFufSBiaXRtYXNrIFRoZSBiaXRtYXNrIGZsYWdzLlxuICAgICAqICAxIC0gRGVlcCBjbG9uZVxuICAgICAqICAyIC0gRmxhdHRlbiBpbmhl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ICAgICBvdXRlcjpcbiAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoICYmIHJlc3VsdC5sZW5ndGggPCBtYXhMZW5ndGgpIHtcbiAgICAgICAgdmFyIHZhbHVlID0gYXJyYXlbaW5kZXhdLFxuICAgICAgICAgICAgY29tcHV0ZWQgPSBpdGVyYXRlZSA/IGl0ZXJhdGVlKHZhbHVlKSA6IHZhbHVlO1xuXG4gICAgICAgIHZhbHVlID0gKGNvbXBhcmF0b3IgfHwgdmFsdWUgIT09IDApID8gdmFsdWUgOiAwO1xuICAgICAgICBpZiAoIShzZWVuXG4gICAgICAgICAgICAgID8gY2FjaGVIYXMoc2VlbiwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgIDogaW5jbHVkZXMocmVzdWx0LCBjb21wdXRlZCwgY29tcGFyYXRvcilcbiAgICAgICAgICAgICkpIHtcbiAgICAgICAgICBvdGhJbmRleCA9IG90aExlbmd0aDtcbiAgICAgICAgICB3aGlsZSAoLS1vdGhJbmRleCkge1xuICAgICAgICAgICAgdmFyIGNhY2hlID0gY2FjaGVzW290aEluZGV4XTtcbiAgICAgICAgICAgIGlmICghKGNhY2hlXG4gICAgICAgICAgICAgICAgICA/IGNhY2hlSGFzKGNhY2hlLCBjb21wdXRlZClcbiAgICAgICAgICAgICAgICAgIDogaW5jbHVkZXMoYXJyYXlzW290aEluZGV4XSwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpKVxuICAgICAgICAgICAgICAgICkge1xuICAgICAgICAgICAgICBjb250aW51ZSBvdXRlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKHNlZW4pIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICAvKipcbiAg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xuICAgICAgICBvYmpJc0FyciA9IHRydWU7XG4gICAgICAgIG9iaklzT2JqID0gZmFsc2U7XG4gICAgICB9XG4gICAgICBpZiAoaXNTYW1lVGFnICYmICFvYmpJc09iaikge1xuICAgICAgICBzdGFjayB8fCAoc3RhY2sgPSBuZXcgU3RhY2spO1xuICAgICAgICByZXR1cm4gKG9iaklzQXJyIHx8IGlzVHlwZWRBcnJheShvYmplY3QpKVxuICAgICAgICAgID8gZXF1YWxBcnJheXMob2JqZWN0LCBvdGhlciwgYml0bWFzaywgY3VzdG9taXplciwgZXF1YWxGdW5jLCBzdGFjaylcbiAgICAgICAgICA6IGVxdWFsQnlUYWcob2JqZWN0LCBvdGhlciwgb2JqVGFnLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKTtcbiAgICAgIH1cbiAgICAgIGlmICghKGJpdG1hc2sgJiBDT01QQVJFX1BBUlRJQUxfRkxBRykpIHtcbiAgICAgICAgdmFyIG9iaklzV3JhcHBlZCA9IG9iaklzT2JqICYmIGhhc093blByb3BlcnR5LmNhbGwob2JqZWN0LCAnX193cmFwcGVkX18nKSxcbiAgICAgICAgICAgIG90aElzV3JhcHBlZCA9IG90aElzT2JqICYmIGhhc093blByb3BlcnR5LmNhbGwob3RoZXIsICdfX3dyYXBwZWRfXycpO1xuXG4gICAgICAgIGlmIChvYmpJc1dyYXBwZWQgfHwgb3RoSXNXcmFwcGVkKSB7XG4gICAgICAgICAgdmFyIG9ialVud3JhcHBlZCA9IG9iaklzV3JhcHBlZCA/IG9iamVjdC52YWx1ZSgpIDogb2JqZWN0LFxuICAgICAgICAgICAgICBvdGhVbndyYXBwZWQgPSBvdGhJc1dyYXBwZWQgPyBvdGhlci52YWx1ZSgpIDogb3RoZXI7XG5cbiAgICAgICAgICBzdGFjayB8fCAoc3RhY2sgPSBuZXcgU3RhY2spO1xuICAgICAgICAgIHJldHVybiBlcXVhbEZ1bmMob2JqVW53cmFwcGVkLCBvdGhV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EpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBzcGxpY2UuY2FsbChhcnJheSwgZnJvbUluZGV4LCAxKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIGFycmF5O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnB1bGxBdGAgd2l0aG91dCBzdXBwb3J0IGZvciBpbmRpdmlkdWFsXG4gICAgICogaW5kZXhlcyBvciBjYXB0dXJpbmcgdGhlIHJlbW92ZWQgZWxlbWVudHMuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBtb2RpZnkuXG4gICAgICogQHBhcmFtIHtudW1iZXJbXX0gaW5kZXhlcyBUaGUgaW5kZXhlcyBvZiBlbGVtZW50cyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZVB1bGxBdChhcnJheSwgaW5kZXhlcykge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5ID8gaW5kZXhlcy5sZW5ndGggOiAwLFxuICAgICAgICAgIGxhc3RJbmRleCA9IGxlbmd0aCAtIDE7XG5cbiAgICAgIHdoaWxlIChsZW5ndGgtLSkge1xuICAgICAgICB2YXIgaW5kZXggPSBpbmRleGVzW2xlbmd0aF07XG4gICAgICAgIGlmIChsZW5ndGggPT0gbGFzdEluZGV4IHx8IGluZGV4ICE9PSBwcmV2aW91cykge1xuICAgICAgICAgIHZhciBwcmV2aW91cyA9IGluZGV4O1xuICAgICAgICAgIGlmIChpc0luZGV4KGluZGV4KSkge1xuICAgICAgICAgICAgc3BsaWNlLmNhbGwoYXJyYXksIGluZGV4LCAxKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYmFzZVVuc2V0KGFycmF5LCB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HZhbHVlICE9PSAwKSA/IHZhbHVlIDogMDtcbiAgICAgICAgaWYgKGlzQ29tbW9uICYmIGNvbXB1dGVkID09PSBjb21wdXRlZCkge1xuICAgICAgICAgIHZhciBzZWVuSW5kZXggPSBzZWVuLmxlbmd0aDtcbiAgICAgICAgICB3aGlsZSAoc2VlbkluZGV4LS0pIHtcbiAgICAgICAgICAgIGlmIChzZWVuW3NlZW5JbmRleF0gPT09IGNvbXB1dGVkKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlIG91dGVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXRlcmF0ZWUpIHtcbiAgICAgICAgICAgIHNlZW4ucHVzaChjb21wdXRlZCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdC5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICghaW5jbHVkZXMoc2VlbiwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpKSB7XG4gICAgICAgICAgaWYgKHNlZW4gIT09IHJlc3VsdCkge1xuICAgICAgICAgICAgc2Vlbi5wdXNoKGNvbXB1dGVkKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVzdWx0LnB1c2godmFsdWUpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLnVuc2V0YC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgb2JqZWN0IHRvIG1vZGlmeS5cbiAgICAgKiBAcGFyYW0ge0FycmF5fHN0cmluZ30gcGF0aCBUaGUgcHJvcGVydHkgcGF0aCB0byB1bnNldC5cbiAgICAgKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgdGhlIHByb3Bl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0YWNrZWQgPT0gb3RoZXI7XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSAtMSxcbiAgICAgICAgICByZXN1bHQgPSB0cnVlLFxuICAgICAgICAgIHNlZW4gPSAoYml0bWFzayAmIENPTVBBUkVfVU5PUkRFUkVEX0ZMQUcpID8gbmV3IFNldENhY2hlIDogdW5kZWZpbmVkO1xuXG4gICAgICBzdGFjay5zZXQoYXJyYXksIG90aGVyKTtcbiAgICAgIHN0YWNrLnNldChvdGhlciwgYXJyYXkpO1xuXG4gICAgICAvLyBJZ25vcmUgbm9uLWluZGV4IHByb3BlcnRpZXMuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGFyckxlbmd0aCkge1xuICAgICAgICB2YXIgYXJyVmFsdWUgPSBhcnJheVtpbmRleF0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2luZGV4XTtcblxuICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgIHZhciBjb21wYXJlZCA9IGlzUGFydGlhbFxuICAgICAgICAgICAgPyBjdXN0b21pemVyKG90aFZhbHVlLCBhcnJWYWx1ZSwgaW5kZXgsIG90aGVyLCBhcnJheSwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIoYXJyVmFsdWUsIG90aFZhbHVlLCBpbmRleCwgYXJyYXksIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbXBhcmVkICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBpZiAoY29tcGFyZWQpIHtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIGFycmF5cyAoc3VzY2VwdGlibGUgdG8gY2FsbCBzdGFjayBsaW1pdHMpLlxuICAgICAgICBpZiAoc2Vlbikge1xu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ml0bWFzaywgY3VzdG9taXplciwgZXF1YWxGdW5jLCBzdGFjaykge1xuICAgICAgc3dpdGNoICh0YWcpIHtcbiAgICAgICAgY2FzZSBkYXRhVmlld1RhZzpcbiAgICAgICAgICBpZiAoKG9iamVjdC5ieXRlTGVuZ3RoICE9IG90aGVyLmJ5dGVMZW5ndGgpIHx8XG4gICAgICAgICAgICAgIChvYmplY3QuYnl0ZU9mZnNldCAhPSBvdGhlci5ieXRlT2Zmc2V0KSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgICBvYmplY3QgPSBvYmplY3QuYnVmZmVyO1xuICAgICAgICAgIG90aGVyID0gb3RoZXIuYnVmZmVyO1xuXG4gICAgICAgIGNhc2UgYXJyYXlCdWZmZXJUYWc6XG4gICAgICAgICAgaWYgKChvYmplY3QuYnl0ZUxlbmd0aCAhPSBvdGhlci5ieXRlTGVuZ3RoKSB8fFxuICAgICAgICAgICAgICAhZXF1YWxGdW5jKG5ldyBVaW50OEFycmF5KG9iamVjdCksIG5ldyBVaW50OEFycmF5KG90aGVyKSkpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHRydWU7XG5cbiAgICAgICAgY2FzZSBib29sVGFnOlxuICAgICAgICBjYXNlIGRhdGVUYWc6XG4gICAgICAgIGNhc2UgbnVtYmVyVGFnOlxuICAgICAgICAgIC8vIENvZXJjZSBib29sZWFucyB0byBgMWAgb3IgYDBgIGFuZCBkYXRlcyB0byBtaWxsaXNlY29uZHMuXG4gICAgICAgICAgLy8gSW52YWxpZCBkYXRlcyBhcmUgY29lcmNlZCB0byBgTmFOYC5cbiAgICAgICAgICByZXR1cm4gZXEoK29iamVjdCwgK290aGVyKTtcblxuICAgICAgICBjYXNlIGVycm9yVGFnOlxuICAgICAgICAgIHJldHVybiBvYmplY3QubmFtZSA9PSBvdGhlci5uYW1lICYmIG9iamVjdC5t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zKS5cbiAgICAgICAgaWYgKCEoY29tcGFyZWQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA/IChvYmpWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKG9ialZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKVxuICAgICAgICAgICAgICA6IGNvbXBhcmVkXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc2tpcEN0b3IgfHwgKHNraXBDdG9yID0ga2V5ID09ICdjb25zdHJ1Y3RvcicpO1xuICAgICAgfVxuICAgICAgaWYgKHJlc3VsdCAmJiAhc2tpcEN0b3IpIHtcbiAgICAgICAgdmFyIG9iakN0b3IgPSBvYmplY3QuY29uc3RydWN0b3IsXG4gICAgICAgICAgICBvdGhDdG9yID0gb3RoZXIuY29uc3RydWN0b3I7XG5cbiAgICAgICAgLy8gTm9uIGBPYmplY3RgIG9iamVjdCBpbnN0YW5jZXMgd2l0aCBkaWZmZXJlbnQgY29uc3RydWN0b3JzIGFyZSBub3QgZXF1YWwuXG4gICAgICAgIGlmIChvYmpDdG9yICE9IG90aEN0b3IgJiZcbiAgICAgICAgICAgICgnY29uc3RydWN0b3InIGluIG9iamVjdCAmJiAnY29uc3RydWN0b3InIGluIG90aGVyKSAmJlxuICAgICAgICAgICAgISh0eXBlb2Ygb2JqQ3RvciA9PSAnZnVuY3Rpb24nICYmIG9iakN0b3IgaW5zdGFuY2VvZiBvYmpDdG9yICYmXG4gICAgICAgICAgICAgIHR5cGVvZiBvdGhDdG9yID09ICdmdW5jdGlvbicgJiYgb3RoQ3RvciBpbnN0YW5jZW9mIG90aEN0b3IpKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHN0YWNrWydkZWxldGUnXShvYmplY3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gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBpbml0aWFsaXplZCBjbG9uZS5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpbml0Q2xvbmVBcnJheShhcnJheSkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5Lmxlbmd0aCxcbiAgICAgICAgICByZXN1bHQgPSBuZXcgYXJyYXkuY29uc3RydWN0b3IobGVuZ3RoKTtcblxuICAgICAgLy8gQWRkIHByb3BlcnRpZXMgYXNzaWduZWQgYnkgYFJlZ0V4cCNleGVjYC5cbiAgICAgIGlmIChsZW5ndGggJiYgdHlwZW9mIGFycmF5WzBdID09ICdzdHJpbmcnICYmIGhhc093blByb3BlcnR5LmNhbGwoYXJyYXksICdpbmRleCcpKSB7XG4gICAgICAgIHJlc3VsdC5pbmRleCA9IGFycmF5LmluZGV4O1xuICAgICAgICByZXN1bHQuaW5wdXQgPSBhcnJheS5pbnB1dDtcbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogSW5pdGlhbGl6ZXMgYW4gb2JqZWN0IGNsb25lLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgaW5pdGlhbGl6ZWQgY2xvbmUuXG4gICAgICovXG4gICAgZnVuY3Rpb24gaW5pdENsb25lT2JqZWN0KG9iamVjdCkge1xuICAgICAgcmV0dXJuICh0eXBlb2Ygb2JqZWN0LmNvbnN0cnVjdG9yID09ICdmdW5jdGlvbicgJiYgIWlzUHJvdG90eXBlKG9iamVjdCkpXG4gICAgICAgID8gYmFzZUNyZWF0ZShnZXR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gICAgIHJldHVybiByZXN1bHQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGNhbmNlbCgpIHtcbiAgICAgICAgaWYgKHRpbWVySWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGNsZWFyVGltZW91dCh0aW1lcklkKTtcbiAgICAgICAgfVxuICAgICAgICBsYXN0SW52b2tlVGltZSA9IDA7XG4gICAgICAgIGxhc3RBcmdzID0gbGFzdENhbGxUaW1lID0gbGFzdFRoaXMgPSB0aW1lcklkID0gdW5kZWZpbmVkO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBmbHVzaCgpIHtcbiAgICAgICAgcmV0dXJuIHRpbWVySWQgPT09IHVuZGVmaW5lZCA/IHJlc3VsdCA6IHRyYWlsaW5nRWRnZShub3coKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGRlYm91bmNlZCgpIHtcbiAgICAgICAgdmFyIHRpbWUgPSBub3coKSxcbiAgICAgICAgICAgIGlzSW52b2tpbmcgPSBzaG91bGRJbnZva2UodGltZSk7XG5cbiAgICAgICAgbGFzdEFyZ3MgPSBhcmd1bWVudHM7XG4gICAgICAgIGxhc3RUaGlzID0gdGhpcztcbiAgICAgICAgbGFzdENhbGxUaW1lID0gdGltZTtcblxuICAgICAgICBpZiAoaXNJbnZva2luZykge1xuICAgICAgICAgIGlmICh0aW1lcklkID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBsZWFkaW5nRWRnZShsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAobWF4aW5nKSB7XG4gICAgICAgICAgICAvLyBIYW5kbGUgaW52b2NhdGlvbnMgaW4gYSB0aWdodCBsb29wLlxuICAgICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgICAgIHJldHVybiBpbnZva2VGdW5jKGxhc3RDYWxsVGltZSk7XG4g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sYWluIG9iamVjdCwgZWxzZSBgZmFsc2VgLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqIH1cbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdChuZXcgRm9vKTtcbiAgICAgKiAvLyA9PiBmYWxzZVxuICAgICAqXG4gICAgICogXy5pc1BsYWluT2JqZWN0KFsxLCAyLCAzXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdCh7ICd4JzogMCwgJ3knOiAwIH0pO1xuICAgICAqIC8vID0+IHRydWVcbiAgICAgKlxuICAgICAqIF8uaXNQbGFpbk9iamVjdChPYmplY3QuY3JlYXRlKG51bGwpKTtcbiAgICAgKiAvLyA9PiB0cnVlXG4gICAgICovXG4gICAgZnVuY3Rpb24gaXNQbGFpbk9iamVjdCh2YWx1ZSkge1xuICAgICAgaWYgKCFpc09iamVjdExpa2UodmFsdWUpIHx8IGJhc2VHZXRUYWcodmFsdWUpICE9IG9iamVjdFRhZykge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgICB2YXIgcHJvdG8gPSBnZXRQcm90b3R5cGUodmFsdWUpO1xuICAgICAgaWYgKHByb3RvID09PSBudWxsKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgfVxuICAgICAgdmFyIEN0b3IgPSBoYXNPd25Qcm9wZXJ0eS5jYWxsKHByb3RvLCAnY29uc3RydWN0b3InKSAmJiBwcm90by5jb25zdHJ1Y3RvcjtcbiAgICAgIHJldHVybiB0eXBlb2YgQ3RvciA9PSAnZnVuY3Rpb24nICYmIEN0b3IgaW5zdGFuY2VvZiBDdG9yICYmXG4gICAgICAgIGZ1bmNUb1N0cmluZy5jYWxsKEN0b3IpID09IG9iamVjdEN0b3JTdHJpbmc7XG4gICAgfVxuXG4gICAgLy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lxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IExhbmdcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBwcm9jZXNzLlxuICAgICAqIEByZXR1cm5zIHtudW1iZXJ9IFJldHVybnMgdGhlIG51bWJlci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy50b051bWJlcigzLjIpO1xuICAgICAqIC8vID0+IDMuMlxuICAgICAqXG4gICAgICogXy50b051bWJlcihOdW1iZXIuTUlOX1ZBTFVFKTtcbiAgICAgKiAvLyA9PiA1ZS0zMjRcbiAgICAgKlxuICAgICAqIF8udG9OdW1iZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IEluZmluaXR5XG4gICAgICpcbiAgICAgKiBfLnRvTnVtYmVyKCczLjInKTtcbiAgICAgKiAvLyA9PiAzLjJcbiAgICAgKi9cbiAgICBmdW5jdGlvbiB0b051bWJlcih2YWx1ZSkge1xuICAgICAgaWYgKHR5cGVvZiB2YWx1ZSA9PSAnbnVtYmVyJykge1xuICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICB9XG4gICAgICBpZiAoaXNTeW1ib2wodmFsdWUpKSB7XG4gICAgICAgIHJldHVybiBOQU47XG4gICAgICB9XG4gICAgICBpZiAoaXNPYmplY3QodmFsdWUpKSB7XG4gICAgICAgIHZhciBvdGhlciA9IHR5cGVvZiB2YWx1ZS52YWx1ZU9mID09ICdmdW5jdGlvbicgPyB2YWx1ZS52YWx1ZU9mKCkgOiB2YWx1ZTtcbiAgICAgICAgdmFsdWUgPSBpc09iamVjdChvdGhlcikgPyAob3RoZXIgKyAnJykgOiBvdGhlcjtcbiAgICAgIH1cbiAgICAgIGlmICh0eXBlb2YgdmFsdWUgIT0gJ3N0cmluZycpIHtcbiAgICAgICAgcmV0dXJuIHZhbHVlID09PSAwID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/ICcnXG4gICAgICAgICAgOiAnb2JqIHx8IChvYmogPSB7fSk7XFxuJ1xuICAgICAgICApICtcbiAgICAgICAgXCJ2YXIgX190LCBfX3AgPSAnJ1wiICtcbiAgICAgICAgKGlzRXNjYXBpbmdcbiAgICAgICAgICAgPyAnLCBfX2UgPSBfLmVzY2FwZSdcbiAgICAgICAgICAgOiAnJ1xuICAgICAgICApICtcbiAgICAgICAgKGlzRXZhbHVhdGluZ1xuICAgICAgICAgID8gJywgX19qID0gQXJyYXkucHJvdG90eXBlLmpvaW47XFxuJyArXG4gICAgICAgICAgICBcImZ1bmN0aW9uIHByaW50KCkgeyBfX3AgKz0gX19qLmNhbGwoYXJndW1lbnRzLCAnJykgfVxcblwiXG4gICAgICAgICAgOiAnO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIHNvdXJjZSArXG4gICAgICAgICdyZXR1cm4gX19wXFxufSc7XG5cbiAgICAgIHZhciByZXN1bHQgPSBhdHRlbXB0KGZ1bmN0aW9uKCkge1xuICAgICAgICByZXR1cm4gRnVuY3Rpb24oaW1wb3J0c0tleXMsIHNvdXJjZVVSTCArICdyZXR1cm4gJyArIHNvdXJjZSlcbiAgICAgICAgICAuYXBwbHkodW5kZWZpbmVkLCBpbXBvcnRzVmFsdWVzKTtcbiAgICAgIH0pO1xuXG4gICAgICAvLyBQcm92aWRlIHRoZSBjb21waWxlZCBmdW5jdGlvbidzIHNvdXJjZSBieSBpdHMgYHRvU3RyaW5nYCBtZXRob2Qgb3JcbiAgICAgIC8vIHRoZSBgc291cmNlYCBwcm9wZXJ0eSBhcyBhIGNvbnZlbmllbmNlIGZvciBpbmxpbmluZyBjb21waWxlZCB0ZW1wbGF0ZXMuXG4gICAgICByZXN1bHQuc291cmNlID0gc291cmNlO1xuICAgICAgaWYgKGlzRXJyb3IocmVzdWx0KSkge1xuICAgICAgICB0aHJvdyByZXN1bHQ7XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAg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AgICAgICAgICBtZXRob2ROYW1lcyA9IGJhc2VGdW5jdGlvbnMoc291cmNlLCBwcm9wcyk7XG5cbiAgICAgIGlmIChvcHRpb25zID09IG51bGwgJiZcbiAgICAgICAgICAhKGlzT2JqZWN0KHNvdXJjZSkgJiYgKG1ldGhvZE5hbWVzLmxlbmd0aCB8fCAhcHJvcHMubGVuZ3RoKSkpIHtcbiAgICAgICAgb3B0aW9ucyA9IHNvdXJjZTtcbiAgICAgICAgc291cmNlID0gb2JqZWN0O1xuICAgICAgICBvYmplY3QgPSB0aGlzO1xuICAgICAgICBtZXRob2ROYW1lcyA9IGJhc2VGdW5jdGlvbnMoc291cmNlLCBrZXlzKHNvdXJjZSkpO1xuICAgICAgfVxuICAgICAgdmFyIGNoYWluID0gIShpc09iamVjdChvcHRpb25zKSAmJiAnY2hhaW4nIGluIG9wdGlvbnMpIHx8ICEhb3B0aW9ucy5jaGFpbixcbiAgICAgICAgICBpc0Z1bmMgPSBpc0Z1bmN0aW9uKG9iamVjdCk7XG5cbiAgICAgIGFycmF5RWFjaChtZXRob2ROYW1lcywgZnVuY3Rpb24obWV0aG9kTmFtZSkge1xuICAgICAgICB2YXIgZnVuYyA9IHNvdXJjZVttZXRob2ROYW1lXTtcbiAgICAgICAgb2JqZWN0W21ldGhvZE5hbWVdID0gZnVuYztcbiAgICAgICAgaWYgKGlzRnVuYykge1xuICAgICAgICAgIG9iamVjdC5wcm90b3R5cGVbbWV0aG9kTmFtZV0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBjaGFpbkFsbCA9IHRoaXMuX19jaGFpbl9fO1xuICAgICAgICAgICAgaWYgKGNoYWluIHx8IGNoYWluQWxsKSB7XG4gICAgICAgICAgICAgIHZhciByZXN1bHQgPSBvYmplY3QodGhpcy5fX3dyYXBwZWRfXyksXG4gICAgICAgICAgICAgICAgICBhY3Rpb25zID0gcmVzdWx0Ll9fYWN0aW9uc19fID0gY29weUFycmF5KHRoaXMuX19hY3Rpb25z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aHQgPSBjcmVhdGVSYW5nZSh0cnVlKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgYXJyYXkuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4xMy4wXG4gICAgICogQGNhdGVnb3J5IFV0aWxcbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIG5ldyBlbXB0eSBhcnJheS5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIGFycmF5cyA9IF8udGltZXMoMiwgXy5zdHViQXJyYXkpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzKTtcbiAgICAgKiAvLyA9PiBbW10sIFtdXVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2coYXJyYXlzWzBdID09PSBhcnJheXNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkFycmF5KCkge1xuICAgICAgcmV0dXJuIFtdO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYGZhbHNlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGBmYWxzZWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udGltZXMoMiwgXy5zdHViRmFsc2UpO1xuICAgICAqIC8vID0+IFtmYWxzZSwgZmFsc2VdXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YkZhbHNlKCkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGVtcHR5IG9iamVjdC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBfLnRpbWVzKDIsIF8uc3R1Yk9iamVjdCk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzKTtcbiAgICAgKiAvLyA9PiBbe30sIHt9XVxuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0c1swXSA9PT0gb2JqZWN0c1sxXSk7XG4gICAgICogLy8gPT4gZmFsc2VcbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViT2JqZWN0KCkge1xuICAgICAgcmV0dXJuIHt9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYW4gZW1wdHkgc3RyaW5nLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge3N0cmluZ30gUmV0dXJucyB0aGUgZW1wdHkgc3RyaW5nLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRpbWVzKDIsIF8uc3R1YlN0cmluZyk7XG4gICAgICogLy8gPT4gWycnLCAnJ11cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViU3RyaW5nKCkge1xuICAgICAgcmV0dXJuICcnO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIHJldHVybnMgYHRydWVgLlxuICAgICAqXG4g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ndW1lbnRzWzBdIDogdHJ1ZTtcblxuICAgICAgdmFyIHByb3BzID0ge307XG4gICAgICBpZiAodGhpcy5wcmlvcml0eSkge1xuICAgICAgICBwcm9wcy5wcmlvcml0eSA9IHRoaXMucHJpb3JpdHk7XG4gICAgICB9XG4gICAgICB2YXIgb3BlciA9IENvbmRpdGlvbi5ib29sZWFuT3BlcmF0b3IodGhpcyk7XG4gICAgICBpZiAob3Blcikge1xuICAgICAgICBwcm9wc1tvcGVyXSA9IHRoaXNbb3Blcl0ubWFwKGZ1bmN0aW9uIChjKSB7XG4gICAgICAgICAgcmV0dXJuIGMudG9KU09OKHN0cmluZ2lmeSk7XG4gICAgICAgIH0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcHJvcHMub3BlcmF0b3IgPSB0aGlzLm9wZXJhdG9yO1xuICAgICAgICBwcm9wcy52YWx1ZSA9IHRoaXMudmFsdWU7XG4gICAgICAgIHByb3BzLmZhY3QgPSB0aGlzLmZhY3Q7XG4gICAgICAgIGlmICh0aGlzLmZhY3RSZXN1bHQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHByb3BzLmZhY3RSZXN1bHQgPSB0aGlzLmZhY3RSZXN1bHQ7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRoaXMucmVzdWx0ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBwcm9wcy5yZXN1bHQgPSB0aGlzLnJlc3VsdDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXJhbXMpIHtcbiAgICAgICAgICBwcm9wcy5wYXJhbXMgPSB0aGlzLnBhcmFtcztcbiAgICAgICAgfVxuICAgICAgICBpZiAodGhpcy5wYXRoKSB7XG4gICAgICAgICAgcHJvcHMucGF0aCA9IHRoaXMucGF0aDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgaWYgKHN0cmluZ2lmeSkge1xuICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocHJvcHMpO1xuICAgIC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KTtcbiAgICAgICAgICAgICAgc3RvcCA9IHRydWU7XG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGFsbCBjb25kaXRpb25zIHBhc3NlZDsgcHJvY2VlZCB3aXRoIHJ1bm5pbmcgbmV4dCBzZXQgaW4gcGFyYWxsZWxcbiAgICAgICAgICAgIHJldHVybiBldmFsdWF0ZUNvbmRpdGlvbnMoc2V0LCBtZXRob2QpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3JkZXJlZFNldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICBfbG9vcChpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY3Vyc29yO1xuICAgICAgfTtcblxuICAgICAgLyoqXG4gICAgICAgKiBSdW5zIGFuICdhbnknIGJvb2xlYW4gb3BlcmF0b3Igb24gYW4gYXJyYXkgb2YgY29uZGl0aW9uc1xuICAgICAgICogQHBhcmFtICB7Q29uZGl0aW9uW119IGNvbmRpdGlvbnMgdG8gYmUgZXZhbHVhdGVkXG4gICAgICAgKiBAcmV0dXJuIHtQcm9taXNlKGJvb2xlYW4pfSBjb25kaXRpb24gZXZhbHVhdGlvbiByZXN1bHRcbiAgICAgICAqL1xuICAgICAgdmFyIGFueSA9IGZ1bmN0aW9uIGFueShjb25kaXRpb25zKSB7XG4gICAgICAgIHJldHVybiBwcmlvcml0aXplQW5kUnVuKGNvbmRpdGlvbnMsICdhbnknKTtcbiAgICAgIH07XG5cbiAgICAgIC8qKlxuICAgICAgICogUnVucyBhbiAnYWxsJyBib29sZWFuIG9wZXJhdG9yIG9uIGFuIGFycmF5IG9mIGNvbmRpdGlvbnNcbiAgICAgICAqIEBwYXJhbSAge0NvbmRpdGlvbltdfSBjb25kaXRpb25zIHRvIGJlIGV2YWx1YXRlZFxuICAgICAgICogQHJldHVybiB7UHJvbWlzZShib29s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ICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCAmJiByZXN1bHQubGVuZ3RoIDwgbWF4TGVuZ3RoKSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgICAgIGNvbXB1dGVkID0gaXRlcmF0ZWUgPyBpdGVyYXRlZSh2YWx1ZSkgOiB2YWx1ZTtcblxuICAgICAgICB2YWx1ZSA9IChjb21wYXJhdG9yIHx8IHZhbHVlICE9PSAwKSA/IHZhbHVlIDogMDtcbiAgICAgICAgaWYgKCEoc2VlblxuICAgICAgICAgICAgICA/IGNhY2hlSGFzKHNlZW4sIGNvbXB1dGVkKVxuICAgICAgICAgICAgICA6IGluY2x1ZGVzKHJlc3VsdCwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgb3RoSW5kZXggPSBvdGhMZW5ndGg7XG4gICAgICAgICAgd2hpbGUgKC0tb3RoSW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjYWNoZSA9IGNhY2hlc1tvdGhJbmRleF07XG4gICAgICAgICAgICBpZiAoIShjYWNoZVxuICAgICAgICAgICAgICAgICAgPyBjYWNoZUhhcyhjYWNoZSwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgICAgICA6IGluY2x1ZGVzKGFycmF5c1tvdGhJbmRleF0sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0ZWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVG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3BlcnR5IG5hbWVzLCB2YWx1ZXMsIGFuZCBjb21wYXJlIGZsYWdzIHRvIG1hdGNoLlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IFtjdXN0b21pemVyXSBUaGUgZnVuY3Rpb24gdG8gY3VzdG9taXplIGNvbXBhcmlzb25zLlxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgb2JqZWN0YCBpcyBhIG1hdGNoLCBlbHNlIGBmYWxzZWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZUlzTWF0Y2gob2JqZWN0LCBzb3VyY2UsIG1hdGNoRGF0YSwgY3VzdG9taXplcikge1xuICAgICAgdmFyIGluZGV4ID0gbWF0Y2hEYXRhLmxlbmd0aCxcbiAgICAgICAgICBsZW5ndGggPSBpbmRleCxcbiAgICAgICAgICBub0N1c3RvbWl6ZXIgPSAhY3VzdG9taXplcjtcblxuICAgICAgaWYgKG9iamVjdCA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybiAhbGVuZ3RoO1xuICAgICAgfVxuICAgICAgb2JqZWN0ID0gT2JqZWN0KG9iamVjdCk7XG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICB2YXIgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIGlmICgobm9DdXN0b21pemVyICYmIGRhdGFbMl0pXG4gICAgICAgICAgICAgID8gZGF0YVsxXSAhPT0gb2JqZWN0W2RhdGFbMF1dXG4gICAgICAgICAgICAgIDogIShkYXRhWzBdIGluIG9iamVjdClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIHZhciBrZXkgPSBkYXRhWzBdLFxuICAgICAgICAgICAgb2JqVmFsdWUgPSBvYmplY3Rba2V5XSxcbiAgICAgICAgICAgIHNyY1ZhbHVlID0gZGF0YVsxXTtcblxuICAgICAgICBpZiAobm9DdXN0b21pemVyICYmIGRhdGFbMl0pIHtcbiAgICAgICAgICBpZiAob2JqVmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBzdGFjayA9IG5ldyBTdGFjaztcbiAgICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGN1c3RvbWl6ZXIob2JqVmFsdWUsIHNyY1ZhbHVlLCBrZXksIG9iamVjdCwgc291cmNlLCBzdGFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghKHJlc3VsdCA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgPyBiYXNlSXNFcXVhbChzcmNWYWx1ZSwgb2JqVmFsdWUsIENPTVBBUkVfUEFSVElBTF9GTEFHIHwgQ09NUEFSRV9VTk9SREVSRURfRkxBRywgY3VzdG9taXplciwgc3RhY2spXG4gICAgICAgICAgICAgICAgOiByZXN1bHRcbiAgICAgICAgICAgICAgKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaXNOYXRpdmVgIHdpdGhvdXQgYmFkIHNoaW0gY2hlY2tzLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjaGVjay5cbiAgICAgKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1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ob2JqZWN0KSB7XG4gICAgICBpZiAoIWlzUHJvdG90eXBlKG9iamVjdCkpIHtcbiAgICAgICAgcmV0dXJuIG5hdGl2ZUtleXMob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgIGZvciAodmFyIGtleSBpbiBPYmplY3Qob2JqZWN0KSkge1xuICAgICAgICBpZiAoaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkgJiYga2V5ICE9ICdjb25zdHJ1Y3RvcicpIHtcbiAgICAgICAgICByZXN1bHQucHVzaChrZXkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmtleXNJbmAgd2hpY2ggZG9lc24ndCB0cmVhdCBzcGFyc2UgYXJyYXlzIGFzIGRlbnNlLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBwcm9wZXJ0eSBuYW1lcy5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBiYXNlS2V5c0luKG9iamVjdCkge1xuICAgICAgaWYgKCFpc09iamVjdChvYmplY3QpKSB7XG4gICAgICAgIHJldHVybiBuYXRpdmVLZXlzSW4ob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciBpc1Byb3RvID0gaXNQcm90b3R5cGUob2JqZWN0KSxcbiAgICAgICAgICByZXN1bHQgPSBbXTtcblxuICAgICAgZm9yICh2YXIga2V5IGluIG9iamVjdCkge1xuICAgICAgICBpZiAoIShrZXkgPT0gJ2NvbnN0cnVjdG9yJyAmJiAoaXNQcm90byB8fCAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3Qs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gICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHBhdGgubGVuZ3RoLFxuICAgICAgICAgIGxhc3RJbmRleCA9IGxlbmd0aCAtIDEsXG4gICAgICAgICAgbmVzdGVkID0gb2JqZWN0O1xuXG4gICAgICB3aGlsZSAobmVzdGVkICE9IG51bGwgJiYgKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pLFxuICAgICAgICAgICAgbmV3VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICBpZiAoa2V5ID09PSAnX19wcm90b19fJyB8fCBrZXkgPT09ICdjb25zdHJ1Y3RvcicgfHwga2V5ID09PSAncHJvdG90eXBlJykge1xuICAgICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXggIT0gbGFzdEluZGV4KSB7XG4gICAgICAgICAgdmFyIG9ialZhbHVlID0gbmVzdGVkW2tleV07XG4gICAgICAgICAgbmV3VmFsdWUgPSBjdXN0b21pemVyID8gY3VzdG9taXplcihvYmpWYWx1ZSwga2V5LCBuZXN0ZWQpIDogdW5kZWZpbmVkO1xuICAgICAgICAgIGlmIChuZXdWYWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBuZXdWYWx1ZSA9IGlzT2JqZWN0KG9ialZhbHVlKVxuICAgICAgICAgICAgICA/IG9ialZhbHVlXG4gICAgICAgICAgICAgIDogKGlzSW5kZXgocGF0aFtpbmRleCArIDFdKSA/IFtdIDoge30pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBhc3NpZ25WYWx1ZShuZXN0ZWQsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICBuZXN0ZWQgPSBuZXN0ZWRba2V5XTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1w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jdGlvbiB0byBjdXN0b21pemUgY29waWVkIHZhbHVlcy5cbiAgICAgKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIGBvYmplY3RgLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGNvcHlPYmplY3Qoc291cmNlLCBwcm9wcywgb2JqZWN0LCBjdXN0b21pemVyKSB7XG4gICAgICB2YXIgaXNOZXcgPSAhb2JqZWN0O1xuICAgICAgb2JqZWN0IHx8IChvYmplY3QgPSB7fSk7XG5cbiAgICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHByb3BzLmxlbmd0aDtcblxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgdmFyIGtleSA9IHByb3BzW2luZGV4XTtcblxuICAgICAgICB2YXIgbmV3VmFsdWUgPSBjdXN0b21pemVyXG4gICAgICAgICAgPyBjdXN0b21pemVyKG9iamVjdFtrZXldLCBzb3VyY2Vba2V5XSwga2V5LCBvYmplY3QsIHNvdXJjZSlcbiAgICAgICAgICA6IHVuZGVmaW5lZDtcblxuICAgICAgICBpZiAobmV3VmFsdWUgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIG5ld1ZhbHVlID0gc291cmNlW2tleV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzTmV3KSB7XG4gICAgICAgICAgYmFzZUFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYXNzaWduVmFsdWUob2JqZWN0LCBrZXksIG5ld1ZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIG9iamVjdDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb3BpZXMgb3duIHN5bWJvbHMgb2YgYHNvdXJjZWAgdG8gYG9iamVjdGAuXG4gICAgICpcbiAgICAgKiBAcHJpdmF0ZVxuICAgICAqIEBwYXJhbS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ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgICAgIG90aFZhbHVlID0gb3RoZXJbaW5kZXhdO1xuXG4gICAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4gICAgICAgICAgICA/IGN1c3RvbWl6ZXIob3RoVmFsdWUsIGFyclZhbHVlLCBpbmRleCwgb3RoZXIsIGFycmF5LCBzdGFjaylcbiAgICAgICAgICAgIDogY3VzdG9taXplcihhcnJWYWx1ZSwgb3RoVmFsdWUsIGluZGV4LCBhcnJheSwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29tcGFyZWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChjb21wYXJlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vIFJlY3Vyc2l2ZWx5IGNvbXBhcmUgYXJyYXlzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgaWYgKCFhcnJheVNvbWUob3RoZXIsIGZ1bmN0aW9uKG90aFZhbHVlLCBvdGhJbmRleCkge1xuICAgICAgICAgICAgICAgIGlmICghY2FjaGVIYXMoc2Vlbiwgb3RoSW5kZXgpICYmXG4gICAgICAgICAgICAgICAgICAgIChhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKGFyclZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKSkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlZW4ucHVzaChvdGhJbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAg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AgICByZXR1cm4gb2JqZWN0ID09IChvdGhlciArICcnKTtcblxuICAgICAgICBjYXNlIG1hcFRhZzpcbiAgICAgICAgICB2YXIgY29udmVydCA9IG1hcFRvQXJyYXk7XG5cbiAgICAgICAgY2FzZSBzZXRUYWc6XG4gICAgICAgICAgdmFyIGlzUGFydGlhbCA9IGJpdG1hc2sgJiBDT01QQVJFX1BBUlRJQUxfRkxBRztcbiAgICAgICAgICBjb252ZXJ0IHx8IChjb252ZXJ0ID0gc2V0VG9BcnJheSk7XG5cbiAgICAgICAgICBpZiAob2JqZWN0LnNpemUgIT0gb3RoZXIuc2l6ZSAmJiAhaXNQYXJ0aWFsKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICAgIC8vIEFzc3VtZSBjeWNsaWMgdmFsdWVzIGFyZSBlcXVhbC5cbiAgICAgICAgICB2YXIgc3RhY2tlZCA9IHN0YWNrLmdldChvYmplY3QpO1xuICAgICAgICAgIGlmIChzdGFja2VkKSB7XG4gICAgICAgICAgICByZXR1cm4gc3RhY2tlZCA9PSBvdGhlcjtcbiAgICAgICAgICB9XG4gICAgICAgICAgYml0bWFzayB8PSBDT01QQVJFX1VOT1JERVJFRF9GTEFHO1xuXG4gICAgICAgICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBvYmplY3RzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgICAgc3RhY2suc2V0KG9iamVjdCwgb3RoZXIpO1xuICAgICAgICAgIHZhciByZXN1bHQgPSBlcXVhbEFycmF5cyhjb252ZXJ0KG9iamVjdCksIGNvbnZlcnQob3RoZXIpLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKTtcbiAgICAgICAgICBzdGFja1snZGVsZXRlJ10ob2JqZWN0KTtcbiAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuXG4gICAgICAgIGNhc2Ugc3ltY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IG90aFN0YWNrZWQgPT0gb2JqZWN0O1xuICAgICAgfVxuICAgICAgdmFyIHJlc3VsdCA9IHRydWU7XG4gICAgICBzdGFjay5zZXQob2JqZWN0LCBvdGhlcik7XG4gICAgICBzdGFjay5zZXQob3RoZXIsIG9iamVjdCk7XG5cbiAgICAgIHZhciBza2lwQ3RvciA9IGlzUGFydGlhbDtcbiAgICAgIHdoaWxlICgrK2luZGV4IDwgb2JqTGVuZ3RoKSB7XG4gICAgICAgIGtleSA9IG9ialByb3BzW2luZGV4XTtcbiAgICAgICAgdmFyIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2tleV07XG5cbiAgICAgICAgaWYgKGN1c3RvbWl6ZXIpIHtcbiAgICAgICAgICB2YXIgY29tcGFyZWQgPSBpc1BhcnRpYWxcbiAgICAgICAgICAgID8gY3VzdG9taXplcihvdGhWYWx1ZSwgb2JqVmFsdWUsIGtleSwgb3RoZXIsIG9iamVjdCwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIob2JqVmFsdWUsIG90aFZhbHVlLCBrZXksIG9iamVjdCwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIG9iamVjdHMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICAgICAgaWYgKCEoY29tcGFyZWQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA/IChvYmpWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKG9ialZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKVxuICAgICAgICAgICAgICA6IGNvbXBhcmVkXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICA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ICAgIHZhciBpbmRleCA9IC0xLFxuICAgICAgICAgIGxlbmd0aCA9IHBhdGgubGVuZ3RoLFxuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pO1xuICAgICAgICBpZiAoIShyZXN1bHQgPSBvYmplY3QgIT0gbnVsbCAmJiBoYXNGdW5jKG9iamVjdCwga2V5KSkpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBvYmplY3QgPSBvYmplY3Rba2V5XTtcbiAgICAgIH1cbiAgICAgIGlmIChyZXN1bHQgfHwgKytpbmRleCAhPSBsZW5ndGgpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICAgIGxlbmd0aCA9IG9iamVjdCA9PSBudWxsID8gMCA6IG9iamVjdC5sZW5ndGg7XG4gICAgICByZXR1cm4gISFsZW5ndGggJiYgaXNMZW5ndGgobGVuZ3RoKSAmJiBpc0luZGV4KGtleSwgbGVuZ3RoKSAmJlxuICAgICAgICAoaXNBcnJheShvYmplY3QpIHx8IGlzQXJndW1lbnRzKG9iamVjdCkpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluaXRpYWxpemVzIGFuIGFycmF5IGNsb25lLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBpbml0aWFsaXplZCBjbG9uZS5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpbml0Q2xvbmVBcnJheShhcnJheSkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5Lmxlbmd0aCxcbiAgICAgICAgICByZXN1bHQgPSBuZXcgYXJyYXkuY29uc3RydWN0b3IobGVu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GhlIHZhbHVlcyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsnYScsICdiJywgJ2MnLCAnYScsICdiJywgJ2MnXTtcbiAgICAgKlxuICAgICAqIF8ucHVsbChhcnJheSwgJ2EnLCAnYycpO1xuICAgICAqIGNvbnNvbGUubG9nKGFycmF5KTtcbiAgICAgKiAvLyA9PiBbJ2InLCAnYiddXG4gICAgICovXG4gICAgdmFyIHB1bGwgPSBiYXNlUmVzdChwdWxsQWxsKTtcblxuICAgIC8qKlxuICAgICAqIFRoaXMgbWV0aG9kIGlzIGxpa2UgYF8ucHVsbGAgZXhjZXB0IHRoYXQgaXQgYWNjZXB0cyBhbiBhcnJheSBvZiB2YWx1ZXMgdG8gcmVtb3ZlLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFVubGlrZSBgXy5kaWZmZXJlbmNlYCwgdGhpcyBtZXRob2QgbXV0YXRlcyBgYXJyYXlgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IEFycmF5XG4gICAgICogQHBhcmFtIHtBcnJheX0gYXJyYXkgVGhlIGFycmF5IHRvIG1vZGlmeS5cbiAgICAgKiBAcGFyYW0ge0FycmF5fSB2YWx1ZXMgVGhlIHZhbHVlcyB0byByZW1vdmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIGBhcnJheWAuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsnYScsICdiJywgJ2MnLCAnYScsICdiJywgJ2MnXTtcbiAgICAgKlxuICAgICAqIF8ucHVsbEFsbChhcnJheSwgWydhJywgJ2MnXSk7XG4gICAgICogY29uc29sZS5sb2coYXJyYXkpO1xuICAgICA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cbiAgICAgKlxuICAgICAqIF8udGFrZShbMSwgMiwgM10sIDApO1xuICAgICAqIC8vID0+IFtdXG4gICAgICovXG4gICAgZnVuY3Rpb24gdGFrZShhcnJheSwgbiwgZ3VhcmQpIHtcbiAgICAgIGlmICghKGFycmF5ICYmIGFycmF5Lmxlbmd0aCkpIHtcbiAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgfVxuICAgICAgbiA9IChndWFyZCB8fCBuID09PSB1bmRlZmluZWQpID8gMSA6IHRvSW50ZWdlcihuKTtcbiAgICAgIHJldHVybiBiYXNlU2xpY2UoYXJyYXksIDAsIG4gPCAwID8gMCA6IG4pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYSBzbGljZSBvZiBgYXJyYXlgIHdpdGggYG5gIGVsZW1lbnRzIHRha2VuIGZyb20gdGhlIGVuZC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSAzLjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBxdWVyeS5cbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW249MV0gVGhlIG51bWJlciBvZiBlbGVtZW50cyB0byB0YWtlLlxuICAgICAqIEBwYXJhbS0ge09iamVjdH0gW2d1YXJkXSBFbmFibGVzIHVzZSBhcyBhbiBpdGVyYXRlZSBmb3IgbWV0aG9kcyBsaWtlIGBfLm1hcGAuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBzbGljZSBvZiBgYXJyYXlgLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBfLnRha2VSaWdodChbMSwgMiwgM10pO1xuICAgICAqIC8vID0+IFszXVxuICAgICAqXG4gICAgICogXy50YWtlUmlnaHQoWzEsIDIsIDNdLCAyKTtcbiAgICAgKiAvLyA9PiBbMi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9XG4gICAgICAgIGxhc3RJbnZva2VUaW1lID0gMDtcbiAgICAgICAgbGFzdEFyZ3MgPSBsYXN0Q2FsbFRpbWUgPSBsYXN0VGhpcyA9IHRpbWVySWQgPSB1bmRlZmluZWQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGZsdXNoKCkge1xuICAgICAgICByZXR1cm4gdGltZXJJZCA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogdHJhaWxpbmdFZGdlKG5vdygpKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZGVib3VuY2VkKCkge1xuICAgICAgICB2YXIgdGltZSA9IG5vdygpLFxuICAgICAgICAgICAgaXNJbnZva2luZyA9IHNob3VsZEludm9rZSh0aW1lKTtcblxuICAgICAgICBsYXN0QXJncyA9IGFyZ3VtZW50cztcbiAgICAgICAgbGFzdFRoaXMgPSB0aGlzO1xuICAgICAgICBsYXN0Q2FsbFRpbWUgPSB0aW1lO1xuXG4gICAgICAgIGlmIChpc0ludm9raW5nKSB7XG4gICAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIGxlYWRpbmdFZGdlKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChtYXhpbmcpIHtcbiAgICAgICAgICAgIC8vIEhhbmRsZSBpbnZvY2F0aW9ucyBpbiBhIHRpZ2h0IGxvb3AuXG4gICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXJJZCk7XG4gICAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICAgICAgcmV0dXJuIGludm9rZUZ1bmMobGFzdENhbGxUaW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHRpbWVySWQgPSBzZXRUaW1lb3V0KHRpbWV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QgaXMgbG9vc2VseSBiYXNlZCBvblxuICAgICAqIFtgVG9JbnRlZ2VyYF0oaHR0cDovL3d3dy5lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLXRvaW50ZWdlcikuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4wLjBcbiAgICAgKiBAY2F0ZWdvcnkgTGFuZ1xuICAgICAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNvbnZlcnQuXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgY29udmVydGVkIGludGVnZXIuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udG9JbnRlZ2VyKDMuMik7XG4gICAgICogLy8gPT4gM1xuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoTnVtYmVyLk1JTl9WQUxVRSk7XG4gICAgICogLy8gPT4gMFxuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IDEuNzk3NjkzMTM0ODYyMzE1N2UrMzA4XG4gICAgICpcbiAgICAgKiBfLnRvSW50ZWdlcignMy4yJyk7XG4gICAgICogLy8gPT4gM1xuICAgICAqL1xuICAgIGZ1bmN0aW9uIHRvSW50ZWdlcih2YWx1ZSkge1xuICAgICAgdmFyIHJlc3VsdCA9IHRvRmluaXRlKHZhbHVlKSxcbiAgICAgICAgICByZW1haW5kZXIgPSByZXN1bHQgJSAxO1xuXG4gICAgICByZXR1cm4gcmVzdWx0ID09PSByZXN1bHQgPyAocmVtYWluZGVyID8gcmVzdWx0IC0gcmVtYWluZGVyIDogcmVzdWx0KSA6IDA7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgYHZhbHVlYCB0byBhbiBpbnRlZ2VyIHN1aXRhYmxlIGZvciB1c2UgYXMgdGhlIGxlbmd0aCBvZ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ICAgICAgfVxuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIgc291cmNlID0gc291cmNlc1tpbmRleF07XG4gICAgICAgIHZhciBwcm9wcyA9IGtleXNJbihzb3VyY2UpO1xuICAgICAgICB2YXIgcHJvcHNJbmRleCA9IC0xO1xuICAgICAgICB2YXIgcHJvcHNMZW5ndGggPSBwcm9wcy5sZW5ndGg7XG5cbiAgICAgICAgd2hpbGUgKCsrcHJvcHNJbmRleCA8IHByb3BzTGVuZ3RoKSB7XG4gICAgICAgICAgdmFyIGtleSA9IHByb3BzW3Byb3BzSW5kZXhdO1xuICAgICAgICAgIHZhciB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHxcbiAgICAgICAgICAgICAgKGVxKHZhbHVlLCBvYmplY3RQcm90b1trZXldKSAmJiAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpKSB7XG4gICAgICAgICAgICBvYmplY3Rba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICByZXR1cm4gb2JqZWN0O1xuICAgIH0pO1xuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgaXMgbGlrZSBgXy5kZWZhdWx0c2AgZXhjZXB0IHRoYXQgaXQgcmVjdXJzaXZlbHkgYXNzaWduc1xuICAgICAqIGRlZmF1bHQgcHJvcGVydGllcy5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBUaGlzIG1ldGhvZCBtdXRhdGVzIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDMuMTAuMFxuICAgICAqIEBjYXRlZ29yeSBPYmplY3RcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBkZXN0aW5hdGl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wbGFjZShyZUVtcHR5U3RyaW5nTGVhZGluZywgJycpIDogc291cmNlKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nTWlkZGxlLCAnJDEnKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nVHJhaWxpbmcsICckMTsnKTtcblxuICAgICAgLy8gRnJhbWUgY29kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2NhcGUnXG4gICAgICAgICAgIDogJydcbiAgICAgICAgKSArXG4gICAgICAgIChpc0V2YWx1YXRpbmdcbiAgICAgICAgICA/ICcsIF9faiA9IEFycmF5LnByb3RvdHlwZS5qb2luO1xcbicgK1xuICAgICAgICAgICAgXCJmdW5jdGlvbiBwcmludCgpIHsgX19wICs9IF9fai5jYWxsKGFyZ3VtZW50cywgJycpIH1cXG5cIlxuICAgICAgICAgIDogJztcXG4nXG4gICAgICAgICkgK1xuICAgICAgICBzb3VyY2UgK1xuICAgICAgICAncmV0dXJuIF9fcFxcbn0nO1xuXG4gICAgICB2YXIgcmVzdWx0ID0gYXR0ZW1wdChmdW5jdGlvbigpIHtcbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uKGltcG9ydHNLZXlzLCBzb3VyY2VVUkwgKyAncmV0dXJuICcgKyBzb3VyY2UpXG4gICAgICAgICAgLmFwcGx5KHVuZGVmaW5lZCwgaW1wb3J0c1ZhbHVlcyk7XG4gICAgICB9KTtcblxuICAgICAgLy8gUHJvdmlkZSB0aG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Q2hhcHRlckNvbnRyb2xsZXInO1xuICAgICAqICAgICAgICAgICRzY29wZS5wYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgIC5jb25maWcoZnVuY3Rpb24oJHJvdXRlUHJvdmlkZXIsICRsb2NhdGlvblByb3ZpZGVyKSB7XG4gICAgICogICAgICAgJHJvdXRlUHJvdmlkZXJcbiAgICAgKiAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQnLCB7XG4gICAgICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2Jvb2suaHRtbCcsXG4gICAgICogICAgICAgICBjb250cm9sbGVyOiAnQm9va0NvbnRyb2xsZXInLFxuICAgICAqICAgICAgICAgcmVzb2x2ZToge1xuICAgICAqICAgICAgICAgICAvLyBJIHdpbGwgY2F1c2UgYSAxIHNlY29uZCBkZWxheVxuICAgICAqICAgICAgICAgICBkZWxheTogZnVuY3Rpb24oJHEsICR0aW1lb3V0KSB7XG4gICAgICogICAgICAgICAgICAgdmFyIGRlbGF5ID0gJHEuZGVmZXIoKTtcbiAgICAgKiAgICAgICAgICAgICAkdGltZW91dChkZWxheS5yZXNvbHZlLCAxMDAwKTtcbiAgICAgKiAgICAgICAgICAgICByZXR1cm4gZGVsYXkucHJvbWlzZTtcbiAgICAgKiAgICAgICAgICAgfVxuICAgICAqICAgICAgICAgfVxuICAgICAqICAgICAgIH0pXG4gICAgICogICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQvY2gvOmNoYXB0ZXJJZCcsIHtcbiAgICAgKiAgICAgICAgIHRlbXBsYXRlVXJsOiAnY2hhcHRlci5odG1sJyxcbiAgICAgKiAgICAgICAgIGNvbnRyb2xsZXI6ICdDaGFwdGVyQ29udHJvbGxlcidcbiAgICAgKiAgICAgICB9KTtcbiAgICAgKlxuICAgICAqICAgICAgIC8vIGNvbmZpZ3VyZSBodG1sNSB0byBnZXQgbGlua3Mgd29ya2luZyBvbiBqc2ZpZGRsZVxuICAgICAqICAgICAgICRsb2NhdGlvblByb3ZpZGVyLmh0bWw1TW9kZSh0cnVlKTtcbiAgICAgKiAgICAgfSk7XG4gICAgICpcbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICAgICAqICAgICBpdCgnc2hvdWxkIGxvYWQgYW5kIGNvbXBpbGUgY29ycmVjdCB0ZW1wbGF0ZScsIGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgIGVsZW1lbnQoYnkubGlua1RleHQoJ01vYnk6IENoMScpKS5jbGljaygpO1xuICAgICAqICAgICAgIHZhciBjb250ZW50ID0gZWxlbWVudChieS5jc3MoJ1tuZy12aWV3XScpKS5nZXRUZXh0KCk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL2NvbnRyb2xsZXI6IENoYXB0ZXJDb250cm9sbGVyLyk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL0Jvb2sgSWQ6IE1vYnkvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQ2hhcHRlciBJZDogMS8pO1xuICAgICAqXG4gICAgICogICAgICAgZWxlbWVudChieS5wYXJ0aWFsTGlua1RleHQoJ1NjYXJsZXQnKSkuY2xpY2soKTtcbiAgICAgKlxuICAgICAqICAgICAgIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQm9va0NvbnRyb2xsZXIvKTtcbiAgICAgKiAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogU2NhcmxldC8pO1xuICAgICAqICAgICB9KTtcbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKiA8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WaWV3fVxuICAgICAgICAgICAqIGNyZWF0ZXMgbmV3IHNjb3BlIGFuZCByZWluc3RhbnRpYXRlcyB0aGUgY29udHJvbGxlci5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICByZWxvYWQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZm9yY2VSZWxvYWQgPSB0cnVlO1xuXG4gICAgICAgICAgICB2YXIgZmFrZUxvY2F0aW9uRXZlbnQgPSB7XG4gICAgICAgICAgICAgIGRlZmF1bHRQcmV2ZW50ZWQ6IGZhbHNlLFxuICAgICAgICAgICAgICBwcmV2ZW50RGVmYXVsdDogZnVuY3Rpb24gZmFrZVByZXZlbnREZWZhdWx0KCkge1xuICAgICAgICAgICAgICAgIHRoaXMuZGVmYXVsdFByZXZlbnRlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgZm9yY2VSZWxvYWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgJHJvb3RTY29wZS4kZXZhbEFzeW5jKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBwcmVwYXJlUm91dGUoZmFrZUxvY2F0aW9uRXZlbnQpO1xuICAgICAgICAgICAgICBpZiAoIWZha2VMb2NhdGlvbkV2ZW50LmRlZmF1bHRQcmV2ZW50ZWQpIGNvbW1pdFJvdXRlKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lICRyb3V0ZSN1cGRhdGVQYXJhbXNcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIENhdXNlcyBgJHJvdXRlYCBzZXJ2aWNlIHRvIHVwZGF0ZSB0aGUgY3VycmVudCBVUkwsIHJlcGxhY2luZ1xuICAgICAgICAgICAqIGN1cnJlbnQgcm91dGUgcGFyYW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GRhdGEuaGFzUmVkaXJlY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChyb3V0ZS5yZXNvbHZlUmVkaXJlY3RUbykge1xuICAgICAgICAgIHJldHVybiAkcS5cbiAgICAgICAgICAgIHJlc29sdmUoJGluamVjdG9yLmludm9rZShyb3V0ZS5yZXNvbHZlUmVkaXJlY3RUbykpLlxuICAgICAgICAgICAgdGhlbihmdW5jdGlvbihuZXdVcmwpIHtcbiAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKG5ld1VybCkpIHtcbiAgICAgICAgICAgICAgICBkYXRhLnVybCA9IG5ld1VybDtcbiAgICAgICAgICAgICAgICBkYXRhLmhhc1JlZGlyZWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHJldHVybiBkYXRhO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgcmV0dXJuIGRhdGE7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gaGFuZGxlUG9zc2libGVSZWRpcmVjdGlvbihkYXRhKSB7XG4gICAgICB2YXIga2VlcFByb2Nlc3NpbmdSb3V0ZSA9IHRydWU7XG5cbiAgICAgIGlmIChkYXRhLnJvdXRlICE9PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICBrZWVwUHJvY2Vzc2luZ1JvdXRlID0gZmFsc2U7XG4gICAgICB9IGVsc2UgaWYgKGRhdGEuaGFzUmVkaXJlY3Rpb24pIHtcbiAgICAgICAgdmFyIG9sZFVybCA9ICRsb2NhdGlvbi51cmwoKTtcbiAgICAgICAgdmFyIG5ld1VybCA9IGRhdGEudXJsO1xuXG4gICAgICAgIGlmIChuZXdVcmwpIHtcbiAgICAgICAgICAkbG9jYXRpb24uXG4gICAgICAgICAgICB1cmwobmV3VXJsKS5cbiAgICAgICAgICAgIHJlcGxhY2UoKT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lLmN1cnJlbnQucGFyYW1zID0ge3ttYWluLiRyb3V0ZS5jdXJyZW50LnBhcmFtc319PC9wcmU+XG4gICAgICAgICAgPHByZT4kcm91dGVQYXJhbXMgPSB7e21haW4uJHJvdXRlUGFyYW1zfX08L3ByZT5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJib29rLmh0bWxcIj5cbiAgICAgICAgPGRpdj5cbiAgICAgICAgICBjb250cm9sbGVyOiB7e2Jvb2submFtZX19PGJyIC8+XG4gICAgICAgICAgQm9vayBJZDoge3tib29rLnBhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvZmlsZT5cblxuICAgICAgPGZpbGUgbmFtZT1cImNoYXB0ZXIuaHRtbFwiPlxuICAgICAgICA8ZGl2PlxuICAgICAgICAgIGNvbnRyb2xsZXI6IHt7Y2hhcHRlci5uYW1lfX08YnIgLz5cbiAgICAgICAgICBCb29rIElkOiB7e2NoYXB0ZXIucGFyYW1zLmJvb2tJZH19PGJyIC8+XG4gICAgICAgICAgQ2hhcHRlciBJZDoge3tjaGFwdGVyLnBhcmFtcy5jaGFwdGVySWR9fVxuICAgICAgICA8L2Rpdj5cbiAgICAgIDwvZmlsZT5cblxuICAgICAgPGZpbGUgbmFtZT1cImFuaW1hdGlvbnMuY3NzXCI+XG4gICAgICAgIC52aWV3LWFuaW1hdGUtY29udGFpbmVyIHtcbiAgICAgICAgICBwb3NpdGlvbjpyZWxhdGl2ZTtcbiAgICAgICAgICBoZWlnaHQ6MTAwcHghaW1wb3J0YW50O1xuICAgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7XG4gICAgICAgICAgYm9yZGVyOjFweCBzb2xpZCBibGFjaztcbiAgICAgICAgICBoZWlnaHQ6NDBweDtcbiAgICAgICAgICBvdmVyZmxvdzpoaWRkZW47XG4gICAgICAgIH1cblxuICAgICAgICAudmlldy1hbmltYXRlIHtc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UHJvdmlkZXIsICRsb2NhdGlvblByb3ZpZGVyKSB7XG4gICAgICAgICAgICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICAgICAgICAgICAgLndoZW4oJy9Cb29rLzpib29rSWQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2Jvb2suaHRtbCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQm9va0N0cmwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlckFzOiAnYm9vaydcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkL2NoLzpjaGFwdGVySWQnLCB7XG4gICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoYXB0ZXIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQ2hhcHRlckN0cmwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlckFzOiAnY2hhcHRlcidcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAkbG9jYXRpb25Qcm92aWRlci5odG1sNU1vZGUodHJ1ZSk7XG4gICAgICAgICAgfV0pXG4gICAgICAgICAgLmNvbnRyb2xsZXIoJ01haW5DdHJsJywgWyckcm91dGUnLCAnJHJvdXRlUGFyYW1zJywgJyRsb2NhdGlvbicsXG4gICAgICAgICAgICBmdW5jdGlvbiBNYWluQ3RybCgkcm91dGUsICRyb3V0ZVBhcmFtcywgJGxvY2F0aW9uKSB7XG4gICAgICAgICAgICAgIHRoaXMuJHJvdXRlID0gJHJvdXRlO1xuICAgICAgICAgICAgICB0aGlzLiRsb2NhdGlvbiA9ICRsb2NhdGlvbjtcbiAgICAgICAgICAgICAgdGhpcy4kcm91dGVQYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICAgICAgfV0pXG4gICAgICAgICAgLmNvbnRyb2xsZXIoJ0Jvb2tDdHJsJywgWyckcm91dGVQYXJhbXMnLCBmdW5jdGlvbiBCb29rQ3RybCgkcm91dGVQYXJhbXMpIHtcbiAgICAgICAgICAgIHRoaXMubmFtZSA9ICdCb29rQ3RybCc7XG4gICAgICAgICAgICB0aGlzLnBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgICAgICB9XSlcbiAgICAgICAgICAuY29udHJvbGxlcignQ2hhcHRlckN0cmwnLCBbJyRyb3V0ZVBhcmFtcycsIGZ1bmN0aW9uIENoYXB0ZXJDdHJsKCRyb3V0ZVBhcmFtcykge1xuICAgICAgICAgICAgdGhpcy5uYW1lID0gJ0NoYXB0ZXJDdHJsJztcbiAgICAgICAgICAgIHRoaXMucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAgICAgIH1dKTtcblxuICAgICAgPC9maWxlPlxuXG4gICAgICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICAgIGl0KCdzaG91bGQgbG9hZCBhbmQgY29tcGlsZSBjb3JyZWN0IHRlbXBsYXRlJywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgZWxlbWVudChieS5saW5rVGV4dCgnTW9ieTogQ2gxJykpLmNsaWNrKCk7XG4gICAgICAgICAgdmFyIGNvbnRlbnQgPSBlbGVtZW50KGJ5LmNzcygnW25nLXZpZXddJykpLmdldFRleHQoKTtcbiAgICAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvY29udHJvbGxlcjogQ2hhcHRlckN0cmwvKTtcbiAgICAgICAgICBleHBlY3QoY29udGVudCkudG9NYXRjaCgvQm9vayBJZDogTW9ieS8pO1xuICAgICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9DaGFwdGVyIElkOiAxLyk7XG5cbiAgICAgICAgICBlbGVtZW50KGJ5LnBhcnRpYWxMaW5rVGV4dCgnU2NhcmxldCcpKS5jbGljaygpO1xuXG4gICAgICAgICAgY29udGVudCA9IGVsZW1lbnQoY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ICAgICAgICAgICAgb25sb2FkRXhwID0gYXR0ci5vbmxvYWQgfHwgJyc7XG5cbiAgICAgICAgc2NvcGUuJG9uKCckcm91dGVDaGFuZ2VTdWNjZXNzJywgdXBkYXRlKTtcbiAgICAgICAgdXBkYXRlKCk7XG5cbiAgICAgICAgZnVuY3Rpb24gY2xlYW51cExhc3RWaWV3KCkge1xuICAgICAgICAgIGlmIChwcmV2aW91c0xlYXZlQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICAkYW5pbWF0ZS5jYW5jZWwocHJldmlvdXNMZWF2ZUFuaW1hdGlvbik7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoY3VycmVudFNjb3BlKSB7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGRlc3Ryb3koKTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChjdXJyZW50RWxlbWVudCkge1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbiA9ICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KTtcbiAgICAgICAgICAgIHByZXZpb3VzTGVhdmVBbmltYXRpb24uZG9uZShmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlKSBwcmV2aW91c0xlYXZlQW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHVwZGF0ZSgpIHtcbiAgICAgICAgICB2YXIgbG9jYWxzID0gJHJvdXRlLmN1cnJlbnQgJiYgJHJvdXRlLmN1cnJlbnQubG9jYWxzLFxuICAgICAgICAgICAgICB0ZW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WQpO1xuXG4gICAgICAgICAgICB2YXIgbGFiZWwgPSBcIlwiO1xuICAgICAgICAgICAgaWYgKG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlICE9IFwidG0uRmxvd1wiICYmIG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlICE9IFwidG0uQm91bmRhcnlcIikge1xuICAgICAgICAgICAgICAgIGxhYmVsID0gJ0NvcHkgb2YgJyArIG5ld0VsZW1lbnQuYXR0cmlidXRlcy5hdHRycy50ZXh0LnRleHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvL0lmIHRoZSBlbGVtZW50IGlzIGEgZmxvdyBvciBhIGJvdW5kYXJ5LCBtYWtlIHN1cmUgdGhlIGxhYmVsIGlzIGRlZmluZWQgYmVmb3JlIGNvcHlpbmcgaXRcbiAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzICE9IFwidW5kZWZpbmVkXCIpIHtcbiAgICAgICAgICAgICAgICBsYWJlbCA9ICdDb3B5IG9mICcgKyBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzWzBdLmF0dHJzLnRleHQudGV4dDsgICBcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlID09IFwidG0uRmxvd1wiIHx8IG5ld0VsZW1lbnQuYXR0cmlidXRlcy50eXBlID09IFwidG0uQm91bmRhcnlcIikgeyAgICBcbiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMuc291cmNlID0geyd4JyA6IDMwLCAneScgOiAyMH07XG4gICAgICAgICAgICAgICAgbmV3RWxlbWVudC5hdHRyaWJ1dGVzLnRhcmdldCA9IHsneCcgOiAxMTAsICd5JyA6IDEwMH07XG4gICAgICAgICAgICAgICAgaWYgKGxhYmVsICE9IFwiXCIpe1xuICAgICAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMubGFiZWxzWzBdLmF0dHJzLnRleHQudGV4dCA9IGxhYmVsO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkZWxldGUgbmV3RWxlbWVudC5hdHRyaWJ1dGVzLnZlcnRpY2VzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIGhlaWdodCA9IG5ld0VsZW1lbnQuYXR0cmlidXRlcy5zaXplLmhlaWdodCArIDIwO1xuICAgICAgICAgICAgICAgIG5ld0VsZW1lbnQuYXR0cmlidXRlcy5wb3NpdGlvbi55ICs9IGhlaWdodDtcbiAgICAgICAgICAgICAgICBuZXdFbGVtZW50LmF0dHJpYnV0ZXMuYXR0cnMudGV4dC50ZXh0ID0gbGFiZWw7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBkaWFncmFtRGF0YSA9IHsgZGlhZ3JhbUpzb246IHsgY2VsbHM6IHZtLmdyYXBoLmdldENlbGxzKCkgfSB9O1xuICAgICAgICAgICAgdm0uZ3JhcGguaW5pdGlhbGlzZShkaWFncmFtRGF0YS5kaWFncmFtSnNvbik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBvbkdlbmVyYXRlVGhyZWF0cyh0aHJlYXRzKSB7XG4gICAgICAgIHZhciB0aHJlYXRUb3RhbCA9IHRocmVhdHMubGVuZ3RoO1xuICAgICAgICB2YXIgdGhyZWF0TGlzdCA9IHRocmVhdHM7XG4gICAgICAgIHZhciBjdXJyZW50VGhyZWF0O1xuICAgICAgICB2YXIgdGVtcGxhdGU7XG4gICAgICAgIHN1Z2dlc3RUaHJlYXQoKTtcblxuICAgICAgICBmdW5jdGlvbiBzdWdnZXN0VGhyZWF0KCkge1xuICAgICAgICAgICAgaWYgKHRocmVhdExpc3QubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGN1cnJlbnRUaHJlYXQgPSB0aHJlYXRMaXN0LnNoaWZ0KCk7XG4gICAgICAgICAgICAgICAgc2VsZWN0VGVtcGxhdGUoY3VycmVudFRocmVhdC5tb2RlbFR5cGUpO1xuICAgICAgICAgICAgICAgIGRpYWxvZ3MuY29uZmlybSh0ZW1wbGF0ZSxcbiAgICAgICAgICAgICAgICAgICAgYWRkVGhyZWF0LFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRpbmc6ICdBZGQgdGhpcyB0aHJlYXQ/JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJlYXQ6IGN1cnJlbnRUaHJlYXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWRpdGluZzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWF0SW5kZXg6IHRocmVhdFRvdGFsIC0gdGhyZWF0TGlzdC5sZW5ndGgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWF0VG90YWw6IHRocmVhdFRvdGFsXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpZ25vcmVUaHJlYXQsXG4gICAgICAgICAgICAgICAgICAgICdmYWRlLXJpZ2h0J1xuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBhZGRUaHJlYXQoYXBwbHlUb0FsbCkge1xuICAgICAgICAgICAgdm0uc2V0RGlydHkoKTtcblxuICAgICAgICAgICAgaWYgKF8uaXNVbmRlZmluZWQodm0uc2VsZWN0ZWQudGhyZWF0cykpIHtcbiAgICAgICAgICAgICAgICB2bS5zZWxlY3RlZC50aHJlYXRzID0gW107XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZtLnNlbGVjdGVkLnRocmVhdHMucHVzaChjdXJyZW50VGhyZWF0KTtcblxuICAgICAgICAgICAgaWYgKGFwcGx5VG9BbGwpIHtcbiAgICAgICAgICAgICAgICB0aHJlYXRMaXN0LmZvckVhY2goZnVuY3Rpb24gKHRocmVhdCkge1xuXG4gICAgICAgICAgICAgICAgICAgIHZtLnNlbGVjdGVkLnRocmVhdHMucHVzaCh0aHJlYXQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgJHRpbWVvdXQoc3VnZ2VzdFRocmVhdCwgNTAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGlnbm9yZVRocmVhdChhcHBseVRvQWxsKSB7XG4gICAgICAgICAgICBpZiAoIWFwcGx5VG9BbGwpIHtcbiAgICAgICAgICAgICAgICAkdGltZW91dChzdWdnZXN0VGhyZWF0LCA1MDApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gc2VsZWN0VGVtcGxhdGUodHlwZSkge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlID0gJ2RpYWdyYW1zL1N0cmlkZUVkaXRQYW5lLmh0bWwnO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09ICdDSUEnKSB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGUgPSAnZGlhZ3JhbXMvQ2lhRWRpdFBhbmUuaHRtbCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ0xJTkREVU4nKSB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGUgPSAnZGlhZ3JhbXMvTGluZGR1bkVkaXRQYW5lLmh0bWwnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZSA9ICdkaWFncmF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lhZ3JhbSBpcyBhY3RpdmVcbiAgICAgICAgaWYgKHZtLmN1cnJlbnREaWFncmFtLmVsID09PSAkZG9jdW1lbnRbMF0uYWN0aXZlRWxlbWVudCkge1xuICAgICAgICAgICAgaWYgKHZtLnNlbGVjdGVkKSB7XG4gICAgICAgICAgICAgICAgdm0uY29waWVkID0gdm0uc2VsZWN0ZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBwYXN0ZUhvdGtleShldmVudCwgaGFuZGxlcikge1xuICAgICAgICAvLyBpZiB0aGUgY3VycmVudCBkaWFncmFtIGlzIGFjdGl2ZVxuICAgICAgICBpZiAodm0uY3VycmVudERpYWdyYW0uZWwgPT09ICRkb2N1bWVudFswXS5hY3RpdmVFbGVtZW50KSB7XG4gICAgICAgICAgICBpZiAodm0uY29waWVkKSB7XG4gICAgICAgICAgICAgICAgdm0uc2VsZWN0KHZtLmNvcGllZCk7XG4gICAgICAgICAgICAgICAgdm0uZHVwbGljYXRlRWxlbWVudCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gdXBkYXRlRGlhZ3JhbVR5cGUoKSB7XG4gICAgICAgIHZhciB0eXBlID0gdm0uZGlhZ3JhbS5kaWFncmFtVHlwZTtcbiAgICAgICAgaWYgKHR5cGUgPT0gbnVsbCkge1xuICAgICAgICAgICAgdm0uZGlhZ3JhbS50aHVtYm5haWwgPSAnLi9wdWJsaWMvY29udGVudC9pbWFnZXMvdGh1bWJuYWlsLnN0cmlkZS5qcGcnO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gJ0NJQScpIHtcbiAgICAgICAgICAgIHZtLmRpYWdyYW0udGh1bWJuYWlsID0gJy4vcHVibGljL2NvbnRlbnQvaW1hZ2VzL3RodW1ibmFpbC5jaWEuanBnJztcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09ICdMSU5ERFVOJykge1xuICA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nKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oY2VsbFZpZXcpO1xuXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChzZWxlY3RlZCAmJiAhc2VsZWN0ZWQubW9kZWwuaXNMaW5rKCkgJiYgc2VsZWN0ZWQubGlua0Zyb20pIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV3Rmxvdyh7IHNvdXJjZTogc2VsZWN0ZWQubW9kZWwsIHRhcmdldDogY2VsbFZpZXcubW9kZWwgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVMaW5rRnJvbShzZWxlY3RlZCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBzZXRTZWxlY3RlZChjZWxsVmlldyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdibGFuazpwb2ludGVyY2xpY2snLCBmdW5jdGlvbiAoKSB7XG5cbiAgICAgICAgICAgIGlmIChzZWxlY3RlZCAmJiAhc2VsZWN0ZWQubW9kZWwuaXNMaW5rKCkpIHtcbiAgICAgICAgICAgICAgICByZW1vdmVMaW5rRnJvbShzZWxlY3RlZCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHNldFNlbGVjdGVkKG51bGwpO1xuICAgICAgICB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdsaW5rOm9wdGlvbnMnLCBmdW5jdGlvbiAoY2VsbFZpZXcsIGV2dCkge1xuXG4gICAgICAgICAgICBpZiAoc2VsZWN0ZWQgJiYgIXNlbGVjdGVkLm1vZGVsLmlzTGluaygpKSB7XG4gICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oc2VsZWN0ZWQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZXRTZWxlY3RlZChjZWxsVmlldyk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGRpYWdyYW0ub24oJ2NlbGw6cG9pbnRlcm1vdmUnLCBmdW5jdGlvbiAoY2VsbFZpZXcsIGV2dCwgeCwgeSkge1xuXG4gICAgICAgICAgICB2YXIgY29uc3RyYWluZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIHZhciBjb25zdHJhaW5lZFggPSB4O1xuICAgICAgICAgICAgdmFyIGNvbnN0cmFpbmVkWSA9IHk7XG4gICAgICAgICAgICB2YXIgY2VsbFdpZHRoID0gY2VsbFZpZXcubW9kZWwuYXR0cmlidXRlcy5zaXplLndpZHRoO1xuICAgICAgICAgICAgdmFyIGNlbGxIZWlnaHQgPSBjZWxsVmlldy5tb2RlbC5hdHRyaWJ1dGVzLnNpemUuaGVpZ2h0O1xuICAgICAgICAgICAgdmFyIGNlbGxYID0geDtcbiAgICAgICAgICAgIHZhciBjZWxsWSA9IHk7XG4gICAgICAgICAgICB2YXIgYmJveCA9IGNlbGxWaWV3LmdldEJCb3goKTtcblxuICAgICAgICAgICAgaWYgKGNlbGxWaWV3Lm1vZGVsLmF0dHJpYnV0ZXMudHlwZSAhPSAndG0uRmxvdycgJiYgY2VsbFZpZXcubW9kZWwuYXR0cmlidXRlcy50eXBlICE9ICd0bS5Cb3VuZGFyeScpIHtcbiAgICAgICAgICAgICAgICAvL2JvdW5kYXJ5IGJveCBnaXZlcyBiZXR0ZXIgc2Nyb2xsaW5nIGZvciBlbGVtZW50cyBvdGhlciB0aGFuIGZsb3cgJiBib3VuZGFyeVxuICAgICAgICAgICAgICAgIGNlbGxYID0gYmJveC54O1xuICAgICAgICAgICAgICAgIGNlbGxZID0gYmJveC55O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL2NvbnN0cmFpbiBtb3ZlbWVudCB0byB4ID49IDBcbiAgICAgICAgICAgIGlmIChjZWxsWCA8PSAwKSB7XG4gICAgICAgICAgICAgICAgY29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lbGVtZW50KS5wYXJlbnQoKS53aWR0aCgpKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9jb25zdHJhaW4gbW92ZW1lbnQgdG8geSA+PSAwXG4gICAgICAgICAgICBpZiAoY2VsbFkgPD0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnN0cmFpbmVkWSA9IHkgKyBzY29wZS5ncmlkU2l6ZTtcbiAgICAgICAgICAgICAgICBjb25zdHJhaW5lZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY2VsbFkgPSAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL2V4cGFuZCB0aGUgZGlhZ3JhbSBkb3duXG4gICAgICAgICAgICBpZiAoY2VsbFkgKyBjZWxsSGVpZ2h0ID49IGRpYWdyYW0ub3B0aW9ucy5oZWlnaHQpIHtcbiAgICAgICAgICAgICAgICBkaWFncmFtLnNldERpbWVuc2lvbnMoZGlhZ3JhbS5vcHRpb25zLndpZHRoLCBjZWxsWSArIGNlbGxIZWlnaHQpO1xuICAgICAgICAgICAgICAgICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsVG9wKGRpYWdyYW0ub3B0aW9ucy5oZWlnaHQgLSBzY29wZS5oZWlnaHQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL3Njcm9sbCB0aGUgZGlhZ3JhbSB1cFxuICAgICAgICAgICAgaWYgKGNlbGxZIDw9ICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsVG9wKCkpIHtcbiAgICAgICAgICAgICAgICAkKGVsZW1lbnQpLnBhcmVudCgpLnNjcm9sbFRvcChjZWxsWSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vc2Nyb2xsIHRoZSBkaWFncmFtIGRvd25cbiAgICAgICAgICAgIGlmIChjZWxsWSArIGNlbGxIZWlnaHQgLSAkKGVsZW1lbnQpLnBhcmVudCgpLnNjcm9sbFRvcCgpID49ICQoZWxlbWVudCkucGFyZW50KCkuaGVpZ2h0KCkgJiYgY2VsbFkgKyBjZWxsSGVpZ2h0IDwgZGlhZ3JhbS5vcHRpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgICAgICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsVG9wKGNlbGxZICsgY2VsbEhlaWdodCAtICQoZWxlbWVudCkucGFyZW50KCkuaGVpZ2h0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoY29uc3RyYWluZWQpIHtcbiAgICAgICAgICAgICAgICBjZWxsVmlldy5wb2ludGVybW92ZShldnQsIGNvbnN0cmFpbmVkWCwgY29uc3RyYWluZWRZKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZGlhZ3JhbS5zZXRTZWxlY3RlZCA9IGZ1bmN0aW9uIChjZWxsKSB7XG5cbiAgICAgICAgICAgIGlmIChzZWxlY3RlZCkge1xuICAgICAgICAgICAgICAgIHNlbGVjdGVkLnNldFVuc2VsZWN0ZWQoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGNlbGwpIHtcbiAgICAgICAgICAgICAgICB2YXIgY2VsbFZpZXcgPSBkaWFncmFtLmZpbmRWaWV3QnlNb2RlbChjZWxsKTtcblxuICAgICAgICAgICAgICAgIGlmIChjZWxsVmlldykge1xuICAgICAgICAgICAgICAgICAgICBjZWxsVmlldy5zZXRTZWxlY3RlZCgpO1xuICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IGNlbGxWaWV3O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5pbml0aWFsaXNlR3JhcGgoeyBkaWFncmFtOiBkaWFncmFtIH0pO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGFkZExpbmt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IGRpYWxvZ3MpIHtcblxuICAgIHZhciBkaXJlY3RpdmUgPVxuICAgICAgICB7XG4gICAgICAgICAgICBsaW5rOiBsaW5rLFxuICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdkaWFncmFtcy9UaHJlYXRTdW1tYXJ5UGFuZS5odG1sJyxcbiAgICAgICAgICAgIHJlc3RyaWN0OiAnRScsXG4gICAgICAgICAgICBzY29wZTpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBzdWdnZXN0OiAnPScsXG4gICAgICAgICAgICAgICAgdGhyZWF0czogJz0nLFxuICAgICAgICAgICAgICAgIHR5cGU6ICc9JyxcbiAgICAgICAgICAgICAgICBzYXZlOiAnJicsXG4gICAgICAgICAgICAgICAgc2V0ZGlydHk6ICc9JyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIHZhciBuZXdUaHJlYXQ7XG4gICAgdmFyIGVkaXRJbmRleCA9IG51bGw7XG4gICAgdmFyIG9yaWdpbmFsVGhyZWF0ID0ge307XG4gICAgdmFyIGdldExvZ0ZuID0gY29tbW9uLmxvZ2dlci5nZXRMb2dGbjtcbiAgICB2YXIgbG9nRXJyb3IgPSBnZXRMb2dGbigndG10RWxlbWVudFRocmVhdHMnLCAnZXJyb3InKTtcblxuICAgIHJldHVybiBkaXJlY3RpdmU7XG5cbiAgICBmdW5jdGlvbiBsaW5rKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgICAgICBzY29wZS5hcHBseVRvQWxsID0gZmFsc2U7XG5cbiAgICAgICAgc2NvcGUub25TdWdnZXN0VGhyZWF0cyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHNjb3BlLnN1Z2dlc3Qoc2NvcGUudHlwZSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgc2NvcGUub25OZXdUaHJlYXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBuZXdUaHJlYXQgPSBpbml0aWFsaXNlVGhyZWF0KHN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AgIHNjb3BlLmFkZFRocmVhdCA9IGZ1bmN0aW9uICgpIHtcblxuICAgICAgICAgICAgaWYgKCFzY29wZS50aHJlYXRzKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUudGhyZWF0cyA9IFtdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzY29wZS50aHJlYXRzLnB1c2gobmV3VGhyZWF0KTtcbiAgICAgICAgICAgIHNjb3BlLnNhdmUoeyB0aHJlYXQ6IG5ld1RocmVhdCB9KTtcbiAgICAgICAgICAgIHNjb3BlLnNldGRpcnR5KCk7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5jYW5jZWxBZGQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5lZGl0VGhyZWF0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc2NvcGUuc2F2ZSgpO1xuICAgICAgICAgICAgc2NvcGUuc2V0ZGlydHkoKTtcbiAgICAgICAgICAgIHJlc2V0KHNjb3BlLnR5cGUpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHNjb3BlLmNhbmNlbEVkaXQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBzY29wZS50aHJlYXRzW2VkaXRJbmRleF0gPSBvcmlnaW5hbFRocmVhdDtcbiAgICAgICAgICAgIHJlc2V0KHNjb3BlLnR5cGUpO1xuICAgICAgICB9O1xuXG4gICAgICAgIHZhciB0aHJlYXRJZCA9ICRyb3V0ZVBhcmFtcy50aHJlYXQ7XG5cbiAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHRocmVhdElkKSkge1xuICAgICAgICAgICAgdmFyIG1hdGNoaW5nSW5kZXggPSAtMTtcblxuICAgICAgICAgICAgc2NvcGUudGhyZWF0cy5mb3JFYWNoKGZ1bmN0aW9uICh0aHJlYXQsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKHRocmVhdC5pZCA9PSB0aHJlYXRJZCkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaGluZ0luZGV4ID0gaW5kZXg7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIGlmIChtYXRjaGluZ0luZGV4ID49IDApIHtcbiAgICAgICAgICAgICAgICBzY29wZS5vbkVkaXRUaHJlYXQobWF0Y2hpbmdJbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBsb2dFcnJvcignSW52YWxpZCB0aHJlYXQgSUQnKTtcbiAgICAgICAgICAgICAgICAkbG9jYXRpb24uc2VhcmNoKCd0aHJlYXQnLCBudWxsKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHJlc2V0KG1vZGVsVHlwZSkge1xuICAgICAgICBuZXdUaHJlYXQgPSBpbml0aWFsaXNlVGhyZWF0KG1vZGVsVHlwZSk7XG4gICAgICAgIGVkaXRJbmRleCA9IG51bGw7XG4gICAgICAgICRsb2NhdGlvbi5zZWFyY2goJ3RocmVhdCcsIG51bGwpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGluaXRpYWxpc2VUaHJlYXQobW9kZWxUeXBlKSB7XG4gICAgICAgIGlmIChtb2RlbFR5cGUgPT0gbnVsbCl7XG4gICAgICAgICAgICByZXR1cm4geyBzdGF0dXM6ICdPcGVuJywgc2V2ZXJpdHk6ICdNZWRpdW0nLCBtb2RlbFR5cGU6ICdVTkRFRklORUQnIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgc3RhdHVzOiAnT3BlbicsIHNldmVyaXR5OiAnTWVkaXVtJywgbW9kZWxUeXBlOiBtb2RlbFR5cGUgfTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRUZW1wbGF0ZSh0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cbiAgICAgICAgICAgICAgICB2YXIgc2VsZWN0b3IgPSAnLicgKyBzZWxlY3RvckNsYXNzICsgJy9jbGFzcyc7XG4gICAgICAgICAgICAgICAgdmFyIG9yaWdpbmFsQ2xhc3MgPSB0aGlzLmF0dHIoc2VsZWN0b3IpIHx8IHNlbGVjdG9yQ2xhc3MgKyAnIGhhc05vT3BlblRocmVhdHMgaXNJblNjb3BlJztcblxuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmF0dHIoc2VsZWN0b3IsIG9yaWdpbmFsQ2xhc3MucmVwbGFjZSgnaXNJblNjb3BlJywgJ2lzT3V0T2ZTY29wZScpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXR0cihzZWxlY3Rvciwgb3JpZ2luYWxDbGFzcy5yZXBsYWNlKCdpc091dE9mU2NvcGUnLCAnaXNJblNjb3BlJykpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMucHJvcCgnb3V0T2ZTY29wZScsIHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSxcblxuICAgIGRlZmluZUhhc09wZW5UaHJlYXRzOiBmdW5jdGlvbiAocHJvdG8sIHNlbGVjdG9yQ2xhc3Nlcykge1xuXG4gICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShwcm90bywgJ2hhc09wZW5UaHJlYXRzJywge1xuICAgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzLnByb3AoJ2hhc09wZW5UaHJlYXRzJyk7IH0sXG4gICAgICAgICAgICBzZXQ6IGZ1bmN0aW9uICh2YWx1ZSkge1xuXG4gICAgICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSB0aGlzO1xuXG4gICAgICAgICAgICAgICAgc2VsZWN0b3JDbGFzc2VzLmZvckVhY2goZnVuY3Rpb24gKHNlbGVjdG9yQ2xhc3MpIHtcblxuICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0b3IgPSAnLicgKyBzZWxlY3RvckNsYXNzICsgJy9jbGFzcyc7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvcmlnaW5hbENsYXNzID0gZWxlbWVudC5hdHRyKHNlbGVjdG9yKSB8fCBzZWxlY3RvckNsYXNzICsgJyBoYXNOb09wZW5UaHJlYXRzIGlzSW5TY29wZSc7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoc2VsZWN0b3IsIG9yaWdpbmFsQ2xhc3MucmVwbGFjZSgnaGFzTm9PcGVuVGhyZWF0cycsICdoYXNPcGVuVGhyZWF0cycpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cihzZWxlY3Rvciwgb3JpZ2luYWxDbGFzcy5yZXBsYWNlKCdoYXNPcGVuVGhyZWF0cycsICdoYXNOb09wZW5UaHJlYXRzJykpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIHRoaXMucHJvcCgnaGFzT3BlblRocmVhdHMnLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbn07XG5cbi8vZGF0YSBmbG93IHNoYXBlXG5cbmpvaW50LnNoYXBlcy50bS5GbG93ID0gam9pbnQuZGlhLkxpbmsuZXh0ZW5kKHtcblxuICAgIGFycm93aGVhZE1hcmt1cDogW1xuICAgICAgICAnPGcgY2xhc3M9XCJtYXJrZXItYXJyb3doZWFkLWdyb3VwIG1hcmtlci1hcnJvd2hlYWQtZ3JvdXAtPCU9IGVuZCAlPlwiPicsXG4gICA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vbiBnZW5lcmF0ZUZvckVsZW1lbnRJbkNvbnRleHQoKSB7XG4gICAgLy90b2RvXG4gICAgcmV0dXJuIFtdO1xuICB9XG5cbiAgZnVuY3Rpb24gZ2VuZXJhdGVGb3JHcmFwaCgpIHtcbiAgICAvL3RvZG9cbiAgICByZXR1cm4gW107XG4gIH1cblxuICBmdW5jdGlvbiBpbml0aWFsaXNlUnVsZXMoZW5naW5lKSB7XG5cbiAgICAvKiBTVFJJREUgcGVyIEVsZW1lbnRcbiAgICAgICAgICAgICAgUyB8IFQgfCBSIHwgSSB8IEQgfCBFXG4gICAgQUNUT1IgICB8IFggfCAgIHwgWCB8ICAgfCAgIHxcbiAgICBTVE9SRSAgIHwgICB8IFggfCBYIHwgWCB8IFggfFxuICAgIFBST0NFU1MgfCBYIHwgWCB8IFggfCBYIHwgWCB8IFhcbiAgICBGTE9XICAgIHwgICB8IFggfCAgIHwgWCB8IFggfFxuICAgICovXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uQWN0b3InXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnYjJhNmQ0MGQtZDNmOC00NzUwLThlNGQtYzAyY2M4NGIxM2RjJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnYjJhNmQ0MGQtZDNmOC00NzUwLThlNGQtYzAyY2M4NGIxM2RjJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgc3Bvb2ZpbmcgdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnU3Bvb2ZpbmcnLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ1NUUklERScsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHNwb29maW5nIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc0YWRhYTQ4YS0wMzQ1LTQ1MzMtYTE4OS02NGM5OGM0NDIwZGQnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc0YWRhYTQ4YS0wMzQ1LTQ1MzMtYTE4OS02NGM5OGM0NDIwZGQnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyB0YW1wZXJpbmcgdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnVGFtcGVyaW5nJyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdTVFJJREUnLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyB0YW1wZXJpbmcgdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5BY3RvcidcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc4N2JjMzdlMi03OThlLTRkNjgtYmI5Ni1mZWIxZGEyNmRhNDgnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc4N2JjMzdlMi03OThlLTRkNjgtYmI5Ni1mZWIxZGEyNmRhNDgnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyByZXB1ZGlhdGlvbiB0aHJlYXQnLFxuICAgICAgICAgIHR5cGU6ICdSZXB1ZGlhdGlvbicsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgcmVwdWRpYXRpb24gdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJzEzMDAwMjk2LWIxN2QtNGI3Mi05Y2M0LWY1Y2MzM2Y4MGU0YycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJzEzMDAwMjk2LWIxN2QtNGI3Mi05Y2M0LWY1Y2MzM2Y4MGU0YycsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIGluZm9ybWF0aW9uIGRpc2Nsb3N1cmUgdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnSW5mb3JtYXRpb24gZGlzY2xvc3VyZScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgaW5mb3JtYXRpb24gZGlzY2xvc3VyZSB0aHJlYXQnXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnZWRiMDVkNzYtYTY5NS00NTVmLTk0N2ItN2Q2N2I3OGJjMzFkJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnZWRiMDVkNzYtYTY5NS00NTVmLTk0N2ItN2Q2N2I3OGJjMzFkJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmV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bFR5cGU6ICdTVFJJREUnLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyBlbGV2YXRpb24gdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICAvKiBTVFJJREUgdXNpbmcgY29udGV4dCAqL1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICB9ICwge1xuICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5pc1B1YmxpY05ldHdvcmsnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogdHJ1ZVxuICAgICAgICAgIH0gLCB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmlzRW5jcnlwdGVkJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogZmFsc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2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdMSU5ERFVOJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJzc0ODM0ZjI0LThmODktNDBiYi1iMGM2LWQxZmRkOGI4YWNjYycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJzc0ODM0ZjI0LThmODktNDBiYi1iMGM2LWQxZmRkOGI4YWNjYycsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIHRocmVhdCB0byBOb24tcmVwdWRpYXRpb24nLFxuICAgICAgICAgIHR5cGU6ICdOb24tcmVwdWRpYXRpb24nLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ0xJTkREVU4nLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyB0aHJlYXQgdG8gbm9uLXJlcHVkaWF0aW9uJ1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ0xJTkREVU4nXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnZGY0M2IwOTEtOWZmYi00NGUzLTllYjktNDcxYjllZTU2ZDM5JyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnZGY0M2IwOTEtOWZmYi00NGUzLTllYjktNDcxYjllZTU2ZDM5JyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIERldGVjdGFiaWxpdHknLFxuICAgICAgICAgIHR5cGU6ICdEZXRlY3RhYmlsaXR5JyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdMSU5ERFVOJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgdGhyZWF0IHRvIGRldGVjdGFiaWxpdHknXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc5ZDU3NjYxMC01YzUzLTRmODQtOTBjNS1lYzcwNzUxYTMzOWQnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc5ZDU3NjYxMC01YzUzLTRmODQtOTBjNS1lYzcwNzUxYTMzOWQnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyB0aHJlYXQgdG8gRGlzY2xvc3VyZSBvZiBpbmZvcm1hdGlvbicsXG4gICAgICAgICAgdHlwZTogJ0Rpc2Ns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TElORERVTicsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHRocmVhdCB0byB1bmF3YXJlbmVzcydcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdMSU5ERFVOJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdW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GFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+Q0lBIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPkNvbmZpZGVudGlhbGl0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+SW50ZWdyaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5BdmFpbGFiaWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvc2VsZWN0PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwiIXRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kdmFsaWQgJiYgdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdHlwZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgcHVsbC1sZWZ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+VGhyZWF0IHN0YXR1czwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXBcIiBuYW1lPVwic3RhdHVzSW5wdXRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgIC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cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8dWliLWFjY29yZGlvbi1oZWFkaW5nPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICBFZGl0IGRpYWdyYW0gPGkgY2xhc3M9XCJwdWxsLXJpZ2h0IGdseXBoaWNvblwiIG5nLWNsYXNzPVwie1xcJ2dseXBoaWNvbi1jaGV2cm9uLWRvd25cXCc6IHZtLnZpZXdTdGVuY2lsLCBcXCdnbHlwaGljb24tY2hldnJvbi1yaWdodFxcJzogIXZtLnZpZXdTdGVuY2lsfVwiPjwvaT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3VpYi1hY2NvcmRpb24taGVhZGluZz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cInN0ZW5jaWwgaW4gdm0uc3RlbmNpbHNcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBoZWlnaHQ9XCIxMjBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0bXQtc3RlbmNpbCBjbGFzcz1cInN0ZW5jaWxcIiBzaGFwZT1cInN0ZW5jaWwuc2hhcGVcIiBwYWRkaW5nPVwiNVwiIHNjYWxlPVwiMC45XCIgYWN0aW9uPVwic3RlbmNpbC5hY3Rpb24oKVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXZcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1UaHJlYXQgcGFuZS0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiB1aWItYWNjb3JkaW9uLWdyb3VwIGlzLW9wZW49XCJ2bS52aWV3VGhyZWF0c1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDx1aWItYWNjb3JkaW9uLWhlYWRpbmc+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIE1hbmFnZSB0aHJlYXRzIDxpIGNsYXNzPVwicHVsbC1yaWdodCBnbHlwaGljb25cIiBuZy1jbGFzcz1cIntcXCdnbHlwaGljb24tY2hldnJvbi1kb3duXFwnOiB2bS52aWV3VGhyZWF0cywgXFwnZ2x5cGhpY29uLWNoZXZyb24tcmlnaHRcXCc6ICF2bS52aWV3VGhyZWF0c31cIj48L2k+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC91aWItYWNjb3JkaW9uLWhlYWRpbmc+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cIiF2bS5zZWxlY3RlZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZW0+U2VsZWN0IGFuIGVsZW1lbnQgaW4gdGhlIGRpYWdyYW0gdG8gc2VlIG9yIGVkaXQgaXRzIHRocmVhdHM8L2VtPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJ2bS5zZWxlY3RlZCAmJiB2bS5zZWxlY3RlZC5hdHRyaWJ1dGVzLnR5cGUgIT0gXFwndG0uQm91bmRhcnlcXCdcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cIiF2bS5zZWxlY3RlZC5vdXRPZlNjb3BlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dG10LWVsZW1lbnQtdGhyZWF0cyBzdWdnZXN0PVwidm0uZ2VuZXJhdGVUaHJlYXRzXCIgdGhyZWF0cz1cInZtLnNlbGVjdGVkLnRocmVhdHNcIiB0eXBlPVwidm0uZGlhZ3JhbS5kaWFncmFtVHlwZVwiIHNhdmU9XCJ2bS5lZGl0XCIgc2V0ZGlydHk9XCJ2bS5zZXREaXJ0eVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidm0uc2VsZWN0ZWQub3V0T2ZTY29wZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlRoZSBzZWxlY3RlZCBlbGVtZW50IGlzIG91dCBvZiBzY29wZTwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PiAgICAgICAgICAgICAgICAgICAgICAgXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cInZtLnNlbGVjdGVkICYmIHZtLnNlbGVjdGVkLmF0dHJpYnV0ZXMudHlwZSA9PSBcXCd0bS5Cb3VuZGFyeVxcJ1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZW0+VGhyZWF0cyBhcmUgbm90IGFzc29jaWF0ZWQgd2l0aCB0cnVzdCBib3VuZGFyaWVzPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L3VpYi1hY2NvcmRpb24+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPCEtLURpYWdyYW0gYXJlYS0tPlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbGctOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdFwiPlxcbicgK1xuICAgICcgICA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1jaGVja2JveCBuZy1jbGljaz1cInZtLnNldEdyaWQoKVwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJUb2dnbGUgR3JpZGxpbmVzXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tdGhcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1ocmVmPVwiIy90aHJlYXRtb2RlbC97e3ZtLmdldFRocmVhdE1vZGVsUGF0aCgpfX1cIiByb2xlPVwiYnV0dG9uXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkNsb3NlIERpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIHR5cGU9XCJidXR0b25cIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmNsZWFyKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiRGVsZXRlIEFsbCBFbGVtZW50cyBGcm9tIFRoaXM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cIiB0aXRsZT1cIlNhdmUgVGhpcyBEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1zYXZlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZm9ybT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidG10LWRpYWdyYW0tY29udGFpbmVyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDx0bXQtZGlhZ3JhbSBncmFwaD1cInZtLmdyYXBoXCIgc2VsZWN0PVwidm0uc2VsZWN0KGVsZW1lbnQpXCIgbmV3LWZsb3c9XCJ2bS5uZXdGbG93KHNvdXJjZSwgdGFyZ2V0KVwiIGluaXRpYWxpc2UtZ3JhcGg9XCJ2bS5pbml0aWFsaXNlKGRpYWdyYW0pXCIgaGVpZ2h0PVwiNjAwXCIgd2lkdGg9XCI4MDBcIiBncmlkLXNpemU9XCIxXCIgaW50ZXJhY3RpdmU9XCJ0cnVlXCIvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwhLS1FbGVtZW50IHByb3BlcnRpZXMtLT5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLWxnLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+UHJvcGVydGllczwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidm0uc2VsZWN0ZWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPHRtdC1lbGVtZW50LXByb3BlcnRpZXMgZWRpdD1cIiB2bS5lZGl0KClcIiBzZWxlY3RlZD1cInZtLnNlbGVjdGVkXCIgZWxlbWVudC10eXBlPVwie3t2bS5zZWxlY3RlZC5hdHRyaWJ1dGVzLnR5cGV9fVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCIhdm0uc2VsZWN0ZWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlNlbGVjdCBhbiBlbGVtZW50IGluIHRoZSBkaWFncmFtIHRvIHNlZSBvciBlZGl0IGl0cyBwcm9wZXJ0aWVzPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPCEtLUVycm9yIGNvbnRlbnQtLT5cXG4nICtcbiAgICAnICAgIDxkaXY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29uIGdseXBoaWNvbi1leGNsYW1hdGlvbi1zaWduXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHRocmVhdCB0aXRsZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxsYWJlbD5MSU5ERFVOIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPkxpbmthYmlsaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5JZGVudGlmaWFiaWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPk5vbi1yZXB1ZGlhdGlvbjwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RGV0ZWN0YWJpbGl0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RGlzY2xvc3VyZSBvZiBpbmZvcm1hdGlvbjwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+VW5hd2FyZW5lc3M8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPk5vbi1jb21wbGlhbmNlPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L3NlbGVjdD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJHZhbGlkICYmIHRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kZGlydHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLWV4Y2xhbWF0aW9uLXNpZ25cIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNyLW9ubHlcIj5FcnJvcjo8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgdGhyZWF0IHR5cGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2R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xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwXCIgcmVxdWlyZWQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdIaWdoXFwnXCI+SGlnaDwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdNZWRpdW1cXCdcIj5NZWRpdW08L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1tb2RlbD1cInBhcmFtZXRlci50aHJlYXQuc2V2ZXJpdHlcIiB1aWItYnRuLXJhZGlvPVwiXFwnTG93XFwnXCI+TG93PC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNsZWFyZml4XCI+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+RGVzY3JpcHRpb248L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPH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ICAnICAgICAgICAgICAgICAgIDxsYWJlbD5UaXRsZTwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8aW5wdXQgbmFtZT1cInRpdGxlSW5wdXRcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLXJlcXVpcmVkPVwidHJ1ZVwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnRpdGxlXCIgcGxhY2Vob2xkZXI9XCJBIHNob3J0IHRpdGxlIGZvciB0aGUgdGhyZWF0XCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+U1RSSURFIHRocmVhdCB0eXBlPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxzZWxlY3QgbmFtZT1cInR5cGVJbnB1dFwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgbmctcmVxdWlyZWQ9XCJ0cnVlXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHNlbGVjdGVkPlNwb29maW5nPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5UYW1wZXJpbmc8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPlJlcHVkaWF0aW9uPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5JbmZvcm1hdGlvbiBkaXNjbG9zdXJlPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5EZW5pYWwgb2Ygc2VydmljZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RWxldmF0aW9uIG9mIHByaXZpbGVnZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9zZWxlY3Q+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IG5nLXNob3c9XCIhdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJGRpcnR5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC1kYW5nZXJcIiByb2xlPVwiYWxlcnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1leGNsYW1hdGlvbi1zaWduXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHRocmVhdCB0eXBlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBwdWxsLWxlZnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxsYWJlbD5UaHJlYXQgc3RhdHVzPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cFwiIG5hbWU9XCJzdGF0dXNJbnB1dFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuYW1lPVwic3RhdHVzSW5wdXRPcGVuXCIgbmctbW9kZWw9X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AgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5SZXZpZXdlcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdj57e3ZtLnRocmVhdE1vZGVsLmRldGFpbC5yZXZpZXdlcn19PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5Db250cmlidXRvcnM6IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIHZtLnRocmVhdE1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIj4ge3tjb250cmlidXRvci5uYW1lfX08c3BhbiBuZy1zaG93PVwiICEgJGxhc3QgXCI+Ozwvc3Bhbj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWhlYWRpbmcgcGFuZWwtdGl0bGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxoND5IaWdoIGxldmVsIHN5c3R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ICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIG5nLWhyZWY9XCIjL3RocmVhdG1vZGVsL3t7dm0udGhyZWF0TW9kZWxQYXRoKCl9fS9kaWFncmFtL3t7ZGlhZ3JhbS5pZH19XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGltZyBuZy1zcmM9XCJ7e2RpYWdyYW0udGh1bWJuYWlsfX1cIiBjbGFzcz1cImltZy10aHVtYm5haWwgY2VudGVyLWJsb2NrXCIgYWx0PVwiVGh1bWJuYWlsIG9mIHt7ZGlhZ3JhbS50aXRsZX19XCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgbmctaWY9XCIoKCRpbmRleCsxKSAlIDQpID09IDBcIiBjbGFzcz1cImNsZWFyZml4IHZpc2libGUtbGctYmxvY2tcIj48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQtZW5kIG5nLWhpZGU+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cInJvd1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwIHB1bGwtcmlnaHRcIiByb2xlPVwiZ3Jv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U9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZmEgZmEtZXhjbGFtYXRpb24tdHJpYW5nbGVcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgdGhyZWF0IG1vZGVsIHRpdGxlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwidm0ud2lsbE1vdmVUaHJlYXRNb2RlbCh7bW9kZWw6IHZtLnRocmVhdE1vZGVsRWRpdEZvcm0udGhyZWF0TW9kZWxUaXRsZS4kdmlld1ZhbHVlfSkgJiYgIXZtLmlzTmV3TW9kZWwoKVwiPiAgICAgICAgICAgICAgICAgICAgICBcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtaW5mb1wiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZmEgZmEtaW5mby1jaXJjbGVcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+V2FybmluZzo8L3NwYW4+IENoYW5naW5nIHRoZSBtb2RlbCB0aXRsZSB3aWxsIGRlbGV0ZSB0aGUgb2xkIG1vZGVsXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGNyZWF0ZSBhIG5ldyBvbmUgdG8gcmVwbGFjZSBpdC5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1Pd25lci0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+T3duZXI8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS50aHJlYXRNb2RlbC5zdW1tYXJ5Lm93bmVyXCIgcGxhY2Vob2xkZXI9XCJUaGUgb3duZXIgb2YgdGhlIHRocmVhdCBtb2RlbFwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPCEtLXJldmlld2VyLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxsYWJlbD5SZXZpZXdlcjwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGlucHV0IGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cInZtLnRocmVhdE1vZGVsLmRldGFpbC5yZXZpZXdlclwiIHBsYWNlaG9sZGVyPVwiVGhlIHJldmlld2VyIG9mIHRoZSB0aHJlYXQgbW9kZWxcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1kZXNjcmlwdGlvbi0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGxhYmVsPkhpZ2ggbGV2ZWwgc3lzdGVtIGRlc2NyaXB0aW9uPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8dGV4dGFyZWEgcm93cz1cIjVcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLW1vZGVsPVwidm0udGhyZWF0TW9kZWwuc3VtbWFyeS5kZXNjcmlwdGlvblwiIHBsYWNlaG9sZGVyPVwiQSBoaWdoIGxldmVsIGRlc2NyaXB0aW9uIG9mIHRoZSBzeXN0ZW1cIj48L3RleHRhcmVhPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tY29udHJpYnV0b3JzLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+Q29udHJpYnV0b3JzPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIHZtLnRocmVhdE1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIiBuZy1mb3JtPVwiY29udHJpYnV0b3JTdWJGb3JtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBuYW1lPVwiY29udHJpYnV0b3JOYW1lXCIgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwiY29udHJpYnV0b3IubmFtZVwiIHJlcXVpcmVkIHBsYWNlaG9sZGVyPVwiVGhlIG5hbWUgb2YgYSBjb250cmlidXRvciB0byB0aGUgdGhyZWF0IG1vZGVsXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnJlbW92ZUNvbnRyaWJ1dG9yKCRpbmRleClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiUmVtb3ZlIFRoaXMgQ29udHJpYnV0b3JcIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZW1vdmVcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cImNvbnRyaWJ1dG9yU3ViRm9ybS5jb250cmlidXRvck5hbWUuJGRpcnR5ICYmICFjb250cmlidXRvclN1YkZvcm0uY29udHJpYnV0b3JOYW1lLiR2YWxpZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWV4Y2xhbWF0aW9uLXRyaWFuZ2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgY29udHJpYnV0b3IgbmFtZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdC1lbmQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCIgbmctc2hvdz1cInZtLmFkZGluZ0NvbnRyaWJ1dG9yXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5hbWU9XCJuZXdDb250cmlidXRvck5hbWVJbnB1dFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS5uZXdDb250cmlidXRvclwiIHBsYWNlaG9sZGVyPVwiVGhlIG5hbWUgb2YgYSBjb250cmlidXRvclwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctZGlzYWJsZWQ9XCJ2bS5uZXdDb250cmlidXRvci5sZW5ndGggPT0gMFwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIG5nLWNsaWNrPVwidm0uYWRkQ29udHJpYnV0b3IoKVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJBZGQgdGhpcyBjb250cmlidXRvclwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGRcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWxpbmtcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmNhbmNlbEFkZGluZ0NvbnRyaWJ1dG9yKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiQ2FuY2VsIGFkZGluZyB0aGlzIGNvbnRyaWJ1dG9yXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1oaWRlPVwidm0uYWRkaW5nQ29udHJpYnV0b3JcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tbGlua1wiIG5nLWNsaWNrPVwidm0uc3RhcnRBZGRpbmdDb250cmlidXRvcigpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gQWRkIGEgbmV3IGNvbnRyaWJ1dG9yLi4uXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPCEtLWRpYWdyYW1zLS0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+RGlhZ3JhbXM8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctcmVwZWF0PVwiZGlhZ3JhbSBpbiB2bS50aHJlYXRNb2RlbC5kZXRhaWwuZGlhZ3JhbXNcIiBuZy1mb3JtPVwiZGlhZ3JhbVN1YkZvcm1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC02XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaW5wdXQtZ3JvdXBcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IG5hbWU9XCJkaWFncmFtVGl0bGVcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJkaWFncmFtLnRpdGxlXCIgcmVxdWlyZWQgcGxhY2Vob2xkZXI9XCJEaWFncmFtIHRpdGxlXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmR1cGxpY2F0ZURpYWdyYW0oJGluZGV4KVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJEdXBsaWNhdGUgVGhpcyBEaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1kdXBsaWNhdGVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHVwbGljYXRlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnJlbW92ZURpYWdyYW0oJGluZGV4KVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJSZW1vdmUgVGhpcyBEaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVtb3ZlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwiZGlhZ3JhbVN1YkZvcm0uZGlhZ3JhbVRpdGxlLiRkaXJ0eSAmJiAhZGlhZ3JhbVN1YkZvcm0uZGlhZ3JhbVRpdGxlLiR2YWxpZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWV4Y2xhbWF0aW9uLXRyaWFuZ2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPiBUaGUgZGlhZ3JhbSB0aXRsZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdC1lbmQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCIgbmctc2hvdz1cInZtLmFkZGluZ0RpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGlucHV0IGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cInZtLm5ld0RpYWdyYW0udGl0bGVcIiBwbGFjZWhvbGRlcj1cIkRpYWdyYW0gdGl0bGVcIiAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImlucHV0LWdyb3VwLWJ0blwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLWRpc2FibGVkPVwidm0ubmV3RGlhZ3JhbS50aXRsZS5sZW5ndGggPT0gMFwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIG5nLWNsaWNrPVwidm0uYWRkRGlhZ3JhbSgpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkFkZCB0aGlzIGRpYWdyYW1cIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXBsdXNcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWRkXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1saW5rXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5jYW5jZWxBZGRpbmdEaWFncmFtKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiQ2FuY2VsIGFkZGluZyB0aGlzIGRpYWdyYW1cIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXJlbW92ZVwiPjwvc3Bhbj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW5jZWxcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWhpZGU9XCJ2bS5hZGRpbmdEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWxpbmtcIiBuZy1jbGljaz1cInZtLnN0YXJ0QWRkaW5nRGlhZ3JhbSgpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcGx1c1wiPjwvc3Bhbj4gQWRkIGEgbmV3IGRpYWdyYW0uLi5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tYnV0dG9ucy0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0zIGNvbC1tZC1vZmZzZXQtOVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXAgcHVsbC1yaWdodFwiIHJvbGU9XCJncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctY2xpY2s9XCJ2bS5jYW5jZWwoKVwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJDYW5jZWwgRWRpdGluZ1wiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcmVtb3ZlXCI+PC9zcGFuPiBDYW5jZWxcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1kaXNhYmxlZD1cIiF2bS5kaXJ0eVwiIG5nLWNsaWNrPVwidm0ucmVsb2FkKClcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZT1cIlJlc2V0IEZvcm1cIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLXVuZG9cIj48L3NwYW4+IFJlbG9hZFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tcHJpbWFyeVwiIG5nLWRpc2FibGVkPVwiIXZtLmRpcnR5IHx8ICF2bS50aHJlYXRNb2RlbEVkaXRGb3JtLiR2YWxpZFwiIG5nLWNsaWNrPVwidm0uaXNOZXdNb2RlbCgpID8gdm0uY3JlYXRlKCkgOiB2bS5zYXZlKClcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIlNhdmUgQ2hhbmdlc1wiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1zYXZlXCI+PC9zcGFuPiBTYXZlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZm9ybT5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPCEtLW9vcHMtLT5cXG4nICtcbiAgICAnICAgIDxkaXYgbmctaWY9XCJ2bS5lcnJvcmVkXCI+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cImp1bWJvdHJvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8aDE+b29vb3BzITwvaDE+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgSXQgbG9va3MgbGlrZSB5b3UgdHJpZWQgdG8gZWRpdCBhbiBpbnZhbGlkIHRocmVhdCBtb2RlbC4gTWF5YmUgeW91IHR5cGVkIHRoZSBhZGRyZXNzIHdyb25nPyBPciBpZiB5b3UgY2xpY2tlZCBhIGxpbmsgdG8gZ2V0XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICBoZXJlLCB0aGUgdGhyZWF0IG1vZGVsIG1pZ2h0IGhhdmUgYmVlbiBkZWxldGVkIHNpbmNlIHlvdSBtYWRlIHRoZSBsaW5rIDxzcGFuIGNsYXNzPVwiZmEgZmEtZnJvd24tb1wiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgIC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PVwiY29sLW1kLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5Pd25lcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2Pnt7bW9kZWwuc3VtbWFyeS5vd25lcn19PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5SZXZpZXdlcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2Pnt7bW9kZWwuZGV0YWlsLnJldmlld2VyfX08L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtOFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkNvbnRyaWJ1dG9yczogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXJlcGVhdD1cImNvbnRyaWJ1dG9yIGluIG1vZGVsLmRldGFpbC5jb250cmlidXRvcnNcIj4ge3tjb250cmlidXRvci5uYW1lfX08c3BhbiBuZy1zaG93PVwiICEgJGxhc3QgXCI+Ozwvc3Bhbj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDxkaXYgY2xhc3M9XCJwYW5lbCBwYW5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gICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLkZsb3dcIj4oRGF0YSBGbG93KTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLlByb2Nlc3NcIj4oUHJvY2Vzcyk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoLXdoZW49XCJ0bS5BY3RvclwiPihFeHRlcm5hbCBBY3Rvcik8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtYm9keVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkRlc2NyaXB0aW9uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQuZGVzY3JpcHRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJlbGVtZW50Lmhhc09wZW5UaHJlYXRzIHx8IChyZXBvcnRPcHRpb25zLnNob3dNaXRpZ2F0ZWQgJiYgZWxlbWVudC50aHJlYXRzLmxlbmd0aCA+IDApXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQ9XCJ0aHJlYXQgaW4gZWxlbWVudC50aHJlYXRzXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJ0aHJlYXQuc3RhdHVzID09IFxcJ09wZW5cXCcgfHwgcmVwb3J0T3B0aW9ucy5zaG93TWl0aWdhdGVkXCIgY2xhc3M9XCJwYW5lbCBwYW5lbC1kZWZhdWx0IHRocmVhdFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWhlYWRpbmcgcGFuZWwtdGl0bGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e3RocmVhdC50aXRsZX19XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtIGNsYXNzPVwic21hbGxcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3t0aHJlYXQudHlwZX19LFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1jbGFzcz1cIntNaXRpZ2F0ZWQ6XFwndGV4dC1zdWNjZXNzXFwnLCBPcGVuOlxcJ3RleHQtZGFuZ2VyXFwnfVt0aHJlYXQuc3RhdHVzXVwiPnt7dGhyZWF0LnN0YXR1c319PC9zcGFuPixcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctY2xhc3M9XCJ7TG93OlxcJ3RleHQtc3VjY2Vzc1xcJywgTWVkaXVtOlxcJ3RleHQtd2FybmluZ1xcJywgSGlnaDpcXCd0ZXh0LWRhbmdlclxcJ31bdGhyZWF0LnNldmVyaXR5XVwiPnt7dGhyZWF0LnNldmVyaXR5fX0gU2V2ZXJpdHk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5EZXNjcmlwdGlvbjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e3RocmVhdC5kZXNjcmlwdGlvbn19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPk1pdGlnYXRpb246IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3t0aHJlYXQubWl0aWdhdGlvbn19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiZWxlbWVudC50aHJlYXRzLmxlbmd0aCA9PSAwIHx8ICFlbGVtZW50LnRocmVhdHMgfHwgKCFlbGVtZW50Lmhhc09wZW5UaHJlYXRzICYmICFyZXBvcnRPcHRpb25zLnNob3dNaXRpZ2F0ZWQpXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGVtPk5vIHRocmVhdHMgbGlzdGVkLjwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJyZXBvcnRPcHRpb25zLnNob3dPdXRPZlNjb3BlXCIgbmctcmVwZWF0PVwiZWxlbWVudCBpbiBncmFwaHNbZGlhZ3JhbS5pZF0uZ2V0Q2VsbHMoKSB8IGZpbHRlcjp7b3V0T2ZTY29wZTogdHJ1ZX1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdCBtb2RlbC1lbGVtZW50XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e2VsZW1lbnQubmFtZX19IChvdXQgb2Ygc2NvcGUgXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2g9XCJlbGVtZW50LmF0dHJpYnV0ZXMudHlwZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uU3RvcmVcIj5EYXRhIFN0b3JlKTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLkZsb3dcIj5EYXRhIEZsb3cpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uUHJvY2Vzc1wiPlByb2Nlc3MpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uQWN0b3JcIj5FeHRlcm5hbCBBY3Rvcik8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtYm9keVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48c3Ryb25nPkRlc2NyaXB0aW9uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQuZGVzY3JpcHRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5PdXQgb2Ygc2NvcGUgcmVhc29uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHAgY2xhc3M9XCJyZXBvcnRcIj57e2VsZW1lbnQucmVhc29uT3V0T2ZTY29wZX19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPGRpdiBuZy1pZj1cIiFpc1ByaW50aW5nT3JTYXZpbmdcIiBjbGFzcz1cInJvd1wiPlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cCBwdWxsLXJpZ2h0XCIgcm9sZT1cImdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8Y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Nb2RlbC5kZXRhaWwuZGlhZ3JhbXMuZm9yRWFjaChmdW5jdGlvbiAoaXRlbSkge1xuICAgICAgICAgICAgaWYgKGlkID09IGl0ZW0uaWQpIHtcbiAgICAgICAgICAgICAgICBpZCArPSAxO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGlkO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG9uRXJyb3IoZXJyKSB7XG4gICAgICAgIHZtLmVycm9yZWQgPSB0cnVlO1xuICAgICAgICBsb2dFcnJvcihlcnIuZGF0YS5tZXNzYWdlKTtcbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gdGhyZWF0TW9kZWw7XG4iLCIndXNlIHN0cmljdCc7XG5cbnZhciBfID0gcmVxdWlyZSgnbG9kYXNoJyk7XG5cbmZ1bmN0aW9uIHRocmVhdE1vZGVsUmVwb3J0KCRsb2NhdGlvbiwgJHJvdXRlUGFyYW1zLCB0aHJlYXRtb2RlbGxvY2F0b3IsIGRpYWdyYW1taW5nKSB7XG5cbiAgICB2YXIgZGlyZWN0aXZlID1cbiAgICAgICAge1xuICAgICAgICAgICAgbGluazogbGluayxcbiAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGhyZWF0bW9kZWxzL3RocmVhdG1vZGVscmVwb3J0Lmh0bWwnLFxuICAgICAgICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgICAgICAgIHNjb3BlOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIG1vZGVsOiAnPScsXG4gICAgICAgICAgICAgICAgbG9hZGVkOiAnJicsXG4gICAgICAgICAgICAgICAgaXNQcmludGluZ09yU2F2aW5nOiAnPWhpZGVDb250cm9scycsXG4gICAgICAgICAgICAgICAgc2F2ZTogJyY/JyxcbiAgICAgICAgICAgICAgICBwcmludDogJyY/J1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgcmV0dXJuIGRpcmVjdGl2ZTtcblxuICAgIGZ1bmN0aW9uIGxpbmsoc2NvcGUpIHtcbiAgICAgICAgXG4gICAgICAgIHNjb3BlLnByaW50YWJsZSA9IF8uaXNGdW5jdGlvbihzY29wZS5wcmludCk7XG4gICAgICAgIHNjb3BlLnNhdmVhYmxlID0gXy5pc0Z1bmN0aW9uKHNjb3BlLnNhdmUpO1xuICAgICAgICBzY29wZS5zYXZlUERGID0gc2F2ZVBERjtcbiAgICAgICAgc2NvcGUucHJpbnRQREYgPSBwcmludFBERjtcbiAgICAgICAgc2NvcGUuY2FuY2VsID0gY2FuY2VsO1xuICAgICAgICBzY29wZS5pbml0aWFsaXNlID0gaW5pdGlhbGlzZTtcbiAgICAgICAgc2NvcGUuZ3JhcGhzID0gbnVsbDtcbiAgICBcbiAgICAgICAgc2NvcGUucmVwb3J0T3B0aW9ucyA9IHtcbiAgICAgICAgICAgIHNob3dNaXRpZ2F0ZWQ6IHRydWUsXG4gICAgICAgICAgICBzaG93T3V0T2ZTY29wZTogdHJ1ZSxcbiAgICAgICAgICAgIHNob3dEaWFncmFtczogdHJ1ZVxuICAgICAgICB9O1xuXG4gICAgICAgIHByaW1lR3JhcGhzKCk7XG4gICAgICAgIHNjb3BlLmxvYWRlZCgpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGluaXRpYWxpc2UoZGlhZ3JhbSkge1xuICAgICAgICAgICAgaW5pdGlhbGlzZUdyYXBocygpO1xuICAgICAgICAgICAgZGlhZ3JhbS5yZW1vdmVUb29scygpO1xuICAgICAgICAgICAgZGlhZ3JhbS5zY2FsZUNvbnRlbnRUb0ZpdCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gc2F2ZVBERigpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IHRydWU7XG4gICAgICAgICAgICBzY29wZS5zYXZlKHtkb25lOiBkb25lfSk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBwcmludFBERigpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IHRydWU7XG4gICAgICAgICAgICBzY29wZS5wcmludCh7ZG9uZTogZG9uZX0pO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gZG9uZSgpIHtcbiAgICAgICAgICAgIHNjb3BlLmlzUHJpbnRpbmdPclNhdmluZyA9IGZhbHNlO1xuICAgICAgICAgICAgc2NvcGUuc2FmZUFwcGx5KCk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjYW5jZWwoKSB7XG4gICAgICAgICAgICBpZiAoIV8uaXNVbmRlZmluZWQoc2NvcGUubW9kZWwuc3VtbWFyeS50aXRsZSkpIHtcbiAgICAgICAgICAgICAgICAkbG9jYXRpb24ucGF0aCgnL3RocmVhdG1vZGVsLycgKyB0aHJlYXRtb2RlbGxvY2F0b3IuZ2V0TW9kZWxQYXRoRnJvbVJvdXRlUGFyYW1zKCRyb3V0ZVBhcmFtcykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgJGxvY2F0aW9uLnBhdGgoJy8nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHNjb3BlLnNhZmVBcHBseSA9IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICB2YXIgcGhhc2UgPSB0aGlzLiRyb290LiQkcGhhc2U7XG4gICAgICAgICAgICBpZihwaGFzZSA9PSAnJGFwcGx5JyB8fCBwaGFzZSA9PSAnJGRpZ2VzdCcpIHtcbiAgICAgICAgICAgICAgaWYoZm4gJiYgKHR5cGVvZihmbikgPT09ICdmdW5jdGlvbicpKSB7XG4gICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhpcy4kYXBwbHkoZm4pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAg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ICAgICAgIGdldENvbnRhaW5lcjogZ2V0Q29udGFpbmVyLFxuICAgICAgICAgICAgICAgIGluZm86IGluZm8sXG4gICAgICAgICAgICAgICAgb3B0aW9uczoge30sXG4gICAgICAgICAgICAgICAgc3Vic2NyaWJlOiBzdWJzY3JpYmUsXG4gICAgICAgICAgICAgICAgc3VjY2Vzczogc3VjY2VzcyxcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiAnMi4xLjQnLFxuICAgICAgICAgICAgICAgIHdhcm5pbmc6IHdhcm5pbmdcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciBwcmV2aW91c1RvYXN0O1xuXG4gICAgICAgICAgICByZXR1cm4gdG9hc3RyO1xuXG4gICAgICAgICAgICAvLy8vLy8vLy8vLy8vLy8vXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGVycm9yKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRDb250YWluZXIob3B0aW9ucywgY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zKSB7IG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7IH1cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnIycgKyBvcHRpb25zLmNvbnRhaW5lcklkKTtcbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjcmVhdGUpIHtcbiAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9IGNyZWF0ZUNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGluZm8obWVzc2FnZSwgdGl0bGUsIG9wdGlvbnNPdmVycmlkZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub3RpZnkoe1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0b2FzdFR5cGUuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzOiBnZXRPcHRpb25zKCkuaWNvbkNsYXNzZXMuaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWJzY3JpYmUoY2FsbGJhY2spIHtcbiAgICAgICAgICAgICAgICBsaXN0ZW5lciA9IGNhbGxiYWNrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBzdWNjZXNzKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogZ2V0T3B0aW9ucygpLmljb25DbGFzc2VzLnN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNPdmVycmlkZTogb3B0aW9uc092ZXJyaWRlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gd2FybmluZyhtZXNzYWdlLCB0aXRsZSwgb3B0aW9uc092ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vdGlmeSh7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHRvYXN0VHlwZS53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy53YXJuaW5nLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zT3ZlcnJpZGU6IG9wdGlvbnNPdmVycmlkZSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyKCR0b2FzdEVsZW1lbnQsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIGlmICghJGNvbnRhaW5lcikgeyBnZXRDb250YWluZXIob3B0aW9ucyk7IH1cbiAgICAgICAgICAgICAgICBpZiAoIWNsZWFyVG9hc3QoJHRvYXN0RWxlbWVudCwgb3B0aW9ucywgY2xlYXJPcHRpb25zKSkge1xuICAgICAgICAgICAgICAgICAgICBjbGVhckNvbnRhaW5lcihvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZSgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBnZXRPcHRpb25zKCk7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7IGdldENvbnRhaW5lcihvcHRpb25zKTsgfVxuICAgICAgICAgICAgICAgIGlmICgkdG9hc3RFbGVtZW50ICYmICQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgICAgICAgICByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoJGNvbnRhaW5lci5jaGlsZHJlbigpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaW50ZXJuYWwgZnVuY3Rpb25zXG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyQ29udGFpbmVyIChvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRvYXN0c1RvQ2xlYXIgPSAkY29udGFpbmVyLmNoaWxkcmVuKCk7XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IHRvYXN0c1RvQ2xlYXIubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJUb2FzdCgkKHRvYXN0c1RvQ2xlYXJbaV0pLCBvcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNsZWFyVG9hc3QgKCR0b2FzdEVsZW1lbnQsIG9wdGlvbnMsIGNsZWFyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciBmb3JjZSA9IGNsZWFyT3B0aW9ucyAmJiBjbGVhck9wdGlvbnMuZm9yY2UgPyBjbGVhck9wdGlvbnMuZm9yY2UgOiBmYWxzZTtcbiAgICAgICAgICAgICAgICBpZiAoJHRvYXN0RWxlbWVudCAmJiAoZm9yY2UgfHwgJCgnOmZvY3VzJywgJHRvYXN0RWxlbWVudCkubGVuZ3RoID09PSAwKSkge1xuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50W29wdGlvbnMuaGlkZU1ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IG9wdGlvbnMuaGlkZUR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBvcHRpb25zLmhpZGVFYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkgeyByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTsgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlQ29udGFpbmVyKG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gJCgnPGRpdi8+JylcbiAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ2lkJywgb3B0aW9ucy5jb250YWluZXJJZClcbiAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKG9wdGlvbnMucG9zaXRpb25DbGFzcyk7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZFRvKCQob3B0aW9ucy50YXJnZXQpKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gJGNvbnRhaW5lcjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0RGVmYXVsdHMoKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgdGFwVG9EaXNtaXNzOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICB0b2FzdENsYXNzOiAndG9hc3QnLFxuICAgICAgICAgICAgICAgICAgICBjb250YWluZXJJZDogJ3RvYXN0LWNvbnRhaW5lcicsXG4gICAgICAgICAgICAgICAgICAgIGRlYnVnOiBmYWxzZSxcblxuICAgICAgICAgICAgICAgICAgICBzaG93TWV0aG9kOiAnZmFkZUluJywgLy9mYWRlSW4sIHNsaWRlRG93biwgYW5kIHNob3cgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIHNob3dEdXJhdGlvbjogMzAwLFxuICAgICAgICAgICAgICAgICAgICBzaG93RWFzaW5nOiAnc3dpbmcnLCAvL3N3aW5nIGFuZCBsaW5lYXIgYXJlIGJ1aWx0IGludG8galF1ZXJ5XG4gICAgICAgICAgICAgICAgICAgIG9uU2hvd246IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZU1ldGhvZDogJ2ZhZGVPdXQnLFxuICAgICAgICAgICAgICAgICAgICBoaWRlRHVyYXRpb246IDEwMDAsXG4gICAgICAgICAgICAgICAgICAgIGhpZGVFYXNpbmc6ICdzd2luZycsXG4gICAgICAgICAgICAgICAgICAgIG9uSGlkZGVuOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlTWV0aG9kOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VEdXJhdGlvbjogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlRWFzaW5nOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VPbkhvdmVyOiB0cnVlLFxuXG4gICAgICAgICAgICAgICAgICAgIGV4dGVuZGVkVGltZU91dDogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzZXM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiAndG9hc3QtZXJyb3InLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbzogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzczogJ3RvYXN0LXN1Y2Nlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgd2FybmluZzogJ3RvYXN0LXdhcm5pbmcnXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogJ3RvYXN0LWluZm8nLFxuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbkNsYXNzOiAndG9hc3QtdG9wLXJpZ2h0JyxcbiAgICAgICAgICAgICAgICAgICAgdGltZU91dDogNTAwMCwgLy8gU2V0IHRpbWVPdXQgYW5kIGV4dGVuZGVkVGltZU91dCB0byAwIHRvIG1ha2UgaXQgc3RpY2t5XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlQ2xhc3M6ICd0b2FzdC10aXRsZScsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2VDbGFzczogJ3RvYXN0LW1lc3NhZ2UnLFxuICAgICAgICAgICAgICAgICAgICBlc2NhcGVIdG1sOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0OiAnYm9keScsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlSHRtbDogJzxidXR0b24gdHlwZT1cImJ1dHRvblwiPiZ0aW1lczs8L2J1dHRvbj4nLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZUNsYXNzOiAndG9hc3QtY2xvc2UtYnV0dG9uJyxcbiAgICAgICAgICAgICAgICAgICAgbmV3ZXN0T25Ub3A6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgIHByZXZlbnREdXBsaWNhdGVzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXI6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0NsYXNzOiAndG9hc3QtcHJvZ3Jlc3MnLFxuICAgICAgICAgICAgICAgICAgICBydGw6IGZhbHNlXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHVibGlzaChhcmdzKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFsaXN0ZW5lcikgeyByZXR1cm47IH1cbiAgICAgICAgICAgICAgICBsaXN0ZW5lcihhcmdzKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gbm90aWZ5KG1hcCkge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIHZhciBpY29uQ2xhc3MgPSBtYXAuaWNvbkNsYXNzIHx8IG9wdGlvbnMuaWNvbkNsYXNzO1xuXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAobWFwLm9wdGlvbnNPdmVycmlkZSkgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMgPSAkLmV4dGVuZChvcHRpb25zLCBtYXAub3B0aW9uc092ZXJyaWRlKTtcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzID0gbWFwLm9wdGlvbnNPdmVycmlkZS5pY29uQ2xhc3MgfHwgaWNvbkNsYXNzO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChzaG91bGRFeGl0KG9wdGlvbnMsIG1hcCkpIHsgcmV0dXJuOyB9XG5cbiAgICAgICAgICAgICAgICB0b2FzdElkKys7XG5cbiAgICAgICAgICAgICAgICAkY29udGFpbmVyID0gZ2V0Q29udGFpbmVyKG9wdGlvbnMsIHRydWUpO1xuXG4gICAgICAgICAgICAgICAgdmFyIGludGVydmFsSWQgPSBudWxsO1xuICAgICAgICAgICAgICAgIHZhciAkdG9hc3RFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICR0aXRsZUVsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJG1lc3NhZ2VFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICRwcm9ncmVzc0VsZW1lbnQgPSAkKCc8ZGl2Lz4nKTtcbiAgICAgICAgICAgICAgICB2YXIgJGNsb3NlRWxlbWVudCA9ICQob3B0aW9ucy5jbG9zZUh0bWwpO1xuICAgICAgICAgICAgICAgIHZhciBwcm9ncmVzc0JhciA9IHtcbiAgICAgICAgICAgICAgICAgICAgaW50ZXJ2YWxJZDogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgaGlkZUV0YTogbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgbWF4SGlkZVRpbWU6IG51bGxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciByZXNwb25zZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgdG9hc3RJZDogdG9hc3RJZCxcbiAgICAgICAgICAgICAgICAgICAgc3RhdGU6ICd2aXNpYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRUaW1lOiBuZXcgRGF0ZSgpLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBvcHRpb25zLFxuICAgICAgICAgICAgICAgICAgICBtYXA6IG1hcFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICBwZXJzb25hbGl6ZVRvYXN0KCk7XG5cbiAgICAgICAgICAgICAgICBkaXNwbGF5VG9hc3QoKTtcblxuICAgICAgICAgICAgICAgIGhhbmRsZUV2ZW50cygpO1xuXG4gICAgICAgICAgICAgICAgcHVibGlzaChyZXNwb25zZSk7XG5cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5kZWJ1ZyAmJiBjb25zb2xlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gJHRvYXN0RWxlbWVudDtcblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGVzY2FwZUh0bWwoc291cmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2UgPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlID0gJyc7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvJi9nLCAnJmFtcDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1wiL2csICcmcXVvdDsnKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLycvZywgJyYjMzk7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC88L2csICcmbHQ7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8+L2csICcmZ3Q7Jyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gcGVyc29uYWxpemVUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0SWNvbigpO1xuICAgICAgICAgICAgICAgICAgICBzZXRUaXRsZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRNZXNzYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldENsb3NlQnV0dG9uKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFByb2dyZXNzQmFyKCk7XG4gICAgICAgICAgICAgICAgICAgIHNldFJUTCgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRTZXF1ZW5jZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRBcmlhKCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0QXJpYSgpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFyaWFWYWx1ZSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvYXN0LXN1Y2Nlc3MnOlxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndG9hc3QtaW5mbyc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYVZhbHVlID0gICdwb2xpdGUnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmlhVmFsdWUgPSAnYXNzZXJ0aXZlJztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmF0dHIoJ2FyaWEtbGl2ZScsIGFyaWFWYWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gaGFuZGxlRXZlbnRzKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZU9uSG92ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuaG92ZXIoc3RpY2tBcm91bmQsIGRlbGF5ZWRIaWRlVG9hc3QpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLm9uY2xpY2sgJiYgb3B0aW9ucy50YXBUb0Rpc21pc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuY2xpY2soaGlkZVRvYXN0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmNsb3NlQnV0dG9uICYmICRjbG9zZUVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRjbG9zZUVsZW1lbnQuY2xpY2soZnVuY3Rpb24gKGV2ZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnN0b3BQcm9wYWdhdGlvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdW5kZWZpbmVkICYmIGV2ZW50LmNhbmNlbEJ1YmJsZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5jYW5jZWxCdWJibGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm9uQ2xvc2VDbGljaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uQ2xvc2VDbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbmNsaWNrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmNsaWNrKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25jbGljayhldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZVRvYXN0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRpc3BsYXlUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5oaWRlKCk7XG5cbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudFtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmcsIGNvbXBsZXRlOiBvcHRpb25zLm9uU2hvd259XG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy50aW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lID0gcGFyc2VGbG9hdChvcHRpb25zLnRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpICsgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWU7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5wcm9ncmVzc0Jhcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmludGVydmFsSWQgPSBzZXRJbnRlcnZhbCh1cGRhdGVQcm9ncmVzcywgMTApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0SWNvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5pY29uQ2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy50b2FzdENsYXNzKS5hZGRDbGFzcyhpY29uQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0U2VxdWVuY2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLm5ld2VzdE9uVG9wKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLnByZXBlbmQoJHRvYXN0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFRpdGxlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWFwLnRpdGxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLnRpdGxlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXNjYXBlSHRtbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeCA9IGVzY2FwZUh0bWwobWFwLnRpdGxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICR0aXRsZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy50aXRsZUNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYXBwZW5kKCR0aXRsZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0TWVzc2FnZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5tZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VmZml4ID0gbWFwLm1lc3NhZ2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5lc2NhcGVIdG1sKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VmZml4ID0gZXNjYXBlSHRtbChtYXAubWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAkbWVzc2FnZUVsZW1lbnQuYXBwZW5kKHN1ZmZpeCkuYWRkQ2xhc3Mob3B0aW9ucy5tZXNzYWdlQ2xhc3MpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5hcHBlbmQoJG1lc3NhZ2VFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldENsb3NlQnV0dG9uKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZUJ1dHRvbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGNsb3NlRWxlbWVudC5hZGRDbGFzcyhvcHRpb25zLmNsb3NlQ2xhc3MpLmF0dHIoJ3JvbGUnLCAnYnV0dG9uJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LnByZXBlbmQoJGNsb3NlRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRQcm9ncmVzc0JhcigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucHJvZ3Jlc3NCYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy5wcm9ncmVzc0NsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQucHJlcGVuZCgkcHJvZ3Jlc3NFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFJUTCgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucnRsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmFkZENsYXNzKCdydGwnKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3VsZEV4aXQob3B0aW9ucywgbWFwKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnByZXZlbnREdXBsaWNhdGVzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWFwLm1lc3NhZ2UgPT09IHByZXZpb3VzVG9hc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUb2FzdCA9IG1hcC5tZXNzYWdlO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlVG9hc3Qob3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1ldGhvZCA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VNZXRob2QgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZU1ldGhvZCA6IG9wdGlvbnMuaGlkZU1ldGhvZDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGR1cmF0aW9uID0gb3ZlcnJpZGUgJiYgb3B0aW9ucy5jbG9zZUR1cmF0aW9uICE9PSBmYWxzZSA/XG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLmNsb3NlRHVyYXRpb24gOiBvcHRpb25zLmhpZGVEdXJhdGlvbjtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGVhc2luZyA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VFYXNpbmcgIT09IGZhbHNlID8gb3B0aW9ucy5jbG9zZUVhc2luZyA6IG9wdGlvbnMuaGlkZUVhc2luZztcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCAmJiAhb3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQocHJvZ3Jlc3NCYXIuaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkdG9hc3RFbGVtZW50W21ldGhvZF0oe1xuICAgICAgICAgICAgICAgICAgICAgICAgZHVyYXRpb246IGR1cmF0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgZWFzaW5nOiBlYXNpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVRvYXN0KCR0b2FzdEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbkhpZGRlbiAmJiByZXNwb25zZS5zdGF0ZSAhPT0gJ2hpZGRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkhpZGRlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5zdGF0ZSA9ICdoaWRkZW4nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLmVuZFRpbWUgPSBuZXcgRGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1Ymxpc2gocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWxheWVkSGlkZVRvYXN0KCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy50aW1lT3V0ID4gMCB8fCBvcHRpb25zLmV4dGVuZGVkVGltZU91dCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQgPSBzZXRUaW1lb3V0KGhpZGVUb2FzdCwgb3B0aW9ucy5leHRlbmRlZFRpbWVPdXQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWUgPSBwYXJzZUZsb2F0KG9wdGlvbnMuZXh0ZW5kZWRUaW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmhpZGVFdGEgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc3RpY2tBcm91bmQoKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChpbnRlcnZhbElkKTtcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NCYXIuaGlkZUV0YSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuc3RvcCh0cnVlLCB0cnVlKVtvcHRpb25zLnNob3dNZXRob2RdKFxuICAgICAgICAgICAgICAgICAgICAgICAge2R1cmF0aW9uOiBvcHRpb25zLnNob3dEdXJhdGlvbiwgZWFzaW5nOiBvcHRpb25zLnNob3dFYXNpbmd9XG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlUHJvZ3Jlc3MoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwZXJjZW50YWdlID0gKChwcm9ncmVzc0Jhci5oaWRlRXRhIC0gKG5ldyBEYXRlKCkuZ2V0VGltZSgpKSkgLyBwcm9ncmVzc0Jhci5tYXhIaWRlVGltZSkgKiAxMDA7XG4gICAgICAgICAgICAgICAgICAgICRwcm9ncmVzc0VsZW1lbnQud2lkdGgocGVyY2VudGFnZSArICclJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBnZXRPcHRpb25zKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiAkLmV4dGVuZCh7fSwgZ2V0RGVmYXVsdHMoKSwgdG9hc3RyLm9wdGlvbnMpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgaWYgKCEkY29udGFpbmVyKSB7ICRjb250YWluZXIgPSBnZXRDb250YWluZXIoKTsgfVxuICAgICAgICAgICAgICAgIGl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ZXIsIHJvdXRlcykge1xuXG4gICAgcm91dGVzLmZvckVhY2goZnVuY3Rpb24gKHIpIHtcbiAgICAgICAgc2V0Um91dGUoci51cmwsIHIuY29uZmlnKTtcbiAgICB9KTtcblxuICAgICRyb3V0ZVByb3ZpZGVyLm90aGVyd2lzZSh7IHJlZGlyZWN0VG86ICcvJyB9KTtcblxuICAgIGZ1bmN0aW9uIHNldFJvdXRlKHVybCwgY29uZmlnKSB7XG5cbiAgICAgICAgJHJvdXRlUHJvdmlkZXIud2hlbih1cmwsIGNvbmZpZyk7XG5cbiAgICAgICAgcmV0dXJuICRyb3V0ZVByb3ZpZGVyO1xuICAgIH1cbn1cblxuLy8gRGVmaW5lIHRoZSByb3V0ZXMgXG5mdW5jdGlvbiBnZXRSb3V0ZXMoKSB7XG4gICAgcmV0dXJuIFtcbiAgICAgICAge1xuICAgICAgICAgICAgdXJsOiAnLycsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC93ZWxjb21lL3dlbGNvbWUuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdXZWxjb21lIFBhZ2UnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvd2VsY29tZScsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC93ZWxjb21lL3dlbGNvbWUuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdXZWxjb21lIFBhZ2UnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL3JlcG9zLmh0bWwnLFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgUmVwbycsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9icmFuY2hlcy5odG1sJyxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIEJyYW5jaCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL21vZGVscy5odG1sJyxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIE1vZGVsJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3RocmVhdG1vZGVsLzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdUaHJlYXQgTW9kZWwgRGV0YWlscycsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxkZXRhaWwuaHRtbCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC9lZGl0LzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdFZGl0IFRocmVhdCBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxlZGl0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvcmVwb3J0LzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdUaHJlYXQgTW9kZWwgUmVwb3J0JyxcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC90aHJlYXRtb2RlbHMvd2VicmVwb3J0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvbmV3L3RocmVhdG1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgUmVwbyBGb3IgWW91ciBOZXcgTW9kZWwnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9yZXBvcy5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL25ldy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnQ2hvb3NlIGEgQnJhbmNoIEZvciBZb3VyIE5ldyBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL2JyYW5jaGVzLmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvbmV3L3RocmVhdG1vZGVsLzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaCcsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0NyZWF0ZSBhIE5ldyBNb2RlbCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0aHJlYXRtb2RlbHMvdGhyZWF0bW9kZWxlZGl0Lmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvOm9yZ2FuaXNhdGlvbi86cmVwby86YnJhbmNoLzptb2RlbC9kaWFncmFtLzpkaWFncmFtSWQnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgIC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ICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuICRodHRwLmdldChtb2RlbHNVcmksIGNvbmZpZyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gbG9hZChsb2NhdGlvbiwgZm9yY2VRdWVyeSkge1xuXG4gICAgICAgIHZhciBsb2MgPSB7XG4gICAgICAgICAgICBvcmdhbmlzYXRpb246IGxvY2F0aW9uLm9yZ2FuaXNhdGlvbixcbiAgICAgICAgICAgIHJlcG86IGxvY2F0aW9uLnJlcG8sXG4gICAgICAgICAgICBicmFuY2g6IGxvY2F0aW9uLmJyYW5jaCxcbiAgICAgICAgICAgIG1vZGVsOiBsb2NhdGlvbi5tb2RlbFxuICAgICAgICB9O1xuXG5cbiAgICAgICAgLy9kb24ndCByZWZldGNoIGlmIHRoZSBsb2NhdGlvbiBoYXMgbm90IGNoYW5nZWRcbiAgICAgICAgaWYgKHNlcnZpY2UudGhyZWF0TW9kZWwgJiYgSlNPTi5zdHJpbmdpZnkobG9jKSA9PT0gSlNPTi5zdHJpbmdpZnkoc2VydmljZS50aHJlYXRNb2RlbExvY2F0aW9uKSAmJiAhZm9yY2VRdWVyeSkge1xuICAgICAgICAgICAgcmV0dXJuICRxLndoZW4oc2VydmljZS50aHJlYXRNb2RlbCk7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgdGhyZWF0TW9kZWxVcmkgPSBidWlsZFVyaShsb2MpICsgJy9kYXRhJztcblxuICAgICAgICB2YXIgY29uZmlnID0ge1xuICAgICAgICAgICAgaGVhZGVyczogeyBBY2NlcHQ6ICdhcHBsaWNhdGlvbi9qc29uJyB9XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuICRodHRwLmdldCh0aHJlYXRNb2RlbFVyaSwgY29uZmlnKS50aGVuKG9uTG9hZGVkVGhyZWF0TW9kZWwsIG9uTG9hZEVycm9yKTtcblxuICAgICAgICBmdW5jdGlvbiBvbkxvYWRlZFRocmVhdE1vZGVsKHJlc3VsdCkge1xuICAgICAgICAg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cG9zKCkge1xuICAgICAgICByZXR1cm4gZGF0YWNvbnRleHQucmVwb3MoJGxvY2F0aW9uLnNlYXJjaCgpLnBhZ2UpLnRoZW4oXG4gICAgICAgICAgICBmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICB2bS5wYWdpbmF0aW9uID0gcmVzcG9uc2UuZGF0YS5wYWdpbmF0aW9uO1xuICAgICAgICAgICAgICAgIHZtLnBhZ2luYXRpb24ucGFnZSA9IHBhcnNlSW50KHZtLnBhZ2luYXRpb24ucGFnZSwgMTApO1xuICAgICAgICAgICAgICAgIHZtLnJlcG9zID0gcmVzcG9uc2UuZGF0YS5yZXBvcztcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgdm0ucmVwb3MgPSBbXTtcbiAgICAgICAgICAgICAgICBvbkVycm9yKGVycik7XG4gICAgICAgICAgICB9XG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0QnJhbmNoZXMob3JnYW5pc2F0aW9uLCByZXBvKSB7XG4gICAgICAgIHJldHVybiBkYXRhY29udGV4dC5icmFuY2hlcyhvcmdhbmlzYXRpb24sIHJlcG8sICRsb2NhdGlvbi5zZWFyY2goKS5wYWdlKS50aGVuKFxuICAgICAgICAgICAgZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdm0ucGFnaW5hdGlvbiA9IHJlc3BvbnNlLmRhdGEucGFnaW5hdGlvbjtcbiAgICAgICAgICAgICAgICB2bS5wYWdpbmF0aW9uLnBhZ2UgPSBwYXJzZUludCh2bS5wYWdpbmF0aW9uLnBhZ2UsIDEwKTtcbiAgICAgICAgICAgICAgICB2bS5icmFuY2hlcyA9IHJlc3BvbnNlLmRhdGEuYnJhbmNoZXM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgIHZtLmJyYW5jaGVzID0gW107XG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldE1vZGVscyhvcmdhbmlzYXRpb24sIHJlcG8sIGJyYW5jaCkge1xuICAgICAgICByZXR1cm4gZGF0YWNvbnRleHQubW9kZWxzKG9yZ2FuaXNhdGlvbiwgcmVwbywgYnJhbmNoKS50aGVuKFxuICAgICAgICAgICAgZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdm0ubW9kZWxzID0gcmVzcG9uc2UuZGF0YTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBmdW5jdGlvbiAoZXJyKSB7XG4gICAgICAgICAgICAgICAgdm0ubW9kZWxzID0gW107XG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gc2VsZWN0QnJhbmNoKGJyYW5jaCkge1xuICAgICAgICAkbG9jYXRpb24udXJsKHVyaVByZWZpeCgpICsgJ3RocmVhdG1vZGVsLycgKyB2bS5vcmdhbmlzYXRpb24gKyAnLycgKyB2bS5yZXBvICsgJy8nICsgYnJhbmNoKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZWxlY3RSZXBvKHJlcG9GdWxsTmFtZSkge1xuICAgICAgICAkbG9jYXRpb24udXJsKHVyaVByZWZpeCgpICsgJ3RocmVhdG1vZGVsLycgKyByZXBvRnVsbE5hbWUpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIG5leHRQYWdlKCkge1xuICAgICAgICBpZiAodm0ucGFnaW5hdGlvbi5uZXh0KSB7XG4gICAgICAgICAgICAkbG9jYXRpb24uc2VhcmNoKCdwYWdlJywgdm0ucGFnaW5hdGlvbi5wYWdlICsgMSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsb2dFcn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vbWUgVmlldycpOyB9KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBsb2FkRGVtb01vZGVsKCkge1xuICAgICAgICB2YXIgbG9jID0gJ3RocmVhdG1vZGVsLyc7XG4gICAgICAgIGxvYyArPSBjb21tb25Db25maWcuY29uZmlnLmRlbW9Nb2RlbExvY2F0aW9uLm9yZ2FuaXNhdGlvbiArICcvJztcbiAgICAgICAgbG9jICs9IGNvbW1vbkNvbmZpZy5jb25maWcuZGVtb01vZGVsTG9jYXRpb24ucmVwbyArICcvJztcbiAgICAgICAgbG9jICs9IGNvbW1vbkNvbmZpZy5jb25maWcuZGVtb01vZGVsTG9jYXRpb24uYnJhbmNoICsgJy8nO1xuICAgICAgICBsb2MgKz0gY29tbW9uQ29uZmlnLmNvbmZpZy5kZW1vTW9kZWxMb2NhdGlvbi5tb2RlbDtcbiAgICAgICAgJGxvY2F0aW9uLnBhdGgobG9jKTtcbiAgICB9XG59XG5cbm1vZHVsZS5leHBvcnRzID0gd2VsY29tZTsiXX0= +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1hbmltYXRlL2FuZ3VsYXItYW5pbWF0ZS5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLWFuaW1hdGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci1yb3V0ZS9hbmd1bGFyLXJvdXRlLmpzIiwibm9kZV9tb2R1bGVzL2FuZ3VsYXItcm91dGUvaW5kZXguanMiLCJub2RlX21vZHVsZXMvYW5ndWxhci11aS1ib290c3RyYXAvZGlzdC91aS1ib290c3RyYXAtdHBscy5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXVpLWJvb3RzdHJhcC9pbmRleC5qcyIsIm5vZGVfbW9kdWxlcy9hbmd1bGFyLXhl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bGFzcyk7XG5cbiAgICAgICAgICAgIHRpbWluZ3MgPSBjb21wdXRlVGltaW5ncyhub2RlLCBmdWxsQ2xhc3NOYW1lLCBjYWNoZUtleSwgZmFsc2UpO1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHRpbWluZ3MubWF4RGVsYXk7XG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgbWF4RHVyYXRpb24gPSB0aW1pbmdzLm1heER1cmF0aW9uO1xuXG4gICAgICAgICAgICBpZiAobWF4RHVyYXRpb24gPT09IDApIHtcbiAgICAgICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmbGFncy5oYXNUcmFuc2l0aW9ucyA9IHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICAgIGZsYWdzLmhhc0FuaW1hdGlvbnMgPSB0aW1pbmdzLmFuaW1hdGlvbkR1cmF0aW9uID4gMDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZmxhZ3MuYXBwbHlBbmltYXRpb25EZWxheSkge1xuICAgICAgICAgICAgcmVsYXRpdmVEZWxheSA9IHR5cGVvZiBvcHRpb25zLmRlbGF5ICE9PSAnYm9vbGVhbicgJiYgdHJ1dGh5VGltaW5nVmFsdWUob3B0aW9ucy5kZWxheSlcbiAgICAgICAgICAgICAgICAgID8gcGFyc2VGbG9hdChvcHRpb25zLmRlbGF5KVxuICAgICAgICAgICAgICAgICAgOiByZWxhdGl2ZURlbGF5O1xuXG4gICAgICAgICAgICBtYXhEZWxheSA9IE1hdGgubWF4KHJlbGF0aXZlRGVsYXksIDApO1xuICAgICAgICAgICAgdGltaW5ncy5hbmltYXRpb25EZWxheSA9IHJlbGF0aXZlRGVsYXk7XG4gICAgICAgICAgICBkZWxheVN0eWxlID0gZ2V0Q3NzRGVsYXlTdHlsZShyZWxhdGl2ZURlbGF5LCB0cnVlKTtcbiAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKGRlbGF5U3R5bGUpO1xuICAgICAgICAgICAgbm9kZS5zdHlsZVtkZWxheVN0eWxlWzBdXSA9IGRlbGF5U3R5bGVbMV07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgbWF4RGVsYXlUaW1lID0gbWF4RGVsYXkgKiBPTkVfU0VDT05EO1xuICAgICAgICAgIG1heER1cmF0aW9uVGltZSA9IG1heER1cmF0aW9uICogT05FX1NFQ09ORDtcblxuICAgICAgICAgIGlmIChvcHRpb25zLmVhc2luZykge1xuICAgICAgICAgICAgdmFyIGVhc2VQcm9wLCBlYXNlVmFsID0gb3B0aW9ucy5lYXNpbmc7XG4gICAgICAgICAgICBpZiAoZmxhZ3MuaGFzVHJhbnNpdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBUUkFOU0lUSU9OX1BST1AgKyBUSU1JTkdfS0VZO1xuICAgICAgICAgICAgICB0ZW1wb3JhcnlTdHlsZXMucHVzaChbZWFzZVByb3AsIGVhc2VWYWxdKTtcbiAgICAgICAgICAgICAgbm9kZS5zdHlsZVtlYXNlUHJvcF0gPSBlYXNlVmFsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZsYWdzLmhhc0FuaW1hdGlvbnMpIHtcbiAgICAgICAgICAgICAgZWFzZVByb3AgPSBBTklNQVRJT05fUFJPUCArIFRJTUlOR19LRVk7XG4gICAgICAgICAgICAgIHRlbXBvcmFyeVN0eWxlcy5wdXNoKFtlYXNlUHJvcCwgZWFzZVZhbF0pO1xuICAgICAgICAgICAgICBub2RlLnN0eWxlW2Vhc2VQcm9wXSA9IGVhc2VWYWw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHRpbWluZ3MudHJhbnNpdGlvbkR1cmF0aW9uKSB7XG4gICAgICAgICAgICBldmVudHMucHVzaChUUkFOU0lUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodGltaW5ncy5hbmltYXRpb25EdXJhdGlvbikge1xuICAgICAgICAgICAgZXZlbnRzLnB1c2goQU5JTUFUSU9ORU5EX0VWRU5UKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzdGFydFRpbWUgPSBEYXRlLm5vdygpO1xuICAgICAgICAgIHZhciB0aW1lclRpbWUgPSBtYXhEZWxheVRpbWUgKyBDTE9TSU5HX1RJTUVfQlVGRkVSICogbWF4RHVyYXRpb25UaW1lO1xuICAgICAgICAgIHZhciBlbmRUaW1lID0gc3RhcnRUaW1lICsgdGltZXJUaW1lO1xuXG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKSB8fCBbXTtcbiAgICAgICAgICB2YXIgc2V0dXBGYWxsYmFja1RpbWVyID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoYW5pbWF0aW9uc0RhdGEubGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY3VycmVudFRpbWVyRGF0YSA9IGFuaW1hdGlvbnNEYXRhWzBdO1xuICAgICAgICAgICAgc2V0dXBGYWxsYmFja1RpbWVyID0gZW5kVGltZSA+IGN1cnJlbnRUaW1lckRhdGEuZXhwZWN0ZWRFbmRUaW1lO1xuICAgICAgICAgICAgaWYgKHNldHVwRmFsbGJhY2tUaW1lcikge1xuICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwoY3VycmVudFRpbWVyRGF0YS50aW1lcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBhbmltYXRpb25zRGF0YS5wdXNoKGNsb3NlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoc2V0dXBGYWxsYmFja1RpbWVyKSB7XG4gICAgICAgICAgICB2YXIgdGltZXIgPSAkdGltZW91dChvbkFuaW1hdGlvbkV4cGlyZWQsIHRpbWVyVGltZSwgZmFsc2UpO1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGFbMF0gPSB7XG4gICAgICAgICAgICAgIHRpbWVyOiB0aW1lcixcbiAgICAgICAgICAgICAgZXhwZWN0ZWRFbmRUaW1lOiBlbmRUaW1lXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYW5pbWF0aW9uc0RhdGEucHVzaChjbG9zZSk7XG4gICAgICAgICAgICBlbGVtZW50LmRhdGEoQU5JTUFURV9USU1FUl9LRVksIGFuaW1hdGlvbnNEYXRhKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoZXZlbnRzLmxlbmd0aCkge1xuICAgICAgICAgICAgZWxlbWVudC5vbihldmVudHMuam9pbignICcpLCBvbkFuaW1hdGlvblByb2dyZXNzKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAob3B0aW9ucy50bykge1xuICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICAgICAgICByZWdpc3RlclJlc3RvcmFibGVTdHlsZXMocmVzdG9yZVN0eWxlcywgbm9kZSwgT2JqZWN0LmtleXMob3B0aW9ucy50bykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXBwbHlBbmltYXRpb25Ub1N0eWxlcyhlbGVtZW50LCBvcHRpb25zKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBvbkFuaW1hdGlvbkV4cGlyZWQoKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbnNEYXRhID0gZWxlbWVudC5kYXRhKEFOSU1BVEVfVElNRVJfS0VZKTtcblxuICAgICAgICAgIC8vIHRoaXMgd2lsbCBiZSBmYWxzZSBpbiB0aGUgZXZlbnQgdGhhdCB0aGUgZWxlbWVudCB3YXNcbiAgICAgICAgICAvLyByZW1vdmVkIGZyb20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dGlvbiBpbml0RHJpdmVyRm4oYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgcmV0dXJuIGFuaW1hdGlvbkRldGFpbHMuZnJvbSAmJiBhbmltYXRpb25EZXRhaWxzLnRvXG4gICAgICAgICAgPyBwcmVwYXJlRnJvbVRvQW5jaG9yQW5pbWF0aW9uKGFuaW1hdGlvbkRldGFpbHMuZnJvbSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uRGV0YWlscy50byxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uRGV0YWlscy5jbGFzc2VzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb25EZXRhaWxzLmFuY2hvcnMpXG4gICAgICAgICAgOiBwcmVwYXJlUmVndWxhckFuaW1hdGlvbihhbmltYXRpb25EZXRhaWxzKTtcbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gZmlsdGVyQ3NzQ2xhc3NlcyhjbGFzc2VzKSB7XG4gICAgICAvL3JlbW92ZSBhbGwgdGhlIGBuZy1gIHN0dWZmXG4gICAgICByZXR1cm4gY2xhc3Nlcy5yZXBsYWNlKC9cXGJuZy1cXFMrXFxiL2csICcnKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBnZXRVbmlxdWVWYWx1ZXMoYSwgYikge1xuICAgICAgaWYgKGlzU3RyaW5nKGEpKSBhID0gYS5zcGxpdCgnICcpO1xuICAgICAgaWYgKGlzU3RyaW5nKGIpKSBiID0gYi5zcGxpdCgnICcpO1xuICAgICAgcmV0dXJuIGEuZmlsdGVyKGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICByZXR1cm4gYi5pbmRleE9mKHZhbCkgPT09IC0xO1xuICAgICAgfSkuam9pbignICcpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIHByZXBhcmVBbmNob3JlZEFuaW1hdGlvbihjbGFzc2VzLCB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ICB9XG5cbiAgICAgIHZhciBzdGFydGluZ0FuaW1hdG9yID0gYW5pbWF0b3JPdXQgfHwgYW5pbWF0b3JJbjtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBydW5uZXI7XG5cbiAgICAgICAgICB2YXIgY3VycmVudEFuaW1hdGlvbiA9IHN0YXJ0aW5nQW5pbWF0b3Iuc3RhcnQoKTtcbiAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgIGlmICghYW5pbWF0b3JJbikge1xuICAgICAgICAgICAgICBhbmltYXRvckluID0gcHJlcGFyZUluQW5pbWF0aW9uKCk7XG4gICAgICAgICAgICAgIGlmIChhbmltYXRvckluKSB7XG4gICAgICAgICAgICAgICAgY3VycmVudEFuaW1hdGlvbiA9IGFuaW1hdG9ySW4uc3RhcnQoKTtcbiAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBjdXJyZW50QW5pbWF0aW9uID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIGVuZCgpO1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJlbnRBbmltYXRpb247XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGluIHRoZSBldmVudCB0aGF0IHRoZXJlIGlzIG5vIGBpbmAgYW5pbWF0aW9uXG4gICAgICAgICAgICBlbmQoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW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wgbm9vcCk7XG4gICAgICB2YXIgdG9BbmltYXRpb24gPSBwcmVwYXJlUmVndWxhckFuaW1hdGlvbih0bywgbm9vcCk7XG5cbiAgICAgIHZhciBhbmNob3JBbmltYXRpb25zID0gW107XG4gICAgICBmb3JFYWNoKGFuY2hvcnMsIGZ1bmN0aW9uKGFuY2hvcikge1xuICAgICAgICB2YXIgb3V0RWxlbWVudCA9IGFuY2hvclsnb3V0J107XG4gICAgICAgIHZhciBpbkVsZW1lbnQgPSBhbmNob3JbJ2luJ107XG4gICAgICAgIHZhciBhbmltYXRvciA9IHByZXBhcmVBbmNob3JlZEFuaW1hdGlvbihjbGFzc2VzLCBvdXRFbGVtZW50LCBpbkVsZW1lbnQpO1xuICAgICAgICBpZiAoYW5pbWF0b3IpIHtcbiAgICAgICAgICBhbmNob3JBbmltYXRpb25zLnB1c2goYW5pbWF0b3IpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgLy8gbm8gcG9pbnQgaW4gZG9pbmcgYW55dGhpbmcgd2hlbiB0aGVyZSBhcmUgbm8gZWxlbWVudHMgdG8gYW5pbWF0ZVxuICAgICAgaWYgKCFmcm9tQW5pbWF0aW9uICYmICF0b0FuaW1hdGlvbiAmJiBhbmNob3JBbmltYXRpb25zLmxlbmd0aCA9PT0gMCkgcmV0dXJuO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBzdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvblJ1bm5lcnMgPSBbXTtcblxuICAgICAgICAgIGlmIChmcm9tQW5pbWF0aW9uKSB7XG4gICAgICAgICAgICBhbmltYXRpb25SdW5uZXJzLnB1c2goZnJvbUFuaW1hdGlvbi5zdGFydCgpKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgIGFuaW1hdGlvblJ1bm5lcnMucHVzaCh0b0FuaW1hdGlvbi5zdGFydCgpKTtcbiAgICA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Uge1xuICAgICAgICAgICAgY2xvc2UoKTtcbiAgICAgICAgICAgIHJ1bm5lciA9IG5ldyAkJEFuaW1hdGVSdW5uZXIoKTtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSh0cnVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgICAgfSxcbiAgICAgICAgc3RhcnQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGlmIChydW5uZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBydW5uZXI7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcigpO1xuICAgICAgICAgIHZhciBjbG9zZUFjdGl2ZUFuaW1hdGlvbnM7XG4gICAgICAgICAgdmFyIGNoYWluID0gW107XG5cbiAgICAgICAgICBpZiAoYmVmb3JlKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGNsb3NlQWN0aXZlQW5pbWF0aW9ucyA9IGJlZm9yZShmbik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoY2hhaW4ubGVuZ3RoKSB7XG4gICAgICAgICAgICBjaGFpbi5wdXNoKGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICAgICAgIGFwcGx5T3B0aW9ucygpO1xuICAgICAgICAgICAgICBmbih0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhcHBseU9wdGlvbnMoKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoYWZ0ZXIpIHtcbiAgICAgICAgICAgIGNoYWluLnB1c2goZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgICAgICAgY2xvc2VBY3RpdmVBbmltYXRpb25zID0gYWZ0ZXIoZm4pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcnVubmVyLnNldEhvc3Qoe1xuICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgZW5kQW5pbWF0aW9ucygpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGVuZEFuaW1hdGlvbnModHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuY2hhaW4oY2hhaW4sIG9uQ29tcGxldGUpO1xuICAgICAgICAgIHJldHVybiBydW5uZXI7XG5cbiAgICAgICAgICBmdW5jdGlvbiBvbkNvbXBsZXRlKHN1Y2Nlc3MpIHtcbiAgICAgICAgICAgIGNsb3NlKHN1Y2Nlc3MpO1xuICAgICAgICAgICAgcnVubmVyLmNvbXBsZXRlKHN1Y2Nlc3MpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGZ1bmN0aW9uIGVuZEFuaW1hdGlvbnMoY2FuY2VsbGVkKSB7XG4gICAgICAgICAgICBpZiAoIWFuaW1hdGlvbkNsb3NlZCkge1xuICAgICAgICAgICAgICAoY2xvc2VBY3RpdmVBbmltYXRpb25zIHx8IG5vb3ApKGNhbmNlbGxlZCk7XG4gICAgICAgICAgICAgIG9uQ29tcGxldGUoY2FuY2VsbGVkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIGZ1bmN0aW9uIGV4ZWN1dGVBbmltYXRpb25GbihmbiwgZWxlbWVudCwgZXZlbnQsIG9wdGlvbnMsIG9uRG9uZSkge1xuICAgICAgICB2YXIgYXJncztcbiAgICAgICAgc3dpdGNoIChldmVudCkge1xuICAgICAgICAgIGNhc2UgJ2FuaW1hdGUnOlxuICAgICAgICAgICAgYXJncyA9IFtlbGVtZW50LCBvcHRpb25zLmZyb20sI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AgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBub29wO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsIGV2ZW50LCBvcHRpb25zLCBhbmltYXRpb25zLCBmbk5hbWUpIHtcbiAgICAgICAgdmFyIG9wZXJhdGlvbnMgPSBbXTtcbiAgICAgICAgZm9yRWFjaChhbmltYXRpb25zLCBmdW5jdGlvbihhbmkpIHtcbiAgICAgICAgICB2YXIgYW5pbWF0aW9uID0gYW5pW2ZuTmFtZV07XG4gICAgICAgICAgaWYgKCFhbmltYXRpb24pIHJldHVybjtcblxuICAgICAgICAgIC8vIG5vdGUgdGhhdCBhbGwgb2YgdGhlc2UgYW5pbWF0aW9ucyB3aWxsIHJ1biBpbiBwYXJhbGxlbFxuICAgICAgICAgIG9wZXJhdGlvbnMucHVzaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBydW5uZXI7XG4gICAgICAgICAgICB2YXIgZW5kUHJvZ3Jlc3NDYjtcblxuICAgICAgICAgICAgdmFyIHJlc29sdmVkID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgb25BbmltYXRpb25Db21wbGV0ZSA9IGZ1bmN0aW9uKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIGlmICghcmVzb2x2ZWQpIHtcbiAgICAgICAgICAgICAgICByZXNvbHZlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgKGVuZFByb2dyZXNzQ2IgfHwgbm9vcCkocmVqZWN0ZWQpO1xuICAgICAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSghcmVqZWN0ZWQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKHtcbiAgICAgICAgICAgICAgZW5kOiBmdW5jdGlvbigpIHtcb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CBhbmltYXRpb25zLCAnYmVmb3JlUmVtb3ZlQ2xhc3MnKTtcbiAgICAgICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdiZWZvcmVBZGRDbGFzcycpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoZm5OYW1lID09PSAnc2V0Q2xhc3MnKSB7XG4gICAgICAgICAgICBhID0gZ3JvdXBFdmVudGVkQW5pbWF0aW9ucyhlbGVtZW50LCAncmVtb3ZlQ2xhc3MnLCBvcHRpb25zLCBhbmltYXRpb25zLCAncmVtb3ZlQ2xhc3MnKTtcbiAgICAgICAgICAgIGIgPSBncm91cEV2ZW50ZWRBbmltYXRpb25zKGVsZW1lbnQsICdhZGRDbGFzcycsIG9wdGlvbnMsIGFuaW1hdGlvbnMsICdhZGRDbGFzcycpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChhKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChiKSB7XG4gICAgICAgICAgICBvcGVyYXRpb25zID0gb3BlcmF0aW9ucy5jb25jYXQoYik7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKG9wZXJhdGlvbnMubGVuZ3RoID09PSAwKSByZXR1cm47XG5cbiAgICAgICAgLy8gVE9ETyhtYXRza28pOiBhZGQgZG9jdW1lbnRhdGlvblxuICAgICAgICByZXR1cm4gZnVuY3Rpb24gc3RhcnRBbmltYXRpb24oY2FsbGJhY2spIHtcbiAgICAgICAgICB2YXIgcnVubmVycyA9IFtdO1xuICAgICAgICAgIGlmIChvcGVyYXRpb25zLmxlbmd0aCkge1xuICAgICAgICAgICAgZm9yRWFjaChvcGVyYXRpb25zLCBmdW5jdGlvbihhbmltYXRlRm4pIHtcbiAgICAgICAgICAgICAgcnVubmVycy5wdXNoKGFuaW1hdGVGbigpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgICAgJCRBbmltYXRlUnVubmVyLmFsbChydW5uZXJzLCBjYWxsYmFjayk7XG4gICAgICAgICAgfSAgZWxzZSB7XG4gICAgICAgICAgICBjYWxsYmFjaygpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBlbmRGbihyZWplY3QpIHtcbiAgICAgICAgICAgIGZvckVhY2gocnVubmVycywgZnVuY3Rpb24ocnVubmVyKSB7XG4gICAgICAgICAgICAgIGlmIChyZWplY3QpIHtcbiAgICAgICAgICAgICAgICBydW5uZXIuY2FuY2VsKCk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9O1xuICAgICAgICB9O1xuICAgICAgfVxuICAgIH07XG5cbiAgICBmdW5jdGlvbiBsb29rdXBBbmltYXRpb25zKGNsYXNzZXMpIHtcbiAgICAgIGNsYXNzZXMgPSBpc0FycmF5KGNsYXNzZXMpID8gY2xhc3NlcyA6IGNsYXNzZXMuc3BsaXQoJyAnKTtcbiAgICAgIHZhciBtYXRjaGVzID0gW10sIGZsYWdNYXAgPSB7fTtcbiAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY2xhc3Nlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIga2xhc3MgPSBjbGFzc2VzW2ldLFxuICAgICAgICAgICAgYW5pbWF0aW9uRmFjdG9yeSA9ICRhbmltYXRlUHJvdmlkZXIuJCRyZWdpc3RlcmVkQW5pbWF0aW9uc1trbGFzc107XG4gICAgICAgIGlmIChhbmltYXRpb25GYWN0b3J5ICYmICFmbGFnTWFwW2tsYXNzXSkge1xuICAgICAgICAg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ICAgIGFuaW1hdGlvblJ1bm5lcnMucHVzaChmcm9tQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodG9BbmltYXRpb24pIHtcbiAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVycy5wdXNoKHRvQW5pbWF0aW9uLnN0YXJ0KCkpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAkJEFuaW1hdGVSdW5uZXIuYWxsKGFuaW1hdGlvblJ1bm5lcnMsIGRvbmUpO1xuXG4gICAgICAgICAgICB2YXIgcnVubmVyID0gbmV3ICQkQW5pbWF0ZVJ1bm5lcih7XG4gICAgICAgICAgICAgIGVuZDogZW5kRm5GYWN0b3J5KCksXG4gICAgICAgICAgICAgIGNhbmNlbDogZW5kRm5GYWN0b3J5KClcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICByZXR1cm4gcnVubmVyO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBlbmRGbkZhY3RvcnkoKSB7XG4gICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmb3JFYWNoKGFuaW1hdGlvblJ1bm5lcnMsIGZ1bmN0aW9uKHJ1bm5lcikge1xuICAgICAgICAgICAgICAgICAgLy8gYXQgdGhpcyBwb2ludCB3ZSBjYW5ub3QgY2FuY2VsIGFuaW1hdGlvbnMgZm9yIGdyb3VwcyBqdXN0IHlldC4gMS41K1xuICAgICAgICAgICAgICAgICAgcnVubmVyLmVuZCgpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBkb25lKHN0YXR1cykge1xuICAgICAgICAgICAgICBydW5uZXIuY29tcGxldGUoc3RhdHVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICB9IGVsc2Uge1xuICAgICAgIC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biAgICAgICAganFMaXRlKGNvbnRhaW5lcikub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgdmFyIGFuaW1hdGlvbkRldGFpbHMgPSBhY3RpdmVBbmltYXRpb25zTG9va3VwLmdldChub2RlKTtcblxuICAgICAgICAgIGlmICghYW5pbWF0aW9uRGV0YWlscykge1xuICAgICAgICAgICAgLy8gSWYgdGhlcmUncyBhbiBhbmltYXRpb24gb25nb2luZywgdGhlIGNhbGxiYWNrIGNhbGxpbmcgY29kZSB3aWxsIHJlbW92ZVxuICAgICAgICAgICAgLy8gdGhlIGV2ZW50IGxpc3RlbmVycy4gSWYgd2UnZCByZW1vdmUgaGVyZSwgdGhlIGNhbGxiYWNrcyB3b3VsZCBiZSByZW1vdmVkXG4gICAgICAgICAgICAvLyBiZWZvcmUgdGhlIGFuaW1hdGlvbiBlbmRzXG4gICAgICAgICAgICAkYW5pbWF0ZS5vZmYoZXZlbnQsIGNvbnRhaW5lciwgY2FsbGJhY2spO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9LFxuXG4gICAgICBvZmY6IGZ1bmN0aW9uKGV2ZW50LCBjb250YWluZXIsIGNhbGxiYWNrKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxICYmICFpc1N0cmluZyhhcmd1bWVudHNbMF0pKSB7XG4gICAgICAgICAgY29udGFpbmVyID0gYXJndW1lbnRzWzBdO1xuICAgICAgICAgIGZvciAodmFyIGV2ZW50VHlwZSBpbiBjYWxsYmFja1JlZ2lzdHJ5KSB7XG4gICAgICAgICAgICBjYWxsYmFja1JlZ2lzdHJ5W2V2ZW50VHlwZV0gPSBmaWx0ZXJGcm9tUmVnaXN0cnkoY2FsbGJhY2tSZWdpc3RyeVtldmVudFR5cGVdLCBjb250YWluZXIpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBlbnRyaWVz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0dGVyXG4gICAgICAvLyAgKGVsZW1lbnQsIGJvb2wpIC0gZWxlbWVudCBzZXR0ZXI8RjM3PlxuICAgICAgZW5hYmxlZDogZnVuY3Rpb24oZWxlbWVudCwgYm9vbCkge1xuICAgICAgICB2YXIgYXJnQ291bnQgPSBhcmd1bWVudHMubGVuZ3RoO1xuXG4gICAgICAgIGlmIChhcmdDb3VudCA9PT0gMCkge1xuICAgICAgICAgIC8vICgpIC0gR2xvYmFsIGdldHRlclxuICAgICAgICAgIGJvb2wgPSAhIWFuaW1hdGlvbnNFbmFibGVkO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBoYXNFbGVtZW50ID0gaXNFbGVtZW50KGVsZW1lbnQpO1xuXG4gICAgICAgICAgaWYgKCFoYXNFbGVtZW50KSB7XG4gICAgICAgICAgICAvLyAoYm9vbCkgLSBHbG9iYWwgc2V0dGVyXG4gICAgICAgICAgICBib29sID0gYW5pbWF0aW9uc0VuYWJsZWQgPSAhIWVsZW1lbnQ7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBub2RlID0gZ2V0RG9tTm9kZShlbGVtZW50KTtcblxuICAgICAgICAgICAgaWYgKGFyZ0NvdW50ID09PSAxKSB7XG4gICAgICAgICAgICAgIC8vIChlbGVtZW50KSAtIEVsZW1lbnQgZ2V0dGVyXG4gICAgICAgICAgICAgIGJvb2wgPSAhZGlzYWJsZWRFbGVtZW50c0xvb2t1cC5nZXQobm9kZSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAvLyAoZWxlbWVudCwgYm9vbCkgLSBFbGVtZW50IHNldHRlclxuICAgICAgICAgICAgICBpZiAoIWRpc2FibGVkRWxlbWVudHNMb29rdXAuaGFzKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgLy8gVGhlIGVsZW1lbnQgaXMgYWRkZWQgdG8gdGhlIG1hcCBmb3IgdGhlIGZpcnN0IHRpbWUuXG4gICAgICAgICAgIC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F0aW9uc1tpXSA9IHtcbiAgICAgICAgICBkb21Ob2RlOiBhbmltYXRpb24uZG9tTm9kZSxcbiAgICAgICAgICBlbGVtZW50OiBhbmltYXRpb24uZWxlbWVudCxcbiAgICAgICAgICBmbjogYW5pbWF0aW9uLmZuLFxuICAgICAgICAgIGNoaWxkcmVuOiBbXVxuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgICAgZm9yIChpID0gMDsgaSA8IGFuaW1hdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgcHJvY2Vzc05vZGUoYW5pbWF0aW9uc1tpXSk7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBmbGF0dGVuKHRyZWUpO1xuXG4gICAgICBmdW5jdGlvbiBwcm9jZXNzTm9kZShlbnRyeSkge1xuICAgICAgICBpZiAoZW50cnkucHJvY2Vzc2VkKSByZXR1cm4gZW50cnk7XG4gICAgICAgIGVudHJ5LnByb2Nlc3NlZCA9IHRydWU7XG5cbiAgICAgICAgdmFyIGVsZW1lbnROb2RlID0gZW50cnkuZG9tTm9kZTtcbiAgICAgICAgdmFyIHBhcmVudE5vZGUgPSBlbGVtZW50Tm9kZS5wYXJlbnROb2RlO1xuICAgICAgICBsb29rdXAuc2V0KGVsZW1lbnROb2RlLCBlbnRyeSk7XG5cbiAgICAgICAgdmFyIHBhcmVudEVudHJ5O1xuICAgICAgICB3aGlsZSAocGFyZW50Tm9kZSkge1xuICAgICAgICAgIHBhcmVudEVudHJ5ID0gbG9va3VwLmdldChwYXJlbnROb2RlKTtcbiAgICAgICAgICBpZiAocGFyZW50RW50cnkpIHtcbiAgICAgICAgICAgIGlmICghcGFyZW50RW50cnkucHJvY2Vzc2VkKSB7XG4gICAgICAgICAgICAgIHBhcmVudEVudHJ5ID0gcHJvY2Vzc05vZGUocGFyZW50RW50cnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICAgIHBhcmVudE5vZGUgPSBwYXJlbnROb2RlLnBhcmVudE5vZGU7XG4gICAgICAgIH1cblxuICAgICAgICAocGFyZW50RW50cnkgfHwgdHJlZSkuY2hpbGRyZW4ucHVzaChlbnRyeSk7XG4gICAgICAgIHJldHVybiBlbnRyeTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZmxhdHRlbih0cmVlKSB7XG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgICAgdmFyIHF1ZXVlID0gW107XG4gICAgICAgIHZhciBpO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0cmVlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgcXVldWUucHVzaCh0cmVlLmNoaWxkcmVuW2ldKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciByZW1haW5pbmdMZXZlbEVudHJpZXMgPSBxdWV1ZS5sZW5ndGg7XG4gICAgICAgIHZhciBuZXh0TGV2ZWxFbnRyaWVzID0gMDtcbiAgICAgICAgdmFyIHJvdyA9IFtdO1xuXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgIHZhciBlbnRyeSA9IHF1ZXVlW2ldO1xuICAgICAgICAgIGlmIChyZW1haW5pbmdMZXZlbEVudHJpZXMgPD0gMCkge1xuICAgICAgICAgICAgcmVtYWluaW5nTGV2ZWxFbnRyaWVzID0gbmV4dExldmVsRW50cmllcztcbiAgICAgICAgICAgIG5leHRMZXZlbEVudHJpZXMgPSAwO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2gocm93KTtcbiAgICAgICAgICAgIHJvdyA9IFtdO1xuICAgICAgICAgIH1cbiAgICAgICAgICByb3cucHVzaChlbnRyeSk7XG4gICAgICAgICAgZW50cnkuY2hpbGRyZW4uZm9yRWFjaChmdW5jdGlvbihjaGlsZEVudHJ5KSB7XG4gICAgICAgICAgICBuZXh0TGV2ZWxFbnRyaWVzKys7XG4gICAgICAgICAgIC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ZSB0aGUgZGlnZXN0IHJ1bnMgb3JcbiAgICAgICAgICAgICAgLy8gZHVyaW5nIHRoZSBSQUYgc2VxdWVuY2luZyB0aGVuIHdlIHNob3VsZCBub3QgdHJpZ2dlciB0aGUgYW5pbWF0aW9uLlxuICAgICAgICAgICAgICB2YXIgdGFyZ2V0RWxlbWVudCA9IGFuaW1hdGlvbkVudHJ5LmFuY2hvcnNcbiAgICAgICAgICAgICAgICAgID8gKGFuaW1hdGlvbkVudHJ5LmZyb20uZWxlbWVudCB8fCBhbmltYXRpb25FbnRyeS50by5lbGVtZW50KVxuICAgICAgICAgICAgICAgICAgOiBhbmltYXRpb25FbnRyeS5lbGVtZW50O1xuXG4gICAgICAgICAgICAgIGlmIChnZXRSdW5uZXIodGFyZ2V0RWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3BlcmF0aW9uID0gaW52b2tlRmlyc3REcml2ZXIoYW5pbWF0aW9uRW50cnkpO1xuICAgICAgICAgICAgICAgIGlmIChvcGVyYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgIHN0YXJ0QW5pbWF0aW9uRm4gPSBvcGVyYXRpb24uc3RhcnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKCFzdGFydEFuaW1hdGlvbkZuKSB7XG4gICAgICAgICAgICAgICAgY2xvc2VGbigpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBhbmltYXRpb25SdW5uZXIgPSBzdGFydEFuaW1hdGlvbkZuKCk7XG4gICAgICAgICAgICAgICAgYW5pbWF0aW9uUnVubmVyLmRvbmUoZnVuY3Rpb24oc3RhdHVzKSB7XG4gICAgICAgICAgICAgICAgICBjbG9zZUZuKCFzdGF0dXMpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHVwZGF0ZUFuaW1hdGlvblJ1bm5lcnMoYW5pbWF0aW9uRW50cnksI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dldEF0dHJpYnV0ZShOR19BTklNQVRFX1JFRl9BVFRSKTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV0gPSByZWZMb29rdXBba2V5XSB8fCB7fTtcbiAgICAgICAgICAgICAgcmVmTG9va3VwW2tleV1bZGlyZWN0aW9uXSA9IHtcbiAgICAgICAgICAgICAgICBhbmltYXRpb25JRDogaW5kZXgsXG4gICAgICAgICAgICAgICAgZWxlbWVudDoganFMaXRlKGFuY2hvcilcbiAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChhbmltYXRpb24pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgdmFyIHVzZWRJbmRpY2VzTG9va3VwID0ge307XG4gICAgICAgIHZhciBhbmNob3JHcm91cHMgPSB7fTtcbiAgICAgICAgZm9yRWFjaChyZWZMb29rdXAsIGZ1bmN0aW9uKG9wZXJhdGlvbnMsIGtleSkge1xuICAgICAgICAgIHZhciBmcm9tID0gb3BlcmF0aW9ucy5mcm9tO1xuICAgICAgICAgIHZhciB0byA9IG9wZXJhdGlvbnMudG87XG5cbiAgICAgICAgICBpZiAoIWZyb20gfHwgIXRvKSB7XG4gICAgICAgICAgICAvLyBvbmx5IG9uZSBvZiB0aGVzZSBpcyBzZXQgdGhlcmVmb3JlIHdlIGNhbid0IGhhdmUgYW5cbiAgICAgICAgICAgIC8vIGFuY2hvciBhbmltYXRpb24gc2luY2UgYWxsIHRocmVlIHBpZWNlcyBhcmUgcmVxdWlyZWRcbiAgICAgICAgICAgIHZhciBpbmRleCA9IGZyb20gPyBmcm9tLmFuaW1hdGlvbklEIDogdG8uYW5pbWF0aW9uSUQ7XG4gICAgICAgICAgICB2YXIgaW5kZXhLZXkgPSBpbmRleC50b1N0cmluZygpO1xuICAgICAgICAgICAgaWYgKCF1c2VkSW5kaWNlc0xvb2t1cFtpbmRleEtleV0pIHtcbiAgICAgICAgICAgICAgdXNlZEluZGljZXNMb29rdXBbaW5kZXhLZXldID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2goYW5pbWF0aW9uc1tpbmRleF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBmcm9tQW5pbWF0aW9uID0gYW5pbWF0aW9uc1tmcm9tLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgdG9BbmltYXRpb24gPSBhbmltYXRpb25zW3RvLmFuaW1hdGlvbklEXTtcbiAgICAgICAgICB2YXIgbG9va3VwS2V5ID0gZnJvbS5hbmltYXRpb25JRC50b1N0cmluZygpO1xuICAgICAgICAgIGlmICghYW5jaG9yR3JvdXBzW2xvb2t1cEtleV0pIHtcbiAgICAgICAgICAgIHZhciBncm91cCA9IGFuY2hvckdyb3Vwc1tsb29rdXBLZXldID0ge1xuICAgICAgICAgICAgICBzdHJ1Y3R1cmFsOiB0cnVlLFxuICAgICAgICAgICAgICBiZWZvcmVTdGFydDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgZnJvbUFuaW1hdGlvbi5iZWZvcmVTdGFydCgpO1xuICAgICAgICAgICAgICAgIHRvQW5pbWF0aW9uLmJlZm9yZVN0YXJ0KCk7XG4gICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIGNsb3NlOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBmcm9tQW5pbWF0aW9uLmNsb3NlKCk7XG4gICAgICAgICAgICAgICAgdG9BbmltYXRpb24uY2xvc2UoKTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgY2xhc3NlczogY3NzQ2xhc3Nlc0ludGVyc2VjdGlvbihmcm9tQW5pbWF0aW9uLmNsYXNzZXMsIHRvQW5pbWF0aW9uLmNsYXNzZXMpLFxuICAgICAgICAgICAgICBmcm9tOiBmcm9tQW5pbWF0aW9uLFxuICAgICAgICAgICAgICB0bzogdG9BbmltYXRpb24sXG4gICAgICAgICAgICAgIGFuY2hvcnM6IFtdIC8vIFRPRE8obWF0c2tvKTogY2hhbmdlIHRvIHJlZmVyZW5jZSBub2Rlc1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gdGhlIGFuY2hvciBhbmltYXRpb25zIHJlcXVpcmUgdGhhdCB0aGUgZnJvbSBhbmQgdG8gZWxlbWVudHMgYm90aCBoYXZlIGF0IGxlYXN0XG4gICAgICAgICAgICAvLyBvbmUgc2hhcmVkIENTUyBjbGFzcyB3aGljaCBlZmZlY3RpdmVseSBtYXJyaWVzIHRoZSB0d28gZWxlbWVudHMgdG9nZXRoZXIgdG8gdXNlXG4gICAgICAgICAgICAvLyB0aGUgc2FtZSBhbmltYXRpb24gZHJpdmVyIGFuZCB0byBwcm9wZXJseSBzZXF1ZW5jZSB0aGUgYW5jaG9yIGFuaW1hdGlvbi5cbiAgICAgICAgICAgIGlmIChncm91cC5jbGFzc2VzLmxlbmd0aCkge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChncm91cCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICBwcmVwYXJlZEFuaW1hdGlvbnMucHVzaChmcm9tQW5pbWF0aW9uKTtcbiAgICAgICAgICAgICAgcHJlcGFyZWRBbmltYXRpb25zLnB1c2godG9BbmltYXRpb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGFuY2hvckdyb3Vwc1tsb29rdXBLZXldLmFuY2hvcnMucHVzaCh7XG4gICAgICAgICAgICAnb3V0JzogZnJvbS5lbGVtZW50LCAnaW4nOiB0by5lbGVtZW50XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIHJldHVybiBwcmVwYXJlZEFuaW1hdGlvbnM7XG4gICAgICB9XG5cb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bmdlJ107XG4gKiAgICAgICAgICRzY29wZS5jb2xvckNsYXNzID0gZnVuY3Rpb24obnVtYmVyKSB7XG4gKiAgICAgICAgICAgcmV0dXJuIGNvbG9yc1tudW1iZXIgJSBjb2xvcnMubGVuZ3RoXTtcbiAqICAgICAgICAgfTtcbiAqICAgICAgIH1dKTtcbiAqICAgPC9maWxlPlxuICogIDxmaWxlIG5hbWU9XCJhbmltYXRpb25zLmNzc1wiPlxuICogIC5jb250YWluZXIge1xuICogICAgaGVpZ2h0OjI1MHB4O1xuICogICAgd2lkdGg6MjUwcHg7XG4gKiAgICBwb3NpdGlvbjpyZWxhdGl2ZTtcbiAqICAgIG92ZXJmbG93OmhpZGRlbjtcbiAqICAgIGJvcmRlcjoycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5jb250YWluZXIgLmNlbGwge1xuICogICAgZm9udC1zaXplOjE1MHB4O1xuICogICAgdGV4dC1hbGlnbjpjZW50ZXI7XG4gKiAgICBsaW5lLWhlaWdodDoyNTBweDtcbiAqICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICogICAgdG9wOjA7XG4gKiAgICBsZWZ0OjA7XG4gKiAgICByaWdodDowO1xuICogICAgYm9yZGVyLWJvdHRvbToycHggc29saWQgYmxhY2s7XG4gKiAgfVxuICogIC5zd2FwLWFuaW1hdGlvbi5uZy1lbnRlciwgLnN3YXAtYW5pbWF0aW9uLm5nLWxlYXZlIHtcbiAqICAgIHRyYW5zaXRpb246MC41cyBsaW5lYXIgYWxsO1xuICogIH1cbiAqICAuc3dhcC1hbmltYXRpb24ubmctZW50ZXIge1xuICogICAgdG9wOi0yNTBweDtcbiAqICB9XG4gKiAgLnN3YXAtYW5pbWF0aW9uLm5nLWVudGVyLWFjdGl2ZSB7XG4gKiAgICB0b3A6MHB4O1xuICogIH1cbiAqICAuc3dhcC1hbmltYXRpb24ubmctbGVhdmUge1xuICogICAgdG9wOjBweDtcbiAqICB9XG4gKiAgLnN3YXAtYW5pbWF0aW9u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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jYW5pbWF0aW9ucyBmb3JtIC8gbmdGb3JtfSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOmZvcm0jY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgICAgfFxuICogfCB7QGxpbmsgbmdBbmltYXRlLmRpcmVjdGl2ZTpuZ0FuaW1hdGVTd2FwI2FuaW1hdGlvbnMgbmdBbmltYXRlU3dhcH0gICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3MjYW5pbWF0aW9ucyBuZ0NsYXNzIC8ge3tjbGFzcyYjMTI1OyYjODIwMzsmIzEyNTt9ICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NFdmVuI2FuaW1hdGlvbnMgbmdDbGFzc0V2ZW59ICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nQ2xhc3NPZGQjYW5pbWF0aW9ucyBuZ0NsYXNzT2RkfSAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSGlkZSNhbmltYXRpb25zIG5nSGlkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSWYjYW5pbWF0aW9ucyBuZ0lmfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nSW5jbHVkZSNhbmltYXRpb25zIG5nSW5jbHVkZX0gICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2UgLyBuZ01lc3NhZ2VFeHB9ICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbW9kdWxlOm5nTWVzc2FnZXMjYW5pbWF0aW9ucyBuZ01lc3NhZ2VzfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWFjdGl2ZWAvYG5nLWluYWN0aXZlYCBjbGFzc2VzKSAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjYW5pbWF0aW9ucyBuZ01vZGVsfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh7QGxpbmsgbmcuZGlyZWN0aXZlOm5nTW9kZWwjY3NzLWNsYXNzZXMgdmFyaW91cyBjbGFzc2VzfSkgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nUmVwZWF0I2FuaW1hdGlvbnMgbmdSZXBlYXR9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyLCBsZWF2ZSwgYW5kIG1vdmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU2hvdyNhbmltYXRpb25zIG5nU2hvd30gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGFkZCBhbmQgcmVtb3ZlICh0aGUgYG5nLWhpZGVgIGNsYXNzKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmcuZGlyZWN0aXZlOm5nU3dpdGNoI2FuaW1hdGlvbnMgbmdTd2l0Y2h9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogfCB7QGxpbmsgbmdSb3V0ZS5kaXJlY3RpdmU6bmdWaWV3I2FuaW1hdGlvbnMgbmdWaWV3fSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGVudGVyIGFuZCBsZWF2ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICpcbiAqIChNb3JlIGluZm9ybWF0aW9uIGNhbiBiZSBmb3VuZCBieSB2aXNpdGluZyB0aGUgZG9jdW1lbnRhdGlvbiBhc3NvY2lhdGVkIHdpdGggZWFjaCBkaXJlY3RpdmUuKV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vdXRlLmpzXCIgZml4QmFzZT1cInRydWVcIj5cbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gICAgICogICAgIDxkaXYgbmctY29udHJvbGxlcj1cIk1haW5Db250cm9sbGVyXCI+XG4gICAgICogICAgICAgQ2hvb3NlOlxuICAgICAqICAgICAgIDxhIGhyZWY9XCJCb29rL01vYnlcIj5Nb2J5PC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svTW9ieS9jaC8xXCI+TW9ieTogQ2gxPC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svR2F0c2J5XCI+R2F0c2J5PC9hPiB8XG4gICAgICogICAgICAgPGEgaHJlZj1cIkJvb2svR2F0c2J5L2NoLzQ/a2V5PXZhbHVlXCI+R2F0c2J5OiBDaDQ8L2E+IHxcbiAgICAgKiAgICAgICA8YSBocmVmPVwiQm9vay9TY2FybGV0XCI+U2NhcmxldCBMZXR0ZXI8L2E+PGJyLz5cbiAgICAgKlxuICAgICAqICAgICAgIDxkaXYgbmctdmlldz48L2Rpdj5cbiAgICAgKlxuICAgICAqICAgICAgIDxociAvPlxuICAgICAqXG4gICAgICogICAgICAgPHByZT4kbG9jYXRpb24ucGF0aCgpID0ge3skbG9jYXRpb24ucGF0aCgpfX08L3ByZT5cbiAgICAgKiAgICAgICA8cHJlPiRyb3V0ZS5jdXJyZW50LnRlbXBsYXRlVXJsID0ge3skcm91dGUuY3VycmVudC50ZW1wbGF0ZVVybH19PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC5wYXJhbXMgPSB7eyRyb3V0ZS5jdXJyZW50LnBhcmFtc319PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC5zY29wZS5uYW1lID0ge3skcm91dGUuY3VycmVudC5zY29wZS5uYW1lfX08L3ByZT5cbiAgICAgKiAgICAgICA8cHJlPiRyb3V0ZVBhcmFtcyA9IHt7JHJvdXRlUGFyYW1zfX08L3ByZT5cbiAgICAgKiAgICAgPC9kaXY+XG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJib29rLmh0bWxcIj5cbiAgICAgKiAgICAgY29udHJvbGxlcjoge3tuYW1lfX08YnIgLz5cbiAgICAgKiAgICAgQm9vayBJZDoge3twYXJhbXMuYm9va0lkfX08YnIgLz5cbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cImNoYXB0ZXIuaHRtbFwiPlxuICAgICAqICAgICBjb250cm9sbGVyOiB7e25hbWV9fTxiciAvPlxuICAgICAqICAgICBCb29rIElkOiB7e3BhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAqICAgICBDaGFwdGVyIElkOiB7e3BhcmFtcy5jaGFwdGVySWR9fVxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICogICAgIGFuZ3VsYXIubW9kdWxlKCduZ1JvdXRlRXhhbXBsZScsIFsnbmdSb3V0ZSddKVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignTWFpbkNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZSwgJHJvdXRlUGFyYW1zLCAkbG9jYXRpb24pIHtcbiAgICAgKiAgICAgICAgICAkc2NvcGUuJHJvdXRlID0gJHJvdXRlO1xuICAgICAqICAgICAgICAgICRzY29wZS4kbG9jYXRpb24gPSAkbG9jYXRpb247XG4gICAgICogICAgICAgICAgJHNjb3BlLiRyb3V0ZVBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgKiAgICAgIH0pXG4gICAgICpcbiAgICAgKiAgICAgIC5jb250cm9sbGVyKCdCb29rQ29udHJvbGxlcicsIGZ1bmN0aW9uKCRzY29wZSwgJHJvdXRlUGFyYW1zKSB7XG4gICAgICogICAgICAgICAgJHNjb3BlLm5hbWUgPSAnQm9va0NvbnRyb2xsZXInO1xuICAgICAqICAgICAgICAgICRzY29wZS5wYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignQ2hhcHRlckNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZVBhcmFtcykge1xuICAgICAqICAgICAgICAgICRzY29wZS5uYW1lID0gJ0NoYXB0ZXJDb250cm9sbGVyJztcbiAgICAgKiAgICAgICAgICAkc2NvcGUucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAqICAgICAgfSlcbiAgICAgKlxuICAgICAqICAgICAuY29uZmlnKGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAqICAgICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICogICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAqICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDb250cm9sbGVyJyxcbiAgICAgKiAgICAgICAgIHJlc29sdmU6IHtcbiAgICAgKiAgICAgICAgICAgLy8gSSB3aWxsIGNhdXNlIGEgMSBzZWNvbmQgZGVsYXlcbiAgICAgKiAgICAgICAgICAgZGVsYXk6IGZ1bmN0aW9uKCRxLCAkdGltZW91dCkge1xuICAgICAqICAgICAgICAgICAgIHZhciBkZWxheSA9ICRxLmRlZmVyKCk7XG4gICAgICogICAgICAgICAgICAgJHRpbWVvdXQoZGVsYXkucmVzb2x2ZSwgMTAwMCk7XG4gICAgICogICAgICAgICAgICAgcmV0dXJuIGRlbGF5LnByb21pc2U7XG4gICAgICogICAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICB9KVxuICAgICAqICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkL2NoLzpjaGFwdGVySWQnLCB7XG4gICAgICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoYXB0ZXIuaHRtbCcsXG4gICAgICogICAgICAgICBjb250cm9sbGVyOiAnQ2hhcHRlckNvbnRyb2xsZXInXG4gICAgICogICAgICAgfSk7XG4gICAgICpcbiAgICAgKiAgICAgICAvLyBjb25maWd1cmUgaHRtbDUgdG8gZ2V0IGxpbmtzIHdvcmtpbmcgb24ganNmaWRkbGVcbiAgICAgKiAgICAgICAkbG9jYXRpb25Qcm92aWRlci5odG1sNU1vZGUodHJ1ZSk7XG4gICAgICogICAgIH0pO1xuICAgICAqXG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAgICAgKiAgICAgaXQoJ3Nob3VsZCBsb2FkIGFuZCBjb21waWxlIGNvcnJlY3QgdGVtcGxhdGUnLCBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICBlbGVtZW50KGJ5LmxpbmtUZXh0KCdNb2J5OiBDaDEnKSkuY2xpY2soKTtcbiAgICAgKiAgICAgICB2YXIgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzKCdbbmctdmlld10nKSkuZ2V0VGV4dCgpO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9jb250cm9sbGVyOiBDaGFwdGVyQ29udHJvbGxlci8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9Cb29rIElkOiBNb2J5Lyk7XG4gICAgICogICAgICAgZXhwZWN0KGNvbnRlbnQpLnRvTWF0Y2goL0NoYXB0ZXIgSWQ6IDEvKTtcbiAgICAgKlxuICAgICAqICAgICAgIGVsZW1lbnQoYnkucGFydGlhbExpbmtUZXh0KCdTY2FybGV0JykpLmNsaWNrKCk7XG4gICAgICpcbiAgICAgKiAgICAgIC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gICAgICAgICAgcmV0dXJuIGtlZXBQcm9jZXNzaW5nUm91dGUgJiYgbmV4dFJvdXRlUHJvbWlzZS5cbiAgICAgICAgICAgICAgdGhlbihyZXNvbHZlTG9jYWxzKS5cbiAgICAgICAgICAgICAgdGhlbihmdW5jdGlvbihsb2NhbHMpIHtcbiAgICAgICAgICAgICAgICAvLyBhZnRlciByb3V0ZSBjaGFuZ2VcbiAgICAgICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAgICAgaWYgKG5leHRSb3V0ZSkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0Um91dGUubG9jYWxzID0gbG9jYWxzO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmNvcHkobmV4dFJvdXRlLnBhcmFtcywgJHJvdXRlUGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICRyb290U2NvcGUuJGJyb2FkY2FzdCgnJHJvdXRlQ2hhbmdlU3VjY2VzcycsIG5leHRSb3V0ZSwgbGFzdFJvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uKGVycm9yKSB7XG4gICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRicm9hZGNhc3QoJyRyb3V0ZUNoYW5nZUVycm9yJywgbmV4dFJvdXRlLCBsYXN0Um91dGUsIGVycm9yKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KS5maW5hbGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgLy8gQmVjYXVzZSBgY29tbWl0Um91dGUoKWAgaXMgY2FsbGVkIGZyb20gYSBgJHJvb3RTY29wZS4kZXZhbEFzeW5jYCBibG9jayAoc2VlXG4gICAgICAgICAgICAvLyBgJGxvY2F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ICAgICAgICAudmlldy1hbmltYXRlLWNvbnRhaW5lciB7XG4gICAgICAgICAgcG9zaXRpb246cmVsYXRpdmU7XG4gICAgICAgICAgaGVpZ2h0OjEwMHB4IWltcG9ydGFudDtcbiAgICAgICAgICBiYWNrZ3JvdW5kOndoaXRlO1xuICAgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7XG4gICAgICAgICAgaGVpZ2h0OjQwcHg7XG4gICAgICAgICAgb3ZlcmZsb3c6aGlkZGVuO1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZSB7XG4gICAgICAgICAgcGFkZGluZzoxMHB4O1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZS5uZy1lbnRlciwgLnZpZXctYW5pbWF0ZS5uZy1sZWF2ZSB7XG4gICAgICAgICAgdHJhbnNpdGlvbjphbGwgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKSAxLjVzO1xuXG4gICAgICAgICAgZGlzcGxheTpibG9jaztcbiAgICAgICAgICB3aWR0aDoxMDAlO1xuICAgICAgICAgIGJvcmRlci1sZWZ0OjFweCBzb2xpZCBibGFjaztcblxuICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICAgICAgICAgIHRvcDowO1xuICAgICAgICAgIGxlZnQ6MDtcbiAgICAgICAgICByaWdodDowO1xuICAgICAgICAgIGJvdHRvbTowO1xuICAgICAgICAgIHBhZGRpbmc6MTBweDtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctZW50ZXIge1xuICAgICAgICAgIGxlZnQ6MTAwJTtcbiAgICAgICAgfVxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWVudGVyLm5nLWVudGVyLWFjdGl2ZSB7XG4gICAgICAgICAgbGVmdDowO1xuICAgICAgICB9XG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctbGVhdmUubmctbGVhdmUtYWN0aXZlIHtcbiAgICAgICAgICBsZWZ0Oi0xMDAlO1xuICAgICAgICB9XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJzY3JpcHQuanNcIj5cbiAgICAgICAgYW5ndWxhci5tb2R1bGUoJ25nVmlld0V4YW1wbGUnLCBbJ25nUm91dGUnLCAnbmdBbmltYXRlJ10pXG4gICAgICAgICAgLmNvbmZpZyhbJyRyb3V0ZVByb3ZpZGVyJywgJyRsb2NhdGlvblByb3ZpZGVyJyxcbiAgICAgICAgICAgIGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAgICAgICAgICAkcm91dGVQcm92aWRlclxuICAgICAgICAgICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2Jvb2snXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZC9jaC86Y2hhcHRlcklkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjaGFwdGVyLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0NoYXB0ZXJDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2NoYXB0ZXInXG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgJGxvY2F0aW9uUHJvdmlkZXIuaHRtbDVNb2RlKHRydWUpO1xuICAgICAgICAgIH1dKVxuICAgICAgICAgIC5jb250cm9sbGVyKCdNYWluQ3RybCcsIFsnJHJvdXRlJywgJyRyb3V0ZVBhcmFtcycsICckbG9jYXRpb24nLFxuICAgICAgICAgICAgZnV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MCxcbiAgICB0cmFuc2NsdWRlOiAnZWxlbWVudCcsXG4gICAgbGluazogZnVuY3Rpb24oc2NvcGUsICRlbGVtZW50LCBhdHRyLCBjdHJsLCAkdHJhbnNjbHVkZSkge1xuICAgICAgICB2YXIgY3VycmVudFNjb3BlLFxuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQsXG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uLFxuICAgICAgICAgICAgYXV0b1Njcm9sbEV4cCA9IGF0dHIuYXV0b3Njcm9sbCxcbiAgICAgICAgICAgIG9ubG9hZEV4cCA9IGF0dHIub25sb2FkIHx8ICcnO1xuXG4gICAgICAgIHNjb3BlLiRvbignJHJvdXRlQ2hhbmdlU3VjY2VzcycsIHVwZGF0ZSk7XG4gICAgICAgIHVwZGF0ZSgpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGNsZWFudXBMYXN0VmlldygpIHtcbiAgICAgICAgICBpZiAocHJldmlvdXNMZWF2ZUFuaW1hdGlvbikge1xuICAgICAgICAgICAgJGFuaW1hdGUuY2FuY2VsKHByZXZpb3VzTGVhdmVBbmltYXRpb24pO1xuICAgICAgICAgICAgcHJldmlvdXNMZWF2ZUFuaW1hdGlvbiA9IG51bGw7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKGN1cnJlbnRTY29wZSkge1xuICAgICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY3VycmVudEVsZW1lbnQpIHtcbiAgICAgICAgICAgIHByZXZpb3VzTGVhdmVBbmltYXRpb24gPSAkYW5pbWF0ZS5sZWF2ZShjdXJyZW50RWxlbWVudCk7XG4gICAgICAgICAgICBwcmV2aW91c0xlYXZlQW5pbWF0aW9uLmRvbmUoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgaWYgKHJlc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gaXMgY2FsbGVkIGJlZm9yZSBsaW5raW5nIHRoZSBjb250ZW50LCB3aGljaCB3b3VsZCBhcHBseSBjaGlsZFxuICAgICAgICAgICAgLy8gZGlyZWN0aXZlcyB0byBub24gZXhpc3RpbmcgZWxlbWVudHMuXG4gICAgICAgICAgICB2YXIgY2xvbmUgPSAkdHJhbnNjbHVkZShuZXdTY29wZSwgZnVuY3Rpb24oY2xvbmUpIHtcbiAgICAgICAgICAgICAgJGFuaW1hdGUuZW50ZXIoY2xvbmUsIG51bGwsIGN1cnJlbnRFbGVtZW50IHx8ICRlbGVtZW50KS5kb25lKGZ1bmN0aW9uIG9uTmdWaWV3RW50ZXIocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlICYmIGFuZ3VsYXIuaXNEZWZpbmVkKGF1dG9TY3JvbGxFeHApXG4gICAgICAgICAgICAgICAgICAmJiAoIWF1dG9TY3JvbGxFeHAgfHwgc2NvcGUuJGV2YWwoYXV0b1Njcm9sbEV4cCkpKSB7XG4gICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RWaWV3KCk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQgPSBjbG9uZTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IGN1cnJlbnQuc2NvcGUgPSBuZXdTY29wZTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJHZpZXdDb250ZW50TG9hZGVkJyk7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGV2YWwob25sb2FkRXhwKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY2xlYW51cExhc3RWaWV3KCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICB9O1xufVxu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hvcml6b250YWwnIGluIGF0dHJzKTtcbiAgICAgICAgICBpZiAoaG9yaXpvbnRhbCkge1xuICAgICAgICAgICAgY3NzID0ge1xuICAgICAgICAgICAgICB3aWR0aDogJydcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBjc3NUbyA9IHt3aWR0aDogJzAnfTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY3NzID0ge1xuICAgICAgICAgICAgICBoZWlnaHQ6ICcnXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgY3NzVG8gPSB7aGVpZ2h0OiAnMCd9O1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoIXNjb3BlLiRldmFsKGF0dHJzLnVpYkNvbGxhcHNlKSkge1xuICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnaW4nKVxuICAgICAgICAgICAgICAuYWRkQ2xhc3MoJ2NvbGxhcHNlJylcbiAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtZXhwYW5kZWQnLCB0cnVlKVxuICAgICAgICAgICAgICAuYXR0cignYXJpYS1oaWRkZW4nLCBmYWxzZSlcbiAgICAgICAgICAgICAgLmNzcyhjc3MpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnQpIHtcbiAgICAgICAgICBpZiAoaG9yaXpvbnRhbCkge1xuICAgICAgICAgICAgcmV0dXJuIHt3aWR0aDogZWxlbWVudC5zY3JvbGxXaWR0aCArICdweCd9O1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4ge2hlaWdodDogZWxlbWVudC5zY3JvbGxIZWlnaHQgKyAncHgnfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGV4cGFuZCgpIHtcbiAgICAgICAgICBpZiAoZWxlbWVudC5oYXNDbGFzcygnY29sbGFwc2UnKSAmJiBlbGVtZW50Lmhhc0NsYXNzKCdpbicpKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgJHEucmVzb2x2ZShleHBhbmRpbmdFeHByKHNjb3BlKSlcbiAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzaW5nJylcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1leHBhbmRlZCcsIHRydWUpXG4gICAgICAgICAgICAgICAgLmF0dHIoJ2FyaWEtaGlkZGVuJywgZmFsc2UpO1xuXG4gICAgICAgICAgICAgIGlmICgkYW5pbWF0ZUNzcykge1xuICAgICAgICAgICAgICAgICRhbmltYXRlQ3NzKGVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgIGFkZENsYXNzOiAnaW4nLFxuICAgICAgICAgICAgICAgICAgZWFzaW5nOiAnZWFzZScsXG4gICAgICAgICAgICAgICAgICBjc3M6IHtcbiAgICAgICAgICAgICAgICAgICAgb3ZlcmZsb3c6ICdoaWRkZW4nXG4gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgdG86IGdldFNjcm9sbEZyb21FbGVtZW50KGVsZW1lbnRbMF0pXG4gICAgICAgICAgICAgICAgfSkuc3RhcnQoKVsnZmluYWxseSddKGV4cGFuZERvbmUpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmFkZENsYXNzKGVsZW1lbnQsICdpbicsIHtcbiAgICAgICAgICAgICAgICAgIGNzczoge1xuICAgICAgICAgICAgICAgICAgICBvdmVyZmxvdzogJ2hpZGRlbidcbiAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICB0bzogZ2V0U2Nyb2xsRnJvbUVsZW1lbnQoZWxlbWVudFswXSlcbiAgICAgICAgICAgICAgICB9KS50aGVuKGV4c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sYXBzZSBoYXZlIHRoZSBjb2xsYXBzZSBjbGFzcywgdGhpcyByZW1vdmFsXG4gICAgICAgICAgICAgICAgLy8gcHJldmVudHMgdGhlIGFuaW1hdGlvbiBmcm9tIGp1bXBpbmcgdG8gY29sbGFwc2VkIHN0YXRlXG4gICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKCdjb2xsYXBzZScpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKCdjb2xsYXBzaW5nJylcbiAgICAgICAgICAgICAgICAuYXR0cignYXJpYS1leHBhbmRlZCcsIGZhbHNlKVxuICAgICAgICAgICAgICAgIC5hdHRyKCdhcmlhLWhpZGRlbicsIHRydWUpO1xuXG4gICAgICAgICAgICAgIGlmICgkYW5pbWF0ZUNzcykge1xuICAgICAgICAgICAgICAgICRhbmltYXRlQ3NzKGVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgIHJlbW92ZUNsYXNzOiAnaW4nLFxuICAgICAgICAgICAgICAgICAgdG86IGNzc1RvXG4gICAgICAgICAgICAgICAgfSkuc3RhcnQoKVsnZmluYWxseSddKGNvbGxhcHNlRG9uZSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoZWxlbWVudCwgJ2luJywge1xuICAgICAgICAgICAgICAgICAgdG86IGNzc1RvXG4gICAgICAgICAgICAgICAgfSkudGhlbihjb2xsYXBzZURvbmUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCBhbmd1bGFyLm5vb3ApO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gY29sbGFwc2VEb25lKCkge1xuICAgICAgICAgIGVsZW1lbnQuY3NzKGNzc1RvKTsgLy8gUmVxdWlyZWQgc28gdGhhdCBjb2xsYXBzZSB3b3JrcyB3aGVuIGFuaW1hdGlvbiBpcyBkaXNhYmxlZFxuICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3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dGFuY2VzLnNvbWUoZnVuY3Rpb24oaW5zdGFuY2UpIHtcbiAgICAgICAgICAgICAgdmFyIHRoaXNWYWwgPSBpbnN0YW5jZS5zY29wZS4kZXZhbChvbkV4cCk7XG4gICAgICAgICAgICAgIGlmICh0aGlzVmFsID09PSBjb21wYXJlV2l0aFZhbCkge1xuICAgICAgICAgICAgICAgIG5ld0FjdGl2YXRlZCA9IGluc3RhbmNlO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmIChkYXRhLmxhc3RBY3RpdmF0ZWQgIT09IG5ld0FjdGl2YXRlZCkge1xuICAgICAgICAgICAgICBpZiAoZGF0YS5sYXN0QWN0aXZhdGVkKSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoZGF0YS5sYXN0QWN0aXZhdGVkLmVsZW1lbnQsIGNsYXp6KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBpZiAobmV3QWN0aXZhdGVkKSB7XG4gICAgICAgICAgICAgICAgJGFuaW1hdGUuYWRkQ2xhc3MobmV3QWN0aXZhdGVkLmVsZW1lbnQsIGNsYXp6KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBkYXRhLmxhc3RBY3RpdmF0ZWQgPSBuZXdBY3RpdmF0ZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfTtcbiAgICAgICAgICBleHBUb0RhdGFbZXhwXSA9IGRhdGEgPSB7XG4gICAgICAgICAgICBsYXN0QWN0aXZhdGVkOiBudWxsLFxuICAgICAgICAgICAgc2NvcGU6IHNjb3BlLFxuICAgICAgICAgICAgd2F0Y2hGbjogd2F0Y2hGbixcbiAgICAgICAgICAgIGNvbXBhcmVXaXRoRXhwOiBjb21wYXJlV2l0aEV4cCxcbiAgICAgICAgICAgIHdhdGNoZXI6IHNjb3BlLiR3YXRjaChjb21wYXJlV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pIHtcbiAgICAgICAgZWxlbSA9IHRoaXMuZ2V0UmF3Tm9kZShlbGVtKTtcblxuICAgICAgICB2YXIgaW5uZXJFbGVtID0gZWxlbS5xdWVyeVNlbGVjdG9yKCcudG9vbHRpcC1pbm5lciwgLnBvcG92ZXItaW5uZXInKTtcbiAgICAgICAgaWYgKCFpbm5lckVsZW0pIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgaXNUb29sdGlwID0gYW5ndWxhci5lbGVtZW50KGlubmVyRWxlbSkuaGFzQ2xhc3MoJ3Rvb2x0aXAtaW5uZXInKTtcblxuICAgICAgICB2YXIgYXJyb3dFbGVtID0gaXNUb29sdGlwID8gZWxlbS5xdWVyeVNlbGVjdG9yKCcudG9vbHRpcC1hcnJvdycpIDogZWxlbS5xdWVyeVNlbGVjdG9yKCcuYXJyb3cnKTtcbiAgICAgICAgaWYgKCFhcnJvd0VsZW0pIHtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgYXJyb3dDc3MgPSB7XG4gICAgICAgICAgdG9wOiAnJyxcbiAgICAgICAgICBib3R0b206ICcnLFxuICAgICAgICAgIGxlZnQ6ICcnLFxuICAgICAgICAgIHJpZ2h0OiAnJ1xuICAgICAgICB9O1xuXG4gICAgICAgIHBsYWNlbWVudCA9IHRoaXMucGFyc2VQbGFjZW1lbnQocGxhY2VtZW50KTtcbiAgICAgICAgaWYgKHBsYWNlbWVudFsxXSA9PT0gJ2NlbnRlcicpIHtcbiAgICAgICAgICAvLyBubyBhZGp1c3RtZW50IG5lY2Vzc2FyeSAtIGp1c3QgcmVzZXQgc3R5bGVzXG4gICAgICAgICAgYW5ndWxhci5lbGVtZW50KGFycm93RWxlbSkuY3NzKGFycm93Q3NzKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgYm9yZGVyUHJvcCA9ICdib3JkZXItJyArIHBsYWNlbWVudFswXSArICct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lzKG1hcCkubWFwKGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGtleToga2V5LFxuICAgICAgICAgICAgICAgIHZhbHVlOiBtYXBba2V5XVxuICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBnZXQ6IGZ1bmN0aW9uKGtleSkge1xuICAgICAgICAgICAgcmV0dXJuIG1hcFtrZXldO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgaGFzS2V5OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiAhIW1hcFtrZXldO1xuICAgICAgICAgIH0sXG4gICAgICAgICAga2V5czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMobWFwKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHB1dDogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKCFtYXBba2V5XSkge1xuICAgICAgICAgICAgICBtYXBba2V5XSA9IFtdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBtYXBba2V5XS5wdXNoKHZhbHVlKTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgdmFyIHZhbHVlcyA9IG1hcFtrZXldO1xuXG4gICAgICAgICAgICBpZiAoIXZhbHVlcykge1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpZHggPSB2YWx1ZXMuaW5kZXhPZih2YWx1ZSk7XG5cbiAgICAgICAgICAgIGlmIChpZHggIT09IC0xKSB7XG4gICAgICAgICAgICAgIHZhbHVlcy5zcGxpY2UoaWR4LCAxKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF2YWx1ZXMubGVuZ3RoKSB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xuICAgICAgfSwge30pO1xuICAgICAgaWYgKG9wZW5Ecm9wZG93bikge1xuICAgICAgICByZXR1cm4gb3BlbmVkRHJvcGRvd25zLmxlbmd0aCA9PT0gMTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gZmFsc2U7XG4gIH07XG5cbiAgdGhpcy5vcGVuID0gZnVuY3Rpb24oZHJvcGRvd25TY29wZSwgZWxlbWVudCwgYXBwZW5kVG8pIHtcbiAgICBpZiAoIW9wZW5TY29wZSkge1xuICAgICAgJGRvY3VtZW50Lm9uKCdjbGljaycsIGNsb3NlRHJvcGRvd24pO1xuICAgIH1cblxuICAgIGlmIChvcGVuU2NvcGUgJiYgb3BlblNjb3BlICE9PSBkcm9wZG93blNjb3BlKSB7XG4gICAgICBvcGVuU2NvcGUuaXNPcGVuID0gZmFsc2U7XG4gICAgfVxuXG4gICAgb3BlblNjb3BlID0gZHJvcGRvd25TY29wZTtcblxuICAgIGlmICghYXBwZW5kVG8pIHtcbiAgICAgIHJldHVybjtcbiAgICB9XG5cbiAgICB2YXIgb3BlbmVkRHJvcGRvd25zID0gb3BlbmVkQ29udGFpbmVycy5nZXQoYXBwZW5kVG8pO1xuICAgIGlmIChvcGVuZWREcm9wZG93bnMpIHtcbiAgICAgIHZhciBvcGVuZWRTY29wZXMgPSBvcGVuZWREcm9wZG93bnMubWFwKGZ1bmN0aW9uKGRyb3Bkb3duKSB7XG4gICAgICAgIHJldHVybiBkcm9wZG93bi5zY29wZTtcbiAgICAgIH0pO1xuICAgICAgaWYgKG9wZW5lZFNjb3Blcy5pbmRleE9mKGRyb3Bkb3duU2NvcGUpID09PSAtMSkge1xuICAgICAgICBvcGVuZWRDb250YWluZXJzLnB1dChhcHBlbmRUbywge1xuICAgICAgICAgIHNjb3BlOiBkcm9wZG93blNjb3BlXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBvcGVuZWRDb250YWluZXJzLnB1dChhcHBlbmRUbywge1x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yoqXG4gKiBBIGhlbHBlciwgaW50ZXJuYWwgZGF0YSBzdHJ1Y3R1cmUgdGhhdCBhY3RzIGFzIGEgbWFwIGJ1dCBhbHNvIGFsbG93cyBnZXR0aW5nIC8gcmVtb3ZpbmdcbiAqIGVsZW1lbnRzIGluIHRoZSBMSUZPIG9yZGVyXG4gKi9cbiAgLmZhY3RvcnkoJyQkc3RhY2tlZE1hcCcsIGZ1bmN0aW9uKCkge1xuICAgIHJldHVybiB7XG4gICAgICBjcmVhdGVOZXc6IGZ1bmN0aW9uKCkge1xuICAgICAgICB2YXIgc3RhY2sgPSBbXTtcblxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIGFkZDogZnVuY3Rpb24oa2V5LCB2YWx1ZSkge1xuICAgICAgICAgICAgc3RhY2sucHVzaCh7XG4gICAgICAgICAgICAgIGtleToga2V5LFxuICAgICAgICAgICAgICB2YWx1ZTogdmFsdWVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgaWYgKGtleSA9PT0gc3RhY2tbaV0ua2V5KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHN0YWNrW2ldO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSxcbiAgICAgICAgICBrZXlzOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBrZXlzID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgIGtleXMucHVzaChzdGFja1tpXS5rZXkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGtleXM7XG4gICAgICAgICAgfSxcbiAgICAgICAgICB0b3A6IGZ1bmN0aW9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AgICAgICAgICAgcHJvbWlzZXMucHVzaCgkcS5yZXNvbHZlKHZhbHVlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICByZXR1cm4gJHEuYWxsKHByb21pc2VzKS50aGVuKGZ1bmN0aW9uKHJlc29sdmVzKSB7XG4gICAgICAgICAgICB2YXIgcmVzb2x2ZU9iaiA9IHt9O1xuICAgICAgICAgICAgdmFyIHJlc29sdmVJdGVyID0gMDtcbiAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChpbnZvY2FibGVzLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7XG4gICAgICAgICAgICAgIHJlc29sdmVPYmpba2V5XSA9IHJlc29sdmVzW3Jlc29sdmVJdGVyKytdO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiByZXNvbHZlT2JqO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1dO1xuICB9KVxuXG4vKipcbiAqIEEgaGVscGVyIGRpcmVjdGl2ZSBmb3IgdGhlICRtb2RhbCBzZXJ2aWNlLiBJdCBjcmVhdGVzIGEgYmFja2Ryb3AgZWxlbWVudC5cbiAqL1xuICAuZGlyZWN0aXZlKCd1aWJNb2RhbEJhY2tkcm9wJywgWyckYW5pbWF0ZScsICckaW5qZWN0b3InLCAnJHVpYk1vZGFsU3RhY2snLFxuICBmdW5jdGlvbigkYW5pbWF0ZSwgJGluamVjdG9yLCAkbW9kYWxTdGFjaykge1xuICAgIHJldHVybiB7XG4gICAgICByZXN0cmljdDogJ0EnLFxuICAgICAgY29tcGlsZTogZnVuY3Rpb24odEVsZW1lbnQsIHRBdHRycykge1xuICAgICAgICB0RWxlbWVudC5hZGRDbGFzcyh0QXR0cnMuYmFja2Ryb3BDbGFzcyk7XG4gICAgICAgIHJldHVybiBsaW5rRm47XG4gICAgICB9XG4gICAgfTtcblxuICAgIGZ1bmN0aW9uIGxpbmtGbihzY29wZS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bnQsIHtcbiAgICAgICAgICAgICAgICByZW1vdmVDbGFzczogYXR0cnMubW9kYWxJbkNsYXNzXG4gICAgICAgICAgICAgIH0pLnN0YXJ0KCkudGhlbihkb25lKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cblxuXG4gICAgICAgICAgJHEud2hlbihhbmltYXRpb25Qcm9taXNlKS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgLy8gTm90aWZ5IHtAbGluayAkbW9kYWxTdGFja30gdGhhdCBtb2RhbCBpcyByZW5kZXJlZC5cbiAgICAgICAgICAgIHZhciBtb2RhbCA9ICRtb2RhbFN0YWNrLmdldFRvcCgpO1xuICAgICAgICAgICAgaWYgKG1vZGFsKSB7XG4gICAgICAgICAgICAgICRtb2RhbFN0YWNrLm1vZGFsUmVuZGVyZWQobW9kYWwua2V5KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBJZiBzb21ldGhpbmcgd2l0aGluIHRoZSBmcmVzaGx5LW9wZW5lZCBtb2RhbCBhbHJlYWR5IGhhcyBmb2N1cyAocGVyaGFwcyB2aWEgYVxuICAgICAgICAgICAgICogZGlyZWN0aXZlIHRoYXQgY2F1c2VzIGZvY3VzKSB0aGVuIHRoZXJlJ3Mgbm8gbmVlZCB0byB0cnkgdG8gZm9jdXMgYW55dGhpbmcuXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmICghKCRkb2N1bWVudFswXS5hY3RpdmVFbGVtZW50ICYmIGVsZW1lbnRbMF0uY29udGFpbnMoJGRvY3VtZW50WzBdLmFjdGl2ZUVsZW1lbnQpKSkge1xuICAgICAgICAgICAgICB2YXIgaW5wdXRXaXRoQXV0b2ZvY3VzID0gZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCdbYXV0b2ZvY3VzXScpO1xuICAgICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAgICogQXV0by1mb2N1c2luZyBvZiBhIGZy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gICAgICAgLy8gTm90ZSB0aGF0IGl0J3MgaW50ZW50aW9uYWwgdGhhdCBhc3luY1Byb21pc2UgbWlnaHQgYmUgbnVsbC5cbiAgICAgICAgLy8gVGhhdCdzIHdoZW4gc2V0SXNBc3luYyBoYXMgbm90IGJlZW4gY2FsbGVkIGR1cmluZyB0aGVcbiAgICAgICAgLy8gTk9XX0NMT1NJTkdfRVZFTlQgYnJvYWRjYXN0LlxuICAgICAgICByZXR1cm4gJHEud2hlbihhc3luY1Byb21pc2UpLnRoZW4oYWZ0ZXJBbmltYXRpbmcpO1xuXG4gICAgICAgIGZ1bmN0aW9uIGFmdGVyQW5pbWF0aW5nKCkge1xuICAgICAgICAgIGlmIChhZnRlckFuaW1hdGluZy5kb25lKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIGFmdGVyQW5pbWF0aW5nLmRvbmUgPSB0cnVlO1xuXG4gICAgICAgICAgJGFuaW1hdGUubGVhdmUoZG9tRWwpLnRoZW4oZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAoZG9uZSkge1xuICAgICAgICAgICAgICBkb25lKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGRvbUVsLnJlbW92ZSgpO1xuICAgICAgICAgICAgaWYgKGNsb3NlZERlZmVycmVkKSB7XG4gICAgICAgICAgICAgIGNsb3NlZERlZmVycmVkLnJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgJGRvY3VtZW50Lm9uKCdrZXlkb3duJywga2V5ZG93bkxpc3RlbmVyKTtcblxuICAgICAgJHJvb3RTY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICRkb2N1bWVudC5vZmYoJ2tleWRvd24nLCBrZXlkb3duTGlzdGVuZXIpO1xuICAgICAgfSk7XG5cbiAgICAgIGZ1bmN0aW9uIGtleWRvd25MaXN0ZW5lcihldnQpIHtcbiAgICAgICAgaWYgKGV2dC5pc0RlZmF1bHRQcmV2ZW50ZWQoKSkge1xuICAgICAgICAgIHJldHVybiBldnQ7XG4gICAgICAgIH1cblxuICAgICAgICB2YXIgbW9kYWwgPSBvcGVuZWRXaW5kb3dzLnRvcCgpO1xuICAgICAgICBpZiAobW9kYWwpIHtcbiAgICAgICAgICBzd2l0Y2ggKGV2dC53aGljaCkge1xuICAgICAgICAgICAgY2FzZSAyNzoge1xuICAgICAgICAgICAgICBpZiAobW9kYWwudmFsdWUua2V5Ym9hcmQpIHtcbiAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLmRpc21pc3MobW9kYWwua2V5LCAnZXNjYXBlIGtleSBwcmVzcycpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2FzZSA5OiB7XG4gICAgICAgICAgICAgIHZhciBsaXN0ID0gJG1vZGFsU3RhY2subG9hZEZvY3VzRWxlbWVudExpc3QobW9kYWwpO1xuICAgICAgICAgICAgICB2YXIgZm9jdXNDaGFuZ2VkID0gZmFsc2U7XG4gICAgICAgICAgICAgIGlmIChldnQuc2hpZnRLZXkpIHtcbiAgICAgICAgICAgICAgICBpZiAoJG1vZGFsU3RhY2suaXNGb2N1c0luRmlyc3RJdGVtKGV2dCwgbGlzdCkgfHwgJG1vZGFsU3RhY2suaXNNb2RhbEZvY3VzZWQoZXZ0LCBtb2RhbCkpIHtcbiAgICAgICAgICAgICAgICAgIGZvY3VzQ2hhbmdlZCA9ICRtb2RhbFN0YWNrLmZvY3VzTGFzdEZvY3VzYWJsZUVsZW1lbnQobGlzdCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmICgkbW9kYWxTdGFjay5pc0ZvY3VzSW5MYXN0SXRlbShldnQsIGxpc3QpKSB7XG4gICAgICAgICAgICAgICAgICBmb2N1c0NoYW5nZWQgPSAkbW9kYWxTdGFjay5mb2N1c0ZpcnN0Rm9jdXNhYmxlRWxlbWVudChsaXN0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoZm9jdXNDaGFuZ2VkKSB7XG4gICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgZXZ0LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgICRtb2RhbFN0YWNrLm9wZW4gPSBmdW5jdGlvbihtb2RhbEluc3RhbmNlLCBtb2RhbCkge1xuICAgICAgICB2YXIgbW9kYWxPcGVuZXIgPSAkZG9jdW1lbnRbMF0uYWN0aXZlRWxlbWVudCxcbiAgICAgICAgICBtb2RhbEJvZHlDbGFzcyA9IG1vZGFsLm9wZW5lZENsYXNzIHx8IE9QRU5FRF9NT0RBTF9DTEFTUztcblxuICAgICAgICB0b2dnbGVUb3BXaW5kb3dDbGFzcyhmYWxzZSk7XG5cbiAgICAgICAgLy8gU3RvcmUgdGhlIGN1cnJlbnQgdG9wIGZpcnN0LCB0byBkZXRlcm1pbmUgd2hhdCBpbmRleCB3ZSBvdWdodCB0byB1c2VcbiAgICAgICAgLy8gZm9yIHRoZSBjdXJyZW50IHRvcCBtb2RhbFxuICAgICAgICBwcmV2aW91c1RvcE9wZW5lZE1vZGFsID0gb3BlbmVkV2luZG93cy50b3AoKTtcblxuICAgIC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tcbiAgICAgICAgICAgIHZhciBlbGVtSXNBbHJlYWR5SGlkZGVuID0gc2libGluZy5nZXRBdHRyaWJ1dGUoJ2FyaWEtaGlkZGVuJykgPT09ICd0cnVlJyxcbiAgICAgICAgICAgICAgYXJpYUhpZGRlbkNvdW50ID0gcGFyc2VJbnQoc2libGluZy5nZXRBdHRyaWJ1dGUoQVJJQV9ISURERU5fQVRUUklCVVRFX05BTUUpLCAxMCk7XG5cbiAgICAgICAgICAgIGlmICghYXJpYUhpZGRlbkNvdW50KSB7XG4gICAgICAgICAgICAgIGFyaWFIaWRkZW5Db3VudCA9IGVsZW1Jc0FscmVhZHlIaWRkZW4gPyAxIDogMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2libGluZy5zZXRBdHRyaWJ1dGUoQVJJQV9ISURERU5fQVRUUklCVVRFX05BTUUsIGFyaWFIaWRkZW5Db3VudCArIDEpO1xuICAgICAgICAgICAgc2libGluZy5zZXRBdHRyaWJ1dGUoJ2FyaWEtaGlkZGVuJywgJ3RydWUnKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHJldHVybiBhcHBseUFyaWFIaWRkZW4oZWwucGFyZW50KCkpO1xuXG4gICAgICAgICAgZnVuY3Rpb24gZ2V0U2libGluZ3MoZWwpIHtcbiAgICAgICAgICAgIHZhciBjaGlsZHJlbiA9IGVsLnBhcmVudCgpID8gZWwucGFyZW50KCkuY2hpbGRyZW4oKSA6IFtdO1xuXG4gICAgICAgICAgICByZXR1cm4gQXJyYXkucHJvdG90eXBlLmZpbHRlci5jYWxsKGNoaWxkcmVuLCBmdW5jdGlvbihjaGlsZCkge1xuICAgICAgICAgICAgICByZXR1cm4gY2hpbGQgIT09IGVsWzBdO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9O1xuXG4gICAgICBmdW5jdGlvbiBicm9hZGNhc3RDbG9zaW5nKG1vZGFsV2luZG93LCByZXN1bHRPclJlYXNvbiw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b24gcmVzb2x2ZVN1Y2Nlc3ModHBsQW5kVmFycykge1xuICAgICAgICAgICAgICAgIHZhciBwcm92aWRlZFNjb3BlID0gbW9kYWxPcHRpb25zLnNjb3BlIHx8ICRyb290U2NvcGU7XG5cbiAgICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IHByb3ZpZGVkU2NvcGUuJG5ldygpO1xuICAgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGNsb3NlID0gbW9kYWxJbnN0YW5jZS5jbG9zZTtcbiAgICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRkaXNtaXNzID0gbW9kYWxJbnN0YW5jZS5kaXNtaXNzO1xuXG4gICAgICAgICAgICAgICAgbW9kYWxTY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICBpZiAoIW1vZGFsU2NvcGUuJCR1aWJEZXN0cnVjdGlvblNjaGVkdWxlZCkge1xuICAgICAgICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRkaXNtaXNzKCckdWliVW5zY2hlZHVsZWREZXN0cnVjdGlvbicpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdmFyIG1vZGFsID0ge1xuICAgICAgICAgICAgICAgICAgc2NvcGU6IG1vZGFsU2NvcGUsXG4gICAgICAgICAgICAgICAgICBkZWZlcnJlZDogbW9kYWxSZXN1bHREZWZlcnJlZCxcbiAgICAgICAgICAgICAgICAgIHJlbmRlckRlZmVycmVkOiBtb2RhbFJlbmRlckRlZmVycmVkLFxuICAgICAgICAgICAgICAgICAgY2xvc2VkRGVmZXJyZWQ6IG1vZGFsQ2xvc2VkRGVmZXJyZWQsXG4gICAgICAgICAgICAgICAgICBhbmltYXRpb246IG1vZGFsT3B0aW9ucy5hbmltYXRpb24sXG4gICAgICAgICAgICAgICAgICBiYWNrZHJvcDogbW9kYWxPcHRpb25zLmJhY2tkcm9wLFxuICAgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsT3B0aW9ucy5rZXlib2FyZCxcbiAgICAgICAgICAgICAgICAgIGJhY2tkcm9wQ2xhc3M6IG1vZGFsT3B0aW9ucy5iYWNrZHJvcENsYXNzLFxuICAgICAgICAgICAgICAgICAgd2luZG93VG9wQ2xhc3M6IG1vZGFsT3B0aW9ucy53aW5kb3dUb3BDbGFzcyxcbiAgICAgICAgICAgICAgICAgIHdpbmRvd0NsYXNzOiBtb2RhbE9wdGlvbnMud2luZG93Q2xhc3MsXG4gICAgICAgICAgICAgICAgICB3aW5kb3dUZW1wbGF0ZVVybDogbW9kYWxPcHRpb25zLndpbmRvd1RlbXBsYXRlVXJsLFxuICAgICAgICAgICAgICAgICAgYXJpYUxhYmVsbGVkQnk6IG1vZGFsT3B0aW9ucy5hcmlhTGFiZWxsZWRCeSxcbiAgICAgICAgICAgICAgICAgIGFyaWFEZXNjcmliZWRCeTogbW9kYWxPcHRpb25zLmFyaWFEZXNjcmliZWRCeSxcbiAgICAgICAgICAgICAgICAgIHNpemU6IG1vZGFsT3B0aW9ucy5zaXplLFxuICAgICAgICAgICAgICAgICAgb3BlbmVkQ2xhc3M6IG1vZGFsT3B0aW9ucy5vcGVuZWRDbGFzcyxcbiAgICAgICAgICAgICAgICAgIGFwcGVuZFRvOiBtb2RhbE9wdGlvbnMuYXBwZW5kVG9cbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdmFyIGNvbXBvbmVudCA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBjdHJsSW5zdGFuY2UsIGN0cmxJbnN0YW50aWF0ZSwgY3RybExvY2FscyA9IHt9O1xuXG4gICAgICAgICAgICAgICAgaWYgKG1vZGFsT3B0aW9ucy5jb21wb25lbnQpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnN0cnVjdExvY2Fscyhjb21wb25lbnQsIGZhbHNlLCB0cnVlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICBjb21wb25lbnQubmFtZSA9IG1vZGFsT3B0aW9ucy5jb21wb25lbnQ7XG4gICAgICAgICAgICAgICAgICBtb2RhbC5jb21wb25lbnQgPSBjb21wb25lbnQ7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtb2RhbE9wdGlvbnMuY29udHJvbGxlcikge1xuICAgICAgICAgICAgICAgICAgY29uc3RydWN0TG9jYWxzKGN0cmxMb2NhbHMsIHRydWUsIGZhbHNlLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgICAgLy8gdGhlIHRoaXJkIHBhcmFtIHdpbGwgbWFrZSB0aGUgY29udHJvbGxlciBpbnN0YW50aWF0ZSBsYXRlcixwcml2YXRlIGFwaVxuICAgICAgICAgICAgICAgICAgLy8gQHNlZSBodHRwczovL2dpdGh1Yi5jb20vYW5ndWxhci9hbmd1bGFyLmpzL2Jsb2IvbWFzdGVyL3NyYy9uZy9jb250cm9sbGVyLmpzI0wxMjZcbiAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW50aWF0ZSA9ICRjb250cm9sbGVyKG1vZGFsT3B0aW9ucy5jb250cm9sbGVyLCBjdHJsTG9jYWxzLCB0cnVlLCBtb2RhbE9wdGlvbnMuY29udHJvbGxlckFzKTtcbiAgICAgICAgICAgICAgICAgIGlmIChtb2RhbE9wdGlvbnMuY29udHJvbGxlckFzICYmIG1vZGFsT3B0aW9ucy5iaW5kVG9Db250cm9sbGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW5jZSA9IGN0cmxJbnN0YW50aWF0ZS5pbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgICAgY3RybEluc3RhbmNlLiRjbG9zZSA9IG1vZGFsU2NvcGUuJGNsb3NlO1xuICAgICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UuJGRpc21pc3MgPSBtb2RhbFNjb3BlLiRkaXNtaXNzO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChjdHJsSW5zdGFuY2UsIHtcbiAgICAgICAgICAgICAgICAgICAgICAkcmVzb2x2ZTogY3RybExvY2Fscy4kc2NvcGUuJHJlc29sdmVcbiAgICAgICAgICAgICAgICAgICAgfSwgcHJvdmlkZWRTY29wZSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGN0cmxJbnN0YW5jZSA9IGN0cmxJbnN0YW50aWF0ZSgpO1xuXG4gICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKGN0cmxJbnN0YW5jZS4kb25Jbml0KSkge1xuICAgICAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UuJG9uSW5pdCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmICghbW9kYWxPcHRpb25zLmNvbXBvbmVudCkge1xuICAgICAgICAgICAgICAgICAgbW9kYWwuY29udGVudCA9IHRwbEFuZFZhcnNbMF07XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgJG1vZGFsU3RhY2sub3Blbihtb2RhbEluc3RhbmNlLCBtb2RhbCk7XG4gICAgICAgICAgICAgICAgbW9kYWxPcGVuZWREZWZlcnJlZC5yZXNvbHZlKHRydWUpO1xuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gY29uc3RydWN0TG9jYWxzKG9iaiwgdGVtcGxhdGUsIGluc3RhbmNlT25TY29wZSwgaW5qZWN0YWJsZSkge1xuICAgICAgICAgICAgICAgICAgb2JqLiRzY29wZSA9IG1vZGFsU2NvcGU7XG4gICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiRyZXNvbHZlID0ge307XG4gICAgICAgICAgICAgICAgICBpZiAoaW5zdGFuY2VPblNjb3BlKSB7XG4gICAgICAgICAgICAgICAgICAgIG9iai4kc2NvcGUuJHVpYk1vZGFsSW5zdGFuY2UgPSBtb2RhbEluc3RhbmNlO1xuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgb2JqLiR1aWJNb2RhbEluc3RhbmNlID0gbW9kYWxJbnN0YW5jZTtcbiAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgdmFyIHJlc29sdmVzID0gdGVtcGxhdGUgPyB0cGxBbmRWYXJzWzFdIDogdHBsQW5kVmFycztcbiAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChyZXNvbHZlcywgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW5qZWN0YWJsZSkge1xuICAgICAgICAgICAgICAgICAgICAgIG9ialtrZXldID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBvYmouJHNjb3BlLiRyZXNvbHZlW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIGZ1bmN0aW9uIHJlc29sdmVFcnJvcihyZWFzb24pIHtcbiAgICAgICAgICAgICAgbW9kYWxPcGVuZWREZWZlcnJlZC5yZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgICAgbW9kYWxSZXN1bHREZWZlcnJlZC5yZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgIH0pWydmaW5hbGx5J10oZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGlmIChwcm9taXNlQ2hhaW4gPT09IHNhbWVQcm9taXNlKSB7XG4gICAgICAgICAgICAgICAgcHJvbWlzZUNoYWluID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBtb2RhbEluc3RhbmNlO1xuICAgICAgICAgIH07XG5cbiAgICAgICAgICByZXR1cm4gJG1vZGFsO1xuICAgICAgICB9XG4gICAgICBdXG4gICAgfTtcblxuICAgIHJldHVybiAkbW9kYWxQcm92aWRlcj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iB0cmlnZ2VyTWFwW3RyaWdnZXJdIHx8IHRyaWdnZXI7XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIHNob3c6IHNob3csXG4gICAgICAgICAgaGlkZTogaGlkZVxuICAgICAgICB9O1xuICAgICAgfVxuXG4gICAgICB2YXIgZGlyZWN0aXZlTmFtZSA9IHNuYWtlX2Nhc2UodHRUeXBlKTtcblxuICAgICAgdmFyIHN0YXJ0U3ltID0gJGludGVycG9sYXRlLnN0YXJ0U3ltYm9sKCk7XG4gICAgICB2YXIgZW5kU3ltID0gJGludGVycG9sYXRlLmVuZFN5bWJvbCgpO1xuICAgICAgdmFyIHRlbXBsYXRlID1cbiAgICAgICAgJzxkaXYgJysgZGlyZWN0aXZlTmFtZSArICctcG9wdXAgJyArXG4gICAgICAgICAgJ3VpYi10aXRsZT1cIicgKyBzdGFydFN5bSArICd0aXRsZScgKyBlbmRTeW0gKyAnXCIgJyArXG4gICAgICAgICAgKG9wdGlvbnMudXNlQ29udGVudEV4cCA/XG4gICAgICAgICAgICAnY29udGVudC1leHA9XCJjb250ZW50RXhwKClcIiAnIDpcbiAgICAgICAgICAgICdjb250ZW50PVwiJyArIHN0YXJ0U3ltICsgJ2NvbnRlbnQnICsgZW5kU3ltICsgJ1wiICcpICtcbiAgICAgICAgICAnb3JpZ2luLXNjb3BlPVwib3JpZ1Njb3BlXCIgJyArXG4gICAgICAgICAgJ2NsYXNzPVwidWliLXBvc2l0aW9uLW1lYXN1cmUgJyArIHByZWZpeCArICdcIiAnICtcbiAgICAgICAgICAndG9vbHRpcC1hbmltYXRpb24tY2xhc3M9XCJmYWRlXCInICtcbiAgICAgICAgICAndWliLXRvb2x0aXAtY2xhc3NlcyAnICtcbiAgICAgICAgICAnbmctY2xhc3M9XCJ7IGluOiBpc09wZW4gfVwiICcgK1xuICAgICAgICAgICc+JyArXG4gICAgICAgICc8L2Rpdj4nO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICBjb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IGxlZnQ6IHR0UG9zaXRpb24ubGVmdCArICdweCcgfSk7XG4gICAgICAgICAgICAgICAgICB2YXIgcGxhY2VtZW50Q2xhc3NlcyA9IHR0UG9zaXRpb24ucGxhY2VtZW50LnNwbGl0KCctJyk7XG5cbiAgICAgICAgICAgICAgICAgIGlmICghdG9vbHRpcC5oYXNDbGFzcyhwbGFjZW1lbnRDbGFzc2VzWzBdKSkge1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZUNsYXNzKGxhc3RQbGFjZW1lbnQuc3BsaXQoJy0nKVswXSk7XG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXAuYWRkQ2xhc3MocGxhY2VtZW50Q2xhc3Nlc1swXSk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGlmICghdG9vbHRpcC5oYXNDbGFzcyhvcHRpb25zLnBsYWNlbWVudENsYXNzUHJlZml4ICsgdHRQb3NpdGlvbi5wbGFjZW1lbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXAucmVtb3ZlQ2xhc3Mob3B0aW9ucy5wbGFjZW1lbnRDbGFzc1ByZWZpeCArIGxhc3RQbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmFkZENsYXNzKG9wdGlvbnMucGxhY2VtZW50Q2xhc3NQcmVmaXggKyB0dFBvc2l0aW9uLnBsYWNlbWVudCk7XG4gICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgIGFkanVzdG1lbnRUaW1lb3V0ID0gJHRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50SGVpZ2h0ID0gYW5ndWxhci5pc0RlZmluZWQodG9vbHRpcC5vZmZzZXRIZWlnaHQpID8gdG9vbHRpcC5vZmZzZXRIZWlnaHQgOiB0b29sdGlwLnByb3AoJ29mZnNldEhlaWdodCcpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYWRqdXN0bWVudCA9ICRwb3NpdGlvbi5hZGp1c3RUb3AocGxhY2VtZW50Q2xhc3NlcywgZWxlbWVudFBvcywgaW5pdGlhbEhlaWdodCwgY3VycmVudEhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhZGp1c3RtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5jc3MoYWRqdXN0bWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWRqdXN0bWVudFRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgfSwgMCwgZmFsc2UpO1xuXG4gICAgICAgICAgICAgICAgICAvLyBmaXJzdCB0aW1lIHRocm91Z2ggdHQgZWxlbWVudCB3aWxsIGhhdmUgdGhlXG4gICAgICAgICAgICAgICAgICAvLyB1aWItcG9zaXRpb24tbWVhc3VyZSBjbGFzcyBvciBpZiB0aGUgcGxhY2VtZW50XG4gICAgICAgICAgICAgICAgICAvLyBoYXMgY2hhbmdlZCB3ZSBuZWVkIHRvIHBvc2l0aW9uIHRoZSBhcnJvdy5cbiAgICAgICAgICAgICAgICAgIGlmICh0b29sdGlwLmhhc0NsYXNzKCd1aWItcG9zaXRpb24tbWVhc3VyZScpKSB7XG4gICAgICAgICAgICAgICAgICAgICRwb3NpdGlvbi5wb3NpdGlvbkFycm93KHRvb2x0aXAsIHR0UG9zaXRpb24ucGxhY2VtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmVDbGFzcygndWliLXBvc2l0aW9uLW1lYXN1cmUnKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobGFzdFBsYWNlbWVudCAhPT0gdHRQb3NpdGlvbi5wbGFjZW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgJHBvc2l0aW9uLnBvc2l0aW9uQXJyb3codG9vbHRpcCwgdHRQb3NpdGlvbi5wbGFjZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgbGFzdFBsYWNlbWVudCA9IHR0UG9zaXRpb24ucGxhY2VtZW50O1xuXG4gICAgICAgICAgICAgICAgICBwb3NpdGlvblRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICAgIH0sIDAsIGZhbHNlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgLy8gU2V0IHVwIHRoZSBjb3JyZWN0IHNjb3BlIHRvIGFsbG93IHRyYW5zY2x1c2lvbiBsYXRlclxuICAgICAgICAgICAgdHRTY29wZS5vcmlnU2NvcGUgPSBzY29wZTtcblxuICAgICAgICAgICAgLy8gQnkgZGVmYXVsdCwgdGhlIHRvb2x0aXAgaXMgbm90IG9wZW4uXG4gICAgICAgICAgICAvLyBUT0RPIGFkZCBhYmlsaXR5IHRvIHN0YXJ0IHRvb2x0aXAgb3BlbmVkXG4gICAgICAgICAgICB0dFNjb3BlLmlzT3BlbiA9IGZhbHNlO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVUb29sdGlwQmluZCgpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlLmlzT3Blbikge1xuICAgICAgICAgICAgICAgIHNob3dUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGhpZGVUb29sdGlwQmluZCgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgd2l0aCBkZWxheSBpZiBzcGVjaWZpZWQsIG90aGVyd2lzZSBzaG93IGl0IGltbWVkaWF0ZWx5XG4gICAgICAgICAgICBmdW5jdGlvbiBzaG93VG9vbHRpcEJpbmQoKSB7XG4gICAgICAgICAgICAgIGlmIChoYXNFbmFibGVFeHAgJiYgIXNjb3BlLiRldmFsKGF0dHJzW3ByZWZpeCArICdFbmFibGUnXSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBjYW5jZWxIaWRlKCk7XG4gICAgICAgICAgICAgIHByZXBhcmVUb29sdGlwKCk7XG5cbiAgICAgICAgICAgICAgaWYgKHR0U2NvcGUucG9wdXBEZWxheSkge1xuICAgICAgICAgICAgICAgIC8vIERvIG5vdGhpbmcgaWYgdGhlIHRvb2x0aXAgd2FzIGFscmVhZHkgc2NoZWR1bGVkIHRvIHBvcC11cC5cbiAgICAgICAgICAgICAgICAvLyBUaGlzIGhhcHBlbnMgaWYgc2hvdyBpcyB0cmlnZ2VyZWQgbXVsdGlwbGUgdGltZXMgYmVmb3JlIGFueSBoaWRlIGlzIHRyaWdnZXJlZC5cbiAgICAgICAgICAgICAgICBpZiAoIXNob3dUaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgICBzaG93VGltZW91dCA9ICR0aW1lb3V0KHNob3csIHR0U2NvcGUucG9wdXBEZWxheSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaG93KCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZVRvb2x0aXBCaW5kKCkge1xuICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG5cbiAgICAgICAgICAgICAgaWYgKHR0U2NvcGUucG9wdXBDbG9zZURlbGF5KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFoaWRlVGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgaGlkZVRpbWVvdXQgPSAkdGltZW91dChoaWRlLCB0dFNjb3BlLnBvcHVwQ2xvc2VEZWxheSwgZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoaWRlKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gU2hvdyB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LlxuICAgICAgICAgICAgZnVuY3Rpb24gc2hvdygpIHtcbiAgICAgICAgICAgICAgY2FuY2VsU2hvdygpO1xuICAgICAgICAgICAgICBjYW5jZWxIaWRlKCk7XG5cbiAgICAgICAgICAgICAgLy8gRG9uJ3Qgc2hvdyBlbXB0eSB0b29sdGlwcy5cbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlLmNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gYW5ndWxhci5ub29wO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgY3JlYXRlVG9vbHRpcCgpO1xuXG4gICAgICAgICAgICAgIC8vIEFuZCBzaG93IHRoZSB0b29sdGlwLlxuICAgICAgICAgICAgICB0dFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSB0cnVlO1xuICAgICAgICAgICAgICAgIGFzc2lnbklzT3Blbih0cnVlKTtcbiAgICAgICAgICAgICAgICBwb3NpdGlvblRvb2x0aXAoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhbmNlbFNob3coKSB7XG4gICAgICAgICAgICAgIGlmIChzaG93VGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChzaG93VGltZW91dCk7XG4gICAgICAgICAgICAgICAgc2hvd1RpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHBvc2l0aW9uVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChwb3NpdGlvblRpbWVvdXQpO1xuICAgICAgICAgICAgICAgIHBvc2l0aW9uVGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gSGlkZSB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LlxuICAgICAgICAgICAgZnVuY3Rpb24gaGlkZSgpIHtcbiAgICAgICAgICAgICAgaWYgKCF0dFNjb3BlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gRmlyc3QgdGhpbmdzIGZpcnN0OiB3ZSBkb24ndCBzaG93IGl0IGFueW1vcmUuXG4gICAgICAgICAgICAgIHR0U2NvcGUuJGV2YWxBc3luYyhmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBpZiAodHRTY29wZSkge1xuICAgICAgICAgICAgICAgICAgdHRTY29wZS5pc09wZW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgIGFzc2lnbklzT3BlbihmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAvLyBBbmQgbm93IHdlIHJlbW92ZSBpdCBmcm9tIHRoZSBET00uIEhvd2V2ZXIsIGlmIHdlIGhhdmUgYW5pbWF0aW9uLCB3ZVxuICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byB3YWl0IGZvciBpdCB0byBleHBpcmUgYmVmb3JlaGFuZC5cbiAgICAgICAgICAgICAgICAgIC8vIEZJWE1FOiB0aGlzIGlzIGEgcGxhY2Vob2xkZXIgZm9yIGEgcG9ydCBvZiB0aGUgdHJhbnNpdGlvbnMgbGlicmFyeS5cbiAgICAgICAgICAgICAgICAgIC8vIFRoZSBmYWRlIHRyYW5zaXRpb24gaW4gVFdCUyBpcyAxNTBtcy5cbiAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlLmFuaW1hdGlvbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXRyYW5zaXRpb25UaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSAkdGltZW91dChyZW1vdmVUb29sdGlwLCAxNTAsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNhbmNlbEhpZGUoKSB7XG4gICAgICAgICAgICAgIGlmIChoaWRlVGltZW91dCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChoaWRlVGltZW91dCk7XG4gICAgICAgICAgICAgICAgaGlkZVRpbWVvdXQgPSBudWxsO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb25UaW1lb3V0KSB7XG4gICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRyYW5zaXRpb25UaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uVGltZW91dCA9IG51bGw7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlVG9vbHRpcCgpIHtcbiAgICAgICAgICAgICAgLy8gVGhlcmUgY2FuIG9ubHkgYmUgb25lIHRvb2x0aXAgZWxlbWVudCBwZXIgZGlyZWN0aXZlIHNob3duIGF0IG9uY2UuXG4gICAgICAgICAgICAgIGlmICh0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlID0gdHRTY29wZS4kbmV3KCk7XG4gICAgICAgICAgICAgIHRvb2x0aXAgPSB0b29sdGlwTGlua2VyKHRvb2x0aXBMaW5rZWRTY29wZSwgZnVuY3Rpb24odG9vbHRpcCkge1xuICAgICAgICAgICAgICAgIGlmIChhcHBlbmRUb0JvZHkpIHtcbiAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5maW5kKCdib2R5JykuYXBwZW5kKHRvb2x0aXApO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKHRvb2x0aXApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgb3BlbmVkVG9vbHRpcHMuYWRkKHR0U2NvcGUsIHtcbiAgICAgICAgICAgICAgICBjbG9zZTogaGlkZVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBwcmVwT2JzZXJ2ZXJzKCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIGNhbmNlbFNob3coKTtcbiAgICAgICAgICAgICAgY2FuY2VsSGlkZSgpO1xuICAgICAgICAgICAgICB1bnJlZ2lzdGVyT2JzZXJ2ZXJzKCk7XG5cbiAgICAgICAgICAgICAgaWYgKHRvb2x0aXApIHtcbiAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZSgpO1xuICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgIHRvb2x0aXAgPSBudWxsO1xuICAgICAgICAgICAgICAgIGlmIChhZGp1c3RtZW50VGltZW91dCkge1xuICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKGFkanVzdG1lbnRUaW1lb3V0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBvcGVuZWRUb29sdGlwcy5yZW1vdmUodHRTY29wZSk7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICBpZiAodG9vbHRpcExpbmtlZFNjb3BlKSB7XG4gICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlID0gbnVsbDtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFNldCB0aGUgaW5pdGlhbCBzY29wZSB2YWx1ZXMuIE9uY2VcbiAgICAgICAgICAgICAqIHRoZSB0b29sdGlwIGlzIGNyZWF0ZWQsIHRoZSBvYnNlcnZlcnNcbiAgICAgICAgICAgICAqIHdpbGwgYmUgYWRkZWQgdG8ga2VlcCB0aGluZ3MgaW4gc3luYy5cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcGFyZVRvb2x0aXAoKSB7XG4gICAgICAgICAgICAgIHR0U2NvcGUudGl0bGUgPSBhdHRyc1twcmVmaXggKyAnVGl0bGUnXTtcbiAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQYXJzZSkge1xuICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IGNvbnRlbnRQYXJzZShzY29wZSk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdHRTY29wZS5jb250ZW50ID0gYXR0cnNbdHRUeXBlXTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIHR0U2NvcGUucG9wdXBDbGFzcyA9IGF0dHJzW3ByZWZpeCArICdDbGFzcyddO1xuICAgICAgICAgICAgICB0dFNjb3BlLnBsYWNlbWVudCA9IGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHJzW3ByZWZpeCArICdQbGFjZW1lbnQnXSkgPyBhdHRyc1twcmVmaXggKyAnUGxhY2VtZW50J10gOiBvcHRpb25zLnBsYWNlbWVudDtcbiAgICAgICAgICAgICAgdmFyIHBsYWNlbWVudCA9ICRwb3NpdGlvbi5wYXJzZVBsYWNlbWVudCh0dFNjb3BlLnBsYWNlbWVudCk7XG4gICAgICAgICAgICAgIGxhc3RQbGFjZW1lbnQgPSBw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GVkJywgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgIGlmICh2YWwpIHtcbiAgICAgICAgICAgICAgICBjYW5jZWxTaG93KCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAodmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgaWYgKGlzT3BlblBhcnNlKSB7XG4gICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChpc09wZW5QYXJzZSwgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUgJiYgIXZhbCA9PT0gdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgIHRvZ2dsZVRvb2x0aXBCaW5kKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcE9ic2VydmVycygpIHtcbiAgICAgICAgICAgICAgb2JzZXJ2ZXJzLmxlbmd0aCA9IDA7XG5cbiAgICAgICAgICAgICAgaWYgKGNvbnRlbnRQYXJzZSkge1xuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGNvbnRlbnRQYXJzZSwgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICAgIHR0U2NvcGUuY29udGVudCA9IHZhbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWwgJiYgdHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgIG9ic2VydmVycy5wdXNoKFxuICAgICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFyZXBvc2l0aW9uU2NoZWR1bGVkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgcmVwb3NpdGlvblNjaGVkdWxlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcExpbmtlZFNjb3BlLiQkcG9zdERpZ2VzdChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcG9zaXRpb25TY2hlZHVsZWQgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0dFNjb3BlICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXJzLnB1c2goXG4gICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSh0dFR5cGUsIGZ1bmN0aW9uKHZhbCkge1xuICAgICAgICAgICAgICAgICAgICB0dFNjb3BlLmNvbnRlbnQgPSB2YWw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdmFsICYmIHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnVGl0bGUnLCBmdW5jdGlvbih2YWwpIHtcbiAgICAgICAgICAgICAgICAgIHR0U2NvcGUudGl0bGUgPSB2YWw7XG4gICAgICAgICAgICAgICAgICBpZiAodHRTY29wZS5pc09wZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25Ub29sdGlwKCk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICBvYnNlcnZlcnMucHVzaChcbiAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnUGxhY2VtZW50JywgZnVuY3Rpb24odmFsKSB7XG4gICAgICAgICAgICAgICAgICB0dFNjb3BlLnBsYWNlbWVudCA9IHZhbCA/IHZhbCA6IG9wdGlvbnMucGxhY2VtZW50O1xuICAgICAgICAgICAgICAgICAgaWYgKHR0U2NvcGUuaXNPcGVuKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uVG9vbHRpcCgpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHVucmVnaXN0ZXJPYnNlcnZlcnMoKSB7XG4gICAgICAgICAgICAgIGlmIChvYnNlcnZlcnMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKG9ic2VydmVycywgZnVuY3Rpb24ob2JzZXJ2ZXIpIHtcbiAgICAgICAgICAgICAgICAgIG9ic2VydmVyKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXJzLmxlbmd0aCA9IDA7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gaGlkZSB0b29sdGlwcy9wb3BvdmVycyBmb3Igb3V0c2lkZUNsaWNrIHRyaWdnZXJcbiAgICAgICAgICAgIGZ1bmN0aW9uIGJvZHlIaWRlVG9vbHRpcEJpbmQoZSkge1xuICAgICAgICAgICAgICBpZiAoIXR0U2NvcGUgfHwgIXR0U2NvcGUuaXNPcGVuIHx8ICF0b29sdGlwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB0aGUgdG9vbHRpcC9wb3BvdmVyIGxpbmsgb3IgdG9vbCB0b29sdGlwL3BvcG92ZXIgaXRzZWxmIHdlcmUgbm90IGNsaWNrZWRcbiAgICAgICAgICAgICAgaWYgKCFlbGVtZW50WzBdLmNvbnRhaW5zKGUudGFyZ2V0KSAmJiAhdG9vbHRpcFswXS5jb250YWlucyhlLnRhcmdldCkpIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBLZXlib2FyZEV2ZW50IGhhbmRsZXIgdG8gaGlkZSB0aGUgdG9vbHRpcCBvbiBFc2NhcGUga2V5IHByZXNzXG4gICAgICAgICAgICBmdW5jdGlvbiBoaWRlT25Fc2NhcGVLZXkoZSkge1xuICAgICAgICAgICAgICBpZiAoZS53aGljaCA9PT0gMjcpIHtcbiAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgdW5yZWdpc3RlclRyaWdnZXJzID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHRyaWdnZXJzLnNob3cuZm9yRWFjaChmdW5jdGlvbih0cmlnZ2VyKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRyaWdnZXIgPT09ICdvdXRzaWRlQ2xpY2snKSB7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZignY2xpY2snLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKHRyaWdnZXIsIHNob3dUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICBlbGVtZW50Lm9mZih0cmlnZ2VyLCB0b2dnbGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsZW1lbnQub2ZmKCdrZXlwcmVzcycsIGhpZGVPbkVzY2FwZUtleSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB0cmlnZ2Vycy5oaWRlLmZvckVhY2goZnVuY3Rpb24odHJpZ2dlcikge1xuICAgICAgICAgICAgICAgIGlmICh0cmlnZ2VyID09PSAnb3V0c2lkZUNsaWNrJykge1xuICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignY2xpY2snLCBib2R5SGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vZmYodHJpZ2dlciwgaGlkZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgZnVuY3Rpb24gcHJlcFRyaWdnZXJzKCkge1xuICAgICAgICAgICAgICB2YXIgc2hvd1RyaWdnZXJzID0gW10sIGhpZGVUcmlnZ2VycyA9IFtdO1xuICAgICAgICAgICAgICB2YXIgdmFsID0gc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ1RyaWdnZXInXSk7XG4gICAgICAgICAgICAgIHVucmVnaXN0ZXJUcmlnZ2VycygpO1xuXG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzT2JqZWN0KHZhbCkpIHtcbiAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyh2YWwpLmZvckVhY2goZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICAgICAgICBzaG93VHJpZ2dlcnMucHVzaChrZXkpO1xuICAgICAgICAgICAgICAgICAgaGlkZVRyaWdnZXJzLnB1c2godmFsW2tleV0pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHRyaWdnZXJzID0ge1xuICAgICAgICAgICAgICAgICAgc2hvdzogc2hvd1RyaWdnZXJzLFxuICAgICAgICAgICAgICAgICAgaGlkZTogaGlkZVRyaWdnZXJzXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0cmlnZ2VycyA9IGdldFRyaWdnZXJzKHZhbCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAodHJpZ2dlcnMuc2hvdyAhPT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgdHJpZ2dlcnMuc2hvdy5mb3JFYWNoKGZ1bmN0aW9uKHRyaWdnZXIsIGlkeCkge1xuICAgICAgICAgICAgICAgICAgaWYgKHRyaWdnZXIgPT09ICdvdXRzaWRlQ2xpY2snKSB7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQub24oJ2NsaWNrJywgdG9nZ2xlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQub24oJ2NsaWNrJywgYm9keUhpZGVUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRyaWdnZXIgPT09IHRyaWdnZXJzLmhpZGVbaWR4XSkge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKHRyaWdnZXIsIHRvZ2dsZVRvb2x0aXBCaW5kKTtcbiAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHJpZ2dlcikge1xuICAgICAgICAgICAgICAgICAgICBlbGVtZW50Lm9uKHRyaWdnZXIsIHNob3dUb29sdGlwQmluZCk7XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQub24odHJpZ2dlcnMuaGlkZVtpZHhdLCBoaWRlVG9vbHRpcEJpbmQpO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgZWxlbWVudC5vbigna2V5cHJlc3MnLCBoaWRlT25Fc2NhcGVLZXkpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHByZXBUcmlnZ2VycygpO1xuXG4gICAgICAgICAgICB2YXIgYW5pbWF0aW9uID0gc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ0FuaW1hdGlvbiddKTtcbiAgICAgICAgICAgIHR0U2NvcGUuYW5pbWF0aW9uID0gYW5ndWxhci5pc0RlZmluZWQoYW5pbWF0aW9uKSA/ICEhYW5pbWF0aW9uIDogb3B0aW9ucy5hbmltYXRpb247XG5cbiAgICAgICAgICAgIHZhciBhcHBlbmRUb0JvZHlWYWw7XG4gICAgICAgICAgICB2YXIgYXBwZW5kS2V5ID0gcHJlZml4ICsgJ0FwcGVuZFRvQm9keSc7XG4gICAgICAgICAgICBpZiAoYXBwZW5kS2V5IGluIGF0dHJzICYmIGF0dHJzW2FwcGVuZEtleV0gPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICBhcHBlbmRUb0JvZHlWYWwgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgYXBwZW5kVG9Cb2R5VmFsID0gc2NvcGUuJGV2YWwoYXR0cnNbYXBwZW5kS2V5XSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGFwcGVuZFRvQm9keSA9IGFuZ3VsYXIuaXNEZWZpbmVkKGFwcGVuZFRvQm9keVZhbCkgPyBhcHBlbmRUb0JvZHlWYWwgOiBhc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AgICBpZiAocHJldmlvdXNFbGVtZW50KSB7XG4gICAgICAgICAgcHJldmlvdXNFbGVtZW50LnJlbW92ZSgpO1xuICAgICAgICAgIHByZXZpb3VzRWxlbWVudCA9IG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoY3VycmVudFNjb3BlKSB7XG4gICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgY3VycmVudFNjb3BlID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjdXJyZW50RWxlbWVudCkge1xuICAgICAgICAgICRhbmltYXRlLmxlYXZlKGN1cnJlbnRFbGVtZW50KS50aGVuKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBjdXJyZW50RWxlbWVudDtcbiAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IG51bGw7XG4gICAgICAgIH1cbiAgICAgIH07XG5cbiAgICAgIHNjb3BlLiR3YXRjaCgkc2NlLnBhcnNlQXNSZXNvdXJjZVVybChhdHRycy51aWJUb29sdGlwVGVtcGxhdGVUcmFuc2NsdWRlKSwgZnVuY3Rpb24oc3JjKSB7XG4gICAgICAgIHZhciB0aGlzQ2hhbmdlSWQgPSArK2NoYW5nZUNvdW50ZXI7XG5cbiAgICAgICAgaWYgKHNyYykge1xuICAgICAgICAgIC8vc2V0IHRoZSAybmQgcGFyYW0gdG8gdHJ1ZSB0byBpZ25vcmUgdGhlIHRlbXBsYXRlIHJlcXVlc3QgZXJyb3Igc28gdGhhdCB0aGUgaW5uZXJcbiAgICAgICAgICAvL2NvbnRlbnRzIGFuZCBzY29wZSBjYW4gYmUgY2xlYW5lZCB1cC5cbiAgICAgICAgICAkdGVtcGxhdGVSZXF1ZXN0KHNyYywgdHJ1ZSkudGhlbihmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHRoaXNDaGFuZ2VJZCAhPT0gY2hhbmdlQ291bnRlcikgeyByZXR1cm47IH1cbiAgICAgICAgICAgIHZhciBuZXdTY29wZSA9IG9yaWdTY29wZS4kbmV3KCk7XG4gICAgICAgICAgICB2YXIgdGVtcGxhdGUgPSByZXNwb25zZTtcblxuICAgICAgICAgICAgdmFyIGNsb25lID0gJGNvbXBpbGUodGVtcGxhdGUpKG5ld1Njb3BlLCBmdW5jdGlvbihjbG9uZSkge1xuICAgICAgICAgICAgICBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50KCk7XG4gICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCBlbGVtKTtcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBuZXdTY29wZTtcbiAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50ID0gY2xvbmU7XG5cbiAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50TG9hZGVkJywgc3JjKTtcbiAgICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGlmICh0aGlzQ2hhbmdlSWQgPT09IGNoYW5nZUNvdW50ZXIpIHtcbiAgICAgICAgICAgICAgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpO1xuICAgICAgICAgICAgICBzY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50RXJyb3InLCBzcmMpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICAgIHNjb3BlLiRlbWl0KCckaW5jbHVkZUNvbnRlbnRSZXF1ZXN0ZWQnLCBzcmMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHNjb3BlLiRvbignJGRlc3Ryb3knLCBjbGVhbnVwTGFzdEluY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TWF0aC5tYXguYXBwbHkobnVsbCwgdGFic2V0Q3RybC50YWJzLm1hcChmdW5jdGlvbih0KSB7IHJldHVybiB0LmluZGV4OyB9KSkgKyAxO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHNjb3BlLmluZGV4ID0gMDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoYW5ndWxhci5pc1VuZGVmaW5lZChhdHRycy5jbGFzc2VzKSkge1xuICAgICAgICBzY29wZS5jbGFzc2VzID0gJyc7XG4gICAgICB9XG5cbiAgICAgIHNjb3BlLnNlbGVjdCA9IGZ1bmN0aW9uKGV2dCkge1xuICAgICAgICBpZiAoIXNjb3BlLmRpc2FibGVkKSB7XG4gICAgICAgICAgdmFyIGluZGV4O1xuICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGFic2V0Q3RybC50YWJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAodGFic2V0Q3RybC50YWJzW2ldLnRhYiA9PT0gc2NvcGUpIHtcbiAgICAgICAgICAgICAgaW5kZXggPSBpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0YWJzZXRDdHJsLnNlbGVjdChpbmRleCwgZXZ0KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAgdGFic2V0Q3RybC5hZGRUYWIoc2NvcGUpO1xuICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICB0YWJzZXRDdHJsLnJlbW92ZVRhYihzY29wZSk7XG4gICAgICB9KTtcblxuICAgICAgLy9XZSBuZWVkIHRvIHRyYW5zY2x1ZGUgbGF0ZXIsIG9uY2UgdGhlIGNvbnRlbnQgY29udGFpbmVyIGlzIHJlYWR5LlxuICAgICAgLy93aGVuIHRoaXMgbGluayBoYXBwZW5zLCB3ZSdyZSBpbnNpZGUgYSB0YWIgaGVhZGluZy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lucHV0RWwsIHNlY29uZHNJbnB1dEVsKSB7XG4gICAgaG91cnNJbnB1dEVsLm9uKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgaWYgKCFkaXNhYmxlZCkge1xuICAgICAgICBpZiAoZS53aGljaCA9PT0gMzgpIHsgLy8gdXBcbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmluY3JlbWVudEhvdXJzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGUud2hpY2ggPT09IDQwKSB7IC8vIGRvd25cbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmRlY3JlbWVudEhvdXJzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBtaW51dGVzSW5wdXRFbC5vbigna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgIGlmICghZGlzYWJsZWQpIHtcbiAgICAgICAgaWYgKGUud2hpY2ggPT09IDM4KSB7IC8vIHVwXG4gICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICRzY29wZS5pbmNyZW1lbnRNaW51dGVzKCk7XG4gICAgICAgICAgJHNjb3BlLiRhcHBseSgpO1xuICAgICAgICB9IGVsc2UgaWYgKGUud2hpY2ggPT09IDQwKSB7IC8vIGRvd25cbiAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgJHNjb3BlLmRlY3JlbWVudE1pbnV0ZXMoKTtcbiAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHNlY29uZHNJbnB1dEVsLm9uKCdrZXlkb3duJywgZnVuY3Rpb24oZSkge1xuICAgICAgaWYgKCFkaXNhYmxlZ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BvbiBhIHBhZ2VcbiAgICAgICAgICAgIC8vZHVlIHRvIG90aGVyIGVsZW1lbnRzIGJlaW5nIHJlbmRlcmVkXG4gICAgICAgICAgICByZWNhbGN1bGF0ZVBvc2l0aW9uKCk7XG5cbiAgICAgICAgICAgIGVsZW1lbnQuYXR0cignYXJpYS1leHBhbmRlZCcsIHRydWUpO1xuXG4gICAgICAgICAgICAvL1NlbGVjdCB0aGUgc2luZ2xlIHJlbWFpbmluZyBvcHRpb24gaWYgdXNlciBpbnB1dCBtYXRjaGVzXG4gICAgICAgICAgICBpZiAoc2VsZWN0T25FeGFjdCAmJiBzY29wZS5tYXRjaGVzLmxlbmd0aCA9PT0gMSAmJiBpbnB1dElzRXhhY3RNYXRjaChpbnB1dFZhbHVlLCAwKSkge1xuICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc051bWJlcihzY29wZS5kZWJvdW5jZVVwZGF0ZSkgfHwgYW5ndWxhci5pc09iamVjdChzY29wZS5kZWJvdW5jZVVwZGF0ZSkpIHtcbiAgICAgICAgICAgICAgICAkJGRlYm91bmNlKGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0KDAsIGV2dCk7XG4gICAgICAgICAgICAgICAgfSwgYW5ndWxhci5pc051bWJlcihzY29wZS5kZWJvdW5jZVVwZGF0ZSkgPyBzY29wZS5kZWJvdW5jZVVwZGF0ZSA6IHNjb3BlLmRlYm91bmNlVXBkYXRlWydkZWZhdWx0J10pO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdCgwLCBldnQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChzaG93SGludCkge1xuICAgICAgICAgICAgICB2YXIgZmlyc3RMYWJlbCA9IHNjb3BlLm1hdGNoZXNbMF0ubGFiZWw7XG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKGl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AgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKCd5ZWFyLXJhbmdlJywgYXR0cnMuZVllYXJSYW5nZSB8fCAyMCk7XG4gICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ25nLXJlYWRvbmx5JywgYXR0cnMuZVJlYWRvbmx5IHx8IGZhbHNlKTtcblxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBwb3B1cEF0dHJOYW1lcy5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcG9wdXBBdHRyID0gYXR0cnNbcG9wdXBBdHRyTmFtZXNbaV1bMF1dO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvcHVwQXR0ciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0RGF0ZVBpY2tlci5hdHRyKHBvcHVwQXR0ck5hbWVzW2ldWzFdLCBwb3B1cEF0dHIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKGF0dHJzLmVOZ0NoYW5nZSkge1xuICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cignbmctY2hhbmdlJywgYXR0cnMuZU5nQ2hhbmdlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25nLWNoYW5nZScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChhdHRycy5lU3R5bGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ3N0eWxlJywgYXR0cnMuZVN0eWxlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ3N0eWxlJyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdmFyIGRhdGVPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICBtYXhEYXRlOiBzY29wZS4kZXZhbChhdHRycy5lTWF4RGF0ZSkgfHwgdWliRGF0ZXBpY2tlckNvbmZpZy5tYXhEYXRlLFxuICAgICAgICAgICAgICAgICAgICBtaW5EYXRlOiBzY29wZS4kZXZhbChhdHRycy5lTWluRGF0ZSkgfHwgdWliRGF0ZXBpY2tlckNvbmZpZy5taW5EYXRlLFxuICAgICAgICAgICAgICAgICAgICBzaG93V2Vla3M6IGF0dHJzLmVTaG93V2Vla3MgPyBhdHRycy5lU2hvd1dlZWtzLnRvTG93ZXJDYXNlKCkgPT09ICd0cnVlJyA6IHVpYkRhdGVwaWNrZXJDb25maWcuc2hvd1dlZWtzLFxuICAgICAgICAgICAgICAgICAgICBzdGFydGluZ0RheTogYXR0cnMuZVN0YXJ0aW5nRGF5IHx8IDAsXG4gICAgICAgICAgICAgICAgICAgIGluaXREYXRlOiBzY29wZS4kZXZhbChhdHRycy5lSW5pdERhdGUpIHx8IG5ldyBEYXRlKClcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgaWYgKGF0dHJzLmVEYXRlcGlja2VyT3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZURhdGVwaWNrZXJPcHRpb25zID0gJHBhcnNlKGF0dHJzLmVEYXRlcGlja2VyT3B0aW9ucykoc2NvcGUpO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChkYXRlT3B0aW9ucywgZURhdGVwaWNrZXJPcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmb3IgKHZhciB6ID0gZGF0ZU9wdGlvbnNOYW1lcy5sZW5ndGggLSAxOyB6ID49IDA7IHotLSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgZG9BdHRyID0gYXR0cnNbZGF0ZU9wdGlvbnNOYW1lc1t6XVswXV07XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZG9BdHRyICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZU9wdGlvbnNbZGF0ZU9wdGlvbnNOYW1lc1t6XVsxXV0gPSBkb0F0dHI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBzY29wZS5kYXRlT3B0aW9ucyA9IGRhdGVPcHRpb25zO1xuXG4gICAgICAgICAgICAgICAgdmFyIHNob3dDYWxlbmRhckJ1dHRvbiA9IGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHJzLmVTaG93Q2FsZW5kYXJCdXR0b24pID8gYXR0cnMuZVNob3dDYWxlbmRhckJ1dHRvbiA6IFwidHJ1ZVwiO1xuXG4gICAgICAgICAgICAgICAgLy9TZWUgaWYgY2FsZW5kYXIgYnV0dG9uIHNob3VsZCBiZSBkaXNwbGF5ZWRcbiAgICAgICAgICAgICAgICBpZiAoc2hvd0NhbGVuZGFyQnV0dG9uID09PSBcInRydWVcIikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYnV0dG9uRGF0ZVBpY2tlciA9IGFuZ3VsYXIuZWxlbWVudCgnPGJ1dHRvbiB0eXBlPVwiYnV0dG9uXCIgY2xhc3M9XCInICtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy50aGVtZS5jYWxlbmRhckJ1dHRvbkNsYXNzICsgJ1wiPjxpIGNsYXNzPVwiJyArXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaWNvbl9zZXQuY2FsZW5kYXIgKyAnXCI+PC9pPjwvYnV0dG9uPicpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYnV0dG9uV3JhcHBlciA9IGFuZ3VsYXIuZWxlbWVudCgnPHNwYW4gY2xhc3M9XCInICsgdGhpcy50aGVtZS5idXR0b25Hcm91cEFwcGVuZENsYXNzKyAnXCI+PC9zcGFuPicpO1xuXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvbkRhdGVQaWNrZXIuYXR0cignbmctY2xpY2snLCBhdHRycy5lTmdDbGljayk7XG5cbiAgICAgICAgICAgICAgICAgICAgYnV0dG9uV3JhcHBlci5hcHBlbmQoYnV0dG9uRGF0ZVBpY2tlcik7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFwcGVuZChidXR0b25XcmFwcGVyKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAvL0lmIG5vIGNhbGVuZGFyIGJ1dHRvbiwgZGlzcGxheSBjYWxlbmRhciBwb3B1cCBvbiBjbGljayBvZiBpbnB1dCBmaWVsZFxuICAgICAgICAgICAgICAgICAgICBpbnB1dERhdGVQaWNrZXIuYXR0cignbmctY2xpY2snLCBhdHRycy5lTmdDbGljayk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaW5wdXREYXRlUGlja2VyLmF0dHIoJ2RhdGVwaWNrZXItb3B0aW9ucycsIFwiZGF0ZU9wdGlvbnNcIik7XG5cbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucHJlcGVuZChpbnB1dERhdGVQaWNrZXIpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2NsYXNzJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ25nLWNsaWNrJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2lzLW9wZW4nKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignaW5pdC1kYXRlJyk7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2RhdGVwaWNrZXItcG9wdXAnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cigncmVxdWlyZWQnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignbmctbW9kZWwnKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignZGF0ZS1waWNrZXItYXBwZW5kLXRvLWJvZHknKTtcbiAgICAgICAgICAgICAgICB0aGlzLmlucHV0RWwucmVtb3ZlQXR0cignbmFtZScpO1xuICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hdHRyKCdjbGFzcycsJ2lucHV0LWdyb3VwJyk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYXV0b3N1Ym1pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdjaGFuZ2UnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0sIDUwMCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9zdWJtaXQgb24gdGFiXG4gICAgICAgICAgICAgICAgICAgIGlmIChlLmtleUNvZGUgPT09IDkgJiYgc2VsZi5lZGl0b3JFbC5hdHRyKCdibHVyJykgPT09ICdzdWJtaXQnKSB7XG4gICAgICA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bC5wYXJlbnQoKS5wcmVwZW5kKGxhYmVsKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBBZGQgY2xhc3NlcyB0byB0aGUgZm9ybVxuICAgICAgICAgICAgaWYgKGF0dHJzLmVGb3JtY2xhc3MpIHtcbiAgICAgICAgICAgICAgdGhpcy5lZGl0b3JFbC5hZGRDbGFzcyhhdHRycy5lRm9ybWNsYXNzKTtcbiAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLnJlbW92ZUF0dHIoJ2Zvcm1jbGFzcycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgYXV0b3N1Ym1pdDogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICAvL3N1Ym1pdCBvbiB0YWJcbiAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSA5ICYmIHNlbGYuZWRpdG9yRWwuYXR0cignYmx1cicpID09PSAnc3VibWl0Jykge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1dKTtcbiAgfSk7XG5cbiAgLy9gcmFuZ2VgIGlzIGJpdCBzcGVjaWZpY1xuICBhbmd1bGFyLm1vZHVsZSgneGVkaXRhYmxlJykuZGlyZWN0aXZlKCdlZGl0YWJsZVJhbmdlJywgWydlZGl0YWJsZURpcmVjdGl2ZUZhY3RvcnknLCAnJGludGVycG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ICAgICB2YXIgc2VsZiA9IHRoaXM7XG4gICAgICAgIHNlbGYucGFyZW50LmFkZExpc3RlbmVycy5jYWxsKHNlbGYpO1xuICAgICAgICAvLyBzdWJtaXQgdGV4dGFyZWEgYnkgY3RybCtlbnRlciBldmVuIHdpdGggYnV0dG9uc1xuICAgICAgICBpZiAoc2VsZi5zaW5nbGUgJiYgc2VsZi5idXR0b25zICE9PSAnbm8nKSB7XG4gICAgICAgICAgc2VsZi5hdXRvc3VibWl0KCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBhdXRvc3VibWl0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICBzZWxmLmlucHV0RWwuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICBpZiAoc2VsZi5hdHRycy5zdWJtaXRPbkVudGVyKSB7XG4gICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSAxMyAmJiAhZS5zaGlmdEtleSkge1xuICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIGlmICgoZS5jdHJsS2V5IHx8IGUubWV0YUtleSkgJiYgKGUua2V5Q29kZSA9PT0gMTMpIHx8IFxuICAgICAgICAgICAgICAgIChlLmtleUNvZGUgPT09IDkgJiYgc2VsZi5lZGl0b3JFbC5hdHRyKCdibHVyJykgPT09ICdzdWJtaXQnKSkge1xuICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHNlbGYuc2NvcGUuJGZvcm0uJHN1Ym1pdCgpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAg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VuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNjb3BlLiRmb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9LCA1MDApO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgc2VsZi5pbnB1dEVsLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vc3VibWl0IG9uIHRhYlxuICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlID09PSA5ICYmIHNlbGYuZWRpdG9yRWwuYXR0cignYmx1cicpID09PSAnc3VibWl0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kc3VibWl0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICB2YXIgbGlua09yZyA9IGRpci5saW5rO1xuXG4gICAgICAgIGRpci5saW5rID0gZnVuY3Rpb24gKHNjb3BlLCBlbCwgYXR0cnMsIGN0cmwpIHtcbiAgICAgICAgICAgIHZhciBtYXRjaEVsID0gZWwuZmluZCgnZWRpdGFibGUtdWktc2VsZWN0LW1hdGNoJyk7XG4gICAgICAgICAgICB2YXIgY2hvaWNlc0VsID0gZWwuZmluZCgnZWRpdGFibGUtdWktc2VsZWN0LWNob2ljZXMnKTtcblxuICAgICAgICAgICAgYXR0cnMuJG1hdGNoRWxlbWVudCA9IG1hdGNoRWwuY2xvbmUoKT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ZWwuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmhpZGVcbiAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZWxlbWVudFxuICAgICAgICAgICAqL1xuICAgICAgICAgIGlmICgkYXR0cnMub25oaWRlKSB7XG4gICAgICAgICAgICBzZWxmLm9uaGlkZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgcmV0dXJuICRwYXJzZSgkYXR0cnMub25oaWRlKSgkc2NvcGUpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBjb250cm9sIGlzIGNhbmNlbGxlZC5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uY2FuY2VsXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWVsZW1lbnRcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpZiAoJGF0dHJzLm9uY2FuY2VsKSB7XG4gICAgICAgICAgICBzZWxmLm9uY2FuY2VsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKCRhdHRycy5vbmNhbmNlbCkoJHNjb3BlKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQ2FsbGVkIGR1cmluZyBzdWJtaXQgYmVmb3JlIHZhbHVlIGlzIHNhdmVkIHRvIG1vZGVsLlxuICAgICAgICAgICAqIFNlZSBbZGVtb10oI29uYmVmb3Jlc2F2ZSkuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmJlZm9yZXNhdmVcbiAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZWxlbWVudFxuICAgICAgICAgICA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IDEpIHtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdHJhbnNmZXJBdHRyID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgbmV4dExldHRlciA9IGsuc3Vic3RyaW5nKDEsIDIpO1xuXG4gICAgICAgICAgICAvLyBpZiBzdGFydHMgd2l0aCBgZWAgKyB1cHBlcmNhc2UgbGV0dGVyXG4gICAgICAgICAgICBpZiAoay5zdWJzdHJpbmcoMCwgMSkgPT09ICdlJyAmJiBuZXh0TGV0dGVyID09PSBuZXh0TGV0dGVyLnRvVXBwZXJDYXNlKCkpIHtcbiAgICAgICAgICAgICAgdHJhbnNmZXJBdHRyID0gay5zdWJzdHJpbmcoMSk7IC8vIGN1dCBgZWBcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBleGNsdWRlIGBmb3JtYCBhbmQgYG5nLXN1Ym1pdGAsXG4gICAgICAgICAgICBpZiAodHJhbnNmZXJBdHRyID09PSAnRm9ybScgfHwgdHJhbnNmZXJBdHRyID09PSAnTmdTdWJtaXQnKSB7XG4gICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2YXIgZmlyc3RMZXR0ZXIgPSB0cmFuc2ZlckF0dHIuc3Vic3RyaW5nKDAsIDEpO1xuICAgICAgICAgICAgdmFyIHNlY29uZExldHRlciA9IHRyYW5zZmVyQXR0ci5zdWJzdHJpbmcoMSwgMik7XG5cbiAgICAgICAgICAgIC8vIGNvbnZlcnQgYmFjayB0byBsb3dlcmNhc2Ugc3R5bGVcbiAgICAgICAgICAgIGlmIChzZWNvbmRMZXR0ZXIgPT09IHNlY29uZExldHRlci50b1VwcGVyQ2FzZSgpICYmXG4gICAgICAgICAgICAgIGZpcnN0TGV0dGVyID09PSBmaXJzdExldHRlci50b1VwcGV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07XG5cbiAgICAgICAgLy8gY2FuY2VsXG4gICAgICAgIHNlbGYuY2FuY2VsID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgIC8vIG9uY2FuY2VsXG4gICAgICAgICAgc2VsZi5vbmNhbmNlbCgpO1xuICAgICAgICAgIC8vIGRvbid0IGNhbGwgaGlkZSgpIGhlcmUgYXMgaXQgY2FsbGVkIGluIGZvcm0ncyBjb2RlXG4gICAgICAgIH07XG5cbiAgICAgICAgLypcbiAgICAgICAgQ2FsbGVkIGFmdGVyIHNob3cgdG8gYXR0YWNoIGxpc3RlbmVyc1xuICAgICAgICAqL1xuICAgICAgICBzZWxmLmFkZExpc3RlbmVycyA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAvLyBiaW5kIGtleXVwIGZvciBgZXNjYXBlYFxuICAgICAgICAgIHNlbGYuaW5wdXRFbC5iaW5kKCdrZXl1cCcsIGZ1bmN0aW9uIChlKSB7XG4gICAgICAgICAgICBpZiAoIXNlbGYuc2luZ2xlKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gdG9kbzogbW92ZSB0aGlzIHRvIGVkaXRhYmxlLWZvcm0hXG4gICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkge1xuICAgICAgICAgICAgICAvLyBoaWRlIG9uIGBlc2NhcGVgIHByZXNzXG4gICAgICAgICAgICAgIGNhc2UgMjc6XG4gICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS4kY2FuY2VsKCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAvLyBhdXRvc3VibWl0IHdoZW4gYG5vIGJ1dHRvbnNgXG4gICAgICAgICAgaWYgKHNlbGYuc2luZ2xlICYmIHNlbGYuYnV0dG9ucyA9PT0gJ25vJykge1xuICAgICAgICAgICAgc2VsZi5hdXRvc3VibWl0KCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gY2xpY2sgLSBtYXJrIGVsZW1lbnQgYXMgY2xpY2tlZCB0byBleGNsdWRlIGluIGRvY3VtZW50IGNsaWNrIGhhbmRsZXJcbiAgICAgICAgICBzZWxmLmVkaXRvckVsLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKGUpIHtcbiAgICAgICAgICAgIC8vIGlnbm9yZSByaWdodC9taWRkbGUgYnV0dG9uIGNsaWNrXG4gICAgICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHNlbGYuc2NvcGUuJGZvcm0uJHZpc2libGUpIHtcbiAgICAgICAgICAgICAgc2VsZi5zY29wZS4kZm9ybS5fY2xpY2tlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH07XG5cbiAgICAgICAgLy8gc2V0V2FpdGluZ1xuICAgICAgICBzZWxmLnNldFdhaXRpbmcgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICBpZiAodmFsdWUpIHtcbiAgICAgICAgICAgIC8vIHBhcnRpY2lwYXRlIGluIHdhaXRpbmcgb25seSBpZiBub3QgZGlzYWJsZWRcbiAgICAgICAgICAgIGluV2FpdGluZyA9ICFzZWxmLmlucHV0RWwuYXR0cignZGlzYWJsZWQnKSAmJlxuICAgICAgICAgICAgICAhc2VsZi5pbnB1dEVsLmF0dHIoJ25nLWRpc2FibGVkJykgJiZcbiAgICAgICAgICAgICAgIXNlbGYuaW5wdXRFbC5hdHRyKCduZy1lbmFibGVkJyk7XG4gICAgICAgICAgICBpZiAoaW5XYWl0aW5nKSB7XG4gICAgICAgICAgICAgIHNlbG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zZWxlY3QoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChlbC5mb2N1cykge1xuICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LCAwKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzZWxmLnNldEVycm9yID0gZnVuY3Rpb24gKG1zZykge1xuICAgICAgICAgIGlmICghYW5ndWxhci5pc09iamVjdChtc2cpKSB7XG4gICAgICAgICAgICAkc2NvcGUuJGVycm9yID0gJHNjZS50cnVzdEFzSHRtbChtc2cpO1xuICAgICAgICAgICAgc2VsZi5lcnJvciA9IG1zZztcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgLypcbiAgICAgICAgQ2hlY2tzIHRoYXQgcmVzdWx0IGlzIHN0cmluZyBvciBwcm9taXNlIHJldHVybmVkIHN0cmluZyBhbmQgc2hvd3MgaXQgYXMgZXJyb3IgbWVzc2FnZVxuICAgICAgICBBcHBsaWVkIHRvIG9uc2hvdywgb25iZWZvcmVzYXZlLCBvbmFmdGVyc2F2ZVxuICAgICAgICAqL1xuICAgICAgICBzZWxmLmNhdGNoRXJyb3IgPSBmdW5jdGlvbiAocmVzdWx0LCBub1Byb21pc2UpIHtcbiAgICAgICAgICBpZiAoYW5ndWxhci5pc09iamVjdChyZXN1bHQpICYmIG5vUHJvbWlzZSAhPT0gdHJ1ZSkge1xuICAgICAgICAgICAgJHEud2hlbihyZXN1bHQpLnRoZW4oXG4gICAgICAgICAgICAgIC8vc3VjY2VzcyBhbmQgZmFpbCBoYW5kbGVycyBhcmUgZXF1YWxcbiAgICAgICAgICAgICAgYW5ndWxhci5iaW5kKHRoaXMsIGZ1bmN0aW9uIChyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jYXRjaEVycm9yKHIsIHRydWUpO1xuICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgYW5ndWxhci5iaW5kKHRoaXMs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ZXNzZWQgeWV0XG4gICAgICAgICAgICAgICAgZUZvcm1DdHJsID0gbnVsbDtcbiAgICAgICAgICAgICAgICBoYXNGb3JtID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8qXG4gICAgICAgIGlmKGhhc0Zvcm0gJiYgIWF0dHJzLmVOYW1lKSB7XG4gICAgICAgICAgdGhyb3cgJ1lvdSBzaG91bGQgcHJvdmlkZSBgZS1uYW1lYCBmb3IgZWRpdGFibGUgZWxlbWVudCBpbnNpZGUgZm9ybSEnO1xuICAgICAgICB9XG4gICAgICAgICovXG5cbiAgICAgICAgLy9jaGVjayBmb3IgYGVkaXRhYmxlLWZvcm1gIGF0dHIgaW4gZm9ybVxuICAgICAgICAvKlxuICAgICAgICBpZihlRm9ybUN0cmwgJiYgKSB7XG4gICAgICAgICAgdGhyb3cgJ1lvdSBzaG91bGQgcHJvdmlkZSBgZS1uYW1lYCBmb3IgZWRpdGFibGUgZWxlbWVudCBpbnNpZGUgZm9ybSEnO1xuICAgICAgICB9XG4gICAgICAgICovXG5cbiAgICAgICAgLy8gc3RvcmUgb3JpZ2luYWwgcHJvcHMgdG8gYHBhcmVudGAgYmVmb3JlIG1lcmdlXG4gICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvdmVyd3JpdGVzLCBmdW5jdGlvbih2LCBrKSB7XG4gICAgICAgICAgaWYoZUN0cmxba10gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgZUN0cmwucGFyZW50W2tdID0gZUN0cmxba107XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBtZXJnZSBvdmVyd3JpdGVzIHRvIGJhc2UgZWRpdGFibGUgY29udHJvbGxlclxuICAgICAgICBhbmd1bGFyLmV4dGVuZChlQ3RybCwgb3ZlcndyaXRlcyk7XG5cbiAgICAgICAgLy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ICAgIHZhciBlZGl0YWJsZXMgPSBzaG93bi4kZWRpdGFibGVzO1xuICAgICAgICBhbmd1bGFyLmZvckVhY2goZWRpdGFibGVzLCBmdW5jdGlvbiAodikge1xuICAgICAgICAgIHZhciBlbGVtZW50ID0gdi5lZGl0b3JFbFswXTtcbiAgICAgICAgICBpZiAoaXNTZWxmT3JEZXNjZW5kYW50KGVsZW1lbnQsIGV2ZW50LnRhcmdldCkpXG4gICAgICAgICAgICBpc0JsdXIgPSBmYWxzZTtcblxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIGlzQmx1cjtcbiAgICAgIH07XG5cbiAgICAgIHZhciBjbGlja0hhbmRsZXIgPSBmdW5jdGlvbiAoZSkge1xuICAgICAgICAvLyBpZ25vcmUgcmlnaHQvbWlkZGxlIGJ1dHRvbiBjbGlja1xuICAgICAgICBpZiAoZS53aGljaCAmJiBlLndoaWNoICE9PSAxKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdmFyIHRvQ2FuY2VsID0gW107XG4gICAgICAgIHZhciB0b1N1Ym1pdCA9IFtdO1xuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNob3duLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgLy8gY29uc29sZS5sb2coXCJpbiBmb3JcIiwgc2hvd25baV0pO1xuICAgICAgICAgIC8vIGV4Y2x1ZGUgY2xpY2tlZFxuICAgICAgICAgIGlmIChzaG93bltpXS5fY2xpY2tlZCkge1xuICAgICAgICAgICAgc2hvd25baV0uX2NsaWNrZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIGV4Y2x1ZGUgd2FpdGluZ1xuICAgICAgICAgIGlmIChzaG93bltpXS4kd2FpdGluZykge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHNob3duW2ldLl9ibHVyID09PS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AgIH1cbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogU2hvd3MgZm9ybSB3aXRoIGVkaXRhYmxlIGNvbnRyb2xzLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRzaG93KClcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRzaG93OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKHRoaXMuJHZpc2libGUpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICB0aGlzLiR2aXNpYmxlID0gdHJ1ZTtcblxuICAgICAgICAgIHZhciBwYyA9IGVkaXRhYmxlUHJvbWlzZUNvbGxlY3Rpb24oKTtcblxuICAgICAgICAgIC8vb3duIHNob3dcbiAgICAgICAgICBwYy53aGVuKHRoaXMuJG9uc2hvdygpKTtcblxuICAgICAgICAgIC8vY2xlYXIgZXJyb3JzXG4gICAgICAgICAgdGhpcy4kc2V0RXJyb3IobnVsbCwgJycpO1xuXG4gICAgICAgICAgLy9jaGlsZHJlbiBzaG93XG4gICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRoaXMuJGVkaXRhYmxlcywgZnVuY3Rpb24gKGVkaXRhYmxlKSB7XG4gICAgICAgICAgICBwYy53aGVuKGVkaXRhYmxlLnNob3coKSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICAvL3dhaXQgcHJvbWlzZXMgYW5kIGFjdGl2YXRlXG4gICAgICAgICAgcGMudGhlbih7XG4gICAgICAgICAgICBvbldhaXQ6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRzZXRXYWl0aW5nKSxcbiAgICAgICAgICAgIG9uVHJ1ZTogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGFjdGl2YXRlKSxcbiAgICAgICAgICAgIG9uRmFsc2U6IGFuZ3VsYXIuYmluZCh0aGlzLCB0aGlzLiRh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AgZnVuY3Rpb24gaXMgY2FsbGVkLlxuICAgICAgICAgKlxuICAgICAgICAgKiBAbWV0aG9kICRhY3RpdmF0ZShuYW1lKVxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBuYW1lIG9mIGZpZWxkXG4gICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAqL1xuICAgICAgICAkYWN0aXZhdGU6IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgICAgdmFyIGksXG4gICAgICAgICAgICBzZWxlY3Rpb25TdGFydCxcbiAgICAgICAgICAgIHNlbGVjdGlvbkVuZDtcbiAgICAgICAgICBpZiAodGhpcy4kZWRpdGFibGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgLy9hY3RpdmF0ZSBieSBuYW1lXG4gICAgICAgICAgICBpZiAoYW5ndWxhci5pc1N0cmluZyhuYW1lKSkge1xuICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdGhpcy4kZWRpdGFibGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuJGVkaXRhYmxlc1tpXS5uYW1lID09PSBuYW1lKSB7XG4gICAgICAgICAgICAgICAgICB0aGlzLiRlZGl0YWJsZXNbaV0uYWN0aXZhdGUoKTtcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy90cnkgYWN0aXZhdGUgZXJyb3IgZmllbGRcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0aGlzLiRlZGl0YWJsZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgaWYgKHRoaXMuJGVkaXRhYmxlc1tpXS5lcnJvcikge1xuICAgICAgICAgICAgICAgIHRoaXMuJGVkaXRhYmxlc1tpXS5hY3RpdmF0ZSgpO1xuICAgICAgICAgICAgICAg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Y2godGhpcy4kZWRpdGFibGVzLCBmdW5jdGlvbiAoZWRpdGFibGUpIHtcbiAgICAgICAgICAgIGVkaXRhYmxlLnNldFdhaXRpbmcoISF2YWx1ZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIFNob3dzIGVycm9yIG1lc3NhZ2UgZm9yIHBhcnRpY3VsYXIgZmllbGQuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBtZXRob2QgJHNldEVycm9yKG5hbWUsIG1zZylcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgbmFtZSBvZiBmaWVsZFxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbXNnIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICovXG4gICAgICAgICRzZXRFcnJvcjogZnVuY3Rpb24gKG5hbWUsIG1zZykge1xuICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLiRlZGl0YWJsZXMsIGZ1bmN0aW9uIChlZGl0YWJsZSkge1xuICAgICAgICAgICAgaWYgKCFuYW1lIHx8IGVkaXRhYmxlLm5hbWUgPT09IG5hbWUpIHtcbiAgICAgICAgICAgICAgZWRpdGFibGUuc2V0RXJyb3IobXNnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcblxuICAgICAgICAkc3VibWl0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgaWYgKHRoaXMuJHdhaXRpbmcpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvL2NsZWFyIGVycm9yc1xuICAgICAgICAgIHRoaXMuJHNldEVycm9yKG51bGwsICcnKTtcblxuICAgICAgICAgIC8vY2hpbGRyZW4gb25iZWZvcmVzYXZlXG4gICAgICAgICAgdmFyIHBjID0gZWRpdGFibGVQcm9ta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YWxzZToganVzdCBjbG9zZSBmb3JtXG4gICAgICAgICAgLSBzdHJpbmc6IGtlZXAgZm9ybSBvcGVuIGFuZCBzaG93IGVycm9yXG4gICAgICAgICAgKi9cbiAgICAgICAgICBwYy50aGVuKHtcbiAgICAgICAgICAgIG9uV2FpdDogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJHNldFdhaXRpbmcpLFxuICAgICAgICAgICAgb25UcnVlOiBhbmd1bGFyLmJpbmQodGhpcywgdGhpcy4kaGlkZSksXG4gICAgICAgICAgICBvbkZhbHNlOiBhbmd1bGFyLmJpbmQodGhpcywgdGhpcy4kaGlkZSksXG4gICAgICAgICAgICBvblN0cmluZzogYW5ndWxhci5iaW5kKHRoaXMsIHRoaXMuJGFjdGl2YXRlKVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgICRvbnNob3c6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uY2FuY2VsOiBhbmd1bGFyLm5vb3AsXG4gICAgICAgICRvbmhpZGU6IGFuZ3VsYXIubm9vcCxcbiAgICAgICAgJG9uYmVmb3Jlc2F2ZTogYW5ndWxhci5ub29wLFxuICAgICAgICAkb25hZnRlcnNhdmU6IGFuZ3VsYXIubm9vcFxuICAgICAgfTtcblxuICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgcmV0dXJuIGFuZ3VsYXIuZXh0ZW5kKHtcbiAgICAgICAgICAkZWRpdGFibGVzOiBbXSxcbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBGb3JtIHZpc2liaWxpdHkgZmxhZy5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEB2YXIge2Jvb2x9ICR2aXNpYmxlXG4gICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgKi9cbiAgICAgICAgICAkdmlzaWJsZTogZmFsc2UsXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogRm9ybSB3YWl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ICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGlzIHNob3duLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbnNob3cgXG4gICAgICAgICAgICAgKiBAbWVtYmVyT2YgZWRpdGFibGUtZm9ybVxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBpZihhdHRycy5vbnNob3cpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uc2hvdyA9IGFuZ3VsYXIuYmluZChlRm9ybSwgJHBhcnNlKGF0dHJzLm9uc2hvdyksIHNjb3BlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBDYWxsZWQgd2hlbiBmb3JtIGhpZGVzIGFmdGVyIGJvdGggc2F2ZSBvciBjYW5jZWwuXG4gICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAqIEB2YXIge21ldGhvZHxhdHRyaWJ1dGV9IG9uaGlkZSBcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLm9uaGlkZSkge1xuICAgICAgICAgICAgICBlRm9ybS4kb25oaWRlID0gYW5ndWxhci5iaW5kKGVGb3JtLCAkcGFyc2UoYXR0cnMub25oaWRlKSwgc2NvcGUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIENhbGxlZCB3aGVuIGZvcm0gaXMgY2FuY2VsbGVkLlxuICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmNhbmNlbFxuICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgaWYoYXR0cnMub25jYW5jZWwpIHtcbiAgICAgICAgICAgICAgZUZvcm0uJG9uY2FuY2VsID0gYW5ndWxhci5iaW5kKGVGb3JtLCAkcGFyc2UoYXR0cnMub25jYW5jZWwpLCBzY29wZSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogV2hldGhlciBmb3JtIGluaXRpYWxseSByZW5kZXJlZCBpbiBzaG93biBzdGF0ZS5cbiAgICAgICAgICAgICAqXG4gICAgICAgICAgICAgKiBAdmFyIHtib29sfGF0dHJpYnV0ZX0gc2hvd25cbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGlmKGF0dHJzLnNob3duICYmICRwYXJzZShhdHRycy5zaG93bikoc2NvcGUpKSB7XG4gICAgICAgICAgICAgIGVGb3JtLiRzaG93KCk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogQWN0aW9uIHdoZW4gZm9ybSBsb3NzZXMgZm9jdXMuIFZhbHVlczogYGNhbmNlbHxzdWJtaXR8aWdub3JlYC5cbiAgICAgICAgICAgICAqIERlZmF1bHQgaXMgYGlnbm9yZWAuXG4gICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAqIEB2YXIge3N0cmluZ3xhdHRyaWJ1dGV9IGJsdXJcbiAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIGVGb3JtLl9ibHVyID0gYXR0cnMuYmx1ciB8fCBlZGl0YWJsZU9wdGlvbnMuYmx1ckZvcm07XG5cbiAgICAgICAgICAgIC8vIG9uYmVmb3Jlc2F2ZSwgb25hZnRlcnNhdmVcbiAgICAgICAgICAgIGlmKCFhdHRycy5uZ1N1Ym1pdCAmJiAhYXR0cnMuc3VibWl0KSB7XG4gICAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICAgKiBDYWxsZWQgYWZ0ZXIgYWxsIGNoaWxkcmVuIGBvbmJlZm9yZXNhdmVgIGNhbGxiYWNrcyBidXQgYmVmb3JlIHNhdmluZyBmb3JtIHZhbHVlc1xuICAgICAgICAgICAgICAgKiB0byBtb2RlbC4gIFxuICAgICAgICAgICAgICAgKiBJZiBhdCBsZWFzdCBvbmUgY2hpbGRyZW4gY2FsbGJhY2sgcmV0dXJucyBgbm9uLXN0cmluZ2AgLSBpdCB3aWxsIG5vdCBub3QgYmUgY2FsbGVkLiAgXG4gICAgICAgICAgICAgICAqIFNlZSBbZWRpdGFibGUtZm9ybSBkZW1vXSgjZWRpdGFibGUtZm9ybSkgZm9yIGRldGFpbHMuXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKiBAdmFyIHttZXRob2R8YXR0cmlidXRlfSBvbmJlZm9yZXNhdmVcbiAgICAgICAgICAgICAgICogQG1lbWJlck9mIGVkaXRhYmxlLWZvcm1cbiAgICAgICAgICAgICAgICogXG4gICAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgICBpZihhdHRycy5vbmJlZm9yZXNhdmUpIHtcbiAgICAgICAgICAgICAgICBlRm9ybS4kb25iZWZvcmVzYXZlID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gJHBhcnNlKGF0dHJzLm9uYmVmb3Jlc2F2ZSkoc2NvcGUsIHskZGF0YTogZUZvcm0uJGRhdGF9KTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgICAqIENhbGxlZCB3aGVuIGZvcm0gdmFsdWVzIGFyZSBzYXZlZCB0byBtb2RlbC4gIFxuICAgICAgICAgICAgICAgKiBTZWUgW2VkaXRhYmxlLWZvcm0gZGVtb10oI2VkaXRhYmxlLWZvcm0pIGZvciBkZXRhaWxzLlxuICAgICAgICAgICAgICAgKiBcbiAgICAgICAgICAgICAgICogQHZhciB7bWV0aG9kfGF0dHJpYnV0ZX0gb25hZnRlcnNhdmUgXG4gICAgICAgICAgICAgICAqIEBtZW1iZXJPZiBlZGl0YWJsZS1mb3JtXG4gICAgICAgICAgICAgICAqIFxuICAgICAgICAgICAgICAgKi9cbiAgICAgICAgICAgICAgaWYoYXR0cnMub25hZnRlcnNhdmUpIHtcbiAgICAgICAgICAgICAgICBlRm9ybS4kb25hZnRlcnNhdmUgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHJldHVybiAkcGFyc2UoYXR0cnMub25hZnRlcnNhdmUpKHNjb3BlLCB7JGRhdGE6IGVGb3JtLiRkYXRhfSk7XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGVsZW0uYmluZCgnc3VibWl0JywgZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIGVGb3JtLiRzdWJtaXQoKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgICAgLy8gY2xpY2sgLSBtYXJrIGZvcm0gYXMgY2xpY2tlZCB0byBleGNsdWRlIGluIGRvY3VtZW50IGNsaWNrIGhhbmRsZXJcbiAgICAgICAgICAgIGVsZW0uYmluZCgnY2xpY2snLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgIC8vIGlnbm9yZSByaWdodC9taWRkbGUgYnV0dG9uIGNsaWNrXG4gICAgICAgICAgICAgIGlmIChlLndoaWNoICYmIGUud2hpY2ggIT09IDEpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBpZiAoZUZvcm0uJHZpc2libGUpIHtcb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vL2FsbCByZXNvbHZlZCAgICAgICBcbiAgICAgICAgICAgIGZ1bmN0aW9uKHJlc3VsdHMpIHtcbiAgICAgICAgICAgICAgb25XYWl0KGZhbHNlKTtcbiAgICAgICAgICAgICAgLy9jaGVjayBhbGwgcmVzdWx0cyB2aWEgc2FtZSBgd2hlbmAgbWV0aG9kICh3aXRob3V0IGNoZWNraW5nIHByb21pc2VzKVxuICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gocmVzdWx0cywgZnVuY3Rpb24ocmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgc2VsZi53aGVuKHJlc3VsdCwgdHJ1ZSk7ICBcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGFwcGx5Q2FsbGJhY2soKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvL3NvbWUgcmVqZWN0ZWRcbiAgICAgICAgICAgIGZ1bmN0aW9uKGVycm9yKSB7IFxuICAgICAgICAgICAgICBvbldhaXQoZmFsc2UpO1xuICAgICAgICAgICAgICBvblN0cmluZygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBhcHBseUNhbGxiYWNrKCk7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBhcHBseUNhbGxiYWNrKCkge1xuICAgICAgICAgIGlmICghc2VsZi5oYXNTdHJpbmcgJiYgIXNlbGYuaGFzRmFsc2UpIHtcbiAgICAgICAgICAgIG9uVHJ1ZSgpO1xuICAgICAgICAgIH0gZWxzZSBpZiAoIXNlbGYuaGFzU3RyaW5nICYmIHNlbGYuaGFzRmFsc2UpIHtcbiAgICAgICAgICAgIG9uRmFsc2UoKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb25TdHJpbmcoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgfVxuICAgIH07XG4gIH1cblxuICByZXR1cm4gcHJvbWlzZUNvbG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0YW5jZSkge1xuICAgICAgICAgICAgZGVsdGEgPSB7dmFsdWU6IG9wdFZhbHVlLCBkaXN0YW5jZTogZGlzdGFuY2V9O1xuICAgICAgICAgIH0gXG4gICAgICAgIH0pOyBcbiAgICAgICAgcmV0dXJuIGRlbHRhLnZhbHVlO1xuICAgICAgfVxuICAgICAgXG4gICAgICBpZihkdC5pc1ZhbGlkKCkpIHtcbiAgICAgICAgLy9yZWFkIHZhbHVlcyBmcm9tIGRhdGUgb2JqZWN0XG4gICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm1hcCwgZnVuY3Rpb24odiwgaykge1xuICAgICAgICAgIGlmKGsgPT09ICdhbXBtJykge1xuICAgICAgICAgICAgcmV0dXJuOyBcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFsdWVzW2tdID0gZHRbdlsxXV0oKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgaWYodGhpcy4kYW1wbSkge1xuICAgICAgICAgIC8vMTI6MDAgcG0gLS0+IDEyOjAwICgyNC1oIGZvcm1hdCwgbWlkZGF5KSwgMTI6MDAgYW0gLS0+IDAwOjAwICgyNC1oIGZvcm1hdCwgbWlkbmlnaHQsIHN0YXJ0IG9mIGRheSlcbiAgICAgICAgICBpZih2YWx1ZXMuaG91ciA+PSAxMikge1xuICAgICAgICAgICAgdmFsdWVzLmFtcG0gPSAncG0nO1xuICAgICAgICAgICAgaWYodmFsdWVzLmhvdXIgPiAxMikge1xuICAgICAgICAgICAgICB2YWx1ZXMuaG91ciAtPSAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVzLmFtcG0gPSAnYW0nO1xuICAgICAgICAgICAgaWYodmFsdWVzLmhvdXIgPT09IDApIHtcbiAgICAgICAgICAgICAgdmFsdWVzLmhvdXIgPSAxMjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBhbmd1bGFyLmZvckVhY2godmFsdWVzLCBmdW5jdGlvbih2LCBrKSB7XG4gICAgICAgICAgLy9jYWxsIHZhbCgpIGZvciBlYWNoIGV4aXN0aW5nIGNvbWJvLCBlLmcuIHRoaXMuJGhvdXIudmFsKClcbiAgICAgICAgICBpZih0aGF0WyckJytrXSkge1xuXG4gICAgICAgICAgICBpZihrID09PSAnbWludXRlJyAmJiB0aGF0Lm9wdGlvbnMubWludXRlU3RlcCA+IDEgJiYgdGhhdC5vcHRpb25zLnJvdW5kVGltZSkge1xuICAgICAgICAgICAgIHYgPSBnZXROZWFyZXN0KHRoYXRbJyQnK2tdLCB2KTtcbiAgICAgICAgICAgfVxuICAgICAgICAgICBcbiAgICAgICAgICAgaWYoayA9PT0gJ3NlY29uZCcgJiYgdGhhdC5vcHRpb25zLnNlY29uZFN0ZXAgPiAxICYmIHRoYXQub3B0aW9ucy5yb3VuZFRpbWUpIHtcbiAgICAgICAgICAgICB2ID0gZ2V0TmVhcmVzdCh0aGF0WyckJytrXSwgdik7XG4gICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICBcbiAgICAgICAgICAgdGhhdFsnJCcra10udmFsKHYpO1xuICAgICAgICAgfVxuICAgICAgIH0pO1xuXG4gICAgICAgIC8vIHVwZGF0ZSBkYXlzIGNvdW50XG4gICAgICAgIGlmICh0aGlzLm9wdGlvbnMuc21hcnREYXlzKSB7XG4gICAgICAgICAgdGhpcy5maWxsQ29tYm8oJ2RheScpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy4kZWxlbWVudC52YWwoZHQuZm9ybWF0KHRoaXMub3B0aW9ucy5mb3JtYXQpKS50cmlnZ2VySGFuZGxlcignY2hhbmdlJyk7XG4gICAgICB9XG4gICAgfSxcbiAgICBcbiAgICAvKlxuICAgICBoaWdobGlnaHQgY29tYm9zIGlmIGRhdGUgaXMgaW52YWxpZFxuICAgICAqL1xuICAgICBoaWdobGlnaHQ6IGZ1bmN0aW9uKGR0KSB7X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AgICAgICAgICAgdGhpcy5pbnB1dEVsLmFkZENsYXNzKCdmb3JtLWNvbnRyb2wnKTtcbiAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXRFbC5hdHRyKCduZy1jbGFzcycsIFwieydpcy1pbnZhbGlkJzogJGVycm9yfVwiKTtcbiAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnRoZW1lLmlucHV0Q2xhc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBkb25gdCBhcHBseSBgZm9ybS1jb250cm9sLXNtYCBhbmQgYGZvcm0tY29udHJvbC1sZ2AgdG8gc2VsZWN0IG11bHRpcGxlXG4gICAgICAgICAgICAgICAgICAgICAgLy8gc2hvdWxkIGJlIGZpeGVkIGluIGJzIGl0c2VsZiFcbiAgICAgICAgICAgICAgICAgICAgICBpZih0aGlzLmlucHV0RWwuYXR0cignbXVsdGlwbGUnKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAodGhpcy50aGVtZS5pbnB1dENsYXNzID09PSAnZm9ybS1jb250cm9sLXNtJyB8fCB0aGlzLnRoZW1lLmlucHV0Q2xhc3MgPT09ICdmb3JtLWNvbnRyb2wtbGcnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dEVsLmFkZENsYXNzKHRoaXMudGhlbWUuaW5wdXRDbGFzcyk7XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgY2FzZSAnZWRpdGFibGVDaGVja2JveCc6XG4gICAgICAgICAgICAgICAgICB0aGlzLmVkaXRvckVsLmFkZENsYXNzKCdmb3JtLWNoZWNrJyk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy9hcHBseSBidXR0b25zQ2xhc3MgKGJzNCBzcGVjaWZpYyEpXG4gICAgICAgICAgaWYodGhpcy5idXR0b25zRWw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XNlIHRoZSBjb250cm9sbGVyIGRvZXMgbm90IGZhaWwgdG9cbiAgICAgICAgICAgICAgaW5zdGFudGlhdGUsIGJ5IHVzaW5nIGV4cGxpY2l0IGFubm90YXRpb24gc3R5bGUgKHNlZVxuICAgICAgICAgICAgICBzY3JpcHQuanMgZm9yIGRldGFpbHMpXG4gICAgICAgICAgIDwvcD5cbiAgICAgICA8L2Rpdj5cblxuICAgICAgIDxkaXYgbmctY29udHJvbGxlcj1cIkdvb2RDb250cm9sbGVyMlwiPlxuICAgICAgICAgICBOYW1lOiA8aW5wdXQgbmctbW9kZWw9XCJuYW1lXCI+PGJyIC8+XG4gICAgICAgICAgIEhlbGxvLCB7e25hbWV9fSFcblxuICAgICAgICAgICA8cD5UaGlzIHJlbmRlcnMgYmVjYXVzZSB0aGUgY29udHJvbGxlciBkb2VzIG5vdCBmYWlsIHRvXG4gICAgICAgICAgICAgIGluc3RhbnRpYXRlLCBieSB1c2luZyBleHBsaWNpdCBhbm5vdGF0aW9uIHN0eWxlXG4gICAgICAgICAgICAgIChzZWUgc2NyaXB0LmpzIGZvciBkZXRhaWxzKVxuICAgICAgICAgICA8L3A+XG4gICAgICAgPC9kaXY+XG5cbiAgICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9XCJCYWRDb250cm9sbGVyXCI+XG4gICAgICAgICAgIEkgY2FuIGFkZDoge3thfX0gKyB7e2J9fSA9ICB7eyBhK2IgfX1cblxuICAgICAgICAgICA8cD5UaGUgY29udHJvbGxlciBjb3VsZCBub3QgYmUgaW5zdGFudGlhdGVkLCBkdWUgdG8gcmVseWluZ1xuICAgICAgICAgICAgICBvbiBhdXRvbWF0aWMgZnVuY3Rpb24gYW5ub3RhdGlvbnMgKHdoaWNoIGFyZSBkaXNhYmxlZCBpblxuICAgICAgICAgICAgICBzdHJpY3QgbW9kZSkuIEFzIHN1Y2gsIHRoZSBjb250ZW50IG9mIHRoaXMgc2VjdGlvbiBpcyBub3RcbiAgICAgICAgICAgICAgaW50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Zvcm1hdGlvbiBhYm91dCB0aGUgbW9kdWxlXG4gICAgICAgICAgICogQHJldHVybnMge09iamVjdHxNb2R1bGV9IFRoZSBjdXJyZW50IGluZm8gb2JqZWN0IGZvciB0aGlzIG1vZHVsZSBpZiBjYWxsZWQgYXMgYSBnZXR0ZXIsXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgIG9yIGB0aGlzYCBpZiBjYWxsZWQgYXMgYSBzZXR0ZXIuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBSZWFkIGFuZCB3cml0ZSBjdXN0b20gaW5mb3JtYXRpb24gYWJvdXQgdGhpcyBtb2R1bGUuXG4gICAgICAgICAgICogRm9yIGV4YW1wbGUgeW91IGNvdWxkIHB1dCB0aGUgdmVyc2lvbiBvZiB0aGUgbW9kdWxlIGluIGhlcmUuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBqc1xuICAgICAgICAgICAqIGFuZ3VsYXIubW9kdWxlKCdteU1vZHVsZScsIFtdKS5pbmZvKHsgdmVyc2lvbjogJzEuMC4wJyB9KTtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFRoZSB2ZXJzaW9uIGNvdWxkIHRoZW4gYmUgcmVhZCBiYWNrIG91dCBieSBhY2Nlc3NpbmcgdGhlIG1vZHVsZSBlbHNld2hlcmU6XG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKiB2YXIgdmVyc2lvbiA9IGFuZ3VsYXIubW9kdWxlKCdteU1vZHVsZScpLmluZm8oKS52ZXJzaW9uO1xuICAgICAgICAgICAqIGBgYFxuICAgICAgICAgICAqXG4gICAgICAgICAgICogWW91IGNhbiBhbHNvIHJldHJpZXZlIHRoaXMgaW5mb3JtYXRpb24gZHVyaW5nIHJ1bnRpbWUgdmlhIHRoZVxuICAgICAgICAgICAqIHtAbGluayAkaW5qZWN0b3IjbW9kdWxlcyBgJGluamVjdG9yLm1vZHVsZXNgfSBwcm9wZXJ0eTpcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIGBgYGpzXG4gICAgICAgICAgICogdmFyIHZlcnNpb24gPSAkaW5qZWN0b3IubW9kdWxlc1snbXlNb2R1bGUnXS5pbmZvKCkudmVyc2lvbjtcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKi9cbiAgICAgICAgICBpbmZvOiBmdW5jdGlvbih2YWx1ZSkge1xuICAgICAgICAgICAgaWYgKGlzRGVmaW5lZCh2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgaWYgKCFpc09iamVjdCh2YWx1ZSkpIHRocm93IG5nTWluRXJyKCdhb2JqJywgJ0FyZ3VtZW50IFxcJ3swfVxcJyBtdXN0IGJlIGFuIG9iamVjdCcsICd2YWx1ZScpO1xuICAgICAgICAgICAgICBpbmZvID0gdmFsdWU7XG4gICAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGluZm87XG4gICAgICAgICAgfSxcblxuICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBwcm9wZXJ0eVxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3JlcXVpcmVzXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogSG9sZHMgdGhlIGxpc3Qgb2YgbW9kdWxlcyB3aGljaCB0aGUgaW5qZWN0b3Igd2lsbCBsb2FkIGJlZm9yZSB0aGUgY3VycmVudCBtb2R1bGUgaXNcbiAgICAgICAgICAgKiBsb2FkZWQuXG4gICAgICAgICAgICovXG4gICAgICAgICAgcmVxdWlyZXM6IHJlcXVpcmVzLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIHByb3BlcnR5XG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjbmFtZVxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIE5hbWUgb2YgdGhlIG1vZHVsZS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBuYW1lOiBuYW1lLFxuXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjcHJvdmlkZXJcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gcHJvdmlkZXJUeXBlIENvbnN0cnVjdGlvbiBmdW5jdGlvbiBmb3IgY3JlYXRpbmcgbmV3IGluc3RhbmNlIG9mIHRoZVxuICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNwcm92aWRlciAkcHJvdmlkZS5wcm92aWRlcigpfS5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBwcm92aWRlcjogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckcHJvdmlkZScsICdwcm92aWRlcicpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2ZhY3RvcnlcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgc2VydmljZSBuYW1lXG4gICAgICAgICAgICogQHBhcm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3N0cmluZ30gbmFtZSBzZXJ2aWNlIG5hbWVcbiAgICAgICAgICAgKiBAcGFyYW0geyp9IG9iamVjdCBTZXJ2aWNlIGluc3RhbmNlIG9iamVjdC5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBTZWUge0BsaW5rIGF1dG8uJHByb3ZpZGUjdmFsdWUgJHByb3ZpZGUudmFsdWUoKX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgdmFsdWU6IGludm9rZUxhdGVyKCckcHJvdmlkZScsICd2YWx1ZScpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2NvbnN0YW50XG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIGNvbnN0YW50IG5hbWVcbiAgICAgICAgICAgKiBAcGFyYW0geyp9IG9iamVjdCBDb25zdGFudCB2YWx1ZS5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBCZWNhdXNlIHRoZSBjb25zdGFudHMgYXJlIGZpeGVkLCB0aGV5IGdldCBhcHBsaWVkIGJlZm9yZSBvdGhlciBwcm92aWRlIG1ldGhvZHMuXG4gICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI2NvbnN0YW50ICRwcm92aWRlLmNvbnN0YW50KCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGNvbnN0YW50OiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAnY29uc3RhbnQnLCAndW5zaGlmdCcpLFxuXG4gICAgICAgICAgIC8qKlxuICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNkZWNvcmF0b3JcbiAgICAgICAgICAgKiBAbW9kdWxlIG5nXG4gICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgVGhlIG5hbWUgb2YgdGhlIHNlcnZpY2UgdG8gZGVjb3JhdGUuXG4gICAgICAgICAgICogQHBhcmFtIHtGdW5jdGlvbn0gZGVjb3JGbiBUaGlzIGZ1bmN0aW9uIHdpbGwgYmUgaW52b2tlZCB3aGVuIHRoZSBzZXJ2aWNlIG5lZWRzIHRvIGJlXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICBpbnN0YW50aWF0ZWQgYW5kIHNob3VsZCByZXR1cm4gdGhlIGRlY29yYXRlZCBzZXJ2aWNlIGluc3RhbmNlLlxuICAgICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNkZWNvcmF0b3IgJHByb3ZpZGUuZGVjb3JhdG9yKCl9LlxuICAgICAgICAgICAqL1xuICAgICAgICAgIGRlY29yYXRvcjogaW52b2tlTGF0ZXJBbmRTZXRNb2R1bGVOYW1lKCckcHJvdmlkZScsICdkZWNvcmF0b3InLCBjb25maWdCbG9ja3MpLFxuXG4gICAgICAgICAgLyoqXG4gICAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI2FuaW1hdGlvblxuICAgICAgICAgICAqIEBtb2R1bGUgbmdcbiAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBhbmltYXRpb24gbmFtZVxuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGFuaW1hdGlvbkZhY3RvcnkgRmFjdG9yeSBmdW5jdGlvbiBmb3IgY3JlYXRpbmcgbmV3IGluc3RhbmNlIG9mIGFuXG4gICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiAqKk5PVEUqKjogYW5pbWF0aW9ucyB0YWtlIGVmZmVjdCBvbmx5IGlmIHRoZSAqKm5nQW5pbWF0ZSoqIG1vZHVsZSBpcyBsb2FkZWQuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIERlZmluZXMgYW4gYW5pbWF0aW9uIGhvb2sgdGhhdCBjYW4gYmUgbGF0ZXIgdXNlZCB3aXRoXG4gICAgICAgICAgICoge0BsaW5rICRhbmltYXRlICRhbmltYXRlfSBzZXJ2aWNlIGFuZCBkaXJlY3RpdmVzIHRoYXQgdXNlIHRoaXMgc2VydmljZS5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIGBgYGpzXG4gICAgICAgICAgICogbW9kdWxlLmFuaW1hdGlvbignLmFuaW1hdGlvbi1uYW1lJywgZnVuY3Rpb24oJGluamVjdDEsICRpbmplY3QyKSB7XG4gICAgICAgICAgICogICByZXR1cm4ge1xuICAgICAgICAgICAqICAgICBldmVudE5hbWUgOiBmdW5jdGlvbihlbGVtZW50LCBkb25lKSB7XG4gICAgICAgICAgICogICAgICAgLy9jb2RlIHRvIHJ1biB0aGUgYW5pbWF0aW9uXG4gICAgICAgICAgICogICAgICAgLy9vbmNlIGNvbXBsZXRlLCB0aGVuIHJ1biBkb25lKClcbiAgICAgICAgICAgKiAgICAgICByZXR1cm4gZnVuY3Rpb24gY2FuY2VsbGF0aW9uRnVuY3Rpb24oZWxlbWVudCkge1xuICAgICAgICAgICAqICAgICAgICAgLy9jb2RlIHRvIGNhbmNlbCB0aGUgYW5pbWF0aW9uXG4gICAgICAgICAgICogICAgICAgfVxuICAgICAgICAgICAqICAgICB9XG4gICAgICAgICAgICogICB9XG4gICAgICAgICAgICogfSlcbiAgICAgICAgICAgKiBgYGBcbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIFNlZSB7QGxpbmsgbmcuJGFuaW1hdGVQcm92aWRlciNyZWdpc3RlciAkYW5pbWF0ZVByb3ZpZGVyLnJlZ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C4gVXNlZnVsIGZvciBzZXJ2aWNlXG4gICAgICAgICAgICogICAgY29uZmlndXJhdGlvbi5cbiAgICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICAgKiBVc2UgdGhpcyBtZXRob2QgdG8gY29uZmlndXJlIHNlcnZpY2VzIGJ5IGluamVjdGluZyB0aGVpclxuICAgICAgICAgICAqIHtAbGluayBhbmd1bGFyLk1vZHVsZSNwcm92aWRlciBgcHJvdmlkZXJzYH0sIGUuZy4gZm9yIGFkZGluZyByb3V0ZXMgdG8gdGhlXG4gICAgICAgICAgICoge0BsaW5rIG5nUm91dGUuJHJvdXRlUHJvdmlkZXIgJHJvdXRlUHJvdmlkZXJ9LlxuICAgICAgICAgICAqXG4gICAgICAgICAgICogTm90ZSB0aGF0IHlvdSBjYW4gb25seSBpbmplY3Qge0BsaW5rIGFuZ3VsYXIuTW9kdWxlI3Byb3ZpZGVyIGBwcm92aWRlcnNgfSBhbmRcbiAgICAgICAgICAgKiB7QGxpbmsgYW5ndWxhci5Nb2R1bGUjY29uc3RhbnQgYGNvbnN0YW50c2B9IGludG8gdGhpcyBmdW5jdGlvbi5cbiAgICAgICAgICAgKlxuICAgICAgICAgICAqIEZvciBtb3JlIGFib3V0IGhvdyB0byBjb25maWd1cmUgc2VydmljZXMsIHNlZVxuICAgICAgICAgICAqIHtAbGluayBwcm92aWRlcnMjcHJvdmlkZXItcmVjaXBlIFByb3ZpZGVyIFJlY2lwZX0uXG4gICAgICAgICAgICovXG4gICAgICAgICAgY29uZmlnOiBjb25maWcsXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjcnVuXG4gICAgICAgICAgICogQG1vZHVsZSBuZ1xuICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IGluaXRpYWxpemF0aW9uRm4gRXhlY3V0ZSB0aGlzIGZ1bmN0aW9uIGFmdGVyIGluamVjdG9yIGNyZWF0aW9uLlxuICAgICAgICAgICAqICAgIFVzZWZ1bCBmb3IgYXBwbGljYXRpb24gaW5pdGlhbGl6YXRpb24uXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogVXNlIHRoaXMgbWV0aG9kIHRvIHJlZ2lzdGVyIHdvcmsgd2hpY2ggc2hvdWxkIGJlIHBlcmZvcm1lZCB3aGVuIHRoZSBpbmplY3RvciBpcyBkb25lXG4gICAgICAgICAgICogbG9hZGluZyBhbGwgbW9kdWxlcy5cbiAgICAgICAgICAgKi9cbiAgICAgICAgICBydW46IGZ1bmN0aW9uKGJsb2NrKSB7XG4gICAgICAgICAgICBydW5CbG9ja3MucHVzaChibG9jayk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgaWYgKGNvbmZpZ0ZuKSB7XG4gICAgICAgICAgY29uZmlnKGNvbmZpZ0ZuKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBtb2R1bGVJbnN0YW5jZTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHByb3ZpZGVyXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBtZXRob2RcbiAgICAgICAgICogQHBhcmFtIHtTdHJpbmc9fSBpbnNlcnRNZXRob2RcbiAgICAgICAgICogQHJldHVybnMge2FuZ3VsYXIuTW9kdWxlfVxuICAgICAgICAgKi9cbiAgICAgICAgZnVuY3Rpb24gaW52b2tlTGF0ZXIocHJvdmlkZXIsIG1ldGhvZCwgaW5zZXJ0TWV0aG9kLCBxdWV1ZSkge1xuICAgICAgICAgIGlmICghcXVldWUpIHF1ZXVlID0gaW52b2tlUXVldWU7XG4gICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcXVldWVbaW5zZXJ0TWV0aG9kIHx8ICdwdXNoJ10oW3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GVzID0gbmV3IE5nTWFwKCksXG4gICAgICBwcm92aWRlckNhY2hlID0ge1xuICAgICAgICAkcHJvdmlkZToge1xuICAgICAgICAgICAgcHJvdmlkZXI6IHN1cHBvcnRPYmplY3QocHJvdmlkZXIpLFxuICAgICAgICAgICAgZmFjdG9yeTogc3VwcG9ydE9iamVjdChmYWN0b3J5KSxcbiAgICAgICAgICAgIHNlcnZpY2U6IHN1cHBvcnRPYmplY3Qoc2VydmljZSksXG4gICAgICAgICAgICB2YWx1ZTogc3VwcG9ydE9iamVjdCh2YWx1ZSksXG4gICAgICAgICAgICBjb25zdGFudDogc3VwcG9ydE9iamVjdChjb25zdGFudCksXG4gICAgICAgICAgICBkZWNvcmF0b3I6IGRlY29yYXRvclxuICAgICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBwcm92aWRlckluamVjdG9yID0gKHByb3ZpZGVyQ2FjaGUuJGluamVjdG9yID1cbiAgICAgICAgICBjcmVhdGVJbnRlcm5hbEluamVjdG9yKHByb3ZpZGVyQ2FjaGUsIGZ1bmN0aW9uKHNlcnZpY2VOYW1lLCBjYWxsZXIpIHtcbiAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzU3RyaW5nKGNhbGxlcikpIHtcbiAgICAgICAgICAgICAgcGF0aC5wdXNoKGNhbGxlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyAkaW5qZWN0b3JNaW5FcnIoJ3VucHInLCAnVW5rbm93biBwcm92aWRlcjogezB9JywgcGF0aC5qb2luKCcgPC0gJykpO1xuICAgICAgICAgIH0pKSxcbiAgICAgIGluc3RhbmNlQ2FjaGUgPSB7fSxcbiAgICAgIHByb3RvSW5zdGFuY2VJbmplY3RvciA9XG4gICAgICAgICAgY3JlYXRlSW50ZXJuYWxJbmplY3RvcihpbnN0YW5jZUNhY2hlLCBmdW5jdGlvbihzZXJ2aWNlTmFtZSwgY2FsbGVyKSB7XG4gICAgICAgICAgICB2YXIgcHJvdmlkZXIgPSBwcm92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G4gICAgICAgICAgaWYgKGNhY2hlW3NlcnZpY2VOYW1lXSA9PT0gSU5TVEFOVElBVElORykge1xuICAgICAgICAgICAgZGVsZXRlIGNhY2hlW3NlcnZpY2VOYW1lXTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdGhyb3cgZXJyO1xuICAgICAgICB9IGZpbmFsbHkge1xuICAgICAgICAgIHBhdGguc2hpZnQoKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuXG4gICAgZnVuY3Rpb24gaW5qZWN0aW9uQXJncyhmbiwgbG9jYWxzLCBzZXJ2aWNlTmFtZSkge1xuICAgICAgdmFyIGFyZ3MgPSBbXSxcbiAgICAgICAgICAkaW5qZWN0ID0gY3JlYXRlSW5qZWN0b3IuJCRhbm5vdGF0ZShmbiwgc3RyaWN0RGksIHNlcnZpY2VOYW1lKTtcblxuICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbmd0aCA9ICRpbmplY3QubGVuZ3RoOyBpIDwgbGVuZ3RoOyBpKyspIHtcbiAgICAgICAgdmFyIGtleSA9ICRpbmplY3RbaV07XG4gICAgICAgIGlmICh0eXBlb2Yga2V5ICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgIHRocm93ICRpbmplY3Rvck1pbkVycignaXRrbicsXG4gICAgICAgICAgICAgICAgICAnSW5jb3JyZWN0IGluamVjdGlvbiB0b2tlbiEgRXhwZWN0ZWQgc2VydmljZSBuYW1lIGFzIHN0cmluZywgZ290IHswfScsIGtleSk7XG4gICAgICAgIH1cbiAgICAgICAgYXJncy5wdXNoKGxvY2FscyAmJiBsb2NhbHMuaGFzT3duUHJvcGVydHkoa2V5KSA/IGxvY2Fsc1trZXldIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldFNlcnZpY2Uoa2V5LCBzZXJ2aWNlTmFtZSkpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGFyZ3M7XG4gICAgfVxuXG4gICA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hvclNjcm9sbCwgJGxvY2F0aW9uLCAkc2NvcGUpIHtcbiAgICAgICAgICAgICAgICRzY29wZS5nb3RvQW5jaG9yID0gZnVuY3Rpb24oeCkge1xuICAgICAgICAgICAgICAgICB2YXIgbmV3SGFzaCA9ICdhbmNob3InICsgeDtcbiAgICAgICAgICAgICAgICAgaWYgKCRsb2NhdGlvbi5oYXNoKCkgIT09IG5ld0hhc2gpIHtcbiAgICAgICAgICAgICAgICAgICAvLyBzZXQgdGhlICRsb2NhdGlvbi5oYXNoIHRvIGBuZXdIYXNoYCBhbmRcbiAgICAgICAgICAgICAgICAgICAvLyAkYW5jaG9yU2Nyb2xsIHdpbGwgYXV0b21hdGljYWxseSBzY3JvbGwgdG8gaXRcbiAgICAgICAgICAgICAgICAgICAkbG9jYXRpb24uaGFzaCgnYW5jaG9yJyArIHgpO1xuICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgIC8vIGNhbGwgJGFuY2hvclNjcm9sbCgpIGV4cGxpY2l0bHksXG4gICAgICAgICAgICAgICAgICAgLy8gc2luY2UgJGxvY2F0aW9uLmhhc2ggaGFzbid0IGNoYW5nZWRcbiAgICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7XG4gICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgfVxuICAgICAgICAgICBdKTtcbiAgICAgICA8L2ZpbGU+XG4gICAgICAgPGZpbGUgbmFtZT1cInN0eWxlLmNzc1wiPlxuICAgICAgICAgYm9keSB7XG4gICAgICAgICAgIHBhZGRpbmctdG9wOiA1MHB4O1xuICAgICAgICAgfVxuXG4gICAgICAgICAuYW5jaG9yIHtcbiAgICAgICAgICAgYm9yZGVyOiAycHggZGFzaGVkIERhcmtPcmNoaWQ7XG4gICAgICAgICAgIHBhZGRpbmc6IDEwcHggMTBweCAyMDBweCAxMHB4O1xuICAgICAgICAgfVxuXG4gICAgICAgICAuZml4ZWQta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WUpIHtcbiAgICAgICAgICAgIHZhciBoYXNDbGFzcyA9ICEhZXhpc3RpbmdbY2xhc3NOYW1lXTtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgIT09IGhhc0NsYXNzKSB7XG4gICAgICAgICAgICAgIGlmIChzdGF0dXMpIHtcbiAgICAgICAgICAgICAgICB0b0FkZCArPSAodG9BZGQubGVuZ3RoID8gJyAnIDogJycpICsgY2xhc3NOYW1lO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRvUmVtb3ZlICs9ICh0b1JlbW92ZS5sZW5ndGggPyAnICcgOiAnJykgKyBjbGFzc05hbWU7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGZvckVhY2goZWxlbWVudCwgZnVuY3Rpb24oZWxtKSB7XG4gICAgICAgICAgICBpZiAodG9BZGQpIHtcbiAgICAgICAgICAgICAganFMaXRlQWRkQ2xhc3MoZWxtLCB0b0FkZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodG9SZW1vdmUpIHtcbiAgICAgICAgICAgICAganFMaXRlUmVtb3ZlQ2xhc3MoZWxtLCB0b1JlbW92ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgcG9zdERpZ2VzdFF1ZXVlLmRlbGV0ZShlbGVtZW50KTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICBwb3N0RGlnZXN0RWxlbWVudHMubGVuZ3RoID0gMDtcbiAgICB9XG5cblxuICAgIGZ1bmN0aW9uIGFkZFJlbW92ZUNsYXNzZXNQb3N0RGlnZXN0KGVsZW1lbnQsIGFkZCwgcmVtb3ZlKSB7XG4gICAgICB2YXIgZGF0YSA9IHBvc3REaWdlc3RRdWV1ZS5nZXQoZWxlbWVudCkgfHwge307XG5cbiAgICAgIHZhciBjbGFzc2VzQWRkZWQgPSB1cGRhdGVEYXRhKGRhdGE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ICAgdGhpcy5ydW5uZXIgPSAkYW5pbWF0ZS5hZGRDbGFzcygkZWxlbWVudC5maW5kKCdkaXYnKSwgJ3JlZCcpO1xuICAgICAgICAgICAgICAgICAgdmFyIGN0cmwgPSB0aGlzO1xuICAgICAgICAgICAgICAgICAgdGhpcy5ydW5uZXIuZmluYWxseShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgY3RybC5ydW5uZXIgPSBudWxsO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlQ2xhc3MgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyID0gJGFuaW1hdGUucmVtb3ZlQ2xhc3MoJGVsZW1lbnQuZmluZCgnZGl2JyksICdyZWQnKTtcbiAgICAgICAgICAgICAgICAgIHZhciBjdHJsID0gdGhpcztcbiAgICAgICAgICAgICAgICAgIHRoaXMucnVubmVyLmZpbmFsbHkoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGN0cmwucnVubmVyID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB0aGlzLmNhbmNlbCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgJGFuaW1hdGUuY2FuY2VsKHRoaXMucnVubmVyKTtcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgICAgPGZpbGUgbmFtZT1cInRlbXBsYXRlLmh0bWxcIj5cbiAgICAgICAgICAgIDxwPlxuICAgICAgICAgICAgICA8YnV0dG9uIGlkPVwiYWRkXCIgbmctY2xpY2s9XCIkY3RybC5hZGRDbGFzcygpXCI+QWRkPC9idXR0b24+XG4gICAgICAgICAgICAgIDxidXR0b24gbmctY2xpY2s9XCIkY3RybC5yZW1vdmVDbGFzcygpXCI+UmVtb3ZlPC9idXR0b24+XG4gICAgICAgICAgICAgIDxicj5cbiAgICAgICAgICAgICAgPGJ1dHRvbiBpZD1cImNhbmNlbFwiIG5nLWNsaWNrPVwiJGN0cmwuY2FuY2VsKClcIiBuZy1kaXNhYmxlZD1cIiEkY3RybC5ydW5uZXJcIj5DYW5jZWw8L2J1dHRvbj5cbiAgICAgICAgICAgICAgPGJyPlxuICAgICAgICAgICAgICA8ZGl2IGlkPVwidGFyZ2V0XCI+Q1NTLUFuaW1hdGVkIFRleHQ8L2Rpdj5cbiAgICAgICAgICAgIDwvcD5cbiAgICAgICAgICA8L2ZpbGU+XG4gICAgICAgICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAgICAgICAgICAgIDxjYW5jZWwtZXhhbXBsZT48L2NhbmNlbC1leGFtcGxlPlxuICAgICAgICAgIDwvZmlsZT5cbiAgICAgICAgICA8ZmlsZSBuYW1lPVwic3R5bGUuY3NzXCI+XG4gICAgICAgICAgICAucmVkLWFkZCwgLnJlZC1yZW1vdmUge1xuICAgICAgICAgICAgICB0cmFuc2l0aW9uOiBhbGwgNHMgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlZCxcbiAgICAgICAgICAgIC5yZWQtYWRkLnJlZC1hZGQtYWN0aXZlIHtcbiAgICAgICAgICAgICAgY29sb3I6ICNGRjAwMDA7XG4gICAgICAgICAgICAgIGZvbnQtc2l6ZTogNDBweDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLnJlZC1yZW1vdmUucmVkLXJlbW92ZS1hY3RpdmUge1xuICAgICAgICAgICAgICBmb250LXNpemU6IDEwcHg7XG4gICAgICAgICAgICAgIGNvbG9yOiBibGFjaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIDwvZmlsZT5cbiAg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biA9IGZ1bmN0aW9uKGNoYWluLCBjYWxsYmFjaykge1xuICAgICAgdmFyIGluZGV4ID0gMDtcblxuICAgICAgbmV4dCgpO1xuICAgICAgZnVuY3Rpb24gbmV4dCgpIHtcbiAgICAgICAgaWYgKGluZGV4ID09PSBjaGFpbi5sZW5ndGgpIHtcbiAgICAgICAgICBjYWxsYmFjayh0cnVlKTtcbiAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBjaGFpbltpbmRleF0oZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICBpZiAocmVzcG9uc2UgPT09IGZhbHNlKSB7XG4gICAgICAgICAgICBjYWxsYmFjayhmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgfVxuICAgICAgICAgIGluZGV4Kys7XG4gICAgICAgICAgbmV4dCgpO1xuICAgICAgICB9KTtcbiAgICAgIH1cbiAgICB9O1xuXG4gICAgQW5pbWF0ZVJ1bm5lci5hbGwgPSBmdW5jdGlvbihydW5uZXJzLCBjYWxsYmFjaykge1xuICAgICAgdmFyIGNvdW50ID0gMDtcbiAgICAgIHZhciBzdGF0dXMgPSB0cnVlO1xuICAgICAgZm9yRWFjaChydW5uZXJzLCBmdW5jdGlvbihydW5uZXIpIHtcbiAgICAgICAgcnVubmVyLmRvbmUob25Qcm9ncmVzcyk7XG4gICAgICB9KTtcblxuICAgICAgZnVuY3Rpb24gb25Qcm9ncmVzcyhyZXNwb25zZSkge1xuICAgICAgICBzdGF0dXMgPSBzdGF0dXMgJiYgcmVzcG9uc2U7XG4gICAgICAgIGlmICgrK2NvdW50ID09PSBydW5uZXJzLmxlbmd0aCkge1xuICAgICAgICAgIGNhbGxiYWNrKHN0YXR1cyk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9O1xuXG4gICAgZnVuY3Rpb24gQW5pbWF0ZVJ1bm5lcihob3N0KSB7XG4gICAgICB0aGlzLnNldEhvc3QoaG9zdCk7XG5cbiAgICAgIHZhciByYWZUaWNrID0gJCRhbmltYXRlQXN5bmNSdW4oKTtcbiAgICAgIHZhciB0aW1lb3V0VGljayA9IGZ1bmN0aW9uKGZuKSB7XG4gICAgICAgICR0aW1lb3V0KGZuLCAwLCBmYWxzZSk7XG4gICAgICB9O1xuXG4gICAgICB0aGlzLl9kb25lQ2FsbGJhY2tzID0gW107XG4gICAgICB0aGlzLl90aWNrID0gZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgaWYgKCQkaXNEb2N1bWVudEhpZGRlbigpKSB7XG4gICAgICAgICAgdGltZW91dFRpY2soZm4pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJhZlRpY2soZm4pO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgdGhpcy5fc3RhdGUgPSAwO1xuICAgIH1cblxuICAgIEFuaW1hdGVSdW5uZXIucHJvdG90eXBlID0ge1xuICAgICAgc2V0SG9zdDogZnVuY3Rpb24oaG9zdCkge1xuICAgICAgICB0aGlzLmhvc3QgPSBob3N0IHx8IHt9O1xuICAgICAgfSxcblxuICAgICAgZG9uZTogZnVuY3Rpb24oZm4pIHtcbiAgICAgICAgaWYgKHRoaXMuX3N0YXRlID09PSBET05FX0NPTVBMRVRFX1NUQVRFKSB7XG4gICAgICAgICAgZm4oKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB0aGlzLl9kb25lQ2FsbGJhY2tzLnB1c2goZm4pO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICBwcm9ncmVzczogbm9vcCxcblxuICAgICAgZ2V0UHJvbWlzZTogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICghdGhpcy5wcm9taXNlKSB7XG4gICAgICAgICAgdmFyIHNlbGYgPSB0aGlzO1xuICAgICAgICAgIHRoaXMucHJvbWlzZSA9ICRxKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgc2VsZi5kb25lKGZ1bmN0aW9uKHN0YXR1cykge1xuICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSBmYWxzZSkge1xuICAgICAgICAgICAgICAgIHJlamVjdCgpO1xuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucHJvbWlzZTtcbiAgICAgIH0sXG5cbiAgICAgIHRoZW46IGZ1bmN0aW9uKHJlc29sdmVIYW5kbGVyLCByZWplY3RIYW5kbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb21pc2UoKS50aGVuKHJlc29sdmVIYW5kbGVyLCByZWplY3RIYW5kbGVyKTtcbiAgICAgIH0sXG5cbiAgICAgICdjYXRjaCc6IGZ1bmN0aW9uKGhhbmRsZXIpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZ2V0UHJvbWlzZSgpWydjYXRjaCddKGhhbmRsZXIpO1xuICAgICAgfSxcblxuICAgICAgJ2ZpbmFsbHknOiBmdW5jdGlvbihoYW5kbGVyKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmdldFByb21pc2UoKVsnZmluYWxseSddKGhhbmRsZXIpO1xuICAgICAgfSxcblxuICAgICAgcGF1c2U6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGhpcy5ob3N0LnBhdXNlKSB7XG4gICAgICAgICAgdGhpcy5ob3N0LnBhdXNlKCk7XG4gICAgICAgIH1cbiAgICAgIH0sXG5cbiAgICAgIHJlc3VtZTogZnVuY3Rpb24oKSB7XG4gICAgICAgIGlmICh0aGlzLmhvc3QucmVzdW1lKSB7XG4gICAgICAgICAgdGhpcy5ob3N0LnJlc3VtZSgpO1xuICAgICAgICB9XG4gICAgICB9LFxuXG4gICAgICBlbmQ6IGZ1bmN0aW9uKCkge1xuICAgICAgICBpZiAodGhpcy5ob3N0LmVuZCkge1xuICA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Bpbml0aWFsT3B0aW9ucyB8fCB7fTtcbiAgICAgIGlmICghb3B0aW9ucy4kJHByZXBhcmVkKSB7XG4gICAgICAgIG9wdGlvbnMgPSBjb3B5KG9wdGlvbnMpO1xuICAgICAgfVxuXG4gICAgICAvLyB0aGVyZSBpcyBubyBwb2ludCBpbiBhcHBseWluZyB0aGUgc3R5bGVzIHNpbmNlXG4gICAgICAvLyB0aGVyZSBpcyBubyBhbmltYXRpb24gdGhhdCBnb2VzIG9uIGF0IGFsbCBpblxuICAgICAgLy8gdGhpcyB2ZXJzaW9uIG9mICRhbmltYXRlQ3NzLlxuICAgICAgaWYgKG9wdGlvbnMuY2xlYW51cFN0eWxlcykge1xuICAgICAgICBvcHRpb25zLmZyb20gPSBvcHRpb25zLnRvID0gbnVsbDtcbiAgICAgIH1cblxuICAgICAgaWYgKG9wdGlvbnMuZnJvbSkge1xuICAgICAgICBlbGVtZW50LmNzcyhvcHRpb25zLmZyb20pO1xuICAgICAgICBvcHRpb25zLmZyb20gPSBudWxsO1xuICAgICAgfVxuXG4gICAgICB2YXIgY2xvc2VkLCBydW5uZXIgPSBuZXcgJCRBbmltYXRlUnVubmVyKCk7XG4gICAgICByZXR1cm4ge1xuICAgICAgICBzdGFydDogcnVuLFxuICAgICAgICBlbmQ6IHJ1blxuICAgICAgfTtcblxuICAgICAgZnVuY3Rpb24gcnVuKCkge1xuICAgICAgICAkJHJBRihmdW5jdGlvbigpIHtcbiAgICAgICAgICBhcHBseUFuaW1hdGlvbkNvbnRlbnRzKCk7XG4gICAgICAgICAgaWYgKCFjbG9zZWQpIHtcbiAgICAgICAgICAgIHJ1bm5lci5jb21wbGV0ZSgpO1xuICAgICAgICAgIH1cbiAgICAgICAgICBjbG9zZWQgPSB0cnVlO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHJ1bm5lcjtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gYXBwbHlBbmltYXRpb25Db250ZW50cygpIHtcbiAgICAgICAga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YFxuICAgICAgICpcbiAgICAgICAqIEV4YW1wbGUgdGVzdDpcbiAgICAgICAqXG4gICAgICAgKiBgYGBqc1xuICAgICAgICogIGl0KCdzaG91bGQgYmVoYXZlIGxpa2UgYSBjYWNoZScsIGluamVjdChmdW5jdGlvbihzdXBlckNhY2hlKSB7XG4gICAgICAgKiAgICBzdXBlckNhY2hlLnB1dCgna2V5JywgJ3ZhbHVlJyk7XG4gICAgICAgKiAgICBzdXBlckNhY2hlLnB1dCgnYW5vdGhlciBrZXknLCAnYW5vdGhlciB2YWx1ZScpO1xuICAgICAgICpcbiAgICAgICAqICAgIGV4cGVjdChzdXBlckNhY2hlLmluZm8oKSkudG9FcXVhbCh7XG4gICAgICAgKiAgICAgIGlkOiAnc3VwZXItY2FjaGUnLFxuICAgICAgICogICAgICBzaXplOiAyXG4gICAgICAgKiAgICB9KTtcbiAgICAgICAqXG4gICAgICAgKiAgICBzdXBlckNhY2hlLnJlbW92ZSgnYW5vdGhlciBrZXknKTtcbiAgICAgICAqICAgIGV4cGVjdChzdXBlckNhY2hlLmdldCgnYW5vdGhlciBrZXknKSkudG9CZVVuZGVmaW5lZCgpO1xuICAgICAgICpcbiAgICAgICAqICAgIHN1cGVyQ2FjaGUucmVtb3ZlQWxsKCk7XG4gICAgICAgKiAgICBleHBlY3Qoc3VwZXJDYWNoZS5pbmZvKCkpLnRvRXF1YWwoe1xuICAgICAgICogICAgICBpZDogJ3N1cGVyLWNhY2hlJyxcbiAgICAgICAqICAgICAgc2l6ZTogMFxuICAgICAgICogICAgfSk7XG4gICAgICAgKiAgfSkpO1xuICAgICAgICogYGBgXG4gICAgICAgKi9cbiAgICAgIHJldHVybiAoY2FjaGVzW2NhY2hlSWRdID0ge1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjcHV0XG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG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uICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldIHx8IChscnVIYXNoW2tleV0gPSB7a2V5OiBrZXl9KTtcblxuICAgICAgICAgICAgcmVmcmVzaChscnVFbnRyeSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCEoa2V5IGluIGRhdGEpKSBzaXplKys7XG4gICAgICAgICAgZGF0YVtrZXldID0gdmFsdWU7XG5cbiAgICAgICAgICBpZiAoc2l6ZSA+IGNhcGFjaXR5KSB7XG4gICAgICAgICAgICB0aGlzLnJlbW92ZShzdGFsZUVuZC5rZXkpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgfSxcblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2dldFxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmV0cmlldmVzIG5hbWVkIGRhdGEgc3RvcmVkIGluIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0LlxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgb2YgdGhlIGRhdGEgdG8gYmUgcmV0cmlldmVkXG4gICAgICAgICAqIEByZXR1cm5zIHsqfSB0aGUgdmFsdWUgc3RvcmVkLlxuICAgICAgICAgKi9cbiAgICAgICAgZ2V0OiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICBpZiAoY2FwYWNpdHkgPCBOdW1iZXIuTUFYX1ZBTFVFKSB7XG4gICAgICAgICAgICB2YXIgbHJ1RW50cnkgPSBscnVIYXNoW2tleV07XG5cbiAgICAgICAgICAgIGlmICghbHJ1RW50cnkpIHJldHVybjtcblxuICAgICAgICAgICAgcmVmcmVzaChscnVFbnRyeSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGRhdGFba2V5XTtcbiAgICAgICAgfSxcblxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjcmVtb3ZlXG4gICAgICAgICAqIEBraW5kIGZ1bmN0aW9uXG4gICAgICAgICAqXG4gICAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICAgKiBSZW1vdmVzIGFuIGVudHJ5IGZyb20gdGhlIHtAbGluayAkY2FjaGVGYWN0b3J5LkNhY2hlIENhY2hlfSBvYmplY3QuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBrZXkgdGhlIGtleSBvZiB0aGUgZW50cnkgdG8gYmUgcmVtb3ZlZFxuICAgICAgICAgKi9cbiAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbihrZXkpIHtcbiAgICAgICAgICBpZiAoY2FwYWNpdHkgPCBOdW1iZXIuTUFYX1ZBTFVFKSB7XG4gICAgICAgICAgICB2YXIgbHJ1RW50cnkgPSBscnVIYXNoW2tleV07XG5cbiAgICAgICAgICAgIGlmICghbHJ1RW50cnkpIHJldHVybjtcblxuICAgICAgICAgICAgaWYgKGxydUVudHJ5ID09PSBmcmVzaEVuZCkgZnJlc2hFbmQgPSBscnVFbnRyeS5wO1xuICAgICAgICAgICAgaWYgKGxydUVudHJ5ID09PSBzdGFsZUVuZCkgc3RhbGVFbmQgPSBscnVFbnRyeS5uO1xuICAgICAgICAgICAgbGluayhscnVFbnRyeS5uLGxydUVudHJ5LnApO1xuXG4gICAgICAgICAgICBkZWxldGUgbHJ1SGFzaFtrZXldO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmICghKGtleSBpbiBkYXRhKSkgcmV0dXJuO1xuXG4gICAgICAgICAgZGVsZXRlIGRhdGFba2V5XTtcbiAgICAgICAgICBzaXplLS07XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZUFsbFxuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogQ2xlYXJzIHRoZSBjYWNoZSBvYmplY3Qgb2YgYW55IGVudHJpZXMuXG4gICAgICAgICAqL1xuICAgICAgICByZW1vdmVBbGw6IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGRhdGEgPSBjcmVhdGVNYXAoKTtcbiAgICAgICAgICBzaXplID0gMDtcbiAgICAgICAgICBscnVIYXNoID0gY3JlYXRlTWFwKCk7XG4gICAgICAgICAgZnJlc2hFbmQgPSBzdGFsZUVuZCA9IG51bGw7XG4gICAgICAgIH0sXG5cblxuICAgICAgICAvKipcbiAgICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2Rlc3Ryb3lcbiAgICAgICAgICogQGtpbmQgZnVuY3Rpb25cbiAgICAgICAgICpcbiAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAqIERlc3Ryb3lzIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0IGVudGlyZWx5LFxuICAgICAgICAgKiByZW1vdmluZyBpdCBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeSAkY2FjaGVGYWN0b3J5fSBzZXQuXG4gICAgICAgICAqL1xuICAgICAgICBkZXN0cm95OiBmdW5jdGlvbigpIHtcbiAgICAgICAgICBkYXRhID0gbnVsbDtcbiAgICAgICAgICBzdGF0cyA9IG51bGw7XG4gICAgICAgICAgbHJ1SGFzaCA9IG51bGw7XG4gICAgICAgICAgZGVsZXRlIGNhY2hlc1tjYWNoZUlkXTtcbiAgICAgICAgfSxcblxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjaW5mb1xuICAgICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICAgKlxuICAgICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAgICogUmV0cmlldmUgaW5mb3JtYXRpb24gcmVnYXJkaW5nIGEgcGFydGljdWxhciB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0uXG4gICAgICAgICAqXG4gICAgICAgICAqIEByZXR1cm5zIHtvYmplY3R9IGFuIG9iamVjdCB3aXRoIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczpcbiAgICAgICAgICogICA8dWw+XG4gICAgICAgICAqICAgICA8bGk+KippZCoqOiB0aGUgaWQgb2YgdGhlIGNhY2hlIGluc3RhbmNlPC9saT5cbiAgICAgICAgICogICAgIDxsaT4qKnNpemUqKjogdGhlIG51bWJlciBvZiBlbnRyaWVzIGtlcHQgaW4gdGhlIGNhY2hlIGluc3RhbmNlPC9saT5cbiAgICAgICAgICogICAgIDxsaT4qKi4uLioqOiBhbnkgYWRkaXRpb25hbCBwcm9wZXJ0aWVzIGZyb20gdGhlIG9wdGlvbnMgb2JqZWN0IHdoZW4gY3JlYXRpbmcgdGhlXG4gICAgICAgICAqICAgICAgIGNhY2hlLjwvbGk+XG4gICAgICAgICAqICAgPC91bD5cbiAgICAgICAgICovXG4gICAgICAgIGluZm86IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBleHRlbmQoe30sIHN0YXRzLCB7c2l6ZTogc2l6ZX0pO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuXG4gICAgICAvKipcbiAgICAgICAqIG1ha2VzIHRoZSBgZW50cnlgIHRoZSBmcmVzaEVuZCBv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dW5jdGlvbigkY2FjaGVGYWN0b3J5KSB7XG4gICAgcmV0dXJuICRjYWNoZUZhY3RvcnkoJ3RlbXBsYXRlcycpO1xuICB9XTtcbn1cblxuLyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKlxuICogICAgIEFueSBjb21taXRzIHRvIHRoaXMgZmlsZSBzaG91bGQgYmUgcmV2aWV3ZWQgd2l0aCBzZWN1cml0eSBpbiBtaW5kLiAgKlxuICogICBDaGFuZ2VzIHRvIHRoaXMgZmlsZSBjYW4gcG90ZW50aWFsbHkgY3JlYXRlIHNlY3VyaXR5IHZ1bG5lcmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgamF2YXNjcmlwdCB0byBiZSBleGVjdXRlZD8gKlxuICogICAgT3IgYWxsb3dzIGZvciBzb21lb25lIHRvIGNoYW5nZSB0aGUgcHJvdG90eXBlIG9mIGJ1aWx0LWluIG9iamVjdHM/ICAgKlxuICogICAgIE9yIGdpdmVzIHVuZGVzaXJlZCBhY2Nlc3MgdG8gdmFyaWFibGVzIGxpa2UgZG9jdW1lbnQgb3Igd2luZG93PyAgICAqXG4gKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqL1xuXG4vKiAhIFZBUklBQkxFL0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qICAgICAgIHtAbGluayAkY29tcGlsZSMtdHJhbnNjbHVkZS0gdHJhbnNjbHVkZX06IGZhbHNlLFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1yZXN0cmljdC0gcmVzdHJpY3R9OiAnQScsXG4gKiAgICAgICB7QGxpbmsgJGNvbXBpbGUjLXRlbXBsYXRlbmFtZXNwYWNlLSB0ZW1wbGF0ZU5hbWVzcGFjZX06ICdodG1sJyxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtc2NvcGUtIHNjb3BlfTogZmFsc2UsXG4gKiAgICAgICB7QGxpbmsgJGNvbXBpbGUjLWNvbnRyb2xsZXItIGNvbnRyb2xsZXJ9OiBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMsICR0cmFuc2NsdWRlLCBvdGhlckluamVjdGFibGVzKSB7IC4uLiB9LFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1jb250cm9sbGVyYXMtIGNvbnRyb2xsZXJBc306ICdzdHJpbmdJZGVudGlmaWVyJyxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtYmluZHRvY29udHJvbGxlci0gYmluZFRvQ29udHJvbGxlcn06IGZhbHNlLFxuICogICAgICAge0BsaW5rICRjb21waWxlIy1yZXF1aXJlLSByZXF1aXJlfTogJ3NpYmxpbmdEaXJlY3RpdmVOYW1lJywgLy8gb3IgLy8gWydecGFyZW50RGlyZWN0aXZlTmFtZScsICc/b3B0aW9uYWxEaXJlY3RpdmVOYW1lJywgJz9eb3B0aW9uYWxQYXJlbnQnXSxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtbXVsdGllbGVtZW50LSBtdWx0aUVsZW1lbnR9OiBmYWxzZSxcbiAqICAgICAgIHtAbGluayAkY29tcGlsZSMtY29tcGlsZS0gY29tcGlsZX06IGZ1bmN0aW9uIGNvbXBpbGUodEVsZW1lbnQsIHRBdHRycywgdHJhbnNjbHVkZSkge1xuICogICAgICAgICByZXR1cm4ge1xuICogICAgICAgICAgICB7QGxpbmsgJGNvbXBpbGUjcHJlLWxpbmtpbmctZnVuY3Rpb24gcHJlfTogZnVuY3Rpb24gcHJlTGluayhzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeyAuLi4gfSxcbiAqICAgICAgICAgICAge0BsaW5rICRjb21waWxlI3Bvc3QtbGlua2luZy1mdW5jdGlvbiBwb3N0fTogZnVuY3Rpb24gcG9zdExpbmsoc2NvcGUsIGlFbGVtZW50LCBpQXR0cnMsIGNvbnRyb2xsZXIpIHsgLi4uIH1cbiAqICAgICAgICAgfVxuICogICAgICAgICAvLyBvclxuICogICAgICAgICAvLyByZXR1cm4gZnVuY3Rpb24gcG9zdExpbmsoIC4uLiApIHsgLi4uIH1cbiAqICAgICAgIH0sXG4gKiAgICAgICAvLyBvclxuICogICAgICAgLy8ge0BsaW5rICRjb21waWxlIy1saW5rLSBsaW5rfToge1xuICogICAgICAgLy8gIHtAbGluayAkY29tcGlsZSNwcmUtbGlua2luZy1mdW5jdGlvbiBwcmV9OiBmdW5jdGlvbiBwcmVMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9LFxuICogICAgICAgLy8gIHtAbGluayAkY29tcGlsZSNwb3N0LWxpbmtpbmctZnVuY3Rpb24gcG9zdH06IGZ1bmN0aW9uIHBvc3RMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9XG4gKiAgICAgICAvLyB9XG4gKiAgICAgICAvLyBvclxuICogICAgICAgLy8ge0BsaW5rICRjb21waWxlIy1saW5rLSBsaW5rfTogZnVuY3Rpb24gcG9zdExpbmsoIC4uLiApIHsgLi4uIH1cbiAqICAgICB9O1xuICogICAgIHJldHVybiBkaXJlY3RpdmVEZWZpbml0aW9uT2JqZWN0O1xuICogICB9KTtcbiAqIGBgYFxuICpcbiAqIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC13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GF0ZSB9fScgK1xuICogICAgICAgICAgICc8dGVzdCBkYXRlPVwiJGN0cmwuZGF0ZVwiPjwvdGVzdD4nLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICB0aGlzLmRhdGUgPSBuZXcgRGF0ZSgpO1xuICogICAgICAgICAgIHRoaXMubW9udGggPSB0aGlzLmRhdGUuZ2V0TW9udGgoKTtcbiAqICAgICAgICAgICB0aGlzLnVwZGF0ZURhdGUgPSBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICAgIHRoaXMuZGF0ZS5zZXRNb250aCh0aGlzLm1vbnRoKTtcbiAqICAgICAgICAgICB9O1xuICogICAgICAgICB9XG4gKiAgICAgICB9KVxuICogICAgICAgLmNvbXBvbmVudCgndGVzdCcsIHtcbiAqICAgICAgICAgYmluZGluZ3M6IHsgZGF0ZTogJzwnIH0sXG4gKiAgICAgICAgIHRlbXBsYXRlOlxuICogICAgICAgICAgICc8cHJlPnt7ICRjdHJsLmxvZyB8IGpzb24gfX08L3ByZT4nLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICB2YXIgcHJldmlvdXNWYWx1ZTtcbiAqICAgICAgICAgICB0aGlzLmxvZyA9IFtdO1xuICogICAgICAgICAgIHRoaXMuJGRvQ2hlY2sgPSBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICAgIHZhciBjdXJyZW50VmFsdWUgPSB0aGlzLmRhdGUgJiYgdGhpcy5kYXRlLnZhbHVlT2YoKTtcbiAqICAgICAgICAgICAgIGlmIChwcmV2aW91c1ZhbHVlICE9PSBjdXJyZW50VmFsdWUpIHtcbiAqICAgICAgICAgICAgICAgdGhpcy5sb2cucHVzaCgnZG9DaGVjazogZGF0ZSBtdXRhdGVkOiAnICsgdGhpcy5kYXRlKTtcbiAqICAgICAgICAgICAgICAgcHJldmlvdXNWYWx1ZSA9IGN1cnJlbnRWYWx1ZTtcbiAq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ICAgICA8L2Rpdj5cbiAqICAgPC9maWxlPlxuICogICA8ZmlsZSBuYW1lPVwiYXBwLmpzXCI+XG4gKiAgICAgIGFuZ3VsYXIubW9kdWxlKCdkby1jaGVjay1tb2R1bGUnLCBbXSlcbiAqICAgICAgICAuY29tcG9uZW50KCd0ZXN0Jywge1xuICogICAgICAgICAgYmluZGluZ3M6IHsgaXRlbXM6ICc8JyB9LFxuICogICAgICAgICAgdGVtcGxhdGU6XG4gKiAgICAgICAgICAgICc8cHJlPnt7ICRjdHJsLmxvZyB8IGpzb24gfX08L3ByZT4nLFxuICogICAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgIHRoaXMubG9nID0gW107XG4gKlxuICogICAgICAgICAgICB0aGlzLiRkb0NoZWNrID0gZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICAgICAgaWYgKHRoaXMuaXRlbXNfcmVmICE9PSB0aGlzLml0ZW1zKSB7XG4gKiAgICAgICAgICAgICAgICB0aGlzLmxvZy5wdXNoKCdkb0NoZWNrOiBpdGVtcyBjaGFuZ2VkJyk7XG4gKiAgICAgICAgICAgICAgICB0aGlzLml0ZW1zX3JlZiA9IHRoaXMuaXRlbXM7XG4gKiAgICAgICAgICAgICAgfVxuICogICAgICAgICAgICAgIGlmICghYW5ndWxhci5lcXVhbHModGhpcy5pdGVtc19jbG9uZSwgdGhpcy5pdGVtcykpIHtcbiAqICAgICAgICAgICAgICAgIHRoaXMubG9nLnB1c2goJ2RvQ2hlY2s6IGl0ZW1zIG11dGF0ZWQnKTtcbiAqICAgICAgICAgICAgICAgIHRoaXMuaXRlbXNfY2xvbmUgPSBhbmd1bGFyLmNvcHkodGhpcy5pdGVtcyk7XG4gKiAgICAgICAgICAgICAgfVxuICogICAgICAgICAgICB9O1xuICogICAgICAgICAgfVxuICogICAgICAgIH0pO1xuICogICA8L2ZpbGU+XG4gKiA8L2V4YW1wbGU+XG4gKlxuICpcbiAqICMjIyBEaXJl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lKCdleGFtcGxlTmdPbicsIFtdKVxuICogICAgICAgLmNvbXBvbmVudCgnbWFpbicsIHtcbiAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdtYWluLmh0bWwnLFxuICogICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHtcbiAqICAgICAgICAgICB0aGlzLmNsaWNrQ291bnQgPSAwO1xuICogICAgICAgICAgIHRoaXMubW91c2VvdmVyQ291bnQgPSAwO1xuICpcbiAqICAgICAgICAgICB0aGlzLmxvYWRpbmdTdGF0ZSA9IDA7XG4gKiAgICAgICAgIH1cbiAqICAgICAgIH0pO1xuICogICA8L2ZpbGU+XG4gKiAgIDxmaWxlIG5hbWU9XCJtYWluLmh0bWxcIj5cbiAqICAgICA8ZGl2PlxuICogICAgICAgVGhpcyBpcyBlcXVpdmFsZW50IHRvIGBuZ0NsaWNrYCBhbmQgYG5nTW91c2VvdmVyYDo8YnI+XG4gKiAgICAgICA8YnV0dG9uXG4gKiAgICAgICAgIG5nLW9uLWNsaWNrPVwiJGN0cmwuY2xpY2tDb3VudCA9ICRjdHJsLmNsaWNrQ291bnQgKyAxXCJcbiAqICAgICAgICAgbmctb24tbW91c2VvdmVyPVwiJGN0cmwubW91c2VvdmVyQ291bnQgPSAkY3RybC5tb3VzZW92ZXJDb3VudCArIDFcIj5DbGljayBvciBtb3VzZW92ZXI8L2J1dHRvbj48YnI+XG4gKiAgICAgICBjbGlja0NvdW50OiB7eyRjdHJsLmNsaWNrQ291bnR9fTxicj5cbiAqICAgICAgIG1vdXNlb3Zlcjoge3skY3RybC5tb3VzZW92ZXJDb3VudH19XG4gKlxuICogICAgICAgPGhyPlxuICpcbiAqICAgICAgIEZvciB0aGUgYGVycm9yYCBhbmQgYGxvYWRgIGV2ZW50IG9uIGltYWdlcyBubyBidWlsdC1pbiBBbmd1bGFySlMgZGlyZWN0aXZlcyBleGlzdDo8YnI+XG4gKiAgICAgICA8aW1nIHNyYz1cInRoaXNpbWFnZWRvZXNub3RleG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5hbWUsIGZhbHNlKSB3aXRoIHN1Y2ggYXR0cmlidXRlcy4gVG8gYXZvaWQgaXNzdWVzXG4gICAgICAgICAgICAgIC8vIGluIFhIVE1MLCBjYWxsIGByZW1vdmVBdHRyYCBpbiBzdWNoIGNhc2VzIGluc3RlYWQuXG4gICAgICAgICAgICAgIC8vIFNlZSBodHRwczovL2dpdGh1Yi5jb20vanF1ZXJ5L2pxdWVyeS9pc3N1ZXMvNDI0OVxuICAgICAgICAgICAgICBpZiAoYm9vbGVhbktleSAmJiB2YWx1ZSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiQkZWxlbWVudC5yZW1vdmVBdHRyKGF0dHJOYW1lKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLiQkZWxlbWVudC5hdHRyKGF0dHJOYW1lLCB2YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHNldFNwZWNpYWxBdHRyKHRoaXMuJCRlbGVtZW50WzBdLCBhdHRyTmFtZSwgdmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIGZpcmUgb2JzZXJ2ZXJzXG4gICAgICAgIHZhciAkJG9ic2VydmVycyA9IHRoaXMuJCRvYnNlcnZlcnM7XG4gICAgICAgIGlmICgkJG9ic2VydmVycykge1xuICAgICAgICAgIGZvckVhY2goJCRvYnNlcnZlcnNbb2JzZXJ2ZXJdLCBmdW5jdGlvbihmbikge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgZm4odmFsdWUpO1xuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSxcblxuXG4gICAgICA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AgLy8gTm9ybWFsaXplIHRoZSBub24tcHJlZml4ZWQgbmFtZVxuICAgICAgICAgICAgICBuYW1lID0gbmFtZS5yZXBsYWNlKFBSRUZJWF9SRUdFWFAsICcnKVxuICAgICAgICAgICAgICAgIC50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgLnN1YnN0cig0ICsgbmdQcmVmaXhNYXRjaFsxXS5sZW5ndGgpLnJlcGxhY2UoL18oLikvZywgZnVuY3Rpb24obWF0Y2gsIGxldHRlcikge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIGxldHRlci50b1VwcGVyQ2FzZSgpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAvLyBTdXBwb3J0ICotc3RhcnQgLyAqLWVuZCBtdWx0aSBlbGVtZW50IGRpcmVjdGl2ZXNcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoKG11bHRpRWxlbWVudE1hdGNoID0gbk5hbWUubWF0Y2goTVVMVElfRUxFTUVOVF9ESVJfUkUpKSAmJiBkaXJlY3RpdmVJc011bHRpRWxlbWVudChtdWx0aUVsZW1lbnRNYXRjaFsxXSkpIHtcbiAgICAgICAgICAgICAgYXR0clN0YXJ0TmFtZSA9IG5hbWU7XG4gICAgICAgICAgICAgIGF0dHJFbmROYW1lID0gbmFtZS5zdWJzdHIoMCwgbmFtZS5sZW5ndGggLSA1KSArICdlbmQnO1xuICAgICAgICAgICAgICBuYW1lID0gbmFtZS5zdWJzdHIoMCwgbmFtZS5sZW5ndGggLSA2KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGlzTmdQcm9wIHx8IGlzTmdFdmVudCkge1xuICAgICAgICAgICAgICBhdHRyc1tuTmFtZV0gPSB2YWx1ZTtcbiAgICAgICAgICAgICAgYXR0cnNNYXBbbk5hbWVdID0gYXR0ci5uYW1lO1xuXG4gICAgICAgICAgICAgIGlmIChpc05nUHJvcCkge1xuICAgICAgICAgICAgICAgIGFkZFByb3BlcnR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VcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUgYXJndW1lbnQgaXMgYXV0by1nZW5lcmF0ZWQgdG8gdGhlIG5ld1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCBvZiB0aGUgdHJhbnNjbHVkZWQgcGFyZW50IHNjb3BlLlxuICAgICAqIEBwYXJhbSB7SlFMaXRlfSBqcUNvbGxlY3Rpb24gSWYgd2UgYXJlIHdvcmtpbmcgb24gdGhlIHJvb3Qgb2YgdGhlIGNvbXBpbGUgdHJlZSB0aGVuIHRoaXNcbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3VtZW50IGhhcyB0aGUgcm9vdCBqcUxpdGUgYXJyYXkgc28gdGhhdCB3ZSBjYW4gcmVwbGFjZSBub2Rlc1xuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24gaXQuXG4gICAgICogQHBhcmFtIHtPYmplY3Q9fSBvcmlnaW5hbFJlcGxhY2VEaXJlY3RpdmUgQW4gb3B0aW9uYWwgZGlyZWN0aXZlIHRoYXQgd2lsbCBiZSBpZ25vcmVkIHdoZW5cbiAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21waWxpbmcgdGhlIHRyYW5zY2x1c2lvbi5cbiAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHByZUxpbmtGbnNcbiAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHBvc3RMaW5rRm5zXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHByZXZpb3VzQ29tcGlsZUNvbnRleHQgQ29udGV4dCB1c2VkIGZvciBwcmV2aW91cyBjb21waWxhdGlvbiBvZiB0aGUgY3VycmVudFxuICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5v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UcmFuc2NsdWRlRm4gPSBjb21waWxhdGlvbkdlbmVyYXRvcihtaWdodEhhdmVNdWx0aXBsZVRyYW5zY2x1c2lvbkVycm9yLCAkdGVtcGxhdGUsIHRyYW5zY2x1ZGVGbiwgdGVybWluYWxQcmlvcml0eSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlRGlyZWN0aXZlICYmIHJlcGxhY2VEaXJlY3RpdmUubmFtZSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRG9uJ3QgcGFzcyBpbjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0gY29udHJvbGxlckRpcmVjdGl2ZXMgLSBvdGhlcndpc2Ugd2UnbGwgY3JlYXRlIGR1cGxpY2F0ZXMgY29udHJvbGxlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0gbmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlIG9yIHRlbXBsYXRlRGlyZWN0aXZlIC0gY29tYmluaW5nIHRlbXBsYXRlcyB3aXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgIGVsZW1lbnQgdHJhbnNjbHVzaW9uIGRvZXNuJ3QgbWFrZSBzZW5zZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBuZWVkIG9ubHkgbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZSBzbyB0aGF0IHdlIHByZXZlbnQgcHV0dGluZyB0cmFuc2NsdXNpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIHRoZSBzYW1lIGVsZW1lbnQgbW9yZSB0aGFuIG9uY2UuXG4gICAgICAgICAgICAgICAgICAgICAgIC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ZU5vZGUuY29udGVudHMoKSwgZnVuY3Rpb24obm9kZSkge1xuICAgICAgICAgICAgICAgIHZhciBzbG90TmFtZSA9IHNsb3RNYXBbZGlyZWN0aXZlTm9ybWFsaXplKG5vZGVOYW1lXyhub2RlKSldO1xuICAgICAgICAgICAgICAgIGlmIChzbG90TmFtZSkge1xuICAgICAgICAgICAgICAgICAgZmlsbGVkU2xvdHNbc2xvdE5hbWVdID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIHNsb3RzW3Nsb3ROYW1lXSA9IHNsb3RzW3Nsb3ROYW1lXSB8fCB3aW5kb3cuZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgpO1xuICAgICAgICAgICAgICAgICAgc2xvdHNbc2xvdE5hbWVdLmFwcGVuZENoaWxkKG5vZGUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAkdGVtcGxhdGUuYXBwZW5kQ2hpbGQobm9kZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAvLyBDaGVjayBmb3IgcmVxdWlyZWQgc2xvdHMgdGhhdCB3ZXJlIG5vdCBmaWxsZWRcbiAgICAgICAgICAgICAgZm9yRWFjaChmaWxsZWRTbG90cywgZnVuY3Rpb24oZmlsbGVkLCBzbG90TmFtZSkge1xuICAgICAgICAgICAgICAgIGlmICghZmlsbGVkKSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyAkY29tcGlsZU1pbkVycigncmVxc2xvdCcsICdSZXF1aXJlZCB0cmFuc2NsdXNpb24gc2xvdCBgezB9YCB3YXMgbm90IGZpbGxlZC4nLCBzbG90TmFtZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICBmb3IgKHZhciBzbG90TmFtZSBpbiBzbG90cykge1xuICAgICAgICAgICAgICAgIGlmIChzbG90c1tzbG90TmFtZV0pIHtcbi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iAgICAgICAgICBjb21waWxlLiQkYWRkU2NvcGVDbGFzcygkZWxlbWVudCwgdHJ1ZSk7XG4gICAgICAgICAgaXNvbGF0ZVNjb3BlLiQkaXNvbGF0ZUJpbmRpbmdzID1cbiAgICAgICAgICAgICAgbmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlLiQkaXNvbGF0ZUJpbmRpbmdzO1xuICAgICAgICAgIHNjb3BlQmluZGluZ0luZm8gPSBpbml0aWFsaXplRGlyZWN0aXZlQmluZGluZ3Moc2NvcGUsIGF0dHJzLCBpc29sYXRlU2NvcGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNvbGF0ZVNjb3BlLiQkaXNvbGF0ZUJpbmRpbmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0lzb2xhdGVTY29wZURpcmVjdGl2ZSk7XG4gICAgICAgICAgaWYgKHNjb3BlQmluZGluZ0luZm8ucmVtb3ZlV2F0Y2hlcykge1xuICAgICAgICAgICAgaXNvbGF0ZVNjb3BlLiRvbignJGRlc3Ryb3knLCBzY29wZUJpbmRpbmdJbmZvLnJlbW92ZVdhdGNoZXMpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEluaXRpYWxpemUgYmluZFRvQ29udHJvbGxlciBiaW5kaW5nc1xuICAgICAgICBmb3IgKHZhciBuYW1lIGluIGVsZW1lbnRDb250cm9sbGVycykge1xuICAgICAgICAgIHZhciBjb250cm9sbGVyRGlyZWN0aXZlID0gY29udHJvbGxlckRpcmVjdGl2ZXNbbmFtZV07XG4gICAgICAgICAgdmFyIGNvbnRyb2xsZXIgPSBlbGVtZW50Q29udHJvbGxlcnNbbmFtZV07XG4gICAgICAgICAgdmFyIGJpbmRpbmdzID0gY29udHJvbGxlckRpcmVjdGl2ZS4kJGJpbmRpbmdzLmJpbmRUb0NvbnRyb2xsZXI7XG5cbiAgICAgICAgICBjb250cm9sbGVy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2tzIG9uIGFsbCBjb250cm9sbGVycyB0aGF0IGhhdmUgdGhlbVxuICAgICAgICBmb3JFYWNoKGVsZW1lbnRDb250cm9sbGVycywgZnVuY3Rpb24oY29udHJvbGxlcikge1xuICAgICAgICAgIHZhciBjb250cm9sbGVySW5zdGFuY2UgPSBjb250cm9sbGVyLmluc3RhbmNlO1xuICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKGNvbnRyb2xsZXJJbnN0YW5jZS4kb25DaGFuZ2VzKSkge1xuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgY29udHJvbGxlckluc3RhbmNlLiRvbkNoYW5nZXMoY29udHJvbGxlci5iaW5kaW5nSW5mby5pbml0aWFsQ2hhbmdlcyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJG9uSW5pdCkpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXJJbnN0YW5jZS4kb25Jbml0KCk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoaXNGdW5jdGlvbihjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2spKSB7XG4gICAgICAgICAgICBjb250cm9sbGVyU2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeyBjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2soKTsgfSk7XG4gICAgICAgICAgICBjb250cm9sbGVySW5zdGFuY2UuJGRvQ2hlY2soKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKGlzRnVuY3Rpb24oY29udHJvbGxlckluc3Rhb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iA9ICRyb290RWxlbWVudC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgIGogPCBqajsgaisrLCBqMisrKSB7XG4gICAgICAgICAgICAgIGlmIChqMiA8IGpqKSB7XG4gICAgICAgICAgICAgICAgJHJvb3RFbGVtZW50W2pdID0gJHJvb3RFbGVtZW50W2oyXTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBkZWxldGUgJHJvb3RFbGVtZW50W2pdO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkcm9vdEVsZW1lbnQubGVuZ3RoIC09IHJlbW92ZUNvdW50IC0gMTtcblxuICAgICAgICAgICAgLy8gSWYgdGhlIHJlcGxhY2VkIGVsZW1lbnQgaXMgYWxzbyB0aGUgalF1ZXJ5IC5jb250ZXh0IHRoZW4gcmVwbGFjZSBpdFxuICAgICAgICAgICAgLy8gLmNvbnRleHQgaXMgYSBkZXByZWNhdGVkIGpRdWVyeSBhcGksIHNvIHdlIHNob3VsZCBzZXQgaXQgb25seSB3aGVuIGpRdWVyeSBzZXQgaXRcbiAgICAgICAgICAgIC8vIGh0dHA6Ly9hcGkuanF1ZXJ5LmNvbS9jb250ZXh0L1xuICAgICAgICAgICAgaWYgKCRyb290RWxlbWVudC5jb250ZXh0ID09PSBmaXJzdEVsZW1lbnRUb1JlbW92ZSkge1xuICAgICAgICAgICAgICAkcm9vdEVsZW1lbnQuY29udGV4dCA9IG5ld05vZGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKHBhcmVudCkge1xuICAgICAgICBwYXJlbnQucmVwbGFjZUNoaWxkKG5ld05vZGUsIGZpcnN0RWxlbWVudFRvUmVtb3ZlKTtcbiAgICAgIH1cblxuICAgICAgLy8gQXBwZW5kIGFsbCB0aGUgYGVsZW1lbnRzVG9SZW1vdmVgIHRvIGEgZnJhZ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GJ1dCB3aWxsIG5vdCBpbnZva2UgdGhlIGNvbnRyb2xsZXIgdW50aWwgYSByZXR1cm5lZFxuICAgICAgLy8gICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayBpcyBpbnZva2VkLlxuICAgICAgLy8gICBwYXJhbSBgaWRlbnRgIC0tLSBBbiBvcHRpb25hbCBsYWJlbCB3aGljaCBvdmVycmlkZXMgdGhlIGxhYmVsIHBhcnNlZCBmcm9tIHRoZSBjb250cm9sbGVyXG4gICAgICAvLyAgICAgICAgICAgICAgICAgICAgIGV4cHJlc3Npb24sIGlmIGFueS5cbiAgICAgIHZhciBpbnN0YW5jZSwgbWF0Y2gsIGNvbnN0cnVjdG9yLCBpZGVudGlmaWVyO1xuICAgICAgbGF0ZXIgPSBsYXRlciA9PT0gdHJ1ZTtcbiAgICAgIGlmIChpZGVudCAmJiBpc1N0cmluZyhpZGVudCkpIHtcbiAgICAgICAgaWRlbnRpZmllciA9IGlkZW50O1xuICAgICAgfVxuXG4gICAgICBpZiAoaXNTdHJpbmcoZXhwcmVzc2lvbikpIHtcbiAgICAgICAgbWF0Y2ggPSBleHByZXNzaW9uLm1hdGNoKENOVFJMX1JFRyk7XG4gICAgICAgIGlmICghbWF0Y2gpIHtcbiAgICAgICAgICB0aHJvdyAkY29udHJvbGxlck1pbkVycignY3RybGZtdCcsXG4gICAgICAgICAgICAnQmFkbHkgZm9ybWVkIGNvbnRyb2xsZXIgc3RyaW5nIFxcJ3swfVxcJy4gJyArXG4gICAgICAgICAgICAnTXVzdCBtYXRjaCBgX19uYW1lX18gYXMgX19pZF9fYCBvciBgX19uYW1lX19gLicsIGV4cHJlc3Npb24pO1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0cnVjdG9yID0gbWF0Y2hbMV07XG4gICAgICAgIGlkZW50aWZpZXIgPSBpZGVudGlmaWVyIHx8IG1hdGNoWzNdO1xuICAgICAgICBleHByZXNzaW9uID0gY29udHJvbGxlcnMuaGFzT3duUHJvcGVydHkoY29u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wcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCdcbiAgICogICAgIH1cbiAgICogICB9KTtcbiAgICpcbiAgICogfSk7XG4gICAqIGBgYFxuICAgKlxuICAgKi9cbiAgdGhpcy4kZ2V0ID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIGZ1bmN0aW9uIGpRdWVyeUxpa2VQYXJhbVNlcmlhbGl6ZXIocGFyYW1zKSB7XG4gICAgICBpZiAoIXBhcmFtcykgcmV0dXJuICcnO1xuICAgICAgdmFyIHBhcnRzID0gW107XG4gICAgICBzZXJpYWxpemUocGFyYW1zLCAnJywgdHJ1ZSk7XG4gICAgICByZXR1cm4gcGFydHMuam9pbignJicpO1xuXG4gICAgICBmdW5jdGlvbiBzZXJpYWxpemUodG9TZXJpYWxpemUsIHByZWZpeCwgdG9wTGV2ZWwpIHtcbiAgICAgICAgaWYgKGlzQXJyYXkodG9TZXJpYWxpemUpKSB7XG4gICAgICAgICAgZm9yRWFjaCh0b1NlcmlhbGl6ZSwgZnVuY3Rpb24odmFsdWUsIGluZGV4KSB7XG4gICAgICAgICAgICBzZXJpYWxpemUodmFsdWUsIHByZWZpeCArICdbJyArIChpc09iamVjdCh2YWx1ZSkgPyBpbmRleCA6ICcnKSArICddJyk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSBpZiAoaXNPYmplY3QodG9TZXJpYWxpemUpICYmICFpc0RhdGUodG9TZXJpYWxpemUpKSB7XG4gICAgICAgICAgZm9yRWFjaFNvcnRlZCh0b1NlcmlhbGl6ZSwgZnVuY3Rpb24odmFsdWUsIGtleSkge1xuICAgICAgICAgICAgc2VyaWFsaXplKHZhbHVlLCBwcmVmaXggK1xuICAgICAgICAgICAgICAgICh0b3BMZXZlbCA/ICcnIDogJ1snKSArXG4gICAgICAgICAgICAgICAga2V5ICtcbiAgICAgICAgICAgICAgICAodG9wTGV2ZWwgPyAnJyA6ICddJykpO1xuICAgICAgICAgIH0pO1xuICA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lZWRzIHRvIHJldHVybiB0aGUgYHJlc3BvbnNlYFxuICAgICAqICAgICBvYmplY3QgZGlyZWN0bHksIG9yIGFzIGEgcHJvbWlzZSBjb250YWluaW5nIHRoZSBgcmVzcG9uc2VgIG9yIGEgbmV3IGByZXNwb25zZWAgb2JqZWN0LlxuICAgICAqICAgKiBgcmVzcG9uc2VFcnJvcmA6IGludGVyY2VwdG9yIGdldHMgY2FsbGVkIHdoZW4gYSBwcmV2aW91cyBpbnRlcmNlcHRvciB0aHJldyBhbiBlcnJvciBvclxuICAgICAqICAgICByZXNvbHZlZCB3aXRoIGEgcmVqZWN0aW9uLlxuICAgICAqXG4gICAgICpcbiAgICAgKiBgYGBqc1xuICAgICAqICAgLy8gcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIGFzIGEgc2VydmljZVxuICAgICAqICAgJHByb3ZpZGUuZmFjdG9yeSgnbXlIdHRwSW50ZXJjZXB0b3InLCBmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAgIHJldHVybiB7XG4gICAgICogICAgICAgLy8gb3B0aW9uYWwgbWV0aG9kXG4gICAgICogICAgICAgJ3JlcXVlc3QnOiBmdW5jdGlvbihjb25maWcpIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzXG4gICAgICogICAgICAgICByZXR1cm4gY29uZmlnO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXF1ZXN0RXJyb3InOiBmdW5jdGlvbihyZWplY3Rpb24pIHtcbiAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvclxuICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVqZWN0aW9uKSkge1xuICAgICAqICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VPck5ld1Byb21pc2VcbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVqZWN0aW9uKTtcbiAgICAgKiAgICAgICB9LFxuICAgICAqXG4gICAgICpcbiAgICAgKlxuICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZFxuICAgICAqICAgICAgICdyZXNwb25zZSc6IGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gc3VjY2Vzc1xuICAgICAqICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAqICAgICAgIH0sXG4gICAgICpcbiAgICAgKiAgICAgICAvLyBvcHRpb25hbCBtZXRob2RcbiAgICAgKiAgICAgICdyZXNwb25zZUVycm9yJzogZnVuY3Rpb24ocmVqZWN0aW9uKSB7XG4gICAgICogICAgICAgICAvLyBkbyBzb21ldGhpbmcgb24gZXJyb3JcbiAgICAgKiAgICAgICAgIGlmIChjYW5SZWNvdmVyKHJlamVjdGlvbikpIHtcbiAgICAgKiAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlT3JOZXdQcm9taXNlXG4gICAgICogICAgICAgICB9XG4gICAgICogICAgICAgICByZXR1cm4gJHEucmVqZWN0KHJlamVjdGlvbik7XG4gICAgICogICAgICAgfVxuICAgICAqICAgICB9O1xuICAgICAqICAgfSk7XG4gICAgICpcbiAgICAgKiAgICRodHRwUHJvdmlkZXIuaW50ZXJjZXB0b3JzLnB1c2goJ215SHR0cEludGVyY2VwdG9yJyk7XG4gICAgICpcbiAgICAgKlxuICAgICAqICAgLy8gYWx0ZXJuYXRpdmVseSwgcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIHZpYSBhbiBhbm9ueW1vdXMgZmFjdG9yeVxuICAgICAqICAgJGh0dHBQcm92aWRlci5pbnRlcmNlcHRvcnMucHVzaChmdW5jdGlvbigkcSwgZGVwZW5kZW5jeTEsIGRlcGVuZGVuY3kyKSB7XG4gICAgICogICAg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SBmdW5jdGlvbiBmb3IgbWVyZ2VkIGhlYWRlcnNcbiAgICAgICAgcmV0dXJuIGV4ZWN1dGVIZWFkZXJGbnMocmVxSGVhZGVycywgc2hhbGxvd0NvcHkoY29uZmlnKSk7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIHNlcnZlclJlcXVlc3QoY29uZmlnKSB7XG4gICAgICAgIHZhciBoZWFkZXJzID0gY29uZmlnLmhlYWRlcnM7XG4gICAgICAgIHZhciByZXFEYXRhID0gdHJhbnNmb3JtRGF0YShjb25maWcuZGF0YSwgaGVhZGVyc0dldHRlcihoZWFkZXJzKSwgdW5kZWZpbmVkLCBjb25maWcudHJhbnNmb3JtUmVxdWVzdCk7XG5cbiAgICAgICAgLy8gc3RyaXAgY29udGVudC10eXBlIGlmIGRhdGEgaXMgdW5kZWZpbmVkXG4gICAgICAgIGlmIChpc1VuZGVmaW5lZChyZXFEYXRhKSkge1xuICAgICAgICAgIGZvckVhY2goaGVhZGVycywgZnVuY3Rpb24odmFsdWUsIGhlYWRlcikge1xuICAgICAgICAgICAgaWYgKGxvd2VyY2FzZShoZWFkZXIpID09PSAnY29udGVudC10eXBlJykge1xuICAgICAgICAgICAgICBkZWxldGUgaGVhZGVyc1toZWFkZXJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlzVW5kZWZpbmVkKGNvbmZpZy53aXRoQ3JlZGVudGlhbHMpICYmICFpc1VuZGVmaW5lZChkZWZhdWx0cy53aXRoQ3JlZGVudGlhbHMpKSB7XG4gICAgICAgICAgY29uZmlnLndpdGhDcmVkZW50aWFscyA9IGRlZmF1bHRzLndpdGhDcmVkZW50aWFscztcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIHNlbmQgcmVxdWVzdFxuICAgICAgICByZXR1cm4gc2VuZFJlcShjb25maWcsIHJlcURhdGEpLnRoZW4odHJhbnNmb3JtUmVzcG9uc2UsIHRyYW5zZm9yb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GNvbmZpZy5ldmVudEhhbmRsZXJzKSxcbiAgICAgICAgICAgIGNyZWF0ZUFwcGx5SGFuZGxlcnMoY29uZmlnLnVwbG9hZEV2ZW50SGFuZGxlcnMpKTtcbiAgICAgIH1cblxuICAgICAgcmV0dXJuIHByb21pc2U7XG5cbiAgICAgIGZ1bmN0aW9uIGNyZWF0ZUFwcGx5SGFuZGxlcnMoZXZlbnRIYW5kbGVycykge1xuICAgICAgICBpZiAoZXZlbnRIYW5kbGVycykge1xuICAgICAgICAgIHZhciBhcHBseUhhbmRsZXJzID0ge307XG4gICAgICAgICAgZm9yRWFjaChldmVudEhhbmRsZXJzLCBmdW5jdGlvbihldmVudEhhbmRsZXIsIGtleSkge1xuICAgICAgICAgICAgYXBwbHlIYW5kbGVyc1trZXldID0gZnVuY3Rpb24oZXZlbnQpIHtcbiAgICAgICAgICAgICAgaWYgKHVzZUFwcGx5QXN5bmMpIHtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseUFzeW5jKGNhbGxFdmVudEhhbmRsZXIpO1xuICAgICAgICAgICAgICB9IGVsc2UgaWYgKCRyb290U2NvcGUuJCRwaGFzZSkge1xuICAgICAgICAgICAgICAgIGNhbGxFdmVudEhhbmRsZXIoKTtcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRhcHBseShjYWxsRXZlbnRIYW5kbGVyKTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGZ1bmN0aW9uIGNhbGxFdmVudEhhbmRsZXIoKSB7XG4gICAgICAgICAgICAgICAgZXZlbnRIYW5kbGVyKGV2ZW50KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICByZXR1cm4gYXBwbHlIYW5kbGVycztcbiAgICAgICAgfVxuICAgICAgfVxuXG5cbiAgICAgIC8qKlxuICAgICAgICogQ2FsbGJhY2sgcmVnaXN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9XG4gICAgICAgICAgLy8gSW4gYW4gdW5wcml2aWxlZ2VkIGNvbnRleHQgb3Igb25seSBvbmUgcGFydDoganVzdCBjb25jYXRlbmF0ZSBhbmQgcmV0dXJuLlxuICAgICAgICAgIHJldHVybiBjb25jYXQuam9pbignJyk7XG4gICAgICAgIH07XG5cbiAgICAgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbiBpbnRlcnBvbGF0aW9uRm4oY29udGV4dCkge1xuICAgICAgICAgICAgdmFyIGkgPSAwO1xuICAgICAgICAgICAgdmFyIGlpID0gZXhwcmVzc2lvbnMubGVuZ3RoO1xuICAgICAgICAgICAgdmFyIHZhbHVlcyA9IG5ldyBBcnJheShpaSk7XG5cbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIGZvciAoOyBpIDwgaWk7IGkrKykge1xuICAgICAgICAgICAgICAgIHZhbHVlc1tpXSA9IHBhcnNlRm5zW2ldKGNvbnRleHQpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgcmV0dXJuIGNvbXB1dGUodmFsdWVzKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcigkaW50ZXJwb2xhdGVNaW5FcnIuaW50ZXJyKHRleHQsIGVycikpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgfSwge1xuICAgICAgICAgIC8vIGFsbCBvZiB0aGVzZSBwcm9wZXJ0aWVzIGFyZSB1bmRvY3VtZW50ZWQgZm9yIG5vd1xuICAgICAgICAgIGV4cDogdGV4dCwgLy9qdXN0IGZvciBjb21wYXRpYmlsaXR5IHdpdGggcmVndWxhciB3YXRjaGVycyBjcmVhdGVkIHZpYSAkd2F0Y2hcbiAgICAgICAgICBleHByZXNzaW9uczogZXhwcmVzc2lvbnMsXG4gICAgICAgICAgJCR3YXRjaERlbGVnYXRlOiBmdW5jdGlvbihzY29wZSwgbGlzdGVuZXIpIHtcbiAgIC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ICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgJyRpbnRlcnZhbCcsXG4gICAgICogICAgICAgICBmdW5jdGlvbigkc2NvcGUsICRpbnRlcnZhbCkge1xuICAgICAqICAgICAgICAgICAkc2NvcGUuZm9ybWF0ID0gJ00vZC95eSBoOm1tOnNzIGEnO1xuICAgICAqICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9IDEwMDtcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAxMjA7XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgdmFyIHN0b3A7XG4gICAgICogICAgICAgICAgICRzY29wZS5maWdodCA9IGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIC8vIERvbid0IHN0YXJ0IGEgbmV3IGZpZ2h0IGlmIHdlIGFyZSBhbHJlYWR5IGZpZ2h0aW5nXG4gICAgICogICAgICAgICAgICAgaWYgKCBhbmd1bGFyLmlzRGVmaW5lZChzdG9wKSApIHJldHVybjtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAgIHN0b3AgPSAkaW50ZXJ2YWwoZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgICBpZiAoJHNjb3BlLmJsb29kXzEgPiAwICYmICRzY29wZS5ibG9vZF8yID4gMCkge1xuICAgICAqICAgICAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9ICRzY29wZS5ibG9vZF8xIC0gMztcbiAgICAgKiAgICAgICAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAkc2NvcGUuYmxvb2RfMiAtIDQ7XG4gICAgICogICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAqICAgICAgICAgICAgICAgICAkc2NvcGUuc3RvcEZpZ2h0KCk7XG4gICAgICogICAgICAgICAgICAgICB9XG4gICAgICogICAgICAgICAgICAgfSwgMTAwKTtcbiAgICAgKiAgICAgICAgICAgfTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAkc2NvcGUuc3RvcEZpZ2h0ID0gZnVuY3Rpb24oKSB7XG4gICAgICogICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHN0b3ApKSB7XG4gICAgICogICAgICAgICAgICAgICAkaW50ZXJ2YWwuY2FuY2VsKHN0b3ApO1xuICAgICAqICAgICAgICAgICAgICAgc3RvcCA9IHVuZGVmaW5lZDtcbiAgICAgKiAgICAgICAgICAgICB9XG4gICAgICogICAgICAgICAgIH07XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgJHNjb3BlLnJlc2V0RmlnaHQgPSBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMSA9IDEwMDtcbiAgICAgKiAgICAgICAgICAgICAkc2NvcGUuYmxvb2RfMiA9IDEyMDtcbiAgICAgKiAgICAgICAgICAgfTtcbiAgICAgKlxuICAgICAqICAgICAgICAgICAkc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAqICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0aGF0IHRoZSBpbnRlcnZhbCBpcyBkZXN0cm95ZWQgdG9vXG4gICAgICogICAgICAgICAgICAgJHNjb3BlLnN0b3BGaWdodCgpO1xuICAgICAqICAgICAgICAgICB9KTtcbiAgICAgKiAgICAgICAgIH1dKVxuICAgICAqICAgICAgIC8vIFJlZ2lzdGVyIHRoZSAnbXlDdXJyZW50VGltZScgZGlyZWN0aXZlIGZhY3RvcnkgbWV0aG9kLlxuICAgICAqICAgICAgIC8vIFdlIGluamVjdCAkaW50ZXJ2YWwgYW5kIGRhdGVGaWx0ZXIgc2VydmljZSBzaW5jZSB0aGUgZmFjdG9yeSBtZXRob2QgaXMgREkuXG4gICAgICogICAgICAgLmRpcmVjdGl2ZSgnbXlDdXJyZW50VGltZScsIFsnJGludGVydmFsJywgJ2RhdGVGaWx0ZXInLFxuICAgICAqICAgICAgICAgZnVuY3Rpb24oJGludGVydmFsLCBkYXRlRmlsdGVyKSB7XG4gICAgICogICAgICAgICAgIC8vIHJldHVybiB0aGUgZGlyZWN0aXZlIGxpbmsgZnVuY3Rpb24uIChjb21waWxlIGZ1bmN0aW9uIG5vdCBuZWVkZWQpXG4gICAgICogICAgICAgICAgIHJldHVybiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgKiAgICAgICAgICAgICB2YXIgZm9ybWF0LCAgLy8gZGF0ZSBmb3JtYXRcbiAgICAgKiAgICAgICAgICAgICAgICAgc3RvcFRpbWU7IC8vIHNvIHRoYXQgd2UgY2FuIGNhbmNlbCB0aGUgdGltZSB1cGRhdGVzXG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICAvLyB1c2VkIHRvIHVwZGF0ZSB0aGUgVUlcbiAgICAgKiAgICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVUaW1lKCkge1xuICAgICAqICAgICAgICAgICAgICAgZWxlbWVudC50ZXh0KGRhdGVGaWx0ZXIobmV3IERhdGUoKSwgZm9ybWF0KSk7XG4gICAgICogICAgICAgICAgICAgfVxuICAgICAqXG4gICAgICogICAgICAgICAgICAgLy8gd2F0Y2ggdGhlIGV4cHJlc3Npb24sIGFuZCB1cGRhdGUgdGhlIFVJIG9uIGNoYW5nZS5cbiAgICAgKiAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0cnMubXlDdXJyZW50VGltZSwgZnVuY3Rpb24odmFsdWUpIHtcbiAgICAgKiAgICAgICAgICAgICAgIGZvcm1hdCA9IHZhbHVlO1xuICAgICAqICAgICAgICAgICAgICAgdXBkYXRlVGltZSgpO1xuICAgICAqICAgICAgICAgICAgIH0pO1xuICAgICAqXG4gICAgICogICAgICAgICAgICAgc3RvcFRpbWUgPSAkaW50ZXJ2YWwodXBkYXRlVGltZSwgMTAwMCk7XG4gICAgICpcbiAgICAgKiAgICAgICAgICAgICAvLyBsaXN0ZW4gb24gRE9NIGRlc3Ryb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10sXG4gICAgICAgICAgICBpdGVyYXRpb24gPSAwLFxuICAgICAgICAgICAgc2tpcEFwcGx5ID0gaXNEZWZpbmVkKGludm9rZUFwcGx5KSAmJiAhaW52b2tlQXBwbHksXG4gICAgICAgICAgICBkZWZlcnJlZCA9IChza2lwQXBwbHkgPyAkJHEgOiAkcSkuZGVmZXIoKSxcbiAgICAgICAgICAgIHByb21pc2UgPSBkZWZlcnJlZC5wcm9taXNlO1xuXG4gICAgICAgIGNvdW50ID0gaXNEZWZpbmVkKGNvdW50KSA/IGNvdW50IDogMDtcblxuICAgICAgICBmdW5jdGlvbiBjYWxsYmFjaygpIHtcbiAgICAgICAgICBpZiAoIWhhc1BhcmFtcykge1xuICAgICAgICAgICAgZm4oaXRlcmF0aW9uKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm4uYXBwbHkobnVsbCwgYXJncyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gdGljaygpIHtcbiAgICAgICAgICBpZiAoc2tpcEFwcGx5KSB7XG4gICAgICAgICAgICAkYnJvd3Nlci5kZWZlcihjYWxsYmFjayk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICRyb290U2NvcGUuJGV2YWxBc3luYyhjYWxsYmFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGRlZmVycmVkLm5vdGlmeShpdGVyYXRpb24rKyk7XG5cbiAgICAgICAgICBpZiAoY291bnQgPiAwICYmIGl0ZXJhdGlvbiA+PSBjb3VudCkge1xuICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShpdGVyYXRpb24pO1xuICAgICAgICAgICAgY2xlYXJJbnRlcnZhbEZuKHByb21pc2UuJCRpbnRlcnZhbElkKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoIXNraXBBcHBseSkgJHJvb3RTY29wZS4kYXBwbHkoKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHByb21pc2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AgcmV0dXJuIHtcbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJGxvZyNsb2dcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGEgbG9nIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgbG9nOiBjb25zb2xlTG9nKCdsb2cnKSxcblxuICAgICAgLyoqXG4gICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgKiBAbmFtZSAkbG9nI2luZm9cbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGFuIGluZm9ybWF0aW9uIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgaW5mbzogY29uc29sZUxvZygnaW5mbycpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjd2FyblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogV3JpdGUgYSB3YXJuaW5nIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgd2FybjogY29uc29sZUxvZygnd2FybicpLFxuXG4gICAgICAvKipcbiAgICAgICAqIEBuZ2RvYyBtZXRob2RcbiAgICAgICAqIEBuYW1lICRsb2cjZXJyb3JcbiAgICAgICAqXG4gICAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgICAqIFdyaXRlIGFuIGVycm9yIG1lc3NhZ2VcbiAgICAgICAqL1xuICAgICAgZXJyb3I6IGNvbnNvbGVMb2coJ2Vycm9yJyksXG5cbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJGxvZyNkZWJ1Z1xuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogV3JpdGUgYSBkZWJ1ZyBtZXNzYWdlXG4gICAgICAgKi9cbiAgICAgI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1bmN0aW9uKGFyZykge1xuICAgICAgICAgIGFyZ3MucHVzaChmb3JtYXRFcnJvcihhcmcpKTtcbiAgICAgICAgfSk7XG4gICAgICAgIC8vIFN1cHBvcnQ6IElFIDkgb25seVxuICAgICAgICAvLyBjb25zb2xlIG1ldGhvZHMgZG9uJ3QgaW5oZXJpdCBmcm9tIEZ1bmN0aW9uLnByb3RvdHlwZSBpbiBJRSA5IHNvIHdlIGNhbid0XG4gICAgICAgIC8vIGNhbGwgYGxvZ0ZuLmFwcGx5KGNvbnNvbGUsIGFyZ3MpYCBkaXJlY3RseS5cbiAgICAgICAgcmV0dXJuIEZ1bmN0aW9uLnByb3RvdHlwZS5hcHBseS5jYWxsKGxvZ0ZuLCBjb25zb2xlLCBhcmdzKTtcbiAgICAgIH07XG4gICAgfVxuICB9XTtcbn1cblxuLyogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKlxuICogICAgIEFueSBjb21taXRzIHRvIHRoaXMgZmlsZSBzaG91bGQgYmUgcmV2aWV3ZWQgd2l0aCBzZWN1cml0eSBpbiBtaW5kLiAgKlxuICogICBDaGFuZ2VzIHRvIHRoaXMgZmlsZSBjYW4gcG90ZW50aWFsbHkgY3JlYXRlIHNlY3VyaXR5IHZ1bG5lcmFiaWxpdGllcy4gKlxuICogICAgICAgICAgQW4gYXBwcm92YWwgZnJvbSAyIENvcmUgbWVtYmVycyB3aXRoIGhpc3Rvcnkgb2YgbW9kaWZ5aW5nICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlIGlzIHJlcXVpcmVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKlxuICogIERvZXMgdGhlIGNoYW5nZSBzb21laG93IGFsbG93IGZvciBhcmJpdHJhcnkgam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m9wZXJ0eTtcbiAgICBpZiAodGhpcy5wZWVrVG9rZW4oKS50ZXh0ICE9PSAnfScpIHtcbiAgICAgIGRvIHtcbiAgICAgICAgaWYgKHRoaXMucGVlaygnfScpKSB7XG4gICAgICAgICAgLy8gU3VwcG9ydCB0cmFpbGluZyBjb21tYXMgcGVyIEVTNS4xLlxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIHByb3BlcnR5ID0ge3R5cGU6IEFTVC5Qcm9wZXJ0eSwga2luZDogJ2luaXQnfTtcbiAgICAgICAgaWYgKHRoaXMucGVlaygpLmNvbnN0YW50KSB7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5jb25zdGFudCgpO1xuICAgICAgICAgIHByb3BlcnR5LmNvbXB1dGVkID0gZmFsc2U7XG4gICAgICAgICAgdGhpcy5jb25zdW1lKCc6Jyk7XG4gICAgICAgICAgcHJvcGVydHkudmFsdWUgPSB0aGlzLmV4cHJlc3Npb24oKTtcbiAgICAgICAgfSBlbHNlIGlmICh0aGlzLnBlZWsoKS5pZGVudGlmaWVyKSB7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5pZGVudGlmaWVyKCk7XG4gICAgICAgICAgcHJvcGVydHkuY29tcHV0ZWQgPSBmYWxzZTtcbiAgICAgICAgICBpZiAodGhpcy5wZWVrKCc6JykpIHtcbiAgICAgICAgICAgIHRoaXMuY29uc3VtZSgnOicpO1xuICAgICAgICAgICAgcHJvcGVydHkudmFsdWUgPSB0aGlzLmV4cHJlc3Npb24oKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcHJvcGVydHkudmFsdWUgPSBwcm9wZXJ0eS5rZXk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKHRoaXMucGVlaygnWycpKSB7XG4gICAgICAgICAgdGhpcy5jb25zdW1lKCdbJyk7XG4gICAgICAgICAgcHJvcGVydHkua2V5ID0gdGhpcy5leHByZXNza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NlbGYuY29tcHV0ZWRNZW1iZXIobGVmdCwgcmlnaHQpLCAne30nKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBleHByZXNzaW9uID0gc2VsZi5jb21wdXRlZE1lbWJlcihsZWZ0LCByaWdodCk7XG4gICAgICAgICAgICBzZWxmLmFzc2lnbihpbnRvSWQsIGV4cHJlc3Npb24pO1xuICAgICAgICAgICAgaWYgKG5hbWVJZCkge1xuICAgICAgICAgICAgICBuYW1lSWQuY29tcHV0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICBuYW1lSWQubmFtZSA9IHJpZ2h0O1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoY3JlYXRlICYmIGNyZWF0ZSAhPT0gMSkge1xuICAgICAgICAgICAgICBzZWxmLmlmXyhzZWxmLmlzTnVsbChzZWxmLm5vbkNvbXB1dGVkTWVtYmVyKGxlZnQsIGFzdC5wcm9wZXJ0eS5uYW1lKSksIHNlbGYubGF6eUFzc2lnbihzZWxmLm5vbkNvbXB1dGVkTWVtYmVyKGxlZnQsIGFzdC5wcm9wZXJ0eS5uYW1lKSwgJ3t9JykpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwcmVzc2lvbiA9IHNlbGYubm9uQ29tcHV0ZWRNZW1iZXIobGVmdCwgYXN0LnByb3BlcnR5Lm5hbWUpO1xuICAgICAgICAgICAgc2VsZi5hc3NpZ24oaW50b0lkLCBleHByZXNzaW9uKTtcbiAgICAgICAgICAgIGlmIChuYW1lSWQpIHtcbiAgICAgICAgICAgICAgbmFtZUlkLmNvbXB1dGVkID0gZmFsc2U7XG4gICAgICAgICAgICAgIG5hbWVJZC5uYW1lID0gYXN0LnByb3BlcnR5Lm5hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9LCBmdW5jdGlvbigpIHtcbiAgICAgICAgICBzZWxmLmFzc2lnbihpbnRvSWQsICd1bmRlZmluZWQnKTtcbiAgICAgICAgfSk7XG4gICAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCk7XG4gICAgICB9LCAhIWNyZWF0ZSk7XG4gICAgICBicmVhaztcbiAgICBjYXNlIEFTVC5DYWxsRXhwcmVzc2lvbjpcbiAgICAgIGludG9JZCA9IGludG9JZCB8fCB0aGlzLm5leHRJZCgpO1xuICAgICAgaWYgKGFzdC5maWx0ZXIpIHtcbiAgICAgICAgcmlnaHQgPSBzZWxmLmZpbHRlcihhc3QuY2FsbGVlLm5hbWUpO1xuICAgICAgICBhcmdzID0gW107XG4gICAgICAgIGZvckVhY2goYXN0LmFyZ3VtZW50cywgZnVuY3Rpb24oZXhwcikge1xuICAgICAgICAgIHZhciBhcmd1bWVudCA9IHNlbGYubmV4dElkKCk7XG4gICAgICAgICAgc2VsZi5yZWN1cnNlKGV4cHIsIGFyZ3VtZW50KTtcbiAgICAgICAgICBhcmdzLnB1c2goYXJndW1lbnQpO1xuICAgICAgICB9KTtcbiAgICAgICAgZXhwcmVzc2lvbiA9IHJpZ2h0ICsgJygnICsgYXJncy5qb2luKCcsJykgKyAnKSc7XG4gICAgICAgIHNlbGYuYXNzaWduKGludG9JZCwgZXhwcmVzc2lvbik7XG4gICAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByaWdodCA9IHNlbGYubmV4dElkKCk7XG4gICAgICAgIGxlZnQgPSB7fTtcbiAgICAgICAgYXJncyA9IFtdO1xuICAgICAgICBzZWxmLnJlY3Vyc2UoYXN0LmNhbGxlZSwgcmlnaHQsIGxlZnQsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHNlbGYuaWZfKHNlbGYubm90TnVsbChyaWdodCksIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgZm9yRWFjaChhc3QuYXJndW1lbnRzLCBmdW5jdGlvbihleHByKSB7XG4gICAgICAgICAgICAgIHNlbGYucmVjdXJzZShleHByLCBhc3QuY29uc3Rh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vbXB1dGVkKSB7XG4gICAgICAgIGludG9JZCA9IGludG9JZCB8fCB0aGlzLm5leHRJZCgpO1xuICAgICAgICB0aGlzLmFzc2lnbihpbnRvSWQsICd7fScpO1xuICAgICAgICBmb3JFYWNoKGFzdC5wcm9wZXJ0aWVzLCBmdW5jdGlvbihwcm9wZXJ0eSkge1xuICAgICAgICAgIGlmIChwcm9wZXJ0eS5jb21wdXRlZCkge1xuICAgICAgICAgICAgbGVmdCA9IHNlbGYubmV4dElkKCk7XG4gICAgICAgICAgICBzZWxmLnJlY3Vyc2UocHJvcGVydHkua2V5LCBsZWZ0KTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGVmdCA9IHByb3BlcnR5LmtleS50eXBlID09PSBBU1QuSWRlbnRpZmllciA/XG4gICAgICAgICAgICAgICAgICAgICAgIHByb3BlcnR5LmtleS5uYW1lIDpcbiAgICAgICAgICAgICAgICAgICAgICAgKCcnICsgcHJvcGVydHkua2V5LnZhbHVlKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmlnaHQgPSBzZWxmLm5leHRJZCgpO1xuICAgICAgICAgIHNlbGYucmVjdXJzZShwcm9wZXJ0eS52YWx1ZSwgcmlnaHQpO1xuICAgICAgICAgIHNlbGYuYXNzaWduKHNlbGYubWVtYmVyKGludG9JZCwgbGVmdCwgcHJvcGVydHkuY29tcHV0ZWQpLCByaWdodCk7XG4gICAgICAgIH0pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZm9yRWFjaChhc3QucHJvcGVydGllcywgZnVuY3Rpb24ocHJvcGVydHkpIHtcbiAgICAgICAgICBzZWxmLnJlY3Vyc2UocHJvcGVydHkudmFsdWUsIGFzdC5jb25zdGFudCA/IHVuZGVmaW5lZCA6IHNlbGYubmV4dElkKCksIHVuZGVmaW5lZCwgZnVuY3Rpb24oZXhwcikge1xuICAgICAgICAgICAgYXJncy5wdXNoKHNlbGYuZXNjYXBlKFxuICAgICAgICAgICAgICAgIHByb3BlcnR5LmtleS50eXBlID09PSBBU1QuSWRlbnRpZmllciA/IHByb3BlcnR5LmtleS5uYW1lIDpcbiAgICAgICAgICAgICAgICAgICgnJyArIHByb3BlcnR5LmtleS52YWx1ZSkpICtcbiAgICAgICAgICAgICAgICAnOicgKyBleHByKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG4gICAgICAgIGV4cHJlc3Npb24gPSAneycgKyBhcmdzLmpvaW4oJywnKSArICd9JztcbiAgICAgICAgdGhpcy5hc3NpZ24oaW50b0lkLCBleHByZXNzaW9uKTtcbiAgICAgIH1cbiAgICAgIHJlY3Vyc2lvbkZuKGludG9JZCB8fCBleHByZXNzaW9uKTtcbiAgICAgIGJyZWFrO1xuICAgIGNhc2UgQVNULlRoaXNFeHByZXNzaW9uOlxuICAgICAgdGhpcy5hc3NpZ24oaW50b0lkLCAncycpO1xuICAgICAgcmVjdXJzaW9uRm4oaW50b0lkIHx8ICdzJyk7XG4gICAgICBicmVhaztcbiAgICBjYXNlIEFTVC5Mb2NhbHNFeHByZXNzaW9uOlxuICAgICAgdGhpcy5hc3NpZ24oaW50b0lkLCAnbCcpO1xuICAgICAgcmVjdXJzaW9uRm4oaW50b0lkIHx8ICdsJyk7XG4gICAgICBicmVhaztcbiAgICBjYXNlIEFTVC5OR1ZhbHVlUGFyYW1ldGVyOlxuICAgICAgdGhpcy5hc3NpZ24oaW50b0lkLCAndicpO1xuICAgICAgcmVjdXJzaW9uRm4oaW50b0lkIHx8ICd2Jyk7XG4gICAgICBicmVhaztcbiAgICB9XG4gIH0sXG5cbiAgZ2V0SGFzT3duUHJvcGVydHk6IGZ1bmN0aW9uKGVsZW1lbnQsIHByb3BlcnR5KSB7XG4gICAgdmFyIGtleSA9IGVsZW1lbnQgKyAnLicgKyBwcm9wZXJ0eTtcbiAgICB2YXIgb3duID0gdGhpcy5jdXJyZW50KCkub3duO1xuICAgIGlmICghb3duLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgIG93bltrZX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b3BlcnR5LnZhbHVlKVxuICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGFyZ3MucHVzaCh7a2V5OiBwcm9wZXJ0eS5rZXkudHlwZSA9PT0gQVNULklkZW50aWZpZXIgP1xuICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0eS5rZXkubmFtZSA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICgnJyArIHByb3BlcnR5LmtleS52YWx1ZSksXG4gICAgICAgICAgICAgICAgICAgICBjb21wdXRlZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICB2YWx1ZTogc2VsZi5yZWN1cnNlKHByb3BlcnR5LnZhbHVlKVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICAgIHJldHVybiBmdW5jdGlvbihzY29wZSwgbG9jYWxzLCBhc3NpZ24sIGlucHV0cykge1xuICAgICAgICB2YXIgdmFsdWUgPSB7fTtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcmdzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgaWYgKGFyZ3NbaV0uY29tcHV0ZWQpIHtcbiAgICAgICAgICAgIHZhbHVlW2FyZ3NbaV0ua2V5KHNjb3BlLCBsb2NhbHMsIGFzc2lnbiwgaW5wdXRzKV0gPSBhcmdzW2ldLnZhbHVlKHNjb3BlLCBsb2NhbHMsIGFzc2lnbiwgaW5wdXRzKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVbYXJnc1tpXS5rZXldID0gYXJnc1tpXS52YWx1ZShzY29wZSwgbG9jYWxzLCBhc3NpZ24sIGlucHV0cyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb250ZXh0ID8ge3ZhbHVlOiB2YWx1ZX0gOiB2YWx1ZTtcbiAgICAgIH07XG4gICAgY2FzZSBBU1QuVGhpc0V4cHJlc3Npb246XG4gICAgICByZX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ucywgZnVuY3Rpb24oZXhwciwgaSkge1xuICAgICAgICAgIHZhciB1bndhdGNoRm4gPSBzZWxmLiR3YXRjaChleHByLCBmdW5jdGlvbiB3YXRjaEdyb3VwU3ViQWN0aW9uKHZhbHVlKSB7XG4gICAgICAgICAgICBuZXdWYWx1ZXNbaV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIGlmICghY2hhbmdlUmVhY3Rpb25TY2hlZHVsZWQpIHtcbiAgICAgICAgICAgICAgY2hhbmdlUmVhY3Rpb25TY2hlZHVsZWQgPSB0cnVlO1xuICAgICAgICAgICAgICBzZWxmLiRldmFsQXN5bmMod2F0Y2hHcm91cEFjdGlvbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgZGVyZWdpc3RlckZucy5wdXNoKHVud2F0Y2hGbik7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGZ1bmN0aW9uIHdhdGNoR3JvdXBBY3Rpb24oKSB7XG4gICAgICAgICAgY2hhbmdlUmVhY3Rpb25TY2hlZHVsZWQgPSBmYWxzZTtcblxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBpZiAoZmlyc3RSdW4pIHtcbiAgICAgICAgICAgICAgZmlyc3RSdW4gPSBmYWxzZTtcbiAgICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWVzLCBuZXdWYWx1ZXMsIHNlbGYpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgbGlzdGVuZXIobmV3VmFsdWVzLCBvbGRWYWx1ZXMsIHNlbGYpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdhdGNoRXhwcmVzc2lvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgb2xkVmFsdWVzW2ldID0gbmV3VmFsdWVzW2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgIC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ICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gY29weSB0aGUgaXRlbXMgdG8gb2xkVmFsdWUgYW5kIGxvb2sgZm9yIGNoYW5nZXMuXG4gICAgICAgICAgICBuZXdMZW5ndGggPSAwO1xuICAgICAgICAgICAgZm9yIChrZXkgaW4gbmV3VmFsdWUpIHtcbiAgICAgICAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwobmV3VmFsdWUsIGtleSkpIHtcbiAgICAgICAgICAgICAgICBuZXdMZW5ndGgrKztcbiAgICAgICAgICAgICAgICBuZXdJdGVtID0gbmV3VmFsdWVba2V5XTtcbiAgICAgICAgICAgICAgICBvbGRJdGVtID0gb2xkVmFsdWVba2V5XTtcblxuICAgICAgICAgICAgICAgIGlmIChrZXkgaW4gb2xkVmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgICAgICAgICAgICAgIGJvdGhOYU4gPSAob2xkSXRlbSAhPT0gb2xkSXRlbSkgJiYgKG5ld0l0ZW0gIT09IG5ld0l0ZW0pO1xuICAgICAgICAgICAgICAgICAgaWYgKCFib3RoTmFOICYmIChvbGRJdGVtICE9PSBuZXdJdGVtKSkge1xuICAgICAgICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrO1xuICAgICAgICAgICAgICAgICAgICBvbGRWYWx1ZVtrZXldID0gbmV3SXRlbTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgb2xkTGVuZ3RoKys7XG4gICAgICAgICAgICAgICAgICBvbGRWYWx1ZVtrZXldID0gbmV3SXRlbTtcbiAgICAgICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAob2xkTGVuZ3RoID4gbmV3TGVuZ3RoKSB7XG4gICAgICAgICAgICAgIC8vIHdlIHVzZWQgdG8gaGF2ZSBtb3JlIGtleXMsIG5lZWQgdG8gZmluZCB0aGVtIGFuZCBkZXN0cm95IHRoZW0uXG4gICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7XG4gICAgICAgICAgICAgIGZvciAoa2V5IGluIG9sZFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFoYXNPd25Qcm9wZXJ0eS5jYWxsKG5ld1ZhbHVlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICBvbGRMZW5ndGgtLTtcbiAgICAgICAgICAgICAgICAgIGRlbGV0ZSBvbGRWYWx1ZVtrZXldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gY2hhbmdlRGV0ZWN0ZWQ7XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiAkd2F0Y2hDb2xsZWN0aW9uQWN0aW9uKCkge1xuICAgICAgICAgIGlmIChpbml0UnVuKSB7XG4gICAgICAgICAgICBpbml0UnVuID0gZmFsc2U7XG4gICAgICAgICAgICBsaXN0ZW5lcihuZXdWYWx1ZSwgbmV3VmFsdWUsIHNlbGYpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsaXN0ZW5lcihuZXdWYWx1ZSwgdmVyeU9sZFZhbHVlLCBzZWxmKTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvLyBtYWtlIGEgY29weSBmb3IgdGhlIG5leHQgdGltZSBhIGNvbGxlY3Rpb24gaXMgY2hhbmdlZFxuICAgICAgICAgIGlmICh0cmFja1ZlcnlPbGRWYWx1ZSkge1xuICAgICAgICAgICAgaWYgKCFpc09iamVjdChuZXdWYWx1ZSkpIHtcbiAgICAgICAgICAgICAgLy9wcmltaXRpdmVcbiAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlID0gbmV3VmFsdWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzQXJyYXlMaWtlKG5ld1ZhbHVlKSkge1xuICAgICAgICAgICAgICB2ZXJ5T2xkVmFsdWUgPSBuZXcgQXJyYXkobmV3VmFsdWUubGVuZ3RoKTtcbiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuZXdWYWx1ZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZVtpXSA9IG5ld1ZhbHVlW2ldO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgeyAvLyBpZiBvYmplY3RcbiAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlID0ge307XG4gICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBuZXdWYWx1ZSkge1xuICAgICAgICAgICAgICAgIGlmIChoYXNPd25Qcm9wZXJ0eS5jYWxsKG5ld1ZhbHVlLCBrZXkpKSB7XG4gICAgICAgICAgICAgICAgICB2ZXJ5T2xkVmFsdWVba2V5XSA9IG5ld1ZhbHVlW2tleV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHRoaXMuJHdhdGNoKGNoYW5nZURldGVjdG9yLCAkd2F0Y2hDb2xsZWN0aW9uQWN0aW9uKTtcbiAgICAgIH0sXG5cbiAgICAgIC8qKlxuICAgICAgICogQG5nZG9jIG1ldGhvZFxuICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkZGlnZXN0XG4gICAgICAgKiBAa2luZCBmdW5jdGlvblxuICAgICAgICpcbiAgICAgICAqIEBkZXNjcmlwdGlvblxuICAgICAgICogUHJvY2Vzc2VzIGFsbCBvZiB0aGUge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJHdhdGNoIHdhdGNoZXJzfSBvZiB0a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gICBleHBlY3Qoc2NvcGUuY291bnRlcikudG9FcXVhbCgxKTtcblxuICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7XG4gICAgICAgICAgIC8vIGJ1dCBub3cgaXQgd2lsbCBub3QgYmUgY2FsbGVkIHVubGVzcyB0aGUgdmFsdWUgY2hhbmdlc1xuICAgICAgICAgICBleHBlY3Qoc2NvcGUuY291bnRlcikudG9FcXVhbCgxKTtcblxuICAgICAgICAgICBzY29wZS5uYW1lID0gJ2FkYW0nO1xuICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7XG4gICAgICAgICAgIGV4cGVjdChzY29wZS5jb3VudGVyKS50b0VxdWFsKDIpO1xuICAgICAgICogYGBgXG4gICAgICAgKlxuICAgICAgICovXG4gICAgICAkZGlnZXN0OiBmdW5jdGlvbigpIHtcbiAgICAgICAgdmFyIHdhdGNoLCB2YWx1ZSwgbGFzdCwgZm4sIGdldCxcbiAgICAgICAgICAgIHdhdGNoZXJzLFxuICAgICAgICAgICAgZGlydHksIHR0bCA9IFRUTCxcbiAgICAgICAgICAgIG5leHQsIGN1cnJlbnQsIHRhcmdldCA9IGFzeW5jUXVldWUubGVuZ3RoID8gJHJvb3RTY29wZSA6IHRoaXMsXG4gICAgICAgICAgICB3YXRjaExvZyA9IFtdLFxuICAgICAgICAgICAgbG9nSWR4LCBhc3luY1Rhc2s7XG5cbiAgICAgICAgYmVnaW5QaGFzZSgnJGRpZ2VzdCcpO1xuICAgICAgICAvLyBDaGVjayBmb3IgY2hhbmdlcyB0byBicm93c2VyIHVybCB0aGF0IGhhcHBlbmVkIGluIHN5bmMgYmVmb3JlIHRoZSBjYWxsIHRvICRkaWdlc3RcbiAgICAgICAgJGJyb3dzZXIuJCRjaGVja1VybENoYW5nZSgpO1xuXG4gICAgICAgIGlmICh0aGlzID09PSAkcm9vdFNjb3BlICYmIGFwcGx5QXN5bmNJZCAhPT0gbnVsbCkge1xuICAgICAgICAgIC8vIElmIHRoaXMgaXMgdGhlIHJvb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gICAgICAgICAgICAgICAgICBpZiAod2F0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgZ2V0ID0gd2F0Y2guZ2V0O1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHZhbHVlID0gZ2V0KGN1cnJlbnQpKSAhPT0gKGxhc3QgPSB3YXRjaC5sYXN0KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgISh3YXRjaC5lcVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gZXF1YWxzKHZhbHVlLCBsYXN0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKGlzTnVtYmVyTmFOKHZhbHVlKSAmJiBpc051bWJlck5hTihsYXN0KSkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgZGlydHkgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICAgIGxhc3REaXJ0eVdhdGNoID0gd2F0Y2g7XG4gICAgICAgICAgICAgICAgICAgICAgd2F0Y2gubGFzdCA9IHdhdGNoLmVxID8gY29weSh2YWx1ZSwgbnVsbCkgOiB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgICBmbiA9IHdhdGNoLmZuO1xuICAgICAgICAgICAgICAgICAgICAgIGZuKHZhbHVlLCAoKGxhc3QgPT09IGluaXRXYXRjaFZhbCkgPyB2YWx1ZSA6IGxhc3QpLCBjdXJyZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICBpZiAodHRsIDwgNSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbG9nSWR4ID0gNCAtIHR0bDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghd2F0Y2hMb2dbbG9nSWR4XSkgd2F0Y2hMb2dbbG9nSWR4XSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2F0Y2hMb2dbbG9nSWR4XS5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnOiBpc0Z1bmN0aW9uKHdhdGNoLmV4cCkgPyAnZm46ICcgKyAod2F0Y2guZXhwLm5hbWUgfHwgd2F0Y2guZXhwLnRvU3RyaW5nKCkpIDogd2F0Y2guZXhwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdWYWw6IHZhbHVlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRWYWw6IGxhc3RcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3YXRjaCA9PT0gbGFzdERpcnR5V2F0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgbW9zdCByZWNlbnRseSBkaXJ0eSB3YXRjaGVyIGlzIG5vdyBjbGVhbiwgc2hvcnQgY2lyY3VpdCBzaW5jZSB0aGUgcmVtYWluaW5nIHdhdGNoZXJzXG4gICAgICAgICAgICAgICAgICAgICAgLy8gaGF2ZSBhbHJlYWR5IGJlZW4gdGVzdGVkLlxuICAgICAgICAgICAgICAgICAgICAgIGRpcnR5ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgYnJlYWsgdHJhdmVyc2VTY29wZXNMb29wO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIEluc2FuaXR5IFdhcm5pbmc6IHNjb3BlIGRlcHRoLWZpcnN0IHRyYXZlcnNhbFxuICAgICAgICAgICAgLy8geWVzLCB0aGlzIGNvZGUgaXMgYSBiaXQgY3JhenksIGJ1dCBpdCB3b3JrcyBhbmQgd2UgaGF2ZSB0ZXN0cyB0byBwcm92ZSBpdCFcbiAgICAgICAgICAgIC8vIHRoaXMgcGllY2Ugc2hvdWxkIGJlIGtlc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IHtcbiAgICAgICAgICAgICAgICBldmVudC5kZWZhdWx0UHJldmVudGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgZGVmYXVsdFByZXZlbnRlZDogZmFsc2VcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBsaXN0ZW5lckFyZ3MgPSBjb25jYXQoW2V2ZW50XSwgYXJndW1lbnRzLCAxKSxcbiAgICAgICAgICAgIGksIGxlbmd0aDtcblxuICAgICAgICBkbyB7XG4gICAgICAgICAgbmFtZWRMaXN0ZW5lcnMgPSBzY29wZS4kJGxpc3RlbmVyc1tuYW1lXSB8fCBlbXB0eTtcbiAgICAgICAgICBldmVudC5jdXJyZW50U2NvcGUgPSBzY29wZTtcbiAgICAgICAgICBmb3IgKGkgPSAwLCBsZW5ndGggPSBuYW1lZExpc3RlbmVycy5sZW5ndGg7IGkgPCBsZW5ndGg7IGkrKykge1xuXG4gICAgICAgICAgICAvLyBpZiBsaXN0ZW5lcnMgd2VyZSBkZXJlZ2lzdGVyZWQsIGRlZnJhZ21lbnQgdGhlIGFycmF5XG4gICAgICAgICAgICBpZiAoIW5hbWVkTGlzdGVuZXJzW2ldKSB7XG4gICAgICAgICAgICAgIG5hbWVkTGlzdGVuZXJzLnNwbGljZShpLCAxKTtcbiAgICAgICAgICAgICAgaS0tO1xuICAgICAgICAgICAgICBsZW5ndGgtLTtcbiAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAvL2FsbG93IGFsbCBsaXN0ZW5lcnMgYXR0YWNoZWQgdG8gdGhlIGN1cnJlbnQgc2NvcGUgdG8gcnVuXG4gICAgICAgICAgICAgIG5hbWVkTGlzdGVuZXJzW2ldLmFwcGx5KG51bGwsIGxpc3RlbmVyQXJncyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1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ICAgICAgICAgIGxlbmd0aC0tO1xuICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgbGlzdGVuZXJzW2ldLmFwcGx5KG51bGwsIGxpc3RlbmVyQXJncyk7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIEluc2FuaXR5IFdhcm5pbmc6IHNjb3BlIGRlcHRoLWZpcnN0IHRyYXZlcnNhbFxuICAgICAgICAgIC8vIHllcywgdGhpcyBjb2RlIGlzIGEgYml0IGNyYXp5LCBidXQgaXQgd29ya3MgYW5kIHdlIGhhdmUgdGVzdHMgdG8gcHJvdmUgaXQhXG4gICAgICAgICAgLy8gdGhpcyBwaWVjZSBzaG91bGQgYmUga2VwdCBpbiBzeW5jIHdpdGggdGhlIHRyYXZlcnNhbCBpbiAkZGlnZXN0XG4gICAgICAgICAgLy8gKHRob3VnaCBpdCBkaWZmZXJzIGR1ZSB0byBoYXZpbmcgdGhlIGV4dHJhIGNoZWNrIGZvciAkJGxpc3RlbmVyQ291bnQgYW5kXG4gICAgICAgICAgLy8gZG9lcyBub3QgY2hlY2sgJCRzdXNwZW5kZWQpXG4gICAgICAgICAgaWYgKCEobmV4dCA9ICgoY3VycmVudC4kJGxpc3RlbmVyQ291bnRbbmFtZV0gJiYgY3VycmVudC4kJGNoaWxkSGVhZCkgfHxcbiAgICAgICAgICAgICAgKGN1cnJlbnQgIT09IHRhcmdldCAmJiBjdXJyZW50LiQkbmV4dFNpYmxpbmcpKSkpIHtcbiAgICAgICAgICAgIHdoaWxlIChjdXJyZW50ICE9PSB0YXJnZXQgJiYgIShuZXh0ID0gY3VycmVudC4kJG5leHRTaWJsaW5nKSkge1xuICAgICAgICAgICAgICBjdXJyZW50ID0gY3VycmVudC4kc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bCAhPT0gJycgJiYgIW5vcm1hbGl6ZWRWYWwubWF0Y2gocmVnZXgpKSB7XG4gICAgICAgIHJldHVybiAndW5zYWZlOicgKyBub3JtYWxpemVkVmFsO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHVyaTtcbiAgICB9O1xuICB9O1xufVxuXG4vKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqICogKiAqXG4gKiAgICAgQW55IGNvbW1pdHMgdG8gdGhpcyBmaWxlIHNob3VsZCBiZSByZXZpZXdlZCB3aXRoIHNlY3VyaXR5IGluIG1pbmQuICAqXG4gKiAgIENoYW5nZXMgdG8gdGhpcyBmaWxlIGNhbiBwb3RlbnRpYWxseSBjcmVhdGUgc2VjdXJpdHkgdnVsbmVyYWJpbGl0aWVzLiAqXG4gKiAgICAgICAgICBBbiBhcHByb3ZhbCBmcm9tIDIgQ29yZSBtZW1iZXJzIHdpdGggaGlzdG9yeSBvZiBtb2RpZnlpbmcgICAgICAqXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIGZpbGUgaXMgcmVxdWlyZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAqXG4gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqXG4gKiAgRG9lcyB0aGUgY2hhbmdlIHNvbWVob3cgYWxsb3cgZm9yIGFyYml0cmFyeSBqYXZhc2NyaXB0IHRvIGJlIGV4ZWN1dGVkPyAqXG4gKiAgICBPciBhbGxvd3MgZm9yIHNvbWVvbmUgdG8gY2hhbmdlIHRoZSBwcm90b3R5cGUgb2YgYnVpbHQtaW4gb2JqZWN0cz8gICAqXG4gKiAgICAgT3IgZ2l2ZXMgdW5kZXNpcmVkIGFjY2VzcyB0byB2YXJpYWJsZXMgbGlrZXMgZG9jdW1lbnQgb3Igd2luZG93PyAgICAqXG4gKiAqICogKiAqIC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oJyRiaW5kaW5nJyk7XG4gICAgICAgIGlmIChkYXRhQmluZGluZykge1xuICAgICAgICAgIGZvckVhY2goZGF0YUJpbmRpbmcsIGZ1bmN0aW9uKGJpbmRpbmdOYW1lKSB7XG4gICAgICAgICAgICBpZiAob3B0X2V4YWN0TWF0Y2gpIHtcbiAgICAgICAgICAgICAgdmFyIG1hdGNoZXIgPSBuZXcgUmVnRXhwKCcoXnxcXFxccyknICsgZXNjYXBlRm9yUmVnZXhwKGV4cHJlc3Npb24pICsgJyhcXFxcc3xcXFxcfHwkKScpO1xuICAgICAgICAgICAgICBpZiAobWF0Y2hlci50ZXN0KGJpbmRpbmdOYW1lKSkge1xuICAgICAgICAgICAgICAgIG1hdGNoZXMucHVzaChiaW5kaW5nKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgaWYgKGJpbmRpbmdOYW1lLmluZGV4T2YoZXhwcmVzc2lvbikgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgbWF0Y2hlcy5wdXNoKGJpbmRpbmcpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgcmV0dXJuIG1hdGNoZXM7XG4gICAgfTtcblxuICAgIC8qKlxuICAgICAqIEBuYW1lICQkdGVzdGFiaWxpdHkjZmluZE1vZGVsc1xuICAgICAqXG4gICAgICogQGRlc2NyaXB0aW9uXG4gICAgICogUmV0dXJucyBhbiBhcnJheSBvZiBlbGVtZW50cyB0aGF0IGFyZSB0d28td2F5IGZvdW5kIHZpYSBuZy1tb2RlbCB0b1xuICAgICAqIGV4cHJlc3Npb25zIG1hdGNoaW5nIHRoZSBpbnB1dC5cbiAgICAgKlxuICAgICAqIEBwYXJhbSB7RWxlbWVudH0gZWxlbWVudCBUaGUgZWxlbWVudCByb290IHRvIHNlYXJjaCBmcm9tLlxuICAgICAqIEBwYXJhbSB7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3MgPSBzbGljZUFyZ3MoYXJndW1lbnRzLCAzKSxcbiAgICAgICAgICBza2lwQXBwbHkgPSAoaXNEZWZpbmVkKGludm9rZUFwcGx5KSAmJiAhaW52b2tlQXBwbHkpLFxuICAgICAgICAgIGRlZmVycmVkID0gKHNraXBBcHBseSA/ICQkcSA6ICRxKS5kZWZlcigpLFxuICAgICAgICAgIHByb21pc2UgPSBkZWZlcnJlZC5wcm9taXNlLFxuICAgICAgICAgIHRpbWVvdXRJZDtcblxuICAgICAgdGltZW91dElkID0gJGJyb3dzZXIuZGVmZXIoZnVuY3Rpb24oKSB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShmbi5hcHBseShudWxsLCBhcmdzKSk7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZSk7XG4gICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSk7XG4gICAgICAgIH0gZmluYWxseSB7XG4gICAgICAgICAgZGVsZXRlIGRlZmVycmVkc1twcm9taXNlLiQkdGltZW91dElkXTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghc2tpcEFwcGx5KSAkcm9vdFNjb3BlLiRhcHBseSgpO1xuICAgICAgfSwgZGVsYXksICckdGltZW91dCcpO1xuXG4gICAgICBwcm9taXNlLiQkdGltZW91dElkID0gdGltZW91dElkO1xuICAgICAgZGVmZXJyZWRzW3RpbWVvdXRJZF0gPSBkZWZlcnJlZDtcblxuICAgICAgcmV0dXJuIHByb21pc2U7XG4gICAgfVxuXG5cbiAgICAvKipcbiAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICogQG5hbWUgJHRpbWVvdXQjY2FuY2VsXG4gICAgICpcbiAgICAgKiBAZGVzY3JpcHRpb25cbiAgICAgKiBDYW5jZWxzIGEgdGFzayBhc3NvY2lhdGVkIHdpdGggdGhlIGBwcm9taXNlYC4gQXMgYSByZXN1bHQgb2Yg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dGhlIHByb3ZpZGVkIFVSTCBpZiBpdCB3YXMgbm90IGFuIGFic29sdXRlIFVSTCB8XG4gKiAgIHwgcHJvdG9jb2wgICAgICB8IFRoZSBwcm90b2NvbCB3aXRob3V0IHRoZSB0cmFpbGluZyBjb2xvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogICB8IGhvc3QgICAgICAgICAgfCBUaGUgaG9zdCBhbmQgcG9ydCAoaWYgdGhlIHBvcnQgaXMgbm9uLWRlZmF1bHQpIG9mIHRoZSBub3JtYWxpemVkVXJsICAgIHxcbiAqICAgfCBzZWFyY2ggICAgICAgIHwgVGhlIHNlYXJjaCBwYXJhbXMsIG1pbnVzIHRoZSBxdWVzdGlvbiBtYXJrICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gKiAgIHwgaGFzaCAgICAgICAgICB8IFRoZSBoYXNoIHN0cmluZywgbWludXMgdGhlIGhhc2ggc3ltYm9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfFxuICogICB8IGhvc3RuYW1lICAgICAgfCBUaGUgaG9zdG5hbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICAgfCBwb3J0ICAgICAgICAgIHwgVGhlIHBvcnQsIHdpdGhvdXQgXCI6XCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqICAgfCBwYXRobmFtZSAgICAgIHwgVGhlIHBhdGhuYW1lLCBiZWdpbm5pbmcgd2l0aCBcIi9cIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxcbiAqXG4gKi9cbmZ1bmN0aW9uIHVybFJlc29sdmUodXJsKSB7XG4gIGlmICghaXNTdHJpbmcodXJsKSkgcmV0dXJuIHVybDtcblxuICB2YXIgaHJlZiA9IHVybDtcblxuICAvLyBTdXBwb3J0OiBJRSA5LTExIG9ubHlcbiAgaWYgKG1z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WVzID0ge307XG4gIHZhciBsYXN0Q29va2llU3RyaW5nID0gJyc7XG5cbiAgZnVuY3Rpb24gc2FmZUdldENvb2tpZShyYXdEb2N1bWVudCkge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gcmF3RG9jdW1lbnQuY29va2llIHx8ICcnO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgIHJldHVybiAnJztcbiAgICB9XG4gIH1cblxuICBmdW5jdGlvbiBzYWZlRGVjb2RlVVJJQ29tcG9uZW50KHN0cikge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gZGVjb2RlVVJJQ29tcG9uZW50KHN0cik7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmV0dXJuIHN0cjtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gZnVuY3Rpb24oKSB7XG4gICAgdmFyIGNvb2tpZUFycmF5LCBjb29raWUsIGksIGluZGV4LCBuYW1lO1xuICAgIHZhciBjdXJyZW50Q29va2llU3RyaW5nID0gc2FmZUdldENvb2tpZShyYXdEb2N1bWVudCk7XG5cbiAgICBpZiAoY3VycmVudENvb2tpZVN0cmluZyAhPT0gbGFzdENvb2tpZVN0cmluZykge1xuICAgICAgbGFzdENvb2tpZVN0cmluZyA9IGN1cnJlbnRDb29raWVTdHJpbmc7XG4gICAgICBjb29raWVBcnJheSA9IGxhc3RDb29raWVTdHJpbmcuc3BsaXQoJzsgJyk7XG4gICAgICBsYXN0Q29va2llcyA9IHt9O1xuXG4gICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llQXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgY29va2llID0gY29va2llQXJyYXlbaV07XG4gICAgICAgIGluZGV4ID0gY29va2llLmluZGV4T2YoJz0nKTtcbiAgICAgICAgaWYgKGluZGV4ID4gMCkgeyAvL2lnbm9yZSBuYW1lbGVzcyBjb29raWVzXG4gICAgICAgICAgbmFtZSA9IHNhZmVEZWNvZGVVUklDb21wb25lbnQoY29va2llLnN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haW5zdCBhbnkgcHJvcGVydHkuXG4gKiAgICAgQnkgZGVmYXVsdCBgJGAuXG4gKlxuICogQGV4YW1wbGVcbiAgIDxleGFtcGxlIG5hbWU9XCJmaWx0ZXItZmlsdGVyXCI+XG4gICAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gICAgICAgPGRpdiBuZy1pbml0PVwiZnJpZW5kcyA9IFt7bmFtZTonSm9obicsIHBob25lOic1NTUtMTI3Nid9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7bmFtZTonTWFyeScsIHBob25lOic4MDAtQklHLU1BUlknfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J01pa2UnLCBwaG9uZTonNTU1LTQzMjEnfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J0FkYW0nLCBwaG9uZTonNTU1LTU2NzgnfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge25hbWU6J0p1bGllJywgcGhvbmU6JzU1NS04NzY1J30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtuYW1lOidKdWxpZXR0ZScsIHBob25lOic1NTUtNTY3OCd9XVwiPjwvZGl2PlxuXG4gICAgICAgPGxhYmVsPlNlYXJjaDogPGlucHV0IG5nLW1vZGVsPVwic2VhcmNoVGV4dFwiPjwvbGFiZWw+XG4gICAgICAgPHRhYmxlIGlkPVwic2VhcmNoVGV4dFJlc3VsdHNcIj5cbiAgICAgICAgIDx0cj48dGg+TmFtZTwvdGg+PHRoPlBob25lPC90aD48L3RyPlxuICAgICAgICAgPHRyIG5nLXJlcGVhdD1cImZyaWVuZCBpbiBmcmllbmRzIHwgZmlsdGVyOnNlYXJjaFRleHRcIj5cbiAgICAgICAgICAgPHRkPnt7ZnJpZW5kLm5hbWV9fTwvdGQ+XG4gICAgICAgICAgIDx0ZD57e2ZyaWVuZC5waG9uZX19PC90ZD5cbiAgICAgICAgIDwvdHI+XG4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BlLmZyaWVuZHMgPSBbXG4gICAgICAgICAgICAge25hbWU6ICdKb2huJywgICBwaG9uZTogJzU1NS0xMjEyJywgIGFnZTogMTB9LFxuICAgICAgICAgICAgIHtuYW1lOiAnTWFyeScsICAgcGhvbmU6ICc1NTUtOTg3NicsICBhZ2U6IDE5fSxcbiAgICAgICAgICAgICB7bmFtZTogJ01pa2UnLCAgIHBob25lOiAnNTU1LTQzMjEnLCAgYWdlOiAyMX0sXG4gICAgICAgICAgICAge25hbWU6ICdBZGFtJywgICBwaG9uZTogJzU1NS01Njc4JywgIGFnZTogMzV9LFxuICAgICAgICAgICAgIHtuYW1lOiAnSnVsaWUnLCAgcGhvbmU6ICc1NTUtODc2NScsICBhZ2U6IDI5fVxuICAgICAgICAgICBdO1xuICAgICAgICAgfV0pO1xuICAgICA8L2ZpbGU+XG4gICAgIDxmaWxlIG5hbWU9XCJzdHlsZS5jc3NcIj5cbiAgICAgICAuZnJpZW5kcyB7XG4gICAgICAgICBib3JkZXItY29sbGFwc2U6IGNvbGxhcHNlO1xuICAgICAgIH1cblxuICAgICAgIC5mcmllbmRzIHRoIHtcbiAgICAgICAgIGJvcmRlci1ib3R0b206IDFweCBzb2xpZDtcbiAgICAgICB9XG4gICAgICAgLmZyaWVuZHMgdGQsIC5mcmllbmRzIHRoIHtcbiAgICAgICAgIGJvcmRlci1sZWZ0OiAxcHggc29saWQ7XG4gICAgICAgICBwYWRkaW5nOiA1cHggMTBweDtcbiAgICAgICB9XG4gICAgICAgLmZyaWVuZHMgdGQ6Zmlyc3QtY2hpbGQsIC5mcmllbmRzIHRoOmZpcnN0LWNoaWxkIHtcbiAgICAgICAgIGJvcmRlci1sZWZ0OiBub25lO1xuICAgICAgIH1cbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gICAgICAgLy8gRWxlbWVudCBsb2NhdG9yc1xuICAgICAgIHZhciBuY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DM1fSxcbiAgICAgICAgICAgICB7bmFtZTogJ0p1bGllJywgIHBob25lOiAnNTU1LTg3NjUnLCAgYWdlOiAyOX1cbiAgICAgICAgICAgXTtcblxuICAgICAgICAgICAkc2NvcGUucHJvcGVydHlOYW1lID0gJ2FnZSc7XG4gICAgICAgICAgICRzY29wZS5yZXZlcnNlID0gdHJ1ZTtcbiAgICAgICAgICAgJHNjb3BlLmZyaWVuZHMgPSBmcmllbmRzO1xuXG4gICAgICAgICAgICRzY29wZS5zb3J0QnkgPSBmdW5jdGlvbihwcm9wZXJ0eU5hbWUpIHtcbiAgICAgICAgICAgICAkc2NvcGUucmV2ZXJzZSA9ICgkc2NvcGUucHJvcGVydHlOYW1lID09PSBwcm9wZXJ0eU5hbWUpID8gISRzY29wZS5yZXZlcnNlIDogZmFsc2U7XG4gICAgICAgICAgICAgJHNjb3BlLnByb3BlcnR5TmFtZSA9IHByb3BlcnR5TmFtZTtcbiAgICAgICAgICAgfTtcbiAgICAgICAgIH1dKTtcbiAgICAgPC9maWxlPlxuICAgICA8ZmlsZSBuYW1lPVwic3R5bGUuY3NzXCI+XG4gICAgICAgLmZyaWVuZHMge1xuICAgICAgICAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTtcbiAgICAgICB9XG5cbiAgICAgICAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQ7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkLCAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItbGVmdDogMXB4IHNvbGlkO1xuICAgICAgICAgcGFkZGluZzogNXB4IDEwcHg7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkOmZpcnN0LWNoaWxkLCAuZnJpZW5kcyB0aDpmaXJzdC1jaGlsZCB7XG4gICAgICAgICBib3JkZXItbGVmdDogbm9uZTtcbiAgICAgICB9XG5cbiAgICAgICAuc29ydG9yZGVyOmFmdGVyIHtcbiAg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AgICAgICAgICAgICAgPHRoPk5hbWU8L3RoPlxuICAgICAgICAgICAgICAgPHRoPkZhdm9yaXRlIExldHRlcjwvdGg+XG4gICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICA8dHIgbmctcmVwZWF0PVwiZnJpZW5kIGluIGZyaWVuZHMgfCBvcmRlckJ5OidmYXZvcml0ZUxldHRlcic6ZmFsc2U6bG9jYWxlU2Vuc2l0aXZlQ29tcGFyYXRvclwiPlxuICAgICAgICAgICAgICAgPHRkPnt7ZnJpZW5kLm5hbWV9fTwvdGQ+XG4gICAgICAgICAgICAgICA8dGQ+e3tmcmllbmQuZmF2b3JpdGVMZXR0ZXJ9fTwvdGQ+XG4gICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgPC90YWJsZT5cbiAgICAgICAgIDwvZGl2PlxuICAgICAgICAgPGRpdiBjbGFzcz1cImZyaWVuZHMtY29udGFpbmVyIGRlZmF1bHQtY29tcGFyYXRvclwiPlxuICAgICAgICAgICA8aDM+RGVmYXVsdCBDb21wYXJhdG9yPC9oMz5cbiAgICAgICAgICAgPHRhYmxlIGNsYXNzPVwiZnJpZW5kc1wiPlxuICAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgIDx0aD5OYW1lPC90aD5cbiAgICAgICAgICAgICAgIDx0aD5GYXZvcml0ZSBMZXR0ZXI8L3RoPlxuICAgICAgICAgICAgIDwvdHI+XG4gICAgICAgICAgICAgPHRyIG5nLXJlcGVhdD1cImZyaWVuZCBpbiBmcmllbmRzIHwgb3JkZXJCeTonZmF2b3JpdGVMZXR0ZXInXCI+XG4gICAgICAgICAgICAgICA8dGQ+e3tmcmllbmQubmFtZX19PC90ZD5cbiAgICAgICAgICAgICAgIDx0ZD57e2ZyaWVuZC5mYXZvcml0ZUxldHRlcn19PC90ZD5cbiAgICAgICAgICAgICA8L3RyPlxuICAgICAgICAgICA8L3RhYmxlPlxuICAgICAgICAgPC9kaXY+XG4gICAgICAgPC9kaXY+XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cInNjcmlwdC5qc1wiPlxuICAgICAgIGFuZ3VsYXIubW9kdWxlKCdvcmRlckJ5RXhhbXBsZTQnLCBbXSlcbiAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICRzY29wZS5mcmllbmRzID0gW1xuICAgICAgICAgICAgIHtuYW1lOiAnSm9obicsICAgZmF2b3JpdGVMZXR0ZXI6ICfDhCd9LFxuICAgICAgICAgICAgIHtuYW1lOiAnTWFyeScsICAgZmF2b3JpdGVMZXR0ZXI6ICfDnCd9LFxuICAgICAgICAgICAgIHtuYW1lOiAnTWlrZScsICAgZmF2b3JpdGVMZXR0ZXI6ICfDlid9LFxuICAgICAgICAgICAgIHtuYW1lOiAnQWRhbScsICAgZmF2b3JpdGVMZXR0ZXI6ICdIJ30sXG4gICAgICAgICAgICAge25hbWU6ICdKdWxpZScsICBmYXZvcml0ZUxldHRlcjogJ1onfVxuICAgICAgICAgICBdO1xuXG4gICAgICAgICAgICRzY29wZS5sb2NhbGVTZW5zaXRpdmVDb21wYXJhdG9yID0gZnVuY3Rpb24odjEsIHYyKSB7XG4gICAgICAgICAgICAgLy8gSWYgd2UgZG9uJ3QgZ2V0IHN0cmluZ3MsIGp1c3QgY29tcGFyZSBieSBpbmRleFxuICAgICAgICAgICAgIGlmICh2MS50eXBlICE9PSAnc3RyaW5nJyB8fCB2Mi50eXBlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgcmV0dXJuICh2MS5pbmRleCA8IHYyLmluZGV4KSA/IC0xIDogMTtcbiAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAvLyBDb21wYXJlIHN0cmluZ3MgYWxwaGFiZXRpY2FsbHksIHRha2luZyBsb2NhbGUgaW50byBhY2NvdW50XG4gICAgICAgICAgICAgcmV0dXJuIHYxLnZhbHVlLmxvY2FsZUNvbXBhcmUodjIudmFsdWUpO1xuICAgICAgICAgICB9O1xuICAgICAgICAgfV0pO1xuICAgICA8L2ZpbGU+XG4gICAgIDxmaWxlIG5hbWU9XCJzdHlsZS5jc3NcIj5cbiAgICAgICAuZnJpZW5kcy1jb250YWluZXIge1xuICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgICAgICAgbWFyZ2luOiAwIDMwcHg7XG4gICAgICAgfVxuXG4gICAgICAgLmZyaWVuZHMge1xuICAgICAgICAgYm9yZGVyLWNvbGxhcHNlOiBjb2xsYXBzZTtcbiAgICAgICB9XG5cbiAgICAgICAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQ7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkLCAuZnJpZW5kcyB0aCB7XG4gICAgICAgICBib3JkZXItbGVmdDogMXB4IHNvbGlkO1xuICAgICAgICAgcGFkZGluZzogNXB4IDEwcHg7XG4gICAgICAgfVxuICAgICAgIC5mcmllbmRzIHRkOmZpcnN0LWNoaWxkLCAuZnJpZW5kcyB0aDpmaXJzdC1jaGlsZCB7XG4gICAgICAgICBib3JkZXItbGVmdDogbm9uZTtcbiAgICAgICB9XG4gICAgIDwvZmlsZT5cbiAgICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICAgICAgIC8vIEVsZW1lbnQgbG9jYXRvcnNcbiAgICAgICB2YXIgY29udGFpbmVyID0gZWxlbWVudChieS5jc3MoJy5jdXN0b20tY29tcGFyYXRvcicpKTtcbiAgICAgICB2YXIgbmFtZXMgPSBjb250YWluZXIuYWxsKGJ5LnJlcGVhdGVyKCdmcmllbmRzJykuY29sdW1uKCdmcmllbmQubmFtZScpKTtcblxuICAgICAgIGl0KCdzaG91bGQgc29ydCBmcmllbmRzIGJ5IGZhdm9yaXRlIGxldHRlciAoaW4gY29ycmVjd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WV2ZSB0aGUgcHJldmVudGlvbiBvZiB0aGUgZGVmYXVsdCBhY3Rpb24uXG4gICAgICAgICAgICAgIGZvcm1FbGVtZW50Lm9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgZm9ybUVsZW1lbnRbMF0ucmVtb3ZlRXZlbnRMaXN0ZW5lcignc3VibWl0JywgaGFuZGxlRm9ybVN1Ym1pc3Npb24pO1xuICAgICAgICAgICAgICAgIH0sIDAsIGZhbHNlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBwYXJlbnRGb3JtQ3RybCA9IGN0cmxzWzFdIHx8IGNvbnRyb2xsZXIuJCRwYXJlbnRGb3JtO1xuICAgICAgICAgICAgcGFyZW50Rm9ybUN0cmwuJGFkZENvbnRyb2woY29udHJvbGxlcik7XG5cbiAgICAgICAgICAgIHZhciBzZXR0ZXIgPSBuYW1lQXR0ciA/IGdldFNldHRlcihjb250cm9sbGVyLiRuYW1lKSA6IG5vb3A7XG5cbiAgICAgICAgICAgIGlmIChuYW1lQXR0cikge1xuICAgICAgICAgICAgICBzZXR0ZXIoc2NvcGUsIGNvbnRyb2xsZXIpO1xuICAgICAgICAgICAgICBhdHRyLiRvYnNlcnZlKG5hbWVBdHRyLCBmdW5jdGlvbihuZXdWYWx1ZSkge1xuICAgICAgICAgICAgICAgIGlmIChjb250cm9sbGVyLiRuYW1lID09PSBuZXdWYWx1ZSkgcmV0dXJuO1xuICAgICAgICAgICAgICAgIHNldHRlcihzY29wZSwgdW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLiQkcGFyZW50Rm9ybS4kJHJlbmFtZUNvbnRyb2woY29udHJvbGxlciwgbmV3VmFsdWUpO1xuICAgICAgICAgICAgICAgIHNldHRlciA9IGdldFNldHRlcihjb250cm9sbGVyL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bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICAgICAgJHNjb3BlLmV4YW1wbGUgPSB7XG4gICAgICAgICAgICAgICAgIHRleHQ6ICdndWVzdCcsXG4gICAgICAgICAgICAgICAgIHdvcmQ6IC9eXFxzKlxcdypcXHMqJC9cbiAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgfV0pO1xuICAgICAgICAgPC9zY3JpcHQ+XG4gICAgICAgICA8Zm9ybSBuYW1lPVwibXlGb3JtXCIgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgIDxsYWJlbD5TaW5nbGUgd29yZDpcbiAgICAgICAgICAgICA8aW5wdXQgdHlwZT1cInRleHRcIiBuYW1lPVwiaW5wdXRcIiBuZy1tb2RlbD1cImV4YW1wbGUudGV4dFwiXG4gICAgICAgICAgICAgICAgICAgIG5nLXBhdHRlcm49XCJleGFtcGxlLndvcmRcIiByZXF1aXJlZCBuZy10cmltPVwiZmFsc2VcIj5cbiAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICAgPGRpdiByb2xlPVwiYWxlcnRcIj5cbiAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImVycm9yXCIgbmctc2hvdz1cIm15Rm9ybS5pbnB1dC4kZXJyb3IucmVxdWlyZWRcIj5cbiAgICAgICAgICAgICAgIFJlcXVpcmVkITwvc3Bhbj5cbiAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImVycm9yXCIgbmctc2hvdz1cIm15Rm9ybS5pbnB1dC4kZXJyb3IucGF0dGVyblwiPlxuICAgICAgICAgICAgICAgU2luZ2xlIHdvcmQgb25seSE8L3NwYW4+XG4gICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICA8Y29kZT50ZXh0ID0ge3tleGFtcGxlLnRleHR9fTwvY29kZT48YnIvPlxuICAgICAgICAgICA8Y29kZT5teUZvcm0uaW5wdXQuJHZhbGlkID0ge3tteUZvcm0uaW5wdXQuJHZhbG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cbiAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGV4cGVjdCh2YWx1ZS5nZXRUZXh0KCkpLnRvQ29udGFpbignMTInKTtcbiAgICAgICAgICAgIGV4cGVjdCh2YWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIGVtcHR5JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpbnB1dC5jbGVhcigpO1xuICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJycpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbHVlLmdldFRleHQoKSkudG9FcXVhbCgndmFsdWUgPScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG92ZXIgbWF4JywgZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpbnB1dC5jbGVhcigpO1xuICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJzEyMycpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbHVlLmdldFRleHQoKSkudG9FcXVhbCgndmFsdWUgPScpO1xuICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIH0pO1xuICAgICAgICA8L2ZpbGU+XG4gICAgICA8L2V4YW1wbGU+XG4gICAqL1xuICAnbnVtYmVyJzogbnVtYmVySW5wdXRUeXBlLFxuXG5cbiAgLyoqXG4gICAqIEBuZ2RvYyBpbnB1dFxuICAgKiBAbmFtZSBpbnB1dFt1cmxdXG4gICAqXG4gICAqIEBkZXNjcmlwdGlvblxuICAgKiBUZXh0IG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1cImluZGV4Lmh0bWxcIj5cbiAgICAgICAgIDxzY3JpcHQ+XG4gICAgICAgICAgIGFuZ3VsYXIubW9kdWxlKCdyYWRpb0V4YW1wbGUnLCBbXSlcbiAgICAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICAgICAgICAgICAgICAgJHNjb3BlLmNvbG9yID0ge1xuICAgICAgICAgICAgICAgICBuYW1lOiAnYmx1ZSdcbiAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAkc2NvcGUuc3BlY2lhbFZhbHVlID0ge1xuICAgICAgICAgICAgICAgICBcImlkXCI6IFwiMTIzNDVcIixcbiAgICAgICAgICAgICAgICAgXCJ2YWx1ZVwiOiBcImdyZWVuXCJcbiAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgfV0pO1xuICAgICAgICAgPC9zY3JpcHQ+XG4gICAgICAgICA8Zm9ybSBuYW1lPVwibXlGb3JtXCIgbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgIDxsYWJlbD5cbiAgICAgICAgICAgICA8aW5wdXQgdHlwZT1cInJhZGlvXCIgbmctbW9kZWw9XCJjb2xvci5uYW1lXCIgdmFsdWU9XCJyZWRcIj5cbiAgICAgICAgICAgICBSZWRcbiAgICAgICAgICAgPC9sYWJlbD48YnIvPlxuICAgICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJyYWRpb1wiIG5nLW1vZGVsPVwiY29sb3IubmFtZVwiIG5nLXZhbHVlPVwic3BlY2lhbFZhbHVlXCI+XG4gICAgICAgICAgICAgR3JlZW5cbiAgICAgICAgICAgPC9sYWJlbD48YnIvPlxuICAgICAgICAgICA8bGFiZWw+XG4gICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJyYWRpb1wiIG5nLW1vZGVsPVwiY29sb3IubmFtZVwiI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iAgICAgICAgICBleHBlY3QoZm9ybVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpdCgnc2hvdWxkIGJlIHZhbGlkIGlmIGVtcHR5IHdoZW4gbWluIGxlbmd0aCBpcyBzZXQnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICB1c2VyTGFzdElucHV0LmNsZWFyKCk7XG4gICAgICAgICAgdXNlckxhc3RJbnB1dC5zZW5kS2V5cygnJyk7XG5cbiAgICAgICAgICBleHBlY3QodXNlci5nZXRUZXh0KCkpLnRvQ29udGFpbigne1wibmFtZVwiOlwiZ3Vlc3RcIixcImxhc3RcIjpcIlwifScpO1xuICAgICAgICAgIGV4cGVjdChsYXN0TmFtZVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7XG4gICAgICAgICAgZXhwZWN0KGZvcm1WYWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgbGVzcyB0aGFuIHJlcXVpcmVkIG1pbiBsZW5ndGgnLCBmdW5jdGlvbigpIHtcbiAgICAgICAgICB1c2VyTGFzdElucHV0LmNsZWFyKCk7XG4gICAgICAgICAgdXNlckxhc3RJbnB1dC5zZW5kS2V5cygneHgnKTtcblxuICAgICAgICAgIGV4cGVjdCh1c2VyLmdldFRleHQoKSkudG9Db250YWluKCd7XCJuYW1lXCI6XCJndWVzdFwifScpO1xuICAgICAgICAgIGV4cGVjdChsYXN0TmFtZVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIGV4cGVjdChsYXN0TmFtZUVycm9yLmdldFRleHQoKSkudG9Db250YWluKCdtaW5sZW5ndGgnKTtcbiAgICAgICAgICBleHBlY3QoZm9ybVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICB9KTtcblxuICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgbG9uZ2VyIHRoYW4gbWF4IGxlbmd0aCcsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHVzZXJMYXN0SW5wdXQuY2xlYXIoKTtcbiAgICAgICAgICB1c2VyTGFzdElucHV0LnNlbmRLZXlzKCdzb21lIHJpZGljdWxvdXNseSBsb25nIG5hbWUnKTtcblxuICAgICAgICAgIGV4cGVjdCh1c2VyLmdldFRleHQoKSkudG9Db250YWluKCd7XCJuYW1lXCI6XCJndWVzdFwifScpO1xuICAgICAgICAgIGV4cGVjdChsYXN0TmFtZVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICAgIGV4cGVjdChsYXN0TmFtZUVycm9yLmdldFRleHQoKSkudG9Db250YWluKCdtYXhsZW5ndGgnKTtcbiAgICAgICAgICBleHBlY3QoZm9ybVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpO1xuICAgICAgICB9KTtcbiAgICAgIDwvZmlsZT5cbiAgICA8L2V4YW1wbGU+XG4gKi9cbnZhciBpbnB1dERpcmVjdGl2ZSA9IFsnJGJyb3dzZXInLCAnJHNuaWZmZXInLCAnJGZpbHRlcicsICckcGFyc2UnLFxuICAgIGZ1bmN0aW9uKCRicm93c2VyLCAkc25pZmZlciwgJGZpbHRlciwgJHBhcnNlKSB7XG4gIHJldHVybiB7XG4gICAgcmVzdHJpY3Q6ICdFJyxcbiAgICByZXF1aXJlOiBbJz9uZ01vZGVsJ10sXG4gICAgbGluazoge1xuICAgICAgcHJlOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybHMpIHtcbiAgICAgICAgaWYgKGN0cmxzWzBdKSB7XG4gICAgICAgICAgKGlucHV0VHlwZVtsb3dlcmNhc2UoYXR0ci50eXBlKV0gfHwgaW5wdXRUeXBlLnRleHQpKHNjb3BlLCBlbGVtZW50LCBhdHRyLC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biAgICAgICAgICAgIH1dKTtcbiAgICAgICA8L3NjcmlwdD5cbiAgICAgICAgPGZvcm0gbmctY29udHJvbGxlcj1cIkV4YW1wbGVDb250cm9sbGVyXCI+XG4gICAgICAgICAgPGgyPldoaWNoIGlzIHlvdXIgZmF2b3JpdGU/PC9oMj5cbiAgICAgICAgICAgIDxsYWJlbCBuZy1yZXBlYXQ9XCJuYW1lIGluIG5hbWVzXCIgZm9yPVwie3tuYW1lfX1cIj5cbiAgICAgICAgICAgICAge3tuYW1lfX1cbiAgICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJyYWRpb1wiXG4gICAgICAgICAgICAgICAgICAgICBuZy1tb2RlbD1cIm15LmZhdm9yaXRlXCJcbiAgICAgICAgICAgICAgICAgICAgIG5nLXZhbHVlPVwibmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICBpZD1cInt7bmFtZX19XCJcbiAgICAgICAgICAgICAgICAgICAgIG5hbWU9XCJmYXZvcml0ZVwiPlxuICAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICA8ZGl2PllvdSBjaG9zZSB7e215LmZhdm9yaXRlfX08L2Rpdj5cbiAgICAgICAgPC9mb3JtPlxuICAgICAgPC9maWxlPlxuICAgICAgPGZpbGUgbmFtZT1cInByb3RyYWN0b3IuanNcIiB0eXBlPVwicHJvdHJhY3RvclwiPlxuICAgICAgICB2YXIgZmF2b3JpdGUgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ215LmZhdm9yaXRlJykpO1xuXG4gICAgICAgIGl0KCdzaG91bGQgaW5pdGlhbGl6ZSB0byBtb2RlbCcsIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIGV4cGVjdChmYXZvcml0ZS5nZXRUZXh0KCkpLnRvQ29udGFpbigndW5pY29ybnMnKTtcbiAgICAgICAgfSk7XG4gICAgICAgIGl0KCdzaG91bGQgYmluZCB0aGUgdmFsdWVzIHRvIHRoZSBpbnB1dHMnLCBmdW5jdGlvbigpIHtcbiAgICAgIC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29udGFjdDpcbiAqICAgICA8dWw+XG4gKiAgICAgICA8bGkgbmctcmVwZWF0PVwiY29udGFjdCBpbiBjb250YWN0c1wiPlxuICogICAgICAgICA8c2VsZWN0IG5nLW1vZGVsPVwiY29udGFjdC50eXBlXCIgaWQ9XCJzZWxlY3Rfe3skaW5kZXh9fVwiPlxuICogICAgICAgICAgICA8b3B0aW9uPnBob25lPC9vcHRpb24+XG4gKiAgICAgICAgICAgIDxvcHRpb24+ZW1haWw8L29wdGlvbj5cbiAqICAgICAgICAgPC9zZWxlY3Q+XG4gKiAgICAgICAgIDxpbnB1dCB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwiY29udGFjdC52YWx1ZVwiIGFyaWEtbGFiZWxsZWRieT1cInNlbGVjdF97eyRpbmRleH19XCIgLz5cbiAqICAgICAgICAgPGJ1dHRvbiBuZy1jbGljaz1cImNsZWFyQ29udGFjdChjb250YWN0KVwiPmNsZWFyPC9idXR0b24+XG4gKiAgICAgICAgIDxidXR0b24gbmctY2xpY2s9XCJyZW1vdmVDb250YWN0KGNvbnRhY3QpXCI+WDwvYnV0dG9uPlxuICogICAgICAgPC9saT5cbiAqICAgICAgIDxsaT5bIDxidXR0b24gbmctY2xpY2s9XCJhZGRDb250YWN0KClcIj5hZGQ8L2J1dHRvbj4gXTwvbGk+XG4gKiAgICA8L3VsPlxuICogICA8L2Rpdj5cbiAqICA8L2ZpbGU+XG4gKiAgPGZpbGUgbmFtZT1cImFwcC5qc1wiPlxuICogICBhbmd1bGFyLm1vZHVsZSgnY29udHJvbGxlckV4YW1wbGUnLCBbXSlcbiAqICAgICAuY29udHJvbGxlcignU2V0dGluZ3NDb250cm9sbGVyMicsIFsnJHNjb3BlJywgU2V0dGluZ3NDb250cm9sbGVyMl0pO1xuICpcbiAqICAgZnVuY3Rpb24gU2V0dGluZ3NDb250cm9sbGVyMigkc2NvcGUpIHtcbiAqICAgICAkc2NvcGUubmFtZSA9ICdKb2huIFNtaXRoJztcbiAqICAgICA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PVwidHJ1ZVwiPlxuICAgIDxmaWxlIG5hbWU9XCJpbmRleC5odG1sXCI+XG4gICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9XCJNYWluQ29udHJvbGxlciBhcyBjdHJsXCI+XG4gICAgICAgIDxkaXY+XG4gICAgICAgICAgPGJ1dHRvbiBuZy1jbGljaz1cImN0cmwuaW5jKClcIiBpZD1cImluY1wiPkluY3JlbWVudDwvYnV0dG9uPlxuICAgICAgICAgIDxzcGFuIGlkPVwiY291bnRlclwiPlxuICAgICAgICAgICAge3tjdHJsLmNvdW50ZXJ9fVxuICAgICAgICAgIDwvc3Bhbj5cbiAgICAgICAgPC9kaXY+XG5cbiAgICAgICAgPGRpdj5cbiAgICAgICAgICA8YnV0dG9uIG5nLWNsaWNrPVwiY3RybC5ldmlsKClcIiBpZD1cImV2aWxcIj5FdmlsPC9idXR0b24+XG4gICAgICAgICAgPHNwYW4gaWQ9XCJldmlsRXJyb3JcIj5cbiAgICAgICAgICAgIHt7Y3RybC5ldmlsRXJyb3J9fVxuICAgICAgICAgIDwvc3Bhbj5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2Rpdj5cbiAgICA8L2ZpbGU+XG4gICAgPGZpbGUgbmFtZT1cInNjcmlwdC5qc1wiPlxuICAgICAgIGFuZ3VsYXIubW9kdWxlKCdjc3BFeGFtcGxlJywgW10pXG4gICAgICAgICAuY29udHJvbGxlcignTWFpbkNvbnRyb2xsZXInLCBmdW5jdGlvbiBNYWluQ29udHJvbGxlcigpIHtcbiAgICAgICAgICAgIHRoaXMuY291bnRlciA9IDA7XG4gICAgICAgICAgICB0aGlzLmluYyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB0aGlzLmNvdW50ZXIrKztcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB0aGlzLmV2aWwgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICBldmFsKCcxKzInKTsgLy8gZ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G4gICAgICAgICAgICAgICAgYmxvY2sgPSB7XG4gICAgICAgICAgICAgICAgICBjbG9uZTogY2xvbmVcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCAkZWxlbWVudC5wYXJlbnQoKSwgJGVsZW1lbnQpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHByZXZpb3VzRWxlbWVudHMpIHtcbiAgICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50cy5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50cyA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2hpbGRTY29wZSkge1xuICAgICAgICAgICAgICBjaGlsZFNjb3BlLiRkZXN0cm95KCk7XG4gICAgICAgICAgICAgIGNoaWxkU2NvcGUgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG4gICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMgPSBnZXRCbG9ja05vZGVzKGJsb2NrLmNsb25lKTtcbiAgICAgICAgICAgICAgJGFuaW1hdGUubGVhdmUocHJldmlvdXNFbGVtZW50cykuZG9uZShmdW5jdGlvbihyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZSAhPT0gZmFsc2UpIHByZXZpb3VzRWxlbWVudHMgPSBudWxsO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgYmxvY2sgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuICB9O1xufV07XG5cbi8qKlxuICogQG5nZG9jIGRpcmVjdGl2ZVxuICogQG5hbWUgbmdJbmNsdWRlXG4gKiBAcmVzdHJpY3QgRUNBXG4gKiBAc2NvcGVcbiAqIEBwcmlv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W5nZUNvdW50ZXIgPSAwLFxuICAgICAgICAgICAgY3VycmVudFNjb3BlLFxuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50LFxuICAgICAgICAgICAgY3VycmVudEVsZW1lbnQ7XG5cbiAgICAgICAgdmFyIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICBpZiAocHJldmlvdXNFbGVtZW50KSB7XG4gICAgICAgICAgICBwcmV2aW91c0VsZW1lbnQucmVtb3ZlKCk7XG4gICAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBudWxsO1xuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAoY3VycmVudFNjb3BlKSB7XG4gICAgICAgICAgICBjdXJyZW50U2NvcGUuJGRlc3Ryb3koKTtcbiAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChjdXJyZW50RWxlbWVudCkge1xuICAgICAgICAgICAgJGFuaW1hdGUubGVhdmUoY3VycmVudEVsZW1lbnQpLmRvbmUoZnVuY3Rpb24ocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlICE9PSBmYWxzZSkgcHJldmlvdXNFbGVtZW50ID0gbnVsbDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcHJldmlvdXNFbGVtZW50ID0gY3VycmVudEVsZW1lbnQ7XG4gICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIHNjb3BlLiR3YXRjaChzcmNFeHAsIGZ1bmN0aW9uIG5nSW5jbHVkZVdhdGNoQWN0aW9uKHNyYykge1xuICAgICAgICAgIHZhciBhZnRlckFuaW1hdGlvbiA9IGZ1bmN0aW9uKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2UgIT09IGZhbHNlICYmIGlzRGVmaW5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lLlxuICAgICAgICAgICAgICAvLyBIb3dldmVyLCB1c2luZyBuZy1pbmNsdWRlIG9uIGFuIGVsZW1lbnQgd2l0aCBhZGRpdGlvbmFsIGNvbnRlbnQgZG9lcyBub3QgbWFrZSBzZW5zZS4uLlxuICAgICAgICAgICAgICAvLyBOb3RlOiBXZSBjYW4ndCByZW1vdmUgdGhlbSBpbiB0aGUgY2xvbmVBdHRjaEZuIG9mICR0cmFuc2NsdWRlIGFzIHRoYXRcbiAgICAgICAgICAgICAgLy8gZnVuY3Rpb24gaXMgY2FsbGVkIGJlZm9yZSBsaW5raW5nIHRoZSBjb250ZW50LCB3aGljaCB3b3VsZCBhcHBseSBjaGlsZFxuICAgICAgICAgICAgICAvLyBkaXJlY3RpdmVzIHRvIG5vbiBleGlzdGluZyBlbGVtZW50cy5cbiAgICAgICAgICAgICAgdmFyIGNsb25lID0gJHRyYW5zY2x1ZGUobmV3U2NvcGUsIGZ1bmN0aW9uKGNsb25lKSB7XG4gICAgICAgICAgICAgICAgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpO1xuICAgICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCBudWxsLCAkZWxlbWVudCkuZG9uZShhZnRlckFuaW1hdGlvbik7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG5ld1Njb3BlO1xuICAgICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IGNsb25lO1xuXG4gICAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50TG9hZGVkJywgc3JjKTtcbiAgICAgICAgICAgICAgc2NvcGUuJGV2YWwob25sb2FkRXhwKTtcbiAgICAgICAgICAgIH0sIGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAoc2NvcGUuJCRkZXN0cm95ZWQpIHJldHVybjtcblxuICAgICAgICAgICAgICBpZiAodGhpc0NoYW5nZUlkID09PSBjaG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aGF0Lml0ZW1zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICBpZiAodGhhdC5pdGVtc1tpXS5uYW1lID09PSB2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICBtYXRjaCA9IHRoYXQuaXRlbXNbaV07XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaDtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB0aGF0LnNlbGVjdEl0ZW0gPSBmdW5jdGlvbihpdGVtKSB7XG4gICAgICAgICAgICAgIG5nTW9kZWwuJHNldFZpZXdWYWx1ZShpdGVtKTtcbiAgICAgICAgICAgICAgbmdNb2RlbC4kcHJvY2Vzc01vZGVsVmFsdWUoKTtcbiAgICAgICAgICAgICAgdGhhdC5vblNlbGVjdCh7aXRlbTogaXRlbX0pO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICA8L2ZpbGU+XG4gICAgIDxmaWxlIG5hbWU9XCJhdXRvY29tcGxldGUuaHRtbFwiPlxuICAgICAgIDxkaXY+XG4gICAgICAgICA8aW5wdXQgdHlwZT1cInNlYXJjaFwiIG5nLW1vZGVsPVwiJGN0cmwuc2VhcmNoVGVybVwiIC8+XG4gICAgICAgICA8dWw+XG4gICAgICAgICAgIDxsaSBuZy1yZXBlYXQ9XCJpdGVtIGluICRjdHJsLml0ZW1zIHwgZmlsdGVyOiRjdHJsLnNlYXJjaFRlcm1cIj5cbiAgICAgICAgICAgICA8YnV0dG9uIG5nLWNsaWNrPVwiJGN0cmwuc2VsZWN0SXRlbShpdGVtKVwiPnt7IGl0ZW0ubmFtZSB9fTwvYnV0dG9uPlxuICAgICAgICAgICA8L2xpPlxuICAgICAgICAgPC91bD5cbiAgICAgICA8L2Rpdj5cbiAgICAgP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VwidXNlci5uYW1lXCJcbiAqICAgICAgICAgICAgICAgICAgbmctbW9kZWwtb3B0aW9ucz1cInsgdXBkYXRlT246ICdibHVyJyB9XCJcbiAqICAgICAgICAgICAgICAgICAgbmcta2V5dXA9XCJjYW5jZWwoJGV2ZW50KVwiIC8+XG4gKiAgICAgICAgIDwvbGFiZWw+PGJyIC8+XG4gKiAgICAgICAgIDxsYWJlbD5cbiAqICAgICAgICAgICBPdGhlciBkYXRhOlxuICogICAgICAgICAgIDxpbnB1dCB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwidXNlci5kYXRhXCIgLz5cbiAqICAgICAgICAgPC9sYWJlbD48YnIgLz5cbiAqICAgICAgIDwvZm9ybT5cbiAqICAgICAgIDxwcmU+dXNlci5uYW1lID0gPHNwYW4gbmctYmluZD1cInVzZXIubmFtZVwiPjwvc3Bhbj48L3ByZT5cbiAqICAgICA8L2Rpdj5cbiAqICAgPC9maWxlPlxuICogICA8ZmlsZSBuYW1lPVwiYXBwLmpzXCI+XG4gKiAgICAgYW5ndWxhci5tb2R1bGUoJ29wdGlvbnNFeGFtcGxlJywgW10pXG4gKiAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICogICAgICAgICAkc2NvcGUudXNlciA9IHsgbmFtZTogJ3NheScsIGRhdGE6ICcnIH07XG4gKlxuICogICAgICAgICAkc2NvcGUuY2FuY2VsID0gZnVuY3Rpb24oZSkge1xuICogICAgICAgICAgIGlmIChlLmtleUNvZGUgPT09IDI3KSB7XG4gKiAgICAgICAgICAgICAkc2NvcGUudXNlckZvcm0udXNlck5hbWUuJHJvbGxiYWNrVmlld1ZhbHVlKCk7XG4gKiAgICAgICAgICAgfVxuICogICAgICAgICB9O1xuICogICAgICAgfV0pO1xuICogICA8L2ZpbGU+XG4gKiAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb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ICAgICAgIGV2ZW50TGlzdC5wdXNoKCcqJyk7XG4gICAgICAgICAgICAgIHZhciBldmVudHMgPSB7fTtcblxuICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGV2ZW50TGlzdC5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGV2ZW50c1tldmVudExpc3RbaV1dID0gdGhpcy5vcHRpb25zLmRlYm91bmNlW2V2ZW50TGlzdFtpXV07XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0aGlzLmV2ZW50cyA9IGV2ZW50cztcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHRoaXMudXBkYXRlT3B0aW9ucyA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgb3B0aW9ucyA9IGFuZ3VsYXIuZXh0ZW5kKHRoaXMub3B0aW9ucywge1xuICAgICAgICAgICAgICAgIHVwZGF0ZU9uOiBPYmplY3Qua2V5cyh0aGlzLmV2ZW50cykuam9pbignICcpLnJlcGxhY2UoJyonLCAnJyksXG4gICAgICAgICAgICAgICAgZGVib3VuY2U6IHRoaXMuZXZlbnRzXG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIHRoaXMuZm9ybS5pbnB1dC4kb3ZlcnJpZGVNb2RlbE9wdGlvbnMob3B0aW9ucyk7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAvLyBJbml0aWFsaXplIHRoZSBldmVudCBmb3JtXG4gICAgICAgICAgICB0aGlzLnVwZGF0ZUV2ZW50cygpO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgPC9maWxlPlxuICAgIDxmaWxlIG5hbWU9XCJ0ZW1wbGF0ZS5odG1sXCI+XG4gICAgICA8Zm9ybSBuYW1lPVwiJGN0cmwuZm9ybVwiPlxuICAgICAgICBJbnB1dDogPGlucHV0IHR5cGU9XCJ0ZXh0XCIgbmFtZT1cImlucHV0XCIgbmctbW9kZWw9XCIkY3R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V4YW1wbGVcIj5cbiAqICAgPGZpbGUgbmFtZT1cImluZGV4Lmh0bWxcIj5cbiAqICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9XCJFeGFtcGxlQ29udHJvbGxlclwiPlxuICogICAgICAgPGZvcm0gbmFtZT1cInVzZXJGb3JtXCI+XG4gKiAgICAgICAgIDxsYWJlbD5cbiAqICAgICAgICAgICBOYW1lOlxuICogICAgICAgICAgIDxpbnB1dCB0eXBlPVwidGV4dFwiIG5hbWU9XCJ1c2VyTmFtZVwiXG4gKiAgICAgICAgICAgICAgICAgIG5nLW1vZGVsPVwidXNlci5uYW1lXCJcbiAqICAgICAgICAgICAgICAgICAgbmctbW9kZWwtb3B0aW9ucz1cInsgZ2V0dGVyU2V0dGVyOiB0cnVlIH1cIiAvPlxuICogICAgICAgICA8L2xhYmVsPlxuICogICAgICAgPC9mb3JtPlxuICogICAgICAgPHByZT51c2VyLm5hbWUgPSA8c3BhbiBuZy1iaW5kPVwidXNlci5uYW1lKClcIj48L3NwYW4+PC9wcmU+XG4gKiAgICAgPC9kaXY+XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cImFwcC5qc1wiPlxuICogICAgIGFuZ3VsYXIubW9kdWxlKCdnZXR0ZXJTZXR0ZXJFeGFtcGxlJywgW10pXG4gKiAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuICogICAgICAgICB2YXIgX25hbWUgPSAnQnJpYW4nO1xuICogICAgICAgICAkc2NvcGUudXNlciA9IHtcbiAqICAgICAgICAgICBuYW1lOiBmdW5jdGlvbihuZXdOYW1lKSB7XG4gKiAgICAgICAgICAgICByZXR1cm4gYW5ndWxhci5pc0RlZmluZWQobmV3TmFtZSkgPyAoX25hbWUgPSBuZXdOYW1lKSA6IF9uYW1lO1xuICogICAgICAgICAgIH1cbiAqICAgICAgICAgfTtcbiAqICAgICAgIH1dK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IG1vZHVsZT1cInNlbGVjdEV4YW1wbGVcIiBuYW1lPVwic2VsZWN0XCI+XG4gICAgICA8ZmlsZSBuYW1lPVwiaW5kZXguaHRtbFwiPlxuICAgICAgICA8c2NyaXB0PlxuICAgICAgICBhbmd1bGFyLm1vZHVsZSgnc2VsZWN0RXhhbXBsZScsIFtdKVxuICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7XG4gICAgICAgICAgICAkc2NvcGUuY29sb3JzID0gW1xuICAgICAgICAgICAgICB7bmFtZTonYmxhY2snLCBzaGFkZTonZGFyayd9LFxuICAgICAgICAgICAgICB7bmFtZTond2hpdGUnLCBzaGFkZTonbGlnaHQnLCBub3RBbk9wdGlvbjogdHJ1ZX0sXG4gICAgICAgICAgICAgIHtuYW1lOidyZWQnLCBzaGFkZTonZGFyayd9LFxuICAgICAgICAgICAgICB7bmFtZTonYmx1ZScsIHNoYWRlOidkYXJrJywgbm90QW5PcHRpb246IHRydWV9LFxuICAgICAgICAgICAgICB7bmFtZToneWVsbG93Jywgc2hhZGU6J2xpZ2h0Jywgbm90QW5PcHRpb246IGZhbHNlfVxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICRzY29wZS5teUNvbG9yID0gJHNjb3BlLmNvbG9yc1syXTsgLy8gcmVkXG4gICAgICAgICAgfV0pO1xuICAgICAgICA8L3NjcmlwdD5cbiAgICAgICAgPGRpdiBuZy1jb250cm9sbGVyPVwiRXhhbXBsZUNvbnRyb2xsZXJcIj5cbiAgICAgICAgICA8dWw+XG4gICAgICAgICAgICA8bGkgbmctcmVwZWF0PVwiY29sb3IgaW4gY29sb3JzXCI+XG4gICAgICAgICAgICAgIDxsYWJlbD5OYW1lOiA8aW5wdXQgbmctbW9kZWw9XCJjb2xvci5uYW1lXCI+PC9sYWJlbD5cbiAgICAgICAgICAgICAgPGxhYmVsPjxpbnB1dCB0eXBlPVwiY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XG4gICAgICAgICAgY291bnQgPSAkbG9jYWxlLnBsdXJhbENhdChjb3VudCAtIG9mZnNldCk7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBJZiBib3RoIGBjb3VudGAgYW5kIGBsYXN0Q291bnRgIGFyZSBOYU4sIHdlIGRvbid0IG5lZWQgdG8gcmUtcmVnaXN0ZXIgYSB3YXRjaC5cbiAgICAgICAgLy8gSW4gSlMgYE5hTiAhPT0gTmFOYCwgc28gd2UgaGF2ZSB0byBleHBsaWNpdGx5IGNoZWNrLlxuICAgICAgICBpZiAoKGNvdW50ICE9PSBsYXN0Q291bnQpICYmICEoY291bnRJc05hTiAmJiBpc051bWJlck5hTihsYXN0Q291bnQpKSkge1xuICAgICAgICAgIHdhdGNoUmVtb3ZlcigpO1xuICAgICAgICAgIHZhciB3aGVuRXhwRm4gPSB3aGVuc0V4cEZuc1tjb3VudF07XG4gICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHdoZW5FeHBGbikpIHtcbiAgICAgICAgICAgIGlmIChuZXdWYWwgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAkbG9nLmRlYnVnKCduZ1BsdXJhbGl6ZTogbm8gcnVsZSBkZWZpbmVkIGZvciBcXCcnICsgY291bnQgKyAnXFwnIGluICcgKyB3aGVuRXhwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdhdGNoUmVtb3ZlciA9IG5vb3A7XG4gICAgICAgICAgICB1cGRhdGVFbGVtZW50VGV4dCgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB3YXRjaFJlbW92ZXIgPSBzY29wZS4kd2F0Y2god2hlbkV4cEZuLCB1cGRhdGVFbGVtZW50VGV4dCk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGxhc3RDb3VudCA9IGNvdW50O1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgZnVuY3Rpb24gdXBkYXRlRWxlbWVudFRleHQobmV3VGV4dCkge1xuICAgICAgICBlbGV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WZNaW5FcnIoJ25vbmFzc2lnbicsICdFeHByZXNzaW9uIGluIG5nUmVmPVwiezB9XCIgaXMgbm9uLWFzc2lnbmFibGUhJywgdEF0dHJzLm5nUmVmKTtcbiAgICAgIH07XG5cbiAgICAgIHJldHVybiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHtcbiAgICAgICAgdmFyIHJlZlZhbHVlO1xuXG4gICAgICAgIGlmIChhdHRycy5oYXNPd25Qcm9wZXJ0eSgnbmdSZWZSZWFkJykpIHtcbiAgICAgICAgICBpZiAoYXR0cnMubmdSZWZSZWFkID09PSAnJGVsZW1lbnQnKSB7XG4gICAgICAgICAgICByZWZWYWx1ZSA9IGVsZW1lbnQ7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlZlZhbHVlID0gZWxlbWVudC5kYXRhKCckJyArIGF0dHJzLm5nUmVmUmVhZCArICdDb250cm9sbGVyJyk7XG5cbiAgICAgICAgICAgIGlmICghcmVmVmFsdWUpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmdSZWZNaW5FcnIoXG4gICAgICAgICAgICAgICAgJ25vY3RybCcsXG4gICAgICAgICAgICAgICAgJ1RoZSBjb250cm9sbGVyIGZvciBuZ1JlZlJlYWQ9XCJ7MH1cIiBjb3VsZCBub3QgYmUgZm91bmQgb24gbmdSZWY9XCJ7MX1cIicsXG4gICAgICAgICAgICAgICAgYXR0cnMubmdSZWZSZWFkLFxuICAgICAgICAgICAgICAgIHRBdHRycy5uZ1JlZlxuICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZWZWYWx1ZSA9IGVsZW1lbnQuZGF0YSgnJCcgKyBjb250cm9sbGVyTmFtZSArICdDb250cm9sbGVyJyk7XG4gICAgICAgIH1cblxuICAgICAgICByZWZWYWx1ZSA9IHJlZlZhbHVlIHx8IGVsZW1lbnQ7XG5cbiAgICAg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c2llJywgYWdlOjMwLCBnZW5kZXI6J2dpcmwnfSxcbiAgICAgICAgICB7bmFtZTonSm9oYW5uYScsIGFnZToyOCwgZ2VuZGVyOidnaXJsJ30sXG4gICAgICAgICAge25hbWU6J0pveScsIGFnZToxNSwgZ2VuZGVyOidnaXJsJ30sXG4gICAgICAgICAge25hbWU6J01hcnknLCBhZ2U6MjgsIGdlbmRlcjonZ2lybCd9LFxuICAgICAgICAgIHtuYW1lOidQZXRlcicsIGFnZTo5NSwgZ2VuZGVyOidib3knfSxcbiAgICAgICAgICB7bmFtZTonU2ViYXN0aWFuJywgYWdlOjUwLCBnZW5kZXI6J2JveSd9LFxuICAgICAgICAgIHtuYW1lOidFcmlrYScsIGFnZToyNywgZ2VuZGVyOidnaXJsJ30sXG4gICAgICAgICAge25hbWU6J1BhdHJpY2snLCBhZ2U6NDAsIGdlbmRlcjonYm95J30sXG4gICAgICAgICAge25hbWU6J1NhbWFudGhhJywgYWdlOjYwLCBnZW5kZXI6J2dpcmwnfVxuICAgICAgICBdO1xuICAgICAgfSk7XG4gICAgPC9maWxlPlxuICAgIDxmaWxlIG5hbWU9XCJhbmltYXRpb25zLmNzc1wiPlxuICAgICAgLmV4YW1wbGUtYW5pbWF0ZS1jb250YWluZXIge1xuICAgICAgICBiYWNrZ3JvdW5kOndoaXRlO1xuICAgICAgICBib3JkZXI6MXB4IHNvbGlkIGJsYWNrO1xuICAgICAgICBsaXN0LXN0eWxlOm5vbmU7XG4gICAgICAgIG1hcmdpbjowO1xuICAgICAgICBwYWRkaW5nOjAgMTBweDtcbiAgICAgIH1cblxuICAgICAgLmFuaW1hdGUtcmVwZWF0IHtcbiAgICAgICAgbGluZS1oZWlnaHQ6MzBweDtcbiAgICAgICAgbGlzdC1zdHlsZTpub25lO1xuICAgICAgICBib3gtc2l6aW5nOmJvcmRlci1ib3g7XG4gICAgICB9XG5cbiAgICAgIC5hbmltYXRlLXJlcGVhdC5uZy1tb3ZlLFxuICAgICAgLmFuaW1hdGU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hcCA9IGNyZWF0ZU1hcCgpLFxuICAgICAgICAgICAgICBjb2xsZWN0aW9uTGVuZ3RoLFxuICAgICAgICAgICAgICBrZXksIHZhbHVlLCAvLyBrZXkvdmFsdWUgb2YgaXRlcmF0aW9uXG4gICAgICAgICAgICAgIHRyYWNrQnlJZCxcbiAgICAgICAgICAgICAgdHJhY2tCeUlkRm4sXG4gICAgICAgICAgICAgIGNvbGxlY3Rpb25LZXlzLFxuICAgICAgICAgICAgICBibG9jaywgICAgICAgLy8gbGFzdCBvYmplY3QgaW5mb3JtYXRpb24ge3Njb3BlLCBlbGVtZW50LCBpZH1cbiAgICAgICAgICAgICAgbmV4dEJsb2NrT3JkZXIsXG4gICAgICAgICAgICAgIGVsZW1lbnRzVG9SZW1vdmU7XG5cbiAgICAgICAgICBpZiAoYWxpYXNBcykge1xuICAgICAgICAgICAgJHNjb3BlW2FsaWFzQXNdID0gY29sbGVjdGlvbjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBpZiAoaXNBcnJheUxpa2UoY29sbGVjdGlvbikpIHtcbiAgICAgICAgICAgIGNvbGxlY3Rpb25LZXlzID0gY29sbGVjdGlvbjtcbiAgICAgICAgICAgIHRyYWNrQnlJZEZuID0gdHJhY2tCeUlkRXhwRm4gfHwgdHJhY2tCeUlkQXJyYXlGbjtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdHJhY2tCeUlkRm4gPSB0cmFja0J5SWRFeHBGbiB8fCB0cmFja0J5SWRPYmpGbjtcbiAgICAgICAgICAgIC8vIGlmIG9iamVjdCwgZXh0cmFjdCBrZXlzLCBpbiBlbnVtZXJhdGlvbiBvcmRlciwgdW5zb3J0ZWRcbiAgICAgICAgICAgIGNvbGxlY3Rpb25LZXlzID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBpdGVtS2V5IGluIGNvbGxlY3Rpb24pIHtcbiAgICAgICAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwoY29sbGVjdGlvbiwgaXRlbUtleSkgJiYgaXRlbUtleS5jaGFyQXQoMCkgIT09ICckJykge1xuICAgICAgICAgICAgICAgIGNvbGxlY3Rpb25LZXlzLnB1c2goaXRlbUtleSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjb2xsZWN0aW9uTGVuZ3RoID0gY29sbGVjdGlvbktleXMubGVuZ3RoO1xuICAgICAgICAgIG5leHRCbG9ja09yZGVyID0gbmV3IEFycmF5KGNvbGxlY3Rpb25MZW5ndGgpO1xuXG4gICAgICAgICAgLy8gbG9jYXRlIGV4aXN0aW5nIGl0ZW1zXG4gICAgICAgICAgZm9yIChpbmRleCA9IDA7IGluZGV4IDwgY29sbGVjdGlvbkxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAga2V5ID0gKGNvbGxlY3Rpb24gPT09IGNvbGxlY3Rpb25LZXlzKSA/IGluZGV4IDogY29sbGVjdGlvbktleXNbaW5kZXhdO1xuICAgICAgICAgICAgdmFsdWUgPSBjb2xsZWN0aW9uW2tleV07XG4gICAgICAgICAgICB0cmFja0J5SWQgPSB0cmFja0J5SWRGbigkc2NvcGUsIGtleSwgdmFsdWUsIGluZGV4KTtcbiAgICAgICAgICAgIGlmIChsYXN0QmxvY2tNYXBbdHJhY2tCeUlkXSkge1xuICAgICAgICAgICAgICAvLyBmb3VuZCBwcmV2aW91c2x5IHNlZW4gYmxvY2tcbiAgICAgICAgICAgICAgYmxvY2sgPSBsYXN0QmxvY2tNYXBbdHJhY2tCeUlkXTtcbiAgICAgICAgICAgICAgZGVsZXRlIGxhc3RCbG9ja01hcFt0cmFja0J5SWRdO1xuICAgICAgICAgICAgICBuZXh0QmxvY2tNYXBbdHJhY2tCeUlkXSA9IGJsb2NrO1xuICAgICAgICAgICAgICBuZXh0QmxvY2tPcmRlcltpbmRleF0gPSBibG9jaztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobmV4dEJsb2NrTWFwW3R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kZGVzdHJveSgpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIHdlIGFyZSBub3QgdXNpbmcgZm9yRWFjaCBmb3IgcGVyZiByZWFzb25zICh0cnlpbmcgdG8gYXZvaWQgI2NhbGwpXG4gICAgICAgICAgZm9yIChpbmRleCA9IDA7IGluZGV4IDwgY29sbGVjdGlvbkxlbmd0aDsgaW5kZXgrKykge1xuICAgICAgICAgICAga2V5ID0gKGNvbGxlY3Rpb24gPT09IGNvbGxlY3Rpb25LZXlzKSA/IGluZGV4IDogY29sbGVjdGlvbktleXNbaW5kZXhdO1xuICAgICAgICAgICAgdmFsdWUgPSBjb2xsZWN0aW9uW2tleV07XG4gICAgICAgICAgICBibG9jayA9IG5leHRCbG9ja09yZGVyW2luZGV4XTtcblxuICAgICAgICAgICAgaWYgKGJsb2NrLnNjb3BlKSB7XG4gICAgICAgICAgICAgIC8vIGlmIHdlIGhhdmUgYWxyZWFkeSBzZWVuIHRoaXMgb2JqZWN0LCB0aGVuIHdlIG5lZWQgdG8gcmV1c2UgdGhlXG4gICAgICAgICAgICAgIC8vIGFzc29jaWF0ZWQgc2NvcGUvZWxlbWVudFxuXG4gICAgICAgICAgICAgIG5leHROb2RlID0gcHJldmlvdXNOb2RlO1xuXG4gICAgICAgICAgICAgIC8vIHNraXAgbm9kZXMgdGhhdCBhcmUgYWxyZWFkeSBwZW5kaW5nIHJlbW92YWwgdmlhIGxlYXZlIGFuaW1hdGlvblxuICAgICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgbmV4dE5vZGUgPSBuZXh0Tm9kZS5uZXh0U2libGluZztcbiAgICAgICAgICAgICAgfSB3aGlsZSAobmV4dE5vZGUgJiYgbmV4dE5vZGVbTkdfUkVNT1ZFRF0pO1xuXG4gICAgICAgICAgICAgIGlmIChnZXRCbG9ja1N0YXJ0KGJsb2NrKSAhPT0gbmV4dE5vZGUpIHtcbiAgICAgICAgICAgICAgICAvLyBleGlzdGluZyBpdGVtIHdoaWNoIGdvdCBtb3ZlZFxuICAgICAgICAgICAgICAgICRhbmltYXRlLm1vdmUoZ2V0QmxvY2tOb2RlcyhibG9jay5jbG9uZSksIG51bGwsIHByZXZpb3VzTm9kZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgcHJldmlvdXNOb2RlID0gZ2V0QmxvY2tFbmQoYmxvY2spO1xuICAgICAgICAgICAgICB1cGRhdGVTY29wZShibG9jay5zY29wZSwgaW5kZXgsIHZhbHVlSWRlbnRpZmllciwgdmFsdWUsIGtleUlkZW50aWZpZXIsIGtleSwgY29sbGVjdGlvbkxlbmd0aCk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAvLyBuZXcgaXRlbSB3aGljaCB3ZSBkb24ndCBrbm93IGFib3V0XG4gICAgICAgICAgICAgICR0cmFuc2NsdWRlKGZ1bmN0aW9uIG5nUmVwZWF0VHJhbnNjbHVkZShjbG9uZSwgc2NvcGUpIHtcbiAgICAgICAgICAgICAgICBibG9jay5zY29wZSA9IHNjb3BlO1xuICAgICAgICAgICAgICAgIC8vIGh0dHA6Ly9qc3BlcmYuY29tL2Nsb25lLXZzLWNyZWF0ZWNvbW1lbnRcbiAgICAgICAgICAgICAgICB2YXIgZW5kTm9kZSA9IG5nUmVwZWF0RW5kQ29tbWVudC5jbG9uZU5vZGUoZmFsc2UpO1xuICAgICAgICAgICAgICAgIGNsb25lW2Nsb25lLmxlbmd0aCsrXSA9IGVuZE5vZGU7XG5cbiAgICAgICAgICAgICAgICAkYW5pbWF0ZS5lbnRlcihjbG9uZSwgbnVsbCwgcHJldmlvdXNOb2RlKTtcbiAgICAgICAgICAgICAgICBwcmV2aW91c05vZGUgPSBlbmROb2RlO1xuICAgICAgICAgICAgICAgIC8vIE5vdGU6IFdlIG9ubHkgbmVlZCB0aGUgZmlyc3QvbGFzdCBub2RlIG9mIHRoZSBjbG9uZWQgbm9kZXMuXG4gICAgICAgICAgICAgICAgLy8gSG93ZXZlciwgd2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cmVjdGl2ZSgnbXlCdXR0b24nLCBmdW5jdGlvbigpe1xuICogICAgICAgICAgICAgcmV0dXJuIHtcbiAqICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAqICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSxcbiAqICAgICAgICAgICAgICAgc2NvcGU6IHRydWUsXG4gKiAgICAgICAgICAgICAgIHRlbXBsYXRlOiAnPGJ1dHRvbiBzdHlsZT1cImN1cnNvcjogcG9pbnRlcjtcIj4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgJzxuZy10cmFuc2NsdWRlPicgK1xuICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICc8YiBzdHlsZT1cImNvbG9yOiByZWQ7XCI+QnV0dG9uMTwvYj4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICAgJzwvbmctdHJhbnNjbHVkZT4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICAgICc8L2J1dHRvbj4nXG4gKiAgICAgICAgICAgICB9O1xuICogICAgICAgICB9KTtcbiAqIDwvc2NyaXB0PlxuICogPCEtLSBmYWxsYmFjayBidXR0b24gY29udGVudCAtLT5cbiAqIDxteS1idXR0b24gaWQ9XCJmYWxsYmFja1wiPjwvbXktYnV0dG9uPlxuICogPCEtLSBtb2RpZmllZCBidXR0b24gY29udGVudCAtLT5cbiAqIDxteS1idXR0b24gaWQ9XCJtb2RpZmllZFwiPlxuICogICA8aSBzdHlsZT1cImNvbG9yOiBncmVlbjtcIj5CdXR0b24yPC9pPlxuICogPC9teS1idXR0b24+XG4gKiA8L2ZpbGU+XG4gKiA8ZmlsZSBuYW1lPVwicHJvdHJhY3Rvci5qc1wiIHR5cGU9XCJwcm90cmFjdG9yXCI+XG4gKiBpdCgnc2hvdWxkIGhhdmUgZGlmZmVyZW50IHRyYW5zY2x1ZGUgZWxlbWVudCBjb250ZW50JywgZnVuY3Rpb24oKSB7XG4gKiAgICAgICAgICBleHBlY3QoZWx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m9keT48cD57e3RleHR9fTwvcD48L3BhbmUtYm9keT5cbiAqICAgICAgPC9wYW5lPlxuICogICAgPC9kaXY+XG4gKiAgIDwvZmlsZT5cbiAqICAgPGZpbGUgbmFtZT1cImFwcC5qc1wiPlxuICogICAgYW5ndWxhci5tb2R1bGUoJ211bHRpU2xvdFRyYW5zY2x1ZGVFeGFtcGxlJywgW10pXG4gKiAgICAgLmRpcmVjdGl2ZSgncGFuZScsIGZ1bmN0aW9uKCkge1xuICogICAgICAgIHJldHVybiB7XG4gKiAgICAgICAgICByZXN0cmljdDogJ0UnLFxuICogICAgICAgICAgdHJhbnNjbHVkZToge1xuICogICAgICAgICAgICAndGl0bGUnOiAnP3BhbmVUaXRsZScsXG4gKiAgICAgICAgICAgICdib2R5JzogJ3BhbmVCb2R5JyxcbiAqICAgICAgICAgICAgJ2Zvb3Rlcic6ICc/cGFuZUZvb3RlcidcbiAqICAgICAgICAgIH0sXG4gKiAgICAgICAgICB0ZW1wbGF0ZTogJzxkaXYgc3R5bGU9XCJib3JkZXI6IDFweCBzb2xpZCBibGFjaztcIj4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICc8ZGl2IGNsYXNzPVwidGl0bGVcIiBuZy10cmFuc2NsdWRlPVwidGl0bGVcIj5GYWxsYmFjayBUaXRsZTwvZGl2PicgK1xuICogICAgICAgICAgICAgICAgICAgICAgJzxkaXYgbmctdHJhbnNjbHVkZT1cImJvZHlcIj48L2Rpdj4nICtcbiAqICAgICAgICAgICAgICAgICAgICAgICc8ZGl2IGNsYXNzPVwiZm9vdGVyXCIgbmctdHJhbnNjbHVkZT1cImZvb3RlclwiPkZhbGxiYWNrIEZvb3RlcjwvZGl2PicgK1xuICogICAgICAgICAgICAgICAgICAgICc8L2Rpdj4nXG4gKiAgICAgICAgfTtcbiAqICAgIH0pXG4gKiAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkge1xuIC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XG4gICAgICBcIk9jdG9iZXJcIixcbiAgICAgIFwiTm92ZW1iZXJcIixcbiAgICAgIFwiRGVjZW1iZXJcIlxuICAgIF0sXG4gICAgXCJTSE9SVERBWVwiOiBbXG4gICAgICBcIlN1blwiLFxuICAgICAgXCJNb25cIixcbiAgICAgIFwiVHVlXCIsXG4gICAgICBcIldlZFwiLFxuICAgICAgXCJUaHVcIixcbiAgICAgIFwiRnJpXCIsXG4gICAgICBcIlNhdFwiXG4gICAgXSxcbiAgICBcIlNIT1JUTU9OVEhcIjogW1xuICAgICAgXCJKYW5cIixcbiAgICAgIFwiRmViXCIsXG4gICAgICBcIk1hclwiLFxuICAgICAgXCJBcHJcIixcbiAgICAgIFwiTWF5XCIsXG4gICAgICBcIkp1blwiLFxuICAgICAgXCJKdWxcIixcbiAgICAgIFwiQXVnXCIsXG4gICAgICBcIlNlcFwiLFxuICAgICAgXCJPY3RcIixcbiAgICAgIFwiTm92XCIsXG4gICAgICBcIkRlY1wiXG4gICAgXSxcbiAgICBcIlNUQU5EQUxPTkVNT05USFwiOiBbXG4gICAgICBcIkphbnVhcnlcIixcbiAgICAgIFwiRmVicnVhcnlcIixcbiAgICAgIFwiTWFyY2hcIixcbiAgICAgIFwiQXByaWxcIixcbiAgICAgIFwiTWF5XCIsXG4gICAgICBcIkp1bmVcIixcbiAgICAgIFwiSnVseVwiLFxuICAgICAgXCJBdWd1c3RcIixcbiAgICAgIFwiU2VwdGVtYmVyXCIsXG4gICAgICBcIk9jdG9iZXJcIixcbiAgICAgIFwiTm92ZW1iZXJcIixcbiAgICAgIFwiRGVjZW1iZXJcIlxuICAgIF0sXG4gICAgXCJXRUVLRU5EUkFOR0VcIjogW1xuICAgICAgNSxcbiAgICAgIDZcbiAgICBdLFxuICAgIFwiZnVsbERhdGVcIjogXCJFRUVFLCBNTU1NIGQsIHlcIixcbiAgICBcImxvbmdEYXRlXCI6IFwiTU1NTSBkLCB5XCIsXG4gICAgXCJtZWRpdW1cIjogXCJNTU0g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i4vanMvdGFiLmpzJylcbnJlcXVpcmUoJy4uLy4uL2pzL2FmZml4LmpzJykiLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWZmaXguanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWZmaXhcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBBRkZJWCBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT1cblxuICB2YXIgQWZmaXggPSBmdW5jdGlvbiAoZWxlbWVudCwgb3B0aW9ucykge1xuICAgIHRoaXMub3B0aW9ucyA9ICQuZXh0ZW5kKHt9LCBBZmZpeC5ERUZBVUxUUywgb3B0aW9ucylcblxuICAgIHZhciB0YXJnZXQgPSB0aGlzLm9wdGlvbnMudGFyZ2V0ID09PSBBZmZpeC5ERUZBVUxUUy50YXJnZXQgPyAkKHRoaXMub3B0aW9ucy50YXJnZXQpIDogJChkb2N1bWVudCkuZmluZCh0aGlzLm9wdGlvbnMudGFyZ2V0KVxuXG4gICAgdGhpcy4kdGFyZ2V0ID0gdGFyZ2V0XG4gICAgICAub24oJ3Njcm9sb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YgKGRhdGEub2Zmc2V0Qm90dG9tICE9IG51bGwpIGRhdGEub2Zmc2V0LmJvdHRvbSA9IGRhdGEub2Zmc2V0Qm90dG9tXG4gICAgICBpZiAoZGF0YS5vZmZzZXRUb3AgICAgIT0gbnVsbCkgZGF0YS5vZmZzZXQudG9wICAgID0gZGF0YS5vZmZzZXRUb3BcblxuICAgICAgUGx1Z2luLmNhbGwoJHNweSwgZGF0YSlcbiAgICB9KVxuICB9KVxuXG59KGpRdWVyeSk7XG4iLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogYWxlcnQuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jYWxlcnRzXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQUxFUlQgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIGRpc21pc3MgPSAnW2RhdGEtZGlzbWlzcz1cImFsZXJ0XCJdJ1xuICB2YXIgQWxlcnQgICA9IGZ1bmN0aW9uIChlbCkge1xuICAgICQoZWwpLm9uKCdjbGljaycsIGRpc21pc3MsIHRoaXMuY2xvc2Up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uICB9XG5cblxuICAvLyBBTEVSVCBEQVRBLUFQSVxuICAvLyA9PT09PT09PT09PT09PVxuXG4gICQoZG9jdW1lbnQpLm9uKCdjbGljay5icy5hbGVydC5kYXRhLWFwaScsIGRpc21pc3MsIEFsZXJ0LnByb3RvdHlwZS5jbG9zZSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGJ1dHRvbi5qcyB2My40LjFcbiAqIGh0dHBzOi8vZ2V0Ym9vdHN0cmFwLmNvbS9kb2NzLzMuNC9qYXZhc2NyaXB0LyNidXR0b25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQlVUVE9OIFBVQkxJQyBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBCdXR0b24gPSBmdW5jdGlvbiAoZWxlbWVudCwgb3B0aW9ucykge1xuICAgIHRoaXMuJGVsZW1lbnQgID0gJChlbGVtZW50KVxuICAgIHRoaXMub3B0aW9ucyAgID0gJC5leHRlbmQoe30sIEJ1dHRvbi5ERUZBVUxUUywgb3B0aW9ucylcbiAgICB0aGlzLmlzTG9hZGluZyA9IGZhbHNlXG4gIH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LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNhcm91c2VsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2Nhcm91c2VsXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQ0FST1VTRUwgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIENhcm91c2VsID0gZnVuY3Rpb24gKGVsZW1lbnQsIG9wdGlvbnMpIHtcbiAgICB0aGlzLiRlbGVtZW50ICAgID0gJChlbGVtZW50KVxuICAgIHRoaXMuJGluZGljYXRvcnMgPSB0aGlzLiRlbGVtZW50LmZpbmQoJy5jYXJvdXNlbC1pbmRpY2F0b3JzJylcbiAgICB0aGlzLm9wdGlvbnMgICAgID0gb3B0aW9uc1xuICAgIHRoaXMucGF1c2VkICAgICAgPSBudWxsXG4gICAgdGhpcy5zbGlkaW5nICAgICA9IG51bGxcbiAgICB0aGlzLmludGVydmFsICAgID0gbnVsbFxuICAgIHRoaXMuJGFjdGl2ZSAgICAgPSBudWxsXG4gICAgdGhpcy4kaXRlbXMgICAgICA9IG51bGxcblxuICA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lYWNoKGZ1bmN0aW9uICgpIHtcbiAgICAgIHZhciAkY2Fyb3VzZWwgPSAkKHRoaXMpXG4gICAgICBQbHVnaW4uY2FsbCgkY2Fyb3VzZWwsICRjYXJvdXNlbC5kYXRhKCkpXG4gICAgfSlcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGNvbGxhcHNlLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2NvbGxhcHNlXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG4vKiBqc2hpbnQgbGF0ZWRlZjogZmFsc2UgKi9cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBDT0xMQVBTRSBQVUJMSUMgQ0xBU1MgREVGSU5JVElPTlxuICAvLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIHZhciBDb2xsYXBzZSA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgdGhpcy4kZWxlbWVudCAgICAgID0gJChlbGVtZW50KVxuICAgIHRoaXMub3B0aW9ucyAgICAgICA9ICQuZXh0ZW5kKHt9LCBDb2xsYXBzZS5ERUZBVUxUUywgb3B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BDb2xsYXBzZVxuXG5cbiAgLy8gQ09MTEFQU0UgTk8gQ09ORkxJQ1RcbiAgLy8gPT09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLmNvbGxhcHNlLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgJC5mbi5jb2xsYXBzZSA9IG9sZFxuICAgIHJldHVybiB0aGlzXG4gIH1cblxuXG4gIC8vIENPTExBUFNFIERBVEEtQVBJXG4gIC8vID09PT09PT09PT09PT09PT09XG5cbiAgJChkb2N1bWVudCkub24oJ2NsaWNrLmJzLmNvbGxhcHNlLmRhdGEtYXBpJywgJ1tkYXRhLXRvZ2dsZT1cImNvbGxhcHNlXCJdJywgZnVuY3Rpb24gKGUpIHtcbiAgICB2YXIgJHRoaXMgICA9ICQodGhpcylcblxuICAgIGlmICghJHRoaXMuYXR0cignZGF0YS10YXJnZXQnKSkgZS5wcmV2ZW50RGVmYXVsdCgpXG5cbiAgICB2YXIgJHRhcmdldCA9IGdldFRhcmdldEZyb21UcmlnZ2VyKCR0aGlzKVxuICAgIHZhciBkYXRhICAgID0gJHRhcmdldC5kYXRhKCdicy5jb2xsYXBzZScpXG4gICAgdmFyIG9wdGlvbiAgPSBkYXRhID8gJ3RvZ2dsZScgOiAkdGhpcy5kYXRhKClcblxuICAgIFBsdWdpbi5jYWxsKCR0YXJnZXQsIG9wdGlvbilcbiAgfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IGRyb3Bkb3duLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI2Ryb3Bkb3duc1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5c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lvbiAoKSB7XG4gICAgJC5mbi5kcm9wZG93biA9IG9sZFxuICAgIHJldHVybiB0aGlzXG4gIH1cblxuXG4gIC8vIEFQUExZIFRPIFNUQU5EQVJEIERST1BET1dOIEVMRU1FTlRTXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgJChkb2N1bWVudClcbiAgICAub24oJ2NsaWNrLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgY2xlYXJNZW51cylcbiAgICAub24oJ2NsaWNrLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgJy5kcm9wZG93biBmb3JtJywgZnVuY3Rpb24gKGUpIHsgZS5zdG9wUHJvcGFnYXRpb24oKSB9KVxuICAgIC5vbignY2xpY2suYnMuZHJvcGRvd24uZGF0YS1hcGknLCB0b2dnbGUsIERyb3Bkb3duLnByb3RvdHlwZS50b2dnbGUpXG4gICAgLm9uKCdrZXlkb3duLmJzLmRyb3Bkb3duLmRhdGEtYXBpJywgdG9nZ2xlLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bilcbiAgICAub24oJ2tleWRvd24uYnMuZHJvcGRvd24uZGF0YS1hcGknLCAnLmRyb3Bkb3duLW1lbnUnLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bilcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IG1vZGFsLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI21vZGFsc1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVC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gfSlcblxufShqUXVlcnkpO1xuIiwiLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBCb290c3RyYXA6IHBvcG92ZXIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jcG9wb3ZlcnNcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cblxuK2Z1bmN0aW9uICgkKSB7XG4gICd1c2Ugc3RyaWN0JztcblxuICAvLyBQT1BPVkVSIFBVQkxJQyBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuICB2YXIgUG9wb3ZlciA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7XG4gICAgdGhpcy5pbml0KCdwb3BvdmVyJywgZWxlbWVudCwgb3B0aW9ucylcbiAgfVxuXG4gIGlmICghJC5mbi50b29sdGlwKSB0aHJvdyBuZXcgRXJyb3IoJ1BvcG92ZXIgcmVxdWlyZXMgdG9vbHRpcC5qcycpXG5cbiAgUG9wb3Zlci5WRVJTSU9OICA9ICczLjQuMSdcblxuICBQb3BvdmVyLkRFRkFVTFRTID0gJC5leHRlbmQoe30sICQuZm4udG9vbHRpcC5Db25zdHJ1Y3Rvci5ERUZBVUxUUywge1xuICAgIHBsYWNlbWVud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hciBvbGQgPSAkLmZuLnBvcG92ZXJcblxuICAkLmZuLnBvcG92ZXIgICAgICAgICAgICAgPSBQbHVnaW5cbiAgJC5mbi5wb3BvdmVyLkNvbnN0cnVjdG9yID0gUG9wb3ZlclxuXG5cbiAgLy8gUE9QT1ZFUiBOTyBDT05GTElDVFxuICAvLyA9PT09PT09PT09PT09PT09PT09XG5cbiAgJC5mbi5wb3BvdmVyLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7XG4gICAgJC5mbi5wb3BvdmVyID0gb2xkXG4gICAgcmV0dXJuIHRoaXNcbiAgfVxuXG59KGpRdWVyeSk7XG4iLCIvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIEJvb3RzdHJhcDogc2Nyb2xsc3B5LmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3Njcm9sbHNweVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIFNDUk9MTFNQWSBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09XG5cbiAgZnVuY3Rpb24gU2Nyb2xsU3B5KGVsZW1lbnQsIG9wdG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T09PT09PVxuXG4gICQod2luZG93KS5vbignbG9hZC5icy5zY3JvbGxzcHkuZGF0YS1hcGknLCBmdW5jdGlvbiAoKSB7XG4gICAgJCgnW2RhdGEtc3B5PVwic2Nyb2xsXCJdJykuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgJHNweSA9ICQodGhpcylcbiAgICAgIFBsdWdpbi5jYWxsKCRzcHksICRzcHkuZGF0YSgpKVxuICAgIH0pXG4gIH0pXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0YWIuanMgdjMuNC4xXG4gKiBodHRwczovL2dldGJvb3RzdHJhcC5jb20vZG9jcy8zLjQvamF2YXNjcmlwdC8jdGFic1xuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4gKiBDb3B5cmlnaHQgMjAxMS0yMDE5IFR3aXR0ZXIsIEluYy5cbiAqIExpY2Vuc2VkIHVuZGVyIE1JVCAoaHR0cHM6Ly9naXRodWIuY29tL3R3YnMvYm9vdHN0cmFwL2Jsb2IvbWFzdGVyL0xJQ0VOU0UpXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi9cblxuXG4rZnVuY3Rpb24gKCQpIHtcbiAgJ3VzZSBzdHJpY3QnO1xuXG4gIC8vIFRBQiBDTEFTUyBERUZJTklUSU9OXG4gIC8vID09PT09PT09PT09PT09PT09PT09XG5cbiAgdmFyIFRhYiA9IGZ1bmN0aW9uIChlbGVtZW50KSB7XG4gICAgLy8ganNjczpkaXNhYmxlIHJlcXVpcmVEb2xsYXJCZWZvcmVqUXVlcnlBc3NpZ25tZW50XG4gICAgdGhpcy5lbGVtZW50ID0gJChl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nZ2xlPVwidGFiXCJdJywgY2xpY2tIYW5kbGVyKVxuICAgIC5vbignY2xpY2suYnMudGFiLmRhdGEtYXBpJywgJ1tkYXRhLXRvZ2dsZT1cInBpbGxcIl0nLCBjbGlja0hhbmRsZXIpXG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0b29sdGlwLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3Rvb2x0aXBcbiAqIEluc3BpcmVkIGJ5IHRoZSBvcmlnaW5hbCBqUXVlcnkudGlwc3kgYnkgSmFzb24gRnJhbWVcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQ29weXJpZ2h0IDIwMTEtMjAxOSBUd2l0dGVyLCBJbmMuXG4gKiBMaWNlbnNlZCB1bmRlciBNSVQgKGh0dHBzOi8vZ2l0aHViLmNvbS90d2JzL2Jvb3RzdHJhcC9ibG9iL21hc3Rlci9MSUNFTlNFKVxuICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgdmFyIERJU0FMTE9XRURfQVRUUklCVVRFUyA9IFsnc2FuaXRpemUnLCAnd2hpdGVMaXN0JywgJ3Nhbml0aXplRm4nXVxuXG4gIHZhciB1cmlBdHRycyA9IFtcbiAgICAnYmFja2dyb3VuZCcsXG4gICAgJ2NpdGUnLFxuICAgICdocmVmJyxcbiAgICAnaXRlbXR5cGUnLFxuICAgICdsb25nZGVzYycsXG4gICAgJ3Bvc3RlcicsXG4gICAgJ3NyYycsXG4g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ob3B0aW9uKSB7XG4gICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7XG4gICAgICB2YXIgJHRoaXMgICA9ICQodGhpcylcbiAgICAgIHZhciBkYXRhICAgID0gJHRoaXMuZGF0YSgnYnMudG9vbHRpcCcpXG4gICAgICB2YXIgb3B0aW9ucyA9IHR5cGVvZiBvcHRpb24gPT0gJ29iamVjdCcgJiYgb3B0aW9uXG5cbiAgICAgIGlmICghZGF0YSAmJiAvZGVzdHJveXxoaWRlLy50ZXN0KG9wdGlvbikpIHJldHVyblxuICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCdicy50b29sdGlwJywgKGRhdGEgPSBuZXcgVG9vbHRpcCh0aGlzLCBvcHRpb25zKSkpXG4gICAgICBpZiAodHlwZW9mIG9wdGlvbiA9PSAnc3RyaW5nJykgZGF0YVtvcHRpb25dKClcbiAgICB9KVxuICB9XG5cbiAgdmFyIG9sZCA9ICQuZm4udG9vbHRpcFxuXG4gICQuZm4udG9vbHRpcCAgICAgICAgICAgICA9IFBsdWdpblxuICAkLmZuLnRvb2x0aXAuQ29uc3RydWN0b3IgPSBUb29sdGlwXG5cblxuICAvLyBUT09MVElQIE5PIENPTkZMSUNUXG4gIC8vID09PT09PT09PT09PT09PT09PT1cblxuICAkLmZuLnRvb2x0aXAubm9Db25mbGljdCA9IGZ1bmN0aW9uICgpIHtcbiAgICAkLmZuLnRvb2x0aXAgPSBvbGRcbiAgICByZXR1cm4gdGhpc1xuICB9XG5cbn0oalF1ZXJ5KTtcbiIsIi8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICogQm9vdHN0cmFwOiB0cmFuc2l0aW9uLmpzIHYzLjQuMVxuICogaHR0cHM6Ly9nZXRib290c3RyYXAuY29tL2RvY3MvMy40L2phdmFzY3JpcHQvI3RyYW5zaXRpb25zXG4gKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAqIENvcHlyaWdodCAyMDExLTIwMTkgVHdpdHRlciwgSW5jLlxuICogTGljZW5zZWQgdW5kZXIgTUlUIChodHRwczovL2dpdGh1Yi5jb20vdHdicy9ib290c3RyYXAvYmxvYi9tYXN0ZXIvTElDRU5TRSlcbiAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqL1xuXG5cbitmdW5jdGlvbiAoJCkge1xuICAndXNlIHN0cmljdCc7XG5cbiAgLy8gQ1NTIFRSQU5TSVRJT04gU1VQUE9SVCAoU2hvdXRvdXQ6IGh0dHBzOi8vbW9kZXJuaXpyLmNvbS8pXG4gIC8vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuXG4gIGZ1bmN0aW9uIHRyYW5zaXRpb25FbmQoKSB7XG4gICAgdmFyIGVsID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYm9vdHN0cmFwJylcblxuICAgIHZhciB0cmFuc0VuZEV2ZW50TmFtZXMgPSB7XG4gICAgICBXZWJraXRUcmFuc2l0aW9uIDogJ3dlYmtpdFRyYW5zaXRpb25FbmQnLFxuICAgICAgTW96VHJhbnNpdGlvbiAgICA6ICd0cmFuc2l0aW9uZW5kJyxcbiAgICAgIE9UcmFuc2l0aW9uICAgICAgOiAnb1RyYW5zaXRpb25FbmQgb3RyYW5zaXRpb25lbmQnLFxuICAgICAgdHJhbnNpdGlvbiAgICAgICA6ICd0cmFuc2l0aW9uZW5kJ1xuICAgIH1cblxuICAgIGZvciAodmFyIG5hbWUgaW4gdHJhbnNFbmRFdmVudE5hbWVzKSB7XG4gICAgICBpZiAoZWwuc3R5bGVbbmFtZV0gIT09IHVuZGVmaW5lZCkge1xuICAgICAgICByZXR1cm4geyBlbmQ6IHRyYW5zRW5k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HNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgaWYgKChzZWNvbmRCeXRlICYgMHhDMCkgPT09IDB4ODApIHtcbiAgICAgICAgICAgIHRlbXBDb2RlUG9pbnQgPSAoZmlyc3RCeXRlICYgMHgxRikgPDwgMHg2IHwgKHNlY29uZEJ5dGUgJiAweDNGKVxuICAgICAgICAgICAgaWYgKHRlbXBDb2RlUG9pbnQgPiAweDdGKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAzOlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGlmICgoc2Vjb25kQnl0ZSAmIDB4QzApID09PSAweDgwICYmICh0aGlyZEJ5dGUgJiAweEMwKSA9PT0gMHg4MCkge1xuICAgICAgICAgICAgdGVtcENvZGVQb2ludCA9IChmaXJzdEJ5dGUgJiAweEYpIDw8IDB4QyB8IChzZWNvbmRCeXRlICYgMHgzRikgPDwgMHg2IHwgKHRoaXJkQnl0ZSAmIDB4M0YpXG4gICAgICAgICAgICBpZiAodGVtcENvZGVQb2ludCA+IDB4N0ZGICYmICh0ZW1wQ29kZVBvaW50IDwgMHhEODAwIHx8IHRlbXBDb2RlUG9pbnQgPiAweERGRkYpKSB7XG4gICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRlbXBDb2RlUG9pbnRcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSA0OlxuICAgICAgICAgIHNlY29uZEJ5dGUgPSBidWZbaSArIDFdXG4gICAgICAgICAgdGhpcmRCeXRlID0gYnVmW2kgKyAyXVxuICAgICAgICAgIGZvdXJ0aEJ5dGUgPSBidWZbaSArIDNd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ChhcmdzKSB7XHJcbiAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgICAgICAgIHZhciBsZW5ndGggPSBhcmdzLmxlbmd0aDtcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJncyA9IGFyZ3VtZW50cztcclxuICAgICAgICAgICAgICB2YXIgbmV3QXJnc0xlbmd0aCA9IG5ld0FyZ3MubGVuZ3RoO1xyXG4gICAgICAgICAgICAgIHZhciBjb21iaW5lZCA9IFtdO1xyXG4gICAgICAgICAgICAgIHZhciBuZXdBcmdzSW5kZXggPSAwO1xyXG4gICAgICAgICAgICAgIHZhciByZW1haW5pbmcgPSBhcml0eTtcclxuICAgICAgICAgICAgICB2YXIgdmFsdWU7XHJcbiAgICAgICAgICAgICAgaWYgKGxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAtMTtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2luZGV4XSA9IHZhbHVlID1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICBhcmdzW2luZGV4XSA9PT0gX18gJiYgbmV3QXJnc0luZGV4IDwgbmV3QXJnc0xlbmd0aFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG5ld0FyZ3NbbmV3QXJnc0luZGV4KytdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYXJnc1tpbmRleF07XHJcbiAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IF9fKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgLS1yZW1haW5pbmc7XHJcbiAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgaWYgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgd2hpbGUgKG5ld0FyZ3NJbmRleCA8IG5ld0FyZ3NMZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGNvbWJpbmVkW2NvbWJpbmVkLmxlbmd0aF0gPSB2YWx1ZSA9IG5ld0FyZ3NbbmV3QXJnc0luZGV4XTtcclxuICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gX18gJiYgbmV3QXJnc0luZGV4IDwgYXJpdHkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAtLXJlbWFpbmluZztcclxuICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICsrbmV3QXJnc0luZGV4O1xyXG4gICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHJldHVybiByZW1haW5pbmcgPiAwID8gX2N1cnJpZWQoY29tYmluZWQpIDogZm4uYXBwbHkodGhpcywgY29tYmluZWQpO1xyXG4gICAgICAgICAgfTtcclxuICAgICAgfVxyXG4gICAgICByZXR1cm4gX2N1cnJpZWQoW10pO1xyXG4gIH1cblxuICAvLyB1dGlsc1xyXG4gIGZ1bmN0aW9uIGN1cnJ5KGZuLCBhcml0eU92ZXJyaWRlKSB7XHJcbiAgICAgIHZhciBhcml0eSA9IHR5cGVvZiBhcml0eU92ZXJyaWRlID09PSAnbnVtYmVyJyA/IGFyaXR5T3ZlcnJpZGUgOiBmbi5sZW5ndGg7XHJcbiAgICAgIHZhciBjdXJyaWVkID0gZ2V0Q3VycmllZChmbiwgYXJpdHkpO1xyXG4gICAgICBjdXJyaWVkLmFyaXR5ID0gYXJpdHk7XHJcbiAgICAgIGN1cnJpZWQuZm4gPSBmbjtcclxuICAgICAgcmV0dXJuIGN1cnJpZWQ7XHJcbiAgfVxyXG4gIGN1cnJ5Ll9fID0gX187XHJcbiAgLyoqXHJcbiAgICogQGZ1bmN0aW9uIGlzUGxhY2V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JqID0gbm9kZS5lZGdlT2JqLFxuICAgICAgICBwYXRoRGF0YSA9IGZpbmRQYXRoKGcsIHBvc3RvcmRlck51bXMsIGVkZ2VPYmoudiwgZWRnZU9iai53KSxcbiAgICAgICAgcGF0aCA9IHBhdGhEYXRhLnBhdGgsXG4gICAgICAgIGxjYSA9IHBhdGhEYXRhLmxjYSxcbiAgICAgICAgcGF0aElkeCA9IDAsXG4gICAgICAgIHBhdGhWID0gcGF0aFtwYXRoSWR4XSxcbiAgICAgICAgYXNjZW5kaW5nID0gdHJ1ZTtcblxuICAgIHdoaWxlICh2ICE9PSBlZGdlT2JqLncpIHtcbiAgICAgIG5vZGUgPSBnLm5vZGUodik7XG5cbiAgICAgIGlmIChhc2NlbmRpbmcpIHtcbiAgICAgICAgd2hpbGUgKChwYXRoViA9IHBhdGhbcGF0aElkeF0pICE9PSBsY2EgJiZcbiAgICAgICAgICAgICAgIGcubm9kZShwYXRoVikubWF4UmFuayA8IG5vZGUucmFuaykge1xuICAgICAgICAgIHBhdGhJZHgrKztcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChwYXRoViA9PT0gbGNhKSB7XG4gICAgICAgICAgYXNjZW5kaW5nID0gZmFsc2U7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKCFhc2NlbmRpbmcpIHtcbiAgICAgICAgd2hpbGUgKHBhdGhJZHggPCBwYXRoLmxlbmd0aCAtIDEgJiZcbiAgICAgICAgICAgICAgIGcubm9kZShwYXRoViA9IHBhdGhbcGF0aElkeCArIDFdKS5taW5SYW5rIDw9IG5vZGUucmFuaykge1xuICAgICAgICAgIHBhdGhJZHgrKztcbiAgICAgICAgfVxuICAgICAgICBwYXRoViA9IHBhdGhbcGF0aElkeF07XG4gICAgICB9XG5cbiAgICAgIGcuc2V0UGFyZW50KHYsIHBhdGhWKTtcbiAgICAgIHYgPSBnLnN1Y2Nlc3NvcnModilbMF07XG4gICAgfVxuICB9KTtcbn1cblxuLy8gRmluZCBhIHB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saXN0ZW5lcik7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzO1xuICAgIH07XG5cbkV2ZW50RW1pdHRlci5wcm90b3R5cGUucmVtb3ZlQWxsTGlzdGVuZXJzID1cbiAgICBmdW5jdGlvbiByZW1vdmVBbGxMaXN0ZW5lcnModHlwZSkge1xuICAgICAgdmFyIGxpc3RlbmVycywgZXZlbnRzLCBpO1xuXG4gICAgICBldmVudHMgPSB0aGlzLl9ldmVudHM7XG4gICAgICBpZiAoIWV2ZW50cylcbiAgICAgICAgcmV0dXJuIHRoaXM7XG5cbiAgICAgIC8vIG5vdCBsaXN0ZW5pbmcgZm9yIHJlbW92ZUxpc3RlbmVyLCBubyBuZWVkIHRvIGVtaXRcbiAgICAgIGlmICghZXZlbnRzLnJlbW92ZUxpc3RlbmVyKSB7XG4gICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgdGhpcy5fZXZlbnRzID0gb2JqZWN0Q3JlYXRlKG51bGwpO1xuICAgICAgICAgIHRoaXMuX2V2ZW50c0NvdW50ID0gMDtcbiAgICAgICAgfSBlbHNlIGlmIChldmVudHNbdHlwZV0pIHtcbiAgICAgICAgICBpZiAoLS10aGlzLl9ldmVudHNDb3VudCA9PT0gMClcbiAgICAgICAgICAgIHRoaXMuX2V2ZW50cyA9IG9iamVjdENyZWF0ZShudWxsKTtcbiAgICAgICAgICBlbHNlXG4gICAgICAgICAgICBkZWxldGUgZXZlbnRzW3R5cGVdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgfVxuXG4gICAgICAvLyBlbWl0IHJlbW92ZUxpc3RlbmVyIGZvciBhbGwgbGlzdGVuZXJzIG9uIGFsbCBldmVudHNcbiAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIHZhciBrZXlzID0gb2JqZWN0S2V5cyhldmVudHMpO1xuICAgICAgICB2YXIga2V5O1xuICAgIC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jUwNDM5MzQvaXMtaXQtb2stdG8taWdub3JlLWtleWRvd24tZXZlbnRzLXdpdGgta2V5Y29kZS0yMjlcbiAgICogaHR0cDovL2xpc3RzLnczLm9yZy9BcmNoaXZlcy9QdWJsaWMvd3d3LWRvbS8yMDEwSnVsU2VwL2F0dC0wMTgyL2tleUNvZGUtc3BlYy5odG1sXG4gICAqL1xuXG4gIGlmIChfZG93bktleXMuaW5kZXhPZihrZXkpID09PSAtMSAmJiBrZXkgIT09IDIyOSkgX2Rvd25LZXlzLnB1c2goa2V5KTtcbiAgLyoqXG4gICAqIEplc3QgdGVzdCBjYXNlcyBhcmUgcmVxdWlyZWQuXG4gICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cbiAgICovXG5cbiAgWydjdHJsS2V5JywgJ2FsdEtleScsICdzaGlmdEtleScsICdtZXRhS2V5J10uZm9yRWFjaChmdW5jdGlvbiAoa2V5TmFtZSkge1xuICAgIHZhciBrZXlOdW0gPSBtb2RpZmllck1hcFtrZXlOYW1lXTtcblxuICAgIGlmIChldmVudFtrZXlOYW1lXSAmJiBfZG93bktleXMuaW5kZXhPZihrZXlOdW0pID09PSAtMSkge1xuICAgICAgX2Rvd25LZXlzLnB1c2goa2V5TnVtKTtcbiAgICB9IGVsc2UgaWYgKCFldmVudFtrZXlOYW1lXSAmJiBfZG93bktleXMuaW5kZXhPZihrZXlOdW0pID4gLTEpIHtcbiAgICAgIF9kb3duS2V5cy5zcGxpY2UoX2Rvd25LZXlzLmluZGV4T2Yoa2V5TnVtKSwgMSk7XG4gICAgfSBlbHNlIGlmIChrZXlOYW1lID09PSAnbWV0YUtleScgJiYgZXZlbnRba2V5TmFtZV0gJiYgX2Rvd25LZXlzLmxlbmd0aCA9PT0gMykge1xuICAgICAgLyoqXG4gICAgICAgKiBGaXggaWYgQ29tbWFuZCBpcyBwcmVzc2VkOlxuICAgICAgICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PVxuICAgICAgICovXG4gICAgICBp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tcGxhdGVTZXR0aW5nc1xuICAgICAgICogQHR5cGUge1JlZ0V4cH1cbiAgICAgICAqL1xuICAgICAgJ2V2YWx1YXRlJzogcmVFdmFsdWF0ZSxcblxuICAgICAgLyoqXG4gICAgICAgKiBVc2VkIHRvIGRldGVjdCBgZGF0YWAgcHJvcGVydHkgdmFsdWVzIHRvIGluamVjdC5cbiAgICAgICAqXG4gICAgICAgKiBAbWVtYmVyT2YgXy50ZW1wbGF0ZVNldHRpbmdzXG4gICAgICAgKiBAdHlwZSB7UmVnRXhwfVxuICAgICAgICovXG4gICAgICAnaW50ZXJwb2xhdGUnOiByZUludGVycG9sYXRlLFxuXG4gICAgICAvKipcbiAgICAgICAqIFVzZWQgdG8gcmVmZXJlbmNlIHRoZSBkYXRhIG9iamVjdCBpbiB0aGUgdGVtcGxhdGUgdGV4dC5cbiAgICAgICAqXG4gICAgICAgKiBAbWVtYmVyT2YgXy50ZW1wbGF0ZVNldHRpbmdzXG4gICAgICAgKiBAdHlwZSB7c3RyaW5nfVxuICAgICAgICovXG4gICAgICAndmFyaWFibGUnOiAnJyxcblxuICAgICAgLyoqXG4gICAgICAgKiBVc2VkIHRvIGltcG9ydCB2YXJpYWJsZXMgaW50byB0aGUgY29tcGlsZWQgdGVtcGxhdGUuXG4gICAgICAgKlxuICAgICAgICogQG1lbWJlck9mIF8udGVtcGxhdGVTZXR0aW5nc1xuICAgICAgICogQHR5cGUge09iamVjdH1cbiAgICAgICAqL1xuICAgICAgJ2ltcG9ydHMnOiB7XG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEEgcmVmZXJlbmNlIHRvIHRoZSBgbG9kYXNoYCBmdW5jdGlvbi5cbiAgICAgICAgICpcbiAgICAgICAgICogQG1lbWJlck9mIF8udGVtcGxhdGVTZXR0aW5ncy5pbXBvcnRzXG4gICAgICAgICAqIEB0eXBlIHtGdW5jdGlvbn1cbiAgICAgICAgICovXG4gICAgICAgICdfJzogbG9kYXNoXG4gICAgICB9XG4gICAgfT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1bmRlZmluZWQ7XG4gICAgICB9XG4gICAgICBhcnJheSA9IGFycmF5c1swXTtcblxuICAgICAgdmFyIGluZGV4ID0gLTEsXG4gICAgICAgICAgc2VlbiA9IGNhY2hlc1swXTtcblxuICAgICAgb3V0ZXI6XG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCAmJiByZXN1bHQubGVuZ3RoIDwgbWF4TGVuZ3RoKSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgICAgIGNvbXB1dGVkID0gaXRlcmF0ZWUgPyBpdGVyYXRlZSh2YWx1ZSkgOiB2YWx1ZTtcblxuICAgICAgICB2YWx1ZSA9IChjb21wYXJhdG9yIHx8IHZhbHVlICE9PSAwKSA/IHZhbHVlIDogMDtcbiAgICAgICAgaWYgKCEoc2VlblxuICAgICAgICAgICAgICA/IGNhY2hlSGFzKHNlZW4sIGNvbXB1dGVkKVxuICAgICAgICAgICAgICA6IGluY2x1ZGVzKHJlc3VsdCwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgb3RoSW5kZXggPSBvdGhMZW5ndGg7XG4gICAgICAgICAgd2hpbGUgKC0tb3RoSW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjYWNoZSA9IGNhY2hlc1tvdGhJbmRleF07XG4gICAgICAgICAgICBpZiAoIShjYWNoZVxuICAgICAgICAgICAgICAgICAgPyBjYWNoZUhhcyhjYWNoZSwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgICAgICA6IGluY2x1ZGVzKGFycmF5c1tvdGhJbmRleF0sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0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uICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIHZhciBrZXkgPSBkYXRhWzBdLFxuICAgICAgICAgICAgb2JqVmFsdWUgPSBvYmplY3Rba2V5XSxcbiAgICAgICAgICAgIHNyY1ZhbHVlID0gZGF0YVsxXTtcblxuICAgICAgICBpZiAobm9DdXN0b21pemVyICYmIGRhdGFbMl0pIHtcbiAgICAgICAgICBpZiAob2JqVmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBzdGFjayA9IG5ldyBTdGFjaztcbiAgICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGN1c3RvbWl6ZXIob2JqVmFsdWUsIHNyY1ZhbHVlLCBrZXksIG9iamVjdCwgc291cmNlLCBzdGFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghKHJlc3VsdCA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgPyBiYXNlSXNFcXVhbChzcmNWYWx1ZSwgb2JqVmFsdWUsIENPTVBBUkVfUEFSVElBTF9GTEFHIHwgQ09NUEFSRV9VTk9SREVSRURfRkxBRywgY3VzdG9taXplciwgc3RhY2spXG4gICAgICAgICAgICAgICAgOiByZXN1bHRcbiAgICAgICAgICAgICAgKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaXNOYXRpdmVgIHdpdGhvdXQgYmFkIHNoaW0gY2hlY2t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IHZhbElzU3ltYm9sID0gaXNTeW1ib2wodmFsdWUpO1xuXG4gICAgICAgIHZhciBvdGhJc0RlZmluZWQgPSBvdGhlciAhPT0gdW5kZWZpbmVkLFxuICAgICAgICAgICAgb3RoSXNOdWxsID0gb3RoZXIgPT09IG51bGwsXG4gICAgICAgICAgICBvdGhJc1JlZmxleGl2ZSA9IG90aGVyID09PSBvdGhlcixcbiAgICAgICAgICAgIG90aElzU3ltYm9sID0gaXNTeW1ib2wob3RoZXIpO1xuXG4gICAgICAgIGlmICgoIW90aElzTnVsbCAmJiAhb3RoSXNTeW1ib2wgJiYgIXZhbElzU3ltYm9sICYmIHZhbHVlID4gb3RoZXIpIHx8XG4gICAgICAgICAgICAodmFsSXNTeW1ib2wgJiYgb3RoSXNEZWZpbmVkICYmIG90aElzUmVmbGV4aXZlICYmICFvdGhJc051bGwgJiYgIW90aElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKHZhbElzTnVsbCAmJiBvdGhJc0RlZmluZWQgJiYgb3RoSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIXZhbElzRGVmaW5lZCAmJiBvdGhJc1JlZmxleGl2ZSkgfHxcbiAgICAgICAgICAgICF2YWxJc1JlZmxleGl2ZSkge1xuICAgICAgICAgIHJldHVybiAxO1xuICAgICAgICB9XG4gICAgICAgIGlmICgoIXZhbElzTnVsbCAmJiAhdmFsSXNTeW1ib2wgJiYgIW90aElzU3ltYm9sICYmIHZhbHVlIDwgb3RoZXIpIHx8XG4gICAgICAgICAgICAob3RoSXNTeW1ib2wgJiYgdmFsSXNEZWZpbmVkICYmIHZhbElzUmVmbGV4aXZlICYmICF2YWxJc051bGwgJiYgIXZhbElzU3ltYm9sKSB8fFxuICAgICAgICAgICAgKG90aElzTnVsbCAmJiB2YWxJc0RlZmluZWQgJiYgdmFsSXNSZWZsZXhpdmUpIHx8XG4gICAgICAgICAgICAoIW90aElzRGVmaW5lZCAmJiB2YWxJc1JlZmxleGl2ZSkgfHxc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clxuICAgICAgICAgID8gY3VzdG9taXplcihvYmplY3Rba2V5XSwgc291cmNlW2tleV0sIGtleSwgb2JqZWN0LCBzb3VyY2UpXG4gICAgICAgICAgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgaWYgKG5ld1ZhbHVlID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBuZXdWYWx1ZSA9IHNvdXJjZVtrZXldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc05ldykge1xuICAgICAgICAgIGJhc2VBc3NpZ25WYWx1ZShvYmplY3QsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGFzc2lnblZhbHVlKG9iamVjdCwga2V5LCBuZXdWYWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29waWVzIG93biBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIGZyb20uXG4gICAgICogQHBhcmFtIHtPYmplY3R9IFtvYmplY3Q9e31dIFRoZSBvYmplY3QgdG8gY29weSBzeW1ib2xzIHRvLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgYG9iamVjdGAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29weVN5bWJvbHMoc291cmNlLCBvYmplY3QpIHtcbiAgICAgIHJldHVybiBjb3B5T2JqZWN0KHNvdXJjZSwgZ2V0U3ltYm9scyhzb3VyY2UpLCBvYmplY3QpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENvcGllcyBvd24gYW5kIGluaGVyaXRlZCBzeW1ib2xzIG9mIGBzb3VyY2VgIHRvIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogQHByaXZhdGV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yICYmIGdldEZ1bmNOYW1lKGZ1bmMpID09ICd3cmFwcGVyJykge1xuICAgICAgICAgICAgdmFyIHdyYXBwZXIgPSBuZXcgTG9kYXNoV3JhcHBlcihbXSwgdHJ1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGluZGV4ID0gd3JhcHBlciA/IGluZGV4IDogbGVuZ3RoO1xuICAgICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgIGZ1bmMgPSBmdW5jc1tpbmRleF07XG5cbiAgICAgICAgICB2YXIgZnVuY05hbWUgPSBnZXRGdW5jTmFtZShmdW5jKSxcbiAgICAgICAgICAgICAgZGF0YSA9IGZ1bmNOYW1lID09ICd3cmFwcGVyJyA/IGdldERhdGEoZnVuYykgOiB1bmRlZmluZWQ7XG5cbiAgICAgICAgICBpZiAoZGF0YSAmJiBpc0xhemlhYmxlKGRhdGFbMF0pICYmXG4gICAgICAgICAgICAgICAgZGF0YVsxXSA9PSAoV1JBUF9BUllfRkxBRyB8IFdSQVBfQ1VSUllfRkxBRyB8IFdSQVBfUEFSVElBTF9GTEFHIHwgV1JBUF9SRUFSR19GTEFHKSAmJlxuICAgICAgICAgICAgICAgICFkYXRhWzRdLmxlbmd0aCAmJiBkYXRhWzldID09IDFcbiAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICB3cmFwcGVyID0gd3JhcHBlcltnZXRGdW5jTmFtZShkYXRhWzBdKV0uYXBwbHkod3JhcHBlciwgZGF0YVszXSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHdyYXBwZXIgPSAoZnVuYy5sZW5ndGggPT0gMSAmJiBpc0xhemlhYmxlKGZ1bmMpKVxuICAgICAgICAgICAgICA/IHdyYXBwZXJbZnVuY05hbWVdKClcbiAgICAgICAgICAgICAgOiB3cmFwcGVyLnRocnUoZnVuYyk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmdW5jd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1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uKG51bWJlciwgcHJlY2lzaW9uKSB7XG4gICAgICAgIG51bWJlciA9IHRvTnVtYmVyKG51bWJlcik7XG4gICAgICAgIHByZWNpc2lvbiA9IHByZWNpc2lvbiA9PSBudWxsID8gMCA6IG5hdGl2ZU1pbih0b0ludGVnZXIocHJlY2lzaW9uKSwgMjkyKTtcbiAgICAgICAgaWYgKHByZWNpc2lvbikge1xuICAgICAgICAgIC8vIFNoaWZ0IHdpdGggZXhwb25lbnRpYWwgbm90YXRpb24gdG8gYXZvaWQgZmxvYXRpbmctcG9pbnQgaXNzdWVzLlxuICAgICAgICAgIC8vIFNlZSBbTUROXShodHRwczovL21kbi5pby9yb3VuZCNFeGFtcGxlcykgZm9yIG1vcmUgZGV0YWlscy5cbiAgICAgICAgICB2YXIgcGFpciA9ICh0b1N0cmluZyhudW1iZXIpICsgJ2UnKS5zcGxpdCgnZScpLFxuICAgICAgICAgICAgICB2YWx1ZSA9IGZ1bmMocGFpclswXSArICdlJyArICgrcGFpclsxXSArIHByZWNpc2lvbikpO1xuXG4gICAgICAgICAgcGFpciA9ICh0b1N0cmluZyh2YWx1ZSkgKyAnZScpLnNwbGl0KCdlJyk7XG4gICAgICAgICAgcmV0dXJuICsocGFpclswXSArICdlJyArICgrcGFpclsxXSAtIHByZWNpc2lvbikpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmdW5jKG51bWJlcik7XG4gICAgICB9O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXMgYSBzZXQgb2JqZWN0IG9mIGB2YWx1ZXNgLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge0FycmF5fSB2YWx1ZXMgVGhlIHZhbHVlcyB0byBhZGQgdG8gdGhlIHNldC5cbiAgICAgKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBuZXcgc2V0LlxuICAgICAqL1xuICAgIHZhciBjcmVh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gZnVuY3Rpb24ob3RoVmFsdWUsIG90aEluZGV4KSB7XG4gICAgICAgICAgICAgICAgaWYgKCFjYWNoZUhhcyhzZWVuLCBvdGhJbmRleCkgJiZcbiAgICAgICAgICAgICAgICAgICAgKGFyclZhbHVlID09PSBvdGhWYWx1ZSB8fCBlcXVhbEZ1bmMoYXJyVmFsdWUsIG90aFZhbHVlLCBiaXRtYXNrLCBjdXN0b21pemVyLCBzdGFjaykpKSB7XG4gICAgICAgICAgICAgICAgICByZXR1cm4gc2Vlbi5wdXNoKG90aEluZGV4KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pKSB7XG4gICAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmICghKFxuICAgICAgICAgICAgICBhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHxcbiAgICAgICAgICAgICAgICBlcXVhbEZ1bmMoYXJyVmFsdWUsIG90aFZhbHVlLCBiaXRtYXNrLCBjdXN0b21pemVyLCBzdGFjaylcbiAgICAgICAgICAgICkpIHtcbiAgICAgICAgICByZXN1bHQgPSBmYWxzZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgc3RhY2tbJ2RlbGV0ZSddKGFycmF5KTtcbiAgICAgIHN0YWNrWydkZWxldGUnXShvdGhlcik7XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEEgc3BlY2lhbGl6ZWQgdmVyc2lvbiBvZiBgYmFzZUlzRXF1YWxEZWVwYCBmb3IgY29tcGFyaW5nIG9iamVjdHMgb2ZcbiAgICAgKiB0aGUgc2FtZSBgdG9TdHJpbmdUYWdgLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFRoaXMgZnVuY3Rpb24gb25seSBzdXBwb3J0cyBjb21wYXJpbmcgdmFsdWVzIHdpdGggdG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GFnOlxuICAgICAgICBjYXNlIHN0cmluZ1RhZzpcbiAgICAgICAgICAvLyBDb2VyY2UgcmVnZXhlcyB0byBzdHJpbmdzIGFuZCB0cmVhdCBzdHJpbmdzLCBwcmltaXRpdmVzIGFuZCBvYmplY3RzLFxuICAgICAgICAgIC8vIGFzIGVxdWFsLiBTZWUgaHR0cDovL3d3dy5lY21hLWludGVybmF0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLXJlZ2V4cC5wcm90b3R5cGUudG9zdHJpbmdcbiAgICAgICAgICAvLyBmb3IgbW9yZSBkZXRhaWxzLlxuICAgICAgICAgIHJldHVybiBvYmplY3QgPT0gKG90aGVyICsgJycpO1xuXG4gICAgICAgIGNhc2UgbWFwVGFnOlxuICAgICAgICAgIHZhciBjb252ZXJ0ID0gbWFwVG9BcnJheTtcblxuICAgICAgICBjYXNlIHNldFRhZzpcbiAgICAgICAgICB2YXIgaXNQYXJ0aWFsID0gYml0bWFzayAmIENPTVBBUkVfUEFSVElBTF9GTEFHO1xuICAgICAgICAgIGNvbnZlcnQgfHwgKGNvbnZlcnQgPSBzZXRUb0FycmF5KTtcblxuICAgICAgICAgIGlmIChvYmplY3Quc2l6ZSAhPSBvdGhlci5zaXplICYmICFpc1BhcnRpYWwpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgLy8gQXNzdW1lIGN5Y2xpYyB2YWx1ZXMgYXJlIGVxdWFsLlxuICAgICAgICAgIHZhciBzdGFja2VkID0gc3RhY2suZ2V0KG9iamVjdCk7XG4gICAgICAgICAgaWYgKHN0YWNrZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBzdGFja2VkID09IG90aGVyO1xuICAgICAgICAgIH1cbiAgICAgICAgICBiaXRtYXNrIHw9IENPTVBBUkVfVU5PUkRFUkVEX0ZMQUc7XG5cbiAgICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIG9iamVjdHMgKHN1c2Nl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gICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAvLyBBc3N1bWUgY3ljbGljIHZhbHVlcyBhcmUgZXF1YWwuXG4gICAgICB2YXIgc3RhY2tlZCA9IHN0YWNrLmdldChvYmplY3QpO1xuICAgICAgaWYgKHN0YWNrZWQgJiYgc3RhY2suZ2V0KG90aGVyKSkge1xuICAgICAgICByZXR1cm4gc3RhY2tlZCA9PSBvdGhlcjtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSB0cnVlO1xuICAgICAgc3RhY2suc2V0KG9iamVjdCwgb3RoZXIpO1xuICAgICAgc3RhY2suc2V0KG90aGVyLCBvYmplY3QpO1xuXG4gICAgICB2YXIgc2tpcEN0b3IgPSBpc1BhcnRpYWw7XG4gICAgICB3aGlsZSAoKytpbmRleCA8IG9iakxlbmd0aCkge1xuICAgICAgICBrZXkgPSBvYmpQcm9wc1tpbmRleF07XG4gICAgICAgIHZhciBvYmpWYWx1ZSA9IG9iamVjdFtrZXldLFxuICAgICAgICAgICAgb3RoVmFsdWUgPSBvdGhlcltrZXldO1xuXG4gICAgICAgIGlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4gICAgICAgICAgICA/IGN1c3RvbWl6ZXIob3RoVmFsdWUsIG9ialZhbHVlLCBrZXksIG90aGVyLCBvYmplY3QsIHN0YWNrKVxuICAgICAgICAgICAgOiBjdXN0b21pemVyKG9ialZhbHVlLCBvdGhWYWx1ZSwga2V5LCBvYmplY3QsIG90aGVyLCBzdGFjayk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gUmVjdXJzaXZlbHkgY29tcGFyZSBvYmplY3RzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGlmICghKGNvbXBhcmVkID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICAgPyAob2JqVmFsdWUgPT09IG90aFZ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bGFncy5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHJldHVybnMge0FycmF5fSBkZXRhaWxzIFRoZSBkZXRhaWxzIHRvIG1vZGlmeS5cbiAgICAgKiBAcGFyYW0ge251bWJlcn0gYml0bWFzayBUaGUgYml0bWFzayBmbGFncy4gU2VlIGBjcmVhdGVXcmFwYCBmb3IgbW9yZSBkZXRhaWxzLlxuICAgICAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyBgZGV0YWlsc2AuXG4gICAgICovXG4gICAgZnVuY3Rpb24gdXBkYXRlV3JhcERldGFpbHMoZGV0YWlscywgYml0bWFzaykge1xuICAgICAgYXJyYXlFYWNoKHdyYXBGbGFncywgZnVuY3Rpb24ocGFpcikge1xuICAgICAgICB2YXIgdmFsdWUgPSAnXy4nICsgcGFpclswXTtcbiAgICAgICAgaWYgKChiaXRtYXNrICYgcGFpclsxXSkgJiYgIWFycmF5SW5jbHVkZXMoZGV0YWlscywgdmFsdWUpKSB7XG4gICAgICAgICAgZGV0YWlscy5wdXNoKHZhbHVlKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG4gICAgICByZXR1cm4gZGV0YWlscy5zb3J0KCk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhIGNsb25lIG9mIGB3cmFwcGVyYC5cbiAgICAgKlxuICAgICAqIEBwcml2YXRlXG4gICAgICogQHBhcmFtIHtPYmplY3R9IHdyYXBwZXIgVGhlIHdyYXBwZXIgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgY2xvbmVkIHdyYXBwZXIuXG4gICAgICovXG4gICAgZnVuY3Rpb24gd3JhcHBlckNsb25lKHdyYXBwZXIpIHtcbiAgICAgIGlmICh3cmFwcGVyIGluc3RhbmNlb2YgTGF6eVdyYXBwZXIpIHtcbiAgICAgICAgcmV0dXJuIHdyYXBwZXIuY2xvbmUoKTtcbiAgICAgIH1cbiAgICAgIHZ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29uY2F0ZW5hdGluZyBgYXJyYXlgIHdpdGggYW55IGFkZGl0aW9uYWwgYXJyYXlzXG4gICAgICogYW5kL29yIHZhbHVlcy5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjAuMFxuICAgICAqIEBjYXRlZ29yeSBBcnJheVxuICAgICAqIEBwYXJhbSB7QXJyYXl9IGFycmF5IFRoZSBhcnJheSB0byBjb25jYXRlbmF0ZS5cbiAgICAgKiBAcGFyYW0gey4uLip9IFt2YWx1ZXNdIFRoZSB2YWx1ZXMgdG8gY29uY2F0ZW5hdGUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBuZXcgY29uY2F0ZW5hdGVkIGFycmF5LlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgYXJyYXkgPSBbMV07XG4gICAgICogdmFyIG90aGVyID0gXy5jb25jYXQoYXJyYXksIDIsIFszXSwgW1s0XV0pO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob3RoZXIpO1xuICAgICAqIC8vID0+IFsxLCAyLCAzLCBbNF1dXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzFdXG4gICAgICovXG4gICAgZnVuY3Rpb24gY29uY2F0KCkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICByZXR1cm4gW107XG4gICAgICB9XG4gICAgICB2YXIgYXJncyA9IEFycmF5KGxlbmd0aCAtIDEpLFxuICAgICAgICAgIGFycmF5ID0gYXJndW1lbnRzWzBdLFxuICAgICAgICAgIGluZGV4ID0gbGVuZ3RoO1xuXG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICBhcmdzW2luZGV4IC0gMV0gPSBhcmd1bWVudHNbaW5kZXhd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HdpdGggZXhwbGljaXQgY2hhaW5pbmcuXG4gICAgICogXyh1c2VycylcbiAgICAgKiAgIC5jaGFpbigpXG4gICAgICogICAuaGVhZCgpXG4gICAgICogICAucGljaygndXNlcicpXG4gICAgICogICAudmFsdWUoKTtcbiAgICAgKiAvLyA9PiB7ICd1c2VyJzogJ2Jhcm5leScgfVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIHdyYXBwZXJDaGFpbigpIHtcbiAgICAgIHJldHVybiBjaGFpbih0aGlzKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBFeGVjdXRlcyB0aGUgY2hhaW4gc2VxdWVuY2UgYW5kIHJldHVybnMgdGhlIHdyYXBwZWQgcmVzdWx0LlxuICAgICAqXG4gICAgICogQG5hbWUgY29tbWl0XG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgMy4yLjBcbiAgICAgKiBAY2F0ZWdvcnkgU2VxXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGBsb2Rhc2hgIHdyYXBwZXIgaW5zdGFuY2UuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBhcnJheSA9IFsxLCAyXTtcbiAgICAgKiB2YXIgd3JhcHBlZCA9IF8oYXJyYXkpLnB1c2goMyk7XG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzEsIDJdXG4gICAgICpcbiAgICAgKiB3cmFwcGVkID0gd3JhcHBlZC5jb21taXQoKTtcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzEsIDIsIDNdXG4gICAgICpcbiAgICAgKiB3cmFwcGVkLmxhc3QoKTtcbiAgICAgKiAvLyA9PiAzXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhhcnJheSk7XG4gICAgICogLy8gPT4gWzEsIDIsIDNdXG4gICAgICovXG4gICAgZnVuY3Rpb24gd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ZWdvcnkgU2VxXG4gICAgICogQHBhcmFtIHsqfSB2YWx1ZSBUaGUgdmFsdWUgdG8gcGxhbnQuXG4gICAgICogQHJldHVybnMge09iamVjdH0gUmV0dXJucyB0aGUgbmV3IGBsb2Rhc2hgIHdyYXBwZXIgaW5zdGFuY2UuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIGZ1bmN0aW9uIHNxdWFyZShuKSB7XG4gICAgICogICByZXR1cm4gbiAqIG47XG4gICAgICogfVxuICAgICAqXG4gICAgICogdmFyIHdyYXBwZWQgPSBfKFsxLCAyXSkubWFwKHNxdWFyZSk7XG4gICAgICogdmFyIG90aGVyID0gd3JhcHBlZC5wbGFudChbMywgNF0pO1xuICAgICAqXG4gICAgICogb3RoZXIudmFsdWUoKTtcbiAgICAgKiAvLyA9PiBbOSwgMTZdXG4gICAgICpcbiAgICAgKiB3cmFwcGVkLnZhbHVlKCk7XG4gICAgICogLy8gPT4gWzEsIDRdXG4gICAgICovXG4gICAgZnVuY3Rpb24gd3JhcHBlclBsYW50KHZhbHVlKSB7XG4gICAgICB2YXIgcmVzdWx0LFxuICAgICAgICAgIHBhcmVudCA9IHRoaXM7XG5cbiAgICAgIHdoaWxlIChwYXJlbnQgaW5zdGFuY2VvZiBiYXNlTG9kYXNoKSB7XG4gICAgICAgIHZhciBjbG9uZSA9IHdyYXBwZXJDbG9uZShwYXJlbnQpO1xuICAgICAgICBjbG9uZS5fX2luZGV4X18gPSAwO1xuICAgICAgICBjbG9uZS5fX3ZhbHVlc19fID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAocmVzdWx0KSB7XG4gICAgICAgICAgcHJldmlvdXMuX193cmFwcGVkX18gPSBjbG9uZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQgPSBjbG9uZTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgcHJldmlvdXMgPSBjbG9uZTtcbiAgICAgICAgcGFyZW50ID0gcGFyZW50Ll9fd3Jhc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VzZXInOiAnZnJlZCcsXG4gICAgICogICAnZ3JlZXQnOiBmdW5jdGlvbihncmVldGluZywgcHVuY3R1YXRpb24pIHtcbiAgICAgKiAgICAgcmV0dXJuIGdyZWV0aW5nICsgJyAnICsgdGhpcy51c2VyICsgcHVuY3R1YXRpb247XG4gICAgICogICB9XG4gICAgICogfTtcbiAgICAgKlxuICAgICAqIHZhciBib3VuZCA9IF8uYmluZEtleShvYmplY3QsICdncmVldCcsICdoaScpO1xuICAgICAqIGJvdW5kKCchJyk7XG4gICAgICogLy8gPT4gJ2hpIGZyZWQhJ1xuICAgICAqXG4gICAgICogb2JqZWN0LmdyZWV0ID0gZnVuY3Rpb24oZ3JlZXRpbmcsIHB1bmN0dWF0aW9uKSB7XG4gICAgICogICByZXR1cm4gZ3JlZXRpbmcgKyAneWEgJyArIHRoaXMudXNlciArIHB1bmN0dWF0aW9uO1xuICAgICAqIH07XG4gICAgICpcbiAgICAgKiBib3VuZCgnIScpO1xuICAgICAqIC8vID0+ICdoaXlhIGZyZWQhJ1xuICAgICAqXG4gICAgICogLy8gQm91bmQgd2l0aCBwbGFjZWhvbGRlcnMuXG4gICAgICogdmFyIGJvdW5kID0gXy5iaW5kS2V5KG9iamVjdCwgJ2dyZWV0JywgXywgJyEnKTtcbiAgICAgKiBib3VuZCgnaGknKTtcbiAgICAgKiAvLyA9PiAnaGl5YSBmcmVkISdcbiAgICAgKi9cbiAgICB2YXIgYmluZEtleSA9IGJhc2VSZXN0KGZ1bmN0aW9uKG9iamVjdCwga2V5LCBwYXJ0aWFscykge1xuICAgICAgdmFyIGJpdG1hc2sgPSBXUkFQX0JJTkRfRkxBRyB8IFdSQVBfQklORF9LRVlfRkxBRztcbiAgICAgIGlmIChwYXJ0aWFscy5sZW5ndGgpIHtcbiAgICAgICAgdmFyIGhvbGRlcnMgPSByZXBsYWNlSG9sZGVycyhwYXJ0aWFscywgZ2V0SG9sZGVyKGJpbmRLZXkpKTtcbiAgICAgICAgYml0bWFzayB8PSB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CkpO1xuICAgICAgfVxuXG4gICAgICBmdW5jdGlvbiBkZWJvdW5jZWQoKSB7XG4gICAgICAgIHZhciB0aW1lID0gbm93KCksXG4gICAgICAgICAgICBpc0ludm9raW5nID0gc2hvdWxkSW52b2tlKHRpbWUpO1xuXG4gICAgICAgIGxhc3RBcmdzID0gYXJndW1lbnRzO1xuICAgICAgICBsYXN0VGhpcyA9IHRoaXM7XG4gICAgICAgIGxhc3RDYWxsVGltZSA9IHRpbWU7XG5cbiAgICAgICAgaWYgKGlzSW52b2tpbmcpIHtcbiAgICAgICAgICBpZiAodGltZXJJZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICByZXR1cm4gbGVhZGluZ0VkZ2UobGFzdENhbGxUaW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG1heGluZykge1xuICAgICAgICAgICAgLy8gSGFuZGxlIGludm9jYXRpb25zIGluIGEgdGlnaHQgbG9vcC5cbiAgICAgICAgICAgIHRpbWVySWQgPSBzZXRUaW1lb3V0KHRpbWVyRXhwaXJlZCwgd2FpdCk7XG4gICAgICAgICAgICByZXR1cm4gaW52b2tlRnVuYyhsYXN0Q2FsbFRpbWUpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodGltZXJJZCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgdGltZXJJZCA9IHNldFRpbWVvdXQodGltZXJFeHBpcmVkLCB3YWl0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgfVxuICAgICAgZGVib3VuY2VkLmNhbmNlbCA9IGNhbmNlbDtcbiAgICAgIGRlYm91bmNlZC5mbHVzaCA9IGZsdXNoO1xuICAgICAgcmV0dXJuIGRlYm91bmNlZDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBEZWZlcnMgaW52b2tpbmcgdGhlIGBmdW5jYCB1bnRpbCB0aGUgY3VycmVudCBjYWxsIHN0YWNrIGhhcy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dHlwZW9mIGZsb2F0aW5nICE9ICdib29sZWFuJyAmJiBpc0l0ZXJhdGVlQ2FsbChsb3dlciwgdXBwZXIsIGZsb2F0aW5nKSkge1xuICAgICAgICB1cHBlciA9IGZsb2F0aW5nID0gdW5kZWZpbmVkO1xuICAgICAgfVxuICAgICAgaWYgKGZsb2F0aW5nID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiB1cHBlciA9PSAnYm9vbGVhbicpIHtcbiAgICAgICAgICBmbG9hdGluZyA9IHVwcGVyO1xuICAgICAgICAgIHVwcGVyID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICAgIGVsc2UgaWYgKHR5cGVvZiBsb3dlciA9PSAnYm9vbGVhbicpIHtcbiAgICAgICAgICBmbG9hdGluZyA9IGxvd2VyO1xuICAgICAgICAgIGxvd2VyID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAobG93ZXIgPT09IHVuZGVmaW5lZCAmJiB1cHBlciA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxvd2VyID0gMDtcbiAgICAgICAgdXBwZXIgPSAxO1xuICAgICAgfVxuICAgICAgZWxzZSB7XG4gICAgICAgIGxvd2VyID0gdG9GaW5pdGUobG93ZXIpO1xuICAgICAgICBpZiAodXBwZXIgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHVwcGVyID0gbG93ZXI7XG4gICAgICAgICAgbG93ZXIgPSAwO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHVwcGVyID0gdG9GaW5pdGUodXBwZXIpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICBpZiAobG93ZXIgPiB1cHBlcikge1xuICAgICAgICB2YXIgdGVtcCA9IGxvd2VyO1xuICAgICAgICBsb3dlciA9IHVwcGVyO1xuICAgICAgICB1cHBlciA9IHRlbXA7XG4gICAgICB9XG4gICAgICBpZiAoZmxvYXRpbmcgfHwgbG93ZXIgJSAx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vYmplY3QgdG8gdGhlIHRvcCBvZiB0aGUgc2NvcGUgY2hhaW4uXG4gICAgICB2YXIgdmFyaWFibGUgPSBvcHRpb25zLnZhcmlhYmxlO1xuICAgICAgaWYgKCF2YXJpYWJsZSkge1xuICAgICAgICBzb3VyY2UgPSAnd2l0aCAob2JqKSB7XFxuJyArIHNvdXJjZSArICdcXG59XFxuJztcbiAgICAgIH1cbiAgICAgIC8vIENsZWFudXAgY29kZSBieSBzdHJpcHBpbmcgZW1wdHkgc3RyaW5ncy5cbiAgICAgIHNvdXJjZSA9IChpc0V2YWx1YXRpbmcgPyBzb3VyY2UucmVwbGFjZShyZUVtcHR5U3RyaW5nTGVhZGluZywgJycpIDogc291cmNlKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nTWlkZGxlLCAnJDEnKVxuICAgICAgICAucmVwbGFjZShyZUVtcHR5U3RyaW5nVHJhaWxpbmcsICckMTsnKTtcblxuICAgICAgLy8gRnJhbWUgY29kZSBhcyB0aGUgZnVuY3Rpb24gYm9keS5cbiAgICAgIHNvdXJjZSA9ICdmdW5jdGlvbignICsgKHZhcmlhYmxlIHx8ICdvYmonKSArICcpIHtcXG4nICtcbiAgICAgICAgKHZhcmlhYmxlXG4gICAgICAgICAgPyAnJ1xuICAgICAgICAgIDogJ29iaiB8fCAob2JqID0ge30pO1xcbidcbiAgICAgICAgKSArXG4gICAgICAgIFwidmFyIF9fdCwgX19wID0gJydcIiArXG4gICAgICAgIChpc0VzY2FwaW5nXG4gICAgICAgICAgID8gJywgX19lID0gXy5lc2NhcGUnXG4gICAgICAgICAgIDogJydcbiAgICAgICAgKSArXG4gICAgICAgIChpc0V2YWx1YXRpbmdcbiAgICAgICAgICA/ICcsIF9faiA9IEFycmF5LnByb3RvdHlwZS5qb2luO1xcbicgK1xuICAgICAgICAgICAgXCJmdW5jdGlvbiBwcmludCgpIHsgX19wICs9IF9fai5jYWxsKGFyZ3VtZW50cywgJycpIH1cXG5cIlxuICAgICAgIC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xuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIG5ldyBlbXB0eSBvYmplY3QuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBvYmplY3RzID0gXy50aW1lcygyLCBfLnN0dWJPYmplY3QpO1xuICAgICAqXG4gICAgICogY29uc29sZS5sb2cob2JqZWN0cyk7XG4gICAgICogLy8gPT4gW3t9LCB7fV1cbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKG9iamVjdHNbMF0gPT09IG9iamVjdHNbMV0pO1xuICAgICAqIC8vID0+IGZhbHNlXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1Yk9iamVjdCgpIHtcbiAgICAgIHJldHVybiB7fTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGlzIG1ldGhvZCByZXR1cm5zIGFuIGVtcHR5IHN0cmluZy5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtzdHJpbmd9IFJldHVybnMgdGhlIGVtcHR5IHN0cmluZy5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy50aW1lcygyLCBfLnN0dWJTdHJpbmcpO1xuICAgICAqIC8vID0+IFsnJywgJyddXG4gICAgICovXG4gICAgZnVuY3Rpb24gc3R1YlN0cmluZygpIHtcbiAgICAgIHJldHVybiAnJztcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBUaGlzIG1ldGhvZCByZXR1cm5zIGB0cnVlYC5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAbWVtYmVyT2YgX1xuICAgICAqIEBzaW5jZSA0LjEzLjBcbiAgICAgKiBAY2F0ZWdvcnkgVXRpbFxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnV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iAgICAgICAgICBpZiAoY29uZGl0aW9uLm9wZXJhdG9yID09PSAnYWxsJykge1xuICAgICAgICAgICAgY29tcGFyaXNvblByb21pc2UgPSBhbGwoc3ViQ29uZGl0aW9ucyk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbXBhcmlzb25Qcm9taXNlID0gYW55KHN1YkNvbmRpdGlvbnMpO1xuICAgICAgICAgIH1cbiAgICAgICAgICAvLyBmb3IgYm9vbGVhbnMsIHJ1bGUgcGFzc2luZyBpcyBkZXRlcm1pbmVkIGJ5IHRoZSBhbGwvYW55IHJlc3VsdFxuICAgICAgICAgIHJldHVybiBjb21wYXJpc29uUHJvbWlzZS50aGVuKGZ1bmN0aW9uIChjb21wYXJpc29uVmFsdWUpIHtcbiAgICAgICAgICAgIHZhciBwYXNzZXMgPSBjb21wYXJpc29uVmFsdWUgPT09IHRydWU7XG4gICAgICAgICAgICBjb25kaXRpb24ucmVzdWx0ID0gcGFzc2VzO1xuICAgICAgICAgICAgcmV0dXJuIHBhc3NlcztcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gY29uZGl0aW9uLmV2YWx1YXRlKGFsbWFuYWMsIF90aGlzMy5lbmdpbmUub3BlcmF0b3JzKS50aGVuKGZ1bmN0aW9uIChldmFsdWF0aW9uUmVzdWx0KSB7XG4gICAgICAgICAgICB2YXIgcGFzc2VzID0gZXZhbHVhdGlvblJlc3VsdC5yZXN1bHQ7XG4gICAgICAgICAgICBjb25kaXRpb24uZmFjdFJlc3VsdCA9IGV2YWx1YXRpb25SZXN1bHQubGVmdEhhbmRTaWRlVmFsdWU7XG4gICAgICAgICAgICBjb25kaXRpb24ucmVzdWx0ID0gcGFzc2VzO1xuICAgICAgICAgICAgcmV0dXJuIHBhc3NlcztcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAgLyoqXG4gICAgICAgKiBFdmFsdXRlcyB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gZmlyZSBvZmYgdGhlIHJlbWFpbmluZyBwcm9taXNlc1xuICAgICAgICAgICAgaWYgKG9wZXJhdG9yID09PSAnYWxsJyAmJiBzZXRSZXN1bHQgPT09IGZhbHNlIHx8IHN0b3ApIHtcbiAgICAgICAgICAgICAgKDAsIF9kZWJ1ZzIuZGVmYXVsdCkoJ3ByaW9yaXRpemVBbmRSdW46OmRldGVjdGVkIGZhbHNleSByZXN1bHQ7IHNraXBwaW5nIHJlbWFpbmluZyBjb25kaXRpb25zJyk7XG4gICAgICAgICAgICAgIHN0b3AgPSB0cnVlO1xuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBhbGwgY29uZGl0aW9ucyBwYXNzZWQ7IHByb2NlZWQgd2l0aCBydW5uaW5nIG5leHQgc2V0IGluIHBhcmFsbGVsXG4gICAgICAgICAgICByZXR1cm4gZXZhbHVhdGVDb25kaXRpb25zKHNldCwgbWV0aG9kKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfTtcblxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG9yZGVyZWRTZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgX2xvb3AoaSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGN1cnNvcjtcbiAgICAgIH07XG5cbiAgICAgIC8qKlxuICAgICAgICogUnVucyBhbiAnYW55JyBib29sZWFuIG9wZXJhdG9yIG9uIGFuIGFycmF5IG9mIGNvbmRpdGlvbnNcbiAgICAgICAqIEBwYXJhbSAge0NvbmRpdGlvbltdfSBjb25kaXRpb25zIHRvIGJlIGV2YWx1YXRlZFxuICAgICAgICogQHJldHVybiB7UHJvbWlzZShib29sZWFuKX0gY29uZGl0aW9uIGV2YWx1YXRpb24gcmVzdWx0XG4gICAgICAgKi9cbiAgICAgIHZhciBhbnkgPSBmdW5jdGlvbiBhbnkoY29uZGl0aW9ucykge1xuICAgICAgICByZXR1cm4gc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ArIHJzTWlzYyArICcpJyxcbiAgICAgIHJzTWlzY1VwcGVyID0gJyg/OicgKyByc1VwcGVyICsgJ3wnICsgcnNNaXNjICsgJyknLFxuICAgICAgcnNPcHRDb250ckxvd2VyID0gJyg/OicgKyByc0Fwb3MgKyAnKD86ZHxsbHxtfHJlfHN8dHx2ZSkpPycsXG4gICAgICByc09wdENvbnRyVXBwZXIgPSAnKD86JyArIHJzQXBvcyArICcoPzpEfExMfE18UkV8U3xUfFZFKSk/JyxcbiAgICAgIHJlT3B0TW9kID0gcnNNb2RpZmllciArICc/JyxcbiAgICAgIHJzT3B0VmFyID0gJ1snICsgcnNWYXJSYW5nZSArICddPycsXG4gICAgICByc09wdEpvaW4gPSAnKD86JyArIHJzWldKICsgJyg/OicgKyBbcnNOb25Bc3RyYWwsIHJzUmVnaW9uYWwsIHJzU3VyclBhaXJdLmpvaW4oJ3wnKSArICcpJyArIHJzT3B0VmFyICsgcmVPcHRNb2QgKyAnKSonLFxuICAgICAgcnNPcmRMb3dlciA9ICdcXFxcZCooPzoxc3R8Mm5kfDNyZHwoPyFbMTIzXSlcXFxcZHRoKSg/PVxcXFxifFtBLVpfXSknLFxuICAgICAgcnNPcmRVcHBlciA9ICdcXFxcZCooPzoxU1R8Mk5EfDNSRHwoPyFbMTIzXSlcXFxcZFRIKSg/PVxcXFxifFthLXpfXSknLFxuICAgICAgcnNTZXEgPSByc09wdFZhciArIHJlT3B0TW9kICsgcnNPcHRKb2luLFxuICAgICAgcnNFbW9qaSA9ICcoPzonICsgW3JzRGluZ2JhdCwgcnNSZWdpb25hbCwgcnNTdXJyUGFpcl0uam9pbignfCcpICsgJyknICsgcnNTZXEsXG4gICAgICByc1N5bWJvbCA9ICcoPzonICsgW3JzTm9uQXN0cmFsICsgcnNDb21ibyArICc/JywgcnNDb21ibywgcnNSZWdpb25hbCwgcnNTdXJyUGFpciwgcnNBc3RyYWxdLmpvaW4oJ3wnKSArICcpJztcblxuICAvKiogVXNlZCB0byBtYXRjaC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XG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uY29uZm9ybXNUb2Agd2hpY2ggYWNjZXB0cyBgcHJvcHNgIHRvIGNoZWNrLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gaW5zcGVjdC5cbiAgICAgKiBAcGFyYW0ge09iamVjdH0gc291cmNlIFRoZSBvYmplY3Qgb2YgcHJvcGVydHkgcHJlZGljYXRlcyB0byBjb25mb3JtIHRvLlxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgb2JqZWN0YCBjb25mb3JtcywgZWxzZSBgZmFsc2VgLlxuICAgICAqL1xuICAgIGZ1bmN0aW9uIGJhc2VDb25mb3Jtc1RvKG9iamVjdCwgc291cmNlLCBwcm9wcykge1xuICAgICAgdmFyIGxlbmd0aCA9IHByb3BzLmxlbmd0aDtcbiAgICAgIGlmIChvYmplY3QgPT0gbnVsbCkge1xuICAgICAgICByZXR1cm4gIWxlbmd0aDtcbiAgICAgIH1cbiAgICAgIG9iamVjdCA9IE9iamVjdChvYmplY3QpO1xuICAgICAgd2hpbGUgKGxlbmd0aC0tKSB7XG4gICAgICAgIHZhciBrZXkgPSBwcm9wc1tsZW5ndGhdLFxuICAgICAgICAgICAgcHJlZGljYXRlID0gc291cmNlW2tleV0sXG4gICAgICAgICAgICB2YWx1ZSA9IG9iamVjdFtrZXldO1xuXG4gICAgICAgIGlmICgodmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSB8fCAhcHJlZGljYXRlKHZhbHVlKSkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRp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AgICAgIHZhciB2YWx1ZSA9IGFycmF5W2luZGV4XSxcbiAgICAgICAgICAgIGNvbXB1dGVkID0gaXRlcmF0ZWUgPyBpdGVyYXRlZSh2YWx1ZSkgOiB2YWx1ZTtcblxuICAgICAgICB2YWx1ZSA9IChjb21wYXJhdG9yIHx8IHZhbHVlICE9PSAwKSA/IHZhbHVlIDogMDtcbiAgICAgICAgaWYgKCEoc2VlblxuICAgICAgICAgICAgICA/IGNhY2hlSGFzKHNlZW4sIGNvbXB1dGVkKVxuICAgICAgICAgICAgICA6IGluY2x1ZGVzKHJlc3VsdCwgY29tcHV0ZWQsIGNvbXBhcmF0b3IpXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgb3RoSW5kZXggPSBvdGhMZW5ndGg7XG4gICAgICAgICAgd2hpbGUgKC0tb3RoSW5kZXgpIHtcbiAgICAgICAgICAgIHZhciBjYWNoZSA9IGNhY2hlc1tvdGhJbmRleF07XG4gICAgICAgICAgICBpZiAoIShjYWNoZVxuICAgICAgICAgICAgICAgICAgPyBjYWNoZUhhcyhjYWNoZSwgY29tcHV0ZWQpXG4gICAgICAgICAgICAgICAgICA6IGluY2x1ZGVzKGFycmF5c1tvdGhJbmRleF0sIGNvbXB1dGVkLCBjb21wYXJhdG9yKSlcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgY29udGludWUgb3V0ZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgICBzZWVuLnB1c2goY29tcHV0ZWQpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXN1bHQucHVzaCh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaW52ZXJ0YCBhbmQgYF8uaW52ZXJ0QnlgIHdoaWNoIGlud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bSB7RnVuY3Rpb259IFtjdXN0b21pemVyXSBUaGUgZnVuY3Rpb24gdG8gY3VzdG9taXplIGNvbXBhcmlzb25zLlxuICAgICAqIEByZXR1cm5zIHtib29sZWFufSBSZXR1cm5zIGB0cnVlYCBpZiBgb2JqZWN0YCBpcyBhIG1hdGNoLCBlbHNlIGBmYWxzZWAuXG4gICAgICovXG4gICAgZnVuY3Rpb24gYmFzZUlzTWF0Y2gob2JqZWN0LCBzb3VyY2UsIG1hdGNoRGF0YSwgY3VzdG9taXplcikge1xuICAgICAgdmFyIGluZGV4ID0gbWF0Y2hEYXRhLmxlbmd0aCxcbiAgICAgICAgICBsZW5ndGggPSBpbmRleCxcbiAgICAgICAgICBub0N1c3RvbWl6ZXIgPSAhY3VzdG9taXplcjtcblxuICAgICAgaWYgKG9iamVjdCA9PSBudWxsKSB7XG4gICAgICAgIHJldHVybiAhbGVuZ3RoO1xuICAgICAgfVxuICAgICAgb2JqZWN0ID0gT2JqZWN0KG9iamVjdCk7XG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICB2YXIgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIGlmICgobm9DdXN0b21pemVyICYmIGRhdGFbMl0pXG4gICAgICAgICAgICAgID8gZGF0YVsxXSAhPT0gb2JqZWN0W2RhdGFbMF1dXG4gICAgICAgICAgICAgIDogIShkYXRhWzBdIGluIG9iamVjdClcbiAgICAgICAgICAgICkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgZGF0YSA9IG1hdGNoRGF0YVtpbmRleF07XG4gICAgICAgIHZhciBrZXkgPSBkYXRhWzBdLFxuICAgICAgICAgICAgb2JqVmFsdWUgPSBvYmplY3Rba2V5XSxcbiAgICAgICAgICAgIHNyY1ZhbHVlID0gZGF0YVsxXTtcblxuICAgICAgICBpZiAobm9DdXN0b21pemVyICYmIGRhdGFbMl0pIHtcbiAgICAgICAgICBpZiAob2JqVmFsdWUgPT09IHVuZGVmaW5lZCAmJiAhKGtleSBpbiBvYmplY3QpKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBzdGFjayA9IG5ldyBTdGFjaztcbiAgICAgICAgICBpZiAoY3VzdG9taXplcikge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGN1c3RvbWl6ZXIob2JqVmFsdWUsIHNyY1ZhbHVlLCBrZXksIG9iamVjdCwgc291cmNlLCBzdGFjayk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmICghKHJlc3VsdCA9PT0gdW5kZWZpbmVkXG4gICAgICAgICAgICAgICAgPyBiYXNlSXNFcXVhbChzcmNWYWx1ZSwgb2JqVmFsdWUsIENPTVBBUkVfUEFSVElBTF9GTEFHIHwgQ09NUEFSRV9VTk9SREVSRURfRkxBRywgY3VzdG9taXplciwgc3RhY2spXG4gICAgICAgICAgICAgICAgOiByZXN1bHRcbiAgICAgICAgICAgICAgKSkge1xuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYF8uaXNOYXRpdmVgIHdpdGhvdXQgYmFkIHNoaW0gY2hlY2tzLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0geyp9IHZhbHVlIFRoZSB2YWx1ZSB0byBjaGVjay5cbiAgICAgKiBAcmV0dXJucyB7Ym9vbGVhbn0gUmV0dXJucyBgdHJ1ZWAgaWYgYHZhbHVlYCBpcyBhIG5hdGl2ZSBmdW5jdGlvbixcbiAgICAgKiAgZWxzZSBgZmFsc2VgLlxuICA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2ZUtleXMob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICAgIGZvciAodmFyIGtleSBpbiBPYmplY3Qob2JqZWN0KSkge1xuICAgICAgICBpZiAoaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkgJiYga2V5ICE9ICdjb25zdHJ1Y3RvcicpIHtcbiAgICAgICAgICByZXN1bHQucHVzaChrZXkpO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFRoZSBiYXNlIGltcGxlbWVudGF0aW9uIG9mIGBfLmtleXNJbmAgd2hpY2ggZG9lc24ndCB0cmVhdCBzcGFyc2UgYXJyYXlzIGFzIGRlbnNlLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge09iamVjdH0gb2JqZWN0IFRoZSBvYmplY3QgdG8gcXVlcnkuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBhcnJheSBvZiBwcm9wZXJ0eSBuYW1lcy5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBiYXNlS2V5c0luKG9iamVjdCkge1xuICAgICAgaWYgKCFpc09iamVjdChvYmplY3QpKSB7XG4gICAgICAgIHJldHVybiBuYXRpdmVLZXlzSW4ob2JqZWN0KTtcbiAgICAgIH1cbiAgICAgIHZhciBpc1Byb3RvID0gaXNQcm90b3R5cGUob2JqZWN0KSxcbiAgICAgICAgICByZXN1bHQgPSBbXTtcblxuICAgICAgZm9yICh2YXIga2V5IGluIG9iamVjdCkge1xuICAgICAgICBpZiAoIShrZXkgPT0gJ2NvbnN0cnVjdG9yJyAmJiAoaXNQcm90byB8fCAhaGFzT3duUHJvcGVydHkuY2FsbChvYmplY3QsIGtleSkpKSkge1xuICAgICAgICAgIHJlc3VsdC5wdXNoKGtleSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgIHJ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3RJbmRleCA9IGxlbmd0aCAtIDEsXG4gICAgICAgICAgbmVzdGVkID0gb2JqZWN0O1xuXG4gICAgICB3aGlsZSAobmVzdGVkICE9IG51bGwgJiYgKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pLFxuICAgICAgICAgICAgbmV3VmFsdWUgPSB2YWx1ZTtcblxuICAgICAgICBpZiAoa2V5ID09PSAnX19wcm90b19fJyB8fCBrZXkgPT09ICdjb25zdHJ1Y3RvcicgfHwga2V5ID09PSAncHJvdG90eXBlJykge1xuICAgICAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaW5kZXggIT0gbGFzdEluZGV4KSB7XG4gICAgICAgICAgdmFyIG9ialZhbHVlID0gbmVzdGVkW2tleV07XG4gICAgICAgICAgbmV3VmFsdWUgPSBjdXN0b21pemVyID8gY3VzdG9taXplcihvYmpWYWx1ZSwga2V5LCBuZXN0ZWQpIDogdW5kZWZpbmVkO1xuICAgICAgICAgIGlmIChuZXdWYWx1ZSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICBuZXdWYWx1ZSA9IGlzT2JqZWN0KG9ialZhbHVlKVxuICAgICAgICAgICAgICA/IG9ialZhbHVlXG4gICAgICAgICAgICAgIDogKGlzSW5kZXgocGF0aFtpbmRleCArIDFdKSA/IFtdIDoge30pO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBhc3NpZ25WYWx1ZShuZXN0ZWQsIGtleSwgbmV3VmFsdWUpO1xuICAgICAgICBuZXN0ZWQgPSBuZXN0ZWRba2V5XTtcbiAgICAgIH1cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhlIGJhc2UgaW1wbGVtZW50YXRpb24gb2YgYHNldERhdGFgIHdpdGhvdXQgc3VwcG9ydCBmb3IgaG90IGxvb3Agc2hvcnRpbmcuXG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JHX0ZMQUcpICYmXG4gICAgICAgICAgICAgICAgIWRhdGFbNF0ubGVuZ3RoICYmIGRhdGFbOV0gPT0gMVxuICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgIHdyYXBwZXIgPSB3cmFwcGVyW2dldEZ1bmNOYW1lKGRhdGFbMF0pXS5hcHBseSh3cmFwcGVyLCBkYXRhWzNdKTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgd3JhcHBlciA9IChmdW5jLmxlbmd0aCA9PSAxICYmIGlzTGF6aWFibGUoZnVuYykpXG4gICAgICAgICAgICAgID8gd3JhcHBlcltmdW5jTmFtZV0oKVxuICAgICAgICAgICAgICA6IHdyYXBwZXIudGhydShmdW5jKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHZhciBhcmdzID0gYXJndW1lbnRzLFxuICAgICAgICAgICAgICB2YWx1ZSA9IGFyZ3NbMF07XG5cbiAgICAgICAgICBpZiAod3JhcHBlciAmJiBhcmdzLmxlbmd0aCA9PSAxICYmIGlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICByZXR1cm4gd3JhcHBlci5wbGFudCh2YWx1ZSkudmFsdWUoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgdmFyIGluZGV4ID0gMCxcbiAgICAgICAgICAgICAgcmVzdWx0ID0gbGVuZ3RoID8gZnVuY3NbaW5kZXhdLmFwcGx5KHRoaXMsIGFyZ3MpIDogdmFsdWU7XG5cbiAgICAgICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICAgICAgcmVzdWx0ID0gZnVuY3NbaW5kZXhdLmNhbGwodGhpcywgcmVzdWx0KTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfTtcbiAgICAgIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIENyZWF0ZXM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GlmIChjdXN0b21pemVyKSB7XG4gICAgICAgICAgdmFyIGNvbXBhcmVkID0gaXNQYXJ0aWFsXG4gICAgICAgICAgICA/IGN1c3RvbWl6ZXIob3RoVmFsdWUsIGFyclZhbHVlLCBpbmRleCwgb3RoZXIsIGFycmF5LCBzdGFjaylcbiAgICAgICAgICAgIDogY3VzdG9taXplcihhcnJWYWx1ZSwgb3RoVmFsdWUsIGluZGV4LCBhcnJheSwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoY29tcGFyZWQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIGlmIChjb21wYXJlZCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIC8vIFJlY3Vyc2l2ZWx5IGNvbXBhcmUgYXJyYXlzIChzdXNjZXB0aWJsZSB0byBjYWxsIHN0YWNrIGxpbWl0cykuXG4gICAgICAgIGlmIChzZWVuKSB7XG4gICAgICAgICAgaWYgKCFhcnJheVNvbWUob3RoZXIsIGZ1bmN0aW9uKG90aFZhbHVlLCBvdGhJbmRleCkge1xuICAgICAgICAgICAgICAgIGlmICghY2FjaGVIYXMoc2Vlbiwgb3RoSW5kZXgpICYmXG4gICAgICAgICAgICAgICAgICAgIChhcnJWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKGFyclZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKSkge1xuICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlZW4ucHVzaChvdGhJbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KSkge1xuICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAo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plY3QsIG90aGVyLCBiaXRtYXNrLCBjdXN0b21pemVyLCBlcXVhbEZ1bmMsIHN0YWNrKSB7XG4gICAgICB2YXIgaXNQYXJ0aWFsID0gYml0bWFzayAmIENPTVBBUkVfUEFSVElBTF9GTEFHLFxuICAgICAgICAgIG9ialByb3BzID0gZ2V0QWxsS2V5cyhvYmplY3QpLFxuICAgICAgICAgIG9iakxlbmd0aCA9IG9ialByb3BzLmxlbmd0aCxcbiAgICAgICAgICBvdGhQcm9wcyA9IGdldEFsbEtleXMob3RoZXIpLFxuICAgICAgICAgIG90aExlbmd0aCA9IG90aFByb3BzLmxlbmd0aDtcblxuICAgICAgaWYgKG9iakxlbmd0aCAhPSBvdGhMZW5ndGggJiYgIWlzUGFydGlhbCkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9XG4gICAgICB2YXIgaW5kZXggPSBvYmpMZW5ndGg7XG4gICAgICB3aGlsZSAoaW5kZXgtLSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqUHJvcHNbaW5kZXhdO1xuICAgICAgICBpZiAoIShpc1BhcnRpYWwgPyBrZXkgaW4gb3RoZXIgOiBoYXNPd25Qcm9wZXJ0eS5jYWxsKG90aGVyLCBrZXkpKSkge1xuICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgLy8gQ2hlY2sgdGhhdCBjeWNsaWMgdmFsdWVzIGFyZSBlcXVhbC5cbiAgICAgIHZhciBvYmpTdGFja2VkID0gc3RhY2suZ2V0KG9iamVjdCk7XG4gICAgICB2YXIgb3RoU3RhY2tlZCA9IHN0YWNrLmdldChvdGhlcik7XG4gICAgICBpZiAob2JqU3RhY2tlZCAmJiBvdGhTdGFja2VkKSB7XG4gICAgICAgIHJldHVybiBvYmpTdGFja2VkID09IG90aGVyICYmIG90aFN0YWNrZWQgPT0gb2JqZWN0O1xuICAgICAgfVxuICAgICAgdmFyIHJlc3VsdCA9IHRydWU7XG4gICAgICBzdGFjay5zZXQob2JqZWN0LCBvdGhlcik7XG4gICAgICBzdGFjay5zZXQob3RoZXIsIG9iamVjdCk7XG5cbiAgICAgIHZhciBza2lwQ3RvciA9IGlzUGFydGlhbDtcbiAgICAgIHdoaWxlICgrK2luZGV4IDwgb2JqTGVuZ3RoKSB7XG4gICAgICAgIGtleSA9IG9ialByb3BzW2luZGV4XTtcbiAgICAgICAgdmFyIG9ialZhbHVlID0gb2JqZWN0W2tleV0sXG4gICAgICAgICAgICBvdGhWYWx1ZSA9IG90aGVyW2tleV07XG5cbiAgICAgICAgaWYgKGN1c3RvbWl6ZXIpIHtcbiAgICAgICAgICB2YXIgY29tcGFyZWQgPSBpc1BhcnRpYWxcbiAgICAgICAgICAgID8gY3VzdG9taXplcihvdGhWYWx1ZSwgb2JqVmFsdWUsIGtleSwgb3RoZXIsIG9iamVjdCwgc3RhY2spXG4gICAgICAgICAgICA6IGN1c3RvbWl6ZXIob2JqVmFsdWUsIG90aFZhbHVlLCBrZXksIG9iamVjdCwgb3RoZXIsIHN0YWNrKTtcbiAgICAgICAgfVxuICAgICAgICAvLyBSZWN1cnNpdmVseSBjb21wYXJlIG9iamVjdHMgKHN1c2NlcHRpYmxlIHRvIGNhbGwgc3RhY2sgbGltaXRzKS5cbiAgICAgICAgaWYgKCEoY29tcGFyZWQgPT09IHVuZGVmaW5lZFxuICAgICAgICAgICAgICA/IChvYmpWYWx1ZSA9PT0gb3RoVmFsdWUgfHwgZXF1YWxGdW5jKG9ialZhbHVlLCBvdGhWYWx1ZSwgYml0bWFzaywgY3VzdG9taXplciwgc3RhY2spKVxuICAgICAgICAgICAgICA6IGNvbXBhcmVkXG4gICAgICAgICAgICApKSB7XG4gICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICAgICAgc2tpcEN0b3IgfHwgKHNraXBDdG9yID0ga2V5ID09ICdjb25zdHJ1Y3RvcicpO1xuICAgICAgfVxuICAgICAg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VsdCA9IGZhbHNlO1xuXG4gICAgICB3aGlsZSAoKytpbmRleCA8IGxlbmd0aCkge1xuICAgICAgICB2YXIga2V5ID0gdG9LZXkocGF0aFtpbmRleF0pO1xuICAgICAgICBpZiAoIShyZXN1bHQgPSBvYmplY3QgIT0gbnVsbCAmJiBoYXNGdW5jKG9iamVjdCwga2V5KSkpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgICBvYmplY3QgPSBvYmplY3Rba2V5XTtcbiAgICAgIH1cbiAgICAgIGlmIChyZXN1bHQgfHwgKytpbmRleCAhPSBsZW5ndGgpIHtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgICAgIGxlbmd0aCA9IG9iamVjdCA9PSBudWxsID8gMCA6IG9iamVjdC5sZW5ndGg7XG4gICAgICByZXR1cm4gISFsZW5ndGggJiYgaXNMZW5ndGgobGVuZ3RoKSAmJiBpc0luZGV4KGtleSwgbGVuZ3RoKSAmJlxuICAgICAgICAoaXNBcnJheShvYmplY3QpIHx8IGlzQXJndW1lbnRzKG9iamVjdCkpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEluaXRpYWxpemVzIGFuIGFycmF5IGNsb25lLlxuICAgICAqXG4gICAgICogQHByaXZhdGVcbiAgICAgKiBAcGFyYW0ge0FycmF5fSBhcnJheSBUaGUgYXJyYXkgdG8gY2xvbmUuXG4gICAgICogQHJldHVybnMge0FycmF5fSBSZXR1cm5zIHRoZSBpbml0aWFsaXplZCBjbG9uZS5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBpbml0Q2xvbmVBcnJheShhcnJheSkge1xuICAgICAgdmFyIGxlbmd0aCA9IGFycmF5Lmxlbmd0aCxcbiAgICAgICAgICByZXN1bHQgPSBuZXcgYXJyYXkuY29uc3RydWN0b3IobGVuZ3RoKTtcblxuICAgICAgLy8gQWRkIHByb3BlcnRpZXMgYXNzaWduZWQgYnkgYFJlZ0V4cCNleGVjYC5cbiAgIC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dWVzIGlzXG4gICAgICogZGV0ZXJtaW5lZCBieSB0aGUgb3JkZXIgdGhleSBvY2N1ciBpbiB0aGUgYXJyYXlzLiBUaGUgY29tcGFyYXRvciBpcyBpbnZva2VkXG4gICAgICogd2l0aCB0d28gYXJndW1lbnRzOiAoYXJyVmFsLCBvdGhWYWwpLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMC4wXG4gICAgICogQGNhdGVnb3J5IEFycmF5XG4gICAgICogQHBhcmFtIHsuLi5BcnJheX0gW2FycmF5c10gVGhlIGFycmF5cyB0byBpbnNwZWN0LlxuICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IFtjb21wYXJhdG9yXSBUaGUgY29tcGFyYXRvciBpbnZva2VkIHBlciBlbGVtZW50LlxuICAgICAqIEByZXR1cm5zIHtBcnJheX0gUmV0dXJucyB0aGUgbmV3IGFycmF5IG9mIGZpbHRlcmVkIHZhbHVlcy5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogdmFyIG9iamVjdHMgPSBbeyAneCc6IDEsICd5JzogMiB9LCB7ICd4JzogMiwgJ3knOiAxIH1dO1xuICAgICAqIHZhciBvdGhlcnMgPSBbeyAneCc6IDEsICd5JzogMSB9LCB7ICd4JzogMSwgJ3knOiAyIH1dO1xuICAgICAqXG4gICAgICogXy54b3JXaXRoKG9iamVjdHMsIG90aGVycywgXy5pc0VxdWFsKTtcbiAgICAgKiAvLyA9PiBbeyAneCc6IDIsICd5JzogMSB9LCB7ICd4JzogMSwgJ3knOiAxIH1dXG4gICAgICovXG4gICAgdmFyIHhvcldpdGggPSBiYXNlUmVzdChmdW5jdGlvbihhcnJheXMpIHtcbiAgICAgIHZhciBjb21wYXJhdG9yID0gbGFzdChhcnJheXMpO1xuICAgICAgY29tcGFyYXRvciA9IHR5cGVvZiBjb21wYXJhdG9yID09ICdmdW5jdGlvbicgPyBjb21wYXJhdG9yID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PSBsYXN0VGhpcyA9IHRpbWVySWQgPSB1bmRlZmluZWQ7XG4gICAgICB9XG5cbiAgICAgIGZ1bmN0aW9uIGZsdXNoKCkge1xuICAgICAgICByZXR1cm4gdGltZXJJZCA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogdHJhaWxpbmdFZGdlKG5vdygpKTtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZGVib3VuY2VkKCkge1xuICAgICAgICB2YXIgdGltZSA9IG5vdygpLFxuICAgICAgICAgICAgaXNJbnZva2luZyA9IHNob3VsZEludm9rZSh0aW1lKTtcblxuICAgICAgICBsYXN0QXJncyA9IGFyZ3VtZW50cztcbiAgICAgICAgbGFzdFRoaXMgPSB0aGlzO1xuICAgICAgICBsYXN0Q2FsbFRpbWUgPSB0aW1lO1xuXG4gICAgICAgIGlmIChpc0ludm9raW5nKSB7XG4gICAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcmV0dXJuIGxlYWRpbmdFZGdlKGxhc3RDYWxsVGltZSk7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChtYXhpbmcpIHtcbiAgICAgICAgICAgIC8vIEhhbmRsZSBpbnZvY2F0aW9ucyBpbiBhIHRpZ2h0IGxvb3AuXG4gICAgICAgICAgICBjbGVhclRpbWVvdXQodGltZXJJZCk7XG4gICAgICAgICAgICB0aW1lcklkID0gc2V0VGltZW91dCh0aW1lckV4cGlyZWQsIHdhaXQpO1xuICAgICAgICAgICAgcmV0dXJuIGludm9rZUZ1bmMobGFzdENhbGxUaW1lKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRpbWVySWQgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgIHRpbWVySWQgPSBzZXRUaW1lb3V0KHRpbWVyRXhwaXJlZCwgd2FpdCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgIH1cbiAgIC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0aW9uYWwub3JnL2VjbWEtMjYyLzcuMC8jc2VjLXRvaW50ZWdlcikuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4wLjBcbiAgICAgKiBAY2F0ZWdvcnkgTGFuZ1xuICAgICAqIEBwYXJhbSB7Kn0gdmFsdWUgVGhlIHZhbHVlIHRvIGNvbnZlcnQuXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgY29udmVydGVkIGludGVnZXIuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIF8udG9JbnRlZ2VyKDMuMik7XG4gICAgICogLy8gPT4gM1xuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoTnVtYmVyLk1JTl9WQUxVRSk7XG4gICAgICogLy8gPT4gMFxuICAgICAqXG4gICAgICogXy50b0ludGVnZXIoSW5maW5pdHkpO1xuICAgICAqIC8vID0+IDEuNzk3NjkzMTM0ODYyMzE1N2UrMzA4XG4gICAgICpcbiAgICAgKiBfLnRvSW50ZWdlcignMy4yJyk7XG4gICAgICogLy8gPT4gM1xuICAgICAqL1xuICAgIGZ1bmN0aW9uIHRvSW50ZWdlcih2YWx1ZSkge1xuICAgICAgdmFyIHJlc3VsdCA9IHRvRmluaXRlKHZhbHVlKSxcbiAgICAgICAgICByZW1haW5kZXIgPSByZXN1bHQgJSAxO1xuXG4gICAgICByZXR1cm4gcmVzdWx0ID09PSByZXN1bHQgPyAocmVtYWluZGVyID8gcmVzdWx0IC0gcmVtYWluZGVyIDogcmVzdWx0KSA6IDA7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ29udmVydHMgYHZhbHVlYCB0byBhbiBpbnRlZ2VyIHN1aXRhYmxlIGZvciB1c2UgYXMgdGhlIGxlbmd0aCBvZiBhblxuICAgICAqIGFycmF5LWxpa2Ugb2JqZWN0LlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFRoaXMgbWV0aG9k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zW2luZGV4XTtcbiAgICAgICAgdmFyIHByb3BzID0ga2V5c0luKHNvdXJjZSk7XG4gICAgICAgIHZhciBwcm9wc0luZGV4ID0gLTE7XG4gICAgICAgIHZhciBwcm9wc0xlbmd0aCA9IHByb3BzLmxlbmd0aDtcblxuICAgICAgICB3aGlsZSAoKytwcm9wc0luZGV4IDwgcHJvcHNMZW5ndGgpIHtcbiAgICAgICAgICB2YXIga2V5ID0gcHJvcHNbcHJvcHNJbmRleF07XG4gICAgICAgICAgdmFyIHZhbHVlID0gb2JqZWN0W2tleV07XG5cbiAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCB8fFxuICAgICAgICAgICAgICAoZXEodmFsdWUsIG9iamVjdFByb3RvW2tleV0pICYmICFoYXNPd25Qcm9wZXJ0eS5jYWxsKG9iamVjdCwga2V5KSkpIHtcbiAgICAgICAgICAgIG9iamVjdFtrZXldID0gc291cmNlW2tleV07XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfSk7XG5cbiAgICAvKipcbiAgICAgKiBUaGlzIG1ldGhvZCBpcyBsaWtlIGBfLmRlZmF1bHRzYCBleGNlcHQgdGhhdCBpdCByZWN1cnNpdmVseSBhc3NpZ25zXG4gICAgICogZGVmYXVsdCBwcm9wZXJ0aWVzLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIFRoaXMgbWV0aG9kIG11dGF0ZXMgYG9iamVjdGAuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgMy4xMC4wXG4gICAgICogQGNhdGVnb3J5IE9iamVjdFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIGRlc3RpbmF0aW9uIG9iamVjdC5cbiAgICAgKiBAcGFyYW0gey4uLk9iamVjdH0gW3NvdXJjZXNdIFRoZSBzb3VyY2Ugb2JqZWN0cy5cbi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vYmplY3Qua2V5cylcbiAgICAgKiBmb3IgbW9yZSBkZXRhaWxzLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBzaW5jZSAwLjEuMFxuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQGNhdGVnb3J5IE9iamVjdFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IG5hbWVzLlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiBmdW5jdGlvbiBGb28oKSB7XG4gICAgICogICB0aGlzLmEgPSAxO1xuICAgICAqICAgdGhpcy5iID0gMjtcbiAgICAgKiB9XG4gICAgICpcbiAgICAgKiBGb28ucHJvdG90eXBlLmMgPSAzO1xuICAgICAqXG4gICAgICogXy5rZXlzKG5ldyBGb28pO1xuICAgICAqIC8vID0+IFsnYScsICdiJ10gKGl0ZXJhdGlvbiBvcmRlciBpcyBub3QgZ3VhcmFudGVlZClcbiAgICAgKlxuICAgICAqIF8ua2V5cygnaGknKTtcbiAgICAgKiAvLyA9PiBbJzAnLCAnMSddXG4gICAgICovXG4gICAgZnVuY3Rpb24ga2V5cyhvYmplY3QpIHtcbiAgICAgIHJldHVybiBpc0FycmF5TGlrZShvYmplY3QpID8gYXJyYXlMaWtlS2V5cyhvYmplY3QpIDogYmFzZUtleXMob2JqZWN0KTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDcmVhdGVzIGFuIGFycmF5IG9mIHRoZSBvd24gYW5kIGluaGVyaXRlZCBlbnVtZXJhYmxlIHByb3BlcnR5IG5hbWVzIG9mIGBvYmplY3RgLlxuICAgICAqXG4gICAgICogKipOb3RlOioqIE5vbi1vYmplY3QgdmFsdWVzIGFyZSBjb2VyY2VkIHRvIG9iamVjdHMuXG4gICAgICpcbiAgICAgKiBAc3RhdGljX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ucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBuZXcgb2JqZWN0LlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgb2JqZWN0ID0geyAnYSc6IDEsICdiJzogJzInLCAnYyc6IDMgfTtcbiAgICAgKlxuICAgICAqIF8ub21pdEJ5KG9iamVjdCwgXy5pc051bWJlcik7XG4gICAgICogLy8gPT4geyAnYic6ICcyJyB9XG4gICAgICovXG4gICAgZnVuY3Rpb24gb21pdEJ5KG9iamVjdCwgcHJlZGljYXRlKSB7XG4gICAgICByZXR1cm4gcGlja0J5KG9iamVjdCwgbmVnYXRlKGdldEl0ZXJhdGVlKHByZWRpY2F0ZSkpKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDcmVhdGVzIGFuIG9iamVjdCBjb21wb3NlZCBvZiB0aGUgcGlja2VkIGBvYmplY3RgIHByb3BlcnRpZXMuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQHNpbmNlIDAuMS4wXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAY2F0ZWdvcnkgT2JqZWN0XG4gICAgICogQHBhcmFtIHtPYmplY3R9IG9iamVjdCBUaGUgc291cmNlIG9iamVjdC5cbiAgICAgKiBAcGFyYW0gey4uLihzdHJpbmd8c3RyaW5nW10pfSBbcGF0aHNdIFRoZSBwcm9wZXJ0eSBwYXRocyB0byBwaWNrLlxuICAgICAqIEByZXR1cm5zIHtPYmplY3R9IFJldHVybnMgdGhlIG5ldyBvYmplY3QuXG4gICAgICogQGV4YW1wbGVcbiAgICAgKlxuICAgICAqIHZhciBvYmplY3QgPSB7ICdhJzogMSwgJ2InOiAnMicsICdjJzogMyB9O1xuICAgICAqXG4gICAgICogXy5waWNrKG9iamVjdCwgWydhJywgJ2MnXSk7XG4gICAgICogLy8gPT4geyAnYSc6IDEsICdjJzogMyB9XG4gICAgICovXG4gICAgdmFyIHBpY2sgPSBmbGF0UmVzdChmdW5jdGlvbihvY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5jdGlvbih1cGRhdGVyKSwgY3VzdG9taXplcik7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhbiBhcnJheSBvZiB0aGUgb3duIGVudW1lcmFibGUgc3RyaW5nIGtleWVkIHByb3BlcnR5IHZhbHVlcyBvZiBgb2JqZWN0YC5cbiAgICAgKlxuICAgICAqICoqTm90ZToqKiBOb24tb2JqZWN0IHZhbHVlcyBhcmUgY29lcmNlZCB0byBvYmplY3RzLlxuICAgICAqXG4gICAgICogQHN0YXRpY1xuICAgICAqIEBzaW5jZSAwLjEuMFxuICAgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQGNhdGVnb3J5IE9iamVjdFxuICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvYmplY3QgVGhlIG9iamVjdCB0byBxdWVyeS5cbiAgICAgKiBAcmV0dXJucyB7QXJyYXl9IFJldHVybnMgdGhlIGFycmF5IG9mIHByb3BlcnR5IHZhbHVlcy5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogZnVuY3Rpb24gRm9vKCkge1xuICAgICAqICAgdGhpcy5hID0gMTtcbiAgICAgKiAgIHRoaXMuYiA9IDI7XG4gICAgICogfVxuICAgICAqXG4gICAgICogRm9vLnByb3RvdHlwZS5jID0gMztcbiAgICAgKlxuICAgICAqIF8udmFsdWVzKG5ldyBGb28pO1xuICAgICAqIC8vID0+IFsxLCAyXSAoaXRlcmF0aW9uIG9yZGVyIGlzIG5vdCBndWFyYW50ZWVkKVxuICAgICAqXG4gICAgICogXy52YWx1ZXMoJ2hpJyk7XG4gICAgICogLy8gPT4gWydoJywgJ2knXVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIHZhbHVlcyhvYmplY3QpIHtcbiAgICAgIHJldHVybiBvYmplY3QgPT0gbnVsbCA/IFtdIDogYmFzZVZhbHVlcyhvYmplY3QsIGtleXMob2JqZWN0KSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogQ3JlYXRlcyBhb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1xuICAgICAgICB2YXIgZnVuYyA9IHNvdXJjZVttZXRob2ROYW1lXTtcbiAgICAgICAgb2JqZWN0W21ldGhvZE5hbWVdID0gZnVuYztcbiAgICAgICAgaWYgKGlzRnVuYykge1xuICAgICAgICAgIG9iamVjdC5wcm90b3R5cGVbbWV0aG9kTmFtZV0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIHZhciBjaGFpbkFsbCA9IHRoaXMuX19jaGFpbl9fO1xuICAgICAgICAgICAgaWYgKGNoYWluIHx8IGNoYWluQWxsKSB7XG4gICAgICAgICAgICAgIHZhciByZXN1bHQgPSBvYmplY3QodGhpcy5fX3dyYXBwZWRfXyksXG4gICAgICAgICAgICAgICAgICBhY3Rpb25zID0gcmVzdWx0Ll9fYWN0aW9uc19fID0gY29weUFycmF5KHRoaXMuX19hY3Rpb25zX18pO1xuXG4gICAgICAgICAgICAgIGFjdGlvbnMucHVzaCh7ICdmdW5jJzogZnVuYywgJ2FyZ3MnOiBhcmd1bWVudHMsICd0aGlzQXJnJzogb2JqZWN0IH0pO1xuICAgICAgICAgICAgICByZXN1bHQuX19jaGFpbl9fID0gY2hhaW5BbGw7XG4gICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZnVuYy5hcHBseShvYmplY3QsIGFycmF5UHVzaChbdGhpcy52YWx1ZSgpXSwgYXJndW1lbnRzKSk7XG4gICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogUmV2ZXJ0cyB0aGUgYF9gIHZhcmlhYmxlIHRvIGl0cyBwcmV2aW91cyB2YWx1ZSBhbmQgcmV0dXJucyBhIHJlZmVyZW5jZSB0b1xuICAgICAqIHRoZSBgbG9kYXNoYCBmdW5jdGlvbi5cbiAgICAgKlxuICAgICAqIEBzdGF0aWNcbiAgICAgKiBAc2lu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AgICAqIEBtZW1iZXJPZiBfXG4gICAgICogQHNpbmNlIDQuMTMuMFxuICAgICAqIEBjYXRlZ29yeSBVdGlsXG4gICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYGZhbHNlYC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy50aW1lcygyLCBfLnN0dWJGYWxzZSk7XG4gICAgICogLy8gPT4gW2ZhbHNlLCBmYWxzZV1cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBzdHViRmFsc2UoKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgcmV0dXJucyBhIG5ldyBlbXB0eSBvYmplY3QuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgNC4xMy4wXG4gICAgICogQGNhdGVnb3J5IFV0aWxcbiAgICAgKiBAcmV0dXJucyB7T2JqZWN0fSBSZXR1cm5zIHRoZSBuZXcgZW1wdHkgb2JqZWN0LlxuICAgICAqIEBleGFtcGxlXG4gICAgICpcbiAgICAgKiB2YXIgb2JqZWN0cyA9IF8udGltZXMoMiwgXy5zdHViT2JqZWN0KTtcbiAgICAgKlxuICAgICAqIGNvbnNvbGUubG9nKG9iamVjdHMpO1xuICAgICAqIC8vID0+IFt7fSwge31dXG4gICAgICpcbiAgICAgKiBjb25zb2xlLmxvZyhvYmplY3RzWzBdID09PSBvYmplY3RzWzFdKTtcbiAgICAgKiAvLyA9PiBmYWxzZVxuICAgICAqL1xuICAgIGZ1bmN0aW9uIHN0dWJPYmplY3QoKSB7XG4gICAgICByZXR1cm4ge307XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogVGhpcyBtZXRob2QgcmV0dXJucyBhbiBlbXB0eSBzdHJpbmcuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2lu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cmV0dXJucyB7bnVtYmVyfSBSZXR1cm5zIHRoZSBxdW90aWVudC5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy5kaXZpZGUoNiwgNCk7XG4gICAgICogLy8gPT4gMS41XG4gICAgICovXG4gICAgdmFyIGRpdmlkZSA9IGNyZWF0ZU1hdGhPcGVyYXRpb24oZnVuY3Rpb24oZGl2aWRlbmQsIGRpdmlzb3IpIHtcbiAgICAgIHJldHVybiBkaXZpZGVuZCAvIGRpdmlzb3I7XG4gICAgfSwgMSk7XG5cbiAgICAvKipcbiAgICAgKiBDb21wdXRlcyBgbnVtYmVyYCByb3VuZGVkIGRvd24gdG8gYHByZWNpc2lvbmAuXG4gICAgICpcbiAgICAgKiBAc3RhdGljXG4gICAgICogQG1lbWJlck9mIF9cbiAgICAgKiBAc2luY2UgMy4xMC4wXG4gICAgICogQGNhdGVnb3J5IE1hdGhcbiAgICAgKiBAcGFyYW0ge251bWJlcn0gbnVtYmVyIFRoZSBudW1iZXIgdG8gcm91bmQgZG93bi5cbiAgICAgKiBAcGFyYW0ge251bWJlcn0gW3ByZWNpc2lvbj0wXSBUaGUgcHJlY2lzaW9uIHRvIHJvdW5kIGRvd24gdG8uXG4gICAgICogQHJldHVybnMge251bWJlcn0gUmV0dXJucyB0aGUgcm91bmRlZCBkb3duIG51bWJlci5cbiAgICAgKiBAZXhhbXBsZVxuICAgICAqXG4gICAgICogXy5mbG9vcig0LjAwNik7XG4gICAgICogLy8gPT4gNFxuICAgICAqXG4gICAgICogXy5mbG9vcigwLjA0NiwgMik7XG4gICAgICogLy8gPT4gMC4wNFxuICAgICAqXG4gICAgICogXy5mbG9vcig0MDYwLCAtMik7XG4gICAgICogLy8gPT4gNDAwMFxuICAgICAqL1xuICAgIHZhciBmbG9vciA9IGNyZWF0ZVJvdW5kKCdmbG9vcicpO1xuXG4gICAgLyoqXG4gICAgICogQ29tcHV0ZXMgdGhlIG1heGltdW0gdmFsdWUgb2YgYGFycmF5YC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91dGUuY3VycmVudC5wYXJhbXMgPSB7eyRyb3V0ZS5jdXJyZW50LnBhcmFtc319PC9wcmU+XG4gICAgICogICAgICAgPHByZT4kcm91dGUuY3VycmVudC5zY29wZS5uYW1lID0ge3skcm91dGUuY3VycmVudC5zY29wZS5uYW1lfX08L3ByZT5cbiAgICAgKiAgICAgICA8cHJlPiRyb3V0ZVBhcmFtcyA9IHt7JHJvdXRlUGFyYW1zfX08L3ByZT5cbiAgICAgKiAgICAgPC9kaXY+XG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJib29rLmh0bWxcIj5cbiAgICAgKiAgICAgY29udHJvbGxlcjoge3tuYW1lfX08YnIgLz5cbiAgICAgKiAgICAgQm9vayBJZDoge3twYXJhbXMuYm9va0lkfX08YnIgLz5cbiAgICAgKiAgIDwvZmlsZT5cbiAgICAgKlxuICAgICAqICAgPGZpbGUgbmFtZT1cImNoYXB0ZXIuaHRtbFwiPlxuICAgICAqICAgICBjb250cm9sbGVyOiB7e25hbWV9fTxiciAvPlxuICAgICAqICAgICBCb29rIElkOiB7e3BhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAqICAgICBDaGFwdGVyIElkOiB7e3BhcmFtcy5jaGFwdGVySWR9fVxuICAgICAqICAgPC9maWxlPlxuICAgICAqXG4gICAgICogICA8ZmlsZSBuYW1lPVwic2NyaXB0LmpzXCI+XG4gICAgICogICAgIGFuZ3VsYXIubW9kdWxlKCduZ1JvdXRlRXhhbXBsZScsIFsnbmdSb3V0ZSddKVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignTWFpbkNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZSwgJHJvdXRlUGFyYW1zLCAkbG9jYXRpb24pIHtcbiAgICAgKiAgICAgICAgICAkc2NvcGUuJHJvdXRlID0gJHJvdXRlO1xuICAgICAqICAgICAgICAgICRzY29wZS4kbG9jYXRpb24gPSAkbG9jYXRpb247XG4gICAgICogICAgICAgICAgJHNjb3BlLiRyb3V0ZVBhcmFtcyA9ICRyb3V0ZVBhcmFtcztcbiAgICAgKiAgICAgIH0pXG4gICAgICpcbiAgICAgKiAgICAgIC5jb250cm9sbGVyKCdCb29rQ29udHJvbGxlcicsIGZ1bmN0aW9uKCRzY29wZSwgJHJvdXRlUGFyYW1zKSB7XG4gICAgICogICAgICAgICAgJHNjb3BlLm5hbWUgPSAnQm9va0NvbnRyb2xsZXInO1xuICAgICAqICAgICAgICAgICRzY29wZS5wYXJhbXMgPSAkcm91dGVQYXJhbXM7XG4gICAgICogICAgICB9KVxuICAgICAqXG4gICAgICogICAgICAuY29udHJvbGxlcignQ2hhcHRlckNvbnRyb2xsZXInLCBmdW5jdGlvbigkc2NvcGUsICRyb3V0ZVBhcmFtcykge1xuICAgICAqICAgICAgICAgICRzY29wZS5uYW1lID0gJ0NoYXB0ZXJDb250cm9sbGVyJztcbiAgICAgKiAgICAgICAgICAkc2NvcGUucGFyYW1zID0gJHJvdXRlUGFyYW1zO1xuICAgICAqICAgICAgfSlcbiAgICAgKlxuICAgICAqICAgICAuY29uZmlnKGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAqICAgICAgICRyb3V0ZVByb3ZpZGVyXG4gICAgICogICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAqICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAqICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDb250cm9sbGVyJyxcbiAgICAgKiAgICAgICAgIHJlc29sdmU6IHtcbiAgICAgKiAgICAgICAgICAgLy8gSSB3aWxsIGNhdXNlIGEgMSBzZWNvbmQgZGVsYXlcbiAgICAgKiAgICAgICAgICAgZGVsYXk6IGZ1bmN0aW9uKCRxLCAkdGltZW91dCkge1xuICAgICAqICAgICAgICAgICAgIHZhciBkZWxheSA9ICRxLmRlZmVyKCk7XG4gICAgICogICAgICAgICAgICAgJHRpbWVvdXQoZGVsYXkucmVzb2x2ZSwgMTAwMCk7XG4gICAgICogICAgICAgICAgICAgcmV0dXJuIGRlbGF5LnByb21pc2U7XG4gICAgICogICAgICAgICAgIH1cbiAgICAgKiAgICAgICAgIH1cbiAgICAgKiAgICAgICB9KVxuICAgICAqICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkL2NoLzpjaGFwdGVySWQnLCB7XG4gICAgICogICAgICAgICB0ZW1wbGF0ZVVybDogJ2NoYXB0ZXIuaHRtbCcsXG4gICAgICogICAgICAgICBjb250cm9sbGVyOiAnQ2hhcHRlckNvbnRyb2xsZXInXG4gICAgICogICAgICAgfSk7XG4gICAgICpcbiAgICAgKiAgICAgICAvLyBjb25maWd1cmUgaHRtbDUgdG8gZ2V0IGxpbmtzIHdvcmtpbmcgb24ganNmaWRkbGVcbiAgICAgKiAgICAgICAkbG9jYXRpb25Qcm92aWRlci5odG1sNU1vZGUodHJ1ZSk7XG4gICAgICogICAgIH0pO1xuICAgICAqXG4gICAgICogICA8L2ZpbGU+XG4gICAgICpcbiAgICAgKiAgIDxmaWxlIG5hbWU9XCJwcm90cmFjdG9yLmpzXCIgdHlwZT1cInByb3RyYWN0b3JcIj5cbiAgICAgKiAgICAgaXQoJ3Nob3VsZCBsb2FkIGFuZCBjb21waWxlIGNvcnJlY3QgdGVtcGxhdGUnLCBmdW5jdGlvbigpIHtcbiAgICAgKiAgICAgICBlbGVtZW50KGJ5LmxpbmtUZXh0KCdNb2J5OiBDaDEnKSkuY2xpY2soKTtcbiAgICAgKiAgICAgICB2YXIgY29udGVudCA9IGVsZW1lbnQoYnkuY3NzKCdbbmctdmlld10nKSkuZ2V0VGV4dCgpO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b01hdGNoKC9jb250cm9sbGVyOiBDaGFwdGVyQ29udHJvbGxlci8pO1xuICAgICAqICAgICAgIGV4cGVjdChjb250ZW50KS50b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hdGVPbmx5LFxuICAgICAgICAkcm91dGUgPSB7XG4gICAgICAgICAgcm91dGVzOiByb3V0ZXMsXG5cbiAgICAgICAgICAvKipcbiAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kXG4gICAgICAgICAgICogQG5hbWUgJHJvdXRlI3JlbG9hZFxuICAgICAgICAgICAqXG4gICAgICAgICAgICogQGRlc2NyaXB0aW9uXG4gICAgICAgICAgICogQ2F1c2VzIGAkcm91dGVgIHNlcnZpY2UgdG8gcmVsb2FkIHRoZSBjdXJyZW50IHJvdXRlIGV2ZW4gaWZcbiAgICAgICAgICAgKiB7QGxpbmsgbmcuJGxvY2F0aW9uICRsb2NhdGlvbn0gaGFzbid0IGNoYW5nZWQuXG4gICAgICAgICAgICpcbiAgICAgICAgICAgKiBBcyBhIHJlc3VsdCBvZiB0aGF0LCB7QGxpbmsgbmdSb3V0ZS5kaXJlY3RpdmU6bmdWaWV3IG5nVmlld31cbiAgICAgICAgICAgKiBjcmVhdGVzIG5ldyBzY29wZSBhbmQgcmVpbnN0YW50aWF0ZXMgdGhlIGNvbnRyb2xsZXIuXG4gICAgICAgICAgICovXG4gICAgICAgICAgcmVsb2FkOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgIGZvcmNlUmVsb2FkID0gdHJ1ZTtcblxuICAgICAgICAgICAgdmFyIGZha2VMb2NhdGlvbkV2ZW50ID0ge1xuICAgICAgICAgICAgICBkZWZhdWx0UHJldmVudGVkOiBmYWxzZSxcbiAgICAgICAgICAgICAgcHJldmVudERlZmF1bHQ6IGZ1bmN0aW9uIGZha2VQcmV2ZW50RGVmYXVsdCgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGZvcmNlUmVsb2FkID0gZmFsc2U7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICRyb290U2NvcGUuJGV2YWxBc3luYyhmd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m91dGUnKTtcblxuICAgICAgICBuZXh0Um91dGVQcm9taXNlLlxuICAgICAgICAgIHRoZW4oZ2V0UmVkaXJlY3Rpb25EYXRhKS5cbiAgICAgICAgICB0aGVuKGhhbmRsZVBvc3NpYmxlUmVkaXJlY3Rpb24pLlxuICAgICAgICAgIHRoZW4oZnVuY3Rpb24oa2VlcFByb2Nlc3NpbmdSb3V0ZSkge1xuICAgICAgICAgICAgcmV0dXJuIGtlZXBQcm9jZXNzaW5nUm91dGUgJiYgbmV4dFJvdXRlUHJvbWlzZS5cbiAgICAgICAgICAgICAgdGhlbihyZXNvbHZlTG9jYWxzKS5cbiAgICAgICAgICAgICAgdGhlbihmdW5jdGlvbihsb2NhbHMpIHtcbiAgICAgICAgICAgICAgICAvLyBhZnRlciByb3V0ZSBjaGFuZ2VcbiAgICAgICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAgICAgaWYgKG5leHRSb3V0ZSkge1xuICAgICAgICAgICAgICAgICAgICBuZXh0Um91dGUubG9jYWxzID0gbG9jYWxzO1xuICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmNvcHkobmV4dFJvdXRlLnBhcmFtcywgJHJvdXRlUGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICRyb290U2NvcGUuJGJyb2FkY2FzdCgnJHJvdXRlQ2hhbmdlU3VjY2VzcycsIG5leHRSb3V0ZSwgbGFzdFJvdXRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pLmNhdGNoKGZ1bmN0aW9uKGVycm9yKSB7XG4gICAgICAgICAgICBpZiAobmV4dFJvdXRlID09PSAkcm91dGUuY3VycmVudCkge1xuICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRicm9hZGNhc3QoJyRyb3V0ZUNoYW5nZUVycm9yJywgbmV4dFJvdXRlLCBsYXN0Um91dGU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1xuICAgICAgICAgICAgZGF0YS5zZWFyY2ggPSByb3V0ZS5wYXJhbXM7XG4gICAgICAgICAgICBkYXRhLmhhc1JlZGlyZWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFyIG9sZFBhdGggPSAkbG9jYXRpb24ucGF0aCgpO1xuICAgICAgICAgICAgdmFyIG9sZFNlYXJjaCA9ICRsb2NhdGlvbi5zZWFyY2goKTtcbiAgICAgICAgICAgIHZhciBuZXdVcmwgPSByb3V0ZS5yZWRpcmVjdFRvKHJvdXRlLnBhdGhQYXJhbXMsIG9sZFBhdGgsIG9sZFNlYXJjaCk7XG5cbiAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChuZXdVcmwpKSB7XG4gICAgICAgICAgICAgIGRhdGEudXJsID0gbmV3VXJsO1xuICAgICAgICAgICAgICBkYXRhLmhhc1JlZGlyZWN0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAocm91dGUucmVzb2x2ZVJlZGlyZWN0VG8pIHtcbiAgICAgICAgICByZXR1cm4gJHEuXG4gICAgICAgICAgICByZXNvbHZlKCRpbmplY3Rvci5pbnZva2Uocm91dGUucmVzb2x2ZVJlZGlyZWN0VG8pKS5cbiAgICAgICAgICAgIHRoZW4oZnVuY3Rpb24obmV3VXJsKSB7XG4gICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChuZXdVcmwpKSB7XG4gICAgICAgICAgICAgICAgZGF0YS51cmwgPSBuZXdVcmw7XG4gICAgICAgICAgICAgICAgZGF0YS5oYXNSZWRpcmVjdGlvbiA9IHRydWU7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICByZXR1cm4gZGF0YTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiBkYXRhO1xuICAgIH1cblxuIC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ICAgQm9vayBJZDoge3tjaGFwdGVyLnBhcmFtcy5ib29rSWR9fTxiciAvPlxuICAgICAgICAgIENoYXB0ZXIgSWQ6IHt7Y2hhcHRlci5wYXJhbXMuY2hhcHRlcklkfX1cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJhbmltYXRpb25zLmNzc1wiPlxuICAgICAgICAudmlldy1hbmltYXRlLWNvbnRhaW5lciB7XG4gICAgICAgICAgcG9zaXRpb246cmVsYXRpdmU7XG4gICAgICAgICAgaGVpZ2h0OjEwMHB4IWltcG9ydGFudDtcbiAgICAgICAgICBiYWNrZ3JvdW5kOndoaXRlO1xuICAgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7XG4gICAgICAgICAgaGVpZ2h0OjQwcHg7XG4gICAgICAgICAgb3ZlcmZsb3c6aGlkZGVuO1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZSB7XG4gICAgICAgICAgcGFkZGluZzoxMHB4O1xuICAgICAgICB9XG5cbiAgICAgICAgLnZpZXctYW5pbWF0ZS5uZy1lbnRlciwgLnZpZXctYW5pbWF0ZS5uZy1sZWF2ZSB7XG4gICAgICAgICAgdHJhbnNpdGlvbjphbGwgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKSAxLjVzO1xuXG4gICAgICAgICAgZGlzcGxheTpibG9jaztcbiAgICAgICAgICB3aWR0aDoxMDAlO1xuICAgICAgICAgIGJvcmRlci1sZWZ0OjFweCBzb2xpZCBibGFjaztcblxuICAgICAgICAgIHBvc2l0aW9uOmFic29sdXRlO1xuICAgICAgICAgIHRvcDowO1xuICAgICAgICAgIGxlZnQ6MDtcbiAgICAgICAgICByaWdodDowO1xuICAgICAgICAgIGJvdHRvbTowO1xuICAgICAgICAgIHBhZGRpbmc6MTBweDtcbiAgICAgICAgfVxuXG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctZW50ZXIge1xuICAgICAgICAgIGxlZnQ6MTAwJTtcbiAgICAgICAgfVxuICAgICAgICAudmlldy1hbmltYXRlLm5nLWVudGVyLm5nLWVudGVyLWFjdGl2ZSB7XG4gICAgICAgICAgbGVmdDowO1xuICAgICAgICB9XG4gICAgICAgIC52aWV3LWFuaW1hdGUubmctbGVhdmUubmctbGVhdmUtYWN0aXZlIHtcbiAgICAgICAgICBsZWZ0Oi0xMDAlO1xuICAgICAgICB9XG4gICAgICA8L2ZpbGU+XG5cbiAgICAgIDxmaWxlIG5hbWU9XCJzY3JpcHQuanNcIj5cbiAgICAgICAgYW5ndWxhci5tb2R1bGUoJ25nVmlld0V4YW1wbGUnLCBbJ25nUm91dGUnLCAnbmdBbmltYXRlJ10pXG4gICAgICAgICAgLmNvbmZpZyhbJyRyb3V0ZVByb3ZpZGVyJywgJyRsb2NhdGlvblByb3ZpZGVyJyxcbiAgICAgICAgICAgIGZ1bmN0aW9uKCRyb3V0ZVByb3ZpZGVyLCAkbG9jYXRpb25Qcm92aWRlcikge1xuICAgICAgICAgICAgICAkcm91dGVQcm92aWRlclxuICAgICAgICAgICAgICAgIC53aGVuKCcvQm9vay86Ym9va0lkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdib29rLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0Jvb2tDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2Jvb2snXG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAud2hlbignL0Jvb2svOmJvb2tJZC9jaC86Y2hhcHRlcklkJywge1xuICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdjaGFwdGVyLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0NoYXB0ZXJDdHJsJyxcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXJBczogJ2NoYXB0ZXInXG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gY3VycmVudC5sb2NhbHM7XG5cbiAgICAgICRlbGVtZW50Lmh0bWwobG9jYWxzLiR0ZW1wbGF0ZSk7XG5cbiAgICAgIHZhciBsaW5rID0gJGNvbXBpbGUoJGVsZW1lbnQuY29udGVudHMoKSk7XG5cbiAgICAgIGlmIChjdXJyZW50LmNvbnRyb2xsZXIpIHtcbiAgICAgICAgbG9jYWxzLiRzY29wZSA9IHNjb3BlO1xuICAgICAgICB2YXIgY29udHJvbGxlciA9ICRjb250cm9sbGVyKGN1cnJlbnQuY29udHJvbGxlciwgbG9jYWxzKTtcbiAgICAgICAgaWYgKGN1cnJlbnQuY29udHJvbGxlckFzKSB7XG4gICAgICAgICAgc2NvcGVbY3VycmVudC5jb250cm9sbGVyQXNdID0gY29udHJvbGxlcjtcbiAgICAgICAgfVxuICAgICAgICAkZWxlbWVudC5kYXRhKCckbmdDb250cm9sbGVyQ29udHJvbGxlcicsIGNvbnRyb2xsZXIpO1xuICAgICAgICAkZWxlbWVudC5jaGlsZHJlbigpLmRhdGEoJyRuZ0NvbnRyb2xsZXJDb250cm9sbGVyJywgY29udHJvbGxlcik7XG4gICAgICB9XG4gICAgICBzY29wZVtjdXJyZW50LnJlc29sdmVBcyB8fCAnJHJlc29sdmUnXSA9IGxvY2FscztcblxuICAgICAgbGluayhzY29wZSk7XG4gICAgfVxuICB9O1xufVxuXG5cbn0pKHdpbmRvdywgd2luZG93LmFuZ3VsYXIpO1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG52YXIgY29tbW9uQ29uZmlnID0gZnVuY3Rpb24gKCkge1xuICAgIHRoaXMuY29uZmlnID0ge1xuICAgICAgICBjb250cm9sbGVyQWN0aXZhdGVTdWNjZXNzRXZlbnQ6ICdDb250cm9sbGVyQWN0aXZhdGVTdWNjZXNzJyxcbiAgICAgICAgZGVtb01vZGVsTG9jYXRpb246IHtcbiAgICAgICAgICAgIG9yZ2FuaXNhdGlvbjogJ21pa2UtZ29vZHdpbicsXG4gICAgICAgICAgICBy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W5jdGlvbiB6b29tSW4oKSB7XG4gICAgICAgIGlmICh2bS5jdXJyZW50Wm9vbUxldmVsIDwgdm0ubWF4Wm9vbSkge1xuICAgICAgICAgICAgdm0uY3VycmVudFpvb21MZXZlbCsrO1xuICAgICAgICAgICAgdm0uY3VycmVudERpYWdyYW0uem9vbSh2bS5jdXJyZW50Wm9vbUxldmVsKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGZ1bmN0aW9uIHpvb21PdXQoKSB7XG4gICAgICAgIGlmICh2bS5jdXJyZW50Wm9vbUxldmVsID4gLXZtLm1heFpvb20pIHtcbiAgICAgICAgICAgIHZtLmN1cnJlbnRab29tTGV2ZWwtLTtcbiAgICAgICAgICAgIHZtLmN1cnJlbnREaWFncmFtLnpvb20odm0uY3VycmVudFpvb21MZXZlbCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZXRHcmlkKCkge1xuICAgICAgICBpZiAodm0uc2hvd0dyaWQpIHtcbiAgICAgICAgICAgIHZtLmN1cnJlbnREaWFncmFtLnNldEdyaWRTaXplKGdyaWRTaXplT24pO1xuICAgICAgICAgICAgdm0uY3VycmVudERpYWdyYW0uZHJhd0dyaWQoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZtLmN1cnJlbnREaWFncmFtLmNsZWFyR3JpZCgpO1xuICAgICAgICAgICAgdm0uY3VycmVudERpYWdyYW0uc2V0R3JpZFNpemUoZ3JpZFNpemVPZmYpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gb25FcnJvcihlcnJvcikge1xuICAgICAgICB2bS5lcnJvcmVkID0gdHJ1ZTtcbiAgICAgICAgbG9nRXJyb3IoZXJyb3IpO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGVkaXQoKSB7XG4gICAgICAgIHZtLnNldERpcnR5KCk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ2V0VGhyZWF0TW9kZWxQYXRoKCkge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S5ncmFwaC5nZXRDZWxscygpIH0gfTtcbiAgICAgICAgICAgIHZtLmdyYXBoLmluaXRpYWxpc2UoZGlhZ3JhbURhdGEuZGlhZ3JhbUpzb24pO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gb25HZW5lcmF0ZVRocmVhdHModGhyZWF0cykge1xuICAgICAgICB2YXIgdGhyZWF0VG90YWwgPSB0aHJlYXRzLmxlbmd0aDtcbiAgICAgICAgdmFyIHRocmVhdExpc3QgPSB0aHJlYXRzO1xuICAgICAgICB2YXIgY3VycmVudFRocmVhdDtcbiAgICAgICAgdmFyIHRlbXBsYXRlO1xuICAgICAgICBzdWdnZXN0VGhyZWF0KCk7XG5cbiAgICAgICAgZnVuY3Rpb24gc3VnZ2VzdFRocmVhdCgpIHtcbiAgICAgICAgICAgIGlmICh0aHJlYXRMaXN0Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICBjdXJyZW50VGhyZWF0ID0gdGhyZWF0TGlzdC5zaGlmdCgpO1xuICAgICAgICAgICAgICAgIHNlbGVjdFRlbXBsYXRlKGN1cnJlbnRUaHJlYXQubW9kZWxUeXBlKTtcbiAgICAgICAgICAgICAgICBkaWFsb2dzLmNvbmZpcm0odGVtcGxhdGUsXG4gICAgICAgICAgICAgICAgICAgIGFkZFRocmVhdCxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkaW5nOiAnQWRkIHRoaXMgdGhyZWF0PycsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWF0OiBjdXJyZW50VGhyZWF0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVkaXRpbmc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocmVhdEluZGV4OiB0aHJlYXRUb3RhbCAtIHRocmVhdExpc3QubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocmVhdFRvdGFsOiB0aHJlYXRUb3RhbFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgaWdub3JlVGhyZWF0LFxuICAgICAgICAgICAgICAgICAgICAnZmFkZS1yaWdodCdcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gYWRkVGhyZWF0KGFwcGx5VG9BbGwpIHtcbiAgICAgICAgICAgIHZtLnNldERpcnR5KCk7XG5cbiAgICAgICAgICAgIGlmIChfLmlzVW5kZWZpbmVkKHZtLnNlbGVjdGVkLnRocmVhdHMpKSB7XG4gICAgICAgICAgICAgICAgdm0uc2VsZWN0ZWQudGhyZWF0cyA9IFtdO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB2bS5zZWxlY3RlZC50aHJlYXRzLnB1c2goY3VycmVudFRocmVhdCk7XG5cbiAgICAgICAgICAgIGlmIChhcHBseVRvQWxsKSB7XG4gICAgICAgICAgICAgICAgdGhyZWF0TGlzdC5mb3JFYWNoKGZ1bmN0aW9uICh0aHJlYXQpIHtcblxuICAgICAgICAgICAgICAgICAgICB2bS5zZWxlY3RlZC50aHJlYXRzLnB1c2godGhyZWF0KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICR0aW1lb3V0KHN1Z2dlc3RUaHJlYXQsIDUwMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBpZ25vcmVUaHJlYXQoYXBwbHlUb0FsbCkge1xuICAgICAgICAgICAgaWYgKCFhcHBseVRvQWxsKSB7XG4gICAgICAgICAgICAgICAgJHRpbWVvdXQoc3VnZ2VzdFRocmVhdCwgNTAwKTtcbiAg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gKG5ld0NlbGwpIHsgbmV3Q2VsbC50cmFuc2xhdGUoJChlbGVtZW50KS5wYXJlbnQoKS5zY3JvbGxMZWZ0KCksICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsVG9wKCkpOyB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdjZWxsOnBvaW50ZXJjbGljaycsIGZ1bmN0aW9uIChjZWxsVmlldykge1xuICAgICAgICAgICAgaWYgKCFjZWxsVmlldy5tb2RlbC5pc0xpbmsoKSkge1xuXG4gICAgICAgICAgICAgICAgaWYgKGNlbGxWaWV3Ll9hY3Rpb24gPT09ICdsaW5rRnJvbScpIHtcblxuICAgICAgICAgICAgICAgICAgICBhZGRMaW5rRnJvbShjZWxsVmlldyk7XG5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY2VsbFZpZXcuX2FjdGlvbiA9PT0gJ3JlbW92ZUxpbmtGcm9tJykge1xuXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZUxpbmtGcm9tKGNlbGxWaWV3KTtcblxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcblxuICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0ZWQgJiYgIXNlbGVjdGVkLm1vZGVsLmlzTGluaygpICYmIHNlbGVjdGVkLmxpbmtGcm9tKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld0Zsb3coeyBzb3VyY2U6IHNlbGVjdGVkLm1vZGVsLCB0YXJnZXQ6IGNlbGxWaWV3Lm1vZGVsIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oc2VsZWN0ZWQpO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgc2V0U2VsZWN0ZWQoY2VsbFZpZXcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZGlhZ3JhbS5vbignYmxhbms6cG9pbnRlcmNsaWNrJywgZnVuY3Rpb24gKCkge1xuXG4gICAgICAgICAgICBpZiAoc2VsZWN0ZWQgJiYgIXNlbGVjdGVkLm1vZGVsLmlzTGluaygpKSB7XG4gICAgICAgICAgICAgICAgcmVtb3ZlTGlua0Zyb20oc2VsZWN0ZWQpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZXRTZWxlY3RlZChudWxsKTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgZGlhZ3JhbS5vbignbGluazpvcHRpb25zJywgZnVuY3Rpb24gKGNlbGxWaWV3LCBldnQpIHtcblxuICAgICAgICAgICAgaWYgKHNlbGVjdGVkICYmICFzZWxlY3RlZC5tb2RlbC5pc0xpbmsoKSkge1xuICAgICAgICAgICAgICAgIHJlbW92ZUxpbmtGcm9tKHNlbGVjdGVkKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgc2V0U2VsZWN0ZWQoY2VsbFZpZXcpO1xuICAgICAgICB9KTtcblxuICAgICAgICBkaWFncmFtLm9uKCdjZWxsOnBvaW50ZXJtb3ZlJywgZnVuY3Rpb24gKGNlbGxWaWV3LCBldnQsIHgsIHkpIHtcblxuICAgICAgICAgICAgdmFyIGNvbnN0cmFpbmVkID0gZmFsc2U7XG4gICAgICAgICAgICB2YXIgY29uc3RyYWluZWRYID0geDtcbiAgICAgICAgICAgIHZhciBjb25zdHJhaW5lZFkgPSB5O1xuICAgICAgICAgICAgdmFyIGNlbGxXaWR0aCA9IGNlbGxWaWV3Lm1vZGVsLmF0dHJpYnV0ZXMuc2l6ZS53aWR0aDtcbiAgICAgICAgICAgIHZhciBjZWxsSGVpZ2h0ID0gY2VsbFZpZXcubW9kZWwuYXR0cmlidXRlcy5zaXplLmhlaWdodDtcbiAgICAgICAgICAgIHZhciBjZWxsWCA9IHg7XG4gICAgICAgICAgICB2YXIgY2VsbFkgPSB5O1xuICAgICAgICAgICAgdmFyIGJib3ggPSBjZWxsVmlldy5nZXRCQm94KCk7XG5cbiAgICAgICAgICAgIGlmIChjZWxsVmlldy5tb2RlbC5hdHRyaWJ1dGVzLnR5cGUgIT0gJ3RtLkZsb3cnICYmIGNlbGxWaWV3Lm1vZGVsLmF0dHJpYnV0ZXMudHlwZSAhPSAndG0uQm91bmRhcnknKSB7XG4gICAgICAgICAgICAgICAgLy9ib3VuZGFyeSBib3ggZ2l2ZXMgYmV0dGVyIHNjcm9sbGluZyBmb3IgZWxlbWVudHMgb3RoZXIgdGhhbiBmbG93ICYgYm91bmRhcnlcbiAgICAgICAgICAgICAgICBjZWxsWCA9IGJib3gueDtcbiAgICAgICAgICAgICAgICBjZWxsWSA9IGJib3gueTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9jb25zdHJhaW4gbW92ZW1lbnQgdG8geCA+PSAwXG4gICAgICAgICAgICBpZiAoY2VsbFggPD0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnN0cmFpbmVkWCA9IHggKyBzY29wZS5ncmlkU2l6ZTtcbiAgICAgICAgICAgICAgICBjb25zdHJhaW5lZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgY2VsbFggPSAwO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvL2V4cGFuZCB0aGUgZGlhZ3JhbSByaWdodFxuICAgICAgICAgICAgaWYgKGNlbGxYICsgY2VsbFdpZHRoID49IGRpYWdyYW0ub3B0aW9ucy53aWR0aCkge1xuICAgICAgICAgICAgICAgIGRpYWdyYW0uc2V0RGltZW5zaW9ucyhjZWxsWCArIGNlbGxXaWR0aCwgZGlhZ3JhbS5vcHRpb25zLmhlaWdodCk7XG4gICAgICAgICAgICAgICAgJChlbGVtZW50KS5wYXJlbnQoKS5zY3JvbGxMZWZ0KGRpYWdyYW0ub3B0aW9ucy53aWR0aCAtIHNjb3BlLndpZHRoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9zY3JvbGwgdGhlIGRpYWdyYW0gbGVmdFxuICAgICAgICAgICAgaWYgKGNlbGxYIDw9ICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsTGVmdCgpKSB7XG4gICAgICAgICAgICAgICAgJChlbGVtZW50KS5wYXJlbnQoKS5zY3JvbGxMZWZ0KGNlbGxYKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9zY3JvbGwgdGhlIGRpYWdyYW0gcmlnaHRcbiAgICAgICAgICAgIGlmIChjZWxsWCArIGNlbGxXaWR0aCAtICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsTGVmdCgpID49ICQoZWxlbWVudCkucGFyZW50KCkud2lkdGgoKSAmJiBjZWxsWCArIGNlbGxXaWR0aCA8IGRpYWdyYW0ub3B0aW9ucy53aWR0aCkge1xuICAgICAgICAgICAgICAgICQoZWxlbWVudCkucGFyZW50KCkuc2Nyb2xsTGVmdChjZWxsWCArIGNlbGxXaWR0aCAtICQoZWxlbWVudCkucGFyZW50KCkud2lkdGgoKSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vY29uc3RyYWluIG1vdmVtZW50IHRvIHkgPj0gMFxuICAgICAgICAgICAgaWYgKGNlbGxZIDw9IDApIHtcbiAgICAgICAgICAgICAgICBjb25zdHJhaW5lZFkgPSB5ICsgc2NvcGUuZ3JpZFNpemU7XG4gICAgICAgICAgICAgICAgY29uc3RyYWluZWQgPSB0cnVlO1xuICAgICAgICAgICAgICAgIGNlbGxZID0gMDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy9leHBhbmQgdGhlIGRpYWdyYW0gZG93blxuICAgICAgICAgICAgaWYgKGNlbGxZICsgY2VsbEhlaWdodCA+PSBkaWFncmFtLm9wdGlvbnMuaGVpZ2h0KSB7XG4gICAgICAgICAgICAgICAgZGlhZ3JhbS5zZXREaW1lbnNpb25zKGRpYWdyYW0ub3B0aW9ucy53aWR0aCwgY2VsbFkgKyBjZWxsSGVpZ2h0KTtcbiAgIC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Ck7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmIChjZWxsKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNlbGxWaWV3ID0gZGlhZ3JhbS5maW5kVmlld0J5TW9kZWwoY2VsbCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoY2VsbFZpZXcpIHtcbiAgICAgICAgICAgICAgICAgICAgY2VsbFZpZXcuc2V0U2VsZWN0ZWQoKTtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBjZWxsVmlldztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgc2NvcGUuaW5pdGlhbGlzZUdyYXBoKHsgZGlhZ3JhbTogZGlhZ3JhbSB9KTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBhZGRMaW5rRnJvbShjZWxsVmlldykge1xuICAgICAgICBjZWxsVmlldy5hZGRMaW5rRnJvbSgpO1xuICAgICAgICBsb2coJ1NlbGVjdCBhbm90aGVyIG1vZGVsIGVsZW1lbnQgdG8gYWRkIGEgZGF0YSBmbG93Jyk7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gcmVtb3ZlTGlua0Zyb20oY2VsbFZpZXcpIHtcbiAgICAgICAgY2VsbFZpZXcucmVtb3ZlTGlua0Zyb20oKTtcbiAgICB9XG5cbiAgICBmdW5jdGlvbiBzZXRTZWxlY3RlZChjZWxsVmlldykge1xuICAgICAgICB2YXIgZWxlbWVudCA9IG51bGw7XG5cbiAgICAgICAgaWYgKGNlbGxWaWV3KSB7XG4gICAgICAgICAgICBlbGVtZW50ID0gY2VsbFZpZXcubW9kZWw7XG4gICAgICAgIH1cblxuICAgICAgICBzZWxlY3RPblNjb3BlKHsgZWxlbWVudDogZWxlbWVudCB9KTtcbiAgICB9XG5cbn07XG5cb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biAgICAgICAge1xuICAgICAgICAgICAgbGluazogbGluayxcbiAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnZGlhZ3JhbXMvRWxlbWVudFByb3BlcnRpZXNQYW5lLmh0bWwnLFxuICAgICAgICAgICAgcmVzdHJpY3Q6ICdFJyxcbiAgICAgICAgICAgIHNjb3BlOlxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiAnPScsXG4gICAgICAgICAgICAgICAgZWxlbWVudFR5cGU6ICdAJyxcbiAgICAgICAgICAgICAgICBlZGl0OiAnJidcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIHJldHVybiBkaXJlY3RpdmU7XG5cbiAgICBmdW5jdGlvbiBsaW5rKHNjb3BlLCBlbGVtZW50LCBhdHRycykge1xuICAgIH1cblxufVxuXG5mdW5jdGlvbiBlbGVtZW50VGhyZWF0cygkcm91dGVQYXJhbXMsICRsb2NhdGlvbiwgY29tbW9uLCBkaWFsb2dzKSB7XG5cbiAgICB2YXIgZGlyZWN0aXZlID1cbiAgICAgICAge1xuICAgICAgICAgICAgbGluazogbGluayxcbiAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnZGlhZ3JhbXMvVGhyZWF0U3VtbWFyeVBhbmUuaHRtbCcsXG4gICAgICAgICAgICByZXN0cmljdDogJ0UnLFxuICAgICAgICAgICAgc2NvcGU6XG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgc3VnZ2VzdDogJz0nLFxuICAgICAgICAgICAgICAgIHRocmVhdHM6ICc9JyxcbiAgICAgICAgICAgICAgICB0eXBlOiAnPScsXG4gICAgICAgICAgICAgICAgc2F2ZTogJyYnLFxuICAgICAgICAgICAgICAgIHNldGRpcnR5OiAnPScsXG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICB2YXIgbmV3VGhyZWF0O1xuICAgIHZhciBlZGl0SW5kZXggPSBudWxsO1xuICAgIHZhciBvcmlnaW5hbFRocmVhdCA9I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gICAgICAgIHNjb3BlLnNhdmUoKTtcbiAgICAgICAgICAgIHNjb3BlLnNldGRpcnR5KCk7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICBzY29wZS5jYW5jZWxFZGl0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgc2NvcGUudGhyZWF0c1tlZGl0SW5kZXhdID0gb3JpZ2luYWxUaHJlYXQ7XG4gICAgICAgICAgICByZXNldChzY29wZS50eXBlKTtcbiAgICAgICAgfTtcblxuICAgICAgICB2YXIgdGhyZWF0SWQgPSAkcm91dGVQYXJhbXMudGhyZWF0O1xuXG4gICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZCh0aHJlYXRJZCkpIHtcbiAgICAgICAgICAgIHZhciBtYXRjaGluZ0luZGV4ID0gLTE7XG5cbiAgICAgICAgICAgIHNjb3BlLnRocmVhdHMuZm9yRWFjaChmdW5jdGlvbiAodGhyZWF0LCBpbmRleCkge1xuICAgICAgICAgICAgICAgIGlmICh0aHJlYXQuaWQgPT0gdGhyZWF0SWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hpbmdJbmRleCA9IGluZGV4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAobWF0Y2hpbmdJbmRleCA+PSAwKSB7XG4gICAgICAgICAgICAgICAgc2NvcGUub25FZGl0VGhyZWF0KG1hdGNoaW5nSW5kZXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgbG9nRXJyb3IoJ0ludmFsaWQgdGhyZWF0IElEJyk7XG4gICAgICAgICAgICAgICAgJGxvY2F0aW9uLnNlYXJjaCgndGhyZWF0JywgbnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmdW5jdGlvbiByZXNldChtb2RlbFR5cGUpIHtcbiAgICAgICA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iBjYW5jZWxOYXZpZ2F0aW9uOyB9LFxuICAgICAgICAgICAgICAgIG9rOiBmdW5jdGlvbiAoKSB7IHJldHVybiBjb250aW51ZU5hdmlnYXRpb247IH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG5cbiAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICByZXR1cm4gbW9kYWwucmVzdWx0O1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGNvbmZpcm0odGVtcGxhdGUsIG9uT2tQcmVDbG9zZSwgZ2V0UGFyYW1ldGVyLCBvbkNhbmNlbFByZUNsb3NlLCB3aW5kb3dDbGFzcykge1xuXG4gICAgICAgIHZhciBvcHRpb25zID0ge1xuICAgICAgICAgICAgdGVtcGxhdGVVcmw6IHRlbXBsYXRlLFxuICAgICAgICAgICAgY29udHJvbGxlcjogJ2NvbmZpcm1Db250cm9sbGVyJyxcbiAgICAgICAgICAgIGtleWJvYXJkOiBmYWxzZSxcbiAgICAgICAgICAgIGJhY2tkcm9wOiAnc3RhdGljJyxcbiAgICAgICAgICAgIHJlc29sdmU6IHtcbiAgICAgICAgICAgICAgICBvazogZnVuY3Rpb24gKCkgeyByZXR1cm4gb25Pa1ByZUNsb3NlOyB9LFxuICAgICAgICAgICAgICAgIGNhbmNlbDogZnVuY3Rpb24gKCkgeyByZXR1cm4gb25DYW5jZWxQcmVDbG9zZTsgfSxcbiAgICAgICAgICAgICAgICBwYXJhbWV0ZXI6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIGdldFBhcmFtZXRlcjsgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmICh3aW5kb3dDbGFzcykge1xuXG4gICAgICAgICAgICBvcHRpb25zLndpbmRvd0NsYXNzID0gd2luZG93Q2xhc3M7XG5cbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBtb2RhbCA9ICRtb2RhbC5vcGVuKG9wdGlvbnMpO1xuXG4gICAgICAgIHJldHV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J2lzSW5TY29wZScpKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnByb3AoJ291dE9mU2NvcGUnLCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH0sXG5cbiAgICBkZWZpbmVIYXNPcGVuVGhyZWF0czogZnVuY3Rpb24gKHByb3RvLCBzZWxlY3RvckNsYXNzZXMpIHtcblxuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkocHJvdG8sICdoYXNPcGVuVGhyZWF0cycsIHtcbiAgICAgICAgICAgIGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpcy5wcm9wKCdoYXNPcGVuVGhyZWF0cycpOyB9LFxuICAgICAgICAgICAgc2V0OiBmdW5jdGlvbiAodmFsdWUpIHtcblxuICAgICAgICAgICAgICAgIHZhciBlbGVtZW50ID0gdGhpcztcblxuICAgICAgICAgICAgICAgIHNlbGVjdG9yQ2xhc3Nlcy5mb3JFYWNoKGZ1bmN0aW9uIChzZWxlY3RvckNsYXNzKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdG9yID0gJy4nICsgc2VsZWN0b3JDbGFzcyArICcvY2xhc3MnO1xuICAgICAgICAgICAgICAgICAgICB2YXIgb3JpZ2luYWxDbGFzcyA9IGVsZW1lbnQuYXR0cihzZWxlY3RvcikgfHwgc2VsZWN0b3JDbGFzcyArICcgaGFzTm9PcGVuVGhyZWF0cyBpc0luU2NvcGUnO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKHNlbGVjdG9yLCBvcmlnaW5hbENsYXNzLnJlcGxhY2UoJ2hhc05vT3BlblRocmVhdHMnLCAnaGFzT3BlblRocmVhdHMnKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgIC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ICAgICAgICB2YXIgbm9kZXMgPSBWKHRvb2xNYXJrdXApO1xuICAgICAgICAgICAgVih0aGlzLmVsKS5hcHBlbmQobm9kZXMpO1xuXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdGhpcztcbiAgICB9LFxuXG4gICAgcG9pbnRlcmNsaWNrOiBmdW5jdGlvbiAoZXZ0LCB4LCB5KSB7XG5cbiAgICAgICAgdGhpcy5fZHggPSB4O1xuICAgICAgICB0aGlzLl9keSA9IHk7XG4gICAgICAgIHRoaXMuX2FjdGlvbiA9ICcnO1xuXG4gICAgICAgIHZhciBjbGFzc05hbWUgPSBldnQudGFyZ2V0LnBhcmVudE5vZGUuZ2V0QXR0cmlidXRlKCdjbGFzcycpO1xuXG4gICAgICAgIHN3aXRjaCAoY2xhc3NOYW1lKSB7XG5cbiAgICAgICAgICAgIGNhc2UgJ2VsZW1lbnQtdG9vbC1yZW1vdmUnOlxuICAgICAgICAgICAgICAgIHRoaXMubW9kZWwucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuXG4gICAgICAgICAgICBjYXNlICdlbGVtZW50LXRvb2wtbGluayc6XG4gICAgICAgICAgICAgICAgdGhpcy5fYWN0aW9uID0gJ2xpbmtGcm9tJztcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgY2FzZSAnZWxlbWVudC10b29sLWxpbmsgbGlua2luZyc6XG4gICAgICAgICAgICAgICAgdGhpcy5fYWN0aW9uID0gJ3JlbW92ZUxpbmtGcm9tJztcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgfVxuXG4gICAgICAgIGpvaW50LmRpYS5DZWxsVmlldy5wcm90b3R5cGUucG9pbnRlcmNsaWNrLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG4gICAgfSxcblxuICAgIHNldFNlbGVjdGVkOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHRoaXMuaGlna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B8ICAgfCBYIHwgICB8IFggfCBYIHxcbiAgICAqL1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkFjdG9yJ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJ2IyYTZkNDBkLWQzZjgtNDc1MC04ZTRkLWMwMmNjODRiMTNkYycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJ2IyYTZkNDBkLWQzZjgtNDc1MC04ZTRkLWMwMmNjODRiMTNkYycsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIHNwb29maW5nIHRocmVhdCcsXG4gICAgICAgICAgdHlwZTogJ1Nwb29maW5nJyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdTVFJJREUnLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyBzcG9vZmluZyB0aHJlYXQnXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcblxuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdTVFJJREUnXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnNGFkYWE0OGEtMDM0NS00NTMzLWExODktNjRjOThjNDQyMGRkJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnNGFkYWE0OGEtMDM0NS00NTMzLWExODktNjRjOThjNDQyMGRkJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGFtcGVyaW5nIHRocmVhdCcsXG4gICAgICAgICAgdHlwZTogJ1RhbXBlcmluZycsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgdGFtcGVyaW5nIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uQWN0b3InXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnODdiYzM3ZTItNzk4ZS00ZDY4LWJiOTYtZmViMWRhMjZkYTQ4JyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnODdiYzM3ZTItNzk4ZS00ZDY4LWJiOTYtZmViMWRhMjZkYTQ4JyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgcmVwdWRpYXRpb24gdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnUmVwdWRpYXRpb24nLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ1NUUklERScsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHJlcHVkaWF0aW9uIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICcxMzAwMDI5Ni1iMTdkLTRiNzItOWNjNC1mNWNjMzNmODBlNGMnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICcxMzAwMDI5Ni1iMTdkLTRiNzItOWNjNC1mNWNjMzNmODBlNGMnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyBpbmZvcm1hdGlvbiBkaXNjbG9zdXJlIHRocmVhdCcsXG4gICAgICAgICAgdHlwZTogJ0luZm9ybWF0aW9uIGRpc2Nsb3N1cmUnLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ1NUUklERScsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIGluZm9ybWF0aW9uIGRpc2Nsb3N1cmUgdGhyZWF0J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG5cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJ2VkYjA1ZDc2LWE2OTUtNDU1Zi05NDdiLTdkNjdiNzhiYzMxZCcsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJ2VkYjA1ZDc2LWE2OTUtNDU1Zi05NDdiLTdkNjdiNzhiYzMxZCcsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIERvUyB0aHJlYXQnLFxuICAgICAgICAgIHR5cGU6ICdEZW5pYWwgb2Ygc2VydmljZScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgRG9TIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ1NUUklERSdcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICdjMTM3Nzg1NS1lYTIwLTRjOTctODg2MS1mOTVjMzY0ZmI4ZDInLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICdjMTM3Nzg1NS1lYTIwLTRjOTctODg2MS1mOTVjMzY0ZmI4ZDInLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyBlbGV2YXRpb24gdGhyZWF0JyxcbiAgICAgICAgICB0eXBlOiAnRWxldmF0aW9uIG9mIHByaXZpbGVnZScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnU1RSSURFJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgZWxldmF0aW9uIHRocmVhdCdcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuXG4gICAgLyogU1RSSURFIHVzaW5nIGNvbnRleHQgKi9cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnU1RSSURFJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgfSAsIHtcbiAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuaXNQdWJsaWNOZXR3b3JrJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6IHRydWVcbiAgICAgICAgICB9ICwge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5pc0VuY3J5cHRlZCcsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6IGZhbHNlXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5pc0VuY3J5cHRlZCcsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6IHVuZGVmaW5lZFxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJ2MxY2FlOTgyLTNlOTItNGJiMi1iNTBiLWVhNTExMzdmYzNhNycsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJ2MxY2FlOTgyLTNlOTItNGJiMi1iNTBiLWVhNTExMzdmYzNhNycsXG4gICAgICAgICAgdG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wgWCB8ICAgfCBYXG4gICAgKi9cbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnODk2YWJkZWYtMGU3ZS00NmVjLWFlYWEtYjhlNzBjMjMzZDU3JyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnODk2YWJkZWYtMGU3ZS00NmVjLWFlYWEtYjhlNzBjMjMzZDU3JyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIExpbmthYmlsaXR5JyxcbiAgICAgICAgICB0eXBlOiAnTGlua2FiaWxpdHknLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ0xJTkREVU4nLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyB0aHJlYXQgdG8gbGlua2FiaWxpdHknXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnOTEyOGM1ODctYmM3Ni00MWQwLWEwMmQtNWRlM2I1MzllY2MwJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnOTEyOGM1ODctYmM3Ni00MWQwLWEwMmQtNWRlM2I1MzllY2MwJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIElkZW50aWZpYWJpbGl0eScsXG4gICAgICAgICAgdHlwZTogJ0lkZW50aWZpYWJpbGl0eScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnTElORERVTicsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHRocmVhdCB0byBpZGVudGlmaWFiaWxpdHknXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc3NDgzNGYyNC04Zjg5LTQwYmItYjBjNi1kMWZkZDhiOGFjY2MnLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc3NDgzNGYyNC04Zjg5LTQwYmItYjBjNi1kMWZkZDhiOGFjY2MnLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyB0aHJlYXQgdG8gTm9uLXJlcHVkaWF0aW9uJyxcbiAgICAgICAgICB0eXBlOiAnTm9uLXJlcHVkaWF0aW9uJyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdMSU5ERFVOJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgdGhyZWF0IHRvIG5vbi1yZXB1ZGlhdGlvbidcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0pO1xuICAgIGVuZ2luZS5hZGRSdWxlKHtcbiAgICAgIGNvbmRpdGlvbnM6IHtcbiAgICAgICAgYWxsOiBbXG4gICAgICAgICAge1xuICAgICAgICAgICAgZmFjdDogJ2RpYWdyYW1UeXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICdMSU5ERFVOJ1xuICAgICAgICAgIH0sXG4gICAgICAgICAge1xuICAgICAgICAgICAgYW55OiBbXG4gICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uU3RvcmUnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uRmxvdydcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5Qcm9jZXNzJ1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICBdXG4gICAgICAgICAgfVxuICAgICAgICBdXG4gICAgICB9LFxuICAgICAgZXZlbnQ6IHtcbiAgICAgICAgdHlwZTogJ2RmNDNiMDkxLTlmZmItNDRlMy05ZWI5LTQ3MWI5ZWU1NmQzOScsXG4gICAgICAgIHBhcmFtczoge1xuICAgICAgICAgIHJ1bGVJZDogJ2RmNDNiMDkxLTlmZmItNDRlMy05ZWI5LTQ3MWI5ZWU1NmQzOScsXG4gICAgICAgICAgdGl0bGU6ICdHZW5lcmljIHRocmVhdCB0byBEZXRlY3RhYmlsaXR5JyxcbiAgICAgICAgICB0eXBlOiAnRGV0ZWN0YWJpbGl0eScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnTElORERVTicsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQSBnZW5lcmljIHRocmVhdCB0byBkZXRlY3RhYmlsaXR5J1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfSk7XG4gICAgZW5naW5lLmFkZFJ1bGUoe1xuICAgICAgY29uZGl0aW9uczoge1xuICAgICAgICBhbGw6IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBmYWN0OiAnZGlhZ3JhbVR5cGUnLFxuICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICB2YWx1ZTogJ0xJTkREVU4nXG4gICAgICAgICAgfSxcbiAgICAgICAgICB7XG4gICAgICAgICAgICBhbnk6IFtcbiAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5TdG9yZSdcbiAgICAgICAgICAgICAgfSwge1xuICAgICAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICAgICAgcGF0aDogJy5lbGVtZW50LmF0dHJpYnV0ZXMudHlwZScsXG4gICAgICAgICAgICAgICAgb3BlcmF0b3I6ICdlcXVhbCcsXG4gICAgICAgICAgICAgICAgdmFsdWU6ICd0bS5GbG93J1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlByb2Nlc3MnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIF1cbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnOWQ1NzY2MTAtNWM1My00Zjg0LTkwYzUtZWM3MDc1MWEzMzlkJyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnOWQ1NzY2MTAtNWM1My00Zjg0LTkwYzUtZWM3MDc1MWEzMzlkJyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIERpc2Nsb3N1cmUgb2YgaW5mb3JtYXRpb24nLFxuICAgICAgICAgIHR5cGU6ICdEaXNjbG9zdXJlIG9mIGluZm9ybWF0aW9uJyxcbiAgICAgICAgICBtb2RlbFR5cGU6ICdMSU5ERFVOJyxcbiAgICAgICAgICBzdGF0dXM6ICdPcGVuJyxcbiAgICAgICAgICBzZXZlcml0eTogJ01lZGl1bScsXG4gICAgICAgICAgZGVzY3JpcHRpb246ICdBIGdlbmVyaWMgdGhyZWF0IHRvIGRpc2Nsb3N1cmUgb2YgaW5mb3JtYXRpb24nXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdlbCcsXG4gICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgdmFsdWU6ICd0bS5BY3RvcidcbiAgICAgICAgICB9XG4gICAgICAgIF1cbiAgICAgIH0sXG4gICAgICBldmVudDoge1xuICAgICAgICB0eXBlOiAnOGQwOTkzYzAtOWQ5Mi00YzUxLTk5ZjUtNjc3MjI3MGE3ZDg4JyxcbiAgICAgICAgcGFyYW1zOiB7XG4gICAgICAgICAgcnVsZUlkOiAnOGQwOTkzYzAtOWQ5Mi00YzUxLTk5ZjUtNjc3MjI3MGE3ZDg4JyxcbiAgICAgICAgICB0aXRsZTogJ0dlbmVyaWMgdGhyZWF0IHRvIFVuYXdhcmVuZXNzJyxcbiAgICAgICAgICB0eXBlOiAnVW5hd2FyZW5lc3MnLFxuICAgICAgICAgIG1vZGVsVHlwZTogJ0xJTkREVU4nLFxuICAgICAgICAgIHN0YXR1czogJ09wZW4nLFxuICAgICAgICAgIHNldmVyaXR5OiAnTWVkaXVtJyxcbiAgICAgICAgICBkZXNjcmlwdGlvbjogJ0EgZ2VuZXJpYyB0aHJlYXQgdG8gdW5hd2FyZW5lc3MnXG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9KTtcbiAgICBlbmdpbmUuYWRkUnVsZSh7XG4gICAgICBjb25kaXRpb25zOiB7XG4gICAgICAgIGFsbDogW1xuICAgICAgICAgIHtcbiAgICAgICAgICAgIGZhY3Q6ICdkaWFncmFtVHlwZScsXG4gICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgIHZhbHVlOiAnTElORERVTidcbiAgICAgICAgICB9LFxuICAgICAgICAgIHtcbiAgICAgICAgICAgIGFueTogW1xuICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLlN0b3JlJ1xuICAgICAgICAgICAgICB9LCB7XG4gICAgICAgICAgICAgICAgZmFjdDogJ2VsJyxcbiAgICAgICAgICAgICAgICBwYXRoOiAnLmVsZW1lbnQuYXR0cmlidXRlcy50eXBlJyxcbiAgICAgICAgICAgICAgICBvcGVyYXRvcjogJ2VxdWFsJyxcbiAgICAgICAgICAgICAgICB2YWx1ZTogJ3RtLkZsb3cnXG4gICAgICAgICAgICAgIH0sIHtcbiAgICAgICAgICAgICAgICBmYWN0OiAnZWwnLFxuICAgICAgICAgICAgICAgIHBhdGg6ICcuZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGUnLFxuICAgICAgICAgICAgICAgIG9wZXJhdG9yOiAnZXF1YWwnLFxuICAgICAgICAgICAgICAgIHZhbHVlOiAndG0uUHJvY2VzcydcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXVxuICAgICAgICAgIH1cbiAgICAgICAgXVxuICAgICAgfSxcbiAgICAgIGV2ZW50OiB7XG4gICAgICAgIHR5cGU6ICc2ZTgwZDJmYy03NDdhLTRhZTgtYTQzNS1hY2NlMDY2MTcxMzknLFxuICAgICAgICBwYXJhbXM6IHtcbiAgICAgICAgICBydWxlSWQ6ICc2ZTgwZDJmYy03NDdhLTRhZTgtYTQzNS1hY2NlMDY2MTcxMzknLFxuICAgICAgICAgIHRpdGxlOiAnR2VuZXJpYyB0aHJlYXQgdG8gTm9uLWNvbXBsaWFuY2UnLFxuICAgICAgICAgIHR5cGU6ICdOb24tY29tcGxpYW5jZScsXG4gICAgICAgICAgbW9kZWxUeXBlOiAnTElORERVTicsXG4gICAgICAgICAgc3RhdHVzOiAnT3BlbicsXG4gICAgICAgICAgc2V2ZXJpdHk6ICdNZWRpdW0nLFxuICAgICAgICAgIGRlc2Ny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FwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC50aXRsZVwiIHBsYWNlaG9sZGVyPVwiQSBzaG9ydCB0aXRsZSBmb3IgdGhlIHRocmVhdFwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IG5nLXNob3c9XCIhdGhyZWF0RWRpdEZvcm0udGl0bGVJbnB1dC4kdmFsaWQgJiYgdGhyZWF0RWRpdEZvcm0udGl0bGVJbnB1dC4kZGlydHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLWV4Y2xhbWF0aW9uLXNpZ25cIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNyLW9ubHlcIj5FcnJvcjo8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgdGhyZWF0IHRpdGxlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGxhYmVsPkNJQSB0aHJlYXQgdHlwZTwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8c2VsZWN0IG5hbWU9XCJ0eXBlSW5wdXRcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLXJlcXVpcmVkPVwidHJ1ZVwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC50eXBlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBzZWxlY3RlZD5Db25maWRlbnRpYWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPkludGVncml0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+QXZhaWxhYmlsaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L3NlbGVjdD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJHZhbGlkICYmIHRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kZGlydHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLWV4Y2xhbWF0aW9uLXNpZ25cIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNyLW9ubHlcIj5FcnJvcjo8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgdGhyZWF0IHR5cGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwIHB1bGwtbGVmdFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGxhYmVsPlRocmVhdCBzdGF0dXM8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwXCIgbmFtZT1cInN0YXR1c0lucHV0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tcHJpbWFyeVwiIG5hbWU9XCJzdGF0dXNJbnB1dE9wZW5cIiBuZy1tb2RlbD1cInBhcmFtZXRlci50aHJlYXQuc3RhdHVzXCIgdWliLWJ0bi1yYWRpbz1cIlxcJ09wZW5cXCdcIj5PcGVuPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGxhYmVsIGNsYXNzPVwiYnRuIGJ0bi1wcmltYXJ5XCIgbmFtZT1cInN0YXR1c0lucHV0TWl0aWdhdGVkXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnN0YXR1c1wiIHVpYi1idG4tcmFkaW89XCJcXCdNaXRpZ2F0ZWRcXCdcIj5NaXRpZ2F0ZWQ8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBwdWxsLXJpZ2h0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+U2V2ZXJpdHk8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwXCIgcmVxdWlyZWQ+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdIaWdoXFwnXCI+SGlnaDwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxsYWJlbCBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zZXZlcml0eVwiIHVpYi1idG4tcmFkaW89XCJcXCdNZWRpdW1cXCdcIj5NZWRpdW08L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1tb2RlbD1cInBhcmFtZXRlci50aHJlYXQuc2V2ZXJpdHlcIiB1aWItYnRuLXJhZGlvPVwiXFwnTG93XFwnXCI+TG93PC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNsZWFyZml4XCI+PC9kaXY+XFxuJyArXG4gICAgJyAg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CdkaWFncmFtcy9kaWFncmFtZWRpdG9yLmh0bWwnLFxuICAgICfvu788ZGl2IGRhdGEtbmctY29udHJvbGxlcj1cImRpYWdyYW0gYXMgdm1cIiBjbGFzcz1cImNvbnRhaW5lci1mbHVpZCBkaWFncmFtLWNvbnRhaW5lclwiPlxcbicgK1xuICAgICcgICAgPGRpdiBuZy1zaG93PVwiIXZtLmVycm9yZWRcIj5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLWxnLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPCEtLURpYWdyYW0gc3RlbmNpbC0tPlxcbicgK1xuICAgICcgICAgICAgICAgICA8dWliLWFjY29yZGlvbiBjbG9zZS1vdGhlcnM9XCJ0cnVlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IHVpYi1hY2NvcmRpb24tZ3JvdXAgaXMtb3Blbj1cInZtLnZpZXdTdGVuY2lsXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHVpYi1hY2NvcmRpb24taGVhZGluZz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgRWRpdCBkaWFncmFtIDxpIGNsYXNzPVwicHVsbC1yaWdodCBnbHlwaGljb25cIiBuZy1jbGFzcz1cIntcXCdnbHlwaGljb24tY2hldnJvbi1kb3duXFwnOiB2bS52aWV3U3RlbmNpbCwgXFwnZ2x5cGhpY29uLWNoZXZyb24tcmlnaHRcXCc6ICF2bS52aWV3U3RlbmNpbH1cIj48L2k+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC91aWItYWNjb3JkaW9uLWhlYWRpbmc+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQ9XCJzdGVuY2lsIGluIHZtLnN0ZW5jaWxzXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgaGVpZ2h0PVwiMTIwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dG10LXN0ZW5jaWwgY2xhc3M9XCJzdGVuY2lsXCIgc2hhcGU9XCJzdGVuY2lsLnNoYXBlXCIgcGFkZGluZz1cIjVcIiBzY2FsZT1cIjAuOVwiIGFjdGlvbj1cInN0ZW5jaWwuYWN0aW9uKClcIiAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tVGhyZWF0IHBhbmUtLT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgdWliLWFjY29yZGlvbi1ncm91cCBpcy1vcGVuPVwidm0udmlld1RocmVhdHNcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8dWliLWFjY29yZGlvbi1oZWFkaW5nPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICBNYW5hZ2UgdGhyZWF0cyA8aSBjbGFzcz1cInB1bGwtcmlnaHQgZ2x5cGhpY29uXCIgbmctY2xhc3M9XCJ7XFwnZ2x5cGhpY29uLWNoZXZyb24tZG93blxcJzogdm0udmlld1RocmVhdHMsIFxcJ2dseXBoaWNvbi1jaGV2cm9uLXJpZ2h0XFwnOiAhdm0udmlld1RocmVhdHN9XCI+PC9pPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvdWliLWFjY29yZGlvbi1oZWFkaW5nPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCIhdm0uc2VsZWN0ZWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlNlbGVjdCBhbiBlbGVtZW50IGluIHRoZSBkaWFncmFtIHRvIHNlZSBvciBlZGl0IGl0cyB0aHJlYXRzPC9lbT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidm0uc2VsZWN0ZWQgJiYgdm0uc2VsZWN0ZWQuYXR0cmlidXRlcy50eXBlICE9IFxcJ3RtLkJvdW5kYXJ5XFwnXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCIhdm0uc2VsZWN0ZWQub3V0T2ZTY29wZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRtdC1lbGVtZW50LXRocmVhdHMgc3VnZ2VzdD1cInZtLmdlbmVyYXRlVGhyZWF0c1wiIHRocmVhdHM9XCJ2bS5zZWxlY3RlZC50aHJlYXRzXCIgdHlwZT1cInZtLmRpYWdyYW0uZGlhZ3JhbVR5cGVcIiBzYXZlPVwidm0uZWRpdFwiIHNldGRpcnR5PVwidm0uc2V0RGlydHlcIiAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cInZtLnNlbGVjdGVkLm91dE9mU2NvcGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxlbT5UaGUgc2VsZWN0ZWQgZWxlbWVudCBpcyBvdXQgb2Ygc2NvcGU8L2VtPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4gICAgICAgICAgICAgICAgICAgICAgIFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJ2bS5zZWxlY3RlZCAmJiB2bS5zZWxlY3RlZC5hdHRyaWJ1dGVzLnR5cGUgPT0gXFwndG0uQm91bmRhcnlcXCdcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGVtPlRocmVhdHMgYXJlIG5vdCBhc3NvY2lhdGVkIHdpdGggdHJ1c3QgYm91bmRhcmllczwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC91aWItYWNjb3JkaW9uPlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwhLS1EaWFncmFtIGFyZWEtLT5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLWxnLThcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCIhdm0uZGlhZ3JhbS50aXRsZVwiIGNsYXNzPVwicGFuZWwtaGVhZGluZyBwYW5lbC10aXRsZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxzcGFuPkxvYWRpbmcuLi48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJ2bS5kaWFncmFtLnRpdGxlXCIgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHNwYW4gZWRpdGFibGUtdGV4dD1cInZtLmRpYWdyYW0udGl0bGVcIiBuZy1jbGljaz1cImRpYWdyYW1UaXRsZUlucHV0LiRzaG93KClcIiBvbmFmdGVyc2F2ZT1cInZtLnNhdmUoKVwiIGUtZm9ybT1cImRpYWdyYW1UaXRsZUlucHV0XCIgZS1yZXF1a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iAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1ib2R5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGZvcm0gbmFtZT1cImRpYWdyYW1FZGl0VG9vbEJhclwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYnRuLWdyb3VwIHB1bGwtbGVmdFwiIHJvbGU9XCJncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gdHlwZT1cImJ1dHRvblwiIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctbW9kZWw9XCJ2bS5zaG93R3JpZFwiIHVpYi1idG4tY2hlY2tib3ggbmctY2xpY2s9XCJ2bS5zZXRHcmlkKClcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiVG9nZ2xlIEdyaWRsaW5lc1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXRoXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgbmctaHJlZj1cIiMvdGhyZWF0bW9kZWwve3t2bS5nZXRUaHJlYXRNb2RlbFBhdGgoKX19XCIgcm9sZT1cImJ1dHRvblwiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJDbG9zZSBEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9hPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiB0eXBlPVwiYnV0dG9uXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5jbGVhcigpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkRlbGV0ZSBBbGwgRWxlbWVudHMgRnJvbSBUaGlzIERpYWdyYW1cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXRyYXNoXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiB0eXBlPVwiYnV0dG9uXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5yZWxvYWQoKVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJEaXNjYXJkIENoYW5nZXMgQW5kIFJlb3BlbiBEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsY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cIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiRHVwbGljYXRlIHRoZSBzZWxlY3RlZCBlbGVtZW50XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1kdXBsaWNhdGVcIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIHR5cGU9XCJidXR0b25cIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLnNhdmUoKVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJTYXZlIFRoaXMgRGlhZ3JhbVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tc2F2ZVwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Zvcm0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRtdC1kaWFncmFtLWNvbnRhaW5lclwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8dG10LWRpYWdyYW0gZ3JhcGg9XCJ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XG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiIXZtLnNlbGVjdGVkXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxlbT5TZWxlY3QgYW4gZWxlbWVudCBpbiB0aGUgZGlhZ3JhbSB0byBzZWUgb3IgZWRpdCBpdHMgcHJvcGVydGllczwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwhLS1FcnJvciBjb250ZW50LS0+XFxuJyArXG4gICAgJyAgICA8ZGl2IG5nLXNob3c9XCJ2bS5lcnJvcmVkXCI+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cImp1bWJvdHJvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8aDE+b29vb3BzITwvaDE+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgSXQgbG9va3MgbGlrZSB5b3UgdHJpZWQgdG8gZWRpdCBhIHRocmVhdCBtb2RlbCBkaWFncmFtIHRoYXQgZG9lc25cXCd0IGV4aXN0LiBNYXliZSB5b3UgdHlwZWQgdGhlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICBhZGRyZXNzIHdyb25nPyBPciBpZiB5b3UgY2xpY2tlZCBhIGxpbmsgdG8gZ2V0IGhlcmUsIHRoZSBkaWFncmFtIG1pZ2h0IGhhdmUgYmVlblxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgZGVsZXRlZCBzaW5jZSB5b3UgbWFkZSB0aGUgbGluayA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JlcXVpcmVkPVwidHJ1ZVwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnRpdGxlXCIgcGxhY2Vob2xkZXI9XCJBIHNob3J0IHRpdGxlIGZvciB0aGUgdGhyZWF0XCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cIiF0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50aXRsZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+TElORERVTiB0aHJlYXQgdHlwZTwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8c2VsZWN0IG5hbWU9XCJ0eXBlSW5wdXRcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLXJlcXVpcmVkPVwidHJ1ZVwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC50eXBlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBzZWxlY3RlZD5MaW5rYWJpbGl0eTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+SWRlbnRpZmlhYmlsaXR5PC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5Ob24tcmVwdWRpYXRpb248L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPkRldGVjdGFiaWxpdHk8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPkRpc2Nsb3N1cmUgb2YgaW5mb3JtYXRpb248L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPlVuYXdhcmVuZXNzPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5Ob24tY29tcGxpYW5jZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9zZWxlY3Q+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IG5nLXNob3c9XCIhdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiR2YWxpZCAmJiB0aHJlYXRFZGl0Rm9ybS50eXBlSW5wdXQuJGRpcnR5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC1kYW5nZXJcIiByb2xlPVwiYWxlcnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1leGNsYW1hdGlvbi1zaWduXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzci1vbmx5XCI+RXJyb3I6PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHRocmVhdCB0eXBlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cCBwdWxsLWxlZnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxsYWJlbD5UaHJlYXQgc3RhdHVzPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cFwiIG5hbWU9XCJzdGF0dXNJbnB1dFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuYW1lPVwic3RhdHVzSW5wdXRPcGVuXCIgbmctbW9kZWw9XCJwYXJhbWV0ZXIudGhyZWF0LnN0YXR1c1wiIHVpYi1idG4tcmFkaW89XCJcXCdPcGVuXFwn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AgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLWV4Y2xhbWF0aW9uLXNpZ25cIiBhcmlhLWhpZGRlbj1cInRydWVcIj48L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNyLW9ubHlcIj5FcnJvcjo8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgdGhyZWF0IHRpdGxlIGNhbm5vdCBiZSBlbXB0eS5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZm9ybS1ncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGxhYmVsPlNUUklERSB0aHJlYXQgdHlwZTwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8c2VsZWN0IG5hbWU9XCJ0eXBlSW5wdXRcIiBjbGFzcz1cImZvcm0tY29udHJvbFwiIG5nLXJlcXVpcmVkPVwidHJ1ZVwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC50eXBlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBzZWxlY3RlZD5TcG9vZmluZzwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+VGFtcGVyaW5nPC9vcHRpb24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPG9wdGlvbj5SZXB1ZGlhdGlvbjwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+SW5mb3JtYXRpb24gZGlzY2xvc3VyZTwvb3B0aW9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxvcHRpb24+RGVuaWFsIG9mIHNlcnZpY2U8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8b3B0aW9uPkVsZXZhdGlvbiBvZiBwcml2aWxlZ2U8L29wdGlvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvc2VsZWN0PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwiIXRocmVhdEVkaXRGb3JtLnR5cGVJbnB1dC4kdmFsaWQgJiYgdGhyZWF0RWRpdEZvcm0udHlwZUlucHV0LiRkaXJ0eVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiYWxlcnQgYWxlcnQtZGFuZ2VyXCIgcm9sZT1cImFsZXJ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZXhjbGFtYXRpb24tc2lnblwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoZSB0aHJlYXQgdHlwZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgcHVsbC1sZWZ0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8bGFiZWw+VGhyZWF0IHN0YXR1czwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXBcIiBuYW1lPVwic3RhdHVzSW5wdXRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGxhYmVsIGNsYXNzPVwiYnRuIGJ0bi1wcmltYXJ5XCIgbmFtZT1cInN0YXR1c0lucHV0T3BlblwiIG5nLW1vZGVsPVwicGFyYW1ldGVyLnRocmVhdC5zdGF0dXNcIiB1aWItYnRuLXJhZGlvPVwiXFwnT3BlblxcJ1wiPk9wZW48L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8bGFiZWwgY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuYW1lPVwic3RhdHVzSW5wdXRNaXRpZ2F0ZWRcIiBuZy1tb2RlbD1cInBhcmFtZXRlci50aHJlYXQuc3RhdHVzXCIgdWliLWJ0bi1yYWRpbz1cIlxcJ01pdGlnYXRlZFxcJ1wiPk1pdGlnYXRlZDwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3Vw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VsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8YSBuZy1ocmVmPVwiIy90aHJlYXRtb2RlbC9lZGl0L3t7dm0udGhyZWF0TW9kZWxQYXRoKCl9fVwiPjxoND57e3ZtLnRocmVhdE1vZGVsLnN1bW1hcnkudGl0bGV9fTwvaDQ+PC9hPlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5Pd25lcjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdj57e3ZtLnRocmVhdE1vZGVsLnN1bW1hcnkub3duZXJ9fTwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTJcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+UmV2aWV3ZXI6IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXY+e3t2bS50aHJlYXRNb2RlbC5kZXRhaWwucmV2aWV3ZXJ9fTwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLThcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+Q29udHJpYnV0b3JzOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1yZXBlYXQ9XCJjb250cmlidXRvciBpbiB2bS50aHJlYXRNb2RlbC5kZXRhaWwuY29udHJpYnV0b3JzXCI+IHt7Y29udHJpYnV0b3IubmFtZX19PHNwYW4gbmctc2hvdz1cIiAhICRsYXN0IFwiPjs8L3NwYW4+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbCBwYW5lbC1kZWZhdWx0XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8aDQ+SGlnaCBsZXZlbCBzeXN0ZW0gZGVzY3JpcHRpb248L2g0PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMTJcIj48cCBjbGFzcz1cInJlcG9ydFwiPnt7dm0udGhyZWF0TW9kZWwuc3VtbWFyeS5kZXNjcmlwdGlvbn19PC9wPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtYm9keVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdC1zdGFydD1cImRpYWdyYW0gaW4gdm0udGhyZWF0TW9kZWwuZGV0YWlsLmRpYWdyYW1zXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTNcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtaGVhZGluZyBwYW5lbC10aXRsZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGEgbmctaHJlZj1cIiMvdGhyZWF0bW9kZWwve3t2bS50aHJlYXRNb2RlbFBhdGgoKX19L2RpYWdyYW0ve3tkaWFncmFtLmlkfX1cIj48aDY+e3tkaWFncmFtLnRpdGxlfX08L2g2PjwvYT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1ib2R5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YSBuZy1ocmVmPVwiIy90aHJlYXRtb2RlbC97e3ZtLnRocmVhdE1vZGVsUGF0aCgpfX0vZGlhZ3JhbS97e2RpYWdyYW0uaWR9fVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbWcgbmctc3JjPVwie3tkaWFncmFtLnRodW1ibmFpbH19XCIgY2xhc3M9XCJpbWctdGh1bWJuYWlsIGNlbnRlci1ibG9ja1wiIGFsdD1cIlRodW1ibmFpbCBvZiB7e2RpYWdyYW0udGl0bGV9fVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiKCgkaW5kZXgrMSkgJSA0KSA9PSAwXCIgY2xhc3M9XCJjbGVhcmZpeCB2aXNpYmxlLWxnLWJsb2NrXCI+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgbmctcmVwZWF0LWVuZCBuZy1oaWRlPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJyb3dcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0xMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImJ0bi1ncm91cCBwdWxsLXJpZ2h0XCIgcm9sZT1cImdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGEgY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuZy1ocmVmPVwiIy90aHJlYXRtb2RlbC9lZGl0L3t7dm0udGhyZWF0TW9kZWxQYXRoKCl9fVwiIFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIHJvbGU9XCJidXR0b25cIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiRWRpdCBUaGlzIFRocmVhdCBNb2RlbFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZWRpdFwiPjwvc3Bhbj4gRWRpdFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvYT5cXG4nICtcb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sZVwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cInZtLnRocmVhdE1vZGVsLnN1bW1hcnkudGl0bGVcIiBuZy1yZXF1aXJlZD1cInRydWVcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIlRocmVhdCBtb2RlbCB0aXRsZVwiIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1zaG93PVwidm0udGhyZWF0TW9kZWxFZGl0Rm9ybS50aHJlYXRNb2RlbFRpdGxlLiRkaXJ0eSAmJiAhdm0udGhyZWF0TW9kZWxFZGl0Rm9ybS50aHJlYXRNb2RlbFRpdGxlLiR2YWxpZFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJhbGVydCBhbGVydC1kYW5nZXJcIiByb2xlPVwiYWxlcnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWV4Y2xhbWF0aW9uLXRyaWFuZ2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj4gVGhlIHRocmVhdCBtb2RlbCB0aXRsZSBjYW5ub3QgYmUgZW1wdHkuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cInZtLndpbGxNb3ZlVGhyZWF0TW9kZWwoe21vZGVsOiB2bS50aHJlYXRNb2RlbEVkaXRGb3JtLnRocmVhdE1vZGVsVGl0bGUuJHZpZXdWYWx1ZX0pICYmICF2bS5pc05ld01vZGVsKClcIj4gICAgICAgICAgICAgICAgICAgICAgXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWluZm9cIiByb2xlPVwiYWxlcnRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImZhIGZhLWluZm8tY2lyY2xlXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCI+PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPldhcm5pbmc6PC9zcGFuPiBDaGFuZ2luZyB0aGUgbW9kZWwgdGl0bGUgd2lsbCBkZWxldGUgdGhlIG9sZCBtb2RlbFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBjcmVhdGUgYSBuZXcgb25lIHRvIHJlcGxhY2UgaXQuXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tT3duZXItLT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwIGNvbC1tZC02XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGxhYmVsPk93bmVyPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8aW5wdXQgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwidm0udGhyZWF0TW9kZWwuc3VtbWFyeS5vd25lclwiIHBsYWNlaG9sZGVyPVwiVGhlIG93bmVyIG9mIHRoZSB0aHJlYXQgbW9kZWxcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1yZXZpZXdlci0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8bGFiZWw+UmV2aWV3ZXI8L2xhYmVsPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS50aHJlYXRNb2RlbC5kZXRhaWwucmV2aWV3ZXJcIiBwbGFjZWhvbGRlcj1cIlRoZSByZXZpZXdlciBvZiB0aGUgdGhyZWF0IG1vZGVsXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8IS0tZGVzY3JpcHRpb24tLT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJmb3JtLWdyb3VwIGNvbC1tZC0xMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxsYWJlbD5IaWdoIGxldmVsIHN5c3RlbSBkZXNjcmlwdGlvbjwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPHRleHRhcmVhIHJvd3M9XCI1XCIgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiBuZy1tb2RlbD1cInZtLnRocmVhdE1vZGVsLnN1bW1hcnkuZGVzY3JpcHRpb25cIiBwbGFjZWhvbGRlcj1cIkEgaGlnaCBsZXZlbCBkZXNjcmlwdGlvbiBvZiB0aGUgc3lzdGVtXCI+PC90ZXh0YXJlYT5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPCEtLWNvbnRyaWJ1dG9ycy0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGxhYmVsPkNvbnRyaWJ1dG9yczwvbGFiZWw+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQ9XCJjb250cmlidXRvciBpbiB2bS50aHJlYXRNb2RlbC5kZXRhaWwuY29udHJpYnV0b3JzXCIgbmctZm9ybT1cImNvbnRyaWJ1dG9yU3ViRm9ybVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJpbnB1dC1ncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgbmFtZT1cImNvbnRyaWJ1dG9yTmFtZVwiIGNsYXNzPVwiZm9ybS1jb250cm9sXCIgdHlwZT1cInRleHRcIiBuZy1tb2RlbD1cImNvbnRyaWJ1dG9yLm5hbWVcIiByZXF1aXJlZCBwbGFjZWhvbGRlcj1cIlRoZSBuYW1lIG9mIGEgY29udHJpYnV0b3IgdG8gdGhlIHRocmVhdCBtb2RlbFwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5yZW1vdmVDb250cmlidXRvcigkaW5kZXgpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIlJlbW92ZSBUaGlzIENvbnRyaWJ1dG9yXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVtb3ZlXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXNob3c9XCJjb250cmlidXRvclN1YkZvcm0uY29udHJpYnV0b3JOYW1lLiRkaXJ0eSAmJiAhY29udHJpYnV0b3JTdWJGb3JtLmNvbnRyaWJ1dG9yTmFtZS4kdmFsaWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJmYSBmYS1leGNsYW1hdGlvbi10cmlhbmdsZVwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj4gVGhlIGNvbnRyaWJ1dG9yIG5hbWUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQtZW5kPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJpbnB1dC1ncm91cFwiIG5nLXNob3c9XCJ2bS5hZGRpbmdDb250cmlidXRvclwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5wdXQgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiBuYW1lPVwibmV3Q29udHJpYnV0b3JOYW1lSW5wdXRcIiB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwidm0ubmV3Q29udHJpYnV0b3JcIiBwbGFjZWhvbGRlcj1cIlRoZSBuYW1lIG9mIGEgY29udHJpYnV0b3JcIlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImlucHV0LWdyb3VwLWJ0blwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIG5nLWRpc2FibGVkPVwidm0ubmV3Q29udHJpYnV0b3IubGVuZ3RoID09IDBcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmFkZENvbnRyaWJ1dG9yKClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiQWRkIHRoaXMgY29udHJpYnV0b3JcIiBhcmlhLWhpZGRlbj1cInRydWVcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXBsdXNcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWRkXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1saW5rXCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5jYW5jZWxBZGRpbmdDb250cmlidXRvcigpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkNhbmNlbCBhZGRpbmcgdGhpcyBjb250cmlidXRvclwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcmVtb3ZlXCI+PC9zcGFuPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbmNlbFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaGlkZT1cInZtLmFkZGluZ0NvbnRyaWJ1dG9yXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWxpbmtcIiBuZy1jbGljaz1cInZtLnN0YXJ0QWRkaW5nQ29udHJpYnV0b3IoKVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXBsdXNcIj48L3NwYW4+IEFkZCBhIG5ldyBjb250cmlidXRvci4uLlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwhLS1kaWFncmFtcy0tPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImZvcm0tZ3JvdXAgY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGxhYmVsPkRpYWdyYW1zPC9sYWJlbD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cImRpYWdyYW0gaW4gdm0udGhyZWF0TW9kZWwuZGV0YWlsLmRpYWdyYW1zXCIgbmctZm9ybT1cImRpYWdyYW1TdWJGb3JtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtNlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHA+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImlucHV0LWdyb3VwXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBuYW1lPVwiZGlhZ3JhbVRpdGxlXCIgY2xhc3M9XCJmb3JtLWNvbnRyb2xcIiB0eXBlPVwidGV4dFwiIG5nLW1vZGVsPVwiZGlhZ3JhbS50aXRsZVwiIHJlcXVpcmVkIHBsYWNlaG9sZGVyPVwiRGlhZ3JhbSB0aXRsZVwiXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiaW5wdXQtZ3JvdXAtYnRuXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1wcmltYXJ5XCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5kdXBsaWNhdGVEaWFncmFtKCRpbmRleClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiRHVwbGljYXRlIFRoaXMgRGlhZ3JhbVwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tZHVwbGljYXRlXCI+PC9zcGFuPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIER1cGxpY2F0ZVxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1kZWZhdWx0XCIgZGF0YS10b2dnbGU9XCJ0b29sdGlwXCIgbmctY2xpY2s9XCJ2bS5yZW1vdmVEaWFncmFtKCRpbmRleClcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiUmVtb3ZlIFRoaXMgRGlhZ3JhbVwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiIHR5cGU9XCJidXR0b25cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tcmVtb3ZlXCI+PC9zcGFuPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlbW92ZVxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctc2hvdz1cImRpYWdyYW1TdWJGb3JtLmRpYWdyYW1UaXRsZS4kZGlydHkgJiYgIWRpYWdyYW1TdWJGb3JtLmRpYWdyYW1UaXRsZS4kdmFsaWRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImFsZXJ0IGFsZXJ0LWRhbmdlclwiIHJvbGU9XCJhbGVydFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJmYSBmYS1leGNsYW1hdGlvbi10cmlhbmdsZVwiIGFyaWEtaGlkZGVuPVwidHJ1ZVwiPjwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3Itb25seVwiPkVycm9yOjwvc3Bhbj4gVGhlIGRpYWdyYW0gdGl0bGUgY2Fubm90IGJlIGVtcHR5LlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3A+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1yZXBlYXQtZW5kPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTZcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJpbnB1dC1ncm91cFwiIG5nLXNob3c9XCJ2bS5hZGRpbmdEaWFncmFtXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbnB1dCBjbGFzcz1cImZvcm0tY29udHJvbFwiIHR5cGU9XCJ0ZXh0XCIgbmctbW9kZWw9XCJ2bS5uZXdEaWFncmFtLnRpdGxlXCIgcGxhY2Vob2xkZXI9XCJEaWFncmFtIHRpdGxlXCIgLz5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJpbnB1dC1ncm91cC1idG5cIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBuZy1kaXNhYmxlZD1cInZtLm5ld0RpYWdyYW0udGl0bGUubGVuZ3RoID09IDBcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBuZy1jbGljaz1cInZtLmFkZERpYWdyYW0oKVwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJBZGQgdGhpcyBkaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1wbHVzXCI+PC9zcGFuPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkZFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImlucHV0LWdyb3VwLWJ0blwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJ1dHRvbiBjbGFzcz1cImJ0biBidG4tbGlua1wiIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIG5nLWNsaWNrPVwidm0uY2FuY2VsQWRkaW5nRGlhZ3JhbSgpXCIgZGF0YS1wbGFjZW1lbnQ9XCJ0b3BcIiB0aXRsZT1cIkNhbmNlbCBhZGRpbmcgdGhpcyBkaWFncmFtXCIgYXJpYS1oaWRkZW49XCJ0cnVlXCIgdHlwZT1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZ2x5cGhpY29uIGdseXBoaWNvbi1yZW1vdmVcIj48L3NwYW4+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FuY2VsXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1oaWRlPVwidm0uYWRkaW5nRGlhZ3JhbVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnV0dG9uIGNsYXNzPVwiYnRuIGJ0bi1saW5rXCIgbmctY2xpY2s9XCJ2bS5zdGFydEFkZGluZ0RpYWdyYW0oKVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJnbHlwaGljb24gZ2x5cGhpY29uLXBsdXNcIj48L3NwYW4+IEFkZCBhIG5ldyBkaWFncmFtLi4uXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvYnV0dG9uPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9wPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICA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T1cImJ1dHRvblwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJmYSBmYS11bmRvXCI+PC9zcGFuPiBSZWxvYWRcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9idXR0b24+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxidXR0b24gY2xhc3M9XCJidG4gYnRuLXByaW1hcnlcIiBuZy1kaXNhYmxlZD1cIiF2bS5kaXJ0eSB8fCAhdm0udGhyZWF0TW9kZWxFZGl0Rm9ybS4kdmFsaWRcIiBuZy1jbGljaz1cInZtLmlzTmV3TW9kZWwoKSA/IHZtLmNyZWF0ZSgpIDogdm0uc2F2ZSgpXCJcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtdG9nZ2xlPVwidG9vbHRpcFwiIGRhdGEtcGxhY2VtZW50PVwidG9wXCIgdGl0bGU9XCJTYXZlIENoYW5nZXNcIiB0eXBlPVwiYnV0dG9uXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cImdseXBoaWNvbiBnbHlwaGljb24tc2F2ZVwiPjwvc3Bhbj4gU2F2ZVxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Zvcm0+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDwhLS1vb3BzLS0+XFxuJyArXG4gICAgJyAgICA8ZGl2IG5nLWlmPVwidm0uZXJyb3JlZFwiPlxcbicgK1xuICAgICcgICAgICAgIDxkaXYgY2xhc3M9XCJ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V0dG9uPlxcbicgK1xuICAgICcgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgPC9kaXY+XFxuJyArXG4gICAgJzwvZGl2PlxcbicgK1xuICAgICc8ZGl2IG5nLWlmPVwibW9kZWwuc3VtbWFyeVwiPlxcbicgK1xuICAgICcgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHRcIj5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtaGVhZGluZyBwYW5lbC10aXRsZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICA8aDQgaWQ9XCJ0aXRsZVRleHRcIj5UaHJlYXQgbW9kZWwgcmVwb3J0IGZvciB7e21vZGVsLnN1bW1hcnkudGl0bGV9fTwvaDQ+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0yXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+T3duZXI6IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj57e21vZGVsLnN1bW1hcnkub3duZXJ9fTwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0yXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+UmV2aWV3ZXI6IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGRpdj57e21vZGVsLmRldGFpbC5yZXZpZXdlcn19PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICA8ZGl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0gXFwndG0uQm91bmRhcnlcXCdcIiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHQgbW9kZWwtZWxlbWVudCB0bXQtZGlhZ3JhbS1lbGVtZW50XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7e2VsZW1lbnQubmFtZX19XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2g9XCJlbGVtZW50LmF0dHJpYnV0ZXMudHlwZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uU3RvcmVcIj4oRGF0YSBTdG9yZSk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoLXdoZW49XCJ0bS5GbG93XCI+KERhdGEgRmxvdyk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoLXdoZW49XCJ0bS5Qcm9jZXNzXCI+KFByb2Nlc3MpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLXN3aXRjaC13aGVuPVwidG0uQWN0b3JcIj4oRXh0ZXJuYWwgQWN0b3IpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5EZXNjcmlwdGlvbjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3tlbGVtZW50LmRlc2NyaXB0aW9ufX08L3A+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiZWxlbWVudC5oYXNPcGVuVGhyZWF0cyB8fCAocmVwb3J0T3B0aW9ucy5zaG93TWl0aWdhdGVkICYmIGVsZW1lbnQudGhyZWF0cy5sZW5ndGggPiAwKVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctcmVwZWF0PVwidGhyZWF0IGluIGVsZW1lbnQudGhyZWF0c1wiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwidGhyZWF0LnN0YXR1cyA9PSBcXCdPcGVuXFwnIHx8IHJlcG9ydE9wdGlvbnMuc2hvd01pdGlnYXRlZFwiIGNsYXNzPVwicGFuZWwgcGFuZWwtZGVmYXVsdCB0aHJlYXRcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1oZWFkaW5nIHBhbmVsLXRpdGxlXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge3t0aHJlYXQudGl0bGV9fVxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxlbSBjbGFzcz1cInNtYWxsXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt7dGhyZWF0LnR5cGV9fSxcXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctY2xhc3M9XCJ7TWl0aWdhdGVkOlxcJ3RleHQtc3VjY2Vzc1xcJywgT3BlbjpcXCd0ZXh0LWRhbmdlclxcJ31bdGhyZWF0LnN0YXR1c11cIj57e3RocmVhdC5zdGF0dXN9fTwvc3Bhbj4sXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIG5nLWNsYXNzPVwie0xvdzpcXCd0ZXh0LXN1Y2Nlc3NcXCcsIE1lZGl1bTpcXCd0ZXh0LXdhcm5pbmdcXCcsIEhpZ2g6XFwndGV4dC1kYW5nZXJcXCd9W3RocmVhdC5zZXZlcml0eV1cIj57e3RocmVhdC5zZXZlcml0eX19IFNldmVyaXR5PC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZW0+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJwYW5lbC1ib2R5XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0xMlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+RGVzY3JpcHRpb246IDwvc3Ryb25nPjwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3t0aHJlYXQuZGVzY3JpcHRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5NaXRpZ2F0aW9uOiA8L3N0cm9uZz48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj48cCBjbGFzcz1cInJlcG9ydFwiPnt7dGhyZWF0Lm1pdGlnYXRpb259fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBuZy1pZj1cImVsZW1lbnQudGhyZWF0cy5sZW5ndGggPT0gMCB8fCAhZWxlbWVudC50aHJlYXRzIHx8ICghZWxlbWVudC5oYXNPcGVuVGhyZWF0cyAmJiAhcmVwb3J0T3B0aW9ucy5zaG93TWl0aWdhdGVkKVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxlbT5ObyB0aHJlYXRzIGxpc3RlZC48L2VtPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8ZGl2IG5nLWlmPVwicmVwb3J0T3B0aW9ucy5zaG93T3V0T2ZTY29wZVwiIG5nLXJlcGVhdD1cImVsZW1lbnQgaW4gZ3JhcGhzW2RpYWdyYW0uaWRdLmdldENlbGxzKCkgfCBmaWx0ZXI6e291dE9mU2NvcGU6IHRydWV9XCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsIHBhbmVsLWRlZmF1bHQgbW9kZWwtZWxlbWVudFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwicGFuZWwtaGVhZGluZyBwYW5lbC10aXRsZVwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAge3tlbGVtZW50Lm5hbWV9fSAob3V0IG9mIHNjb3BlIFxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoPVwiZWxlbWVudC5hdHRyaWJ1dGVzLnR5cGVcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLlN0b3JlXCI+RGF0YSBTdG9yZSk8L3NwYW4+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctc3dpdGNoLXdoZW49XCJ0bS5GbG93XCI+RGF0YSBGbG93KTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLlByb2Nlc3NcIj5Qcm9jZXNzKTwvc3Bhbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1zd2l0Y2gtd2hlbj1cInRtLkFjdG9yXCI+RXh0ZXJuYWwgQWN0b3IpPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInBhbmVsLWJvZHlcIj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+PHN0cm9uZz5EZXNjcmlwdGlvbjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3tlbGVtZW50LmRlc2NyaXB0aW9ufX08L3A+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxzdHJvbmc+T3V0IG9mIHNjb3BlIHJlYXNvbjogPC9zdHJvbmc+PC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PjxwIGNsYXNzPVwicmVwb3J0XCI+e3tlbGVtZW50LnJlYXNvbk91dE9mU2NvcGV9fTwvcD48L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgICAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICAgICAgPC9kaXY+XFxuJyArXG4gICAgJyAgICA8L2Rpdj5cXG4nICtcbiAgICAnICAgIDxkaXYgbmctaWY9XCIhaXNQcmludGluZ09yU2F2aW5nXCIgY2xhc3M9XCJyb3dcIj5cXG4nICtcbiAgICAnICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTEyXCI+XFxuJyArXG4gICAgJyAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJidG4tZ3JvdXAgcHVsbC1yaWdodFwiIHJvbGU9XCJncm91cFwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgPGJ1dHRvbiBuZy1pZj1cInNhdmVhYmxlXCIgY2xhc3M9XCJidG4gYnRuLWRlZmF1bHRcIiBpZD1cInNhdmVQREZCdXR0b25cIiByb2xlPVwiYnV0dG9uXCIgbmctY2xpY2s9XCJzYXZlUERGKClcIiBkYXRhLXRvZ2dsZT1cInRvb2x0aXBcIiBkYXRhLXBsYWNlbWVudD1cInRvcFwiIHRpdGxlPVwiU2F2ZSBUaHJlYXQgTW9kZWwgUmVwb3J0IEFzIFBERlwiPlxcbicgK1xuICAgICcgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwiZmEgZmEtZmxvcHB5LW9cIj48L3NwYW4+IFNhdmUgUERGXFxuJyArXG4gICAgJyAgICAgICAgICAgICAgICA8L2J1dHRvbj5cXG4nICtcbiAgICAnICAgICAgICAgICAgICAgIDxidXR0b24gbmctaWY9XCJwcmludGFibGVcIiBjbGFzcz1cImJ0biBidG4tZGVmYXVsdFwiIGlk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sb2NhdG9yLCBkaWFncmFtbWluZykge1xuXG4gICAgdmFyIGRpcmVjdGl2ZSA9XG4gICAgICAgIHtcbiAgICAgICAgICAgIGxpbms6IGxpbmssXG4gICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RocmVhdG1vZGVscy90aHJlYXRtb2RlbHJlcG9ydC5odG1sJyxcbiAgICAgICAgICAgIHJlc3RyaWN0OiAnRScsXG4gICAgICAgICAgICBzY29wZTpcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICBtb2RlbDogJz0nLFxuICAgICAgICAgICAgICAgIGxvYWRlZDogJyYnLFxuICAgICAgICAgICAgICAgIGlzUHJpbnRpbmdPclNhdmluZzogJz1oaWRlQ29udHJvbHMnLFxuICAgICAgICAgICAgICAgIHNhdmU6ICcmPycsXG4gICAgICAgICAgICAgICAgcHJpbnQ6ICcmPydcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgIHJldHVybiBkaXJlY3RpdmU7XG5cbiAgICBmdW5jdGlvbiBsaW5rKHNjb3BlKSB7XG4gICAgICAgIFxuICAgICAgICBzY29wZS5wcmludGFibGUgPSBfLmlzRnVuY3Rpb24oc2NvcGUucHJpbnQpO1xuICAgICAgICBzY29wZS5zYXZlYWJsZSA9IF8uaXNGdW5jdGlvbihzY29wZS5zYXZlKTtcbiAgICAgICAgc2NvcGUuc2F2ZVBERiA9IHNhdmVQREY7XG4gICAgICAgIHNjb3BlLnByaW50UERGID0gcHJpbnRQREY7XG4gICAgICAgIHNjb3BlLmNhbmNlbCA9IGNhbmNlbDtcbiAgICAgICAgc2NvcGUuaW5pdGlhbGlzZSA9IGluaXRpYWxpc2U7XG4gICAgICAgIHNjb3BlLmdyYXBocyA9IG51bGw7XG4gICAgXG4gICAgICAgIHNjb3BlLnJlcG9ydE9wdGlvbnMgPSB7XG4gICAgICAgICAgICBzaG93TWl0aWdhdGVkOiB0cnVlLFxuICAgICAgICAgICAgc2hvd091dE9mU2NvcGU6IHRydWUsX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tcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICRsb2NhdGlvbi5wYXRoKCcvJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBzY29wZS5zYWZlQXBwbHkgPSBmdW5jdGlvbihmbikge1xuICAgICAgICAgICAgdmFyIHBoYXNlID0gdGhpcy4kcm9vdC4kJHBoYXNlO1xuICAgICAgICAgICAgaWYocGhhc2UgPT0gJyRhcHBseScgfHwgcGhhc2UgPT0gJyRkaWdlc3QnKSB7XG4gICAgICAgICAgICAgIGlmKGZuICYmICh0eXBlb2YoZm4pID09PSAnZnVuY3Rpb24nKSkge1xuICAgICAgICAgICAgICAgIGZuKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuJGFwcGx5KGZuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcblxuICAgICAgICBmdW5jdGlvbiBpbml0aWFsaXNlR3JhcGhzKCkge1xuXG4gICAgICAgICAgICBzY29wZS5tb2RlbC5kZXRhaWwuZGlhZ3JhbXMuZm9yRWFjaChpbml0aWFsaXNlR3JhcGgpO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBpbml0aWFsaXNlR3JhcGgoZGlhZ3JhbSkge1xuICAgICAgICAgICAgICAgIHNjb3BlLmdyYXBoc1tkaWFncmFtLmlkXS5pbml0aWFsaXNlKGRpYWdyYW0uZGlhZ3JhbUpzb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gcHJpbWVHcmFwaHMoKSB7XG4gICAgICAgICAgICAvL2NhbnQgc2VlIGhvdyB0byBpbml0aWFsaXNlIHdpdGggdGhlIHJpZ2h0IG51bWJlciBvZiBkaWFncmFtc1xuICAgICAgICAgICAgLy9zbyBhcmJpdHJhcmlseSBwaWNrIDIwXG4gICAgICAgICAgICBzY29wZS5ncm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ICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIHZhciB0b2FzdHIgPSB7XG4gICAgICAgICAgICAgICAgY2xlYXI6IGNsZWFyLFxuICAgICAgICAgICAgICAgIHJlbW92ZTogcmVtb3ZlLFxuICAgICAgICAgICAgICAgIGVycm9yOiBlcnJvcixcbiAgICAgICAgICAgICAgICBnZXRDb250YWluZXI6IGdldENvbnRhaW5lcixcbiAgICAgICAgICAgICAgICBpbmZvOiBpbmZvLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6IHt9LFxuICAgICAgICAgICAgICAgIHN1YnNjcmliZTogc3Vic2NyaWJlLFxuICAgICAgICAgICAgICAgIHN1Y2Nlc3M6IHN1Y2Nlc3MsXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogJzIuMS40JyxcbiAgICAgICAgICAgICAgICB3YXJuaW5nOiB3YXJuaW5nXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB2YXIgcHJldmlvdXNUb2FzdDtcblxuICAgICAgICAgICAgcmV0dXJuIHRvYXN0cjtcblxuICAgICAgICAgICAgLy8vLy8vLy8vLy8vLy8vL1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBlcnJvcihtZXNzYWdlLCB0aXRsZSwgb3B0aW9uc092ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vdGlmeSh7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHRvYXN0VHlwZS5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzOiBnZXRPcHRpb25zKCkuaWNvbkNsYXNzZXMuZXJyb3IsXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNPdmVycmlkZTogb3B0aW9uc092ZXJyaWRlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0Q29udGFpbmVyKG9wdGlvbnMsIGNyZWF0ZSkge1xuICAgICAgICAgICAgICAgIGlmICghb3B0aW9ucykgeyBvcHRpb25zID0gZ2V0T3B0aW9ucygpOyB9XG4gICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9ICQoJyMnICsgb3B0aW9ucy5jb250YWluZXJJZCk7XG4gICAgICAgICAgICAgICAgaWYgKCRjb250YWluZXIubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkY29udGFpbmVyO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY3JlYXRlKSB7XG4gICAgICAgICAgICAgICAgICAgICRjb250YWluZXIgPSBjcmVhdGVDb250YWluZXIob3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiAkY29udGFpbmVyO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBpbmZvKG1lc3NhZ2UsIHRpdGxlLCBvcHRpb25zT3ZlcnJpZGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbm90aWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogdG9hc3RUeXBlLmluZm8sXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzczogZ2V0T3B0aW9ucygpLmljb25DbGFzc2VzLmluZm8sXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UsXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnNPdmVycmlkZTogb3B0aW9uc092ZXJyaWRlLFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGVcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gc3Vic2NyaWJlKGNhbGxiYWNrKSB7XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIgPSBjYWxsYmFjaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gc3VjY2VzcyhtZXNzYWdlLCB0aXRsZSwgb3B0aW9uc092ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG5vdGlmeSh7XG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHRvYXN0VHlwZS5zdWNjZXNzLFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6IGdldE9wdGlvbnMoKS5pY29uQ2xhc3Nlcy5zdWNjZXNzLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlLFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zT3ZlcnJpZGU6IG9wdGlvbnNPdmVycmlkZSxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHdhcm5pbmcobWVzc2FnZSwgdGl0bGUsIG9wdGlvbnNPdmVycmlkZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub3RpZnkoe1xuICAgICAgICAgICAgICAgICAgICB0eXBlOiB0b2FzdFR5cGUud2FybmluZyxcbiAgICAgICAgICAgICAgICAgICAgaWNvbkNsYXNzOiBnZXRPcHRpb25zKCkuaWNvbkNsYXNzZXMud2FybmluZyxcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbWVzc2FnZSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uc092ZXJyaWRlOiBvcHRpb25zT3ZlcnJpZGUsXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjbGVhcigkdG9hc3RFbGVtZW50LCBjbGVhck9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3B0aW9ucyA9IGdldE9wdGlvbnMoKTtcbiAgICAgICAgICAgICAgICBpZiAoISRjb250YWluZXIpIHsgZ2V0Q29udGFpbmVyKG9wdGlvbnMpOyB9XG4gICAgICAgICAgICAgICAgaWYgKCFjbGVhclRvYXN0KCR0b2FzdEVsZW1lbnQsIG9wdGlvbnMsIGNsZWFyT3B0aW9ucykpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJDb250YWluZXIob3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmUoJHRvYXN0RWxlbWVudCkge1xuICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gZ2V0T3B0aW9ucygpO1xuICAgICAgICAgICAgICAgIGlmICghJGNvbnRhaW5lcikgeyBnZXRDb250YWluZXIob3B0aW9ucyk7IH1cbiAgICAgICAgICAgICAgICBpZiAoJHRvYXN0RWxlbWVudCAmJiAkKCc6Zm9jdXMnLCAkdG9hc3RFbGVtZW50KS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVG9hc3QoJHRvYXN0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCRjb250YWluZXIuY2hpbGRyZW4oKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIC8vIGludGVybmFsIGZ1bmN0aW9uc1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBjbGVhckNvbnRhaW5lciAob3B0aW9ucykge1xuICAgICAgICAgICAgICAgIHZhciB0b2FzdHNUb0NsZWFyID0gJGNvbnRhaW5lci5jaGlsZHJlbigpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSB0b2FzdHNUb0NsZWFyLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsZWFyVG9hc3QoJCh0b2FzdHNUb0NsZWFyW2ldKSwgb3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmdW5jdGlvbiBjbGVhclRvYXN0ICgkdG9hc3RFbGVtZW50LCBvcHRpb25zLCBjbGVhck9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICB2YXIgZm9yY2UgPSBjbGVhck9wdGlvbnMgJiYgY2xlYXJPcHRpb25zLmZvcmNlID8gY2xlYXJPcHRpb25zLmZvcmNlIDogZmFsc2U7XG4gICAgICAgICAgICAgICAgaWYgKCR0b2FzdEVsZW1lbnQgJiYgKGZvcmNlIHx8ICQoJzpmb2N1cycsICR0b2FzdEVsZW1lbnQpLmxlbmd0aCA9PT0gMCkpIHtcbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudFtvcHRpb25zLmhpZGVNZXRob2RdKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uOiBvcHRpb25zLmhpZGVEdXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIGVhc2luZzogb3B0aW9ucy5oaWRlRWFzaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGU6IGZ1bmN0aW9uICgpIHsgcmVtb3ZlVG9hc3QoJHRvYXN0RWxlbWVudCk7IH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGNyZWF0ZUNvbnRhaW5lcihvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9ICQoJzxkaXYvPicpXG4gICAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsIG9wdGlvbnMuY29udGFpbmVySWQpXG4gICAgICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhvcHRpb25zLnBvc2l0aW9uQ2xhc3MpO1xuXG4gICAgICAgICAgICAgICAgJGNvbnRhaW5lci5hcHBlbmRUbygkKG9wdGlvbnMudGFyZ2V0KSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuICRjb250YWluZXI7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIGdldERlZmF1bHRzKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgIHRhcFRvRGlzbWlzczogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgdG9hc3RDbGFzczogJ3RvYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgY29udGFpbmVySWQ6ICd0b2FzdC1jb250YWluZXInLFxuICAgICAgICAgICAgICAgICAgICBkZWJ1ZzogZmFsc2UsXG5cbiAgICAgICAgICAgICAgICAgICAgc2hvd01ldGhvZDogJ2ZhZGVJbicsIC8vZmFkZUluLCBzbGlkZURvd24sIGFuZCBzaG93IGFyZSBidWlsdCBpbnRvIGpRdWVyeVxuICAgICAgICAgICAgICAgICAgICBzaG93RHVyYXRpb246IDMwMCxcbiAgICAgICAgICAgICAgICAgICAgc2hvd0Vhc2luZzogJ3N3aW5nJywgLy9zd2luZyBhbmQgbGluZWFyIGFyZSBidWlsdCBpbnRvIGpRdWVyeVxuICAgICAgICAgICAgICAgICAgICBvblNob3duOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIGhpZGVNZXRob2Q6ICdmYWRlT3V0JyxcbiAgICAgICAgICAgICAgICAgICAgaGlkZUR1cmF0aW9uOiAxMDAwLFxuICAgICAgICAgICAgICAgICAgICBoaWRlRWFzaW5nOiAnc3dpbmcnLFxuICAgICAgICAgICAgICAgICAgICBvbkhpZGRlbjogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZU1ldGhvZDogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlRHVyYXRpb246IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZUVhc2luZzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIGNsb3NlT25Ib3ZlcjogdHJ1ZSxcblxuICAgICAgICAgICAgICAgICAgICBleHRlbmRlZFRpbWVPdXQ6IDEwMDAsXG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzc2VzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlcnJvcjogJ3RvYXN0LWVycm9yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm86ICd0b2FzdC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3M6ICd0b2FzdC1zdWNjZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm5pbmc6ICd0b2FzdC13YXJuaW5nJ1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBpY29uQ2xhc3M6ICd0b2FzdC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25DbGFzczogJ3RvYXN0LXRvcC1yaWdodCcsXG4gICAgICAgICAgICAgICAgICAgIHRpbWVPdXQ6IDUwMDAsIC8vIFNldCB0aW1lT3V0IGFuZCBleHRlbmRlZFRpbWVPdXQgdG8gMCB0byBtYWtlIGl0IHN0aWNreVxuICAgICAgICAgICAgICAgICAgICB0aXRsZUNsYXNzOiAndG9hc3QtdGl0bGUnLFxuICAgICAgICAgICAgICAgICAgICBtZXNzYWdlQ2xhc3M6ICd0b2FzdC1tZXNzYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgZXNjYXBlSHRtbDogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIHRhcmdldDogJ2JvZHknLFxuICAgICAgICAgICAgICAgICAgICBjbG9zZUh0bWw6ICc8YnV0dG9uIHR5cGU9XCJidXR0b25cIj4mdGltZXM7PC9idXR0b24+JyxcbiAgICAgICAgICAgICAgICAgICAgY2xvc2VDbGFzczogJ3RvYXN0LWNsb3NlLWJ1dHRvbicsXG4gICAgICAgICAgICAgICAgICAgIG5ld2VzdE9uVG9wOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBwcmV2ZW50RHVwbGljYXRlczogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NDbGFzczogJ3RvYXN0LXByb2dyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgcnRsOiBmYWxzZVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIHB1Ymxpc2goYXJncykge1xuICAgICAgICAgICAgICAgIGlmICghbGlzdGVuZXIpIHsgcmV0dXJuOyB9XG4gICAgICAgICAgICAgICAgbGlzdGVuZXIoYXJncyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZ1bmN0aW9uIG5vdGlmeShtYXApIHtcbiAgICAgICAgICAgICAgICB2YXIgb3B0aW9ucyA9IGdldE9wdGlvbnMoKTtcbiAgICAgICAgICAgICAgICB2YXIgaWNvbkNsYXNzID0gbWFwLmljb25DbGFzcyB8fCBvcHRpb25zLmljb25DbGFzcztcblxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKG1hcC5vcHRpb25zT3ZlcnJpZGUpICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBvcHRpb25zID0gJC5leHRlbmQob3B0aW9ucywgbWFwLm9wdGlvbnNPdmVycmlkZSk7XG4gICAgICAgICAgICAgICAgICAgIGljb25DbGFzcyA9IG1hcC5vcHRpb25zT3ZlcnJpZGUuaWNvbkNsYXNzIHx8IGljb25DbGFzcztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoc2hvdWxkRXhpdChvcHRpb25zLCBtYXApKSB7IHJldHVybjsgfVxuXG4gICAgICAgICAgICAgICAgdG9hc3RJZCsrO1xuXG4gICAgICAgICAgICAgICAgJGNvbnRhaW5lciA9IGdldENvbnRhaW5lcihvcHRpb25zLCB0cnVlKTtcblxuICAgICAgICAgICAgICAgIHZhciBpbnRlcnZhbElkID0gbnVsbDtcbiAgICAgICAgICAgICAgICB2YXIgJHRvYXN0RWxlbWVudCA9ICQoJzxkaXYvPicpO1xuICAgICAgICAgICAgICAgIHZhciAkdGl0bGVFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICRtZXNzYWdlRWxlbWVudCA9ICQoJzxkaXYvPicpO1xuICAgICAgICAgICAgICAgIHZhciAkcHJvZ3Jlc3NFbGVtZW50ID0gJCgnPGRpdi8+Jyk7XG4gICAgICAgICAgICAgICAgdmFyICRjbG9zZUVsZW1lbnQgPSAkKG9wdGlvbnMuY2xvc2VIdG1sKTtcbiAgICAgICAgICAgICAgICB2YXIgcHJvZ3Jlc3NCYXIgPSB7XG4gICAgICAgICAgICAgICAgICAgIGludGVydmFsSWQ6IG51bGwsXG4gICAgICAgICAgICAgICAgICAgIGhpZGVFdGE6IG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG1heEhpZGVUaW1lOiBudWxsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB2YXIgcmVzcG9uc2UgPSB7XG4gICAgICAgICAgICAgICAgICAgIHRvYXN0SWQ6IHRvYXN0SWQsXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlOiAndmlzaWJsZScsXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0VGltZTogbmV3IERhdGUoKSxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogb3B0aW9ucyxcbiAgICAgICAgICAgICAgICAgICAgbWFwOiBtYXBcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgcGVyc29uYWxpemVUb2FzdCgpO1xuXG4gICAgICAgICAgICAgICAgZGlzcGxheVRvYXN0KCk7XG5cbiAgICAgICAgICAgICAgICBoYW5kbGVFdmVudHMoKTtcblxuICAgICAgICAgICAgICAgIHB1Ymxpc2gocmVzcG9uc2UpO1xuXG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZGVidWcgJiYgY29uc29sZSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuICR0b2FzdEVsZW1lbnQ7XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBlc2NhcGVIdG1sKHNvdXJjZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlID09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJjZVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoLyYvZywgJyZhbXA7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cIi9nLCAnJnF1b3Q7JylcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8nL2csICcmIzM5OycpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvPC9nLCAnJmx0OycpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvPi9nLCAnJmd0OycpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHBlcnNvbmFsaXplVG9hc3QoKSB7XG4gICAgICAgICAgICAgICAgICAgIHNldEljb24oKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGl0bGUoKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0TWVzc2FnZSgpO1xuICAgICAgICAgICAgICAgICAgICBzZXRDbG9zZUJ1dHRvbigpO1xuICAgICAgICAgICAgICAgICAgICBzZXRQcm9ncmVzc0JhcigpO1xuICAgICAgICAgICAgICAgICAgICBzZXRSVEwoKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0U2VxdWVuY2UoKTtcbiAgICAgICAgICAgICAgICAgICAgc2V0QXJpYSgpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldEFyaWEoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhcmlhVmFsdWUgPSAnJztcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtYXAuaWNvbkNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0b2FzdC1zdWNjZXNzJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvYXN0LWluZm8nOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyaWFWYWx1ZSA9ICAncG9saXRlJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJpYVZhbHVlID0gJ2Fzc2VydGl2ZSc7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5hdHRyKCdhcmlhLWxpdmUnLCBhcmlhVmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhhbmRsZUV2ZW50cygpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xvc2VPbkhvdmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmhvdmVyKHN0aWNrQXJvdW5kLCBkZWxheWVkSGlkZVRvYXN0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghb3B0aW9ucy5vbmNsaWNrICYmIG9wdGlvbnMudGFwVG9EaXNtaXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmNsaWNrKGhpZGVUb2FzdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5jbG9zZUJ1dHRvbiAmJiAkY2xvc2VFbGVtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkY2xvc2VFbGVtZW50LmNsaWNrKGZ1bmN0aW9uIChldmVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldmVudC5zdG9wUHJvcGFnYXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldmVudC5jYW5jZWxCdWJibGUgIT09IHVuZGVmaW5lZCAmJiBldmVudC5jYW5jZWxCdWJibGUgIT09IHRydWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuY2FuY2VsQnViYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5vbkNsb3NlQ2xpY2spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5vbkNsb3NlQ2xpY2soZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVUb2FzdCh0cnVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMub25jbGljaykge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5jbGljayhmdW5jdGlvbiAoZXZlbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLm9uY2xpY2soZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVUb2FzdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBkaXNwbGF5VG9hc3QoKSB7XG4gICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuaGlkZSgpO1xuXG4gICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnRbb3B0aW9ucy5zaG93TWV0aG9kXShcbiAgICAgICAgICAgICAgICAgICAgICAgIHtkdXJhdGlvbjogb3B0aW9ucy5zaG93RHVyYXRpb24sIGVhc2luZzogb3B0aW9ucy5zaG93RWFzaW5nLCBjb21wbGV0ZTogb3B0aW9ucy5vblNob3dufVxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnRpbWVPdXQgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnZhbElkID0gc2V0VGltZW91dChoaWRlVG9hc3QsIG9wdGlvbnMudGltZU91dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0Jhci5tYXhIaWRlVGltZSA9IHBhcnNlRmxvYXQob3B0aW9ucy50aW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmhpZGVFdGEgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMucHJvZ3Jlc3NCYXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0Jhci5pbnRlcnZhbElkID0gc2V0SW50ZXJ2YWwodXBkYXRlUHJvZ3Jlc3MsIDEwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldEljb24oKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXAuaWNvbkNsYXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmFkZENsYXNzKG9wdGlvbnMudG9hc3RDbGFzcykuYWRkQ2xhc3MoaWNvbkNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFNlcXVlbmNlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5uZXdlc3RPblRvcCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci5wcmVwZW5kKCR0b2FzdEVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci5hcHBlbmQoJHRvYXN0RWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRUaXRsZSgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC50aXRsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1ZmZpeCA9IG1hcC50aXRsZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLmVzY2FwZUh0bWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWZmaXggPSBlc2NhcGVIdG1sKG1hcC50aXRsZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAkdGl0bGVFbGVtZW50LmFwcGVuZChzdWZmaXgpLmFkZENsYXNzKG9wdGlvbnMudGl0bGVDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LmFwcGVuZCgkdGl0bGVFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldE1lc3NhZ2UoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXAubWVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1ZmZpeCA9IG1hcC5tZXNzYWdlO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuZXNjYXBlSHRtbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZmZpeCA9IGVzY2FwZUh0bWwobWFwLm1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgJG1lc3NhZ2VFbGVtZW50LmFwcGVuZChzdWZmaXgpLmFkZENsYXNzKG9wdGlvbnMubWVzc2FnZUNsYXNzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQuYXBwZW5kKCRtZXNzYWdlRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRDbG9zZUJ1dHRvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMuY2xvc2VCdXR0b24pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICRjbG9zZUVsZW1lbnQuYWRkQ2xhc3Mob3B0aW9ucy5jbG9zZUNsYXNzKS5hdHRyKCdyb2xlJywgJ2J1dHRvbicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5wcmVwZW5kKCRjbG9zZUVsZW1lbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0UHJvZ3Jlc3NCYXIoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnByb2dyZXNzQmFyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAkcHJvZ3Jlc3NFbGVtZW50LmFkZENsYXNzKG9wdGlvbnMucHJvZ3Jlc3NDbGFzcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LnByZXBlbmQoJHByb2dyZXNzRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRSVEwoKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChvcHRpb25zLnJ0bCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudC5hZGRDbGFzcygncnRsJyk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBzaG91bGRFeGl0KG9wdGlvbnMsIG1hcCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAob3B0aW9ucy5wcmV2ZW50RHVwbGljYXRlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1hcC5tZXNzYWdlID09PSBwcmV2aW91c1RvYXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzVG9hc3QgPSBtYXAubWVzc2FnZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gaGlkZVRvYXN0KG92ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtZXRob2QgPSBvdmVycmlkZSAmJiBvcHRpb25zLmNsb3NlTWV0aG9kICE9PSBmYWxzZSA/IG9wdGlvbnMuY2xvc2VNZXRob2QgOiBvcHRpb25zLmhpZGVNZXRob2Q7XG4gICAgICAgICAgICAgICAgICAgIHZhciBkdXJhdGlvbiA9IG92ZXJyaWRlICYmIG9wdGlvbnMuY2xvc2VEdXJhdGlvbiAhPT0gZmFsc2UgP1xuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy5jbG9zZUR1cmF0aW9uIDogb3B0aW9ucy5oaWRlRHVyYXRpb247XG4gICAgICAgICAgICAgICAgICAgIHZhciBlYXNpbmcgPSBvdmVycmlkZSAmJiBvcHRpb25zLmNsb3NlRWFzaW5nICE9PSBmYWxzZSA/IG9wdGlvbnMuY2xvc2VFYXNpbmcgOiBvcHRpb25zLmhpZGVFYXNpbmc7XG4gICAgICAgICAgICAgICAgICAgIGlmICgkKCc6Zm9jdXMnLCAkdG9hc3RFbGVtZW50KS5sZW5ndGggJiYgIW92ZXJyaWRlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHByb2dyZXNzQmFyLmludGVydmFsSWQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRvYXN0RWxlbWVudFttZXRob2RdKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGR1cmF0aW9uOiBkdXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIGVhc2luZzogZWFzaW5nLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tcGxldGU6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVUb2FzdCgkdG9hc3RFbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQoaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMub25IaWRkZW4gJiYgcmVzcG9uc2Uuc3RhdGUgIT09ICdoaWRkZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnMub25IaWRkZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2Uuc3RhdGUgPSAnaGlkZGVuJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS5lbmRUaW1lID0gbmV3IERhdGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdWJsaXNoKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gZGVsYXllZEhpZGVUb2FzdCgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMudGltZU91dCA+IDAgfHwgb3B0aW9ucy5leHRlbmRlZFRpbWVPdXQgPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnZhbElkID0gc2V0VGltZW91dChoaWRlVG9hc3QsIG9wdGlvbnMuZXh0ZW5kZWRUaW1lT3V0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLm1heEhpZGVUaW1lID0gcGFyc2VGbG9hdChvcHRpb25zLmV4dGVuZGVkVGltZU91dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc0Jhci5oaWRlRXRhID0gbmV3IERhdGUoKS5nZXRUaW1lKCkgKyBwcm9ncmVzc0Jhci5tYXhIaWRlVGltZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHN0aWNrQXJvdW5kKCkge1xuICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQoaW50ZXJ2YWxJZCk7XG4gICAgICAgICAgICAgICAgICAgIHByb2dyZXNzQmFyLmhpZGVFdGEgPSAwO1xuICAgICAgICAgICAgICAgICAgICAkdG9hc3RFbGVtZW50LnN0b3AodHJ1ZSwgdHJ1ZSlbb3B0aW9ucy5zaG93TWV0aG9kXShcbiAgICAgICAgICAgICAgICAgICAgICAgIHtkdXJhdGlvbjogb3B0aW9ucy5zaG93RHVyYXRpb24sIGVhc2luZzogb3B0aW9ucy5zaG93RWFzaW5nfVxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHVwZGF0ZVByb2dyZXNzKCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgcGVyY2VudGFnZSA9ICgocHJvZ3Jlc3NCYXIuaGlkZUV0YSAtIChuZXcgRGF0ZSgpLmdldFRpbWUoKSkpIC8gcHJvZ3Jlc3NCYXIubWF4SGlkZVRpbWUpICogMTAwO1xuICAgICAgICAgICAgICAgICAgICAkcHJvZ3Jlc3NFbGVtZW50LndpZHRoKHBlcmNlbnRhZ2UgKyAnJScpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gZ2V0T3B0aW9ucygpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5leHRlbmQoe30sIGdldERlZmF1bHRzKCksIHRvYXN0ci5vcHRpb25zKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZnVuY3Rpb24gcmVtb3ZlVG9hc3QoJHRvYXN0RWxlbWVudCkge1xuICAgICAgICAgICAgICAgIGlmICghJGNvbnRhaW5lcikgeyAkY29udGFpbmVyID0gZ2V0Q29udGFpbmVyKCk7IH1cbiAgICAgICAgICAgICAgICBpZiAoJHRvYXN0RWxlbWVudC5pcygnOnZpc2libGUnKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICR0b2FzdEVsZW1lbnQucmVtb3ZlKCk7XG4gICAgICAgICAgICAgICAgJHRvYXN0RWxlbWVudCA9IG51bGw7XG4gICAgICAgICAgICAgICAgaWYgKCRjb250YWluZXIuY2hpbGRyZW4oKS5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgJGNvbnRhaW5lci5yZW1vdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNUb2FzdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSkoKTtcbiAgICB9KTtcbn0odHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kID8gZGVmaW5lIDogZnVuY3Rpb24gKGRlcHMsIGZhY3RvcnkpIHtcbiAgICBpZiAodHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCcgJiYgbW9kdWxlLmV4cG9ydHMpIHsgLy9Ob2RlXG4gICAgICAgIG1vZHVsZS5leHBvcnRzID0gZmFjdG9yeShyZXF1aXJlKCdqcXVlcnknKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgICAgd2luZG93LnRvYXN0ciA9IGZhY3Rvcnkod2luZG93LmpRdWVyeSk7XG4gICAgfVxufSkpO1xuIiwiLy8gICAgIFVuZGVyc2NvcmUuanMgMS44LjNcbi8vICAgICBodHRwOi8vdW5kZXJzY29yZWpzLm9yZ1xuLy8gICAgIChjKSAyMDA5LTIwMTUgSmVyZW15IEFzaGtlbmFzLCBE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dG9yKCRyb3V0ZVByb3ZpZGVyLCByb3V0ZXMpIHtcblxuICAgIHJvdXRlcy5mb3JFYWNoKGZ1bmN0aW9uIChyKSB7XG4gICAgICAgIHNldFJvdXRlKHIudXJsLCByLmNvbmZpZyk7XG4gICAgfSk7XG5cbiAgICAkcm91dGVQcm92aWRlci5vdGhlcndpc2UoeyByZWRpcmVjdFRvOiAnLycgfSk7XG5cbiAgICBmdW5jdGlvbiBzZXRSb3V0ZSh1cmwsIGNvbmZpZykge1xuXG4gICAgICAgICRyb3V0ZVByb3ZpZGVyLndoZW4odXJsLCBjb25maWcpO1xuXG4gICAgICAgIHJldHVybiAkcm91dGVQcm92aWRlcjtcbiAgICB9XG59XG5cbi8vIERlZmluZSB0aGUgcm91dGVzIFxuZnVuY3Rpb24gZ2V0Um91dGVzKCkge1xuICAgIHJldHVybiBbXG4gICAgICAgIHtcbiAgICAgICAgICAgIHVybDogJy8nLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvd2VsY29tZS93ZWxjb21lLmh0bWwnLFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnV2VsY29tZSBQYWdlJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3dlbGNvbWUnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvd2VsY29tZS93ZWxjb21lLmh0bWwnLFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnV2VsY29tZSBQYWdlJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3RocmVhdG1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9yZXBvcy5odG1sJyxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIFJlcG8nLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvOm9yZ2FuaXNhdGlvbi86cmVwbycsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC90aHJlYXRtb2RlbHMvYnJhbmNoZXMuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdDaG9vc2UgYSBCcmFuY2gnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvOm9yZ2FuaXNhdGlvbi86cmVwby86YnJhbmNoJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9tb2RlbHMuaHRtbCcsXG4gICAgICAgICAgICAgICAgdGl0bGU6ICdDaG9vc2UgYSBNb2RlbCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gvOm1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnVGhyZWF0IE1vZGVsIERldGFpbHMnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGhyZWF0bW9kZWxzL3RocmVhdG1vZGVsZGV0YWlsLmh0bWwnLFxuICAgICAgICAgICAgICAgIHNldHRpbmdzOiB7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LCB7XG4gICAgICAgICAgICB1cmw6ICcvdGhyZWF0bW9kZWwvZWRpdC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gvOm1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnRWRpdCBUaHJlYXQgTW9kZWwnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGhyZWF0bW9kZWxzL3RocmVhdG1vZGVsZWRpdC5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3RocmVhdG1vZGVsL3JlcG9ydC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gvOm1vZGVsJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgICAgICAgICAgIHRpdGxlOiAnVGhyZWF0IE1vZGVsIFJlcG9ydCcsXG4gICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICcuL3B1YmxpYy9hcHAvdGhyZWF0bW9kZWxzL3dlYnJlcG9ydC5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL25ldy90aHJlYXRtb2RlbCcsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIFJlcG8gRm9yIFlvdXIgTmV3IE1vZGVsJyxcbiAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJy4vcHVibGljL2FwcC90aHJlYXRtb2RlbHMvcmVwb3MuaHRtbCcsXG4gICAgICAgICAgICAgICAgc2V0dGluZ3M6IHtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIHVybDogJy9uZXcvdGhyZWF0bW9kZWwvOm9yZ2FuaXNhdGlvbi86cmVwbycsXG4gICAgICAgICAgICBjb25maWc6IHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ0Nob29zZSBhIEJyYW5jaCBGb3IgWW91ciBOZXcgTW9kZWwnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnLi9wdWJsaWMvYXBwL3RocmVhdG1vZGVscy9icmFuY2hlcy5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL25ldy90aHJlYXRtb2RlbC86b3JnYW5pc2F0aW9uLzpyZXBvLzpicmFuY2gnLFxuICAgICAgICAgICAgY29uZmlnOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICdDcmVhdGUgYSBOZXcgTW9kZWwnLFxuICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGhyZWF0bW9kZWxzL3RocmVhdG1vZGVsZWRpdC5odG1sJyxcbiAgICAgICAgICAgICAgICBzZXR0aW5nczoge1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwge1xuICAgICAgICAgICAgdXJsOiAnL3RocmVhdG1vZGVsLzpvcmdhbmlzYXRpb24vOnJlcG8vOmJyYW5jaC86bW9kZWwvZGlhZ3JhbS86ZGlhZ3JhbUlkJyxcbiAgICAgICAgICAgIGNvbmZpZzoge1xuICAgICAgIC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Xh0LnJlcG9zKCRsb2NhdGlvbi5zZWFyY2goKS5wYWdlKS50aGVuKFxuICAgICAgICAgICAgZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgdm0ucGFnaW5hdGlvbiA9IHJlc3BvbnNlLmRhdGEucGFnaW5hdGlvbjtcbiAgICAgICAgICAgICAgICB2bS5wYWdpbmF0aW9uLnBhZ2UgPSBwYXJzZUludCh2bS5wYWdpbmF0aW9uLnBhZ2UsIDEwKTtcbiAgICAgICAgICAgICAgICB2bS5yZXBvcyA9IHJlc3BvbnNlLmRhdGEucmVwb3M7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZnVuY3Rpb24gKGVycikge1xuICAgICAgICAgICAgICAgIHZtLnJlcG9zID0gW107XG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xuICAgICAgICAgICAgfVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZ1bmN0aW9uIGdldEJyYW5jaGVzKG9yZ2FuaXNhdGlvbiwgcmVwbykge1xuICAgICAgICByZXR1cm4gZGF0YWNvbnRleHQuYnJhbmNoZXMob3JnYW5pc2F0aW9uLCByZXBvLCAkbG9jYXRpb24uc2VhcmNoKCkucGFnZSkudGhlbihcbiAgICAgICAgICAgIGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIHZtLnBhZ2luYXRpb24gPSByZXNwb25zZS5kYXRhLnBhZ2luYXRpb247XG4gICAgICAgICAgICAgICAgdm0ucGFnaW5hdGlvbi5wYWdlID0gcGFyc2VJbnQodm0ucGFnaW5hdGlvbi5wYWdlLCAxMCk7XG4gICAgICAgICAgICAgICAgdm0uYnJhbmNoZXMgPSByZXNwb25zZS5kYXRhLmJyYW5jaGVzO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGZ1bmN0aW9uIChlcnIpIHtcbiAgICAgICAgICAgICAgICB2bS5icmFuY2hlcyA9IFtdO1xuICAgICAgICAgICAgICAgIG9u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G4gICAgZnVuY3Rpb24gbG9hZERlbW9Nb2RlbCgpIHtcbiAgICAgICAgdmFyIGxvYyA9ICd0aHJlYXRtb2RlbC8nO1xuICAgICAgICBsb2MgKz0gY29tbW9uQ29uZmlnLmNvbmZpZy5kZW1vTW9kZWxMb2NhdGlvbi5vcmdhbmlzYXRpb24gKyAnLyc7XG4gICAgICAgIGxvYyArPSBjb21tb25Db25maWcuY29uZmlnLmRlbW9Nb2RlbExvY2F0aW9uLnJlcG8gKyAnLyc7XG4gICAgICAgIGxvYyArPSBjb21tb25Db25maWcuY29uZmlnLmRlbW9Nb2RlbExvY2F0aW9uLmJyYW5jaCArICcvJztcbiAgICAgICAgbG9jICs9IGNvbW1vbkNvbmZpZy5jb25maWcuZGVtb01vZGVsTG9jYXRpb24ubW9kZWw7XG4gICAgICAgICRsb2NhdGlvbi5wYXRoKGxvYyk7XG4gICAgfVxufVxuXG5tb2R1bGUuZXhwb3J0cyA9IHdlbGNvbWU7Il19 diff --git a/td.site/app/threatdragon.js.map b/td.site/app/threatdragon.js.map new file mode 100644 index 000000000..c136855da --- /dev/null +++ b/td.site/app/threatdragon.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["node_modules/browser-pack/_prelude.js","node_modules/angular-animate/angular-animate.js","node_modules/angular-animate/index.js","node_modules/angular-route/angular-route.js","node_modules/angular-route/index.js","node_modules/angular-ui-bootstrap/dist/ui-bootstrap-tpls.js","node_modules/angular-ui-bootstrap/index.js","node_modules/angular-xeditable/dist/js/xeditable.js","node_modules/angular-xeditable/index.js","node_modules/angular/angular.js","node_modules/angular/index.js","node_modules/backbone/backbone.js","node_modules/base64-js/index.js","node_modules/bootstrap/dist/js/npm.js","node_modules/bootstrap/js/affix.js","node_modules/bootstrap/js/alert.js","node_modules/bootstrap/js/button.js","node_modules/bootstrap/js/carousel.js","node_modules/bootstrap/js/collapse.js","node_modules/bootstrap/js/dropdown.js","node_modules/bootstrap/js/modal.js","node_modules/bootstrap/js/popover.js","node_modules/bootstrap/js/scrollspy.js","node_modules/bootstrap/js/tab.js","node_modules/bootstrap/js/tooltip.js","node_modules/bootstrap/js/transition.js","node_modules/brackets2dots/index.js","node_modules/buffer/index.js","node_modules/clone/clone.js","node_modules/curriable/dist/curriable.js","node_modules/curry2/index.js","node_modules/dagre/index.js","node_modules/dagre/lib/acyclic.js","node_modules/dagre/lib/add-border-segments.js","node_modules/dagre/lib/coordinate-system.js","node_modules/dagre/lib/data/list.js","node_modules/dagre/lib/debug.js","node_modules/dagre/lib/graphlib.js","node_modules/dagre/lib/greedy-fas.js","node_modules/dagre/lib/layout.js","node_modules/dagre/lib/lodash.js","node_modules/dagre/lib/nesting-graph.js","node_modules/dagre/lib/normalize.js","node_modules/dagre/lib/order/add-subgraph-constraints.js","node_modules/dagre/lib/order/barycenter.js","node_modules/dagre/lib/order/build-layer-graph.js","node_modules/dagre/lib/order/cross-count.js","node_modules/dagre/lib/order/index.js","node_modules/dagre/lib/order/init-order.js","node_modules/dagre/lib/order/resolve-conflicts.js","node_modules/dagre/lib/order/sort-subgraph.js","node_modules/dagre/lib/order/sort.js","node_modules/dagre/lib/parent-dummy-chains.js","node_modules/dagre/lib/position/bk.js","node_modules/dagre/lib/position/index.js","node_modules/dagre/lib/rank/feasible-tree.js","node_modules/dagre/lib/rank/index.js","node_modules/dagre/lib/rank/network-simplex.js","node_modules/dagre/lib/rank/util.js","node_modules/dagre/lib/util.js","node_modules/dagre/lib/version.js","node_modules/dotsplit.js/index.js","node_modules/events/events.js","node_modules/fast-bind/bind-loop.js","node_modules/graphlib/index.js","node_modules/graphlib/lib/alg/components.js","node_modules/graphlib/lib/alg/dfs.js","node_modules/graphlib/lib/alg/dijkstra-all.js","node_modules/graphlib/lib/alg/dijkstra.js","node_modules/graphlib/lib/alg/find-cycles.js","node_modules/graphlib/lib/alg/floyd-warshall.js","node_modules/graphlib/lib/alg/index.js","node_modules/graphlib/lib/alg/is-acyclic.js","node_modules/graphlib/lib/alg/postorder.js","node_modules/graphlib/lib/alg/preorder.js","node_modules/graphlib/lib/alg/prim.js","node_modules/graphlib/lib/alg/tarjan.js","node_modules/graphlib/lib/alg/topsort.js","node_modules/graphlib/lib/data/priority-queue.js","node_modules/graphlib/lib/graph.js","node_modules/graphlib/lib/index.js","node_modules/graphlib/lib/json.js","node_modules/graphlib/lib/version.js","node_modules/hash-it/lib/constants.js","node_modules/hash-it/lib/index.js","node_modules/hash-it/lib/utils.js","node_modules/hotkeys-js/dist/hotkeys.common.js","node_modules/hotkeys-js/dist/hotkeys.common.min.js","node_modules/hotkeys-js/index.js","node_modules/ieee754/index.js","node_modules/jointjs/dist/joint.min.js","node_modules/jointjs/node_modules/jquery/dist/jquery.js","node_modules/jointjs/node_modules/lodash/lodash.js","node_modules/jquery/dist/jquery.js","node_modules/json-rules-engine/dist/almanac.js","node_modules/json-rules-engine/dist/condition.js","node_modules/json-rules-engine/dist/debug.js","node_modules/json-rules-engine/dist/engine-default-operators.js","node_modules/json-rules-engine/dist/engine-facts.js","node_modules/json-rules-engine/dist/engine.js","node_modules/json-rules-engine/dist/errors.js","node_modules/json-rules-engine/dist/fact.js","node_modules/json-rules-engine/dist/index.js","node_modules/json-rules-engine/dist/json-rules-engine.js","node_modules/json-rules-engine/dist/operator.js","node_modules/json-rules-engine/dist/rule-result.js","node_modules/json-rules-engine/dist/rule.js","node_modules/lodash.isobjectlike/index.js","node_modules/lodash/lodash.js","node_modules/owasp-threat-dragon-core/node_modules/angular-route/angular-route.js","node_modules/owasp-threat-dragon-core/src/common/common.js","node_modules/owasp-threat-dragon-core/src/common/index.js","node_modules/owasp-threat-dragon-core/src/common/logger.js","node_modules/owasp-threat-dragon-core/src/config.js","node_modules/owasp-threat-dragon-core/src/diagrams/diagram.js","node_modules/owasp-threat-dragon-core/src/diagrams/diagramdirectives.js","node_modules/owasp-threat-dragon-core/src/diagrams/elementpropdirectives.js","node_modules/owasp-threat-dragon-core/src/diagrams/index.js","node_modules/owasp-threat-dragon-core/src/index.js","node_modules/owasp-threat-dragon-core/src/layout/directives.js","node_modules/owasp-threat-dragon-core/src/layout/index.js","node_modules/owasp-threat-dragon-core/src/services/diagramming.js","node_modules/owasp-threat-dragon-core/src/services/dialogControllers.js","node_modules/owasp-threat-dragon-core/src/services/dialogs.js","node_modules/owasp-threat-dragon-core/src/services/index.js","node_modules/owasp-threat-dragon-core/src/services/joint.shapes.tm.js","node_modules/owasp-threat-dragon-core/src/services/routemediator.js","node_modules/owasp-threat-dragon-core/src/services/threatengine.js","node_modules/owasp-threat-dragon-core/src/templates.js","node_modules/owasp-threat-dragon-core/src/threatmodels/index.js","node_modules/owasp-threat-dragon-core/src/threatmodels/threatmodel.js","node_modules/owasp-threat-dragon-core/src/threatmodels/threatmodeldirectives.js","node_modules/process/browser.js","node_modules/selectn/index.js","node_modules/selectn/node_modules/debug/src/browser.js","node_modules/selectn/node_modules/debug/src/debug.js","node_modules/selectn/node_modules/ms/index.js","node_modules/toastr/toastr.js","node_modules/underscore/underscore.js","td.site/app/app.js","td.site/app/config.route.js","td.site/app/layout/index.js","td.site/app/layout/shell.js","td.site/app/services/datacontext.js","td.site/app/services/index.js","td.site/app/services/threatmodellocator.js","td.site/app/threatmodels/github.js","td.site/app/threatmodels/index.js","td.site/app/threatmodels/webreport.js","td.site/app/welcome/index.js","td.site/app/welcome/welcome.js"],"names":["window","angular","assertArg","arg","name","reason","ngMinErr","mergeClasses","a","b","isArray","join","packageStyles","options","styles","to","from","pendClasses","classes","fix","isPrefix","className","isString","length","split","forEach","klass","i","removeFromArray","arr","val","index","indexOf","splice","stripCommentsFromElement","element","jqLite","nodeType","ELEMENT_NODE","extractElementNode","elm","$$addClass","$$jqLite","addClass","$$removeClass","removeClass","applyAnimationClassesFactory","prepareAnimationOptions","$$prepared","domOperation","noop","$$domOperationFired","applyAnimationStyles","applyAnimationFromStyles","applyAnimationToStyles","css","mergeAnimationDetails","oldAnimation","newAnimation","target","newOptions","toAdd","toRemove","resolveElementClasses","attr","preparationClasses","concatWithSpace","realDomOperation","extend","existing","splitClassesToLookup","obj","flags","value","key","prop","allow","REMOVE_CLASS_SUFFIX","ADD_CLASS_SUFFIX","getDomNode","applyGeneratedPreparationClasses","event","EVENT_CLASS_PREFIX","clearGeneratedClasses","activeClasses","blockKeyframeAnimations","node","applyBlock","ANIMATION_PROP","ANIMATION_PLAYSTATE_KEY","applyInlineStyle","styleTuple","style","getCssKeyframeDurationStyle","duration","ANIMATION_DURATION_PROP","getCssDelayStyle","delay","isKeyframeAnimation","ANIMATION_DELAY_PROP","TRANSITION_DELAY_PROP","computeCssStyles","$window","properties","Object","create","detectedStyles","getComputedStyle","formalStyleName","actualStyleName","c","charAt","parseMaxTime","str","maxValue","values","substring","parseFloat","Math","max","truthyTimingValue","getCssTransitionDurationStyle","applyOnlyDuration","TRANSITION_PROP","DURATION_KEY","registerRestorableStyles","backup","isDefined","getPropertyValue","TRANSITIONEND_EVENT","ANIMATIONEND_EVENT","NG_ANIMATE_CLASSNAME","NG_ANIMATE_CHILDREN_DATA","undefined","ontransitionend","onwebkittransitionend","onanimationend","onwebkitanimationend","copy","isElement","isFunction","isObject","isUndefined","TIMING_KEY","TRANSITION_DURATION_PROP","$$minErr","helpers","blockTransitions","$$rAFSchedulerFactory","$$rAF","scheduler","tasks","queue","concat","nextTick","items","shift","cancelFn","waitUntilQuiet","fn","$$AnimateChildrenDirective","$interpolate","link","scope","attrs","setData","data","ngAnimateChildren","$observe","ANIMATE_TIMER_KEY","ONE_SECOND","ELAPSED_TIME_MAX_DECIMAL_PLACES","CLOSING_TIME_BUFFER","DETECT_CSS_PROPERTIES","transitionDuration","transitionDelay","transitionProperty","animationDuration","animationDelay","animationIterationCount","DETECT_STAGGER_CSS_PROPERTIES","$AnimateCssProvider","$animateProvider","this","$get","$$AnimateRunner","$timeout","$$animateCache","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue","computeCachedCssStyles","cacheKey","allowNoDuration","timings","get","hasDuration","put","computeCachedCssStaggerStyles","stagger","staggerCacheKey","count","staggerClassName","callback","rafWaitQueue","push","flush","pageWidth","computeTimings","aD","tD","maxDelay","maxDuration","applyAnimationClasses","initialOptions","endFn","close","rejected","animationClosed","animationCompleted","animationPaused","$$skipPreparationClasses","temporaryStyles","entry","keys","restoreStyles","setProperty","removeProperty","onDone","events","off","onAnimationProgress","animationTimerData","cancel","timer","removeData","runner","complete","applyBlocking","blockTransition","blockKeyframeAnimation","closeAndReturnNoopAnimator","end","$$willAnimate","start","stopPropagation","ev","originalEvent","timeStamp","$manualTimeStamp","Date","now","elapsedTime","toFixed","startTime","maxDelayTime","triggerAnimationStart","recalculateTimingStyles","fullClassName","getAttribute","method","relativeDelay","hasTransitions","hasAnimations","applyAnimationDelay","delayStyle","maxDurationTime","easing","easeProp","easeVal","timerTime","endTime","animationsData","setupFallbackTimer","currentTimerData","expectedEndTime","onAnimationExpired","on","cleanupStyles","parentNode","playPause","playAnimation","maxStagger","itemIndex","floor","runnerHost","resume","pause","enabled","animations","transitions","isStructural","structural","structuralClassName","addRemoveClassName","applyClassesEarly","trim","hasToStyles","keyframeStyle","containsCachedAnimationWithoutDuration","staggerVal","transitionStyle","durationStyle","staggerIndex","isFirst","skipBlocking","hasTransitionAll","applyTransitionDuration","applyAnimationDuration","applyTransitionDelay","$$AnimateCssDriverProvider","$$animationProvider","isDocumentFragment","drivers","NG_ANIMATE_SHIM_CLASS_NAME","NG_OUT_ANCHOR_CLASS_NAME","$animateCss","$rootScope","$rootElement","$document","filterCssClasses","replace","getUniqueValues","filter","prepareAnchoredAnimation","outAnchor","inAnchor","calculateAnchorStyles","anchor","coords","getBoundingClientRect","bodyNode","scrollTop","scrollLeft","getClassVal","prepareInAnimation","endingClasses","startingClasses","animator","clone","NG_IN_ANCHOR_CLASS_NAME","remove","cloneNode","rootBodyElement","append","animatorIn","animatorOut","startingAnimator","currentAnimation","done","prepareFromToAnchorAnimation","anchors","fromAnimation","prepareRegularAnimation","toAnimation","anchorAnimations","outElement","inElement","animationRunners","animation","all","status","animationDetails","body","rootNode","contains","$$AnimateJsProvider","$injector","lookupAnimations","matches","flagMap","animationFactory","$$registeredAnimations","applyOptions","executeAnimationFn","args","classesToAdd","classesToRemove","apply","groupEventedAnimations","fnName","operations","ani","endProgressCb","resolved","onAnimationComplete","result","packageAnimations","runners","animateFn","reject","arguments","before","after","afterFn","beforeFn","toUpperCase","substr","onComplete","success","endAnimations","cancelled","closeActiveAnimations","chain","setHost","$$AnimateJsDriverProvider","$$animateJs","prepareAnimation","endFnFactory","NG_ANIMATE_ATTR_NAME","NG_ANIMATE_PIN_DATA","$$AnimateQueueProvider","getEventData","makeTruthyCssClassMap","classString","ONE_SPACE","map","hasMatchingClasses","newClassString","currentClassString","currentClassMap","some","isAllowed","ruleType","previousAnimation","rules","hasAnimationClasses","and","PRE_DIGEST_STATE","RUNNING_STATE","skip","state","nA","nR","cA","cR","$$Map","$$animation","$templateRequest","$$isDocumentHidden","removeFromDisabledElementsLookup","evt","disabledElementsLookup","delete","postDigestTaskFactory","postDigestCalled","$$postDigest","normalizeAnimationDetails","findCallbacks","targetParentNode","targetNode","entries","callbackRegistry","call","filterFromRegistry","list","matchContainer","matchCallback","containerNode","cleanupEventListeners","phase","$animate","queueAnimation","originalElement","notifyProgress","runInNextPostDigestOrNow","callbacks","progress","animationsEnabled","isAnimatableByFilter","isAnimatableClassName","documentHidden","skipAnimations","existingAnimation","activeAnimationsLookup","hasExistingAnimation","areAnimationsAllowed","closeChildAnimations","isValidAnimation","clearElementAnimationState","counter","markElementAnimationState","animationCancelled","parentElement","parent","realRunner","children","querySelectorAll","child","parseInt","removeAttribute","animateChildren","bodyNodeDetected","nodeName","rootNodeDetected","parentAnimationDetected","elementDisabled","parentHost","details","parentNodeDisabled","setAttribute","oldValue","newValue","set","deregisterWatch","$watch","totalPendingRequests","isEmpty","customFilter","classNameFilter","returnTrue","test","Node","prototype","compareDocumentPosition","container","eventType","pin","bool","argCount","has","$$AnimateCacheProvider","KEY","parentCounter","cache","parentID","parts","isValid","total","$$AnimationProvider","setRunner","RUNNER_STORAGE_KEY","removeRunner","getRunner","NG_ANIMATE_REF_ATTR","PREPARE_CLASSES_KEY","sortAnimations","processNode","processed","elementNode","domNode","lookup","parentEntry","tree","remainingLevelEntries","nextLevelEntries","row","childEntry","animationQueue","getAnchorNodes","SELECTOR","hasAttribute","groupAnimations","preparedAnimations","refLookup","enterOrMove","anchorNodes","direction","animationID","usedIndicesLookup","anchorGroups","indexKey","toString","lookupKey","group","beforeStart","cssClassesIntersection","out","in","aa","j","invokeFirstDriver","driverName","factory","driver","tempClasses","prepareClassName","updateAnimationRunners","newRunner","update","handleDestroyedElement","groupedAnimations","toBeSortedAnimations","animationEntry","extraClasses","startAnimationFn","closeFn","operation","animationRunner","finalAnimations","innerArray","ngAnimateSwapDirective","restrict","transclude","terminal","priority","$element","ctrl","$transclude","previousElement","previousScope","$watchCollection","ngAnimateSwap","leave","$destroy","childScope","enter","module","info","angularVersion","directive","provider","require","exports","shallowCopy","src","dst","ii","routeToRegExp","path","opts","pattern","_","slash","option","optional","star","ignoreTrailingSlashes","regexp","RegExp","caseInsensitiveMatch","$RouteProvider","inherit","extra","routes","when","route","routeCopy","reloadOnUrl","reloadOnSearch","originalPath","redirectPath","redirectTo","otherwise","params","isEagerInstantiationEnabled","eagerInstantiationEnabled","$location","$routeParams","$q","$sce","$browser","switchRouteMatcher","m","exec","len","prepareRoute","$locationEvent","lastRoute","$route","current","preparedRoute","parseRoute","preparedRouteIsUpdateOnly","isNavigationUpdateOnly","$broadcast","defaultPrevented","preventDefault","commitRoute","nextRoute","forceReload","nextRoutePromise","resolve","$$incOutstandingRequestCount","then","getRedirectionData","handlePossibleRedirection","keepProcessingRoute","resolveLocals","locals","catch","error","finally","$$completeOutstandingRequest","hasRedirection","interpolate","search","oldPath","oldSearch","newUrl","pathParams","url","resolveRedirectTo","invoke","oldUrl","template","getTemplateFor","templateUrl","loadedTemplateUrl","valueOf","match","$$route","newRoute","oldRoute","equals","string","segment","segmentMatch","reload","fakeLocationEvent","$evalAsync","updateParams","newParams","$routeMinErr","$on","instantiateRoute","$RouteParamsProvider","ngViewFactory","$anchorScroll","cleanupLastView","previousLeaveAnimation","currentScope","currentElement","response","$template","newScope","$new","autoScrollExp","$eval","$emit","onloadExp","autoscroll","onload","ngViewFillContentFactory","$compile","$controller","html","contents","controller","$scope","controllerAs","resolveAs","ngRouteModule","run","$inject","$parse","getScrollFromElement","horizontal","width","scrollWidth","height","scrollHeight","expand","hasClass","expandingExpr","overflow","expandDone","expandedExpr","collapse","collapseDone","collapsingExpr","cssTo","collapsedExpr","expanding","expanded","collapsing","collapsed","uibCollapse","shouldCollapse","elem","disabled","$set","constant","closeOthers","$attrs","accordionConfig","groups","openGroup","isOpen","addGroup","groupScope","that","removeGroup","heading","panelClass","isDisabled","setHeading","accordionCtrl","openClass","toggleClass","toggleOpen","$event","which","id","$id","random","headingId","panelId","accordionGroupCtrl","uibAccordionTransclude","querySelector","closeable","dismissOnTimeout","$parent","activeClass","toggleEvent","buttonConfig","ctrls","buttonsCtrl","ngModelCtrl","uncheckableExpr","uibUncheckable","find","display","$render","$modelValue","uibBtnRadio","isActive","uncheckable","$apply","$setViewValue","getTrueValue","getCheckboxValue","btnCheckboxTrue","getFalseValue","btnCheckboxFalse","attribute","defaultValue","$interval","setActive","slides","slide","active","goNext","destroyed","currentIndex","$currentTransition","self","SLIDE_DIRECTION","currentIdx","getCurrentIndex","isNumber","restartTimer","findSlideIndex","resetTimer","currentInterval","resetTransition","interval","isNaN","timerFn","isPlaying","next","addSlide","sort","select","play","newIndex","noWrap","prev","removeSlide","nextSlide","nextIndex","indexOfSlide","isPrevDisabled","isNextDisabled","noPause","noTransition","actual","carouselCtrl","beforeAddClass","stopped","directionClass","removeClassFn","bind","beforeRemoveClass","service","$log","$locale","dateFilter","orderByFilter","filterFilter","getFormatCodeToRegex","formatCodeToRegex","createParser","format","regex","quoteIndex","inLiteral","n","matcher","createFormatter","formatter","literalIdx","formatters","constructLiteralFormatter","constructFormatterFromIdx","endIdx","parser","currentPosStr","year","month","date","toInt","toTimezone","timezone","convertTimezoneToLocal","fromTimezone","timezoneToOffset","fallback","requestedTimezoneOffset","parse","addDateMinutes","minutes","getTime","setMinutes","getMinutes","reverse","dateTimezoneOffset","getTimezoneOffset","localeId","SPECIAL_CHARACTERS_REGEXP","init","parsers","_date","setFullYear","abs","getFullYear","getMonth","DATETIME_FORMATS","MONTH","SHORTMONTH","getDate","DAY","SHORTDAY","hours","milliseconds","seconds","AMPMS","sign","ERANAMES","ERAS","version","major","minor","STANDALONEMONTH","getParser","f","overrideParser","isDate","reduce","input","baseDate","results","tzOffset","fields","dt","getHours","getSeconds","getMilliseconds","warn","mapper","datesetter","setUTCFullYear","timesetter","setUTCHours","setHours","ON_REGEXP","IS_REGEXP","compile","tElement","tAttrs","linkFn","linkedScopes","instances","exps","exp","k","addForExp","removeScope","clazz","compareWithExp","expToData","watchFn","compareWithVal","newActivated","instance","onExp","lastActivated","watcher","e","removedScope","targetScope","newWatchScope","onExpMatches","uibIsClass","expsStr","datepickerMode","formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","maxDate","maxMode","minDate","minMode","monthColumns","ngModelOptions","shortcutPropagation","showWeeks","yearColumns","yearRows","datepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","dateParser","setMode","mode","datepickerOptions","extractOptions","$options","getOption","createChild","watchListeners","modes","startingDay","FIRSTDAYOFWEEK","refreshView","uniqueId","ngDisabled","dateObject","compare","activeDate","activeDateId","uid","ngModelCtrl_","initDate","$isEmpty","$invalid","render","$viewValue","selectedDt","_refreshView","activeDt","$setValidity","createDateObject","model","today","time","label","selected","past","future","customClass","dateDisabled","size","arrays","move","step","years","months","toggleMode","13","32","33","34","35","36","37","38","39","40","focusElement","focus","keydown","shiftKey","altKey","ctrlKey","handleKeyDown","getDaysInMonth","DAYS_IN_MONTH","getISO8601WeekNumber","checkDate","setDate","getDay","setMonth","round","getDates","startDate","dates","Array","firstDayOfMonth","difference","numDisplayedFromPreviousMonth","firstDate","days","secondary","labels","abbr","full","title","rows","weekNumbers","thursdayIndex","numWeeks","curWeek","date1","date2","_date1","_date2","min","yearHeaderColspan","getStartingYear","range","columns","yearpickerInit","datepickerCtrl","SCROLLBAR_WIDTH","BODY_SCROLLBAR_WIDTH","OVERFLOW_REGEX","normal","hidden","PLACEMENT_REGEX","auto","primary","vertical","BODY_REGEX","getRawNode","parseStyle","isFinite","offsetParent","documentElement","el","position","scrollbarWidth","isBody","bodyElem","innerWidth","clientWidth","scrollElem","offsetWidth","scrollbarPadding","elemStyle","paddingRight","paddingBottom","scrollParent","tagName","widthOverflow","right","originalRight","heightOverflow","clientHeight","bottom","originalBottom","isScrollable","includeHidden","overflowRegex","overflowY","overflowX","includeSelf","documentEl","excludeStatic","spStyle","includeMagins","elemOffset","offset","top","marginTop","left","marginLeft","parentOffset","clientTop","clientLeft","offsetHeight","elemBCR","pageYOffset","pageXOffset","viewportOffset","useDocument","includePadding","offsetBCR","offsetParentBCR","offsetParentStyle","paddingTop","paddingLeft","parsePlacement","placement","autoPlace","positionElements","hostElem","targetElem","appendToBody","targetWidth","targetHeight","hostElemPos","targetElemPos","targetElemStyle","adjustedSize","marginRight","marginBottom","xOverflow","yOverflow","adjustTop","placementClasses","containerPosition","initialHeight","currentHeight","positionArrow","innerElem","isTooltip","arrowElem","arrowCss","borderProp","borderWidth","borderRadiusProp","borderRadius","altInputFormats","clearText","closeOnDateSelection","closeText","currentText","datepickerPopup","datepickerPopupTemplateUrl","datepickerTemplateUrl","html5Types","datetime-local","onOpenFocus","showButtonBar","$position","datepickerPopupConfig","$datepickerPopupLiteralWarning","parseDateString","viewValue","dateFormat","parseDate","validator","modelValue","ngRequired","documentClickBind","popup","$popup","dpContainsTarget","popupContainsTarget","inputKeydownBind","positionPopup","dpElement","popupPlacement","popupEl","datepickerEl","scrollParentEl","ngModel","isHtml5DateInput","_ngModel_","datepickerAppendToBody","type","uibDatepickerPopup","newDateFormat","Error","ng-model","ng-change","template-url","$formatters","$$parserName","$validators","$parsers","unshift","$viewChangeListeners","$$phase","getText","dateSelection","debounceTime","timeoutPromise","slice","createNew","hasKey","idx","appendToOpenClass","$$multiMap","openScope","openedContainers","isOnlyOpen","dropdownScope","appendTo","openedDropdowns","toClose","dropdown","open","closeDropdown","keybindFilter","dropdownToClose","getAutoClose","toggleElement","getToggleElement","dropdownElement","getDropdownElement","focusToggleElement","dropdownElementTargeted","toggleElementTargeted","isKeynavEnabled","focusDropdownEntry","dropdownConfig","uibDropdownService","removeDropdownMenu","dropdownMenu","templateScope","getIsOpen","setIsOpen","toggleInvoker","onToggle","keynavEnabled","assign","keyboardNav","toggle","autoClose","getElement","keyCode","elems","eq","selectedOption","wasOpen","dropdownAppendTo","appendToEl","dropdownAppendToBody","rightalign","pos","appendOffset","openContainer","dropdownOpenClass","hasOpenClass","dropdownMenuTemplateUrl","tplContent","newEl","replaceWith","dropdownCtrl","dropdownNested","tplUrl","toggleDropdown","aria-haspopup","aria-expanded","stack","add","removeTop","pop","resolver","setResolver","invocables","promises","resolves","resolveObj","resolveIter","$modalStack","modalInClass","NOW_CLOSING_EVENT","setIsAsync","modalOptions","backdropClass","windowTopClass","modal","getTop","backdrop","currentTarget","dismiss","$isRendered","modalRenderDeferObj","defer","promise","animationPromise","modalRendered","activeElement","inputWithAutofocus","modalAnimation","uibModalAnimationClass","empty","$$stackedMap","$uibPosition","snake_case","SNAKE_CASE_REGEXP","letter","toLowerCase","isVisible","getClientRects","backdropIndex","topBackdropIndex","opened","openedWindows","topModalIndex","removeModalWindow","modalInstance","elementToReceiveFocus","modalWindow","appendToElement","previousTopOpenedModal","modalDomEl","removeAfterAnimate","modalScope","modalBodyClass","openedClass","OPENED_MODAL_CLASS","openedClasses","areAnyOpen","toggleTopWindowClass","closedDeferred","checkRemoveBackdrop","toggleSwitch","backdropDomEl","backdropScopeRef","backdropScope","domEl","afterAnimating","asyncDeferred","asyncPromise","keydownListener","isDefaultPrevented","keyboard","loadFocusElementList","focusChanged","isFocusInFirstItem","isModalFocused","focusLastFocusableElement","isFocusInLastItem","focusFirstFocusableElement","broadcastClosing","resultOrReason","closing","unhideBackgroundElements","document","ARIA_HIDDEN_ATTRIBUTE_NAME","hiddenEl","ariaHiddenCount","newHiddenCount","newBackdropIndex","applyAriaHidden","sibling","elemIsAlreadyHidden","modalOpener","deferred","renderDeferred","currBackdropIndex","class","ng-style","uib-modal-animation-class","modal-in-class","content","component","createElement","modal-instance","angularDomEl","windowTemplateUrl","window-top-class","role","aria-labelledby","ariaLabelledBy","aria-describedby","ariaDescribedBy","animate","tabindex","windowClass","$$topModalIndex","$$uibDestructionScheduled","dismissAll","topModal","srcElement","modalDomE1","elements","$modalProvider","$uibResolve","getTemplatePromise","$modal","promiseChain","getPromiseChain","resolveWithTemplate","templateAndResolvePromise","modalResultDeferred","modalOpenedDeferred","modalClosedDeferred","modalRenderDeferred","closed","rendered","samePromise","tplAndVars","constructLocals","instanceOnScope","injectable","$resolve","$uibModalInstance","providedScope","$close","$dismiss","ctrlInstance","ctrlInstantiate","ctrlLocals","bindToController","$onInit","setNumPages","numPages","_watchers","config","itemsPerPage","totalPages","calculateTotalPages","updatePage","newTotal","oldTotal","ceil","totalItems","page","selectPage","blur","noPrevious","noNext","uibPaging","uibPagerConfig","align","previousText","nextText","paginationCtrl","uibPaginationConfig","makePage","number","text","getPages","currentPage","pages","startPage","endPage","isMaxSized","maxSize","rotate","pageLabel","forceEllipses","boundaryLinkNumbers","previousPageSet","secondPageLink","firstPageLink","nextPageSet","secondToLastPageLink","lastPageLink","$page","identity","boundaryLinks","directionLinks","originalRender","firstText","lastText","defaultOptions","placementClassPrefix","popupDelay","popupCloseDelay","useContentExp","triggerMap","mouseenter","click","outsideClick","none","globalOptions","setTriggers","triggers","keypressListener","last","openedTooltips","ttType","prefix","defaultTriggerShow","getTriggers","trigger","show","hide","directiveName","startSym","startSymbol","endSym","endSymbol","tElem","tooltipLinker","tooltipCtrl","toggleTooltipBind","ttScope","hideTooltipBind","showTooltipBind","hasEnableExp","cancelHide","prepareTooltip","showTimeout","cancelShow","hideTimeout","createTooltip","assignIsOpen","positionTooltip","positionTimeout","transitionTimeout","removeTooltip","tooltip","tooltipLinkedScope","prepObservers","unregisterObservers","adjustmentTimeout","contentParse","popupClass","lastPlacement","closeDelay","isOpenParse","observers","repositionScheduled","observer","bodyHideTooltipBind","hideOnEscapeKey","ttPosition","elementPos","adjustment","origScope","contentExp","unregisterTriggers","showTriggers","hideTriggers","appendToBodyVal","appendKey","tooltipTemplateTranscludeScope","changeCounter","cleanupLastIncludeContent","parseAsResourceUrl","uibTooltipTemplateTransclude","thisChangeId","tooltipAnimationClass","$uibTooltip","originScope","uibTitle","progressConfig","getMaxOrDefault","maxParam","bars","addBar","bar","transition","recalculatePercentage","totalPercentage","percent","removeBar","progressCtrl","stateOn","stateOff","enableReset","titles","ratingConfig","tmpTitles","ratingStates","buildTemplateObjects","states","getTitle","rate","readonly","newViewValue","onHover","reset","onLeave","onKeydown","ratingCtrl","findTabIndex","tabs","oldIndex","previousIndex","previousSelected","tab","onDeselect","$selectedIndex","onSelect","addTab","t1","t2","newActiveIndex","removeTab","newActiveTabIndex","justified","tabsetCtrl","disable","t","$transcludeFn","isTabHeading","uibTabContentTransclude","headingElement","hourStep","minuteStep","secondStep","showMeridian","showSeconds","meridians","readonlyInput","mousewheel","arrowkeys","showSpinners","timepickerConfig","getHoursFromTemplate","meridian","getMinutesFromTemplate","getSecondsFromTemplate","pad","noPad","refresh","keyboardChange","makeValid","updateTemplate","hoursModelCtrl","minutesModelCtrl","secondsModelCtrl","invalidHours","invalidMinutes","invalidSeconds","padHours","addSecondsToSelected","addSeconds","addMinutes","newDate","modelIsEmpty","watchers","removeAttr","inputs","hoursInputEl","minutesInputEl","secondsInputEl","setupMousewheelEvents","setupArrowkeyEvents","setupInputEvents","noIncrementHours","incrementedSelected","noDecrementHours","decrementedSelected","noIncrementMinutes","noDecrementMinutes","noIncrementSeconds","noDecrementSeconds","noToggleMeridian","$error","isScrollingUp","delta","wheelDelta","deltaY","detail","incrementHours","decrementHours","incrementMinutes","decrementMinutes","incrementSeconds","decrementSeconds","updateHours","updateMinutes","updateSeconds","invalidate","$setDirty","$setTouched","setSeconds","toggleMeridian","uibTimepickerConfig","timepickerCtrl","TYPEAHEAD_REGEXP","itemName","source","viewMapper","modelMapper","originalScope","$$debounce","typeaheadParser","fireRecalculating","moveInProgress","$digest","debouncedRecalculate","recalculatePosition","modelCtrl","HOT_KEYS","minLength","typeaheadMinLength","newVal","waitTime","typeaheadWaitMs","isEditable","typeaheadEditable","hasFocus","isLoadingSetter","typeaheadLoading","isSelectEvent","typeaheadShouldSelect","vals","onSelectCallback","typeaheadOnSelect","isSelectOnBlur","typeaheadSelectOnBlur","isNoResultsSetter","typeaheadNoResults","inputFormatter","typeaheadInputFormatter","typeaheadAppendToBody","typeaheadAppendTo","focusFirst","typeaheadFocusFirst","selectOnExact","typeaheadSelectOnExact","isOpenSetter","typeaheadIsOpen","showHint","typeaheadShowHint","parsedModel","invokeModelSetter","$setModelValue","$$$p","parserResult","uibTypeahead","offDestroy","popupId","aria-autocomplete","aria-owns","inputsContainer","hintInputElem","border-color","box-shadow","opacity","background","color","vertical-align","background-color","popUpEl","move-in-progress","query","assign-is-open","debounce","typeaheadTemplateUrl","typeaheadPopupTemplateUrl","resetHint","resetMatches","activeIdx","getMatchId","inputIsExactMatch","inputValue","getMatchesAsync","onCurrentRequest","debounceUpdate","firstLabel","scheduleSearchWithTimeout","cancelPreviousTimeout","item","$item","$model","$label","typeaheadFocusOnSelect","shouldSelect","offsetTop","editable","dismissClickHandler","_modelCtrl","candidateViewValue","emptyViewValue","popupTemplateUrl","isDropdownOpen","matchIdx","selectActive","selectMatch","tplEl","escapeRegexp","queryToEscape","containsHtml","matchItem","isSanitizePresent","trustAsHtml","$templateCache","$$csp","noInlineStyle","$$uibCarouselCss","prepend","$$uibDatepickerCss","$$uibPositionCss","$$uibDatepickerpopupCss","$$uibTooltipCss","$$uibTimepickerCss","$$uibTypeaheadCss","theme","icon_set","buttons","blurElem","blurForm","activate","activationEvent","submitButtonTitle","submitButtonAriaLabel","cancelButtonTitle","cancelButtonAriaLabel","clearButtonTitle","clearButtonAriaLabel","displayClearButton","editableDirectiveFactory","uibDatepickerConfig","uibDatepickerPopupConfig","popupAttrNames","dateOptionsNames","inputTpl","inputDatePicker","eDatepickerPopupXEditable","eYearRange","eReadonly","popupAttr","eNgChange","inputEl","eStyle","dateOptions","eMaxDate","eMinDate","eShowWeeks","eStartingDay","eInitDate","eDatepickerOptions","z","doAttr","eShowCalendarButton","buttonDatePicker","calendarButtonClass","calendar","buttonWrapper","buttonGroupAppendClass","eNgClick","autosubmit","setTimeout","$form","$submit","editorEl","div","wrap","eTitle","editableNgOptionsParser","useCopy","parsed","eNgOptions","ngChangeHtml","ngChecklistComparatorHtml","eChecklistComparator","eNgDisabled","ngRepeat","valueFn","displayFn","editableCombodate","$data","attrName","combodate","getInstance","$widget","getValue","moment","toDate","toISOString","change","camelCase","dashDelimitedString","word","types","eInputgroupleft","eInputgroupright","inputGroupLeft","inputGroupRight","eLabel","eFormclass","editableUtils","dir","rename","$autoCompleteElement","linkOrg","autoCompleteEl","ngNameHtml","ngValueFn","eName","ePlaceholder","placeholder","hasOwnProperty","addListeners","single","submitOnEnter","metaKey","eUiDate","$matchElement","$choicesElement","matchEl","choicesEl","EditableController","editableThemes","editableIcons","editableOptions","valueGetter","inWaiting","editableTheme","theme_name","icon_set_option","editableIconSet","default","external","popover","onshow","catchError","onhide","oncancel","onbeforesave","onaftersave","oldVal","setLocalValue","handleEmpty","controlsEl","controlsTpl","buttonsEl","buttonsTpl","submitEl","submitTpl","resetEl","resetTpl","cancelEl","cancelTpl","ok","clear","errorEl","errorTpl","formTpl","noformTpl","$attr","transferAttr","nextLetter","firstLetter","secondLetter","camelToDash","attrValue","postrender","wrapper","outerHTML","$cancel","$visible","_clicked","setWaiting","setSelectionRange","onfocus","setError","msg","noPromise","r","save","editableController","editableFormController","overwrites","eFormCtrl","eCtrl","hasForm","eSingle","eForm","getter","parents","forms","v","is_disabled","editDisabled","$editable","$addEditable","$$editableBuffer","eClickable","$show","editablePromiseCollection","shown","isSelfOrDescendant","isBlur","editables","$editables","clickHandler","toCancel","toSubmit","$waiting","_blur","$hide","base","$removeEditable","pc","$onshow","$setError","onWait","$setWaiting","onTrue","$activate","onFalse","onString","selectionStart","selectionEnd","usemousedown","innerHTML","$onhide","arrayRemove","$oncancel","checkSelf","childrenTrue","$onbeforesave","$save","$onaftersave","pre","form","editableForm","buf","$name","post","ngSubmit","submit","promiseCollection","hasFalse","hasString","applyCallback","array","dashToCamel","SPECIAL_CHARS_REGEXP","MOZ_HACK_REGEXP","separator","tag","attributes","optionsExp","NG_OPTIONS_REGEXP","valueName","keyName","valuesFn","track","trackFn","Combodate","currentYear","defaults","minYear","maxYear","yearDescending","firstItem","errorClass","roundTime","smartDays","constructor","day","hour","minute","second","ampm","getTemplate","initCombos","combo","fillCombo","setValue","tpl","token","$combo","fillCommon","relTime","relativeTime","langData","_relativeTime","header","fillDay","twoDigit","daysCount","$month","$year","daysInMonth","leadZero","fillMonth","longNames","shortNames","fillYear","fillHour","h12","fillMinute","fillSecond","fillAmpm","ampmL","notSelected","def","$ampm","highlight","getNearest","$select","opt","optValue","distance","triggerHandler","borderColor","destroy","bs2","bs3","bs4","font-awesome","buttonsClass","inputClass","semantic","errorHandlingConfig","minErrConfig","objectMaxDepth","isValidObjectMaxDepth","NaN","urlErrorParamsEnabled","isBoolean","maxDepth","minErr","ErrorConstructor","errRegExp","paramPrefix","code","message","templateArgs","sliceArgs","toDebugString","encodeURIComponent","isArrayLike","isWindow","iterator","context","isPrimitive","isBlankObject","forEachSorted","reverseParams","iteratorFn","nextUid","setHashKey","h","$$hashKey","baseExtend","objs","deep","jj","isRegExp","merge","$","hasCustomToString","getPrototypeOf","isError","isScope","isFile","isFormData","isBlob","isPromiseLike","isTypedArray","TYPED_ARRAY_REGEXP","isArrayBuffer","makeMap","nodeName_","lowercase","includes","destination","copyRecurse","copyElement","stackSource","stackDest","needsRecurse","copyType","buffer","byteOffset","copied","ArrayBuffer","byteLength","Uint8Array","re","lastIndex","simpleCompare","o1","o2","keySet","createMap","array1","array2","startIndex","curryArgs","toJsonReplacer","toJson","pretty","JSON","stringify","fromJson","json","ALL_COLONS","isNumberNaN","startingTag","elemHtml","NODE_TYPE_TEXT","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","toKeyValue","arrayValue","encodeUriQuery","encodeUriSegment","pctEncodeSpaces","getNgAttribute","ngAttr","ngAttrPrefixes","angularInit","bootstrap","appElement","candidate","isAutoBootstrapAllowed","console","strictDi","modules","doBootstrap","injector","$provide","debugInfoEnabled","$compileProvider","createInjector","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","getTestability","rootElement","UNSAFE_restoreLegacyJqLiteXHTMLReplacement","JQLite","legacyXHTMLReplacement","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","bindFnToScope","lastInstance","getBlockNodes","nodes","blockNodes","endNode","nextSibling","setupModuleLoader","ensure","$injectorMinErr","requires","configFn","invokeLater","insertMethod","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","decorator","block","serializeObject","seen","jqNextId","jqId","cssKebabToCamel","kebabToCamel","MS_HACK_REGEXP","fnCamelCaseReplace","DASH_LOWERCASE_REGEXP","jqLiteIsTextNode","HTML_REGEXP","jqLiteAcceptsData","NODE_TYPE_ELEMENT","NODE_TYPE_DOCUMENT","jqLiteHasData","jqCache","ng339","jqLiteBuildFragment","tmp","finalHtml","fragment","createDocumentFragment","createTextNode","appendChild","TAG_NAME_REGEXP","XHTML_TAG_REGEXP","msie","wrapMapIE9","_default","firstChild","wrapMap","childNodes","textContent","jqLiteParseHTML","SINGLE_TAG_REGEXP","jqLiteWrapNode","replaceChild","argIsString","jqLiteMinErr","jqLiteAddNodes","jqLiteReady","jqLiteClone","jqLiteDealoc","onlyDescendants","cleanData","isEmptyObject","removeIfEmptyData","expandoId","expandoStore","jqLiteOff","unsupported","jqLiteExpandoStore","handle","removeHandler","listenerFns","removeEventListener","MOUSE_EVENT_MAP","jqLiteRemoveData","createIfNecessary","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","existingClasses","newClasses","cssClass","jqLiteAddClass","root","jqLiteController","jqLiteInheritedData","names","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","jqLiteDocumentLoaded","action","win","readyState","addEventListener","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","getAliasedAttrName","ALIASED_ATTR","createEventHandler","eventHandler","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","isImmediatePropagationStopped","handlerWrapper","specialHandlerWrapper","defaultHandlerWrapper","handler","specialMouseHandlerWrapper","related","relatedTarget","jqLiteContains","$$jqLiteProvider","hashKey","nextUidFn","objType","NgMapShim","_keys","_values","_lastKey","_lastIndex","stringifyFn","Function","extractArgs","fnText","STRIP_COMMENTS","ARROW_ARG","FN_ARGS","anonFn","annotate","argDecl","FN_ARG_SPLIT","FN_ARG","underscore","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","instanceInjector","factoryFn","enforce","instanceCache","serviceName","decorFn","origProvider","orig$get","origInstance","$delegate","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","angularModule","createInternalInjector","getService","caller","INSTANTIATING","err","injectionArgs","$$annotate","isClass","func","$$ngIsClass","Type","ctor","NgMap","protoInstanceInjector","loadNewModules","mods","$AnchorScrollProvider","autoScrollingEnabled","disableAutoScrolling","getFirstAnchor","getYOffset","scroll","yOffset","scrollTo","scrollIntoView","elemTop","scrollBy","hash","getElementById","getElementsByName","splitClasses","prepareAnimateOptions","getHash","trimEmptyHash","Browser","$$taskTrackerFactory","cacheStateAndFireUrlChange","pendingLocation","fireStateOrUrlChange","cacheState","cachedState","getCurrentState","lastCachedState","lastHistoryState","prevLastHistoryState","lastBrowserUrl","urlChangeListeners","listener","history","clearTimeout","pendingDeferIds","taskTracker","isMock","completeTask","incTaskCount","notifyWhenNoOutstandingRequests","notifyWhenNoPendingTasks","href","baseElement","sameState","urlResolve","sameBase","stripHash","urlChangeInit","onUrlChange","$$applicationDestroyed","$$checkUrlChange","baseHref","taskType","timeoutId","DEFAULT_TASK_TYPE","deferId","$BrowserProvider","$CacheFactoryProvider","cacheFactory","cacheId","freshEnd","staleEnd","p","nextEntry","prevEntry","caches","stats","capacity","Number","MAX_VALUE","lruHash","lruEntry","removeAll","$TemplateCacheProvider","$cacheFactory","UNINITIALIZED_VALUE","$CompileProvider","$$sanitizeUriProvider","parseIsolateBindings","isController","LOCAL_REGEXP","bindings","definition","scopeName","bindingCache","$compileMinErr","collection","parseDirectiveBindings","isolateScope","assertValidDirectiveName","getDirectiveRequire","REQUIRE_PREFIX_REGEXP","getDirectiveRestrict","hasDirectives","Suffix","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","EVENT_HANDLER_ATTR_REGEXP","registerDirective","directiveFactory","$exceptionHandler","directives","registerComponent","makeInjectable","ddo","identifierForController","aHrefSanitizationTrustedUrlList","defineProperty","imgSrcSanitizationTrustedUrlList","strictComponentBindingsEnabled","TTL","onChangesTtl","commentDirectivesEnabledConfig","commentDirectivesEnabled","cssClassDirectivesEnabledConfig","cssClassDirectivesEnabled","PROP_CONTEXTS","addPropertySecurityContext","elementName","propertyName","ctx","registerContext","SCE_CONTEXTS","HTML","CSS","URL","MEDIA_URL","RESOURCE_URL","flushOnChangesQueue","onChangesQueue","sanitizeSrcset","invokeType","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","innerIdx","getTrustedMediaUrl","lastTuple","Attributes","attributesToCopy","l","$$element","setSpecialAttr","specialAttrHolder","removeNamedItem","setNamedItem","safeAddClass","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","compositeLinkFn","compileNodes","$$addScopeClass","namespace","cloneConnectFn","needsNewScope","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","detectNamespaceForChildElements","$linkNode","wrapTemplate","JQLitePrototype","controllerName","$$addScopeInfo","nodeList","nodeLinkFn","childLinkFn","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","nodeListLength","linkFns","transcludeOnThisElement","createBoundTranscludeFn","templateOnThisElement","linkFnFound","notLiveList","mergeConsecutiveTextNodes","collectDirectives","applyDirectivesToNode","nodeValue","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","boundSlots","$$slots","slotName","attrsMap","addDirective","directiveNormalize","nName","ngPrefixMatch","nAttrs","multiElementMatch","attrStartName","attrEndName","isNgAttr","isNgProp","isNgEvent","NG_PREFIX_BINDING","PREFIX_REGEXP","MULTI_ELEMENT_DIR_RE","directiveIsMultiElement","addPropertyDirective","addEventDirective","addAttrInterpolateDirective","animVal","addTextInterpolateDirective","NODE_TYPE_COMMENT","collectCommentDirectives","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","compilationGenerator","eager","compiled","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","linkNode","controllersBoundTransclude","cloneAttachFn","hasElementTranscludeDirective","elementControllers","scopeToChild","slotTranscludeFn","controllerScope","scopeBindingInfo","newScopeDirective","isSlotFilled","controllerDirectives","setupControllers","templateDirective","$$originalDirective","$$isolateBindings","initializeDirectiveBindings","removeWatches","controllerDirective","$$bindings","bindingInfo","getControllers","controllerInstance","$onChanges","initialChanges","$doCheck","$onDestroy","invokeLinkFn","$postLink","directiveValue","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","replaceDirective","childTranscludeFn","didScanForMultipleTransclusion","mightHaveMultipleTransclusionError","$$start","$$end","assertNoDuplicate","$$tlb","candidateDirective","scanningIndex","$$createComment","slots","slotMap","filledSlots","elementSelector","filled","slotCompileNodes","$$newScope","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectiveScope","mergeTemplateAttributes","compileTemplateUrl","inheritType","dataName","inheritedData","property","controllerKey","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","linkQueue","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","ignoreChildLinkFn","diff","what","previousDirective","wrapModuleNameIfDefined","moduleName","interpolateFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","$$addBindingInfo","expressions","getTrustedAttrContext","attrNormalizedName","getTrustedPropContext","propNormalizedName","sanitizeSrcsetPropertyValue","propName","trustedContext","sanitizer","getTrusted","ngPropGetter","ngPropWatch","applyPropValue","propValue","eventName","createEventDirective","mustHaveExpression","allOrNothing","$$observers","$$inter","$$scope","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","hasData","annotation","strictBindingsCheck","recordChanges","currentValue","previousValue","changes","triggerOnChangesHook","SimpleChange","removeWatchCollection","lastValue","parentGet","parentSet","removeWatch","_UNINITIALIZED_VALUE","literal","parentValueWatch","parentValue","$stateful","isLiteral","initialValue","SIMPLE_ATTR_NAME","$normalize","$addClass","classVal","$removeClass","tokenDifference","writeAttr","booleanKey","aliasedKey","listeners","binding","isolated","noTemplate","comment","createComment","previous","str1","str2","tokens1","tokens2","outer","jqNodes","ident","CNTRL_REG","$ControllerProvider","register","addIdentifier","identifier","expression","later","$controllerMinErr","controllerPrototype","$DocumentProvider","$$IsDocumentHiddenProvider","changeListener","doc","$ExceptionHandlerProvider","exception","cause","serializeValue","$HttpParamSerializerProvider","$HttpParamSerializerJQLikeProvider","serialize","toSerialize","topLevel","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","hasJsonContentType","APPLICATION_JSON","isJsonLike","$httpMinErr","jsonStart","JSON_START","JSON_ENDS","parseHeaders","fillInParsed","line","headerVal","headerKey","headersGetter","headersObj","transformData","fns","isSuccess","$HttpProvider","transformResponse","transformRequest","d","common","Accept","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","jsonpCallbackParam","useApplyAsync","interceptorFactories","interceptors","xsrfTrustedOrigins","origins","$httpBackend","$$cookieReader","$http","requestConfig","chainInterceptors","thenFn","rejectFn","completeOutstandingRequest","executeHeaderFns","headerContent","processedHeaders","headerFn","serverRequest","reqData","withCredentials","sendReq","resp","defHeaderName","lowercaseDefHeaderName","reqHeaderName","defHeaders","reqHeaders","defaultHeadersIteration","uppercase","requestInterceptors","responseInterceptors","reversedInterceptors","interceptor","request","requestError","responseError","createApplyHandlers","eventHandlers","applyHandlers","callEventHandler","$applyAsync","headersString","statusText","xhrStatus","resolveHttpPromise","resolvePromise","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","isJsonp","getTrustedResourceUrl","buildUrl","sanitizeJsonpCallbackParam","defaultCache","xsrfValue","urlIsAllowedOrigin","timeout","responseType","uploadEventHandlers","serializedParams","cbKey","interceptorFactory","urlIsAllowedOriginFactory","$xhrFactoryProvider","XMLHttpRequest","$HttpBackendProvider","$jsonpCallbacks","$xhrFactory","createHttpBackend","createXhr","$browserDefer","rawDocument","jsonpReq","callbackPath","script","async","wasCalled","timeoutRequest","abortedByTimeout","jsonpDone","xhr","abort","completeRequest","createCallback","getResponse","removeCallback","setRequestHeader","responseText","protocol","getAllResponseHeaders","requestAborted","requestTimeout","onerror","ontimeout","onabort","upload","send","$$timeoutId","$InterpolateProvider","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","constantWatchDelegate","objectEquality","constantInterp","unwatch","parseStringifyInterceptor","contextAllowsConcatenation","$interpolateMinErr","interr","unescapedText","$$watchDelegate","endIndex","parseFns","singleExpression","textLength","expressionPositions","startSymbolLength","endSymbolLength","compute","throwNoconcat","$watchGroup","oldValues","currValue","$IntervalProvider","$$intervalFactory","intervals","setIntervalFn","tick","setInterval","clearIntervalFn","clearInterval","$intervalMinErr","$$intervalId","markQExceptionHandled","$$IntervalFactoryProvider","$$q","invokeApply","hasParams","iteration","skipApply","notify","encodePath","segments","decodePath","html5Mode","normalizePath","pathValue","searchValue","hashValue","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","DOUBLE_SLASH_REGEX","$locationMinErr","prefixed","pathname","$$path","$$search","$$hash","startsWith","stripBaseUrl","stripFile","lastIndexOf","serverBase","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","pathUrl","$$compose","$$normalizeUrl","$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutHashUrl","withoutBaseUrl","firstPathSegmentMatch","windowsFilePathExp","LocationHashbangInHtml5Url","locationGetter","locationGetterSetter","preprocess","$LocationProvider","requireBase","rewriteLinks","urlsEqual","setBrowserUrlWithFallback","oldState","$$state","afterLocationChange","absUrl","LocationMode","initialUrl","IGNORE_URI_REGEXP","button","absHref","initializing","newState","$$urlUpdatedByLocation","currentReplace","$$replace","urlOrStateChanged","$LogProvider","debug","debugEnabled","flag","formatError","formatStackTrace","sourceURL","consoleLog","logFn","log","navigator","userAgent","getStringValue","ifDefined","plusFn","isStateless","$filter","filterName","isPure","parentIsPure","AST","MemberExpression","computed","UnaryExpression","PURITY_ABSOLUTE","BinaryExpression","operator","CallExpression","PURITY_RELATIVE","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","isStatelessFilter","astIsPure","Program","expr","Literal","toWatch","argument","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","object","callee","AssignmentExpression","ArrayExpression","ObjectExpression","ThisExpression","LocalsExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","isConstant","ASTCompiler","ASTInterpreter","Parser","lexer","astCompiler","csp","getValueOf","objectValueOf","$ParseProvider","identStart","identContinue","literals","true","false","null","addLiteral","literalName","literalValue","setIdentifierFns","identifierStart","identifierContinue","interceptorFn","parsedExpression","Lexer","$parseOptions","addWatchDelegate","addInterceptor","$$getAst","getAst","expressionInputDirtyCheck","oldValueOfValue","compareObjectIdentity","inputsWatchDelegate","prettyPrintExpression","lastResult","inputExpressions","oldInputValueOf","newInputValue","oldInputValueOfValues","oldInputValues","changed","oneTimeWatchDelegate","unwatchIfDone","isDone","oneTimeWatch","useInputs","isAllDefined","$$intercepted","$$interceptor","allDefined","oneTime","first","chainedInterceptor","$$pure","s","noUnsafeEval","isIdentifierStart","isIdentifierContinue","$QProvider","errorOnUnhandledRejections","qFactory","$$QProvider","exceptionHandler","Deferred","Promise","rejectPromise","notifyPromise","processQueue","pending","processScheduled","markQStateExceptionHandled","$$passToExceptionHandler","queueSize","processChecks","checkQueue","toCheck","isStateExceptionHandled","errorMessage","scheduleProcessQueue","$$reject","$qMinErr","$$resolve","doResolve","doReject","doNotify","handleCallback","callbackOutput","errback","progressBack","race","$Q","resolveFn","TypeError","onFulfilled","onRejected","pur","q","$$RAFProvider","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","supported","$RootScopeProvider","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$$ChildScope","$$suspended","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","destroyChildScope","cleanUpScope","$$prevSibling","$root","Scope","beginPhase","clearPhase","incrementWatchersCount","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","watchExp","$$digestWatchIndex","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","unwatchFn","$watchCollectionInterceptor","_value","newLength","newItem","oldItem","internalArray","oldLength","changeDetected","internalObject","$watchCollectionAction","initRun","veryOldValue","trackVeryOldValue","changeDetector","watch","dirty","logIdx","asyncTask","ttl","asyncQueue","watchLog","asyncQueuePosition","traverseScopesLoop","postDigestQueuePosition","postDigestQueue","$suspend","$isSuspended","$resume","$applyAsyncExpression","namedListeners","indexOfListener","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","$$SanitizeUriProvider","uri","isMediaUrl","normalizedVal","snakeToCamel","UNDERSCORE_LOWERCASE_REGEXP","adjustMatcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","$SceDelegateProvider","trustedResourceUrlList","bannedResourceUrlList","$$sanitizeUri","matchUrl","urlIsSameOrigin","urlIsSameOriginAsBaseUrl","isResourceUrlAllowedByPolicy","allowed","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","trustAs","Constructor","byType","maybeTrusted","trustedValueHolderBase","htmlSanitizer","JS","$SceProvider","$sceDelegate","sce","isEnabled","parseAs","enumValue","lName","$SnifferProvider","eventSupport","isNw","nw","process","isChromePackagedApp","chrome","app","runtime","hasHistoryPushState","pushState","android","boxee","bodyStyle","hasEvent","divElm","$$TaskTrackerFactoryProvider","TaskTracker","decTaskCount","countForType","taskCounts","countForAll","ALL_TASKS_TYPE","nextCb","getNextCallback","getLastCallbackForType","getLastCallback","cbInfo","taskCallbacks","cb","$TemplateRequestProvider","httpOptions","handleRequestFn","ignoreRequestError","handleError","$templateRequestMinErr","transformer","$$TestabilityProvider","testability","findBindings","opt_exactMatch","getElementsByClassName","dataBinding","bindingName","findModels","prefixes","attributeEquals","getLocation","setLocation","whenStable","$TimeoutProvider","deferreds","$timeoutMinErr","urlParsingNode","ipv6InBrackets","requestUrl","urlsAreSameOrigin","originUrl","getBaseUrl","trustedOriginUrls","parsedAllowedOriginUrls","url1","url2","baseURI","baseUrlParsingNode","$WindowProvider","$$CookieReader","safeGetCookie","cookie","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","currentCookieString","$$CookieReaderProvider","$FilterProvider","filters","suffix","currencyFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","uppercaseFilter","comparator","anyPropertyKey","predicateFn","matchAgainstAnyProp","expressionType","getTypeForFilter","createPredicateFn","shouldMatchPrimitives","expected","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","currencySymbolRe","formatNumber","GROUP_SEP","DECIMAL_SEP","numStr","digits","numberOfIntegerDigits","zeros","exponent","ZERO_CHAR","MAX_DIGITS","roundNumber","parsedNumber","minFrac","fractionLen","roundAt","digit","carry","reduceRight","groupSep","decimalSep","isInfinity","isZero","formattedText","integerLen","decimals","lgSize","gSize","negPre","negSuf","posPre","posSuf","padNumber","num","negWrap","neg","dateGetter","dateStrGetter","shortForm","standAlone","timeZoneGetter","zone","paddedZone","getFirstThursdayOfYear","dayOfWeekOnFirst","getThursdayThisWeek","datetime","weekGetter","firstThurs","thisThurs","ampmGetter","eraGetter","longEraGetter","jsonStringToDate","R_ISO8601_STR","tzHour","tzMin","dateSetter","timeSetter","ms","NUMBER_STRING","DATE_FORMATS_SPLIT","DATE_FORMATS","spacing","limit","begin","Infinity","sliceFn","processPredicates","sortPredicates","predicate","descending","objectValue","getPredicateValue","defaultCompare","v1","v2","type1","type2","value1","value2","sortPredicate","reverseOrder","compareFn","getComparisonObject","tieBreaker","predicateValues","predicates","doComparison","compareValues","ngDirective","nullFormRenameControl","control","FormController","$$controls","$$success","$pending","ngForm","$dirty","$pristine","$valid","$submitted","$$parentForm","nullFormCtrl","$$animate","setupValidity","$$classCache","INVALID_CLASS","VALID_CLASS","addSetValidityMethod","createAndSet","unsetAndCleanup","unset","isObjectEmpty","cachedToggleClass","switchValue","toggleValidationCss","validationErrorKey","PENDING_CLASS","combinedState","stringBasedInputType","textInputType","baseInputType","composing","ngTrim","$$hasNativeValidators","deferListener","origValue","PARTIAL_VALIDATION_TYPES","PARTIAL_VALIDATION_EVENTS","validity","VALIDITY_STATE_PROPERTY","origBadInput","badInput","origTypeMismatch","typeMismatch","weekParser","isoWeek","existingDate","WEEK_REGEXP","week","addDays","createDateParser","mapping","iso","previousDate","ISO_DATE_REGEXP","yyyy","MM","dd","HH","mm","ss","sss","part","createDateInputType","isValidDate","parseObservedDateValue","parseDateAndConvertTimeZoneToLocal","previousTimezone","parsedDate","targetFormat","isTimeType","formatted","badInputChecker","ngModelMinErr","ngMin","minVal","parsedMinVal","$validate","ngMax","maxVal","parsedMaxVal","parserName","numberFormatterParser","NUMBER_REGEXP","parseNumberAttrVal","isNumberInteger","countDecimals","numString","decimalSymbolIndex","isValidForStep","stepBase","isNonIntegerValue","isNonIntegerStepBase","isNonIntegerStep","valueDecimals","stepBaseDecimals","stepDecimals","decimalCount","multiplier","pow","numberInputType","ngStep","stepVal","parsedStepVal","rangeInputType","setInitialValueAndObserver","htmlAttrName","changeFn","minChange","supportsRange","elVal","maxChange","stepChange","hasMinAttr","hasMaxAttr","hasStepAttr","rangeUnderflow","rangeOverflow","stepMismatch","urlInputType","URL_REGEXP","emailInputType","email","EMAIL_REGEXP","radioInputType","doTrim","checked","parseConstantExpr","parseFn","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","classDirective","arrayDifference","toClassString","classValue","indexWatchExpression","addClasses","digestClassCounts","removeClasses","updateClasses","oldClassString","oldClassArray","newClassArray","toRemoveArray","toAddArray","toRemoveString","toAddString","classArray","classesToUpdate","classCounts","ngClassIndexWatchAction","newModulo","oldModulo","ngClassWatchAction","$index","forceAsync","NgModelController","$$rawModelValue","$asyncValidators","$untouched","$touched","defaultModelOptions","$$updateEvents","$$updateEventHandler","$$parsedNgModel","$$parsedNgModelAssign","$$ngModelGet","$$ngModelSet","$$pendingDebounce","$$parserValid","$$currentValidationRunId","$$rootScope","$$attr","$$timeout","$$exceptionHandler","setupModelWatcher","$$setModelValue","ModelOptions","$$options","setOptionSelectedStatus","optionEl","parsePatternAttr","patternExp","parseLength","intVal","jQuery","REGEX_STRING_REGEXP","documentMode","ngCspElement","ngCspAttribute","jq","name_","currentScript","HTMLScriptElement","SVGScriptElement","getNamedItem","every","origin","bindJQueryFired","dot","codeName","expando","_data","mouseleave","thead","col","tr","td","tbody","tfoot","colgroup","caption","th","wrapMapValueClosing","wrapMapValue","optgroup","ready","ngMinlength","ngMaxlength","ngPattern","ret","lowercasedName","isBooleanAttr","$dv","multiple","arg1","arg2","nodeCount","addHandler","noEventListener","one","onFn","replaceNode","insertBefore","contentDocument","wrapNode","detach","newElement","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","eventFnsCopy","handlerArgs","arg3","unbind","nanKey","_idx","_transformKey","$$MapProvider","$animateMinErr","$$CoreAnimateJsProvider","$$CoreAnimateQueueProvider","postDigestElements","updateData","handleCSSClassChanges","addRemoveClassesPostDigest","classesAdded","classesRemoved","$AnimateProvider","filterFn","domInsert","afterElement","afterNode","previousElementSibling","addclass","setClass","$$AnimateAsyncRunFactoryProvider","waitForTick","waitQueue","passed","$$AnimateRunnerFactoryProvider","$$animateAsyncRun","AnimateRunner","rafTick","timeoutTick","_doneCallbacks","_tick","_state","onProgress","getPromise","resolveHandler","rejectHandler","_resolve","$CoreAnimateCssProvider","applyAnimationContents","isFirstChange","$$ForceReflowProvider","Content-Type","[","{","$jsonpCallbacksProvider","callbackId","called","callbackMap","$$counter","PATH_MATCH","http","https","ftp","locationPrototype","$$absUrl","$$url","paramValue","Location","$parseMinErr","OPERATORS","ESCAPE","'","\"","lex","tokens","readString","peek","readNumber","peekMultichar","readIdent","is","isWhitespace","ch2","ch3","op1","op2","op3","throwError","chars","codePointAt","isValidIdentifierStart","isValidIdentifierContinue","cp","charCodeAt","cp1","cp2","isExpOperator","colStr","peekCh","quote","rawString","hex","String","fromCharCode","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","arrayDeclaration","selfReferential","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","$locals","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","not","getHasOwnProperty","isNull","nonComputedMember","notNull","member","SAFE_IDENTIFIER","UNSAFE_CHARACTERS","stringEscapeFn","stringEscapeRegex","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","yy","y","MMMM","MMM","M","LLLL","H","hh","EEEE","EEE","Z","ww","w","G","GG","GGG","GGGG","htmlAnchorDirective","xlinkHref","ngAttributeAliasDirectives","defaultLinkFn","normalized","htmlAttr","$addControl","$getControls","$$renameControl","$removeControl","$setPristine","$setSubmitted","$$setSubmitted","$rollbackViewValue","$commitViewValue","newName","oldName","PRISTINE_CLASS","DIRTY_CLASS","$setUntouched","rootForm","formDirectiveFactory","isNgForm","getSetter","formElement","nameAttr","handleFormSubmission","setter","formDirective","ngFormDirective","DATE_REGEXP","DATETIMELOCAL_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","radio","checkbox","file","inputDirective","hiddenInputBrowserCacheDirective","valueProperty","configurable","enumerable","CONSTANT_VALUE_REGEXP","ngValueDirective","updateElementValue","tplAttr","ngValue","ngBindDirective","templateElement","ngBind","ngBindTemplateDirective","ngBindTemplate","ngBindHtmlDirective","ngBindHtmlGetter","ngBindHtml","ngBindHtmlWatch","getTrustedHtml","ngChangeDirective","ngChange","ngClassDirective","ngClassOddDirective","ngClassEvenDirective","ngCloakDirective","ngControllerDirective","ngEventDirectives","forceAsyncEvents","ngIfDirective","previousElements","ngIf","ngIncludeDirective","srcExp","ngInclude","afterAnimation","ngIncludeFillContentDirective","ngInitDirective","ngInit","ngListDirective","ngList","trimValues","$$initGetterSetters","invokeModelGetter","$$updateEmptyClasses","$$lastCommittedViewValue","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","doneCallback","setValidity","localValidationRunId","validationDone","errorKey","syncValidatorsValid","Boolean","validatorPromises","$$parseAndValidate","writeToModelIfNeeded","$$debounceViewValueCommit","debounceDelay","$overrideModelOptions","$$setUpdateOnEvents","$processModelValue","$$format","ngModelDirective","formCtrl","optionsCtrl","setTouched","DEFAULT_REGEXP","inheritAll","updateOnDefault","updateOn","getterSetter","ngModelOptionsDirective","NgModelOptionsController","$$attrs","parentOptions","parentCtrl","modelOptionsDefinition","ngNonBindableDirective","ngOptionsMinErr","ngOptionsDirective","parseOptionsExpression","selectElement","Option","selectValue","getOptionValuesKeys","optionValues","optionValuesKeys","itemKey","selectAs","trackBy","selectAsFn","viewValueFn","trackByFn","getTrackByValueFn","getTrackByValue","getLocals","groupByFn","disableWhenFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","ngOptionsPostLink","addOptionElement","optionElement","optionTemplate","updateOptionElement","getAndUpdateSelectedOption","updateOptions","selectCtrl","readValue","ngOptions","groupElementMap","groupElement","optGroupTemplate","listFragment","nextValue","hasEmptyOption","emptyOption","providedEmptyOption","generateUnknownOptionValue","writeValue","selectedOptions","selectedValues","selections","selectedIndex","removeUnknownOption","selectUnknownOrEmptyOption","unselectEmptyOption","registerOption","optionScope","needsRerender","$isEmptyOptionSelected","ngPluralizeDirective","BRACE","IS_WHEN","updateElementText","newText","lastCount","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","attributeName","tmpMatch","whenKey","countIsNaN","pluralCat","whenExpFn","ngRefMinErr","ngRefDirective","ngRef","refValue","ngRefRead","ngRepeatDirective","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","getBlockStart","getBlockEnd","trackByIdArrayFn","trackByIdObjFn","ngRepeatEndComment","aliasAs","trackByExp","trackByIdExpFn","hashFnLocals","trackByExpGetter","lastBlockMap","nextNode","collectionLength","trackById","trackByIdFn","collectionKeys","nextBlockOrder","previousNode","nextBlockMap","blockKey","ngShowDirective","ngShow","ngHideDirective","ngHide","ngStyleDirective","ngStyle","newStyles","oldStyles","ngSwitchDirective","cases","ngSwitchController","watchExpr","ngSwitch","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","selectedTransclude","caseElement","selectedScope","ngSwitchWhenDirective","ngSwitchWhen","ngSwitchWhenSeparator","whenCase","ngSwitchDefaultDirective","ngTranscludeMinErr","ngTranscludeDirective","fallbackLinkFn","ngTranscludeCloneAttachFn","notWhitespace","useFallbackContent","ngTransclude","ngTranscludeSlot","scriptDirective","noopNgModelController","SelectController","scheduleRender","renderScheduled","scheduleViewValueUpdate","renderAfter","updateScheduled","optionsMap","unknownOption","renderUnknownOption","unknownVal","updateUnknownOption","selectEmptyOption","realVal","hasOption","currentlySelectedOption","hashedVal","addOption","removeOption","$hasEmptyOption","$isUnknownOptionSelected","optionAttrs","interpolateValueFn","interpolateTextFn","removal","previouslySelected","removeValue","selectDirective","selectPreLink","shouldBeSelected","lastView","lastViewRef","selectPostLink","optionDirective","requiredDirective","required","patternDirective","tElm","tAttr","attrVal","oldRegexp","maxlengthDirective","maxlength","maxlengthParsed","minlengthDirective","minlength","minlengthParsed","originalCleanData","jqName","$$encodeUriSegment","$$encodeUriQuery","$$lowercase","$$stringify","$$uppercase","textarea","ngClass","ngClassEven","ngClassOdd","ngCloak","ngController","ngNonBindable","ngPluralize","ngSwitchDefault","$httpParamSerializer","$httpParamSerializerJQLike","$$testability","getDecimals","getVF","opt_precision","PLURAL_CATEGORY","ZERO","ONE","TWO","FEW","MANY","OTHER","WEEKENDRANGE","fullDate","longDate","medium","mediumDate","mediumTime","short","shortDate","shortTime","minInt","localeID","vf","head","global","define","amd","Backbone","Zepto","ender","previousBackbone","VERSION","noConflict","emulateHTTP","emulateJSON","addMethod","iteratee","defaultVal","addUnderscoreMethods","Class","methods","each","_isModel","modelMatcher","Events","eventSplitter","eventsApi","internalOn","listening","_events","onApi","_listeners","listenTo","_listenId","listeningTo","_listeningTo","thisId","objId","handlers","offApi","stopListening","ids","remaining","_callback","once","onceMap","listenToOnce","offer","triggerApi","objEvents","allEvents","triggerEvents","a1","a2","a3","Model","cid","cidPrefix","initialize","validationError","idAttribute","toJSON","sync","_validate","silent","changing","_changing","_previousAttributes","isEqual","_pending","hasChanged","changedAttributes","old","previousAttributes","fetch","serverAttrs","wrapError","validate","wait","isNew","urlError","pairs","invert","pick","omit","Collection","models","_reset","setOptions","addOptions","insert","at","tail","singular","removed","_removeModels","added","merged","toMerge","modelMap","sortable","sortAttr","_prepareModel","_addReference","orderChanged","_removeReference","previousModels","_byId","modelId","where","findWhere","sortBy","pluck","callbackOpts","_onModelEvent","prevId","collect","foldl","inject","foldr","detect","any","include","toArray","take","initial","rest","drop","without","shuffle","sample","partition","groupBy","countBy","indexBy","findIndex","findLastIndex","View","viewOptions","_ensureElement","delegateEventSplitter","$el","_removeElement","setElement","undelegateEvents","_setElement","delegateEvents","undelegate","_createElement","_setAttributes","methodMap","dataType","_method","beforeSend","processData","textStatus","errorThrown","ajax","read","Router","_bindRoutes","optionalParam","namedParam","splatParam","escapeRegExp","_routeToRegExp","router","_extractParameters","execute","navigate","param","History","checkUrl","routeStripper","rootStripper","pathStripper","started","atRoot","getSearch","matchRoot","decodeFragment","decodeURI","getPath","getFragment","_usePushState","_wantsHashChange","hashChange","_hasHashChange","_useHashChange","_wantsPushState","_hasPushState","rootPath","iframe","tabIndex","iWindow","contentWindow","attachEvent","_checkUrlInterval","loadUrl","stop","detachEvent","_updateHash","protoProps","staticProps","__super__","getLens","b64","validLen","lens","placeHoldersLen","_byteLength","toByteArray","Arr","curByte","revLookup","tripletToBase64","encodeChunk","uint8","output","fromByteArray","extraBytes","len2","Plugin","$this","Affix","DEFAULTS","$target","proxy","checkPosition","checkPositionWithEventLoop","affixed","unpin","pinnedOffset","RESET","getState","offsetBottom","colliderTop","colliderHeight","getPinnedOffset","affix","affixType","Event","$spy","Alert","TRANSITION_DURATION","removeElement","closest","support","emulateTransitionEnd","alert","Button","setState","isLoading","loadingText","resetText","$input","$btn","Carousel","cycle","$indicators","paused","sliding","$active","$items","getItemIndex","getItemForDirection","activeIndex","$next","isCycling","slideEvent","$nextIndicator","slidEvent","carousel","slideIndex","$carousel","getTargetFromTrigger","$trigger","Collapse","transitioning","getParent","addAriaAndCollapsedClass","dimension","activesData","actives","startEvent","scrollSize","clearMenus","Dropdown","insertAfter","_relatedTarget","Modal","$body","$dialog","$backdrop","isShown","originalBodyPad","ignoreBackdropClick","fixedContent","remote","load","BACKDROP_TRANSITION_DURATION","checkScrollbar","setScrollbar","resize","adjustDialog","enforceFocus","hideModal","handleUpdate","resetAdjustments","resetScrollbar","removeBackdrop","doAnimate","callbackRemove","modalIsOverflowing","bodyIsOverflowing","fullWindowWidth","documentElementRect","measureScrollbar","bodyPad","actualPadding","calculatedPadding","padding","scrollDiv","showEvent","Popover","getDefaults","setContent","$tip","tip","getContent","typeContent","sanitize","sanitizeHtml","hasContent","$e","o","arrow","$arrow","ScrollSpy","$scrollElement","offsets","targets","activeTarget","getScrollHeight","offsetMethod","offsetBase","$href","maxScroll","parentsUntil","scrollspy","Tab","$ul","$previous","hideEvent","allowedAttribute","allowedAttributeList","inArray","uriAttrs","SAFE_URL_PATTERN","DATA_URL_PATTERN","regExp","unsafeHtml","whiteList","sanitizeFn","implementation","createHTMLDocument","createdDocument","whitelistKeys","elName","attributeList","whitelistedAttributes","Tooltip","DISALLOWED_ATTRIBUTES","ARIA_ATTRIBUTE_PATTERN","DefaultWhitelist","*","area","br","em","hr","h1","h2","h3","h4","h5","h6","img","li","ol","small","span","sub","sup","strong","u","ul","hoverState","inState","viewport","$viewport","hover","eventIn","eventOut","_options","fixTitle","dataAttributes","dataAttr","getDelegateOptions","isInStateTrue","inDom","ownerDocument","tipId","getUID","autoToken","getPosition","actualWidth","actualHeight","orgPlacement","viewportDim","calculatedOffset","getCalculatedOffset","applyPlacement","prevHoverState","setOffset","using","props","getViewportAdjustedDelta","isVertical","arrowDelta","arrowOffsetPosition","replaceArrow","elRect","isSvg","SVGElement","elOffset","outerDims","viewportPadding","viewportDimensions","topEdgeOffset","bottomEdgeOffset","leftEdgeOffset","rightEdgeOffset","enable","toggleEnabled","transitionEnd","transEndEventNames","WebkitTransition","MozTransition","OTransition","special","bsTransitionEnd","bindType","delegateType","handleObj","brackets2dots","REPLACE_BRACKETS","LFT_RT_TRIM_DOTS","typedArraySupport","__proto__","foo","createBuffer","K_MAX_LENGTH","RangeError","Buffer","encodingOrOffset","allocUnsafe","fromString","isView","fromArrayLike","isInstance","fromArrayBuffer","fromObject","Symbol","toPrimitive","assertSize","alloc","fill","encoding","isEncoding","write","isBuffer","numberIsNaN","SlowBuffer","mustMatch","loweredCase","utf8ToBytes","base64ToBytes","slowToString","hexSlice","utf8Slice","asciiSlice","latin1Slice","base64Slice","utf16leSlice","swap","bidirectionalIndexOf","arrayIndexOf","indexSize","readUInt16BE","arrLength","valLength","foundIndex","found","hexWrite","strLen","utf8Write","blitBuffer","asciiWrite","asciiToBytes","latin1Write","base64Write","ucs2Write","utf16leToBytes","base64","res","firstByte","codePoint","bytesPerSequence","secondByte","thirdByte","fourthByte","tempCodePoint","decodeCodePointsArray","codePoints","MAX_ARGUMENTS_LENGTH","toHex","bytes","checkOffset","ext","checkInt","checkIEEE754","writeFloat","littleEndian","noAssert","ieee754","writeDouble","base64clean","INVALID_BASE64_RE","units","leadSurrogate","byteArray","hi","lo","INSPECT_MAX_BYTES","kMaxLength","TYPED_ARRAY_SUPPORT","species","writable","poolSize","allocUnsafeSlow","_isBuffer","x","swap16","swap32","swap64","toLocaleString","inspect","thisStart","thisEnd","thisCopy","targetCopy","_arr","newBuf","subarray","readUIntLE","mul","readUIntBE","readUInt8","readUInt16LE","readUInt32LE","readUInt32BE","readIntLE","readIntBE","readInt8","readInt16LE","readInt16BE","readInt32LE","readInt32BE","readFloatLE","readFloatBE","readDoubleLE","readDoubleBE","writeUIntLE","writeUIntBE","writeUInt8","writeUInt16LE","writeUInt16BE","writeUInt32LE","writeUInt32BE","writeIntLE","writeIntBE","writeInt8","writeInt16LE","writeInt16BE","writeInt32LE","writeInt32BE","writeFloatLE","writeFloatBE","writeDoubleLE","writeDoubleBE","targetStart","copyWithin","_instanceof","circular","includeNonEnumerable","_clone","proto","nativeMap","nativeSet","nativePromise","__isArray","__isRegExp","__getRegExpFlags","__isDate","useBuffer","allParents","allChildren","keyChild","valueChild","entryChild","getOwnPropertyDescriptor","getOwnPropertySymbols","symbols","symbol","descriptor","allPropertyNames","getOwnPropertyNames","__objToStr","ignoreCase","multiline","Map","Set","clonePrototype","curriable","getCurried","arity","_curried","newArgs","newArgsLength","combined","newArgsIndex","__","curry","arityOverride","curried","isPlaceholder","uncurry","curry2","graphlib","layout","util","notime","g","fas","graph","acyclicer","greedyFAS","edge","weight","dfsFAS","removeEdge","forwardName","reversed","setEdge","dfs","visited","outEdges","undo","edges","addBorderSegments","borderLeft","borderRight","rank","minRank","maxRank","addBorderNode","sg","sgNode","borderType","curr","addDummyNode","setParent","adjust","rankDir","rankdir","swapWidthHeight","reverseY","swapXY","swapWidthHeightOne","reverseYOne","points","swapXYOne","List","sentinel","_next","_prev","_sentinel","unlink","filterOutLinks","dequeue","enqueue","strs","debugOrdering","layerMatrix","buildLayerMatrix","Graph","compound","multigraph","setGraph","setNode","layer","layerV","weightFn","buildState","DEFAULT_WEIGHT_FN","doGreedyFAS","buckets","zeroIdx","flatten","sources","sinks","removeNode","collectPredecessors","inEdges","uEntry","assignBucket","wEntry","fasGraph","maxIn","maxOut","prevWeight","edgeWeight","debugTiming","layoutGraph","buildLayoutGraph","runLayout","updateInputGraph","makeSpaceForEdgeLabels","removeSelfEdges","acyclic","nestingGraph","asNonCompoundGraph","injectEdgeLabelProxies","removeEmptyRanks","cleanup","normalizeRanks","assignRankMinMax","removeEdgeLabelProxies","normalize","parentDummyChains","order","insertSelfEdges","coordinateSystem","positionSelfEdges","removeBorderNodes","fixupEdgeLabelCoords","translateGraph","assignNodeIntersects","reversePointsForReversedEdges","inputGraph","inputLabel","layoutLabel","canonicalize","graphDefaults","selectNumberAttrs","graphNumAttrs","graphAttrs","nodeNumAttrs","nodeDefaults","edgeDefaults","edgeNumAttrs","edgeAttrs","ranksep","minlen","labelpos","labeloffset","borderTop","borderBottom","dummy","labelRank","getExtremes","minX","maxX","minY","maxY","POSITIVE_INFINITY","graphLabel","marginX","marginx","marginY","marginy","p1","p2","nodeV","nodeW","intersectRect","selfEdges","layers","orderShift","selfEdge","selfNode","dx","dy","mapValues","newAttrs","edgesep","nodesep","lodash","depths","treeDepths","nodeSep","nestingRoot","sumWeights","nodeRankFactor","childNode","childTop","childBottom","thisWeight","nestingEdge","acc","dummyChains","normalizeEdge","vRank","wRank","edgeLabel","edgeObj","origLabel","successors","addSubgraphConstraints","cg","vs","rootPrev","prevChild","barycenter","movable","inV","nodeU","sum","buildLayerGraph","relationship","createRootNode","setDefaultNodeLabel","hasNode","crossCount","layering","cc","twoLayerCrossCount","northLayer","southLayer","southPos","zipObject","southEntries","firstIndex","treeSize","weightSum","downLayerGraphs","buildLayerGraphs","upLayerGraphs","initOrder","assignOrder","best","bestCC","lastBest","sweepLayerGraphs","cloneDeep","ranks","layerGraphs","biasRight","lg","sorted","sortSubgraph","simpleNodes","orderedVs","resolveConflicts","mappedEntries","indegree","entryV","entryW","doResolveConflicts","sourceSet","vEntry","mergeEntries","bl","subgraphs","barycenters","subgraphResult","mergeBarycenters","expandSubgraphs","predecessors","blPred","brPred","other","unsortable","vsIndex","compareWithBias","consumeUnsortable","bias","postorderNums","postorder","pathData","findPath","lca","pathIdx","pathV","ascending","vPath","wPath","low","lim","findType1Conflicts","visitLayer","prevLayer","k0","scanPos","prevLayerLength","lastNode","findOtherInnerSegmentNode","k1","scanNode","uLabel","uPos","addConflict","conflicts","findType2Conflicts","scan","south","southEnd","prevNorthBorder","nextNorthBorder","uNode","north","nextNorthPos","prevNorthPos","southLookahead","conflictsV","hasConflict","verticalAlignment","neighborFn","prevIdx","ws","mp","il","horizontalCompaction","reverseSep","iterate","setXsFunc","nextNodesFunc","blockG","pass1","xs","pass2","buildBlockGraph","blockGraph","sepFn","sep","vRoot","uRoot","prevMax","findSmallestWidthAlignment","xss","minBy","NEGATIVE_INFINITY","forIn","halfWidth","alignCoordinates","alignTo","alignToVals","alignToMin","alignToMax","vert","horiz","alignment","xsVals","balance","ignore","positionX","adjustedLayering","inner","smallestWidth","edgeSep","vLabel","wLabel","positionY","rankSep","prevY","maxHeight","feasibleTree","directed","tightTree","findMinSlackEdge","slack","shiftRanks","nodeEdges","edgeV","ranker","networkSimplexRanker","tightTreeRanker","longestPathRanker","longestPath","networkSimplex","rankUtil","simplify","initRank","initLowLimValues","initCutValues","leaveEdge","enterEdge","exchangeEdges","assignCutValue","childLab","cutvalue","calcCutValue","childIsTail","graphEdge","cutValue","isOutEdge","pointsToHead","otherWeight","isTreeEdge","otherCutValue","dfsAssignLowLim","nextLim","neighbors","hasEdge","tailLabel","flip","candidates","isDescendant","updateRanks","preorder","flipped","rootLabel","alg","simplified","simpleLabel","isMultigraph","successorWeights","weightMap","sucs","predecessorWeights","preds","rect","point","sx","sy","dotsplit","compact","todots","EventEmitter","objectCreate","_eventsCount","_maxListeners","$getMaxListeners","defaultMaxListeners","emitNone","isFn","arrayClone","emitOne","emitTwo","emitThree","emitMany","_addListener","newListener","emit","warned","emitter","onceWrapper","fired","removeListener","wrapFn","_onceWrap","wrapped","unwrap","evlistener","unwrapListeners","listenerCount","spliceOne","objectCreatePolyfill","F","objectKeysPolyfill","functionBindPolyfill","objectKeys","hasDefineProperty","setMaxListeners","getMaxListeners","er","doError","addListener","prependListener","prependOnceListener","originalListener","removeAllListeners","rawListeners","eventNames","Reflect","ownKeys","boundThis","ret_","boundArgs","boundLen","lib","components","cmpt","cmpts","navigation","isDirected","doDfs","dijkstraAll","weightFunc","edgeFunc","transform","dijkstra","edgeFn","runDijkstra","DEFAULT_WEIGHT_FUNC","pq","PriorityQueue","updateNeighbors","predecessor","decrease","removeMin","findCycles","tarjan","floydWarshall","runFloydWarshall","rowK","rowI","ik","kj","ij","altDistance","isAcyclic","prim","topsort","CycleException","pri","onStack","lowlink","visit","_keyIndices","keyIndices","_decrease","_swap","_heapify","largest","origArrI","origArrJ","_isDirected","_isMultigraph","_isCompound","_label","_defaultNodeLabelFn","_defaultEdgeLabelFn","_nodes","_parent","_children","GRAPH_NODE","_in","_preds","_out","_sucs","_edgeObjs","_edgeLabels","incrementOrInitEntry","decrementOrRemoveEntry","edgeArgsToId","v_","w_","EDGE_KEY_DELIM","DEFAULT_EDGE_NAME","edgeArgsToObj","edgeObjToId","_nodeCount","_edgeCount","isCompound","newDefault","setNodes","_removeFromParentsChildList","ancestor","predsV","sucsV","union","isLeaf","filterNodes","findParent","setDefaultEdgeLabel","edgeCount","setPath","valueSpecified","arg0","freeze","outV","writeNodes","writeEdges","edgeValue","__esModule","UNPARSEABLE_TAGS","TYPEDARRAY_TAGS","TOSTRING_TAGS","SELF_TAGS","PRIMITIVE_TAGS","ITERABLE_TAGS","OBJECT_CLASS_TYPE_MAP","OBJECT_CLASS_MAP","SVG_ELEMENT_REGEXP","HTML_ELEMENT_REGEXP","HAS_UINT16ARRAY_SUPPORT","HAS_BUFFER_FROM_SUPPORT","_SELF_TAGS","_TOSTRING_TAGS","_TYPEDARRAY_TAGS","_UNPARSEABLE_TAGS","Uint16Array","OBJECT_CLASSES","objectClasses","objectClassTypes","objectClass","[object Map]","[object Set]","boolean","function","ARGUMENTS","ARRAY","REGEXP","SYMBOL","FLOAT32ARRAY","FLOAT64ARRAY","INT8ARRAY","INT16ARRAY","INT32ARRAY","UINT8ARRAY","UINT8CLAMPEDARRAY","UINT16ARRAY","UINT32ARRAY","GENERATOR","PROMISE","WEAKMAP","WEAKSET","_utils","getIntegerHashValue","_curriable","otherObject","objectBasis","getFunctionName","FUNCTION_NAME_REGEX","charCode","hashA","hashB","getSortedEvent","bubbles","cancelBubble","cancelable","composed","eventPhase","isTrusted","returnValue","shouldSort","valueA","valueB","shouldSortPair","pairA","pairB","subIndex","getSortedIterable","iterable","isMap","_final","getSortedObject","newObject","getStringifiedArrayBufferFallback","getStringifiedArrayBufferModern","getStringifiedArrayBufferNoSupport","getStringifiedDocumentFragment","getCutoffIndex","getNormalizedValue","passedTag","_constants","OBJECT","DATE","ERROR","EVENT","DOCUMENTFRAGMENT","ARRAYBUFFER","getStringifiedArrayBuffer","DATAVIEW","createReplacer","thisCutoff","valueCutoff","addEvent","getMods","modifier","getKeys","compareArray","arr1","arr2","isIndex","setScope","_scope","getScope","getPressedKeyCodes","_downKeys","isContentEditable","readOnly","isPressed","deleteScope","_handlers","clearModifier","_mods","_modifier","hotkeys","keysInfo","eachUnbind","_len","_key","splitKey","modifiersMatch","shortcut","dispatch","asterisk","keyNum","modifierMap","getModifierState","keyup","_i","record","keyShortcut","_downKeysCurrent","isElementBind","elementHasBindEvent","isff","_keyMap","backspace","return","esc","space","up","down","del","ins","home","pageup","pagedown","capslock","num_0","num_1","num_2","num_3","num_4","num_5","num_6","num_7","num_8","num_9","num_multiply","num_add","num_enter","num_subtract","num_decimal","num_divide","⇪",",",".","/","`","-","=",";","]","\\","⇧","⌥","alt","⌃","⌘","cmd","command","16","18","17","91","_ref","_ref$splitKey","originKey","unbindKeys","lastKey","_api","_hotkeys","env","NODE_ENV","isLE","mLen","nBytes","eLen","eMax","eBias","nBits","rt","LN2","joint","V","Vectorizer","btoa","atob","Uint32Array","Int32Array","VBArray","responseBody","R","cos","sin","sqrt","atan2","PI","E","bezier","curveThroughPoints","throughPoints","getCurveControlPoints","getFirstControlPoints","getCurveDivider","divide","p0","controlPoint1","controlPoint2","p3","getInversionSolver","closestPointT","Curve","bbox","S","P","A","L","T","I","X","Y","C","N","O","D","closestPoint","pointAtT","closestPointLength","precision","PRECISION","subdivisions","getSubdivisions","lengthAtT","closestPointNormalizedLength","closestPointTangent","tangentAtT","getSkeletonPoints","startControlPoint1","startControlPoint2","divider","dividerControlPoint1","dividerControlPoint2","endpointDistance","pointAt","isDifferentiable","tAt","pointAtLength","tAtLength","scale","tangentAt","tangentAtLength","translate","toPoints","toPolyline","Ellipse","fromRect","center","containsPoint","normalizedDistance","inflate","intersectionWithLine","vector","lerp","intersectionWithLineFromCenterToPoint","pointNearestToPoint","tangentTheta","theta","Line","bearing","squaredLength","intersect","midpoint","pointOffset","Point","setLength","intersection","Path","isSegment","appendSegment","createSegment","segmentTypes","prepareSegment","segmentSubdivisions","getSegmentSubdivisions","segmentIndex","getSegment","insertSegment","nextSegment","toPolylines","precisison","previousSegment","isSubpathStart","subpathStartSegment","updateSubpathStartSegment","removeSegment","replaceSegment","segmentAt","segmentIndexAt","segmentAtLength","segmentIndexAtLength","fromPolar","adhereToRect","angleBetween","changeInAngle","cross","magnitude","manhattanDistance","reflection","snapToGrid","squaredDistance","toPolar","vectorAngle","Polyline","convexHull","Rect","fromEllipse","bottomLeft","bottomLine","bottomRight","bottomMiddle","containsRect","corner","topLine","rightLine","leftLine","topLeft","leftMiddle","maxRectScaleToFit","topRight","maxRectUniformScaleToFit","moveAndExpand","sideNearestToPoint","rightMiddle","topMiddle","linear","normalizeAngle","toDeg","toRad","ellipse","regexSupportedData","isDataSupported","includeAnnotationIndices","eol","lineHeight","baseSize","annotations","maxFontSize","SVGAngle","hasFeature","xmlns","xml","xlink","xhtml","isV","createSvgDocument","importNode","createElementNS","ensureId","setAttributes","getTransformToElement","isSVGGraphicsElement","toNode","getScreenCTM","inverse","multiply","createSVGMatrix","transformStringToMatrix","absolute","matrixToTransformString","createSVGTransform","baseVal","appendItem","parseTransformString","tx","ty","angle","ownerSVGElement","getBBox","transformRect","recursive","sanitizeText","textPath","textVerticalAnchor","xml:space","defs","annotateString","fillOpacity","strokeOpacity","qualifyAttr","ns","hasAttributeNS","local","removeAttributeNS","normalizePathData","svg","SVGSVGElement","findOne","previousSibling","findParentByClass","toLocalPoint","createSVGPoint","matrixTransform","translateCenterToPoint","translateAndAutoOrient","setTranslate","setRotate","setMatrix","matrix","decomposeMatrix","translateX","translateY","rotation","animateAlongPath","xlink:href","beginElement","animators","id2anim","getTargets","Animator","getTotalLength","getPointAtLength","convertToPath","convertToPathData","convertLineToPathData","convertPolygonToPathData","convertPolylineToPathData","convertEllipseToPathData","convertCircleToPathData","convertRectToPathData","toGeometryShape","getPointsFromSvgNode","findIntersection","refDistance","setAttributeNS","parseXML","idCounter","DOMParser","parseFromString","transformRegex","transformSeparatorRegex","transformationListRegex","scaleNonUniform","skewX","skewY","scaleX","scaleY","cx","cy","deltaTransformPoint","matrixToScale","matrixToRotate","matrixToTranslate","isVElement","SVGMatrix","createSVGTransformFromMatrix","transformPoint","transformLine","transformPolyline","styleToObject","createSlicePathData","mergeAttrs","findAnnotationsAtIndex","findAnnotationsBetweenIndexes","shiftAnnotations","svgPointsToPath","numberOfItems","getItem","KAPPA","rectToPath","rx","ry","bx","by","qx","qy","Q","U","W","K","B","tan","asin","classNamePrefix","defaultTheme","dia","ui","shapes","connectors","highlighters","routers","connectionPoints","connectionStrategies","linkTools","mvc","views","setTheme","_results","_tests","svgforeignobject","addTest","hashCode","getByPath","setByPath","unsetByPath","flattenObject","uuid","guid","toKebabCase","normalizeEvent","changedTouches","correspondingUseElement","nextFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","cancelFrame","msCancelAnimationFrame","msCancelRequestAnimationFrame","oCancelAnimationFrame","oCancelRequestAnimationFrame","mozCancelAnimationFrame","mozCancelRequestAnimationFrame","shapePerimeterConnectionPoint","paper","isPercentage","parseCssNumeric","unit","breakText","svgDocument","getComputedTextLength","ellipsis","sanitizeHTML","parseHTML","downloadBlob","msSaveBlob","createObjectURL","download","revokeObjectURL","downloadDataUri","dataUriToBlob","unescape","Blob","imageToDataUri","FileReader","readAsDataURL","getElementBBox","offsetLeft","sortElements","setAttributesBySelector","addBack","normalizeSides","timing","quad","cubic","inout","exponential","bounce","reflect","clamp","back","elastic","hexColor","outline","margin","outerRadius","innerRadius","stdDeviation","dropShadow","grayscale","sepia","saturate","hueRotate","amount2","brightness","contrast","grouping","thousands","currency","decimal","convert","toPrecision","toExponential","LN10","toggleFullScreen","addClassNamePrefix","removeClassNamePrefix","wrapWith","wrappers","cells","Cell","parseDOMJSON","namespaceURI","groupSelector","selectors","groupSelectors","mixin","supplement","deepMixin","deepSupplement","defaultsDeep","invokeMap","sortedIndex","sortedIndexBy","uniq","uniqBy","isPlainObject","flattenDeep","bindAll","mergeWith","themeClassNamePrefix","requireSetThemeOverride","renderChildren","svgElement","vel","findAttribute","_ensureElClassName","onRender","override","removeThemeClassName","addThemeClassName","onSetTheme","onRemove","undelegateDocumentEvents","getEventNamespace","delegateElementEvents","undelegateElementEvents","delegateDocumentEvents","eventData","propagationStopped","isPropagationStopped","__render__","GraphCells","cellNamespace","Link","Element","dry","_batches","cellModel","_sortOnChangeZ","_edges","_restructureOnAdd","_restructureOnRemove","_restructureOnReset","_restructureOnChangeSource","_restructureOnChangeTarget","_removeCell","isLink","getOutboundEdges","getInboundEdges","fromJSON","resetCells","startBatch","stopBatch","_prepareCell","minZIndex","maxZIndex","addCell","addCells","removeCells","disconnectLinks","removeLinks","getCell","getCells","getElements","getLinks","getFirstCell","getLastCell","getConnectedLinks","inbound","outbound","getEmbeddedCells","includeEnclosed","getNeighbors","hasLoop","isEmbeddedIn","getCommonAncestor","getSuccessors","cloneCells","cloneSubgraph","getSubgraph","getPredecessors","breadthFirst","bfs","getSources","getSinks","isSource","isSink","isSuccessor","isPredecessor","isNeighbor","findModelsFromPoint","findModelsInArea","strict","findModelsUnderElement","searchBy","getCellsBBox","isEmbedded","resizeCells","batchName","hasActiveBatch","validations","multiLinks","getSourceElement","linkPinning","resetOffset","shape","shapeBBox","LinkView","stroke","xlinkShow","xlinkRole","xlinkType","xlinkArcrole","xlinkTitle","xlinkActuate","xmlSpace","xmlBase","xmlLang","preserveAspectRatio","requiredExtension","requiredFeatures","systemLanguage","externalResourcesRequired","qualify","defineFilter","defineGradient","sourceMarker","marker-start","defineMarker","targetMarker","marker-end","vertexMarker","marker-mid","textWrap","fontSize","findBySelector","SVGPathElement","font-weight","fontWeight","font-size","font-family","fontFamily","ref","refX","refY","refDx","refDy","refWidth","refHeight","refRx","refRy","refRInscribed","refRCircumscribed","refCx","refCy","xAlignment","yAlignment","refDResetOffset","refDKeepOffset","refPointsResetOffset","refPointsKeepOffset","connection","getSerializedConnection","atConnectionLengthKeepGradient","atConnectionLengthIgnoreGradient","atConnectionRatioKeepGradient","atConnectionRatioIgnoreGradient","refR","refD","refPoints","atConnectionLength","atConnectionRatio","refX2","refY2","refWidth2","refHeight2","_visible","configure","relatedView","parentView","simulateRelatedView","getName","focusOpacity","focusTool","blurTool","tools","CellView","tool","mount","ToolsView","ToolView","_transitionIds","processPorts","ports","getParentCell","unembed","toFront","toBack","embed","getAncestors","propertyPath","propertyValue","propertyPathArray","rewrite","removeProp","timingFunction","valueFunction","transitionId","stopTransitions","getTransitions","addTo","findView","findViewByModel","cell","getAttributeDefinition","model-id","onChangeAttrs","can","interactive","getStrokeBBox","partial","unhighlight","findMagnet","getSelector","getLinkEnd","magnet","hasPort","connectionStrategy","getMagnetFromLinkEnd","findPortNode","setNodeAttributes","processNodeAttributes","raw","updateRelativeAttributes","HTMLElement","getNodeScale","scalableNode","findNodesAttributes","selectedLength","getEventTarget","elementFromPoint","clientX","clientY","updateDOMSubtreeAttributes","rootBBox","roAttributes","refNode","processedAttributes","allAttributes","rotatableNode","mergeProcessedAttributes","removeTools","_toolsView","hasTools","addTools","onToolEvent","updateTools","hideTools","showTools","pointerdblclick","pointerclick","contextmenu","pointerdown","_graph","pointermove","pointerup","mouseover","mouseout","onevent","onmagnet","magnetpointerdblclick","magnetcontextmenu","setInteractivity","dispatchToolsEvent","Paper","_initializePorts","parentRelative","translateBy","restrictedArea","top-right","top-left","bottom-left","bottom-right","atan","fitEmbeds","ElementView","_removePorts","_renderPorts","metrics","rotatableSelector","scalableSelector","renderMarkup","markup","renderJSONMarkup","renderStringMarkup","updateTransformation","sgResize","rgTranslate","rgRotate","getTranslateString","getRotateString","useModelGeometry","getNodeBBox","localToPaperRect","nodeCache","getNodeData","getNodeBoundingRect","getNodeMatrix","getRootTranslateMatrix","getRootRotateMatrix","boundingRect","getNodeUnrotatedBBox","getNodeShape","geometryShape","magnetMatrix","prepareEmbedding","processEmbedding","findParentBy","frontParentOnly","candidateEmbedView","validateEmbedding","clearEmbedding","embedding","finalizeEmbedding","getDelegatedView","dragStart","dragMagnet","delegatedView","drag","dragMagnetEnd","dragEnd","targetMagnet","magnetpointerclick","dragMagnetStart","getRestrictedArea","validateMagnet","magnetThreshold","dragLinkStart","delegateDragEvents","addLinkFromMagnet","startArrowheadMove","whenNotAllowed","linkView","getDefaultLink","gridSize","embeddingMode","mousemoved","clickThreshold","toolMarkup","doubleToolMarkup","vertexMarkup","arrowheadMarkup","defaultLabel","labelMarkup","_builtins","textAnchor","pointerEvents","disconnect","connector","insertLabel","appendLabel","removeLabel","vertex","vertices","insertVertex","removeVertex","applyToPoints","reparent","getTargetElement","getRelationshipAncestor","isRelationshipEmbeddedIn","_getDefaultLabel","endsEqual","shortLinkLength","doubleLinkTools","longLinkLength","linkToolsOffset","doubleLinkToolsOffset","sampleInterval","_labelCache","_labelSelectors","_markerCache","_V","_dragData","decimalsRounding","watchSource","createWatcher","watchTarget","startListening","onToolsChange","onLabelsChange","onVerticesChange","onSourceChange","onTargetChange","renderVertexMarkers","renderTools","updateToolsPosition","renderLabels","updateLabels","updateLabelPositions","renderArrowheadMarkers","_getLabelMarkup","_getLabelStringMarkup","_normalizeLabelMarkup","DocumentFragment","hasChildNodes","_mergeLabelAttrs","_toolCache","_tool2Cache","markerVertices","markerArrowheads","sourceArrowhead","targetArrowhead","updateConnection","updateDefaultConnectionPath","updateArrowheadMarkers","perpendicular","updatePostponed","removeRedundantLinearVertices","sourceAnchor","targetAnchor","connectionWrap","markerSource","markerTarget","_translateAndAutoOrientArrows","getEndView","sourceView","targetView","getEndAnchor","getEndMagnet","sourceMagnet","_translateConnectionPoints","findAnchors","findRoute","findConnectionPoints","sourcePoint","targetPoint","findMarkerPoints","sourceBBox","targetBBox","getAnchor","connectionPoint","defaultConnectionPoint","getConnectionPoint","perpendicularLinks","defaultAnchor","linkConnectionPoint","_normalizeLabelPosition","getLabelCoordinates","getConnectionLength","onEndModelChange","getModelById","cacheOnly","makeSelector","handleBy","_getDefaultLabelPositionArgs","_getLabelPositionArgs","_mergeLabelPositionArgs","addLabel","getLabelPosition","addVertex","getVertexIndex","sendToken","dur","repeatCount","calcMode","keyPoints","keyTimes","defaultRouter","defaultConnector","getConnection","getConnectionSubdivisions","getPointAtRatio","getTangentAtLength","getTangentAtRatio","getClosestPoint","getClosestPointLength","getClosestPointRatio","absoluteDistance","reverseDistance","absoluteOffset","dragVertexStart","dragVertexRemoveStart","dragArrowheadStart","dragConnectionStart","dragVertex","dragLabel","dragArrowhead","dragVertexEnd","dragLabelEnd","dragArrowheadEnd","onlabel","dragLabelStart","vertexIdx","labelIdx","positionArgs","ignoreBackwardsCompatibility","snapLinks","_snapArrowhead","_connectArrowhead","_snapArrowheadEnd","_connectArrowheadEnd","linkAllowed","_finishEmbedding","_notifyConnectEvent","_disallow","_afterArrowheadMove","arrowhead","initialEnd","initialMagnet","magnetUnderPointer","radius","findViewsInArea","closestView","closestMagnet","validateConnection","validateConnectionArgs","connecting","snapping","eventTarget","viewUnderPointer","_beforeArrowheadMove","markAvailable","_markAvailableMagnets","_unmarkAvailableMagnets","_createValidateConnectionArgs","marked","magnetAvailability","elementAvailability","drawGrid","elementView","guard","highlighting","preventContextMenu","preventDefaultBlankAction","restrictTranslate","defaultLink","labelMove","allowLink","moveThreshold","cellViewNamespace","highlighterNamespace","dblclick","mousedown","touchstart","DOMMouseScroll","mouseenter .joint-cell","mouseleave .joint-cell","mouseenter .joint-tools","mouseleave .joint-tools","mousedown .joint-cell [event]","touchstart .joint-cell [event]","mousedown .joint-cell [magnet]","touchstart .joint-cell [magnet]","dblclick .joint-cell [magnet]","contextmenu .joint-cell [magnet]","mousedown .joint-link .label","touchstart .joint-link .label","dragstart .joint-cell image","documentEvents","mousemove","touchmove","mouseup","touchend","touchcancel","_highlights","setGrid","cloneOptions","setDimensions","onCellAdded","removeView","resetViews","_onSort","_onBatchStop","onCellHighlight","onCellUnhighlight","_views","$background","drawBackground","$grid","_background","updateBackgroundImage","_viewportMatrix","_viewportTransformString","getCTM","clientMatrix","_sortDelayingBatches","sortViews","removeViews","getComputedSize","setOrigin","fitToContent","gridWidth","gridHeight","allowNewOrigin","minWidth","minHeight","maxWidth","scaleContentToFit","getContentBBox","scaleGrid","minScale","maxScale","minScaleX","maxScaleX","minScaleY","maxScaleY","fittingBBox","getContentArea","getArea","paperToLocalRect","createViewForModel","_asyncCells","_frameId","asyncRenderViews","renderView","onImageDragStart","beforeRenderViews","afterRenderViews","cancelRenderViews","asyncBatchAdded","batchSize","MIN_SCALE","findViewsFromPoint","clientToLocalPoint","localToPaperPoint","paperToLocalPoint","localToClientPoint","localToClientRect","clientToLocalRect","localToPagePoint","pageOffset","localToPageRect","pageToLocalPoint","pageToLocalRect","clientOffset","scrollX","scrollY","resolveHighlighter","highlighter","cellView","magnetEl","magnetEvent","guarded","setGridSize","clearGrid","_getGriRefs","_gridCache","patterns","exist","_gridSettings","_resolveDrawGridOption","gridPatterns","ox","oy","scaleFactor","patternUnits","XMLSerializer","serializeToString","backgroundSize","backgroundPosition","drawBackgroundImage","HTMLImageElement","repeat","quality","backgroundPatterns","HTMLCanvasElement","toDataURL","backgroundRepeat","backgroundImage","updateBackgroundColor","image","filterUnits","stops","orient","markerUnits","flipXy","getContext","drawImage","setTransform","flipX","flipY","watermark","watermarkAngle","thickness","fixedDot","mesh","stroke-width","doubleMesh","portLayoutNamespace","Port","portLabelLayoutNamespace","PortLabel","_init","getPorts","getGroup","getPortsByGroup","getGroupPortsMetrics","portId","portTransformation","labelTransformation","_getPortLabelLayout","portAttrs","portSize","labelSize","_evaluateGroup","_evaluatePort","_getPosition","_getLabel","_createPositionNode","_getZIndex","_createPortData","_processRemovedPort","hasPorts","getPortIndex","getPort","getPortsPositions","_portSettingsData","_isValidPortId","addPort","portProp","_validatePorts","addPorts","removePort","removePorts","portContainerMarkup","portMarkup","portLabelMarkup","_portElementsCache","_refreshPorts","_getContainerElement","_getPortElement","_appendPorts","_updatePorts","portElement","_createPortElement","portContentElement","portContentSelectors","_updatePortGroup","_getPortMarkup","port-group","_getPortLabelMarkup","portLabelElement","portSelectors","portLabelSelectors","applyPortTransform","basic","Generic","ref-x","ref-y","text-anchor","y-alignment","TextView","circle","polygon","ref-dy","polyline","PortsModelInterface","updatePortsAttrs","_portSelectors","getPortAttrs","getPortSelector","PortsViewInterface","renderPorts",".content","x-alignment","updateSize","updateContent",".fobj","setForeignObjectSize","setDivContent","TextBlockView","noSVGForeignObjectElement","strokeWidth","border","headerText","bodyText","lateralArea","topRy","backgroundColor","textAlign","boxSizing","alignItems","justifyContent","foreignObject","strokeLinejoin","cursor","pointer-events","shadow","manhattan","mapGridSize","OPEN","CLOSE","paddingBox","J","tt","et","it","nt","ot","st","directionMap","startDirections","endDirections","isPointAccessible","previousDirectionAngle","directions","gridOffsetX","offsetX","gridOffsetY","offsetY","maximumLoops","maxAllowedDirectionChange","isClose","cost","penalties","fallbackRoute","build","draggingRoute","fallbackRouter","excludeEnds","excludeTypes","0","45","90","orthogonal","metro","diagonalCost","oneSide","side","elementPadding","rounded","smooth","jumpover","_jumpOverUpdateList","isJump","jump","ignoreConnectors","compensateRotation","dr","ellipseSpread","startAngle","manual","outsideOriented","outside","insideOriented","inside","radial","radialOriented","getHighlighterId","removeHighlighter","vector-effect","midSide","modelCenter","rectangle","boundary","firstElementChild","insideout","extrapolate","sticky","useDefaults","pinAbsolute","pinRelative","onPointerDown","onPointerMove","onDoubleClick","onPointerUp","handleClass","snapRadius","redundancyRemoval","vertexAdding","handles","mousedown .joint-vertices-path","touchstart .joint-vertices-path","resetHandles","updatePath","startHandleListening","onHandleWillChange","onHandleChanging","onHandleChanged","onHandleRemove","getNeighborPoints","snapVertex","vertexAdded","onPathPointerDown","VertexHandle","segmentLengthThreshold","snapHandle","renderHandle","updateHandle","onHandleChangeStart","onHandleChangeEnd","shiftHandleIndexes","resetAnchor","axis","sourceAnchorDef","targetAnchorDef","SegmentHandle","xAxisVector","ratio","arrowheadType","stroke-dasharray","snap","customAnchorAttributes","defaultAnchorAttributes","areaPadding","restrictArea","toggleArea","updateAnchor","updateArea","onPointerDblClick","Vertices","Segments","SourceArrowhead","TargetArrowhead","SourceAnchor","TargetAnchor","Remove","Boundary",".outer",".inner","erd","Entity","Relationship","Attribute","text-decoration","cardinality","Circle",".marker-target",".card",".rank",".name",".connection",".root",".label",".tokens > circle",".tokens.one > circle",".tokens.two > circle:nth-child(1)",".tokens.two > circle:nth-child(2)",".tokens.three > circle:nth-child(1)",".tokens.three > circle:nth-child(2)",".tokens.three > circle:nth-child(3)",".tokens.alot > text","pn","PlaceView","renderTokens","inPorts","outPorts",".body","ref-width","ref-height",".port-label",".port-body","updatePortItems","createPortItems","createPortItem","_addGroupPort","addOutPort","addInPort","_removeGroupPort","removeOutPort","removeInPort","_changeGroup","changeInGroup","changeOutGroup","devs",".uml-class-name-rect",".uml-class-attrs-rect",".uml-class-methods-rect",".uml-class-name-text",".uml-class-attrs-text",".uml-class-methods-text","updateRectangles","getClassName","uml","ClassView","AbstractView","InterfaceView",".uml-state-body",".uml-state-separator",".uml-state-name",".uml-state-events","change:name","updateName","change:events","updateEvents","change:size","circle.outer","circle.inner","logic","Gate",".wire","font-variant","text-transform","IO","ref-dx",".input",".output",".input1",".input2","Gate11","Gate21",".marker-vertex","dagre","DirectedGraph","exportElement","exportLink","minLen","importElement","setPosition","importLink","setVertices","setLinkVertices","setLabels","resizeClusters","clusterPadding","toGraphLib","setNodeLabel","setEdgeLabel","setEdgeName","fromGraphLib","importEdge","noGlobal","DOMEval","preservedScriptAttributes","toType","class2type","winnow","qualifier","grep","cur","createOptions","rnothtmlwhite","Identity","Thrower","ex","adoptValue","noValue","fail","completed","fcamelCase","rmsPrefix","rdashAlpha","Data","getData","rbrace","rmultiDash","dataUser","adjustCSS","valueParts","tween","adjusted","maxIterations","cssNumber","initialInUnit","rcssNum","getDefaultDisplay","temp","defaultDisplayMap","showHide","dataPriv","isHiddenWithinTree","getAll","setGlobalEval","refElements","buildFragment","scripts","selection","ignored","rhtml","rtagName","htmlPrefilter","lastChild","rscriptType","returnFalse","safeActiveElement","origFn","manipulationTarget","disableScript","restoreScript","cloneCopyEvent","dest","pdataOld","pdataCur","udataOld","udataCur","access","fixInput","rcheckableType","domManip","hasScripts","iNoClone","valueIsFunction","checkClone","rchecked","_evalUrl","rcleanScript","curCSS","getStyles","pixelBoxStyles","rnumnonpx","rboxStyle","addGetHookIf","conditionFn","hookFn","vendorPropName","emptyStyle","capName","cssPrefixes","finalPropName","cssProps","setPositiveNumber","subtract","boxModelAdjustment","box","isBorderBox","computedVal","cssExpand","getWidthOrHeight","valueIsBorderBox","boxSizingReliable","Tween","schedule","inProgress","fx","createFxNow","fxNow","genFx","includeWidth","createTween","Animation","tweeners","defaultPrefilter","hooks","oldfire","propTween","restoreDisplay","isBox","anim","orig","dataShow","_queueHooks","unqueued","fire","always","rfxtypes","propFilter","specialEasing","cssHooks","prefilters","currentTime","tweens","notifyWith","resolveWith","originalProperties","originalOptions","gotoEnd","rejectWith","stripAndCollapse","getClass","classesToArray","buildParams","traditional","rbracket","addToPrefiltersOrTransports","structure","dataTypeExpression","dataTypes","inspectPrefiltersOrTransports","jqXHR","inspected","prefilterOrFactory","dataTypeOrTransport","seekingTransport","transports","ajaxExtend","flatOptions","ajaxSettings","ajaxHandleResponses","responses","ct","finalDataType","firstDataType","mimeType","getResponseHeader","converters","ajaxConvert","conv2","conv","responseFields","dataFilter","throws","getProto","hasOwn","fnToString","ObjectFunctionString","noModule","rtrim","jquery","pushStack","prevObject","copyIsArray","isReady","Ctor","globalEval","makeArray","callbackExpect","Sizzle","seed","nid","newSelector","newContext","preferredDoc","setDocument","documentIsHTML","rquickExpr","qsa","compilerCache","rbuggyQSA","rcssescape","fcssescape","tokenize","toSelector","rsibling","testContext","qsaError","createCache","Expr","cacheLength","markFunction","assert","addHandle","attrHandle","siblingCheck","sourceIndex","createDisabledPseudo","disabledAncestor","createPositionalPseudo","matchIndexes","setFilters","addCombinator","combinator","checkNonElements","doneName","oldCache","uniqueCache","outerCache","newCache","dirruns","uniqueID","elementMatcher","multipleContexts","contexts","condense","unmatched","newUnmatched","mapped","setMatcher","preFilter","postFilter","postFinder","postSelector","preMap","postMap","preexisting","matcherIn","matcherOut","matcherFromTokens","checkContext","leadingRelative","relative","implicitRelative","matchContext","matchAnyContext","outermostContext","matcherFromGroupMatchers","elementMatchers","setMatchers","bySet","byElement","superMatcher","outermost","matchedCount","setMatched","contextBackup","dirrunsUnique","uniqueSort","isXML","sortInput","hasDuplicate","docElem","rbuggyMatches","classCache","tokenCache","sortOrder","push_native","booleans","whitespace","pseudos","rwhitespace","rcomma","rcombinators","rattributeQuotes","rpseudo","ridentifier","matchExpr","ID","CLASS","TAG","ATTR","PSEUDO","CHILD","needsContext","rinputs","rheader","rnative","runescape","funescape","escaped","escapedWhitespace","high","asCodePoint","unloadHandler","els","hasCompare","subWindow","defaultView","getById","attrId","getAttributeNode","matchesSelector","webkitMatchesSelector","mozMatchesSelector","oMatchesSelector","msMatchesSelector","disconnectedMatch","adown","bup","sortDetached","aup","ap","bp","specified","sel","duplicates","detectDuplicates","sortStable","createPseudo",">"," ","+","~","excess","unquoted","nodeNameSelector","check","simple","forward","ofType","nodeIndex","useCache","pseudo","matched","innerText","lang","elemLang","even","odd","lt","gt","password","parseOnly","soFar","preFilters","cached","unique","isXMLDoc","escapeSelector","until","truncate","siblings","rneedsContext","rsingleTag","rootjQuery","rparentsprev","guaranteedUnique","prevAll","nextAll","nextUntil","prevUntil","Callbacks","firing","memory","locked","firingIndex","stopOnFalse","lock","fireWith","tuples","pipe","newDefer","tuple","returned","mightThrow","exceptionHook","stackTrace","getStackHook","stateString","singleValue","resolveContexts","resolveValues","master","updateFunc","rerrorNames","readyException","readyList","readyWait","doScroll","chainable","emptyGet","bulk","acceptData","owner","_removeData","startLength","clearQueue","pnum","noCloneChecked","rkeyEvent","rmouseEvent","rtypenamespace","handleObjIn","eventHandle","namespaces","origType","elemData","triggered","delegateCount","setup","mappedTypes","origCount","teardown","removeEvent","nativeEvent","handlerQueue","delegateTarget","preDispatch","rnamespace","postDispatch","matchedHandlers","matchedSelectors","addProp","hook","noBubble","beforeunload","isSimulated","pageX","pageY","view","char","pointerId","pointerType","screenX","screenY","targetTouches","toElement","touches","pointerenter","pointerleave","rxhtmlTag","rnoInnerhtml","dataAndEvents","deepDataAndEvents","srcElements","destElements","inPage","prependTo","replaceAll","original","opener","computeStyleTests","cssText","divStyle","pixelPositionVal","reliableMarginLeftVal","roundPixelMeasures","pixelBoxStylesVal","boxSizingReliableVal","scrollboxSizeVal","measure","backgroundClip","clearCloneStyle","pixelPosition","reliableMarginLeft","scrollboxSize","rdisplayswap","rcustomProp","cssShow","visibility","cssNormalTransform","letterSpacing","columnCount","flexGrow","flexShrink","orphans","widows","zIndex","zoom","origName","isCustomProp","propHooks","eased","swing","rrun","tweener","prefilter","speed","speeds","fadeTo","optall","doAnimation","finish","stopQueue","timers","cssFn","slideDown","slideUp","slideToggle","fadeIn","fadeOut","fadeToggle","slow","fast","checkOn","optSelected","radioValue","boolHook","nType","attrHooks","attrNames","lowercaseName","rfocusable","rclickable","propFix","for","curValue","finalValue","stateVal","isValidValue","classNames","rreturn","valHooks","optionSet","focusin","rfocusMorph","stopPropagationCallback","onlyHandlers","bubbleType","ontype","lastElement","eventPath","isTrigger","parentWindow","simulate","attaches","nonce","rquery","rCRLF","rsubmitterTypes","rsubmittable","valueOrFunction","serializeArray","r20","rhash","rantiCache","rheaders","rlocalProtocol","rnoContent","rprotocol","allTypes","originAnchor","lastModified","etag","isLocal","accepts","* text","text html","text json","text xml","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","nativeStatusText","modified","timeoutTimer","transport","responseHeadersString","ifModified","cacheURL","callbackContext","statusCode","fireGlobals","globalEventContext","completeDeferred","responseHeaders","urlAnchor","uncached","requestHeaders","requestHeadersNames","strAbort","overrideMimeType","finalText","crossDomain","getJSON","getScript","wrapAll","wrapInner","htmlIsFunction","visible","xhrSuccessStatus","1223","xhrSupported","cors","errorCallback","username","xhrFields","onreadystatechange","binary","text script","charset","scriptCharset","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","animated","curPosition","curLeft","curCSSTop","curTop","curOffset","curCSSLeft","calculatePosition","curElem","Height","Width","","defaultExtra","funcName","fnOver","fnOut","holdReady","hold","parseJSON","isNumeric","_jQuery","_$","thisArg","arrayAggregator","accumulator","arrayEach","arrayEachRight","arrayEvery","arrayFilter","resIndex","arrayIncludes","baseIndexOf","arrayIncludesWith","arrayMap","arrayPush","arrayReduce","initAccum","arrayReduceRight","arraySome","asciiToArray","asciiWords","reAsciiWord","baseFindKey","eachFunc","baseFindIndex","fromIndex","fromRight","strictIndexOf","baseIsNaN","baseIndexOfWith","baseMean","baseSum","NAN","baseProperty","basePropertyOf","baseReduce","baseSortBy","comparer","baseTimes","baseToPairs","baseUnary","baseValues","cacheHas","charsStartIndex","strSymbols","chrSymbols","charsEndIndex","countHolders","escapeStringChar","chr","stringEscapes","hasUnicode","reHasUnicode","hasUnicodeWord","reHasUnicodeWord","iteratorToArray","mapToArray","overArg","replaceHolders","PLACEHOLDER","setToArray","setToPairs","strictLastIndexOf","stringSize","unicodeSize","asciiSize","stringToArray","unicodeToArray","reUnicode","unicodeWords","reUnicodeWord","LARGE_ARRAY_SIZE","CORE_ERROR_TEXT","FUNC_ERROR_TEXT","HASH_UNDEFINED","MAX_MEMOIZE_SIZE","CLONE_DEEP_FLAG","CLONE_FLAT_FLAG","CLONE_SYMBOLS_FLAG","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","WRAP_BIND_FLAG","WRAP_BIND_KEY_FLAG","WRAP_CURRY_BOUND_FLAG","WRAP_CURRY_FLAG","WRAP_CURRY_RIGHT_FLAG","WRAP_PARTIAL_FLAG","WRAP_PARTIAL_RIGHT_FLAG","WRAP_ARY_FLAG","WRAP_REARG_FLAG","WRAP_FLIP_FLAG","DEFAULT_TRUNC_LENGTH","DEFAULT_TRUNC_OMISSION","HOT_COUNT","HOT_SPAN","LAZY_FILTER_FLAG","LAZY_MAP_FLAG","INFINITY","MAX_SAFE_INTEGER","MAX_INTEGER","MAX_ARRAY_LENGTH","MAX_ARRAY_INDEX","HALF_MAX_ARRAY_LENGTH","wrapFlags","argsTag","arrayTag","asyncTag","boolTag","dateTag","domExcTag","errorTag","funcTag","genTag","mapTag","numberTag","nullTag","objectTag","proxyTag","regexpTag","setTag","stringTag","symbolTag","undefinedTag","weakMapTag","weakSetTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reEmptyStringLeading","reEmptyStringMiddle","reEmptyStringTrailing","reEscapedHtml","reUnescapedHtml","reHasEscapedHtml","reHasUnescapedHtml","reEscape","reEvaluate","reInterpolate","reIsDeepProp","reIsPlainProp","rePropName","reRegExpChar","reHasRegExpChar","reTrim","reTrimStart","reTrimEnd","reWrapComment","reWrapDetails","reSplitDetails","reEscapeChar","reEsTemplate","reFlags","reIsBadHex","reIsBinary","reIsHostCtor","reIsOctal","reIsUint","reLatin","reNoMatch","reUnescapedString","rsComboRange","rsComboMarksRange","rsBreakRange","rsMathOpRange","rsBreak","rsCombo","rsLower","rsMisc","rsFitz","rsRegional","rsSurrPair","rsUpper","rsMiscLower","reOptMod","rsModifier","rsOptJoin","rsSeq","rsEmoji","rsSymbol","reApos","reComboMark","rsMiscUpper","contextProps","templateCounter","typedArrayTags","cloneableTags","deburredLetters","À","Á","Â","Ã","Ä","Å","à","á","â","ã","ä","å","Ç","ç","Ð","ð","È","É","Ê","Ë","è","é","ê","ë","Ì","Í","Î","Ï","ì","í","î","ï","Ñ","ñ","Ò","Ó","Ô","Õ","Ö","Ø","ò","ó","ô","õ","ö","ø","Ù","Ú","Û","Ü","ù","ú","û","ü","Ý","ý","ÿ","Æ","æ","Þ","þ","ß","Ā","Ă","Ą","ā","ă","ą","Ć","Ĉ","Ċ","Č","ć","ĉ","ċ","č","Ď","Đ","ď","đ","Ē","Ĕ","Ė","Ę","Ě","ē","ĕ","ė","ę","ě","Ĝ","Ğ","Ġ","Ģ","ĝ","ğ","ġ","ģ","Ĥ","Ħ","ĥ","ħ","Ĩ","Ī","Ĭ","Į","İ","ĩ","ī","ĭ","į","ı","Ĵ","ĵ","Ķ","ķ","ĸ","Ĺ","Ļ","Ľ","Ŀ","Ł","ĺ","ļ","ľ","ŀ","ł","Ń","Ņ","Ň","Ŋ","ń","ņ","ň","ŋ","Ō","Ŏ","Ő","ō","ŏ","ő","Ŕ","Ŗ","Ř","ŕ","ŗ","ř","Ś","Ŝ","Ş","Š","ś","ŝ","ş","š","Ţ","Ť","Ŧ","ţ","ť","ŧ","Ũ","Ū","Ŭ","Ů","Ű","Ų","ũ","ū","ŭ","ů","ű","ų","Ŵ","ŵ","Ŷ","ŷ","Ÿ","Ź","Ż","Ž","ź","ż","ž","IJ","ij","Œ","œ","ʼn","ſ","htmlEscapes","&","<","htmlUnescapes","&","<",">",""","'","\n","\r","
","
","freeParseFloat","freeParseInt","freeGlobal","freeSelf","freeExports","freeModule","moduleExports","freeProcess","nodeUtil","nodeIsArrayBuffer","nodeIsDate","nodeIsMap","nodeIsRegExp","nodeIsSet","isSet","nodeIsTypedArray","deburrLetter","escapeHtmlChar","unescapeHtmlChar","runInContext","isObjectLike","LazyWrapper","LodashWrapper","wrapperClone","baseLodash","chainAll","__wrapped__","__actions__","__chain__","__index__","__values__","__dir__","__filtered__","__iteratees__","__takeCount__","__views__","lazyClone","copyArray","lazyReverse","lazyValue","isArr","isRight","getView","iteratees","iterLength","takeCount","nativeMin","baseWrapperValue","iterIndex","Hash","hashClear","__data__","nativeCreate","hashDelete","hashGet","hashHas","hashSet","ListCache","listCacheClear","listCacheDelete","assocIndexOf","listCacheGet","listCacheHas","listCacheSet","MapCache","mapCacheClear","mapCacheDelete","getMapData","mapCacheGet","mapCacheHas","mapCacheSet","SetCache","setCacheAdd","setCacheHas","Stack","stackClear","stackDelete","stackGet","stackHas","stackSet","arrayLikeKeys","inherited","isArg","isArguments","isBuff","isType","skipIndexes","arraySample","baseRandom","arraySampleSize","shuffleSelf","baseClamp","arrayShuffle","assignMergeValue","baseAssignValue","assignValue","objValue","baseAggregator","baseEach","baseAssign","copyObject","baseAssignIn","keysIn","baseAt","paths","lower","upper","baseClone","bitmask","customizer","isDeep","isFlat","isFull","initCloneArray","getTag","isFunc","cloneBuffer","initCloneObject","copySymbolsIn","copySymbols","initCloneByTag","stacked","subValue","keysFunc","getAllKeysIn","getAllKeys","baseConforms","baseConformsTo","baseDelay","baseDifference","isCommon","valuesLength","valuesIndex","baseEvery","baseExtremum","isSymbol","baseFill","toInteger","toLength","baseFilter","baseFlatten","isStrict","isFlattenable","baseForOwn","baseFor","baseForOwnRight","baseForRight","baseFunctions","baseGet","castPath","toKey","baseGetAllKeys","symbolsFunc","baseGetTag","symToStringTag","getRawTag","objectToString","baseGt","baseHas","baseHasIn","baseInRange","nativeMax","baseIntersection","othLength","othIndex","maxLength","baseInverter","baseInvoke","baseIsArguments","baseIsArrayBuffer","baseIsDate","baseIsEqual","baseIsEqualDeep","equalFunc","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","equalArrays","equalByTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","equalObjects","baseIsMap","baseIsMatch","matchData","noCustomizer","srcValue","baseIsNative","isMasked","reIsNative","toSource","baseIsRegExp","baseIsSet","baseIsTypedArray","isLength","baseIteratee","baseMatchesProperty","baseMatches","baseKeys","isPrototype","nativeKeys","baseKeysIn","nativeKeysIn","isProto","baseLt","baseMap","getMatchData","matchesStrictComparable","isKey","isStrictComparable","hasIn","baseMerge","srcIndex","baseMergeDeep","safeGet","mergeFunc","isTyped","isArrayLikeObject","cloneTypedArray","toPlainObject","baseNth","baseOrderBy","orders","getIteratee","criteria","compareMultiple","basePick","basePickBy","baseSet","basePropertyDeep","basePullAll","basePullAt","indexes","baseUnset","nativeFloor","nativeRandom","baseRange","nativeCeil","baseRepeat","baseRest","setToString","overRest","baseSample","baseSampleSize","nested","baseShuffle","baseSlice","baseSome","baseSortedIndex","retHighest","mid","baseSortedIndexBy","valIsNaN","valIsNull","valIsSymbol","valIsUndefined","othIsDefined","othIsNull","othIsReflexive","othIsSymbol","setLow","baseSortedUniq","baseToNumber","baseToString","symbolToString","baseUniq","createSet","seenIndex","baseUpdate","updater","baseWhile","isDrop","actions","baseXor","baseZipObject","assignFunc","valsLength","castArrayLikeObject","castFunction","stringToPath","castSlice","cloneArrayBuffer","arrayBuffer","cloneDataView","dataView","cloneRegExp","cloneSymbol","symbolValueOf","typedArray","compareAscending","valIsDefined","valIsReflexive","objCriteria","othCriteria","ordersLength","composeArgs","partials","holders","isCurried","argsIndex","argsLength","holdersLength","leftIndex","leftLength","rangeLength","isUncurried","composeArgsRight","holdersIndex","rightIndex","rightLength","getSymbols","getSymbolsIn","createAggregator","initializer","createAssigner","assigner","isIterateeCall","createBaseEach","createBaseFor","createBind","isBind","createCtor","createCaseFirst","methodName","trailing","createCompounder","words","deburr","thisBinding","baseCreate","createCurry","getHolder","createRecurry","createHybrid","createFind","findIndexFunc","createFlow","flatRest","funcs","prereq","thru","getFuncName","isLaziable","plant","partialsRight","holdersRight","argPos","ary","holdersCount","newHolders","isBindKey","reorder","isFlip","isAry","createInverter","toIteratee","createMathOperation","createOver","arrayFunc","createPadding","charsLength","createPartial","createRange","toFinite","createRelationalOperation","toNumber","wrapFunc","isCurry","newHoldersRight","newPartials","newPartialsRight","newData","setWrapToString","createRound","pair","createToPairs","createWrap","mergeData","baseSetData","customDefaultsAssignIn","objectProto","customDefaultsMerge","customOmitClone","isPartial","arrValue","othValue","compared","objProps","objLength","skipCtor","objCtor","othCtor","realNames","otherFunc","isKeyable","getNative","isOwn","unmasked","nativeObjectToString","transforms","getWrapDetails","hasPath","hasFunc","getPrototype","insertWrapDetails","spreadableSymbol","maskSrcKey","srcBitmask","newBitmask","isCombo","otherArgs","oldArray","reference","updateWrapDetails","shortOut","lastCalled","stamp","nativeNow","rand","funcToString","chunk","dropRight","dropRightWhile","dropWhile","flattenDepth","fromPairs","nativeJoin","nth","pullAll","pullAllBy","pullAllWith","nativeReverse","sortedIndexOf","sortedLastIndex","sortedLastIndexBy","sortedLastIndexOf","sortedUniq","sortedUniqBy","takeRight","takeRightWhile","takeWhile","uniqWith","unzip","unzipWith","zipObjectDeep","tap","wrapperChain","wrapperCommit","wrapperNext","wrapperToIterator","wrapperPlant","wrapperReverse","wrapperValue","flatMap","flatMapDeep","flatMapDepth","forEachRight","baseEachRight","orderBy","negate","sampleSize","curryRight","invokeFunc","lastArgs","lastThis","lastInvokeTime","leadingEdge","timerId","timerExpired","leading","remainingWait","timeSinceLastCall","lastCallTime","timeSinceLastInvoke","timeWaiting","maxing","maxWait","shouldInvoke","trailingEdge","debounced","isInvoking","memoize","memoized","Cache","spread","throttle","castArray","cloneWith","cloneDeepWith","conformsTo","isEqualWith","nativeIsFinite","isInteger","isMatch","isMatchWith","isNative","isMaskable","isNil","objectCtorString","isSafeInteger","isWeakMap","isWeakSet","symIterator","remainder","isBinary","toSafeInteger","findKey","findLastKey","forInRight","forOwn","forOwnRight","functions","functionsIn","mapKeys","omitBy","pickBy","setWith","isArrLike","updateWith","valuesIn","inRange","floating","capitalize","upperFirst","endsWith","strLength","padEnd","padStart","radix","nativeParseInt","templateSettings","assignInWith","isEscaping","isEvaluating","imports","importsKeys","importsValues","reDelimiters","evaluate","escapeValue","interpolateValue","esTemplateValue","evaluateValue","variable","attempt","toLower","toUpper","trimEnd","trimStart","omission","newEnd","cond","conforms","defaultTo","matchesProperty","methodNames","oldDash","nthArg","propertyOf","stubArray","stubFalse","stubObject","stubString","stubTrue","times","toPath","maxBy","mean","meanBy","sumBy","arrayProto","funcProto","coreJsData","IE_PROTO","propertyIsEnumerable","isConcatSpreadable","toStringTag","ctxClearTimeout","ctxNow","ctxSetTimeout","nativeGetSymbols","nativeIsBuffer","DataView","WeakMap","metaMap","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","baseSetToString","castRest","ctorString","subString","differenceBy","differenceWith","intersectionBy","intersectionWith","pull","pullAt","unionBy","unionWith","xor","xorBy","xorWith","zip","zipWith","wrapperAt","findLast","keyBy","bindKey","overArgs","funcsLength","partialRight","rearg","gte","lte","assignIn","assignWith","propsIndex","propsLength","invertBy","toPairs","toPairsIn","kebabCase","lowerCase","lowerFirst","snakeCase","startCase","upperCase","flow","flowRight","methodOf","over","overEvery","overSome","rangeRight","augend","addend","dividend","divisor","multiplicand","minuend","subtrahend","entriesIn","extendWith","eachRight","isFilter","takeName","dropName","checkIteratee","isTaker","lodashFunc","retUnwrapped","isLazy","useLazy","isHybrid","isUnwrapped","onlyLazy","chainName","commit","_all","attached","isAttached","expectSync","leverageNative","notAsync","saved","flat","final","vendorProps","_elem","boxSizingNeeded","offsetProp","reliableTrDimensions","nonnativeSelectorCache","rdescend","inDisabledFieldset","pushNative","nonHex","_argument","_context","_matchIndexes","_name","getRootNode","reliableTrDimensionsVal","table","trChild","trStyle","borderTopWidth","borderBottomWidth","gridArea","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","scrollboxSizeBuggy","parserErrorElem","scriptAttrs","_interopRequireDefault","_classCallCheck","_typeof","_createClass","defineProperties","_fact","_fact2","_errors","_debug","_debug2","_selectn","_selectn2","_lodash","_lodash2","Almanac","factMap","runtimeFacts","factResultsCache","allowUndefinedFacts","factId","fact","_addConstantFact","_setFactValue","getCacheKey","factValue","factValuePromise","_getFact","UndefinedFactError","calculate","cacheVal","Condition","booleanOperator","subConditions","oper","factResult","almanac","operatorMap","_this","isBooleanOperator","op","_getValue","rightHandSideValue","leftHandSideValue","DEBUG","localStorage","numberValidator","_operator","_operator2","Operators","SuccessEventFact","successTriggers","_possibleConstructorReturn","ReferenceError","_inherits","subClass","superClass","setPrototypeOf","FINISHED","RUNNING","READY","_rule","_rule2","_almanac","_almanac2","_engineFacts","_engineDefaultOperators","_engineDefaultOperators2","Engine","_EventEmitter","operators","facts","addRule","addOperator","rule","setEngine","prioritizedRules","operatorOrName","operatorName","valueOrMethod","factOrId","ruleSets","sets","ruleArray","_this2","ruleResult","_this3","orderedSets","prioritizeRules","evaluateRules","_Error","_hashIt","_hashIt2","Fact","CONSTANT","calculationMethod","DYNAMIC","cacheKeyMethod","defaultCacheKeys","cacheProperties","hashFromObject","Operator","Rule","_engine2","_engine","factValueValidator","jsonValue","_clone2","RuleResult","conditions","_condition","_condition2","_ruleResult","_ruleResult2","setConditions","onSuccess","onFailure","setName","setPriority","setEvent","engine","factSets","getFact","evaluateCondition","comparisonPromise","comparisonValue","passes","evaluationResult","evaluateConditions","conditionResults","prioritizeAndRun","prioritizeConditions","setResult","processResult","baseTrim","trimmedEndIndex","reWhitespace","INVALID_TEMPL_VAR_ERROR_TEXT","reForbiddenIdentifierChars","arrStacked","othStacked","objStacked","commonConfig","controllerActivateSuccessEvent","demoModelLocation","organisation","repo","branch","logger","activateController","controllerId","eventArgs","commonModule","getLogFn","moduleId","showToast","logIt","logWarning","logSuccess","logError","toastType","toastr","warning","core","timeOut","positionClass","controllerActivateSuccess","appErrorPrefix","docTitle","$logProvider","cfg","diagram","dialogs","datacontext","threatengine","diagramming","threatmodellocator","diagramData","diagramJson","vm","currentDiagram","saveThreatModelDiagram","diagramId","onSaveDiagram","setClean","addDirtyEventHandlers","initialise","newDiagram","forceQuery","onGetThreatModelDiagram","watchThreats","getCellById","initialSelect","setSelected","viewStencil","viewThreats","loaded","threatModelLocation","getModelLocation","threatModel","diagrams","onError","cellCount","confirm","clearAll","zoomIn","currentZoomLevel","maxZoom","zoomOut","showGrid","gridSizeOn","gridSizeOff","errored","edit","setDirty","getThreatModelPath","getModelPathFromRouteParams","generateThreats","generatePerElement","onGenerateThreats","duplicateElement","cloneElement","threats","suggestThreat","threatList","currentThreat","selectTemplate","modelType","addThreat","threat","editing","threatIndex","threatTotal","ignoreThreat","applyToAll","onSelectElement","elementId","unWatchThreats","newProcess","addProcess","newStore","addStore","newActor","addActor","newFlow","addFlow","newBoundary","addBoundary","threatWatchers","hasOpenThreats","escapeHotkey","copyHotkey","pasteHotkey","updateDiagramType","diagramType","thumbnail","ipc","newGraph","stencils","Process","Store","Actor","Flow","saveDiagram","absPathCurrent","absPathPrevious","structuredExit","ipcRenderer","stencil","linkStencil","elementStencil","toolTip",".tooltip","elementWidth","setLabel","shapeHeight","selectOnScope","newCell","_action","addLinkFrom","removeLinkFrom","linkFrom","constrained","constrainedX","constrainedY","cellWidth","cellHeight","cellX","cellY","setUnselected","initialiseGraph","modalClose","onAction","newClass","elementProperties","elementType","elementThreats","onSuggestThreats","suggest","onNewThreat","newThreat","initialiseThreat","cancelAdd","onEditThreat","editIndex","originalThreat","editThreat","cancelEdit","removeThreat","setdirty","threatId","matchingIndex","severity","diagramdirectives","elementPropertyDirectives","pager","canPrevious","canNext","ShapeClass","newTarget","newSource","tm","cloneDict","firstElement","clonedCell","scaleContent","zoomLevel","factor","structuredExitController","onCancel","onOK","confirmController","parameter","cancelNavigation","continueNavigation","onOkPreClose","getParameter","onCancelPreClose","Highlighter","utils","shapeFromClassName","editNameElement","wordWrap","editNameLink","wordUnwrap","defineOutOfScope","selectorClass","originalClass","defineHasOpenThreats","selectorClasses","labelText","nameProperty","toolElement",".element-shape","follow-scale","ToolElementView","_dx","_dy","StoreView","ActorView","ProcessView","FlowView","BoundaryView","routemediator","setRoutingHandlers","updateDocTitle","handleRoutingErrors","rejection","handleRouteChangeError","onCompleted","initialiseRules","addFact","getModel","generateForElementInContext","generateForGraph","ruleId","description","mitigation","threatmodel","threatModelDirectives","threatModelReport","getThreatModel","onLoad","threatModelEditForm","isNewModel","summary","contributors","onSave","getModelPath","onCreate","threatModelPath","willMoveThreatModel","willMoveModel","deleteModel","onDelete","removeContributor","removeDiagram","duplicateDiagram","duplicatedDiagram","newID","emptyDiagram","addingDiagram","addContributor","newContributor","addingContributor","cancelAddingContributor","startAddingContributor","addDiagram","cancelAddingDiagram","startAddingDiagram","newModelLocation","initialiseGraphs","savePDF","isPrintingOrSaving","printPDF","print","safeApply","graphs","printable","saveable","reportOptions","showMitigated","showOutOfScope","showDiagrams","defaultSetTimout","defaultClearTimeout","runTimeout","fun","cachedSetTimeout","runClearTimeout","marker","cachedClearTimeout","cleanUpNextTick","draining","currentQueue","queueIndex","drainQueue","Item","browser","argv","versions","cwd","chdir","umask","selectn","seg","splits","dotted","useColors","WebkitAppearance","firebug","$1","formatArgs","humanize","lastC","storage","removeItem","localstorage","colors","selectColor","createDebug","prevTime","coerce","skips","fmtShort","fmtLong","plural","long","optionsOverride","iconClass","iconClasses","getContainer","$container","containerId","createContainer","subscribe","$toastElement","clearOptions","clearToast","clearContainer","removeToast","toastsToClear","force","hideMethod","hideDuration","hideEasing","tapToDismiss","toastClass","showMethod","showDuration","showEasing","onShown","onHidden","closeMethod","closeDuration","closeEasing","closeOnHover","extendedTimeOut","titleClass","messageClass","escapeHtml","closeHtml","closeClass","newestOnTop","preventDuplicates","progressBar","progressClass","rtl","publish","setAria","ariaValue","setIcon","setSequence","setTitle","$titleElement","setMessage","$messageElement","setCloseButton","closeButton","$closeElement","setProgressBar","$progressElement","setRTL","hideToast","intervalId","delayedHideToast","maxHideTime","hideEta","stickAround","updateProgress","percentage","previousToast","toastId","onclick","onCloseClick","deps","createReduce","memo","currentKey","optimizeCb","createPredicateIndexFinder","getLength","createIndexFinder","predicateFind","collectNonEnumProps","nonEnumIdx","nonEnumerableProps","ObjProto","previousUnderscore","ArrayProto","FuncProto","nativeIsArray","nativeBind","_wrapped","undefinedOnly","lastComputed","shuffled","behavior","pass","shallow","isSorted","executeBound","sourceFunc","boundFunc","callingContext","bound","hasher","address","immediate","timestamp","callNow","compose","hasEnumBug","allKeys","mapObject","extendOwn","oiteratee","aStack","bStack","areArrays","aCtor","bCtor","Int8Array","accum","escapeMap","unescapeMap","createEscaper","escaper","testRegexp","replaceRegexp","noMatch","escapes","escapeChar","oldSettings","_chain","$qProvider","$locationProvider","routeConfigurator","$routeProvider","setRoute","getRoutes","shell","appLoaded","repos","reposUri","branches","branchesUri","modelsUri","onLoadedThreatModel","loc","onLoadError","threatModelUri","buildUri","onCreated","onCreateError","cleanUpUri","oldLocation","onCreateCompleted","onDeletedModel","onDeleteError","diagramToSave","github","getModels","getBranches","getRepos","pagination","selectBranch","uriPrefix","selectRepo","repoFullName","nextPage","previousPage","webreport","onLoaded","welcome","loadDemoModel"],"mappings":"AAAA;CCKA,SAAUA,EAAQC,GAAU,YA0D5B,SAASC,GAAUC,EAAKC,EAAMC,GAC5B,IAAKF,EACH,KAAMG,IAAS,OAAQ,wBAA4BF,GAAQ,IAAOC,GAAU,WAE9E,OAAOF,GAGT,QAASI,GAAaC,EAAEC,GACtB,MAAKD,IAAMC,EACND,EACAC,GACDC,EAAQF,KAAIA,EAAIA,EAAEG,KAAK,MACvBD,EAAQD,KAAIA,EAAIA,EAAEE,KAAK,MACpBH,EAAI,IAAMC,GAHFD,EADAC,EADM,GAQvB,QAASG,GAAcC,GACrB,GAAIC,K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w/F,GAClB27B,cAAep7B,GACf5vG,SAAUywG,GACV71G,QAAS42G,GACT7zG,MAAOgoG,GACP3uG,SAAUu2E,GACV59D,MAAOi6G,GACPl7B,eAAgBujB,QAIrB13F,MAAOC,eAAgB,WAurhCPjmB,IAEnBA,GAAQ+lB,OAAO,eAAiB,WAAY,SAASupD,GAErD,QAASonE,GAAYl/G,GACnBA,GAAQ,EACR,IAAI91B,GAAI81B,EAAEz1B,QAAQ,IAClB,QAAc,GAANL,EAAW,EAAI81B,EAAEl2B,OAASI,EAAI,EAGxC,QAASi1I,GAAMn/G,EAAGo/G,GAChB,GAAI72E,GAAI62E,MAEJxuI,KAAc23D,IAChBA,EAAI14D,KAAKk+B,IAAImxG,EAAYl/G,GAAI,GAG/B,IAAI2pC,GAAO95D,KAAKqkH,IAAI,GAAI3rD,EAExB,QAAQA,EAAGA,EAAG7kC,GADJ1D,EAAI2pC,EAAQ,GAAKA,GAf7B,GAAI01E,IAAmBC,KAAM,OAAQC,IAAK,MAAOC,IAAK,MAAOC,IAAK,MAAOC,KAAM,OAAQC,MAAO,QAmB9F7nE,GAAS9qE,MAAM,WACbw1B,kBACES,OACE,KACA,MAEFL,KACE,SACA,SACA,UACA,YACA,WACA,SACA,YAEFO,UACE,gBACA,eAEFC,MACE,KACA,MAEFuF,eAAkB,EAClBlG,OACE,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEFI,UACE,MACA,MACA,MACA,MACA,MACA,MACA,OAEFH,YACE,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,OAEFc,iBACE,UACA,WACA,QACA,QACA,MACA,OACA,OACA,SACA,YACA,UACA,WACA,YAEFo8G,cACE,EACA,GAEFC,SAAY,kBACZC,SAAY,YACZC,OAAU,qBACVC,WAAc,WACdC,WAAc,YACdC,MAAS,gBACTC,UAAa,SACbC,UAAa,UAEfx4B,gBACEI,aAAgB,IAChBM,YAAe,IACfD,UAAa,IACbJ,WA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X08P,EAAGwc,cAAgBA,EAInB,WACI1kN,EAAOomM,sBAAuBC,GAAcx1Q,KAAK,WAAcg+E,EAAI,+BAa3EniF,OAAOM,QAAUy3R","file":"bundle.js","sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 0) {\n className += (i > 0) ? ' ' : '';\n className += isPrefix ? fix + klass\n : klass + fix;\n }\n });\n return className;\n}\n\nfunction removeFromArray(arr, val) {\n var index = arr.indexOf(val);\n if (val >= 0) {\n arr.splice(index, 1);\n }\n}\n\nfunction stripCommentsFromElement(element) {\n if (element instanceof jqLite) {\n switch (element.length) {\n case 0:\n return element;\n\n case 1:\n // there is no point of stripping anything if the element\n // is the only element within the jqLite wrapper.\n // (it's important that we retain the element instance.)\n if (element[0].nodeType === ELEMENT_NODE) {\n return element;\n }\n break;\n\n default:\n return jqLite(extractElementNode(element));\n }\n }\n\n if (element.nodeType === ELEMENT_NODE) {\n return jqLite(element);\n }\n}\n\nfunction extractElementNode(element) {\n if (!element[0]) return element;\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction $$addClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.addClass(elm, className);\n });\n}\n\nfunction $$removeClass($$jqLite, element, className) {\n forEach(element, function(elm) {\n $$jqLite.removeClass(elm, className);\n });\n}\n\nfunction applyAnimationClassesFactory($$jqLite) {\n return function(element, options) {\n if (options.addClass) {\n $$addClass($$jqLite, element, options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n $$removeClass($$jqLite, element, options.removeClass);\n options.removeClass = null;\n }\n };\n}\n\nfunction prepareAnimationOptions(options) {\n options = options || {};\n if (!options.$$prepared) {\n var domOperation = options.domOperation || noop;\n options.domOperation = function() {\n options.$$domOperationFired = true;\n domOperation();\n domOperation = noop;\n };\n options.$$prepared = true;\n }\n return options;\n}\n\nfunction applyAnimationStyles(element, options) {\n applyAnimationFromStyles(element, options);\n applyAnimationToStyles(element, options);\n}\n\nfunction applyAnimationFromStyles(element, options) {\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n}\n\nfunction applyAnimationToStyles(element, options) {\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n}\n\nfunction mergeAnimationDetails(element, oldAnimation, newAnimation) {\n var target = oldAnimation.options || {};\n var newOptions = newAnimation.options || {};\n\n var toAdd = (target.addClass || '') + ' ' + (newOptions.addClass || '');\n var toRemove = (target.removeClass || '') + ' ' + (newOptions.removeClass || '');\n var classes = resolveElementClasses(element.attr('class'), toAdd, toRemove);\n\n if (newOptions.preparationClasses) {\n target.preparationClasses = concatWithSpace(newOptions.preparationClasses, target.preparationClasses);\n delete newOptions.preparationClasses;\n }\n\n // noop is basically when there is no callback; otherwise something has been set\n var realDomOperation = target.domOperation !== noop ? target.domOperation : null;\n\n extend(target, newOptions);\n\n // TODO(matsko or sreeramu): proper fix is to maintain all animation callback in array and call at last,but now only leave has the callback so no issue with this.\n if (realDomOperation) {\n target.domOperation = realDomOperation;\n }\n\n if (classes.addClass) {\n target.addClass = classes.addClass;\n } else {\n target.addClass = null;\n }\n\n if (classes.removeClass) {\n target.removeClass = classes.removeClass;\n } else {\n target.removeClass = null;\n }\n\n oldAnimation.addClass = target.addClass;\n oldAnimation.removeClass = target.removeClass;\n\n return target;\n}\n\nfunction resolveElementClasses(existing, toAdd, toRemove) {\n var ADD_CLASS = 1;\n var REMOVE_CLASS = -1;\n\n var flags = {};\n existing = splitClassesToLookup(existing);\n\n toAdd = splitClassesToLookup(toAdd);\n forEach(toAdd, function(value, key) {\n flags[key] = ADD_CLASS;\n });\n\n toRemove = splitClassesToLookup(toRemove);\n forEach(toRemove, function(value, key) {\n flags[key] = flags[key] === ADD_CLASS ? null : REMOVE_CLASS;\n });\n\n var classes = {\n addClass: '',\n removeClass: ''\n };\n\n forEach(flags, function(val, klass) {\n var prop, allow;\n if (val === ADD_CLASS) {\n prop = 'addClass';\n allow = !existing[klass] || existing[klass + REMOVE_CLASS_SUFFIX];\n } else if (val === REMOVE_CLASS) {\n prop = 'removeClass';\n allow = existing[klass] || existing[klass + ADD_CLASS_SUFFIX];\n }\n if (allow) {\n if (classes[prop].length) {\n classes[prop] += ' ';\n }\n classes[prop] += klass;\n }\n });\n\n function splitClassesToLookup(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n var obj = {};\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n }\n\n return classes;\n}\n\nfunction getDomNode(element) {\n return (element instanceof jqLite) ? element[0] : element;\n}\n\nfunction applyGeneratedPreparationClasses($$jqLite, element, event, options) {\n var classes = '';\n if (event) {\n classes = pendClasses(event, EVENT_CLASS_PREFIX, true);\n }\n if (options.addClass) {\n classes = concatWithSpace(classes, pendClasses(options.addClass, ADD_CLASS_SUFFIX));\n }\n if (options.removeClass) {\n classes = concatWithSpace(classes, pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX));\n }\n if (classes.length) {\n options.preparationClasses = classes;\n element.addClass(classes);\n }\n}\n\nfunction clearGeneratedClasses(element, options) {\n if (options.preparationClasses) {\n element.removeClass(options.preparationClasses);\n options.preparationClasses = null;\n }\n if (options.activeClasses) {\n element.removeClass(options.activeClasses);\n options.activeClasses = null;\n }\n}\n\nfunction blockKeyframeAnimations(node, applyBlock) {\n var value = applyBlock ? 'paused' : '';\n var key = ANIMATION_PROP + ANIMATION_PLAYSTATE_KEY;\n applyInlineStyle(node, [key, value]);\n return [key, value];\n}\n\nfunction applyInlineStyle(node, styleTuple) {\n var prop = styleTuple[0];\n var value = styleTuple[1];\n node.style[prop] = value;\n}\n\nfunction concatWithSpace(a,b) {\n if (!a) return b;\n if (!b) return a;\n return a + ' ' + b;\n}\n\nvar helpers = {\n blockTransitions: function(node, duration) {\n // we use a negative delay value since it performs blocking\n // yet it doesn't kill any existing transitions running on the\n // same element which makes this safe for class-based animations\n var value = duration ? '-' + duration + 's' : '';\n applyInlineStyle(node, [TRANSITION_DELAY_PROP, value]);\n return [TRANSITION_DELAY_PROP, value];\n }\n};\n\nvar $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {\n var queue, cancelFn;\n\n function scheduler(tasks) {\n // we make a copy since RAFScheduler mutates the state\n // of the passed in array variable and this would be difficult\n // to track down on the outside code\n queue = queue.concat(tasks);\n nextTick();\n }\n\n queue = scheduler.queue = [];\n\n /* waitUntilQuiet does two things:\n * 1. It will run the FINAL `fn` value only when an uncanceled RAF has passed through\n * 2. It will delay the next wave of tasks from running until the quiet `fn` has run.\n *\n * The motivation here is that animation code can request more time from the scheduler\n * before the next wave runs. This allows for certain DOM properties such as classes to\n * be resolved in time for the next animation to run.\n */\n scheduler.waitUntilQuiet = function(fn) {\n if (cancelFn) cancelFn();\n\n cancelFn = $$rAF(function() {\n cancelFn = null;\n fn();\n nextTick();\n });\n };\n\n return scheduler;\n\n function nextTick() {\n if (!queue.length) return;\n\n var items = queue.shift();\n for (var i = 0; i < items.length; i++) {\n items[i]();\n }\n\n if (!cancelFn) {\n $$rAF(function() {\n if (!cancelFn) nextTick();\n });\n }\n }\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateChildren\n * @restrict AE\n * @element ANY\n *\n * @description\n *\n * ngAnimateChildren allows you to specify that children of this element should animate even if any\n * of the children's parents are currently animating. By default, when an element has an active `enter`, `leave`, or `move`\n * (structural) animation, child elements that also have an active structural animation are not animated.\n *\n * Note that even if `ngAnimateChildren` is set, no child animations will run when the parent element is removed from the DOM (`leave` animation).\n *\n *\n * @param {string} ngAnimateChildren If the value is empty, `true` or `on`,\n * then child animations are allowed. If the value is `false`, child animations are not allowed.\n *\n * @example\n * \n \n
\n \n \n
\n
\n
\n List of items:\n
Item {{item}}
\n
\n
\n
\n
\n \n\n .container.ng-enter,\n .container.ng-leave {\n transition: all ease 1.5s;\n }\n\n .container.ng-enter,\n .container.ng-leave-active {\n opacity: 0;\n }\n\n .container.ng-leave,\n .container.ng-enter-active {\n opacity: 1;\n }\n\n .item {\n background: firebrick;\n color: #FFF;\n margin-bottom: 10px;\n }\n\n .item.ng-enter,\n .item.ng-leave {\n transition: transform 1.5s ease;\n }\n\n .item.ng-enter {\n transform: translateX(50px);\n }\n\n .item.ng-enter-active {\n transform: translateX(0);\n }\n \n \n angular.module('ngAnimateChildren', ['ngAnimate'])\n .controller('MainController', function MainController() {\n this.animateChildren = false;\n this.enterElement = false;\n });\n \n
\n */\nvar $$AnimateChildrenDirective = ['$interpolate', function($interpolate) {\n return {\n link: function(scope, element, attrs) {\n var val = attrs.ngAnimateChildren;\n if (isString(val) && val.length === 0) { //empty attribute\n element.data(NG_ANIMATE_CHILDREN_DATA, true);\n } else {\n // Interpolate and set the value, so that it is available to\n // animations that run right after compilation\n setData($interpolate(val)(scope));\n attrs.$observe('ngAnimateChildren', setData);\n }\n\n function setData(value) {\n value = value === 'on' || value === 'true';\n element.data(NG_ANIMATE_CHILDREN_DATA, value);\n }\n }\n };\n}];\n\n/* exported $AnimateCssProvider */\n\nvar ANIMATE_TIMER_KEY = '$$animateCss';\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n *\n * @description\n * The `$animateCss` service is a useful utility to trigger customized CSS-based transitions/keyframes\n * from a JavaScript-based animation or directly from a directive. The purpose of `$animateCss` is NOT\n * to side-step how `$animate` and ngAnimate work, but the goal is to allow pre-existing animations or\n * directives to create more complex animations that can be purely driven using CSS code.\n *\n * Note that only browsers that support CSS transitions and/or keyframe animations are capable of\n * rendering animations triggered via `$animateCss` (bad news for IE9 and lower).\n *\n * ## General Use\n * Once again, `$animateCss` is designed to be used inside of a registered JavaScript animation that\n * is powered by ngAnimate. It is possible to use `$animateCss` directly inside of a directive, however,\n * any automatic control over cancelling animations and/or preventing animations from being run on\n * child elements will not be handled by AngularJS. For this to work as expected, please use `$animate` to\n * trigger the animation and then setup a JavaScript animation that injects `$animateCss` to trigger\n * the CSS animation.\n *\n * The example below shows how we can create a folding animation on an element using `ng-if`:\n *\n * ```html\n * \n *
\n * This element will go BOOM\n *
\n * \n * ```\n *\n * Now we create the **JavaScript animation** that will trigger the CSS transition:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * ## More Advanced Uses\n *\n * `$animateCss` is the underlying code that ngAnimate uses to power **CSS-based animations** behind the scenes. Therefore CSS hooks\n * like `.ng-EVENT`, `.ng-EVENT-active`, `.ng-EVENT-stagger` are all features that can be triggered using `$animateCss` via JavaScript code.\n *\n * This also means that just about any combination of adding classes, removing classes, setting styles, dynamically setting a keyframe animation,\n * applying a hardcoded duration or delay value, changing the animation easing or applying a stagger animation are all options that work with\n * `$animateCss`. The service itself is smart enough to figure out the combination of options and examine the element styling properties in order\n * to provide a working animation that will run in CSS.\n *\n * The example below showcases a more advanced version of the `.fold-animation` from the example above:\n *\n * ```js\n * ngModule.animation('.fold-animation', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element, doneFn) {\n * var height = element[0].offsetHeight;\n * return $animateCss(element, {\n * addClass: 'red large-text pulse-twice',\n * easing: 'ease-out',\n * from: { height:'0px' },\n * to: { height:height + 'px' },\n * duration: 1 // one second\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Since we're adding/removing CSS classes then the CSS transition will also pick those up:\n *\n * ```css\n * /* since a hardcoded duration value of 1 was provided in the JavaScript animation code,\n * the CSS classes below will be transitioned despite them being defined as regular CSS classes */\n * .red { background:red; }\n * .large-text { font-size:20px; }\n *\n * /* we can also use a keyframe animation and $animateCss will make it work alongside the transition */\n * .pulse-twice {\n * animation: 0.5s pulse linear 2;\n * -webkit-animation: 0.5s pulse linear 2;\n * }\n *\n * @keyframes pulse {\n * from { transform: scale(0.5); }\n * to { transform: scale(1.5); }\n * }\n *\n * @-webkit-keyframes pulse {\n * from { -webkit-transform: scale(0.5); }\n * to { -webkit-transform: scale(1.5); }\n * }\n * ```\n *\n * Given this complex combination of CSS classes, styles and options, `$animateCss` will figure everything out and make the animation happen.\n *\n * ## How the Options are handled\n *\n * `$animateCss` is very versatile and intelligent when it comes to figuring out what configurations to apply to the element to ensure the animation\n * works with the options provided. Say for example we were adding a class that contained a keyframe value and we wanted to also animate some inline\n * styles using the `from` and `to` properties.\n *\n * ```js\n * var animator = $animateCss(element, {\n * from: { background:'red' },\n * to: { background:'blue' }\n * });\n * animator.start();\n * ```\n *\n * ```css\n * .rotating-animation {\n * animation:0.5s rotate linear;\n * -webkit-animation:0.5s rotate linear;\n * }\n *\n * @keyframes rotate {\n * from { transform: rotate(0deg); }\n * to { transform: rotate(360deg); }\n * }\n *\n * @-webkit-keyframes rotate {\n * from { -webkit-transform: rotate(0deg); }\n * to { -webkit-transform: rotate(360deg); }\n * }\n * ```\n *\n * The missing pieces here are that we do not have a transition set (within the CSS code nor within the `$animateCss` options) and the duration of the animation is\n * going to be detected from what the keyframe styles on the CSS class are. In this event, `$animateCss` will automatically create an inline transition\n * style matching the duration detected from the keyframe style (which is present in the CSS class that is being added) and then prepare both the transition\n * and keyframe animations to run in parallel on the element. Then when the animation is underway the provided `from` and `to` CSS styles will be applied\n * and spread across the transition and keyframe animation.\n *\n * ## What is returned\n *\n * `$animateCss` works in two stages: a preparation phase and an animation phase. Therefore when `$animateCss` is first called it will NOT actually\n * start the animation. All that is going on here is that the element is being prepared for the animation (which means that the generated CSS classes are\n * added and removed on the element). Once `$animateCss` is called it will return an object with the following properties:\n *\n * ```js\n * var animator = $animateCss(element, { ... });\n * ```\n *\n * Now what do the contents of our `animator` variable look like:\n *\n * ```js\n * {\n * // starts the animation\n * start: Function,\n *\n * // ends (aborts) the animation\n * end: Function\n * }\n * ```\n *\n * To actually start the animation we need to run `animation.start()` which will then return a promise that we can hook into to detect when the animation ends.\n * If we choose not to run the animation then we MUST run `animation.end()` to perform a cleanup on the element (since some CSS classes and styles may have been\n * applied to the element during the preparation phase). Note that all other properties such as duration, delay, transitions and keyframes are just properties\n * and that changing them will not reconfigure the parameters of the animation.\n *\n * ### runner.done() vs runner.then()\n * It is documented that `animation.start()` will return a promise object and this is true, however, there is also an additional method available on the\n * runner called `.done(callbackFn)`. The done method works the same as `.finally(callbackFn)`, however, it does **not trigger a digest to occur**.\n * Therefore, for performance reasons, it's always best to use `runner.done(callback)` instead of `runner.then()`, `runner.catch()` or `runner.finally()`\n * unless you really need a digest to kick off afterwards.\n *\n * Keep in mind that, to make this easier, ngAnimate has tweaked the JS animations API to recognize when a runner instance is returned from $animateCss\n * (so there is no need to call `runner.done(doneFn)` inside of your JavaScript animation code).\n * Check the {@link ngAnimate.$animateCss#usage animation code above} to see how this works.\n *\n * @param {DOMElement} element the element that will be animated\n * @param {object} options the animation-related options that will be applied during the animation\n *\n * * `event` - The DOM event (e.g. enter, leave, move). When used, a generated CSS class of `ng-EVENT` and `ng-EVENT-active` will be applied\n * to the element during the animation. Multiple events can be provided when spaces are used as a separator. (Note that this will not perform any DOM operation.)\n * * `structural` - Indicates that the `ng-` prefix will be added to the event class. Setting to `false` or omitting will turn `ng-EVENT` and\n * `ng-EVENT-active` in `EVENT` and `EVENT-active`. Unused if `event` is omitted.\n * * `easing` - The CSS easing value that will be applied to the transition or keyframe animation (or both).\n * * `transitionStyle` - The raw CSS transition style that will be used (e.g. `1s linear all`).\n * * `keyframeStyle` - The raw CSS keyframe animation style that will be used (e.g. `1s my_animation linear`).\n * * `from` - The starting CSS styles (a key/value object) that will be applied at the start of the animation.\n * * `to` - The ending CSS styles (a key/value object) that will be applied across the animation via a CSS transition.\n * * `addClass` - A space separated list of CSS classes that will be added to the element and spread across the animation.\n * * `removeClass` - A space separated list of CSS classes that will be removed from the element and spread across the animation.\n * * `duration` - A number value representing the total duration of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `0`\n * is provided then the animation will be skipped entirely.\n * * `delay` - A number value representing the total delay of the transition and/or keyframe (note that a value of 1 is 1000ms). If a value of `true` is\n * used then whatever delay value is detected from the CSS classes will be mirrored on the elements styles (e.g. by setting delay true then the style value\n * of the element will be `transition-delay: DETECTED_VALUE`). Using `true` is useful when you want the CSS classes and inline styles to all share the same\n * CSS delay value.\n * * `stagger` - A numeric time value representing the delay between successively animated elements\n * ({@link ngAnimate#css-staggering-animations Click here to learn how CSS-based staggering works in ngAnimate.})\n * * `staggerIndex` - The numeric index representing the stagger item (e.g. a value of 5 is equal to the sixth item in the stagger; therefore when a\n * `stagger` option value of `0.1` is used then there will be a stagger delay of `600ms`)\n * * `applyClassesEarly` - Whether or not the classes being added or removed will be used when detecting the animation. This is set by `$animate` when enter/leave/move animations are fired to ensure that the CSS classes are resolved in time. (Note that this will prevent any transitions from occurring on the classes being added and removed.)\n * * `cleanupStyles` - Whether or not the provided `from` and `to` styles will be removed once\n * the animation is closed. This is useful for when the styles are used purely for the sake of\n * the animation and do not have a lasting visual effect on the element (e.g. a collapse and open animation).\n * By default this value is set to `false`.\n *\n * @return {object} an object with start and end methods and details about the animation.\n *\n * * `start` - The method to start the animation. This will return a `Promise` when called.\n * * `end` - This method will cancel the animation and remove all applied CSS classes and styles.\n */\nvar ONE_SECOND = 1000;\n\nvar ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;\nvar CLOSING_TIME_BUFFER = 1.5;\n\nvar DETECT_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n transitionProperty: TRANSITION_PROP + PROPERTY_KEY,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP,\n animationIterationCount: ANIMATION_PROP + ANIMATION_ITERATION_COUNT_KEY\n};\n\nvar DETECT_STAGGER_CSS_PROPERTIES = {\n transitionDuration: TRANSITION_DURATION_PROP,\n transitionDelay: TRANSITION_DELAY_PROP,\n animationDuration: ANIMATION_DURATION_PROP,\n animationDelay: ANIMATION_DELAY_PROP\n};\n\nfunction getCssKeyframeDurationStyle(duration) {\n return [ANIMATION_DURATION_PROP, duration + 's'];\n}\n\nfunction getCssDelayStyle(delay, isKeyframeAnimation) {\n var prop = isKeyframeAnimation ? ANIMATION_DELAY_PROP : TRANSITION_DELAY_PROP;\n return [prop, delay + 's'];\n}\n\nfunction computeCssStyles($window, element, properties) {\n var styles = Object.create(null);\n var detectedStyles = $window.getComputedStyle(element) || {};\n forEach(properties, function(formalStyleName, actualStyleName) {\n var val = detectedStyles[formalStyleName];\n if (val) {\n var c = val.charAt(0);\n\n // only numerical-based values have a negative sign or digit as the first value\n if (c === '-' || c === '+' || c >= 0) {\n val = parseMaxTime(val);\n }\n\n // by setting this to null in the event that the delay is not set or is set directly as 0\n // then we can still allow for negative values to be used later on and not mistake this\n // value for being greater than any other negative value.\n if (val === 0) {\n val = null;\n }\n styles[actualStyleName] = val;\n }\n });\n\n return styles;\n}\n\nfunction parseMaxTime(str) {\n var maxValue = 0;\n var values = str.split(/\\s*,\\s*/);\n forEach(values, function(value) {\n // it's always safe to consider only second values and omit `ms` values since\n // getComputedStyle will always handle the conversion for us\n if (value.charAt(value.length - 1) === 's') {\n value = value.substring(0, value.length - 1);\n }\n value = parseFloat(value) || 0;\n maxValue = maxValue ? Math.max(value, maxValue) : value;\n });\n return maxValue;\n}\n\nfunction truthyTimingValue(val) {\n return val === 0 || val != null;\n}\n\nfunction getCssTransitionDurationStyle(duration, applyOnlyDuration) {\n var style = TRANSITION_PROP;\n var value = duration + 's';\n if (applyOnlyDuration) {\n style += DURATION_KEY;\n } else {\n value += ' linear all';\n }\n return [style, value];\n}\n\n// we do not reassign an already present style value since\n// if we detect the style property value again we may be\n// detecting styles that were added via the `from` styles.\n// We make use of `isDefined` here since an empty string\n// or null value (which is what getPropertyValue will return\n// for a non-existing style) will still be marked as a valid\n// value for the style (a falsy value implies that the style\n// is to be removed at the end of the animation). If we had a simple\n// \"OR\" statement then it would not be enough to catch that.\nfunction registerRestorableStyles(backup, node, properties) {\n forEach(properties, function(prop) {\n backup[prop] = isDefined(backup[prop])\n ? backup[prop]\n : node.style.getPropertyValue(prop);\n });\n}\n\nvar $AnimateCssProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n\n this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout', '$$animateCache',\n '$$forceReflow', '$sniffer', '$$rAFScheduler', '$$animateQueue',\n function($window, $$jqLite, $$AnimateRunner, $timeout, $$animateCache,\n $$forceReflow, $sniffer, $$rAFScheduler, $$animateQueue) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function computeCachedCssStyles(node, className, cacheKey, allowNoDuration, properties) {\n var timings = $$animateCache.get(cacheKey);\n\n if (!timings) {\n timings = computeCssStyles($window, node, properties);\n if (timings.animationIterationCount === 'infinite') {\n timings.animationIterationCount = 1;\n }\n }\n\n // if a css animation has no duration we\n // should mark that so that repeated addClass/removeClass calls are skipped\n var hasDuration = allowNoDuration || (timings.transitionDuration > 0 || timings.animationDuration > 0);\n\n // we keep putting this in multiple times even though the value and the cacheKey are the same\n // because we're keeping an internal tally of how many duplicate animations are detected.\n $$animateCache.put(cacheKey, timings, hasDuration);\n\n return timings;\n }\n\n function computeCachedCssStaggerStyles(node, className, cacheKey, properties) {\n var stagger;\n var staggerCacheKey = 'stagger-' + cacheKey;\n\n // if we have one or more existing matches of matching elements\n // containing the same parent + CSS styles (which is how cacheKey works)\n // then staggering is possible\n if ($$animateCache.count(cacheKey) > 0) {\n stagger = $$animateCache.get(staggerCacheKey);\n\n if (!stagger) {\n var staggerClassName = pendClasses(className, '-stagger');\n\n $$jqLite.addClass(node, staggerClassName);\n\n stagger = computeCssStyles($window, node, properties);\n\n // force the conversion of a null value to zero incase not set\n stagger.animationDuration = Math.max(stagger.animationDuration, 0);\n stagger.transitionDuration = Math.max(stagger.transitionDuration, 0);\n\n $$jqLite.removeClass(node, staggerClassName);\n\n $$animateCache.put(staggerCacheKey, stagger, true);\n }\n }\n\n return stagger || {};\n }\n\n var rafWaitQueue = [];\n function waitUntilQuiet(callback) {\n rafWaitQueue.push(callback);\n $$rAFScheduler.waitUntilQuiet(function() {\n $$animateCache.flush();\n\n // DO NOT REMOVE THIS LINE OR REFACTOR OUT THE `pageWidth` variable.\n // PLEASE EXAMINE THE `$$forceReflow` service to understand why.\n var pageWidth = $$forceReflow();\n\n // we use a for loop to ensure that if the queue is changed\n // during this looping then it will consider new requests\n for (var i = 0; i < rafWaitQueue.length; i++) {\n rafWaitQueue[i](pageWidth);\n }\n rafWaitQueue.length = 0;\n });\n }\n\n function computeTimings(node, className, cacheKey, allowNoDuration) {\n var timings = computeCachedCssStyles(node, className, cacheKey, allowNoDuration, DETECT_CSS_PROPERTIES);\n var aD = timings.animationDelay;\n var tD = timings.transitionDelay;\n timings.maxDelay = aD && tD\n ? Math.max(aD, tD)\n : (aD || tD);\n timings.maxDuration = Math.max(\n timings.animationDuration * timings.animationIterationCount,\n timings.transitionDuration);\n\n return timings;\n }\n\n return function init(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = prepareAnimationOptions(copy(options));\n }\n\n var restoreStyles = {};\n var node = getDomNode(element);\n if (!node\n || !node.parentNode\n || !$$animateQueue.enabled()) {\n return closeAndReturnNoopAnimator();\n }\n\n var temporaryStyles = [];\n var classes = element.attr('class');\n var styles = packageStyles(options);\n var animationClosed;\n var animationPaused;\n var animationCompleted;\n var runner;\n var runnerHost;\n var maxDelay;\n var maxDelayTime;\n var maxDuration;\n var maxDurationTime;\n var startTime;\n var events = [];\n\n if (options.duration === 0 || (!$sniffer.animations && !$sniffer.transitions)) {\n return closeAndReturnNoopAnimator();\n }\n\n var method = options.event && isArray(options.event)\n ? options.event.join(' ')\n : options.event;\n\n var isStructural = method && options.structural;\n var structuralClassName = '';\n var addRemoveClassName = '';\n\n if (isStructural) {\n structuralClassName = pendClasses(method, EVENT_CLASS_PREFIX, true);\n } else if (method) {\n structuralClassName = method;\n }\n\n if (options.addClass) {\n addRemoveClassName += pendClasses(options.addClass, ADD_CLASS_SUFFIX);\n }\n\n if (options.removeClass) {\n if (addRemoveClassName.length) {\n addRemoveClassName += ' ';\n }\n addRemoveClassName += pendClasses(options.removeClass, REMOVE_CLASS_SUFFIX);\n }\n\n // there may be a situation where a structural animation is combined together\n // with CSS classes that need to resolve before the animation is computed.\n // However this means that there is no explicit CSS code to block the animation\n // from happening (by setting 0s none in the class name). If this is the case\n // we need to apply the classes before the first rAF so we know to continue if\n // there actually is a detected transition or keyframe animation\n if (options.applyClassesEarly && addRemoveClassName.length) {\n applyAnimationClasses(element, options);\n }\n\n var preparationClasses = [structuralClassName, addRemoveClassName].join(' ').trim();\n var fullClassName = classes + ' ' + preparationClasses;\n var hasToStyles = styles.to && Object.keys(styles.to).length > 0;\n var containsKeyframeAnimation = (options.keyframeStyle || '').length > 0;\n\n // there is no way we can trigger an animation if no styles and\n // no classes are being applied which would then trigger a transition,\n // unless there a is raw keyframe value that is applied to the element.\n if (!containsKeyframeAnimation\n && !hasToStyles\n && !preparationClasses) {\n return closeAndReturnNoopAnimator();\n }\n\n var stagger, cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n preparationClasses = null;\n return closeAndReturnNoopAnimator();\n }\n\n if (options.stagger > 0) {\n var staggerVal = parseFloat(options.stagger);\n stagger = {\n transitionDelay: staggerVal,\n animationDelay: staggerVal,\n transitionDuration: 0,\n animationDuration: 0\n };\n } else {\n stagger = computeCachedCssStaggerStyles(node, preparationClasses, cacheKey, DETECT_STAGGER_CSS_PROPERTIES);\n }\n\n if (!options.$$skipPreparationClasses) {\n $$jqLite.addClass(element, preparationClasses);\n }\n\n var applyOnlyDuration;\n\n if (options.transitionStyle) {\n var transitionStyle = [TRANSITION_PROP, options.transitionStyle];\n applyInlineStyle(node, transitionStyle);\n temporaryStyles.push(transitionStyle);\n }\n\n if (options.duration >= 0) {\n applyOnlyDuration = node.style[TRANSITION_PROP].length > 0;\n var durationStyle = getCssTransitionDurationStyle(options.duration, applyOnlyDuration);\n\n // we set the duration so that it will be picked up by getComputedStyle later\n applyInlineStyle(node, durationStyle);\n temporaryStyles.push(durationStyle);\n }\n\n if (options.keyframeStyle) {\n var keyframeStyle = [ANIMATION_PROP, options.keyframeStyle];\n applyInlineStyle(node, keyframeStyle);\n temporaryStyles.push(keyframeStyle);\n }\n\n var itemIndex = stagger\n ? options.staggerIndex >= 0\n ? options.staggerIndex\n : $$animateCache.count(cacheKey)\n : 0;\n\n var isFirst = itemIndex === 0;\n\n // this is a pre-emptive way of forcing the setup classes to be added and applied INSTANTLY\n // without causing any combination of transitions to kick in. By adding a negative delay value\n // it forces the setup class' transition to end immediately. We later then remove the negative\n // transition delay to allow for the transition to naturally do it's thing. The beauty here is\n // that if there is no transition defined then nothing will happen and this will also allow\n // other transitions to be stacked on top of each other without any chopping them out.\n if (isFirst && !options.skipBlocking) {\n helpers.blockTransitions(node, SAFE_FAST_FORWARD_DURATION_VALUE);\n }\n\n var timings = computeTimings(node, fullClassName, cacheKey, !isStructural);\n var relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n var flags = {};\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n flags.hasTransitionAll = flags.hasTransitions && timings.transitionProperty === 'all';\n flags.applyTransitionDuration = hasToStyles && (\n (flags.hasTransitions && !flags.hasTransitionAll)\n || (flags.hasAnimations && !flags.hasTransitions));\n flags.applyAnimationDuration = options.duration && flags.hasAnimations;\n flags.applyTransitionDelay = truthyTimingValue(options.delay) && (flags.applyTransitionDuration || flags.hasTransitions);\n flags.applyAnimationDelay = truthyTimingValue(options.delay) && flags.hasAnimations;\n flags.recalculateTimingStyles = addRemoveClassName.length > 0;\n\n if (flags.applyTransitionDuration || flags.applyAnimationDuration) {\n maxDuration = options.duration ? parseFloat(options.duration) : maxDuration;\n\n if (flags.applyTransitionDuration) {\n flags.hasTransitions = true;\n timings.transitionDuration = maxDuration;\n applyOnlyDuration = node.style[TRANSITION_PROP + PROPERTY_KEY].length > 0;\n temporaryStyles.push(getCssTransitionDurationStyle(maxDuration, applyOnlyDuration));\n }\n\n if (flags.applyAnimationDuration) {\n flags.hasAnimations = true;\n timings.animationDuration = maxDuration;\n temporaryStyles.push(getCssKeyframeDurationStyle(maxDuration));\n }\n }\n\n if (maxDuration === 0 && !flags.recalculateTimingStyles) {\n return closeAndReturnNoopAnimator();\n }\n\n var activeClasses = pendClasses(preparationClasses, ACTIVE_CLASS_SUFFIX);\n\n if (options.delay != null) {\n var delayStyle;\n if (typeof options.delay !== 'boolean') {\n delayStyle = parseFloat(options.delay);\n // number in options.delay means we have to recalculate the delay for the closing timeout\n maxDelay = Math.max(delayStyle, 0);\n }\n\n if (flags.applyTransitionDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle));\n }\n\n if (flags.applyAnimationDelay) {\n temporaryStyles.push(getCssDelayStyle(delayStyle, true));\n }\n }\n\n // we need to recalculate the delay value since we used a pre-emptive negative\n // delay value and the delay value is required for the final event checking. This\n // property will ensure that this will happen after the RAF phase has passed.\n if (options.duration == null && timings.transitionDuration > 0) {\n flags.recalculateTimingStyles = flags.recalculateTimingStyles || isFirst;\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n if (!options.skipBlocking) {\n flags.blockTransition = timings.transitionDuration > 0;\n flags.blockKeyframeAnimation = timings.animationDuration > 0 &&\n stagger.animationDelay > 0 &&\n stagger.animationDuration === 0;\n }\n\n if (options.from) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.from));\n }\n applyAnimationFromStyles(element, options);\n }\n\n if (flags.blockTransition || flags.blockKeyframeAnimation) {\n applyBlocking(maxDuration);\n } else if (!options.skipBlocking) {\n helpers.blockTransitions(node, false);\n }\n\n // TODO(matsko): for 1.5 change this code to have an animator object for better debugging\n return {\n $$willAnimate: true,\n end: endFn,\n start: function() {\n if (animationClosed) return;\n\n runnerHost = {\n end: endFn,\n cancel: cancelFn,\n resume: null, //this will be set during the start() phase\n pause: null\n };\n\n runner = new $$AnimateRunner(runnerHost);\n\n waitUntilQuiet(start);\n\n // we don't have access to pause/resume the animation\n // since it hasn't run yet. AnimateRunner will therefore\n // set noop functions for resume and pause and they will\n // later be overridden once the animation is triggered\n return runner;\n }\n };\n\n function endFn() {\n close();\n }\n\n function cancelFn() {\n close(true);\n }\n\n function close(rejected) {\n // if the promise has been called already then we shouldn't close\n // the animation again\n if (animationClosed || (animationCompleted && animationPaused)) return;\n animationClosed = true;\n animationPaused = false;\n\n if (preparationClasses && !options.$$skipPreparationClasses) {\n $$jqLite.removeClass(element, preparationClasses);\n }\n\n if (activeClasses) {\n $$jqLite.removeClass(element, activeClasses);\n }\n\n blockKeyframeAnimations(node, false);\n helpers.blockTransitions(node, false);\n\n forEach(temporaryStyles, function(entry) {\n // There is only one way to remove inline style properties entirely from elements.\n // By using `removeProperty` this works, but we need to convert camel-cased CSS\n // styles down to hyphenated values.\n node.style[entry[0]] = '';\n });\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n\n if (Object.keys(restoreStyles).length) {\n forEach(restoreStyles, function(value, prop) {\n if (value) {\n node.style.setProperty(prop, value);\n } else {\n node.style.removeProperty(prop);\n }\n });\n }\n\n // the reason why we have this option is to allow a synchronous closing callback\n // that is fired as SOON as the animation ends (when the CSS is removed) or if\n // the animation never takes off at all. A good example is a leave animation since\n // the element must be removed just after the animation is over or else the element\n // will appear on screen for one animation frame causing an overbearing flicker.\n if (options.onDone) {\n options.onDone();\n }\n\n if (events && events.length) {\n // Remove the transitionend / animationend listener(s)\n element.off(events.join(' '), onAnimationProgress);\n }\n\n //Cancel the fallback closing timeout and remove the timer data\n var animationTimerData = element.data(ANIMATE_TIMER_KEY);\n if (animationTimerData) {\n $timeout.cancel(animationTimerData[0].timer);\n element.removeData(ANIMATE_TIMER_KEY);\n }\n\n // if the preparation function fails then the promise is not setup\n if (runner) {\n runner.complete(!rejected);\n }\n }\n\n function applyBlocking(duration) {\n if (flags.blockTransition) {\n helpers.blockTransitions(node, duration);\n }\n\n if (flags.blockKeyframeAnimation) {\n blockKeyframeAnimations(node, !!duration);\n }\n }\n\n function closeAndReturnNoopAnimator() {\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: cancelFn\n });\n\n // should flush the cache animation\n waitUntilQuiet(noop);\n close();\n\n return {\n $$willAnimate: false,\n start: function() {\n return runner;\n },\n end: endFn\n };\n }\n\n function onAnimationProgress(event) {\n event.stopPropagation();\n var ev = event.originalEvent || event;\n\n if (ev.target !== node) {\n // Since TransitionEvent / AnimationEvent bubble up,\n // we have to ignore events by finished child animations\n return;\n }\n\n // we now always use `Date.now()` due to the recent changes with\n // event.timeStamp in Firefox, Webkit and Chrome (see #13494 for more info)\n var timeStamp = ev.$manualTimeStamp || Date.now();\n\n /* Firefox (or possibly just Gecko) likes to not round values up\n * when a ms measurement is used for the animation */\n var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));\n\n /* $manualTimeStamp is a mocked timeStamp value which is set\n * within browserTrigger(). This is only here so that tests can\n * mock animations properly. Real events fallback to event.timeStamp,\n * or, if they don't, then a timeStamp is automatically created for them.\n * We're checking to see if the timeStamp surpasses the expected delay,\n * but we're using elapsedTime instead of the timeStamp on the 2nd\n * pre-condition since animationPauseds sometimes close off early */\n if (Math.max(timeStamp - startTime, 0) >= maxDelayTime && elapsedTime >= maxDuration) {\n // we set this flag to ensure that if the transition is paused then, when resumed,\n // the animation will automatically close itself since transitions cannot be paused.\n animationCompleted = true;\n close();\n }\n }\n\n function start() {\n if (animationClosed) return;\n if (!node.parentNode) {\n close();\n return;\n }\n\n // even though we only pause keyframe animations here the pause flag\n // will still happen when transitions are used. Only the transition will\n // not be paused since that is not possible. If the animation ends when\n // paused then it will not complete until unpaused or cancelled.\n var playPause = function(playAnimation) {\n if (!animationCompleted) {\n animationPaused = !playAnimation;\n if (timings.animationDuration) {\n var value = blockKeyframeAnimations(node, animationPaused);\n if (animationPaused) {\n temporaryStyles.push(value);\n } else {\n removeFromArray(temporaryStyles, value);\n }\n }\n } else if (animationPaused && playAnimation) {\n animationPaused = false;\n close();\n }\n };\n\n // checking the stagger duration prevents an accidentally cascade of the CSS delay style\n // being inherited from the parent. If the transition duration is zero then we can safely\n // rely that the delay value is an intentional stagger delay style.\n var maxStagger = itemIndex > 0\n && ((timings.transitionDuration && stagger.transitionDuration === 0) ||\n (timings.animationDuration && stagger.animationDuration === 0))\n && Math.max(stagger.animationDelay, stagger.transitionDelay);\n if (maxStagger) {\n $timeout(triggerAnimationStart,\n Math.floor(maxStagger * itemIndex * ONE_SECOND),\n false);\n } else {\n triggerAnimationStart();\n }\n\n // this will decorate the existing promise runner with pause/resume methods\n runnerHost.resume = function() {\n playPause(true);\n };\n\n runnerHost.pause = function() {\n playPause(false);\n };\n\n function triggerAnimationStart() {\n // just incase a stagger animation kicks in when the animation\n // itself was cancelled entirely\n if (animationClosed) return;\n\n applyBlocking(false);\n\n forEach(temporaryStyles, function(entry) {\n var key = entry[0];\n var value = entry[1];\n node.style[key] = value;\n });\n\n applyAnimationClasses(element, options);\n $$jqLite.addClass(element, activeClasses);\n\n if (flags.recalculateTimingStyles) {\n fullClassName = node.getAttribute('class') + ' ' + preparationClasses;\n cacheKey = $$animateCache.cacheKey(node, method, options.addClass, options.removeClass);\n\n timings = computeTimings(node, fullClassName, cacheKey, false);\n relativeDelay = timings.maxDelay;\n maxDelay = Math.max(relativeDelay, 0);\n maxDuration = timings.maxDuration;\n\n if (maxDuration === 0) {\n close();\n return;\n }\n\n flags.hasTransitions = timings.transitionDuration > 0;\n flags.hasAnimations = timings.animationDuration > 0;\n }\n\n if (flags.applyAnimationDelay) {\n relativeDelay = typeof options.delay !== 'boolean' && truthyTimingValue(options.delay)\n ? parseFloat(options.delay)\n : relativeDelay;\n\n maxDelay = Math.max(relativeDelay, 0);\n timings.animationDelay = relativeDelay;\n delayStyle = getCssDelayStyle(relativeDelay, true);\n temporaryStyles.push(delayStyle);\n node.style[delayStyle[0]] = delayStyle[1];\n }\n\n maxDelayTime = maxDelay * ONE_SECOND;\n maxDurationTime = maxDuration * ONE_SECOND;\n\n if (options.easing) {\n var easeProp, easeVal = options.easing;\n if (flags.hasTransitions) {\n easeProp = TRANSITION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n if (flags.hasAnimations) {\n easeProp = ANIMATION_PROP + TIMING_KEY;\n temporaryStyles.push([easeProp, easeVal]);\n node.style[easeProp] = easeVal;\n }\n }\n\n if (timings.transitionDuration) {\n events.push(TRANSITIONEND_EVENT);\n }\n\n if (timings.animationDuration) {\n events.push(ANIMATIONEND_EVENT);\n }\n\n startTime = Date.now();\n var timerTime = maxDelayTime + CLOSING_TIME_BUFFER * maxDurationTime;\n var endTime = startTime + timerTime;\n\n var animationsData = element.data(ANIMATE_TIMER_KEY) || [];\n var setupFallbackTimer = true;\n if (animationsData.length) {\n var currentTimerData = animationsData[0];\n setupFallbackTimer = endTime > currentTimerData.expectedEndTime;\n if (setupFallbackTimer) {\n $timeout.cancel(currentTimerData.timer);\n } else {\n animationsData.push(close);\n }\n }\n\n if (setupFallbackTimer) {\n var timer = $timeout(onAnimationExpired, timerTime, false);\n animationsData[0] = {\n timer: timer,\n expectedEndTime: endTime\n };\n animationsData.push(close);\n element.data(ANIMATE_TIMER_KEY, animationsData);\n }\n\n if (events.length) {\n element.on(events.join(' '), onAnimationProgress);\n }\n\n if (options.to) {\n if (options.cleanupStyles) {\n registerRestorableStyles(restoreStyles, node, Object.keys(options.to));\n }\n applyAnimationToStyles(element, options);\n }\n }\n\n function onAnimationExpired() {\n var animationsData = element.data(ANIMATE_TIMER_KEY);\n\n // this will be false in the event that the element was\n // removed from the DOM (via a leave animation or something\n // similar)\n if (animationsData) {\n for (var i = 1; i < animationsData.length; i++) {\n animationsData[i]();\n }\n element.removeData(ANIMATE_TIMER_KEY);\n }\n }\n }\n };\n }];\n}];\n\nvar $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateCssDriver');\n\n var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';\n var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';\n\n var NG_OUT_ANCHOR_CLASS_NAME = 'ng-anchor-out';\n var NG_IN_ANCHOR_CLASS_NAME = 'ng-anchor-in';\n\n function isDocumentFragment(node) {\n return node.parentNode && node.parentNode.nodeType === 11;\n }\n\n this.$get = ['$animateCss', '$rootScope', '$$AnimateRunner', '$rootElement', '$sniffer', '$$jqLite', '$document',\n function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $sniffer, $$jqLite, $document) {\n\n // only browsers that support these properties can render animations\n if (!$sniffer.animations && !$sniffer.transitions) return noop;\n\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var rootBodyElement = jqLite(\n // this is to avoid using something that exists outside of the body\n // we also special case the doc fragment case because our unit test code\n // appends the $rootElement to the body after the app has been bootstrapped\n isDocumentFragment(rootNode) || bodyNode.contains(rootNode) ? rootNode : bodyNode\n );\n\n return function initDriverFn(animationDetails) {\n return animationDetails.from && animationDetails.to\n ? prepareFromToAnchorAnimation(animationDetails.from,\n animationDetails.to,\n animationDetails.classes,\n animationDetails.anchors)\n : prepareRegularAnimation(animationDetails);\n };\n\n function filterCssClasses(classes) {\n //remove all the `ng-` stuff\n return classes.replace(/\\bng-\\S+\\b/g, '');\n }\n\n function getUniqueValues(a, b) {\n if (isString(a)) a = a.split(' ');\n if (isString(b)) b = b.split(' ');\n return a.filter(function(val) {\n return b.indexOf(val) === -1;\n }).join(' ');\n }\n\n function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {\n var clone = jqLite(getDomNode(outAnchor).cloneNode(true));\n var startingClasses = filterCssClasses(getClassVal(clone));\n\n outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);\n\n clone.addClass(NG_ANIMATE_ANCHOR_CLASS_NAME);\n\n rootBodyElement.append(clone);\n\n var animatorIn, animatorOut = prepareOutAnimation();\n\n // the user may not end up using the `out` animation and\n // only making use of the `in` animation or vice-versa.\n // In either case we should allow this and not assume the\n // animation is over unless both animations are not used.\n if (!animatorOut) {\n animatorIn = prepareInAnimation();\n if (!animatorIn) {\n return end();\n }\n }\n\n var startingAnimator = animatorOut || animatorIn;\n\n return {\n start: function() {\n var runner;\n\n var currentAnimation = startingAnimator.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n if (!animatorIn) {\n animatorIn = prepareInAnimation();\n if (animatorIn) {\n currentAnimation = animatorIn.start();\n currentAnimation.done(function() {\n currentAnimation = null;\n end();\n runner.complete();\n });\n return currentAnimation;\n }\n }\n // in the event that there is no `in` animation\n end();\n runner.complete();\n });\n\n runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn\n });\n\n return runner;\n\n function endFn() {\n if (currentAnimation) {\n currentAnimation.end();\n }\n }\n }\n };\n\n function calculateAnchorStyles(anchor) {\n var styles = {};\n\n var coords = getDomNode(anchor).getBoundingClientRect();\n\n // we iterate directly since safari messes up and doesn't return\n // all the keys for the coords object when iterated\n forEach(['width','height','top','left'], function(key) {\n var value = coords[key];\n switch (key) {\n case 'top':\n value += bodyNode.scrollTop;\n break;\n case 'left':\n value += bodyNode.scrollLeft;\n break;\n }\n styles[key] = Math.floor(value) + 'px';\n });\n return styles;\n }\n\n function prepareOutAnimation() {\n var animator = $animateCss(clone, {\n addClass: NG_OUT_ANCHOR_CLASS_NAME,\n delay: true,\n from: calculateAnchorStyles(outAnchor)\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function getClassVal(element) {\n return element.attr('class') || '';\n }\n\n function prepareInAnimation() {\n var endingClasses = filterCssClasses(getClassVal(inAnchor));\n var toAdd = getUniqueValues(endingClasses, startingClasses);\n var toRemove = getUniqueValues(startingClasses, endingClasses);\n\n var animator = $animateCss(clone, {\n to: calculateAnchorStyles(inAnchor),\n addClass: NG_IN_ANCHOR_CLASS_NAME + ' ' + toAdd,\n removeClass: NG_OUT_ANCHOR_CLASS_NAME + ' ' + toRemove,\n delay: true\n });\n\n // read the comment within `prepareRegularAnimation` to understand\n // why this check is necessary\n return animator.$$willAnimate ? animator : null;\n }\n\n function end() {\n clone.remove();\n outAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n inAnchor.removeClass(NG_ANIMATE_SHIM_CLASS_NAME);\n }\n }\n\n function prepareFromToAnchorAnimation(from, to, classes, anchors) {\n var fromAnimation = prepareRegularAnimation(from, noop);\n var toAnimation = prepareRegularAnimation(to, noop);\n\n var anchorAnimations = [];\n forEach(anchors, function(anchor) {\n var outElement = anchor['out'];\n var inElement = anchor['in'];\n var animator = prepareAnchoredAnimation(classes, outElement, inElement);\n if (animator) {\n anchorAnimations.push(animator);\n }\n });\n\n // no point in doing anything when there are no elements to animate\n if (!fromAnimation && !toAnimation && anchorAnimations.length === 0) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n forEach(anchorAnimations, function(animation) {\n animationRunners.push(animation.start());\n });\n\n var runner = new $$AnimateRunner({\n end: endFn,\n cancel: endFn // CSS-driven animations cannot be cancelled, only ended\n });\n\n $$AnimateRunner.all(animationRunners, function(status) {\n runner.complete(status);\n });\n\n return runner;\n\n function endFn() {\n forEach(animationRunners, function(runner) {\n runner.end();\n });\n }\n }\n };\n }\n\n function prepareRegularAnimation(animationDetails) {\n var element = animationDetails.element;\n var options = animationDetails.options || {};\n\n if (animationDetails.structural) {\n options.event = animationDetails.event;\n options.structural = true;\n options.applyClassesEarly = true;\n\n // we special case the leave animation since we want to ensure that\n // the element is removed as soon as the animation is over. Otherwise\n // a flicker might appear or the element may not be removed at all\n if (animationDetails.event === 'leave') {\n options.onDone = options.domOperation;\n }\n }\n\n // We assign the preparationClasses as the actual animation event since\n // the internals of $animateCss will just suffix the event token values\n // with `-active` to trigger the animation.\n if (options.preparationClasses) {\n options.event = concatWithSpace(options.event, options.preparationClasses);\n }\n\n var animator = $animateCss(element, options);\n\n // the driver lookup code inside of $$animation attempts to spawn a\n // driver one by one until a driver returns a.$$willAnimate animator object.\n // $animateCss will always return an object, however, it will pass in\n // a flag as a hint as to whether an animation was detected or not\n return animator.$$willAnimate ? animator : null;\n }\n }];\n}];\n\n// TODO(matsko): use caching here to speed things up for detection\n// TODO(matsko): add documentation\n// by the time...\n\nvar $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',\n function($injector, $$AnimateRunner, $$jqLite) {\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n // $animateJs(element, 'enter');\n return function(element, event, classes, options) {\n var animationClosed = false;\n\n // the `classes` argument is optional and if it is not used\n // then the classes will be resolved from the element's className\n // property as well as options.addClass/options.removeClass.\n if (arguments.length === 3 && isObject(classes)) {\n options = classes;\n classes = null;\n }\n\n options = prepareAnimationOptions(options);\n if (!classes) {\n classes = element.attr('class') || '';\n if (options.addClass) {\n classes += ' ' + options.addClass;\n }\n if (options.removeClass) {\n classes += ' ' + options.removeClass;\n }\n }\n\n var classesToAdd = options.addClass;\n var classesToRemove = options.removeClass;\n\n // the lookupAnimations function returns a series of animation objects that are\n // matched up with one or more of the CSS classes. These animation objects are\n // defined via the module.animation factory function. If nothing is detected then\n // we don't return anything which then makes $animation query the next driver.\n var animations = lookupAnimations(classes);\n var before, after;\n if (animations.length) {\n var afterFn, beforeFn;\n if (event === 'leave') {\n beforeFn = 'leave';\n afterFn = 'afterLeave'; // TODO(matsko): get rid of this\n } else {\n beforeFn = 'before' + event.charAt(0).toUpperCase() + event.substr(1);\n afterFn = event;\n }\n\n if (event !== 'enter' && event !== 'move') {\n before = packageAnimations(element, event, options, animations, beforeFn);\n }\n after = packageAnimations(element, event, options, animations, afterFn);\n }\n\n // no matching animations\n if (!before && !after) return;\n\n function applyOptions() {\n options.domOperation();\n applyAnimationClasses(element, options);\n }\n\n function close() {\n animationClosed = true;\n applyOptions();\n applyAnimationStyles(element, options);\n }\n\n var runner;\n\n return {\n $$willAnimate: true,\n end: function() {\n if (runner) {\n runner.end();\n } else {\n close();\n runner = new $$AnimateRunner();\n runner.complete(true);\n }\n return runner;\n },\n start: function() {\n if (runner) {\n return runner;\n }\n\n runner = new $$AnimateRunner();\n var closeActiveAnimations;\n var chain = [];\n\n if (before) {\n chain.push(function(fn) {\n closeActiveAnimations = before(fn);\n });\n }\n\n if (chain.length) {\n chain.push(function(fn) {\n applyOptions();\n fn(true);\n });\n } else {\n applyOptions();\n }\n\n if (after) {\n chain.push(function(fn) {\n closeActiveAnimations = after(fn);\n });\n }\n\n runner.setHost({\n end: function() {\n endAnimations();\n },\n cancel: function() {\n endAnimations(true);\n }\n });\n\n $$AnimateRunner.chain(chain, onComplete);\n return runner;\n\n function onComplete(success) {\n close(success);\n runner.complete(success);\n }\n\n function endAnimations(cancelled) {\n if (!animationClosed) {\n (closeActiveAnimations || noop)(cancelled);\n onComplete(cancelled);\n }\n }\n }\n };\n\n function executeAnimationFn(fn, element, event, options, onDone) {\n var args;\n switch (event) {\n case 'animate':\n args = [element, options.from, options.to, onDone];\n break;\n\n case 'setClass':\n args = [element, classesToAdd, classesToRemove, onDone];\n break;\n\n case 'addClass':\n args = [element, classesToAdd, onDone];\n break;\n\n case 'removeClass':\n args = [element, classesToRemove, onDone];\n break;\n\n default:\n args = [element, onDone];\n break;\n }\n\n args.push(options);\n\n var value = fn.apply(fn, args);\n if (value) {\n if (isFunction(value.start)) {\n value = value.start();\n }\n\n if (value instanceof $$AnimateRunner) {\n value.done(onDone);\n } else if (isFunction(value)) {\n // optional onEnd / onCancel callback\n return value;\n }\n }\n\n return noop;\n }\n\n function groupEventedAnimations(element, event, options, animations, fnName) {\n var operations = [];\n forEach(animations, function(ani) {\n var animation = ani[fnName];\n if (!animation) return;\n\n // note that all of these animations will run in parallel\n operations.push(function() {\n var runner;\n var endProgressCb;\n\n var resolved = false;\n var onAnimationComplete = function(rejected) {\n if (!resolved) {\n resolved = true;\n (endProgressCb || noop)(rejected);\n runner.complete(!rejected);\n }\n };\n\n runner = new $$AnimateRunner({\n end: function() {\n onAnimationComplete();\n },\n cancel: function() {\n onAnimationComplete(true);\n }\n });\n\n endProgressCb = executeAnimationFn(animation, element, event, options, function(result) {\n var cancelled = result === false;\n onAnimationComplete(cancelled);\n });\n\n return runner;\n });\n });\n\n return operations;\n }\n\n function packageAnimations(element, event, options, animations, fnName) {\n var operations = groupEventedAnimations(element, event, options, animations, fnName);\n if (operations.length === 0) {\n var a, b;\n if (fnName === 'beforeSetClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'beforeRemoveClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'beforeAddClass');\n } else if (fnName === 'setClass') {\n a = groupEventedAnimations(element, 'removeClass', options, animations, 'removeClass');\n b = groupEventedAnimations(element, 'addClass', options, animations, 'addClass');\n }\n\n if (a) {\n operations = operations.concat(a);\n }\n if (b) {\n operations = operations.concat(b);\n }\n }\n\n if (operations.length === 0) return;\n\n // TODO(matsko): add documentation\n return function startAnimation(callback) {\n var runners = [];\n if (operations.length) {\n forEach(operations, function(animateFn) {\n runners.push(animateFn());\n });\n }\n\n if (runners.length) {\n $$AnimateRunner.all(runners, callback);\n } else {\n callback();\n }\n\n return function endFn(reject) {\n forEach(runners, function(runner) {\n if (reject) {\n runner.cancel();\n } else {\n runner.end();\n }\n });\n };\n };\n }\n };\n\n function lookupAnimations(classes) {\n classes = isArray(classes) ? classes : classes.split(' ');\n var matches = [], flagMap = {};\n for (var i = 0; i < classes.length; i++) {\n var klass = classes[i],\n animationFactory = $animateProvider.$$registeredAnimations[klass];\n if (animationFactory && !flagMap[klass]) {\n matches.push($injector.get(animationFactory));\n flagMap[klass] = true;\n }\n }\n return matches;\n }\n }];\n}];\n\nvar $$AnimateJsDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {\n $$animationProvider.drivers.push('$$animateJsDriver');\n this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {\n return function initDriverFn(animationDetails) {\n if (animationDetails.from && animationDetails.to) {\n var fromAnimation = prepareAnimation(animationDetails.from);\n var toAnimation = prepareAnimation(animationDetails.to);\n if (!fromAnimation && !toAnimation) return;\n\n return {\n start: function() {\n var animationRunners = [];\n\n if (fromAnimation) {\n animationRunners.push(fromAnimation.start());\n }\n\n if (toAnimation) {\n animationRunners.push(toAnimation.start());\n }\n\n $$AnimateRunner.all(animationRunners, done);\n\n var runner = new $$AnimateRunner({\n end: endFnFactory(),\n cancel: endFnFactory()\n });\n\n return runner;\n\n function endFnFactory() {\n return function() {\n forEach(animationRunners, function(runner) {\n // at this point we cannot cancel animations for groups just yet. 1.5+\n runner.end();\n });\n };\n }\n\n function done(status) {\n runner.complete(status);\n }\n }\n };\n } else {\n return prepareAnimation(animationDetails);\n }\n };\n\n function prepareAnimation(animationDetails) {\n // TODO(matsko): make sure to check for grouped animations and delegate down to normal animations\n var element = animationDetails.element;\n var event = animationDetails.event;\n var options = animationDetails.options;\n var classes = animationDetails.classes;\n return $$animateJs(element, event, classes, options);\n }\n }];\n}];\n\nvar NG_ANIMATE_ATTR_NAME = 'data-ng-animate';\nvar NG_ANIMATE_PIN_DATA = '$ngAnimatePin';\nvar $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n var PRE_DIGEST_STATE = 1;\n var RUNNING_STATE = 2;\n var ONE_SPACE = ' ';\n\n var rules = this.rules = {\n skip: [],\n cancel: [],\n join: []\n };\n\n function getEventData(options) {\n return {\n addClass: options.addClass,\n removeClass: options.removeClass,\n from: options.from,\n to: options.to\n };\n }\n\n function makeTruthyCssClassMap(classString) {\n if (!classString) {\n return null;\n }\n\n var keys = classString.split(ONE_SPACE);\n var map = Object.create(null);\n\n forEach(keys, function(key) {\n map[key] = true;\n });\n return map;\n }\n\n function hasMatchingClasses(newClassString, currentClassString) {\n if (newClassString && currentClassString) {\n var currentClassMap = makeTruthyCssClassMap(currentClassString);\n return newClassString.split(ONE_SPACE).some(function(className) {\n return currentClassMap[className];\n });\n }\n }\n\n function isAllowed(ruleType, currentAnimation, previousAnimation) {\n return rules[ruleType].some(function(fn) {\n return fn(currentAnimation, previousAnimation);\n });\n }\n\n function hasAnimationClasses(animation, and) {\n var a = (animation.addClass || '').length > 0;\n var b = (animation.removeClass || '').length > 0;\n return and ? a && b : a || b;\n }\n\n rules.join.push(function(newAnimation, currentAnimation) {\n // if the new animation is class-based then we can just tack that on\n return !newAnimation.structural && hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // there is no need to animate anything if no classes are being added and\n // there is no structural animation that will be triggered\n return !newAnimation.structural && !hasAnimationClasses(newAnimation);\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // why should we trigger a new structural animation if the element will\n // be removed from the DOM anyway?\n return currentAnimation.event === 'leave' && newAnimation.structural;\n });\n\n rules.skip.push(function(newAnimation, currentAnimation) {\n // if there is an ongoing current animation then don't even bother running the class-based animation\n return currentAnimation.structural && currentAnimation.state === RUNNING_STATE && !newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // there can never be two structural animations running at the same time\n return currentAnimation.structural && newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // if the previous animation is already running, but the new animation will\n // be triggered, but the new animation is structural\n return currentAnimation.state === RUNNING_STATE && newAnimation.structural;\n });\n\n rules.cancel.push(function(newAnimation, currentAnimation) {\n // cancel the animation if classes added / removed in both animation cancel each other out,\n // but only if the current animation isn't structural\n\n if (currentAnimation.structural) return false;\n\n var nA = newAnimation.addClass;\n var nR = newAnimation.removeClass;\n var cA = currentAnimation.addClass;\n var cR = currentAnimation.removeClass;\n\n // early detection to save the global CPU shortage :)\n if ((isUndefined(nA) && isUndefined(nR)) || (isUndefined(cA) && isUndefined(cR))) {\n return false;\n }\n\n return hasMatchingClasses(nA, cR) || hasMatchingClasses(nR, cA);\n });\n\n this.$get = ['$$rAF', '$rootScope', '$rootElement', '$document', '$$Map',\n '$$animation', '$$AnimateRunner', '$templateRequest', '$$jqLite', '$$forceReflow',\n '$$isDocumentHidden',\n function($$rAF, $rootScope, $rootElement, $document, $$Map,\n $$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,\n $$isDocumentHidden) {\n\n var activeAnimationsLookup = new $$Map();\n var disabledElementsLookup = new $$Map();\n var animationsEnabled = null;\n\n function removeFromDisabledElementsLookup(evt) {\n disabledElementsLookup.delete(evt.target);\n }\n\n function postDigestTaskFactory() {\n var postDigestCalled = false;\n return function(fn) {\n // we only issue a call to postDigest before\n // it has first passed. This prevents any callbacks\n // from not firing once the animation has completed\n // since it will be out of the digest cycle.\n if (postDigestCalled) {\n fn();\n } else {\n $rootScope.$$postDigest(function() {\n postDigestCalled = true;\n fn();\n });\n }\n };\n }\n\n // Wait until all directive and route-related templates are downloaded and\n // compiled. The $templateRequest.totalPendingRequests variable keeps track of\n // all of the remote templates being currently downloaded. If there are no\n // templates currently downloading then the watcher will still fire anyway.\n var deregisterWatch = $rootScope.$watch(\n function() { return $templateRequest.totalPendingRequests === 0; },\n function(isEmpty) {\n if (!isEmpty) return;\n deregisterWatch();\n\n // Now that all templates have been downloaded, $animate will wait until\n // the post digest queue is empty before enabling animations. By having two\n // calls to $postDigest calls we can ensure that the flag is enabled at the\n // very end of the post digest queue. Since all of the animations in $animate\n // use $postDigest, it's important that the code below executes at the end.\n // This basically means that the page is fully downloaded and compiled before\n // any animations are triggered.\n $rootScope.$$postDigest(function() {\n $rootScope.$$postDigest(function() {\n // we check for null directly in the event that the application already called\n // .enabled() with whatever arguments that it provided it with\n if (animationsEnabled === null) {\n animationsEnabled = true;\n }\n });\n });\n }\n );\n\n var callbackRegistry = Object.create(null);\n\n // remember that the `customFilter`/`classNameFilter` are set during the\n // provider/config stage therefore we can optimize here and setup helper functions\n var customFilter = $animateProvider.customFilter();\n var classNameFilter = $animateProvider.classNameFilter();\n var returnTrue = function() { return true; };\n\n var isAnimatableByFilter = customFilter || returnTrue;\n var isAnimatableClassName = !classNameFilter ? returnTrue : function(node, options) {\n var className = [node.getAttribute('class'), options.addClass, options.removeClass].join(' ');\n return classNameFilter.test(className);\n };\n\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function normalizeAnimationDetails(element, animation) {\n return mergeAnimationDetails(element, animation, {});\n }\n\n // IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\n var contains = window.Node.prototype.contains || /** @this */ function(arg) {\n // eslint-disable-next-line no-bitwise\n return this === arg || !!(this.compareDocumentPosition(arg) & 16);\n };\n\n function findCallbacks(targetParentNode, targetNode, event) {\n var matches = [];\n var entries = callbackRegistry[event];\n if (entries) {\n forEach(entries, function(entry) {\n if (contains.call(entry.node, targetNode)) {\n matches.push(entry.callback);\n } else if (event === 'leave' && contains.call(entry.node, targetParentNode)) {\n matches.push(entry.callback);\n }\n });\n }\n\n return matches;\n }\n\n function filterFromRegistry(list, matchContainer, matchCallback) {\n var containerNode = extractElementNode(matchContainer);\n return list.filter(function(entry) {\n var isMatch = entry.node === containerNode &&\n (!matchCallback || entry.callback === matchCallback);\n return !isMatch;\n });\n }\n\n function cleanupEventListeners(phase, node) {\n if (phase === 'close' && !node.parentNode) {\n // If the element is not attached to a parentNode, it has been removed by\n // the domOperation, and we can safely remove the event callbacks\n $animate.off(node);\n }\n }\n\n var $animate = {\n on: function(event, container, callback) {\n var node = extractElementNode(container);\n callbackRegistry[event] = callbackRegistry[event] || [];\n callbackRegistry[event].push({\n node: node,\n callback: callback\n });\n\n // Remove the callback when the element is removed from the DOM\n jqLite(container).on('$destroy', function() {\n var animationDetails = activeAnimationsLookup.get(node);\n\n if (!animationDetails) {\n // If there's an animation ongoing, the callback calling code will remove\n // the event listeners. If we'd remove here, the callbacks would be removed\n // before the animation ends\n $animate.off(event, container, callback);\n }\n });\n },\n\n off: function(event, container, callback) {\n if (arguments.length === 1 && !isString(arguments[0])) {\n container = arguments[0];\n for (var eventType in callbackRegistry) {\n callbackRegistry[eventType] = filterFromRegistry(callbackRegistry[eventType], container);\n }\n\n return;\n }\n\n var entries = callbackRegistry[event];\n if (!entries) return;\n\n callbackRegistry[event] = arguments.length === 1\n ? null\n : filterFromRegistry(entries, container, callback);\n },\n\n pin: function(element, parentElement) {\n assertArg(isElement(element), 'element', 'not an element');\n assertArg(isElement(parentElement), 'parentElement', 'not an element');\n element.data(NG_ANIMATE_PIN_DATA, parentElement);\n },\n\n push: function(element, event, options, domOperation) {\n options = options || {};\n options.domOperation = domOperation;\n return queueAnimation(element, event, options);\n },\n\n // this method has four signatures:\n // () - global getter\n // (bool) - global setter\n // (element) - element getter\n // (element, bool) - element setter\n enabled: function(element, bool) {\n var argCount = arguments.length;\n\n if (argCount === 0) {\n // () - Global getter\n bool = !!animationsEnabled;\n } else {\n var hasElement = isElement(element);\n\n if (!hasElement) {\n // (bool) - Global setter\n bool = animationsEnabled = !!element;\n } else {\n var node = getDomNode(element);\n\n if (argCount === 1) {\n // (element) - Element getter\n bool = !disabledElementsLookup.get(node);\n } else {\n // (element, bool) - Element setter\n if (!disabledElementsLookup.has(node)) {\n // The element is added to the map for the first time.\n // Create a listener to remove it on `$destroy` (to avoid memory leak).\n jqLite(element).on('$destroy', removeFromDisabledElementsLookup);\n }\n disabledElementsLookup.set(node, !bool);\n }\n }\n }\n\n return bool;\n }\n };\n\n return $animate;\n\n function queueAnimation(originalElement, event, initialOptions) {\n // we always make a copy of the options since\n // there should never be any side effects on\n // the input data when running `$animateCss`.\n var options = copy(initialOptions);\n\n var element = stripCommentsFromElement(originalElement);\n var node = getDomNode(element);\n var parentNode = node && node.parentNode;\n\n options = prepareAnimationOptions(options);\n\n // we create a fake runner with a working promise.\n // These methods will become available after the digest has passed\n var runner = new $$AnimateRunner();\n\n // this is used to trigger callbacks in postDigest mode\n var runInNextPostDigestOrNow = postDigestTaskFactory();\n\n if (isArray(options.addClass)) {\n options.addClass = options.addClass.join(' ');\n }\n\n if (options.addClass && !isString(options.addClass)) {\n options.addClass = null;\n }\n\n if (isArray(options.removeClass)) {\n options.removeClass = options.removeClass.join(' ');\n }\n\n if (options.removeClass && !isString(options.removeClass)) {\n options.removeClass = null;\n }\n\n if (options.from && !isObject(options.from)) {\n options.from = null;\n }\n\n if (options.to && !isObject(options.to)) {\n options.to = null;\n }\n\n // If animations are hard-disabled for the whole application there is no need to continue.\n // There are also situations where a directive issues an animation for a jqLite wrapper that\n // contains only comment nodes. In this case, there is no way we can perform an animation.\n if (!animationsEnabled ||\n !node ||\n !isAnimatableByFilter(node, event, initialOptions) ||\n !isAnimatableClassName(node, options)) {\n close();\n return runner;\n }\n\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n var documentHidden = $$isDocumentHidden();\n\n // This is a hard disable of all animations the element itself, therefore there is no need to\n // continue further past this point if not enabled\n // Animations are also disabled if the document is currently hidden (page is not visible\n // to the user), because browsers slow down or do not flush calls to requestAnimationFrame\n var skipAnimations = documentHidden || disabledElementsLookup.get(node);\n var existingAnimation = (!skipAnimations && activeAnimationsLookup.get(node)) || {};\n var hasExistingAnimation = !!existingAnimation.state;\n\n // there is no point in traversing the same collection of parent ancestors if a followup\n // animation will be run on the same element that already did all that checking work\n if (!skipAnimations && (!hasExistingAnimation || existingAnimation.state !== PRE_DIGEST_STATE)) {\n skipAnimations = !areAnimationsAllowed(node, parentNode, event);\n }\n\n if (skipAnimations) {\n // Callbacks should fire even if the document is hidden (regression fix for issue #14120)\n if (documentHidden) notifyProgress(runner, event, 'start', getEventData(options));\n close();\n if (documentHidden) notifyProgress(runner, event, 'close', getEventData(options));\n return runner;\n }\n\n if (isStructural) {\n closeChildAnimations(node);\n }\n\n var newAnimation = {\n structural: isStructural,\n element: element,\n event: event,\n addClass: options.addClass,\n removeClass: options.removeClass,\n close: close,\n options: options,\n runner: runner\n };\n\n if (hasExistingAnimation) {\n var skipAnimationFlag = isAllowed('skip', newAnimation, existingAnimation);\n if (skipAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n close();\n return runner;\n } else {\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n return existingAnimation.runner;\n }\n }\n var cancelAnimationFlag = isAllowed('cancel', newAnimation, existingAnimation);\n if (cancelAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n // this will end the animation right away and it is safe\n // to do so since the animation is already running and the\n // runner callback code will run in async\n existingAnimation.runner.end();\n } else if (existingAnimation.structural) {\n // this means that the animation is queued into a digest, but\n // hasn't started yet. Therefore it is safe to run the close\n // method which will call the runner methods in async.\n existingAnimation.close();\n } else {\n // this will merge the new animation options into existing animation options\n mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n return existingAnimation.runner;\n }\n } else {\n // a joined animation means that this animation will take over the existing one\n // so an example would involve a leave animation taking over an enter. Then when\n // the postDigest kicks in the enter will be ignored.\n var joinAnimationFlag = isAllowed('join', newAnimation, existingAnimation);\n if (joinAnimationFlag) {\n if (existingAnimation.state === RUNNING_STATE) {\n normalizeAnimationDetails(element, newAnimation);\n } else {\n applyGeneratedPreparationClasses($$jqLite, element, isStructural ? event : null, options);\n\n event = newAnimation.event = existingAnimation.event;\n options = mergeAnimationDetails(element, existingAnimation, newAnimation);\n\n //we return the same runner since only the option values of this animation will\n //be fed into the `existingAnimation`.\n return existingAnimation.runner;\n }\n }\n }\n } else {\n // normalization in this case means that it removes redundant CSS classes that\n // already exist (addClass) or do not exist (removeClass) on the element\n normalizeAnimationDetails(element, newAnimation);\n }\n\n // when the options are merged and cleaned up we may end up not having to do\n // an animation at all, therefore we should check this before issuing a post\n // digest callback. Structural animations will always run no matter what.\n var isValidAnimation = newAnimation.structural;\n if (!isValidAnimation) {\n // animate (from/to) can be quickly checked first, otherwise we check if any classes are present\n isValidAnimation = (newAnimation.event === 'animate' && Object.keys(newAnimation.options.to || {}).length > 0)\n || hasAnimationClasses(newAnimation);\n }\n\n if (!isValidAnimation) {\n close();\n clearElementAnimationState(node);\n return runner;\n }\n\n // the counter keeps track of cancelled animations\n var counter = (existingAnimation.counter || 0) + 1;\n newAnimation.counter = counter;\n\n markElementAnimationState(node, PRE_DIGEST_STATE, newAnimation);\n\n $rootScope.$$postDigest(function() {\n // It is possible that the DOM nodes inside `originalElement` have been replaced. This can\n // happen if the animated element is a transcluded clone and also has a `templateUrl`\n // directive on it. Therefore, we must recreate `element` in order to interact with the\n // actual DOM nodes.\n // Note: We still need to use the old `node` for certain things, such as looking up in\n // HashMaps where it was used as the key.\n\n element = stripCommentsFromElement(originalElement);\n\n var animationDetails = activeAnimationsLookup.get(node);\n var animationCancelled = !animationDetails;\n animationDetails = animationDetails || {};\n\n // if addClass/removeClass is called before something like enter then the\n // registered parent element may not be present. The code below will ensure\n // that a final value for parent element is obtained\n var parentElement = element.parent() || [];\n\n // animate/structural/class-based animations all have requirements. Otherwise there\n // is no point in performing an animation. The parent node must also be set.\n var isValidAnimation = parentElement.length > 0\n && (animationDetails.event === 'animate'\n || animationDetails.structural\n || hasAnimationClasses(animationDetails));\n\n // this means that the previous animation was cancelled\n // even if the follow-up animation is the same event\n if (animationCancelled || animationDetails.counter !== counter || !isValidAnimation) {\n // if another animation did not take over then we need\n // to make sure that the domOperation and options are\n // handled accordingly\n if (animationCancelled) {\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n }\n\n // if the event changed from something like enter to leave then we do\n // it, otherwise if it's the same then the end result will be the same too\n if (animationCancelled || (isStructural && animationDetails.event !== event)) {\n options.domOperation();\n runner.end();\n }\n\n // in the event that the element animation was not cancelled or a follow-up animation\n // isn't allowed to animate from here then we need to clear the state of the element\n // so that any future animations won't read the expired animation data.\n if (!isValidAnimation) {\n clearElementAnimationState(node);\n }\n\n return;\n }\n\n // this combined multiple class to addClass / removeClass into a setClass event\n // so long as a structural event did not take over the animation\n event = !animationDetails.structural && hasAnimationClasses(animationDetails, true)\n ? 'setClass'\n : animationDetails.event;\n\n markElementAnimationState(node, RUNNING_STATE);\n var realRunner = $$animation(element, event, animationDetails.options);\n\n // this will update the runner's flow-control events based on\n // the `realRunner` object.\n runner.setHost(realRunner);\n notifyProgress(runner, event, 'start', getEventData(options));\n\n realRunner.done(function(status) {\n close(!status);\n var animationDetails = activeAnimationsLookup.get(node);\n if (animationDetails && animationDetails.counter === counter) {\n clearElementAnimationState(node);\n }\n notifyProgress(runner, event, 'close', getEventData(options));\n });\n });\n\n return runner;\n\n function notifyProgress(runner, event, phase, data) {\n runInNextPostDigestOrNow(function() {\n var callbacks = findCallbacks(parentNode, node, event);\n if (callbacks.length) {\n // do not optimize this call here to RAF because\n // we don't know how heavy the callback code here will\n // be and if this code is buffered then this can\n // lead to a performance regression.\n $$rAF(function() {\n forEach(callbacks, function(callback) {\n callback(element, phase, data);\n });\n cleanupEventListeners(phase, node);\n });\n } else {\n cleanupEventListeners(phase, node);\n }\n });\n runner.progress(event, phase, data);\n }\n\n function close(reject) {\n clearGeneratedClasses(element, options);\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n runner.complete(!reject);\n }\n }\n\n function closeChildAnimations(node) {\n var children = node.querySelectorAll('[' + NG_ANIMATE_ATTR_NAME + ']');\n forEach(children, function(child) {\n var state = parseInt(child.getAttribute(NG_ANIMATE_ATTR_NAME), 10);\n var animationDetails = activeAnimationsLookup.get(child);\n if (animationDetails) {\n switch (state) {\n case RUNNING_STATE:\n animationDetails.runner.end();\n /* falls through */\n case PRE_DIGEST_STATE:\n activeAnimationsLookup.delete(child);\n break;\n }\n }\n });\n }\n\n function clearElementAnimationState(node) {\n node.removeAttribute(NG_ANIMATE_ATTR_NAME);\n activeAnimationsLookup.delete(node);\n }\n\n /**\n * This fn returns false if any of the following is true:\n * a) animations on any parent element are disabled, and animations on the element aren't explicitly allowed\n * b) a parent element has an ongoing structural animation, and animateChildren is false\n * c) the element is not a child of the body\n * d) the element is not a child of the $rootElement\n */\n function areAnimationsAllowed(node, parentNode, event) {\n var bodyNode = $document[0].body;\n var rootNode = getDomNode($rootElement);\n\n var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';\n var rootNodeDetected = (node === rootNode);\n var parentAnimationDetected = false;\n var elementDisabled = disabledElementsLookup.get(node);\n var animateChildren;\n\n var parentHost = jqLite.data(node, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n parentNode = getDomNode(parentHost);\n }\n\n while (parentNode) {\n if (!rootNodeDetected) {\n // AngularJS doesn't want to attempt to animate elements outside of the application\n // therefore we need to ensure that the rootElement is an ancestor of the current element\n rootNodeDetected = (parentNode === rootNode);\n }\n\n if (parentNode.nodeType !== ELEMENT_NODE) {\n // no point in inspecting the #document element\n break;\n }\n\n var details = activeAnimationsLookup.get(parentNode) || {};\n // either an enter, leave or move animation will commence\n // therefore we can't allow any animations to take place\n // but if a parent animation is class-based then that's ok\n if (!parentAnimationDetected) {\n var parentNodeDisabled = disabledElementsLookup.get(parentNode);\n\n if (parentNodeDisabled === true && elementDisabled !== false) {\n // disable animations if the user hasn't explicitly enabled animations on the\n // current element\n elementDisabled = true;\n // element is disabled via parent element, no need to check anything else\n break;\n } else if (parentNodeDisabled === false) {\n elementDisabled = false;\n }\n parentAnimationDetected = details.structural;\n }\n\n if (isUndefined(animateChildren) || animateChildren === true) {\n var value = jqLite.data(parentNode, NG_ANIMATE_CHILDREN_DATA);\n if (isDefined(value)) {\n animateChildren = value;\n }\n }\n\n // there is no need to continue traversing at this point\n if (parentAnimationDetected && animateChildren === false) break;\n\n if (!bodyNodeDetected) {\n // we also need to ensure that the element is or will be a part of the body element\n // otherwise it is pointless to even issue an animation to be rendered\n bodyNodeDetected = (parentNode === bodyNode);\n }\n\n if (bodyNodeDetected && rootNodeDetected) {\n // If both body and root have been found, any other checks are pointless,\n // as no animation data should live outside the application\n break;\n }\n\n if (!rootNodeDetected) {\n // If `rootNode` is not detected, check if `parentNode` is pinned to another element\n parentHost = jqLite.data(parentNode, NG_ANIMATE_PIN_DATA);\n if (parentHost) {\n // The pin target element becomes the next parent element\n parentNode = getDomNode(parentHost);\n continue;\n }\n }\n\n parentNode = parentNode.parentNode;\n }\n\n var allowAnimation = (!parentAnimationDetected || animateChildren) && elementDisabled !== true;\n return allowAnimation && rootNodeDetected && bodyNodeDetected;\n }\n\n function markElementAnimationState(node, state, details) {\n details = details || {};\n details.state = state;\n\n node.setAttribute(NG_ANIMATE_ATTR_NAME, state);\n\n var oldValue = activeAnimationsLookup.get(node);\n var newValue = oldValue\n ? extend(oldValue, details)\n : details;\n activeAnimationsLookup.set(node, newValue);\n }\n }];\n}];\n\n/** @this */\nvar $$AnimateCacheProvider = function() {\n\n var KEY = '$$ngAnimateParentKey';\n var parentCounter = 0;\n var cache = Object.create(null);\n\n this.$get = [function() {\n return {\n cacheKey: function(node, method, addClass, removeClass) {\n var parentNode = node.parentNode;\n var parentID = parentNode[KEY] || (parentNode[KEY] = ++parentCounter);\n var parts = [parentID, method, node.getAttribute('class')];\n if (addClass) {\n parts.push(addClass);\n }\n if (removeClass) {\n parts.push(removeClass);\n }\n return parts.join(' ');\n },\n\n containsCachedAnimationWithoutDuration: function(key) {\n var entry = cache[key];\n\n // nothing cached, so go ahead and animate\n // otherwise it should be a valid animation\n return (entry && !entry.isValid) || false;\n },\n\n flush: function() {\n cache = Object.create(null);\n },\n\n count: function(key) {\n var entry = cache[key];\n return entry ? entry.total : 0;\n },\n\n get: function(key) {\n var entry = cache[key];\n return entry && entry.value;\n },\n\n put: function(key, value, isValid) {\n if (!cache[key]) {\n cache[key] = { total: 1, value: value, isValid: isValid };\n } else {\n cache[key].total++;\n cache[key].value = value;\n }\n }\n };\n }];\n};\n\n/* exported $$AnimationProvider */\n\nvar $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {\n var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';\n\n var drivers = this.drivers = [];\n\n var RUNNER_STORAGE_KEY = '$$animationRunner';\n var PREPARE_CLASSES_KEY = '$$animatePrepareClasses';\n\n function setRunner(element, runner) {\n element.data(RUNNER_STORAGE_KEY, runner);\n }\n\n function removeRunner(element) {\n element.removeData(RUNNER_STORAGE_KEY);\n }\n\n function getRunner(element) {\n return element.data(RUNNER_STORAGE_KEY);\n }\n\n this.$get = ['$$jqLite', '$rootScope', '$injector', '$$AnimateRunner', '$$Map', '$$rAFScheduler', '$$animateCache',\n function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) {\n\n var animationQueue = [];\n var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);\n\n function sortAnimations(animations) {\n var tree = { children: [] };\n var i, lookup = new $$Map();\n\n // this is done first beforehand so that the map\n // is filled with a list of the elements that will be animated\n for (i = 0; i < animations.length; i++) {\n var animation = animations[i];\n lookup.set(animation.domNode, animations[i] = {\n domNode: animation.domNode,\n element: animation.element,\n fn: animation.fn,\n children: []\n });\n }\n\n for (i = 0; i < animations.length; i++) {\n processNode(animations[i]);\n }\n\n return flatten(tree);\n\n function processNode(entry) {\n if (entry.processed) return entry;\n entry.processed = true;\n\n var elementNode = entry.domNode;\n var parentNode = elementNode.parentNode;\n lookup.set(elementNode, entry);\n\n var parentEntry;\n while (parentNode) {\n parentEntry = lookup.get(parentNode);\n if (parentEntry) {\n if (!parentEntry.processed) {\n parentEntry = processNode(parentEntry);\n }\n break;\n }\n parentNode = parentNode.parentNode;\n }\n\n (parentEntry || tree).children.push(entry);\n return entry;\n }\n\n function flatten(tree) {\n var result = [];\n var queue = [];\n var i;\n\n for (i = 0; i < tree.children.length; i++) {\n queue.push(tree.children[i]);\n }\n\n var remainingLevelEntries = queue.length;\n var nextLevelEntries = 0;\n var row = [];\n\n for (i = 0; i < queue.length; i++) {\n var entry = queue[i];\n if (remainingLevelEntries <= 0) {\n remainingLevelEntries = nextLevelEntries;\n nextLevelEntries = 0;\n result.push(row);\n row = [];\n }\n row.push(entry);\n entry.children.forEach(function(childEntry) {\n nextLevelEntries++;\n queue.push(childEntry);\n });\n remainingLevelEntries--;\n }\n\n if (row.length) {\n result.push(row);\n }\n\n return result;\n }\n }\n\n // TODO(matsko): document the signature in a better way\n return function(element, event, options) {\n options = prepareAnimationOptions(options);\n var isStructural = ['enter', 'move', 'leave'].indexOf(event) >= 0;\n\n // there is no animation at the current moment, however\n // these runner methods will get later updated with the\n // methods leading into the driver's end/cancel methods\n // for now they just stop the animation from starting\n var runner = new $$AnimateRunner({\n end: function() { close(); },\n cancel: function() { close(true); }\n });\n\n if (!drivers.length) {\n close();\n return runner;\n }\n\n var classes = mergeClasses(element.attr('class'), mergeClasses(options.addClass, options.removeClass));\n var tempClasses = options.tempClasses;\n if (tempClasses) {\n classes += ' ' + tempClasses;\n options.tempClasses = null;\n }\n\n if (isStructural) {\n element.data(PREPARE_CLASSES_KEY, 'ng-' + event + PREPARE_CLASS_SUFFIX);\n }\n\n setRunner(element, runner);\n\n animationQueue.push({\n // this data is used by the postDigest code and passed into\n // the driver step function\n element: element,\n classes: classes,\n event: event,\n structural: isStructural,\n options: options,\n beforeStart: beforeStart,\n close: close\n });\n\n element.on('$destroy', handleDestroyedElement);\n\n // we only want there to be one function called within the post digest\n // block. This way we can group animations for all the animations that\n // were apart of the same postDigest flush call.\n if (animationQueue.length > 1) return runner;\n\n $rootScope.$$postDigest(function() {\n var animations = [];\n forEach(animationQueue, function(entry) {\n // the element was destroyed early on which removed the runner\n // form its storage. This means we can't animate this element\n // at all and it already has been closed due to destruction.\n if (getRunner(entry.element)) {\n animations.push(entry);\n } else {\n entry.close();\n }\n });\n\n // now any future animations will be in another postDigest\n animationQueue.length = 0;\n\n var groupedAnimations = groupAnimations(animations);\n var toBeSortedAnimations = [];\n\n forEach(groupedAnimations, function(animationEntry) {\n var element = animationEntry.from ? animationEntry.from.element : animationEntry.element;\n var extraClasses = options.addClass;\n\n extraClasses = (extraClasses ? (extraClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n var cacheKey = $$animateCache.cacheKey(element[0], animationEntry.event, extraClasses, options.removeClass);\n\n toBeSortedAnimations.push({\n element: element,\n domNode: getDomNode(element),\n fn: function triggerAnimationStart() {\n var startAnimationFn, closeFn = animationEntry.close;\n\n // in the event that we've cached the animation status for this element\n // and it's in fact an invalid animation (something that has duration = 0)\n // then we should skip all the heavy work from here on\n if ($$animateCache.containsCachedAnimationWithoutDuration(cacheKey)) {\n closeFn();\n return;\n }\n\n // it's important that we apply the `ng-animate` CSS class and the\n // temporary classes before we do any driver invoking since these\n // CSS classes may be required for proper CSS detection.\n animationEntry.beforeStart();\n\n // in the event that the element was removed before the digest runs or\n // during the RAF sequencing then we should not trigger the animation.\n var targetElement = animationEntry.anchors\n ? (animationEntry.from.element || animationEntry.to.element)\n : animationEntry.element;\n\n if (getRunner(targetElement)) {\n var operation = invokeFirstDriver(animationEntry);\n if (operation) {\n startAnimationFn = operation.start;\n }\n }\n\n if (!startAnimationFn) {\n closeFn();\n } else {\n var animationRunner = startAnimationFn();\n animationRunner.done(function(status) {\n closeFn(!status);\n });\n updateAnimationRunners(animationEntry, animationRunner);\n }\n }\n });\n });\n\n // we need to sort each of the animations in order of parent to child\n // relationships. This ensures that the child classes are applied at the\n // right time.\n var finalAnimations = sortAnimations(toBeSortedAnimations);\n for (var i = 0; i < finalAnimations.length; i++) {\n var innerArray = finalAnimations[i];\n for (var j = 0; j < innerArray.length; j++) {\n var entry = innerArray[j];\n var element = entry.element;\n\n // the RAFScheduler code only uses functions\n finalAnimations[i][j] = entry.fn;\n\n // the first row of elements shouldn't have a prepare-class added to them\n // since the elements are at the top of the animation hierarchy and they\n // will be applied without a RAF having to pass...\n if (i === 0) {\n element.removeData(PREPARE_CLASSES_KEY);\n continue;\n }\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\n if (prepareClassName) {\n $$jqLite.addClass(element, prepareClassName);\n }\n }\n }\n\n $$rAFScheduler(finalAnimations);\n });\n\n return runner;\n\n // TODO(matsko): change to reference nodes\n function getAnchorNodes(node) {\n var SELECTOR = '[' + NG_ANIMATE_REF_ATTR + ']';\n var items = node.hasAttribute(NG_ANIMATE_REF_ATTR)\n ? [node]\n : node.querySelectorAll(SELECTOR);\n var anchors = [];\n forEach(items, function(node) {\n var attr = node.getAttribute(NG_ANIMATE_REF_ATTR);\n if (attr && attr.length) {\n anchors.push(node);\n }\n });\n return anchors;\n }\n\n function groupAnimations(animations) {\n var preparedAnimations = [];\n var refLookup = {};\n forEach(animations, function(animation, index) {\n var element = animation.element;\n var node = getDomNode(element);\n var event = animation.event;\n var enterOrMove = ['enter', 'move'].indexOf(event) >= 0;\n var anchorNodes = animation.structural ? getAnchorNodes(node) : [];\n\n if (anchorNodes.length) {\n var direction = enterOrMove ? 'to' : 'from';\n\n forEach(anchorNodes, function(anchor) {\n var key = anchor.getAttribute(NG_ANIMATE_REF_ATTR);\n refLookup[key] = refLookup[key] || {};\n refLookup[key][direction] = {\n animationID: index,\n element: jqLite(anchor)\n };\n });\n } else {\n preparedAnimations.push(animation);\n }\n });\n\n var usedIndicesLookup = {};\n var anchorGroups = {};\n forEach(refLookup, function(operations, key) {\n var from = operations.from;\n var to = operations.to;\n\n if (!from || !to) {\n // only one of these is set therefore we can't have an\n // anchor animation since all three pieces are required\n var index = from ? from.animationID : to.animationID;\n var indexKey = index.toString();\n if (!usedIndicesLookup[indexKey]) {\n usedIndicesLookup[indexKey] = true;\n preparedAnimations.push(animations[index]);\n }\n return;\n }\n\n var fromAnimation = animations[from.animationID];\n var toAnimation = animations[to.animationID];\n var lookupKey = from.animationID.toString();\n if (!anchorGroups[lookupKey]) {\n var group = anchorGroups[lookupKey] = {\n structural: true,\n beforeStart: function() {\n fromAnimation.beforeStart();\n toAnimation.beforeStart();\n },\n close: function() {\n fromAnimation.close();\n toAnimation.close();\n },\n classes: cssClassesIntersection(fromAnimation.classes, toAnimation.classes),\n from: fromAnimation,\n to: toAnimation,\n anchors: [] // TODO(matsko): change to reference nodes\n };\n\n // the anchor animations require that the from and to elements both have at least\n // one shared CSS class which effectively marries the two elements together to use\n // the same animation driver and to properly sequence the anchor animation.\n if (group.classes.length) {\n preparedAnimations.push(group);\n } else {\n preparedAnimations.push(fromAnimation);\n preparedAnimations.push(toAnimation);\n }\n }\n\n anchorGroups[lookupKey].anchors.push({\n 'out': from.element, 'in': to.element\n });\n });\n\n return preparedAnimations;\n }\n\n function cssClassesIntersection(a,b) {\n a = a.split(' ');\n b = b.split(' ');\n var matches = [];\n\n for (var i = 0; i < a.length; i++) {\n var aa = a[i];\n if (aa.substring(0,3) === 'ng-') continue;\n\n for (var j = 0; j < b.length; j++) {\n if (aa === b[j]) {\n matches.push(aa);\n break;\n }\n }\n }\n\n return matches.join(' ');\n }\n\n function invokeFirstDriver(animationDetails) {\n // we loop in reverse order since the more general drivers (like CSS and JS)\n // may attempt more elements, but custom drivers are more particular\n for (var i = drivers.length - 1; i >= 0; i--) {\n var driverName = drivers[i];\n var factory = $injector.get(driverName);\n var driver = factory(animationDetails);\n if (driver) {\n return driver;\n }\n }\n }\n\n function beforeStart() {\n tempClasses = (tempClasses ? (tempClasses + ' ') : '') + NG_ANIMATE_CLASSNAME;\n $$jqLite.addClass(element, tempClasses);\n\n var prepareClassName = element.data(PREPARE_CLASSES_KEY);\n if (prepareClassName) {\n $$jqLite.removeClass(element, prepareClassName);\n prepareClassName = null;\n }\n }\n\n function updateAnimationRunners(animation, newRunner) {\n if (animation.from && animation.to) {\n update(animation.from.element);\n update(animation.to.element);\n } else {\n update(animation.element);\n }\n\n function update(element) {\n var runner = getRunner(element);\n if (runner) runner.setHost(newRunner);\n }\n }\n\n function handleDestroyedElement() {\n var runner = getRunner(element);\n if (runner && (event !== 'leave' || !options.$$domOperationFired)) {\n runner.end();\n }\n }\n\n function close(rejected) {\n element.off('$destroy', handleDestroyedElement);\n removeRunner(element);\n\n applyAnimationClasses(element, options);\n applyAnimationStyles(element, options);\n options.domOperation();\n\n if (tempClasses) {\n $$jqLite.removeClass(element, tempClasses);\n }\n\n runner.complete(!rejected);\n }\n };\n }];\n}];\n\n/**\n * @ngdoc directive\n * @name ngAnimateSwap\n * @restrict A\n * @scope\n *\n * @description\n *\n * ngAnimateSwap is a animation-oriented directive that allows for the container to\n * be removed and entered in whenever the associated expression changes. A\n * common usecase for this directive is a rotating banner or slider component which\n * contains one image being present at a time. When the active image changes\n * then the old image will perform a `leave` animation and the new element\n * will be inserted via an `enter` animation.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|--------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from the DOM |\n *\n * @example\n * \n * \n *
\n *
\n * {{ number }}\n *
\n *
\n *
\n * \n * angular.module('ngAnimateSwapExample', ['ngAnimate'])\n * .controller('AppCtrl', ['$scope', '$interval', function($scope, $interval) {\n * $scope.number = 0;\n * $interval(function() {\n * $scope.number++;\n * }, 1000);\n *\n * var colors = ['red','blue','green','yellow','orange'];\n * $scope.colorClass = function(number) {\n * return colors[number % colors.length];\n * };\n * }]);\n * \n * \n * .container {\n * height:250px;\n * width:250px;\n * position:relative;\n * overflow:hidden;\n * border:2px solid black;\n * }\n * .container .cell {\n * font-size:150px;\n * text-align:center;\n * line-height:250px;\n * position:absolute;\n * top:0;\n * left:0;\n * right:0;\n * border-bottom:2px solid black;\n * }\n * .swap-animation.ng-enter, .swap-animation.ng-leave {\n * transition:0.5s linear all;\n * }\n * .swap-animation.ng-enter {\n * top:-250px;\n * }\n * .swap-animation.ng-enter-active {\n * top:0px;\n * }\n * .swap-animation.ng-leave {\n * top:0px;\n * }\n * .swap-animation.ng-leave-active {\n * top:250px;\n * }\n * .red { background:red; }\n * .green { background:green; }\n * .blue { background:blue; }\n * .yellow { background:yellow; }\n * .orange { background:orange; }\n * \n *
\n */\nvar ngAnimateSwapDirective = ['$animate', function($animate) {\n return {\n restrict: 'A',\n transclude: 'element',\n terminal: true,\n priority: 550, // We use 550 here to ensure that the directive is caught before others,\n // but after `ngIf` (at priority 600).\n link: function(scope, $element, attrs, ctrl, $transclude) {\n var previousElement, previousScope;\n scope.$watchCollection(attrs.ngAnimateSwap || attrs['for'], function(value) {\n if (previousElement) {\n $animate.leave(previousElement);\n }\n if (previousScope) {\n previousScope.$destroy();\n previousScope = null;\n }\n if (value || value === 0) {\n $transclude(function(clone, childScope) {\n previousElement = clone;\n previousScope = childScope;\n $animate.enter(clone, null, $element);\n });\n }\n });\n }\n };\n}];\n\n/**\n * @ngdoc module\n * @name ngAnimate\n * @description\n *\n * The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via\n * callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app.\n *\n * ## Usage\n * Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based\n * using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For\n * both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within\n * the HTML element that the animation will be triggered on.\n *\n * ## Directive Support\n * The following directives are \"animation aware\":\n *\n * | Directive | Supported Animations |\n * |-------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n * | {@link ng.directive:form#animations form / ngForm} | add and remove ({@link ng.directive:form#css-classes various classes}) |\n * | {@link ngAnimate.directive:ngAnimateSwap#animations ngAnimateSwap} | enter and leave |\n * | {@link ng.directive:ngClass#animations ngClass / {{class}​}} | add and remove |\n * | {@link ng.directive:ngClassEven#animations ngClassEven} | add and remove |\n * | {@link ng.directive:ngClassOdd#animations ngClassOdd} | add and remove |\n * | {@link ng.directive:ngHide#animations ngHide} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngIf#animations ngIf} | enter and leave |\n * | {@link ng.directive:ngInclude#animations ngInclude} | enter and leave |\n * | {@link module:ngMessages#animations ngMessage / ngMessageExp} | enter and leave |\n * | {@link module:ngMessages#animations ngMessages} | add and remove (the `ng-active`/`ng-inactive` classes) |\n * | {@link ng.directive:ngModel#animations ngModel} | add and remove ({@link ng.directive:ngModel#css-classes various classes}) |\n * | {@link ng.directive:ngRepeat#animations ngRepeat} | enter, leave, and move |\n * | {@link ng.directive:ngShow#animations ngShow} | add and remove (the `ng-hide` class) |\n * | {@link ng.directive:ngSwitch#animations ngSwitch} | enter and leave |\n * | {@link ngRoute.directive:ngView#animations ngView} | enter and leave |\n *\n * (More information can be found by visiting the documentation associated with each directive.)\n *\n * For a full breakdown of the steps involved during each animation event, refer to the\n * {@link ng.$animate `$animate` API docs}.\n *\n * ## CSS-based Animations\n *\n * CSS-based animations with ngAnimate are unique since they require no JavaScript code at all. By using a CSS class that we reference between our HTML\n * and CSS code we can create an animation that will be picked up by AngularJS when an underlying directive performs an operation.\n *\n * The example below shows how an `enter` animation can be made possible on an element using `ng-if`:\n *\n * ```html\n *
\n * Fade me in out\n *
\n * \n * \n * ```\n *\n * Notice the CSS class **fade**? We can now create the CSS transition code that references this class:\n *\n * ```css\n * /* The starting CSS styles for the enter animation */\n * .fade.ng-enter {\n * transition:0.5s linear all;\n * opacity:0;\n * }\n *\n * /* The finishing CSS styles for the enter animation */\n * .fade.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * ```\n *\n * The key thing to remember here is that, depending on the animation event (which each of the directives above trigger depending on what's going on) two\n * generated CSS classes will be applied to the element; in the example above we have `.ng-enter` and `.ng-enter-active`. For CSS transitions, the transition\n * code **must** be defined within the starting CSS class (in this case `.ng-enter`). The destination class is what the transition will animate towards.\n *\n * If for example we wanted to create animations for `leave` and `move` (ngRepeat triggers move) then we can do so using the same CSS naming conventions:\n *\n * ```css\n * /* now the element will fade out before it is removed from the DOM */\n * .fade.ng-leave {\n * transition:0.5s linear all;\n * opacity:1;\n * }\n * .fade.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * We can also make use of **CSS Keyframes** by referencing the keyframe animation within the starting CSS class:\n *\n * ```css\n * /* there is no need to define anything inside of the destination\n * CSS class since the keyframe will take charge of the animation */\n * .fade.ng-leave {\n * animation: my_fade_animation 0.5s linear;\n * -webkit-animation: my_fade_animation 0.5s linear;\n * }\n *\n * @keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n *\n * @-webkit-keyframes my_fade_animation {\n * from { opacity:1; }\n * to { opacity:0; }\n * }\n * ```\n *\n * Feel free also mix transitions and keyframes together as well as any other CSS classes on the same element.\n *\n * ### CSS Class-based Animations\n *\n * Class-based animations (animations that are triggered via `ngClass`, `ngShow`, `ngHide` and some other directives) have a slightly different\n * naming convention. Class-based animations are basic enough that a standard transition or keyframe can be referenced on the class being added\n * and removed.\n *\n * For example if we wanted to do a CSS animation for `ngHide` then we place an animation on the `.ng-hide` CSS class:\n *\n * ```html\n *
\n * Show and hide me\n *
\n * \n *\n * \n * ```\n *\n * All that is going on here with ngShow/ngHide behind the scenes is the `.ng-hide` class is added/removed (when the hidden state is valid). Since\n * ngShow and ngHide are animation aware then we can match up a transition and ngAnimate handles the rest.\n *\n * In addition the addition and removal of the CSS class, ngAnimate also provides two helper methods that we can use to further decorate the animation\n * with CSS styles.\n *\n * ```html\n *
\n * Highlight this box\n *
\n * \n *\n * \n * ```\n *\n * We can also make use of CSS keyframes by placing them within the CSS classes.\n *\n *\n * ### CSS Staggering Animations\n * A Staggering animation is a collection of animations that are issued with a slight delay in between each successive operation resulting in a\n * curtain-like effect. The ngAnimate module (versions >=1.2) supports staggering animations and the stagger effect can be\n * performed by creating a **ng-EVENT-stagger** CSS class and attaching that class to the base CSS class used for\n * the animation. The style property expected within the stagger class can either be a **transition-delay** or an\n * **animation-delay** property (or both if your animation contains both transitions and keyframe animations).\n *\n * ```css\n * .my-animation.ng-enter {\n * /* standard transition code */\n * transition: 1s linear all;\n * opacity:0;\n * }\n * .my-animation.ng-enter-stagger {\n * /* this will have a 100ms delay between each successive leave animation */\n * transition-delay: 0.1s;\n *\n * /* As of 1.4.4, this must always be set: it signals ngAnimate\n * to not accidentally inherit a delay property from another CSS class */\n * transition-duration: 0s;\n *\n * /* if you are using animations instead of transitions you should configure as follows:\n * animation-delay: 0.1s;\n * animation-duration: 0s; */\n * }\n * .my-animation.ng-enter.ng-enter-active {\n * /* standard transition styles */\n * opacity:1;\n * }\n * ```\n *\n * Staggering animations work by default in ngRepeat (so long as the CSS class is defined). Outside of ngRepeat, to use staggering animations\n * on your own, they can be triggered by firing multiple calls to the same event on $animate. However, the restrictions surrounding this\n * are that each of the elements must have the same CSS className value as well as the same parent element. A stagger operation\n * will also be reset if one or more animation frames have passed since the multiple calls to `$animate` were fired.\n *\n * The following code will issue the **ng-leave-stagger** event on the element provided:\n *\n * ```js\n * var kids = parent.children();\n *\n * $animate.leave(kids[0]); //stagger index=0\n * $animate.leave(kids[1]); //stagger index=1\n * $animate.leave(kids[2]); //stagger index=2\n * $animate.leave(kids[3]); //stagger index=3\n * $animate.leave(kids[4]); //stagger index=4\n *\n * window.requestAnimationFrame(function() {\n * //stagger has reset itself\n * $animate.leave(kids[5]); //stagger index=0\n * $animate.leave(kids[6]); //stagger index=1\n *\n * $scope.$digest();\n * });\n * ```\n *\n * Stagger animations are currently only supported within CSS-defined animations.\n *\n * ### The `ng-animate` CSS class\n *\n * When ngAnimate is animating an element it will apply the `ng-animate` CSS class to the element for the duration of the animation.\n * This is a temporary CSS class and it will be removed once the animation is over (for both JavaScript and CSS-based animations).\n *\n * Therefore, animations can be applied to an element using this temporary class directly via CSS.\n *\n * ```css\n * .zipper.ng-animate {\n * transition:0.5s linear all;\n * }\n * .zipper.ng-enter {\n * opacity:0;\n * }\n * .zipper.ng-enter.ng-enter-active {\n * opacity:1;\n * }\n * .zipper.ng-leave {\n * opacity:1;\n * }\n * .zipper.ng-leave.ng-leave-active {\n * opacity:0;\n * }\n * ```\n *\n * (Note that the `ng-animate` CSS class is reserved and it cannot be applied on an element directly since ngAnimate will always remove\n * the CSS class once an animation has completed.)\n *\n *\n * ### The `ng-[event]-prepare` class\n *\n * This is a special class that can be used to prevent unwanted flickering / flash of content before\n * the actual animation starts. The class is added as soon as an animation is initialized, but removed\n * before the actual animation starts (after waiting for a $digest).\n * It is also only added for *structural* animations (`enter`, `move`, and `leave`).\n *\n * In practice, flickering can appear when nesting elements with structural animations such as `ngIf`\n * into elements that have class-based animations such as `ngClass`.\n *\n * ```html\n *
\n *
\n *
\n *
\n *
\n * ```\n *\n * It is possible that during the `enter` animation, the `.message` div will be briefly visible before it starts animating.\n * In that case, you can add styles to the CSS that make sure the element stays hidden before the animation starts:\n *\n * ```css\n * .message.ng-enter-prepare {\n * opacity: 0;\n * }\n * ```\n *\n * ### Animating between value changes\n *\n * Sometimes you need to animate between different expression states, whose values\n * don't necessary need to be known or referenced in CSS styles.\n * Unless possible with another {@link ngAnimate#directive-support \"animation aware\" directive},\n * that specific use case can always be covered with {@link ngAnimate.directive:ngAnimateSwap} as\n * can be seen in {@link ngAnimate.directive:ngAnimateSwap#examples this example}.\n *\n * Note that {@link ngAnimate.directive:ngAnimateSwap} is a *structural directive*, which means it\n * creates a new instance of the element (including any other/child directives it may have) and\n * links it to a new scope every time *swap* happens. In some cases this might not be desirable\n * (e.g. for performance reasons, or when you wish to retain internal state on the original\n * element instance).\n *\n * ## JavaScript-based Animations\n *\n * ngAnimate also allows for animations to be consumed by JavaScript code. The approach is similar to CSS-based animations (where there is a shared\n * CSS class that is referenced in our HTML code) but in addition we need to register the JavaScript animation on the module. By making use of the\n * `module.animation()` module function we can register the animation.\n *\n * Let's see an example of a enter/leave animation using `ngRepeat`:\n *\n * ```html\n *
\n * {{ item }}\n *
\n * ```\n *\n * See the **slide** CSS class? Let's use that class to define an animation that we'll structure in our module code by using `module.animation`:\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * // make note that other events (like addClass/removeClass)\n * // have different function input parameters\n * enter: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n *\n * // remember to call doneFn so that AngularJS\n * // knows that the animation has concluded\n * },\n *\n * move: function(element, doneFn) {\n * jQuery(element).fadeIn(1000, doneFn);\n * },\n *\n * leave: function(element, doneFn) {\n * jQuery(element).fadeOut(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing about JS-based animations is that we can inject other services and make use of advanced animation libraries such as\n * greensock.js and velocity.js.\n *\n * If our animation code class-based (meaning that something like `ngClass`, `ngHide` and `ngShow` triggers it) then we can still define\n * our animations inside of the same registered animation, however, the function input arguments are a bit different:\n *\n * ```html\n *
\n * this box is moody\n *
\n * \n * \n * \n * ```\n *\n * ```js\n * myModule.animation('.colorful', [function() {\n * return {\n * addClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * removeClass: function(element, className, doneFn) {\n * // do some cool animation and call the doneFn\n * },\n * setClass: function(element, addedClass, removedClass, doneFn) {\n * // do some cool animation and call the doneFn\n * }\n * }\n * }]);\n * ```\n *\n * ## CSS + JS Animations Together\n *\n * AngularJS 1.4 and higher has taken steps to make the amalgamation of CSS and JS animations more flexible. However, unlike earlier versions of AngularJS,\n * defining CSS and JS animations to work off of the same CSS class will not work anymore. Therefore the example below will only result in **JS animations taking\n * charge of the animation**:\n *\n * ```html\n *
\n * Slide in and out\n *
\n * ```\n *\n * ```js\n * myModule.animation('.slide', [function() {\n * return {\n * enter: function(element, doneFn) {\n * jQuery(element).slideIn(1000, doneFn);\n * }\n * }\n * }]);\n * ```\n *\n * ```css\n * .slide.ng-enter {\n * transition:0.5s linear all;\n * transform:translateY(-100px);\n * }\n * .slide.ng-enter.ng-enter-active {\n * transform:translateY(0);\n * }\n * ```\n *\n * Does this mean that CSS and JS animations cannot be used together? Do JS-based animations always have higher priority? We can make up for the\n * lack of CSS animations by using the `$animateCss` service to trigger our own tweaked-out, CSS-based animations directly from\n * our own JS-based animation code:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n* // this will trigger `.slide.ng-enter` and `.slide.ng-enter-active`.\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true\n * });\n * }\n * }\n * }]);\n * ```\n *\n * The nice thing here is that we can save bandwidth by sticking to our CSS-based animation code and we don't need to rely on a 3rd-party animation framework.\n *\n * The `$animateCss` service is very powerful since we can feed in all kinds of extra properties that will be evaluated and fed into a CSS transition or\n * keyframe animation. For example if we wanted to animate the height of an element while adding and removing classes then we can do so by providing that\n * data into `$animateCss` directly:\n *\n * ```js\n * myModule.animation('.slide', ['$animateCss', function($animateCss) {\n * return {\n * enter: function(element) {\n * return $animateCss(element, {\n * event: 'enter',\n * structural: true,\n * addClass: 'maroon-setting',\n * from: { height:0 },\n * to: { height: 200 }\n * });\n * }\n * }\n * }]);\n * ```\n *\n * Now we can fill in the rest via our transition CSS code:\n *\n * ```css\n * /* the transition tells ngAnimate to make the animation happen */\n * .slide.ng-enter { transition:0.5s linear all; }\n *\n * /* this extra CSS class will be absorbed into the transition\n * since the $animateCss code is adding the class */\n * .maroon-setting { background:red; }\n * ```\n *\n * And `$animateCss` will figure out the rest. Just make sure to have the `done()` callback fire the `doneFn` function to signal when the animation is over.\n *\n * To learn more about what's possible be sure to visit the {@link ngAnimate.$animateCss $animateCss service}.\n *\n * ## Animation Anchoring (via `ng-animate-ref`)\n *\n * ngAnimate in AngularJS 1.4 comes packed with the ability to cross-animate elements between\n * structural areas of an application (like views) by pairing up elements using an attribute\n * called `ng-animate-ref`.\n *\n * Let's say for example we have two views that are managed by `ng-view` and we want to show\n * that there is a relationship between two components situated in within these views. By using the\n * `ng-animate-ref` attribute we can identify that the two components are paired together and we\n * can then attach an animation, which is triggered when the view changes.\n *\n * Say for example we have the following template code:\n *\n * ```html\n * \n *
\n *
\n *\n * \n * \n * \n * \n *\n * \n * \n * ```\n *\n * Now, when the view changes (once the link is clicked), ngAnimate will examine the\n * HTML contents to see if there is a match reference between any components in the view\n * that is leaving and the view that is entering. It will scan both the view which is being\n * removed (leave) and inserted (enter) to see if there are any paired DOM elements that\n * contain a matching ref value.\n *\n * The two images match since they share the same ref value. ngAnimate will now create a\n * transport element (which is a clone of the first image element) and it will then attempt\n * to animate to the position of the second image element in the next view. For the animation to\n * work a special CSS class called `ng-anchor` will be added to the transported element.\n *\n * We can now attach a transition onto the `.banner.ng-anchor` CSS class and then\n * ngAnimate will handle the entire transition for us as well as the addition and removal of\n * any changes of CSS classes between the elements:\n *\n * ```css\n * .banner.ng-anchor {\n * /* this animation will last for 1 second since there are\n * two phases to the animation (an `in` and an `out` phase) */\n * transition:0.5s linear all;\n * }\n * ```\n *\n * We also **must** include animations for the views that are being entered and removed\n * (otherwise anchoring wouldn't be possible since the new view would be inserted right away).\n *\n * ```css\n * .view-animation.ng-enter, .view-animation.ng-leave {\n * transition:0.5s linear all;\n * position:fixed;\n * left:0;\n * top:0;\n * width:100%;\n * }\n * .view-animation.ng-enter {\n * transform:translateX(100%);\n * }\n * .view-animation.ng-leave,\n * .view-animation.ng-enter.ng-enter-active {\n * transform:translateX(0%);\n * }\n * .view-animation.ng-leave.ng-leave-active {\n * transform:translateX(-100%);\n * }\n * ```\n *\n * Now we can jump back to the anchor animation. When the animation happens, there are two stages that occur:\n * an `out` and an `in` stage. The `out` stage happens first and that is when the element is animated away\n * from its origin. Once that animation is over then the `in` stage occurs which animates the\n * element to its destination. The reason why there are two animations is to give enough time\n * for the enter animation on the new element to be ready.\n *\n * The example above sets up a transition for both the in and out phases, but we can also target the out or\n * in phases directly via `ng-anchor-out` and `ng-anchor-in`.\n *\n * ```css\n * .banner.ng-anchor-out {\n * transition: 0.5s linear all;\n *\n * /* the scale will be applied during the out animation,\n * but will be animated away when the in animation runs */\n * transform: scale(1.2);\n * }\n *\n * .banner.ng-anchor-in {\n * transition: 1s linear all;\n * }\n * ```\n *\n *\n *\n *\n * ### Anchoring Demo\n *\n \n \n Home\n
\n
\n
\n
\n
\n \n angular.module('anchoringExample', ['ngAnimate', 'ngRoute'])\n .config(['$routeProvider', function($routeProvider) {\n $routeProvider.when('/', {\n templateUrl: 'home.html',\n controller: 'HomeController as home'\n });\n $routeProvider.when('/profile/:id', {\n templateUrl: 'profile.html',\n controller: 'ProfileController as profile'\n });\n }])\n .run(['$rootScope', function($rootScope) {\n $rootScope.records = [\n { id: 1, title: 'Miss Beulah Roob' },\n { id: 2, title: 'Trent Morissette' },\n { id: 3, title: 'Miss Ava Pouros' },\n { id: 4, title: 'Rod Pouros' },\n { id: 5, title: 'Abdul Rice' },\n { id: 6, title: 'Laurie Rutherford Sr.' },\n { id: 7, title: 'Nakia McLaughlin' },\n { id: 8, title: 'Jordon Blanda DVM' },\n { id: 9, title: 'Rhoda Hand' },\n { id: 10, title: 'Alexandrea Sauer' }\n ];\n }])\n .controller('HomeController', [function() {\n //empty\n }])\n .controller('ProfileController', ['$rootScope', '$routeParams',\n function ProfileController($rootScope, $routeParams) {\n var index = parseInt($routeParams.id, 10);\n var record = $rootScope.records[index - 1];\n\n this.title = record.title;\n this.id = record.id;\n }]);\n \n \n

Welcome to the home page

\n

Please click on an element

\n \n {{ record.title }}\n \n
\n \n
\n {{ profile.title }}\n
\n
\n \n .record {\n display:block;\n font-size:20px;\n }\n .profile {\n background:black;\n color:white;\n font-size:100px;\n }\n .view-container {\n position:relative;\n }\n .view-container > .view.ng-animate {\n position:absolute;\n top:0;\n left:0;\n width:100%;\n min-height:500px;\n }\n .view.ng-enter, .view.ng-leave,\n .record.ng-anchor {\n transition:0.5s linear all;\n }\n .view.ng-enter {\n transform:translateX(100%);\n }\n .view.ng-enter.ng-enter-active, .view.ng-leave {\n transform:translateX(0%);\n }\n .view.ng-leave.ng-leave-active {\n transform:translateX(-100%);\n }\n .record.ng-anchor-out {\n background:red;\n }\n \n
\n *\n * ### How is the element transported?\n *\n * When an anchor animation occurs, ngAnimate will clone the starting element and position it exactly where the starting\n * element is located on screen via absolute positioning. The cloned element will be placed inside of the root element\n * of the application (where ng-app was defined) and all of the CSS classes of the starting element will be applied. The\n * element will then animate into the `out` and `in` animations and will eventually reach the coordinates and match\n * the dimensions of the destination element. During the entire animation a CSS class of `.ng-animate-shim` will be applied\n * to both the starting and destination elements in order to hide them from being visible (the CSS styling for the class\n * is: `visibility:hidden`). Once the anchor reaches its destination then it will be removed and the destination element\n * will become visible since the shim class will be removed.\n *\n * ### How is the morphing handled?\n *\n * CSS Anchoring relies on transitions and keyframes and the internal code is intelligent enough to figure out\n * what CSS classes differ between the starting element and the destination element. These different CSS classes\n * will be added/removed on the anchor element and a transition will be applied (the transition that is provided\n * in the anchor class). Long story short, ngAnimate will figure out what classes to add and remove which will\n * make the transition of the element as smooth and automatic as possible. Be sure to use simple CSS classes that\n * do not rely on DOM nesting structure so that the anchor element appears the same as the starting element (since\n * the cloned element is placed inside of root element which is likely close to the body element).\n *\n * Note that if the root element is on the `` element then the cloned node will be placed inside of body.\n *\n *\n * ## Using $animate in your directive code\n *\n * So far we've explored how to feed in animations into an AngularJS application, but how do we trigger animations within our own directives in our application?\n * By injecting the `$animate` service into our directive code, we can trigger structural and class-based hooks which can then be consumed by animations. Let's\n * imagine we have a greeting box that shows and hides itself when the data changes\n *\n * ```html\n * Hi there\n * ```\n *\n * ```js\n * ngModule.directive('greetingBox', ['$animate', function($animate) {\n * return function(scope, element, attrs) {\n * attrs.$observe('active', function(value) {\n * value ? $animate.addClass(element, 'on') : $animate.removeClass(element, 'on');\n * });\n * });\n * }]);\n * ```\n *\n * Now the `on` CSS class is added and removed on the greeting box component. Now if we add a CSS class on top of the greeting box element\n * in our HTML code then we can trigger a CSS or JS animation to happen.\n *\n * ```css\n * /* normally we would create a CSS class to reference on the element */\n * greeting-box.on { transition:0.5s linear all; background:green; color:white; }\n * ```\n *\n * The `$animate` service contains a variety of other methods like `enter`, `leave`, `animate` and `setClass`. To learn more about what's\n * possible be sure to visit the {@link ng.$animate $animate service API page}.\n *\n *\n * ## Callbacks and Promises\n *\n * When `$animate` is called it returns a promise that can be used to capture when the animation has ended. Therefore if we were to trigger\n * an animation (within our directive code) then we can continue performing directive and scope related activities after the animation has\n * ended by chaining onto the returned promise that animation method returns.\n *\n * ```js\n * // somewhere within the depths of the directive\n * $animate.enter(element, parent).then(function() {\n * //the animation has completed\n * });\n * ```\n *\n * (Note that earlier versions of AngularJS prior to v1.4 required the promise code to be wrapped using `$scope.$apply(...)`. This is not the case\n * anymore.)\n *\n * In addition to the animation promise, we can also make use of animation-related callbacks within our directives and controller code by registering\n * an event listener using the `$animate` service. Let's say for example that an animation was triggered on our view\n * routing controller to hook into that:\n *\n * ```js\n * ngModule.controller('HomePageController', ['$animate', function($animate) {\n * $animate.on('enter', ngViewElement, function(element) {\n * // the animation for this route has completed\n * }]);\n * }])\n * ```\n *\n * (Note that you will need to trigger a digest within the callback to get AngularJS to notice any scope-related changes.)\n */\n\nvar copy;\nvar extend;\nvar forEach;\nvar isArray;\nvar isDefined;\nvar isElement;\nvar isFunction;\nvar isObject;\nvar isString;\nvar isUndefined;\nvar jqLite;\nvar noop;\n\n/**\n * @ngdoc service\n * @name $animate\n * @kind object\n *\n * @description\n * The ngAnimate `$animate` service documentation is the same for the core `$animate` service.\n *\n * Click here {@link ng.$animate to learn more about animations with `$animate`}.\n */\nangular.module('ngAnimate', [], function initAngularHelpers() {\n // Access helpers from AngularJS core.\n // Do it inside a `config` block to ensure `window.angular` is available.\n noop = angular.noop;\n copy = angular.copy;\n extend = angular.extend;\n jqLite = angular.element;\n forEach = angular.forEach;\n isArray = angular.isArray;\n isString = angular.isString;\n isObject = angular.isObject;\n isUndefined = angular.isUndefined;\n isDefined = angular.isDefined;\n isFunction = angular.isFunction;\n isElement = angular.isElement;\n})\n .info({ angularVersion: '1.8.2' })\n .directive('ngAnimateSwap', ngAnimateSwapDirective)\n\n .directive('ngAnimateChildren', $$AnimateChildrenDirective)\n .factory('$$rAFScheduler', $$rAFSchedulerFactory)\n\n .provider('$$animateQueue', $$AnimateQueueProvider)\n .provider('$$animateCache', $$AnimateCacheProvider)\n .provider('$$animation', $$AnimationProvider)\n\n .provider('$animateCss', $AnimateCssProvider)\n .provider('$$animateCssDriver', $$AnimateCssDriverProvider)\n\n .provider('$$animateJs', $$AnimateJsProvider)\n .provider('$$animateJsDriver', $$AnimateJsDriverProvider);\n\n\n})(window, window.angular);\n","require('./angular-animate');\nmodule.exports = 'ngAnimate';\n","/**\n * @license AngularJS v1.8.2\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function(window, angular) {'use strict';\n\n/* global shallowCopy: true */\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n/* global routeToRegExp: true */\n\n/**\n * @param {string} path - The path to parse. (It is assumed to have query and hash stripped off.)\n * @param {Object} opts - Options.\n * @return {Object} - An object containing an array of path parameter names (`keys`) and a regular\n * expression (`regexp`) that can be used to identify a matching URL and extract the path\n * parameter values.\n *\n * @description\n * Parses the given path, extracting path parameter names and a regular expression to match URLs.\n *\n * Originally inspired by `pathRexp` in `visionmedia/express/lib/utils.js`.\n */\nfunction routeToRegExp(path, opts) {\n var keys = [];\n\n var pattern = path\n .replace(/([().])/g, '\\\\$1')\n .replace(/(\\/)?:(\\w+)(\\*\\?|[?*])?/g, function(_, slash, key, option) {\n var optional = option === '?' || option === '*?';\n var star = option === '*' || option === '*?';\n keys.push({name: key, optional: optional});\n slash = slash || '';\n return (\n (optional ? '(?:' + slash : slash + '(?:') +\n (star ? '(.+?)' : '([^/]+)') +\n (optional ? '?)?' : ')')\n );\n })\n .replace(/([/$*])/g, '\\\\$1');\n\n if (opts.ignoreTrailingSlashes) {\n pattern = pattern.replace(/\\/+$/, '') + '/*';\n }\n\n return {\n keys: keys,\n regexp: new RegExp(\n '^' + pattern + '(?:[?#]|$)',\n opts.caseInsensitiveMatch ? 'i' : ''\n )\n };\n}\n\n/* global routeToRegExp: false */\n/* global shallowCopy: false */\n\n// `isArray` and `isObject` are necessary for `shallowCopy()` (included via `src/shallowCopy.js`).\n// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available.\nvar isArray;\nvar isObject;\nvar isDefined;\nvar noop;\n\n/**\n * @ngdoc module\n * @name ngRoute\n * @description\n *\n * The `ngRoute` module provides routing and deeplinking services and directives for AngularJS apps.\n *\n * ## Example\n * See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.\n *\n */\n/* global -ngRouteModule */\nvar ngRouteModule = angular.\n module('ngRoute', []).\n info({ angularVersion: '1.8.2' }).\n provider('$route', $RouteProvider).\n // Ensure `$route` will be instantiated in time to capture the initial `$locationChangeSuccess`\n // event (unless explicitly disabled). This is necessary in case `ngView` is included in an\n // asynchronously loaded template.\n run(instantiateRoute);\nvar $routeMinErr = angular.$$minErr('ngRoute');\nvar isEagerInstantiationEnabled;\n\n\n/**\n * @ngdoc provider\n * @name $routeProvider\n * @this\n *\n * @description\n *\n * Used for configuring routes.\n *\n * ## Example\n * See {@link ngRoute.$route#examples $route} for an example of configuring and using `ngRoute`.\n *\n * ## Dependencies\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n */\nfunction $RouteProvider() {\n isArray = angular.isArray;\n isObject = angular.isObject;\n isDefined = angular.isDefined;\n noop = angular.noop;\n\n function inherit(parent, extra) {\n return angular.extend(Object.create(parent), extra);\n }\n\n var routes = {};\n\n /**\n * @ngdoc method\n * @name $routeProvider#when\n *\n * @param {string} path Route path (matched against `$location.path`). If `$location.path`\n * contains redundant trailing slash or is missing one, the route will still match and the\n * `$location.path` will be updated to add or drop the trailing slash to exactly match the\n * route definition.\n *\n * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up\n * to the next slash are matched and stored in `$routeParams` under the given `name`\n * when the route matches.\n * * `path` can contain named groups starting with a colon and ending with a star:\n * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`\n * when the route matches.\n * * `path` can contain optional named groups with a question mark: e.g.`:name?`.\n *\n * For example, routes like `/color/:color/largecode/:largecode*\\/edit` will match\n * `/color/brown/largecode/code/with/slashes/edit` and extract:\n *\n * * `color: brown`\n * * `largecode: code/with/slashes`.\n *\n *\n * @param {Object} route Mapping information to be assigned to `$route.current` on route\n * match.\n *\n * Object properties:\n *\n * - `controller` – `{(string|Function)=}` – Controller fn that should be associated with\n * newly created scope or the name of a {@link angular.Module#controller registered\n * controller} if passed as a string.\n * - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * - `template` – `{(string|Function)=}` – html template as a string or a function that\n * returns an html template as a string which should be used by {@link\n * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.\n * This property takes precedence over `templateUrl`.\n *\n * If `template` is a function, it will be called with the following parameters:\n *\n * - `{Array.}` - route parameters extracted from the current\n * `$location.path()` by applying the current route\n *\n * One of `template` or `templateUrl` is required.\n *\n * - `templateUrl` – `{(string|Function)=}` – path or function that returns a path to an html\n * template that should be used by {@link ngRoute.directive:ngView ngView}.\n *\n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - `{Array.}` - route parameters extracted from the current\n * `$location.path()` by applying the current route\n *\n * One of `templateUrl` or `template` is required.\n *\n * - `resolve` - `{Object.=}` - An optional map of dependencies which should\n * be injected into the controller. If any of these dependencies are promises, the router\n * will wait for them all to be resolved or one to be rejected before the controller is\n * instantiated.\n * If all the promises are resolved successfully, the values of the resolved promises are\n * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is\n * fired. If any of the promises are rejected the\n * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired.\n * For easier access to the resolved dependencies from the template, the `resolve` map will\n * be available on the scope of the route, under `$resolve` (by default) or a custom name\n * specified by the `resolveAs` property (see below). This can be particularly useful, when\n * working with {@link angular.Module#component components} as route templates.
\n *
\n * **Note:** If your scope already contains a property with this name, it will be hidden\n * or overwritten. Make sure, you specify an appropriate name for this property, that\n * does not collide with other properties on the scope.\n *
\n * The map object is:\n *\n * - `key` – `{string}`: a name of a dependency to be injected into the controller.\n * - `factory` - `{string|Function}`: If `string` then it is an alias for a service.\n * Otherwise if function, then it is {@link auto.$injector#invoke injected}\n * and the return value is treated as the dependency. If the result is a promise, it is\n * resolved before its value is injected into the controller. Be aware that\n * `ngRoute.$routeParams` will still refer to the previous route within these resolve\n * functions. Use `$route.current.params` to access the new route parameters, instead.\n *\n * - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on\n * the scope of the route. If omitted, defaults to `$resolve`.\n *\n * - `redirectTo` – `{(string|Function)=}` – value to update\n * {@link ng.$location $location} path with and trigger route redirection.\n *\n * If `redirectTo` is a function, it will be called with the following parameters:\n *\n * - `{Object.}` - route parameters extracted from the current\n * `$location.path()` by applying the current route templateUrl.\n * - `{string}` - current `$location.path()`\n * - `{Object}` - current `$location.search()`\n *\n * The custom `redirectTo` function is expected to return a string which will be used\n * to update `$location.url()`. If the function throws an error, no further processing will\n * take place and the {@link ngRoute.$route#$routeChangeError $routeChangeError} event will\n * be fired.\n *\n * Routes that specify `redirectTo` will not have their controllers, template functions\n * or resolves called, the `$location` will be changed to the redirect url and route\n * processing will stop. The exception to this is if the `redirectTo` is a function that\n * returns `undefined`. In this case the route transition occurs as though there was no\n * redirection.\n *\n * - `resolveRedirectTo` – `{Function=}` – a function that will (eventually) return the value\n * to update {@link ng.$location $location} URL with and trigger route redirection. In\n * contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the\n * return value can be either a string or a promise that will be resolved to a string.\n *\n * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets\n * resolved to `undefined`), no redirection takes place and the route transition occurs as\n * though there was no redirection.\n *\n * If the function throws an error or the returned promise gets rejected, no further\n * processing will take place and the\n * {@link ngRoute.$route#$routeChangeError $routeChangeError} event will be fired.\n *\n * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same\n * route definition, will cause the latter to be ignored.\n *\n * - `[reloadOnUrl=true]` - `{boolean=}` - reload route when any part of the URL changes\n * (including the path) even if the new URL maps to the same route.\n *\n * If the option is set to `false` and the URL in the browser changes, but the new URL maps\n * to the same route, then a `$routeUpdate` event is broadcasted on the root scope (without\n * reloading the route).\n *\n * - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()`\n * or `$location.hash()` changes.\n *\n * If the option is set to `false` and the URL in the browser changes, then a `$routeUpdate`\n * event is broadcasted on the root scope (without reloading the route).\n *\n *
\n * **Note:** This option has no effect if `reloadOnUrl` is set to `false`.\n *
\n *\n * - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive\n *\n * If the option is set to `true`, then the particular route can be matched without being\n * case sensitive\n *\n * @returns {Object} self\n *\n * @description\n * Adds a new route definition to the `$route` service.\n */\n this.when = function(path, route) {\n //copy original route object to preserve params inherited from proto chain\n var routeCopy = shallowCopy(route);\n if (angular.isUndefined(routeCopy.reloadOnUrl)) {\n routeCopy.reloadOnUrl = true;\n }\n if (angular.isUndefined(routeCopy.reloadOnSearch)) {\n routeCopy.reloadOnSearch = true;\n }\n if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {\n routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;\n }\n routes[path] = angular.extend(\n routeCopy,\n {originalPath: path},\n path && routeToRegExp(path, routeCopy)\n );\n\n // create redirection for trailing slashes\n if (path) {\n var redirectPath = (path[path.length - 1] === '/')\n ? path.substr(0, path.length - 1)\n : path + '/';\n\n routes[redirectPath] = angular.extend(\n {originalPath: path, redirectTo: path},\n routeToRegExp(redirectPath, routeCopy)\n );\n }\n\n return this;\n };\n\n /**\n * @ngdoc property\n * @name $routeProvider#caseInsensitiveMatch\n * @description\n *\n * A boolean property indicating if routes defined\n * using this provider should be matched using a case insensitive\n * algorithm. Defaults to `false`.\n */\n this.caseInsensitiveMatch = false;\n\n /**\n * @ngdoc method\n * @name $routeProvider#otherwise\n *\n * @description\n * Sets route definition that will be used on route change when no other route definition\n * is matched.\n *\n * @param {Object|string} params Mapping information to be assigned to `$route.current`.\n * If called with a string, the value maps to `redirectTo`.\n * @returns {Object} self\n */\n this.otherwise = function(params) {\n if (typeof params === 'string') {\n params = {redirectTo: params};\n }\n this.when(null, params);\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $routeProvider#eagerInstantiationEnabled\n * @kind function\n *\n * @description\n * Call this method as a setter to enable/disable eager instantiation of the\n * {@link ngRoute.$route $route} service upon application bootstrap. You can also call it as a\n * getter (i.e. without any arguments) to get the current value of the\n * `eagerInstantiationEnabled` flag.\n *\n * Instantiating `$route` early is necessary for capturing the initial\n * {@link ng.$location#$locationChangeStart $locationChangeStart} event and navigating to the\n * appropriate route. Usually, `$route` is instantiated in time by the\n * {@link ngRoute.ngView ngView} directive. Yet, in cases where `ngView` is included in an\n * asynchronously loaded template (e.g. in another directive's template), the directive factory\n * might not be called soon enough for `$route` to be instantiated _before_ the initial\n * `$locationChangeSuccess` event is fired. Eager instantiation ensures that `$route` is always\n * instantiated in time, regardless of when `ngView` will be loaded.\n *\n * The default value is true.\n *\n * **Note**:
\n * You may want to disable the default behavior when unit-testing modules that depend on\n * `ngRoute`, in order to avoid an unexpected request for the default route's template.\n *\n * @param {boolean=} enabled - If provided, update the internal `eagerInstantiationEnabled` flag.\n *\n * @returns {*} The current value of the `eagerInstantiationEnabled` flag if used as a getter or\n * itself (for chaining) if used as a setter.\n */\n isEagerInstantiationEnabled = true;\n this.eagerInstantiationEnabled = function eagerInstantiationEnabled(enabled) {\n if (isDefined(enabled)) {\n isEagerInstantiationEnabled = enabled;\n return this;\n }\n\n return isEagerInstantiationEnabled;\n };\n\n\n this.$get = ['$rootScope',\n '$location',\n '$routeParams',\n '$q',\n '$injector',\n '$templateRequest',\n '$sce',\n '$browser',\n function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) {\n\n /**\n * @ngdoc service\n * @name $route\n * @requires $location\n * @requires $routeParams\n *\n * @property {Object} current Reference to the current route definition.\n * The route definition contains:\n *\n * - `controller`: The controller constructor as defined in the route definition.\n * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for\n * controller instantiation. The `locals` contain\n * the resolved values of the `resolve` map. Additionally the `locals` also contain:\n *\n * - `$scope` - The current route scope.\n * - `$template` - The current route template HTML.\n *\n * The `locals` will be assigned to the route scope's `$resolve` property. You can override\n * the property name, using `resolveAs` in the route definition. See\n * {@link ngRoute.$routeProvider $routeProvider} for more info.\n *\n * @property {Object} routes Object with all route configuration Objects as its properties.\n *\n * @description\n * `$route` is used for deep-linking URLs to controllers and views (HTML partials).\n * It watches `$location.url()` and tries to map the path to an existing route definition.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.\n *\n * The `$route` service is typically used in conjunction with the\n * {@link ngRoute.directive:ngView `ngView`} directive and the\n * {@link ngRoute.$routeParams `$routeParams`} service.\n *\n * @example\n * This example shows how changing the URL hash causes the `$route` to match a route against the\n * URL, and the `ngView` pulls in the partial.\n *\n * \n * \n *
\n * Choose:\n * Moby |\n * Moby: Ch1 |\n * Gatsby |\n * Gatsby: Ch4 |\n * Scarlet Letter
\n *\n *
\n *\n *
\n *\n *
$location.path() = {{$location.path()}}
\n *
$route.current.templateUrl = {{$route.current.templateUrl}}
\n *
$route.current.params = {{$route.current.params}}
\n *
$route.current.scope.name = {{$route.current.scope.name}}
\n *
$routeParams = {{$routeParams}}
\n *
\n *
\n *\n * \n * controller: {{name}}
\n * Book Id: {{params.bookId}}
\n *
\n *\n * \n * controller: {{name}}
\n * Book Id: {{params.bookId}}
\n * Chapter Id: {{params.chapterId}}\n *
\n *\n * \n * angular.module('ngRouteExample', ['ngRoute'])\n *\n * .controller('MainController', function($scope, $route, $routeParams, $location) {\n * $scope.$route = $route;\n * $scope.$location = $location;\n * $scope.$routeParams = $routeParams;\n * })\n *\n * .controller('BookController', function($scope, $routeParams) {\n * $scope.name = 'BookController';\n * $scope.params = $routeParams;\n * })\n *\n * .controller('ChapterController', function($scope, $routeParams) {\n * $scope.name = 'ChapterController';\n * $scope.params = $routeParams;\n * })\n *\n * .config(function($routeProvider, $locationProvider) {\n * $routeProvider\n * .when('/Book/:bookId', {\n * templateUrl: 'book.html',\n * controller: 'BookController',\n * resolve: {\n * // I will cause a 1 second delay\n * delay: function($q, $timeout) {\n * var delay = $q.defer();\n * $timeout(delay.resolve, 1000);\n * return delay.promise;\n * }\n * }\n * })\n * .when('/Book/:bookId/ch/:chapterId', {\n * templateUrl: 'chapter.html',\n * controller: 'ChapterController'\n * });\n *\n * // configure html5 to get links working on jsfiddle\n * $locationProvider.html5Mode(true);\n * });\n *\n * \n *\n * \n * it('should load and compile correct template', function() {\n * element(by.linkText('Moby: Ch1')).click();\n * var content = element(by.css('[ng-view]')).getText();\n * expect(content).toMatch(/controller: ChapterController/);\n * expect(content).toMatch(/Book Id: Moby/);\n * expect(content).toMatch(/Chapter Id: 1/);\n *\n * element(by.partialLinkText('Scarlet')).click();\n *\n * content = element(by.css('[ng-view]')).getText();\n * expect(content).toMatch(/controller: BookController/);\n * expect(content).toMatch(/Book Id: Scarlet/);\n * });\n * \n *
\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a route change. At this point the route services starts\n * resolving all of the dependencies needed for the route change to occur.\n * Typically this involves fetching the view template as well as any dependencies\n * defined in `resolve` route property. Once all of the dependencies are resolved\n * `$routeChangeSuccess` is fired.\n *\n * The route change (and the `$location` change that triggered it) can be prevented\n * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}\n * for more details about event object.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {Route} next Future route information.\n * @param {Route} current Current route information.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a route change has happened successfully.\n * The `resolve` dependencies are now available in the `current.locals` property.\n *\n * {@link ngRoute.directive:ngView ngView} listens for the directive\n * to instantiate the controller and render the view.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {Route} current Current route information.\n * @param {Route|Undefined} previous Previous route information, or undefined if current is\n * first route entered.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeChangeError\n * @eventType broadcast on root scope\n * @description\n * Broadcasted if a redirection function fails or any redirection or resolve promises are\n * rejected.\n *\n * @param {Object} angularEvent Synthetic event object\n * @param {Route} current Current route information.\n * @param {Route} previous Previous route information.\n * @param {Route} rejection The thrown error or the rejection reason of the promise. Usually\n * the rejection reason is the error that caused the promise to get rejected.\n */\n\n /**\n * @ngdoc event\n * @name $route#$routeUpdate\n * @eventType broadcast on root scope\n * @description\n * Broadcasted if the same instance of a route (including template, controller instance,\n * resolved dependencies, etc.) is being reused. This can happen if either `reloadOnSearch` or\n * `reloadOnUrl` has been set to `false`.\n *\n * @param {Object} angularEvent Synthetic event object\n * @param {Route} current Current/previous route information.\n */\n\n var forceReload = false,\n preparedRoute,\n preparedRouteIsUpdateOnly,\n $route = {\n routes: routes,\n\n /**\n * @ngdoc method\n * @name $route#reload\n *\n * @description\n * Causes `$route` service to reload the current route even if\n * {@link ng.$location $location} hasn't changed.\n *\n * As a result of that, {@link ngRoute.directive:ngView ngView}\n * creates new scope and reinstantiates the controller.\n */\n reload: function() {\n forceReload = true;\n\n var fakeLocationEvent = {\n defaultPrevented: false,\n preventDefault: function fakePreventDefault() {\n this.defaultPrevented = true;\n forceReload = false;\n }\n };\n\n $rootScope.$evalAsync(function() {\n prepareRoute(fakeLocationEvent);\n if (!fakeLocationEvent.defaultPrevented) commitRoute();\n });\n },\n\n /**\n * @ngdoc method\n * @name $route#updateParams\n *\n * @description\n * Causes `$route` service to update the current URL, replacing\n * current route parameters with those specified in `newParams`.\n * Provided property names that match the route's path segment\n * definitions will be interpolated into the location's path, while\n * remaining properties will be treated as query params.\n *\n * @param {!Object} newParams mapping of URL parameter names to values\n */\n updateParams: function(newParams) {\n if (this.current && this.current.$$route) {\n newParams = angular.extend({}, this.current.params, newParams);\n $location.path(interpolate(this.current.$$route.originalPath, newParams));\n // interpolate modifies newParams, only query params are left\n $location.search(newParams);\n } else {\n throw $routeMinErr('norout', 'Tried updating route with no current route');\n }\n }\n };\n\n $rootScope.$on('$locationChangeStart', prepareRoute);\n $rootScope.$on('$locationChangeSuccess', commitRoute);\n\n return $route;\n\n /////////////////////////////////////////////////////\n\n /**\n * @param on {string} current url\n * @param route {Object} route regexp to match the url against\n * @return {?Object}\n *\n * @description\n * Check if the route matches the current url.\n *\n * Inspired by match in\n * visionmedia/express/lib/router/router.js.\n */\n function switchRouteMatcher(on, route) {\n var keys = route.keys,\n params = {};\n\n if (!route.regexp) return null;\n\n var m = route.regexp.exec(on);\n if (!m) return null;\n\n for (var i = 1, len = m.length; i < len; ++i) {\n var key = keys[i - 1];\n\n var val = m[i];\n\n if (key && val) {\n params[key.name] = val;\n }\n }\n return params;\n }\n\n function prepareRoute($locationEvent) {\n var lastRoute = $route.current;\n\n preparedRoute = parseRoute();\n preparedRouteIsUpdateOnly = isNavigationUpdateOnly(preparedRoute, lastRoute);\n\n if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {\n if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {\n if ($locationEvent) {\n $locationEvent.preventDefault();\n }\n }\n }\n }\n\n function commitRoute() {\n var lastRoute = $route.current;\n var nextRoute = preparedRoute;\n\n if (preparedRouteIsUpdateOnly) {\n lastRoute.params = nextRoute.params;\n angular.copy(lastRoute.params, $routeParams);\n $rootScope.$broadcast('$routeUpdate', lastRoute);\n } else if (nextRoute || lastRoute) {\n forceReload = false;\n $route.current = nextRoute;\n\n var nextRoutePromise = $q.resolve(nextRoute);\n\n $browser.$$incOutstandingRequestCount('$route');\n\n nextRoutePromise.\n then(getRedirectionData).\n then(handlePossibleRedirection).\n then(function(keepProcessingRoute) {\n return keepProcessingRoute && nextRoutePromise.\n then(resolveLocals).\n then(function(locals) {\n // after route change\n if (nextRoute === $route.current) {\n if (nextRoute) {\n nextRoute.locals = locals;\n angular.copy(nextRoute.params, $routeParams);\n }\n $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);\n }\n });\n }).catch(function(error) {\n if (nextRoute === $route.current) {\n $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);\n }\n }).finally(function() {\n // Because `commitRoute()` is called from a `$rootScope.$evalAsync` block (see\n // `$locationWatch`), this `$$completeOutstandingRequest()` call will not cause\n // `outstandingRequestCount` to hit zero. This is important in case we are redirecting\n // to a new route which also requires some asynchronous work.\n\n $browser.$$completeOutstandingRequest(noop, '$route');\n });\n }\n }\n\n function getRedirectionData(route) {\n var data = {\n route: route,\n hasRedirection: false\n };\n\n if (route) {\n if (route.redirectTo) {\n if (angular.isString(route.redirectTo)) {\n data.path = interpolate(route.redirectTo, route.params);\n data.search = route.params;\n data.hasRedirection = true;\n } else {\n var oldPath = $location.path();\n var oldSearch = $location.search();\n var newUrl = route.redirectTo(route.pathParams, oldPath, oldSearch);\n\n if (angular.isDefined(newUrl)) {\n data.url = newUrl;\n data.hasRedirection = true;\n }\n }\n } else if (route.resolveRedirectTo) {\n return $q.\n resolve($injector.invoke(route.resolveRedirectTo)).\n then(function(newUrl) {\n if (angular.isDefined(newUrl)) {\n data.url = newUrl;\n data.hasRedirection = true;\n }\n\n return data;\n });\n }\n }\n\n return data;\n }\n\n function handlePossibleRedirection(data) {\n var keepProcessingRoute = true;\n\n if (data.route !== $route.current) {\n keepProcessingRoute = false;\n } else if (data.hasRedirection) {\n var oldUrl = $location.url();\n var newUrl = data.url;\n\n if (newUrl) {\n $location.\n url(newUrl).\n replace();\n } else {\n newUrl = $location.\n path(data.path).\n search(data.search).\n replace().\n url();\n }\n\n if (newUrl !== oldUrl) {\n // Exit out and don't process current next value,\n // wait for next location change from redirect\n keepProcessingRoute = false;\n }\n }\n\n return keepProcessingRoute;\n }\n\n function resolveLocals(route) {\n if (route) {\n var locals = angular.extend({}, route.resolve);\n angular.forEach(locals, function(value, key) {\n locals[key] = angular.isString(value) ?\n $injector.get(value) :\n $injector.invoke(value, null, null, key);\n });\n var template = getTemplateFor(route);\n if (angular.isDefined(template)) {\n locals['$template'] = template;\n }\n return $q.all(locals);\n }\n }\n\n function getTemplateFor(route) {\n var template, templateUrl;\n if (angular.isDefined(template = route.template)) {\n if (angular.isFunction(template)) {\n template = template(route.params);\n }\n } else if (angular.isDefined(templateUrl = route.templateUrl)) {\n if (angular.isFunction(templateUrl)) {\n templateUrl = templateUrl(route.params);\n }\n if (angular.isDefined(templateUrl)) {\n route.loadedTemplateUrl = $sce.valueOf(templateUrl);\n template = $templateRequest(templateUrl);\n }\n }\n return template;\n }\n\n /**\n * @returns {Object} the current active route, by matching it against the URL\n */\n function parseRoute() {\n // Match a route\n var params, match;\n angular.forEach(routes, function(route, path) {\n if (!match && (params = switchRouteMatcher($location.path(), route))) {\n match = inherit(route, {\n params: angular.extend({}, $location.search(), params),\n pathParams: params});\n match.$$route = route;\n }\n });\n // No route matched; fallback to \"otherwise\" route\n return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});\n }\n\n /**\n * @param {Object} newRoute - The new route configuration (as returned by `parseRoute()`).\n * @param {Object} oldRoute - The previous route configuration (as returned by `parseRoute()`).\n * @returns {boolean} Whether this is an \"update-only\" navigation, i.e. the URL maps to the same\n * route and it can be reused (based on the config and the type of change).\n */\n function isNavigationUpdateOnly(newRoute, oldRoute) {\n // IF this is not a forced reload\n return !forceReload\n // AND both `newRoute`/`oldRoute` are defined\n && newRoute && oldRoute\n // AND they map to the same Route Definition Object\n && (newRoute.$$route === oldRoute.$$route)\n // AND `reloadOnUrl` is disabled\n && (!newRoute.reloadOnUrl\n // OR `reloadOnSearch` is disabled\n || (!newRoute.reloadOnSearch\n // AND both routes have the same path params\n && angular.equals(newRoute.pathParams, oldRoute.pathParams)\n )\n );\n }\n\n /**\n * @returns {string} interpolation of the redirect path with the parameters\n */\n function interpolate(string, params) {\n var result = [];\n angular.forEach((string || '').split(':'), function(segment, i) {\n if (i === 0) {\n result.push(segment);\n } else {\n var segmentMatch = segment.match(/(\\w+)(?:[?*])?(.*)/);\n var key = segmentMatch[1];\n result.push(params[key]);\n result.push(segmentMatch[2] || '');\n delete params[key];\n }\n });\n return result.join('');\n }\n }];\n}\n\ninstantiateRoute.$inject = ['$injector'];\nfunction instantiateRoute($injector) {\n if (isEagerInstantiationEnabled) {\n // Instantiate `$route`\n $injector.get('$route');\n }\n}\n\nngRouteModule.provider('$routeParams', $RouteParamsProvider);\n\n\n/**\n * @ngdoc service\n * @name $routeParams\n * @requires $route\n * @this\n *\n * @description\n * The `$routeParams` service allows you to retrieve the current set of route parameters.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * The route parameters are a combination of {@link ng.$location `$location`}'s\n * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.\n * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.\n *\n * In case of parameter name collision, `path` params take precedence over `search` params.\n *\n * The service guarantees that the identity of the `$routeParams` object will remain unchanged\n * (but its properties will likely change) even when a route change occurs.\n *\n * Note that the `$routeParams` are only updated *after* a route change completes successfully.\n * This means that you cannot rely on `$routeParams` being correct in route resolve functions.\n * Instead you can use `$route.current.params` to access the new route's parameters.\n *\n * @example\n * ```js\n * // Given:\n * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby\n * // Route: /Chapter/:chapterId/Section/:sectionId\n * //\n * // Then\n * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}\n * ```\n */\nfunction $RouteParamsProvider() {\n this.$get = function() { return {}; };\n}\n\nngRouteModule.directive('ngView', ngViewFactory);\nngRouteModule.directive('ngView', ngViewFillContentFactory);\n\n\n/**\n * @ngdoc directive\n * @name ngView\n * @restrict ECA\n *\n * @description\n * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by\n * including the rendered template of the current route into the main layout (`index.html`) file.\n * Every time the current route changes, the included view changes with it according to the\n * configuration of the `$route` service.\n *\n * Requires the {@link ngRoute `ngRoute`} module to be installed.\n *\n * @animations\n * | Animation | Occurs |\n * |----------------------------------|-------------------------------------|\n * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM |\n * | {@link ng.$animate#leave leave} | when the old element is removed from to the DOM |\n *\n * The enter and leave animation occur concurrently.\n *\n * @scope\n * @priority 400\n * @param {string=} onload Expression to evaluate whenever the view updates.\n *\n * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll\n * $anchorScroll} to scroll the viewport after the view is updated.\n *\n * - If the attribute is not set, disable scrolling.\n * - If the attribute is set without value, enable scrolling.\n * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated\n * as an expression yields a truthy value.\n * @example\n \n \n
\n Choose:\n Moby |\n Moby: Ch1 |\n Gatsby |\n Gatsby: Ch4 |\n Scarlet Letter
\n\n
\n
\n
\n
\n\n
$location.path() = {{main.$location.path()}}
\n
$route.current.templateUrl = {{main.$route.current.templateUrl}}
\n
$route.current.params = {{main.$route.current.params}}
\n
$routeParams = {{main.$routeParams}}
\n
\n
\n\n \n
\n controller: {{book.name}}
\n Book Id: {{book.params.bookId}}
\n
\n
\n\n \n
\n controller: {{chapter.name}}
\n Book Id: {{chapter.params.bookId}}
\n Chapter Id: {{chapter.params.chapterId}}\n
\n
\n\n \n .view-animate-container {\n position:relative;\n height:100px!important;\n background:white;\n border:1px solid black;\n height:40px;\n overflow:hidden;\n }\n\n .view-animate {\n padding:10px;\n }\n\n .view-animate.ng-enter, .view-animate.ng-leave {\n transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;\n\n display:block;\n width:100%;\n border-left:1px solid black;\n\n position:absolute;\n top:0;\n left:0;\n right:0;\n bottom:0;\n padding:10px;\n }\n\n .view-animate.ng-enter {\n left:100%;\n }\n .view-animate.ng-enter.ng-enter-active {\n left:0;\n }\n .view-animate.ng-leave.ng-leave-active {\n left:-100%;\n }\n \n\n \n angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])\n .config(['$routeProvider', '$locationProvider',\n function($routeProvider, $locationProvider) {\n $routeProvider\n .when('/Book/:bookId', {\n templateUrl: 'book.html',\n controller: 'BookCtrl',\n controllerAs: 'book'\n })\n .when('/Book/:bookId/ch/:chapterId', {\n templateUrl: 'chapter.html',\n controller: 'ChapterCtrl',\n controllerAs: 'chapter'\n });\n\n $locationProvider.html5Mode(true);\n }])\n .controller('MainCtrl', ['$route', '$routeParams', '$location',\n function MainCtrl($route, $routeParams, $location) {\n this.$route = $route;\n this.$location = $location;\n this.$routeParams = $routeParams;\n }])\n .controller('BookCtrl', ['$routeParams', function BookCtrl($routeParams) {\n this.name = 'BookCtrl';\n this.params = $routeParams;\n }])\n .controller('ChapterCtrl', ['$routeParams', function ChapterCtrl($routeParams) {\n this.name = 'ChapterCtrl';\n this.params = $routeParams;\n }]);\n\n \n\n \n it('should load and compile correct template', function() {\n element(by.linkText('Moby: Ch1')).click();\n var content = element(by.css('[ng-view]')).getText();\n expect(content).toMatch(/controller: ChapterCtrl/);\n expect(content).toMatch(/Book Id: Moby/);\n expect(content).toMatch(/Chapter Id: 1/);\n\n element(by.partialLinkText('Scarlet')).click();\n\n content = element(by.css('[ng-view]')).getText();\n expect(content).toMatch(/controller: BookCtrl/);\n expect(content).toMatch(/Book Id: Scarlet/);\n });\n \n
\n */\n\n\n/**\n * @ngdoc event\n * @name ngView#$viewContentLoaded\n * @eventType emit on the current ngView scope\n * @description\n * Emitted every time the ngView content is reloaded.\n */\nngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];\nfunction ngViewFactory($route, $anchorScroll, $animate) {\n return {\n restrict: 'ECA',\n terminal: true,\n priority: 400,\n transclude: 'element',\n link: function(scope, $element, attr, ctrl, $transclude) {\n var currentScope,\n currentElement,\n previousLeaveAnimation,\n autoScrollExp = attr.autoscroll,\n onloadExp = attr.onload || '';\n\n scope.$on('$routeChangeSuccess', update);\n update();\n\n function cleanupLastView() {\n if (previousLeaveAnimation) {\n $animate.cancel(previousLeaveAnimation);\n previousLeaveAnimation = null;\n }\n\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n if (currentElement) {\n previousLeaveAnimation = $animate.leave(currentElement);\n previousLeaveAnimation.done(function(response) {\n if (response !== false) previousLeaveAnimation = null;\n });\n currentElement = null;\n }\n }\n\n function update() {\n var locals = $route.current && $route.current.locals,\n template = locals && locals.$template;\n\n if (angular.isDefined(template)) {\n var newScope = scope.$new();\n var current = $route.current;\n\n // Note: This will also link all children of ng-view that were contained in the original\n // html. If that content contains controllers, ... they could pollute/change the scope.\n // However, using ng-view on an element with additional content does not make sense...\n // Note: We can't remove them in the cloneAttchFn of $transclude as that\n // function is called before linking the content, which would apply child\n // directives to non existing elements.\n var clone = $transclude(newScope, function(clone) {\n $animate.enter(clone, null, currentElement || $element).done(function onNgViewEnter(response) {\n if (response !== false && angular.isDefined(autoScrollExp)\n && (!autoScrollExp || scope.$eval(autoScrollExp))) {\n $anchorScroll();\n }\n });\n cleanupLastView();\n });\n\n currentElement = clone;\n currentScope = current.scope = newScope;\n currentScope.$emit('$viewContentLoaded');\n currentScope.$eval(onloadExp);\n } else {\n cleanupLastView();\n }\n }\n }\n };\n}\n\n// This directive is called during the $transclude call of the first `ngView` directive.\n// It will replace and compile the content of the element with the loaded template.\n// We need this directive so that the element content is already filled when\n// the link function of another directive on the same element as ngView\n// is called.\nngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];\nfunction ngViewFillContentFactory($compile, $controller, $route) {\n return {\n restrict: 'ECA',\n priority: -400,\n link: function(scope, $element) {\n var current = $route.current,\n locals = current.locals;\n\n $element.html(locals.$template);\n\n var link = $compile($element.contents());\n\n if (current.controller) {\n locals.$scope = scope;\n var controller = $controller(current.controller, locals);\n if (current.controllerAs) {\n scope[current.controllerAs] = controller;\n }\n $element.data('$ngControllerController', controller);\n $element.children().data('$ngControllerController', controller);\n }\n scope[current.resolveAs || '$resolve'] = locals;\n\n link(scope);\n }\n };\n}\n\n\n})(window, window.angular);\n","require('./angular-route');\nmodule.exports = 'ngRoute';\n","/*\n * angular-ui-bootstrap\n * http://angular-ui.github.io/bootstrap/\n\n * Version: 2.5.6 - 2017-10-14\n * License: MIT\n */angular.module(\"ui.bootstrap\", [\"ui.bootstrap.tpls\", \"ui.bootstrap.collapse\",\"ui.bootstrap.tabindex\",\"ui.bootstrap.accordion\",\"ui.bootstrap.alert\",\"ui.bootstrap.buttons\",\"ui.bootstrap.carousel\",\"ui.bootstrap.dateparser\",\"ui.bootstrap.isClass\",\"ui.bootstrap.datepicker\",\"ui.bootstrap.position\",\"ui.bootstrap.datepickerPopup\",\"ui.bootstrap.debounce\",\"ui.bootstrap.multiMap\",\"ui.bootstrap.dropdown\",\"ui.bootstrap.stackedMap\",\"ui.bootstrap.modal\",\"ui.bootstrap.paging\",\"ui.bootstrap.pager\",\"ui.bootstrap.pagination\",\"ui.bootstrap.tooltip\",\"ui.bootstrap.popover\",\"ui.bootstrap.progressbar\",\"ui.bootstrap.rating\",\"ui.bootstrap.tabs\",\"ui.bootstrap.timepicker\",\"ui.bootstrap.typeahead\"]);\nangular.module(\"ui.bootstrap.tpls\", [\"uib/template/accordion/accordion-group.html\",\"uib/template/accordion/accordion.html\",\"uib/template/alert/alert.html\",\"uib/template/carousel/carousel.html\",\"uib/template/carousel/slide.html\",\"uib/template/datepicker/datepicker.html\",\"uib/template/datepicker/day.html\",\"uib/template/datepicker/month.html\",\"uib/template/datepicker/year.html\",\"uib/template/datepickerPopup/popup.html\",\"uib/template/modal/window.html\",\"uib/template/pager/pager.html\",\"uib/template/pagination/pagination.html\",\"uib/template/tooltip/tooltip-html-popup.html\",\"uib/template/tooltip/tooltip-popup.html\",\"uib/template/tooltip/tooltip-template-popup.html\",\"uib/template/popover/popover-html.html\",\"uib/template/popover/popover-template.html\",\"uib/template/popover/popover.html\",\"uib/template/progressbar/bar.html\",\"uib/template/progressbar/progress.html\",\"uib/template/progressbar/progressbar.html\",\"uib/template/rating/rating.html\",\"uib/template/tabs/tab.html\",\"uib/template/tabs/tabset.html\",\"uib/template/timepicker/timepicker.html\",\"uib/template/typeahead/typeahead-match.html\",\"uib/template/typeahead/typeahead-popup.html\"]);\nangular.module('ui.bootstrap.collapse', [])\n\n .directive('uibCollapse', ['$animate', '$q', '$parse', '$injector', function($animate, $q, $parse, $injector) {\n var $animateCss = $injector.has('$animateCss') ? $injector.get('$animateCss') : null;\n return {\n link: function(scope, element, attrs) {\n var expandingExpr = $parse(attrs.expanding),\n expandedExpr = $parse(attrs.expanded),\n collapsingExpr = $parse(attrs.collapsing),\n collapsedExpr = $parse(attrs.collapsed),\n horizontal = false,\n css = {},\n cssTo = {};\n\n init();\n\n function init() {\n horizontal = !!('horizontal' in attrs);\n if (horizontal) {\n css = {\n width: ''\n };\n cssTo = {width: '0'};\n } else {\n css = {\n height: ''\n };\n cssTo = {height: '0'};\n }\n if (!scope.$eval(attrs.uibCollapse)) {\n element.addClass('in')\n .addClass('collapse')\n .attr('aria-expanded', true)\n .attr('aria-hidden', false)\n .css(css);\n }\n }\n\n function getScrollFromElement(element) {\n if (horizontal) {\n return {width: element.scrollWidth + 'px'};\n }\n return {height: element.scrollHeight + 'px'};\n }\n\n function expand() {\n if (element.hasClass('collapse') && element.hasClass('in')) {\n return;\n }\n\n $q.resolve(expandingExpr(scope))\n .then(function() {\n element.removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', true)\n .attr('aria-hidden', false);\n\n if ($animateCss) {\n $animateCss(element, {\n addClass: 'in',\n easing: 'ease',\n css: {\n overflow: 'hidden'\n },\n to: getScrollFromElement(element[0])\n }).start()['finally'](expandDone);\n } else {\n $animate.addClass(element, 'in', {\n css: {\n overflow: 'hidden'\n },\n to: getScrollFromElement(element[0])\n }).then(expandDone);\n }\n }, angular.noop);\n }\n\n function expandDone() {\n element.removeClass('collapsing')\n .addClass('collapse')\n .css(css);\n expandedExpr(scope);\n }\n\n function collapse() {\n if (!element.hasClass('collapse') && !element.hasClass('in')) {\n return collapseDone();\n }\n\n $q.resolve(collapsingExpr(scope))\n .then(function() {\n element\n // IMPORTANT: The width must be set before adding \"collapsing\" class.\n // Otherwise, the browser attempts to animate from width 0 (in\n // collapsing class) to the given width here.\n .css(getScrollFromElement(element[0]))\n // initially all panel collapse have the collapse class, this removal\n // prevents the animation from jumping to collapsed state\n .removeClass('collapse')\n .addClass('collapsing')\n .attr('aria-expanded', false)\n .attr('aria-hidden', true);\n\n if ($animateCss) {\n $animateCss(element, {\n removeClass: 'in',\n to: cssTo\n }).start()['finally'](collapseDone);\n } else {\n $animate.removeClass(element, 'in', {\n to: cssTo\n }).then(collapseDone);\n }\n }, angular.noop);\n }\n\n function collapseDone() {\n element.css(cssTo); // Required so that collapse works when animation is disabled\n element.removeClass('collapsing')\n .addClass('collapse');\n collapsedExpr(scope);\n }\n\n scope.$watch(attrs.uibCollapse, function(shouldCollapse) {\n if (shouldCollapse) {\n collapse();\n } else {\n expand();\n }\n });\n }\n };\n }]);\n\nangular.module('ui.bootstrap.tabindex', [])\n\n.directive('uibTabindexToggle', function() {\n return {\n restrict: 'A',\n link: function(scope, elem, attrs) {\n attrs.$observe('disabled', function(disabled) {\n attrs.$set('tabindex', disabled ? -1 : null);\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.accordion', ['ui.bootstrap.collapse', 'ui.bootstrap.tabindex'])\n\n.constant('uibAccordionConfig', {\n closeOthers: true\n})\n\n.controller('UibAccordionController', ['$scope', '$attrs', 'uibAccordionConfig', function($scope, $attrs, accordionConfig) {\n // This array keeps track of the accordion groups\n this.groups = [];\n\n // Ensure that all the groups in this accordion are closed, unless close-others explicitly says not to\n this.closeOthers = function(openGroup) {\n var closeOthers = angular.isDefined($attrs.closeOthers) ?\n $scope.$eval($attrs.closeOthers) : accordionConfig.closeOthers;\n if (closeOthers) {\n angular.forEach(this.groups, function(group) {\n if (group !== openGroup) {\n group.isOpen = false;\n }\n });\n }\n };\n\n // This is called from the accordion-group directive to add itself to the accordion\n this.addGroup = function(groupScope) {\n var that = this;\n this.groups.push(groupScope);\n\n groupScope.$on('$destroy', function(event) {\n that.removeGroup(groupScope);\n });\n };\n\n // This is called from the accordion-group directive when to remove itself\n this.removeGroup = function(group) {\n var index = this.groups.indexOf(group);\n if (index !== -1) {\n this.groups.splice(index, 1);\n }\n };\n}])\n\n// The accordion directive simply sets up the directive controller\n// and adds an accordion CSS class to itself element.\n.directive('uibAccordion', function() {\n return {\n controller: 'UibAccordionController',\n controllerAs: 'accordion',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/accordion/accordion.html';\n }\n };\n})\n\n// The accordion-group directive indicates a block of html that will expand and collapse in an accordion\n.directive('uibAccordionGroup', function() {\n return {\n require: '^uibAccordion', // We need this directive to be inside an accordion\n transclude: true, // It transcludes the contents of the directive into the template\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/accordion/accordion-group.html';\n },\n scope: {\n heading: '@', // Interpolate the heading attribute onto this scope\n panelClass: '@?', // Ditto with panelClass\n isOpen: '=?',\n isDisabled: '=?'\n },\n controller: function() {\n this.setHeading = function(element) {\n this.heading = element;\n };\n },\n link: function(scope, element, attrs, accordionCtrl) {\n element.addClass('panel');\n accordionCtrl.addGroup(scope);\n\n scope.openClass = attrs.openClass || 'panel-open';\n scope.panelClass = attrs.panelClass || 'panel-default';\n scope.$watch('isOpen', function(value) {\n element.toggleClass(scope.openClass, !!value);\n if (value) {\n accordionCtrl.closeOthers(scope);\n }\n });\n\n scope.toggleOpen = function($event) {\n if (!scope.isDisabled) {\n if (!$event || $event.which === 32) {\n scope.isOpen = !scope.isOpen;\n }\n }\n };\n\n var id = 'accordiongroup-' + scope.$id + '-' + Math.floor(Math.random() * 10000);\n scope.headingId = id + '-tab';\n scope.panelId = id + '-panel';\n }\n };\n})\n\n// Use accordion-heading below an accordion-group to provide a heading containing HTML\n.directive('uibAccordionHeading', function() {\n return {\n transclude: true, // Grab the contents to be used as the heading\n template: '', // In effect remove this element!\n replace: true,\n require: '^uibAccordionGroup',\n link: function(scope, element, attrs, accordionGroupCtrl, transclude) {\n // Pass the heading to the accordion-group controller\n // so that it can be transcluded into the right place in the template\n // [The second parameter to transclude causes the elements to be cloned so that they work in ng-repeat]\n accordionGroupCtrl.setHeading(transclude(scope, angular.noop));\n }\n };\n})\n\n// Use in the accordion-group template to indicate where you want the heading to be transcluded\n// You must provide the property on the accordion-group controller that will hold the transcluded element\n.directive('uibAccordionTransclude', function() {\n return {\n require: '^uibAccordionGroup',\n link: function(scope, element, attrs, controller) {\n scope.$watch(function() { return controller[attrs.uibAccordionTransclude]; }, function(heading) {\n if (heading) {\n var elem = angular.element(element[0].querySelector(getHeaderSelectors()));\n elem.html('');\n elem.append(heading);\n }\n });\n }\n };\n\n function getHeaderSelectors() {\n return 'uib-accordion-header,' +\n 'data-uib-accordion-header,' +\n 'x-uib-accordion-header,' +\n 'uib\\\\:accordion-header,' +\n '[uib-accordion-header],' +\n '[data-uib-accordion-header],' +\n '[x-uib-accordion-header]';\n }\n});\n\nangular.module('ui.bootstrap.alert', [])\n\n.controller('UibAlertController', ['$scope', '$element', '$attrs', '$interpolate', '$timeout', function($scope, $element, $attrs, $interpolate, $timeout) {\n $scope.closeable = !!$attrs.close;\n $element.addClass('alert');\n $attrs.$set('role', 'alert');\n if ($scope.closeable) {\n $element.addClass('alert-dismissible');\n }\n\n var dismissOnTimeout = angular.isDefined($attrs.dismissOnTimeout) ?\n $interpolate($attrs.dismissOnTimeout)($scope.$parent) : null;\n\n if (dismissOnTimeout) {\n $timeout(function() {\n $scope.close();\n }, parseInt(dismissOnTimeout, 10));\n }\n}])\n\n.directive('uibAlert', function() {\n return {\n controller: 'UibAlertController',\n controllerAs: 'alert',\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/alert/alert.html';\n },\n transclude: true,\n scope: {\n close: '&'\n }\n };\n});\n\nangular.module('ui.bootstrap.buttons', [])\n\n.constant('uibButtonConfig', {\n activeClass: 'active',\n toggleEvent: 'click'\n})\n\n.controller('UibButtonsController', ['uibButtonConfig', function(buttonConfig) {\n this.activeClass = buttonConfig.activeClass || 'active';\n this.toggleEvent = buttonConfig.toggleEvent || 'click';\n}])\n\n.directive('uibBtnRadio', ['$parse', function($parse) {\n return {\n require: ['uibBtnRadio', 'ngModel'],\n controller: 'UibButtonsController',\n controllerAs: 'buttons',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n var uncheckableExpr = $parse(attrs.uibUncheckable);\n\n element.find('input').css({display: 'none'});\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, scope.$eval(attrs.uibBtnRadio)));\n };\n\n //ui->model\n element.on(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n var isActive = element.hasClass(buttonsCtrl.activeClass);\n\n if (!isActive || angular.isDefined(attrs.uncheckable)) {\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(isActive ? null : scope.$eval(attrs.uibBtnRadio));\n ngModelCtrl.$render();\n });\n }\n });\n\n if (attrs.uibUncheckable) {\n scope.$watch(uncheckableExpr, function(uncheckable) {\n attrs.$set('uncheckable', uncheckable ? '' : undefined);\n });\n }\n }\n };\n}])\n\n.directive('uibBtnCheckbox', function() {\n return {\n require: ['uibBtnCheckbox', 'ngModel'],\n controller: 'UibButtonsController',\n controllerAs: 'button',\n link: function(scope, element, attrs, ctrls) {\n var buttonsCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n element.find('input').css({display: 'none'});\n\n function getTrueValue() {\n return getCheckboxValue(attrs.btnCheckboxTrue, true);\n }\n\n function getFalseValue() {\n return getCheckboxValue(attrs.btnCheckboxFalse, false);\n }\n\n function getCheckboxValue(attribute, defaultValue) {\n return angular.isDefined(attribute) ? scope.$eval(attribute) : defaultValue;\n }\n\n //model -> UI\n ngModelCtrl.$render = function() {\n element.toggleClass(buttonsCtrl.activeClass, angular.equals(ngModelCtrl.$modelValue, getTrueValue()));\n };\n\n //ui->model\n element.on(buttonsCtrl.toggleEvent, function() {\n if (attrs.disabled) {\n return;\n }\n\n scope.$apply(function() {\n ngModelCtrl.$setViewValue(element.hasClass(buttonsCtrl.activeClass) ? getFalseValue() : getTrueValue());\n ngModelCtrl.$render();\n });\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.carousel', [])\n\n.controller('UibCarouselController', ['$scope', '$element', '$interval', '$timeout', '$animate', function($scope, $element, $interval, $timeout, $animate) {\n var self = this,\n slides = self.slides = $scope.slides = [],\n SLIDE_DIRECTION = 'uib-slideDirection',\n currentIndex = $scope.active,\n currentInterval, isPlaying;\n\n var destroyed = false;\n $element.addClass('carousel');\n\n self.addSlide = function(slide, element) {\n slides.push({\n slide: slide,\n element: element\n });\n slides.sort(function(a, b) {\n return +a.slide.index - +b.slide.index;\n });\n //if this is the first slide or the slide is set to active, select it\n if (slide.index === $scope.active || slides.length === 1 && !angular.isNumber($scope.active)) {\n if ($scope.$currentTransition) {\n $scope.$currentTransition = null;\n }\n\n currentIndex = slide.index;\n $scope.active = slide.index;\n setActive(currentIndex);\n self.select(slides[findSlideIndex(slide)]);\n if (slides.length === 1) {\n $scope.play();\n }\n }\n };\n\n self.getCurrentIndex = function() {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide.index === currentIndex) {\n return i;\n }\n }\n };\n\n self.next = $scope.next = function() {\n var newIndex = (self.getCurrentIndex() + 1) % slides.length;\n\n if (newIndex === 0 && $scope.noWrap()) {\n $scope.pause();\n return;\n }\n\n return self.select(slides[newIndex], 'next');\n };\n\n self.prev = $scope.prev = function() {\n var newIndex = self.getCurrentIndex() - 1 < 0 ? slides.length - 1 : self.getCurrentIndex() - 1;\n\n if ($scope.noWrap() && newIndex === slides.length - 1) {\n $scope.pause();\n return;\n }\n\n return self.select(slides[newIndex], 'prev');\n };\n\n self.removeSlide = function(slide) {\n var index = findSlideIndex(slide);\n\n //get the index of the slide inside the carousel\n slides.splice(index, 1);\n if (slides.length > 0 && currentIndex === index) {\n if (index >= slides.length) {\n currentIndex = slides.length - 1;\n $scope.active = currentIndex;\n setActive(currentIndex);\n self.select(slides[slides.length - 1]);\n } else {\n currentIndex = index;\n $scope.active = currentIndex;\n setActive(currentIndex);\n self.select(slides[index]);\n }\n } else if (currentIndex > index) {\n currentIndex--;\n $scope.active = currentIndex;\n }\n\n //clean the active value when no more slide\n if (slides.length === 0) {\n currentIndex = null;\n $scope.active = null;\n }\n };\n\n /* direction: \"prev\" or \"next\" */\n self.select = $scope.select = function(nextSlide, direction) {\n var nextIndex = findSlideIndex(nextSlide.slide);\n //Decide direction if it's not given\n if (direction === undefined) {\n direction = nextIndex > self.getCurrentIndex() ? 'next' : 'prev';\n }\n //Prevent this user-triggered transition from occurring if there is already one in progress\n if (nextSlide.slide.index !== currentIndex &&\n !$scope.$currentTransition) {\n goNext(nextSlide.slide, nextIndex, direction);\n }\n };\n\n /* Allow outside people to call indexOf on slides array */\n $scope.indexOfSlide = function(slide) {\n return +slide.slide.index;\n };\n\n $scope.isActive = function(slide) {\n return $scope.active === slide.slide.index;\n };\n\n $scope.isPrevDisabled = function() {\n return $scope.active === 0 && $scope.noWrap();\n };\n\n $scope.isNextDisabled = function() {\n return $scope.active === slides.length - 1 && $scope.noWrap();\n };\n\n $scope.pause = function() {\n if (!$scope.noPause) {\n isPlaying = false;\n resetTimer();\n }\n };\n\n $scope.play = function() {\n if (!isPlaying) {\n isPlaying = true;\n restartTimer();\n }\n };\n\n $element.on('mouseenter', $scope.pause);\n $element.on('mouseleave', $scope.play);\n\n $scope.$on('$destroy', function() {\n destroyed = true;\n resetTimer();\n });\n\n $scope.$watch('noTransition', function(noTransition) {\n $animate.enabled($element, !noTransition);\n });\n\n $scope.$watch('interval', restartTimer);\n\n $scope.$watchCollection('slides', resetTransition);\n\n $scope.$watch('active', function(index) {\n if (angular.isNumber(index) && currentIndex !== index) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide.index === index) {\n index = i;\n break;\n }\n }\n\n var slide = slides[index];\n if (slide) {\n setActive(index);\n self.select(slides[index]);\n currentIndex = index;\n }\n }\n });\n\n function getSlideByIndex(index) {\n for (var i = 0, l = slides.length; i < l; ++i) {\n if (slides[i].index === index) {\n return slides[i];\n }\n }\n }\n\n function setActive(index) {\n for (var i = 0; i < slides.length; i++) {\n slides[i].slide.active = i === index;\n }\n }\n\n function goNext(slide, index, direction) {\n if (destroyed) {\n return;\n }\n\n angular.extend(slide, {direction: direction});\n angular.extend(slides[currentIndex].slide || {}, {direction: direction});\n if ($animate.enabled($element) && !$scope.$currentTransition &&\n slides[index].element && self.slides.length > 1) {\n slides[index].element.data(SLIDE_DIRECTION, slide.direction);\n var currentIdx = self.getCurrentIndex();\n\n if (angular.isNumber(currentIdx) && slides[currentIdx].element) {\n slides[currentIdx].element.data(SLIDE_DIRECTION, slide.direction);\n }\n\n $scope.$currentTransition = true;\n $animate.on('addClass', slides[index].element, function(element, phase) {\n if (phase === 'close') {\n $scope.$currentTransition = null;\n $animate.off('addClass', element);\n }\n });\n }\n\n $scope.active = slide.index;\n currentIndex = slide.index;\n setActive(index);\n\n //every time you change slides, reset the timer\n restartTimer();\n }\n\n function findSlideIndex(slide) {\n for (var i = 0; i < slides.length; i++) {\n if (slides[i].slide === slide) {\n return i;\n }\n }\n }\n\n function resetTimer() {\n if (currentInterval) {\n $interval.cancel(currentInterval);\n currentInterval = null;\n }\n }\n\n function resetTransition(slides) {\n if (!slides.length) {\n $scope.$currentTransition = null;\n }\n }\n\n function restartTimer() {\n resetTimer();\n var interval = +$scope.interval;\n if (!isNaN(interval) && interval > 0) {\n currentInterval = $interval(timerFn, interval);\n }\n }\n\n function timerFn() {\n var interval = +$scope.interval;\n if (isPlaying && !isNaN(interval) && interval > 0 && slides.length) {\n $scope.next();\n } else {\n $scope.pause();\n }\n }\n}])\n\n.directive('uibCarousel', function() {\n return {\n transclude: true,\n controller: 'UibCarouselController',\n controllerAs: 'carousel',\n restrict: 'A',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/carousel/carousel.html';\n },\n scope: {\n active: '=',\n interval: '=',\n noTransition: '=',\n noPause: '=',\n noWrap: '&'\n }\n };\n})\n\n.directive('uibSlide', ['$animate', function($animate) {\n return {\n require: '^uibCarousel',\n restrict: 'A',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/carousel/slide.html';\n },\n scope: {\n actual: '=?',\n index: '=?'\n },\n link: function (scope, element, attrs, carouselCtrl) {\n element.addClass('item');\n carouselCtrl.addSlide(scope, element);\n //when the scope is destroyed then remove the slide from the current slides array\n scope.$on('$destroy', function() {\n carouselCtrl.removeSlide(scope);\n });\n\n scope.$watch('active', function(active) {\n $animate[active ? 'addClass' : 'removeClass'](element, 'active');\n });\n }\n };\n}])\n\n.animation('.item', ['$animateCss',\nfunction($animateCss) {\n var SLIDE_DIRECTION = 'uib-slideDirection';\n\n function removeClass(element, className, callback) {\n element.removeClass(className);\n if (callback) {\n callback();\n }\n }\n\n return {\n beforeAddClass: function(element, className, done) {\n if (className === 'active') {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction === 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element,\n directionClass + ' ' + direction, done);\n element.addClass(direction);\n\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n\n return function() {\n stopped = true;\n };\n }\n done();\n },\n beforeRemoveClass: function (element, className, done) {\n if (className === 'active') {\n var stopped = false;\n var direction = element.data(SLIDE_DIRECTION);\n var directionClass = direction === 'next' ? 'left' : 'right';\n var removeClassFn = removeClass.bind(this, element, directionClass, done);\n\n $animateCss(element, {addClass: directionClass})\n .start()\n .done(removeClassFn);\n\n return function() {\n stopped = true;\n };\n }\n done();\n }\n };\n}]);\n\nangular.module('ui.bootstrap.dateparser', [])\n\n.service('uibDateParser', ['$log', '$locale', 'dateFilter', 'orderByFilter', 'filterFilter', function($log, $locale, dateFilter, orderByFilter, filterFilter) {\n // Pulled from https://github.com/mbostock/d3/blob/master/src/format/requote.js\n var SPECIAL_CHARACTERS_REGEXP = /[\\\\\\^\\$\\*\\+\\?\\|\\[\\]\\(\\)\\.\\{\\}]/g;\n\n var localeId;\n var formatCodeToRegex;\n\n this.init = function() {\n localeId = $locale.id;\n\n this.parsers = {};\n this.formatters = {};\n\n formatCodeToRegex = [\n {\n key: 'yyyy',\n regex: '\\\\d{4}',\n apply: function(value) { this.year = +value; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'yyyy');\n }\n },\n {\n key: 'yy',\n regex: '\\\\d{2}',\n apply: function(value) { value = +value; this.year = value < 69 ? value + 2000 : value + 1900; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'yy');\n }\n },\n {\n key: 'y',\n regex: '\\\\d{1,4}',\n apply: function(value) { this.year = +value; },\n formatter: function(date) {\n var _date = new Date();\n _date.setFullYear(Math.abs(date.getFullYear()));\n return dateFilter(_date, 'y');\n }\n },\n {\n key: 'M!',\n regex: '0?[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) {\n var value = date.getMonth();\n if (/^[0-9]$/.test(value)) {\n return dateFilter(date, 'MM');\n }\n\n return dateFilter(date, 'M');\n }\n },\n {\n key: 'MMMM',\n regex: $locale.DATETIME_FORMATS.MONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.MONTH.indexOf(value); },\n formatter: function(date) { return dateFilter(date, 'MMMM'); }\n },\n {\n key: 'MMM',\n regex: $locale.DATETIME_FORMATS.SHORTMONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.SHORTMONTH.indexOf(value); },\n formatter: function(date) { return dateFilter(date, 'MMM'); }\n },\n {\n key: 'MM',\n regex: '0[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) { return dateFilter(date, 'MM'); }\n },\n {\n key: 'M',\n regex: '[1-9]|1[0-2]',\n apply: function(value) { this.month = value - 1; },\n formatter: function(date) { return dateFilter(date, 'M'); }\n },\n {\n key: 'd!',\n regex: '[0-2]?[0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) {\n var value = date.getDate();\n if (/^[1-9]$/.test(value)) {\n return dateFilter(date, 'dd');\n }\n\n return dateFilter(date, 'd');\n }\n },\n {\n key: 'dd',\n regex: '[0-2][0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) { return dateFilter(date, 'dd'); }\n },\n {\n key: 'd',\n regex: '[1-2]?[0-9]{1}|3[0-1]{1}',\n apply: function(value) { this.date = +value; },\n formatter: function(date) { return dateFilter(date, 'd'); }\n },\n {\n key: 'EEEE',\n regex: $locale.DATETIME_FORMATS.DAY.join('|'),\n formatter: function(date) { return dateFilter(date, 'EEEE'); }\n },\n {\n key: 'EEE',\n regex: $locale.DATETIME_FORMATS.SHORTDAY.join('|'),\n formatter: function(date) { return dateFilter(date, 'EEE'); }\n },\n {\n key: 'HH',\n regex: '(?:0|1)[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'HH'); }\n },\n {\n key: 'hh',\n regex: '0[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'hh'); }\n },\n {\n key: 'H',\n regex: '1?[0-9]|2[0-3]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'H'); }\n },\n {\n key: 'h',\n regex: '[0-9]|1[0-2]',\n apply: function(value) { this.hours = +value; },\n formatter: function(date) { return dateFilter(date, 'h'); }\n },\n {\n key: 'mm',\n regex: '[0-5][0-9]',\n apply: function(value) { this.minutes = +value; },\n formatter: function(date) { return dateFilter(date, 'mm'); }\n },\n {\n key: 'm',\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.minutes = +value; },\n formatter: function(date) { return dateFilter(date, 'm'); }\n },\n {\n key: 'sss',\n regex: '[0-9][0-9][0-9]',\n apply: function(value) { this.milliseconds = +value; },\n formatter: function(date) { return dateFilter(date, 'sss'); }\n },\n {\n key: 'ss',\n regex: '[0-5][0-9]',\n apply: function(value) { this.seconds = +value; },\n formatter: function(date) { return dateFilter(date, 'ss'); }\n },\n {\n key: 's',\n regex: '[0-9]|[1-5][0-9]',\n apply: function(value) { this.seconds = +value; },\n formatter: function(date) { return dateFilter(date, 's'); }\n },\n {\n key: 'a',\n regex: $locale.DATETIME_FORMATS.AMPMS.join('|'),\n apply: function(value) {\n if (this.hours === 12) {\n this.hours = 0;\n }\n\n if (value === 'PM') {\n this.hours += 12;\n }\n },\n formatter: function(date) { return dateFilter(date, 'a'); }\n },\n {\n key: 'Z',\n regex: '[+-]\\\\d{4}',\n apply: function(value) {\n var matches = value.match(/([+-])(\\d{2})(\\d{2})/),\n sign = matches[1],\n hours = matches[2],\n minutes = matches[3];\n this.hours += toInt(sign + hours);\n this.minutes += toInt(sign + minutes);\n },\n formatter: function(date) {\n return dateFilter(date, 'Z');\n }\n },\n {\n key: 'ww',\n regex: '[0-4][0-9]|5[0-3]',\n formatter: function(date) { return dateFilter(date, 'ww'); }\n },\n {\n key: 'w',\n regex: '[0-9]|[1-4][0-9]|5[0-3]',\n formatter: function(date) { return dateFilter(date, 'w'); }\n },\n {\n key: 'GGGG',\n regex: $locale.DATETIME_FORMATS.ERANAMES.join('|').replace(/\\s/g, '\\\\s'),\n formatter: function(date) { return dateFilter(date, 'GGGG'); }\n },\n {\n key: 'GGG',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'GGG'); }\n },\n {\n key: 'GG',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'GG'); }\n },\n {\n key: 'G',\n regex: $locale.DATETIME_FORMATS.ERAS.join('|'),\n formatter: function(date) { return dateFilter(date, 'G'); }\n }\n ];\n\n if (angular.version.major >= 1 && angular.version.minor > 4) {\n formatCodeToRegex.push({\n key: 'LLLL',\n regex: $locale.DATETIME_FORMATS.STANDALONEMONTH.join('|'),\n apply: function(value) { this.month = $locale.DATETIME_FORMATS.STANDALONEMONTH.indexOf(value); },\n formatter: function(date) { return dateFilter(date, 'LLLL'); }\n });\n }\n };\n\n this.init();\n\n function getFormatCodeToRegex(key) {\n return filterFilter(formatCodeToRegex, {key: key}, true)[0];\n }\n\n this.getParser = function (key) {\n var f = getFormatCodeToRegex(key);\n return f && f.apply || null;\n };\n\n this.overrideParser = function (key, parser) {\n var f = getFormatCodeToRegex(key);\n if (f && angular.isFunction(parser)) {\n this.parsers = {};\n f.apply = parser;\n }\n }.bind(this);\n\n function createParser(format) {\n var map = [], regex = format.split('');\n\n // check for literal values\n var quoteIndex = format.indexOf('\\'');\n if (quoteIndex > -1) {\n var inLiteral = false;\n format = format.split('');\n for (var i = quoteIndex; i < format.length; i++) {\n if (inLiteral) {\n if (format[i] === '\\'') {\n if (i + 1 < format.length && format[i+1] === '\\'') { // escaped single quote\n format[i+1] = '$';\n regex[i+1] = '';\n } else { // end of literal\n regex[i] = '';\n inLiteral = false;\n }\n }\n format[i] = '$';\n } else {\n if (format[i] === '\\'') { // start of literal\n format[i] = '$';\n regex[i] = '';\n inLiteral = true;\n }\n }\n }\n\n format = format.join('');\n }\n\n angular.forEach(formatCodeToRegex, function(data) {\n var index = format.indexOf(data.key);\n\n if (index > -1) {\n format = format.split('');\n\n regex[index] = '(' + data.regex + ')';\n format[index] = '$'; // Custom symbol to define consumed part of format\n for (var i = index + 1, n = index + data.key.length; i < n; i++) {\n regex[i] = '';\n format[i] = '$';\n }\n format = format.join('');\n\n map.push({\n index: index,\n key: data.key,\n apply: data.apply,\n matcher: data.regex\n });\n }\n });\n\n return {\n regex: new RegExp('^' + regex.join('') + '$'),\n map: orderByFilter(map, 'index')\n };\n }\n\n function createFormatter(format) {\n var formatters = [];\n var i = 0;\n var formatter, literalIdx;\n while (i < format.length) {\n if (angular.isNumber(literalIdx)) {\n if (format.charAt(i) === '\\'') {\n if (i + 1 >= format.length || format.charAt(i + 1) !== '\\'') {\n formatters.push(constructLiteralFormatter(format, literalIdx, i));\n literalIdx = null;\n }\n } else if (i === format.length) {\n while (literalIdx < format.length) {\n formatter = constructFormatterFromIdx(format, literalIdx);\n formatters.push(formatter);\n literalIdx = formatter.endIdx;\n }\n }\n\n i++;\n continue;\n }\n\n if (format.charAt(i) === '\\'') {\n literalIdx = i;\n i++;\n continue;\n }\n\n formatter = constructFormatterFromIdx(format, i);\n\n formatters.push(formatter.parser);\n i = formatter.endIdx;\n }\n\n return formatters;\n }\n\n function constructLiteralFormatter(format, literalIdx, endIdx) {\n return function() {\n return format.substr(literalIdx + 1, endIdx - literalIdx - 1);\n };\n }\n\n function constructFormatterFromIdx(format, i) {\n var currentPosStr = format.substr(i);\n for (var j = 0; j < formatCodeToRegex.length; j++) {\n if (new RegExp('^' + formatCodeToRegex[j].key).test(currentPosStr)) {\n var data = formatCodeToRegex[j];\n return {\n endIdx: i + data.key.length,\n parser: data.formatter\n };\n }\n }\n\n return {\n endIdx: i + 1,\n parser: function() {\n return currentPosStr.charAt(0);\n }\n };\n }\n\n this.filter = function(date, format) {\n if (!angular.isDate(date) || isNaN(date) || !format) {\n return '';\n }\n\n format = $locale.DATETIME_FORMATS[format] || format;\n\n if ($locale.id !== localeId) {\n this.init();\n }\n\n if (!this.formatters[format]) {\n this.formatters[format] = createFormatter(format);\n }\n\n var formatters = this.formatters[format];\n\n return formatters.reduce(function(str, formatter) {\n return str + formatter(date);\n }, '');\n };\n\n this.parse = function(input, format, baseDate) {\n if (!angular.isString(input) || !format) {\n return input;\n }\n\n format = $locale.DATETIME_FORMATS[format] || format;\n format = format.replace(SPECIAL_CHARACTERS_REGEXP, '\\\\$&');\n\n if ($locale.id !== localeId) {\n this.init();\n }\n\n if (!this.parsers[format]) {\n this.parsers[format] = createParser(format, 'apply');\n }\n\n var parser = this.parsers[format],\n regex = parser.regex,\n map = parser.map,\n results = input.match(regex),\n tzOffset = false;\n if (results && results.length) {\n var fields, dt;\n if (angular.isDate(baseDate) && !isNaN(baseDate.getTime())) {\n fields = {\n year: baseDate.getFullYear(),\n month: baseDate.getMonth(),\n date: baseDate.getDate(),\n hours: baseDate.getHours(),\n minutes: baseDate.getMinutes(),\n seconds: baseDate.getSeconds(),\n milliseconds: baseDate.getMilliseconds()\n };\n } else {\n if (baseDate) {\n $log.warn('dateparser:', 'baseDate is not a valid date');\n }\n fields = { year: 1900, month: 0, date: 1, hours: 0, minutes: 0, seconds: 0, milliseconds: 0 };\n }\n\n for (var i = 1, n = results.length; i < n; i++) {\n var mapper = map[i - 1];\n if (mapper.matcher === 'Z') {\n tzOffset = true;\n }\n\n if (mapper.apply) {\n mapper.apply.call(fields, results[i]);\n }\n }\n\n var datesetter = tzOffset ? Date.prototype.setUTCFullYear :\n Date.prototype.setFullYear;\n var timesetter = tzOffset ? Date.prototype.setUTCHours :\n Date.prototype.setHours;\n\n if (isValid(fields.year, fields.month, fields.date)) {\n if (angular.isDate(baseDate) && !isNaN(baseDate.getTime()) && !tzOffset) {\n dt = new Date(baseDate);\n datesetter.call(dt, fields.year, fields.month, fields.date);\n timesetter.call(dt, fields.hours, fields.minutes,\n fields.seconds, fields.milliseconds);\n } else {\n dt = new Date(0);\n datesetter.call(dt, fields.year, fields.month, fields.date);\n timesetter.call(dt, fields.hours || 0, fields.minutes || 0,\n fields.seconds || 0, fields.milliseconds || 0);\n }\n }\n\n return dt;\n }\n };\n\n // Check if date is valid for specific month (and year for February).\n // Month: 0 = Jan, 1 = Feb, etc\n function isValid(year, month, date) {\n if (date < 1) {\n return false;\n }\n\n if (month === 1 && date > 28) {\n return date === 29 && (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0);\n }\n\n if (month === 3 || month === 5 || month === 8 || month === 10) {\n return date < 31;\n }\n\n return true;\n }\n\n function toInt(str) {\n return parseInt(str, 10);\n }\n\n this.toTimezone = toTimezone;\n this.fromTimezone = fromTimezone;\n this.timezoneToOffset = timezoneToOffset;\n this.addDateMinutes = addDateMinutes;\n this.convertTimezoneToLocal = convertTimezoneToLocal;\n\n function toTimezone(date, timezone) {\n return date && timezone ? convertTimezoneToLocal(date, timezone) : date;\n }\n\n function fromTimezone(date, timezone) {\n return date && timezone ? convertTimezoneToLocal(date, timezone, true) : date;\n }\n\n //https://github.com/angular/angular.js/blob/622c42169699ec07fc6daaa19fe6d224e5d2f70e/src/Angular.js#L1207\n function timezoneToOffset(timezone, fallback) {\n timezone = timezone.replace(/:/g, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n }\n\n function addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n }\n\n function convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n }\n}]);\n\n// Avoiding use of ng-class as it creates a lot of watchers when a class is to be applied to\n// at most one element.\nangular.module('ui.bootstrap.isClass', [])\n.directive('uibIsClass', [\n '$animate',\nfunction ($animate) {\n // 11111111 22222222\n var ON_REGEXP = /^\\s*([\\s\\S]+?)\\s+on\\s+([\\s\\S]+?)\\s*$/;\n // 11111111 22222222\n var IS_REGEXP = /^\\s*([\\s\\S]+?)\\s+for\\s+([\\s\\S]+?)\\s*$/;\n\n var dataPerTracked = {};\n\n return {\n restrict: 'A',\n compile: function(tElement, tAttrs) {\n var linkedScopes = [];\n var instances = [];\n var expToData = {};\n var lastActivated = null;\n var onExpMatches = tAttrs.uibIsClass.match(ON_REGEXP);\n var onExp = onExpMatches[2];\n var expsStr = onExpMatches[1];\n var exps = expsStr.split(',');\n\n return linkFn;\n\n function linkFn(scope, element, attrs) {\n linkedScopes.push(scope);\n instances.push({\n scope: scope,\n element: element\n });\n\n exps.forEach(function(exp, k) {\n addForExp(exp, scope);\n });\n\n scope.$on('$destroy', removeScope);\n }\n\n function addForExp(exp, scope) {\n var matches = exp.match(IS_REGEXP);\n var clazz = scope.$eval(matches[1]);\n var compareWithExp = matches[2];\n var data = expToData[exp];\n if (!data) {\n var watchFn = function(compareWithVal) {\n var newActivated = null;\n instances.some(function(instance) {\n var thisVal = instance.scope.$eval(onExp);\n if (thisVal === compareWithVal) {\n newActivated = instance;\n return true;\n }\n });\n if (data.lastActivated !== newActivated) {\n if (data.lastActivated) {\n $animate.removeClass(data.lastActivated.element, clazz);\n }\n if (newActivated) {\n $animate.addClass(newActivated.element, clazz);\n }\n data.lastActivated = newActivated;\n }\n };\n expToData[exp] = data = {\n lastActivated: null,\n scope: scope,\n watchFn: watchFn,\n compareWithExp: compareWithExp,\n watcher: scope.$watch(compareWithExp, watchFn)\n };\n }\n data.watchFn(scope.$eval(compareWithExp));\n }\n\n function removeScope(e) {\n var removedScope = e.targetScope;\n var index = linkedScopes.indexOf(removedScope);\n linkedScopes.splice(index, 1);\n instances.splice(index, 1);\n if (linkedScopes.length) {\n var newWatchScope = linkedScopes[0];\n angular.forEach(expToData, function(data) {\n if (data.scope === removedScope) {\n data.watcher = newWatchScope.$watch(data.compareWithExp, data.watchFn);\n data.scope = newWatchScope;\n }\n });\n } else {\n expToData = {};\n }\n }\n }\n };\n}]);\nangular.module('ui.bootstrap.datepicker', ['ui.bootstrap.dateparser', 'ui.bootstrap.isClass'])\n\n.value('$datepickerSuppressError', false)\n\n.value('$datepickerLiteralWarning', true)\n\n.constant('uibDatepickerConfig', {\n datepickerMode: 'day',\n formatDay: 'dd',\n formatMonth: 'MMMM',\n formatYear: 'yyyy',\n formatDayHeader: 'EEE',\n formatDayTitle: 'MMMM yyyy',\n formatMonthTitle: 'yyyy',\n maxDate: null,\n maxMode: 'year',\n minDate: null,\n minMode: 'day',\n monthColumns: 3,\n ngModelOptions: {},\n shortcutPropagation: false,\n showWeeks: true,\n yearColumns: 5,\n yearRows: 4\n})\n\n.controller('UibDatepickerController', ['$scope', '$element', '$attrs', '$parse', '$interpolate', '$locale', '$log', 'dateFilter', 'uibDatepickerConfig', '$datepickerLiteralWarning', '$datepickerSuppressError', 'uibDateParser',\n function($scope, $element, $attrs, $parse, $interpolate, $locale, $log, dateFilter, datepickerConfig, $datepickerLiteralWarning, $datepickerSuppressError, dateParser) {\n var self = this,\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl;\n ngModelOptions = {},\n watchListeners = [];\n\n $element.addClass('uib-datepicker');\n $attrs.$set('role', 'application');\n\n if (!$scope.datepickerOptions) {\n $scope.datepickerOptions = {};\n }\n\n // Modes chain\n this.modes = ['day', 'month', 'year'];\n\n [\n 'customClass',\n 'dateDisabled',\n 'datepickerMode',\n 'formatDay',\n 'formatDayHeader',\n 'formatDayTitle',\n 'formatMonth',\n 'formatMonthTitle',\n 'formatYear',\n 'maxDate',\n 'maxMode',\n 'minDate',\n 'minMode',\n 'monthColumns',\n 'showWeeks',\n 'shortcutPropagation',\n 'startingDay',\n 'yearColumns',\n 'yearRows'\n ].forEach(function(key) {\n switch (key) {\n case 'customClass':\n case 'dateDisabled':\n $scope[key] = $scope.datepickerOptions[key] || angular.noop;\n break;\n case 'datepickerMode':\n $scope.datepickerMode = angular.isDefined($scope.datepickerOptions.datepickerMode) ?\n $scope.datepickerOptions.datepickerMode : datepickerConfig.datepickerMode;\n break;\n case 'formatDay':\n case 'formatDayHeader':\n case 'formatDayTitle':\n case 'formatMonth':\n case 'formatMonthTitle':\n case 'formatYear':\n self[key] = angular.isDefined($scope.datepickerOptions[key]) ?\n $interpolate($scope.datepickerOptions[key])($scope.$parent) :\n datepickerConfig[key];\n break;\n case 'monthColumns':\n case 'showWeeks':\n case 'shortcutPropagation':\n case 'yearColumns':\n case 'yearRows':\n self[key] = angular.isDefined($scope.datepickerOptions[key]) ?\n $scope.datepickerOptions[key] : datepickerConfig[key];\n break;\n case 'startingDay':\n if (angular.isDefined($scope.datepickerOptions.startingDay)) {\n self.startingDay = $scope.datepickerOptions.startingDay;\n } else if (angular.isNumber(datepickerConfig.startingDay)) {\n self.startingDay = datepickerConfig.startingDay;\n } else {\n self.startingDay = ($locale.DATETIME_FORMATS.FIRSTDAYOFWEEK + 8) % 7;\n }\n\n break;\n case 'maxDate':\n case 'minDate':\n $scope.$watch('datepickerOptions.' + key, function(value) {\n if (value) {\n if (angular.isDate(value)) {\n self[key] = dateParser.fromTimezone(new Date(value), ngModelOptions.getOption('timezone'));\n } else {\n if ($datepickerLiteralWarning) {\n $log.warn('Literal date support has been deprecated, please switch to date object usage');\n }\n\n self[key] = new Date(dateFilter(value, 'medium'));\n }\n } else {\n self[key] = datepickerConfig[key] ?\n dateParser.fromTimezone(new Date(datepickerConfig[key]), ngModelOptions.getOption('timezone')) :\n null;\n }\n\n self.refreshView();\n });\n\n break;\n case 'maxMode':\n case 'minMode':\n if ($scope.datepickerOptions[key]) {\n $scope.$watch(function() { return $scope.datepickerOptions[key]; }, function(value) {\n self[key] = $scope[key] = angular.isDefined(value) ? value : $scope.datepickerOptions[key];\n if (key === 'minMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) < self.modes.indexOf(self[key]) ||\n key === 'maxMode' && self.modes.indexOf($scope.datepickerOptions.datepickerMode) > self.modes.indexOf(self[key])) {\n $scope.datepickerMode = self[key];\n $scope.datepickerOptions.datepickerMode = self[key];\n }\n });\n } else {\n self[key] = $scope[key] = datepickerConfig[key] || null;\n }\n\n break;\n }\n });\n\n $scope.uniqueId = 'datepicker-' + $scope.$id + '-' + Math.floor(Math.random() * 10000);\n\n $scope.disabled = angular.isDefined($attrs.disabled) || false;\n if (angular.isDefined($attrs.ngDisabled)) {\n watchListeners.push($scope.$parent.$watch($attrs.ngDisabled, function(disabled) {\n $scope.disabled = disabled;\n self.refreshView();\n }));\n }\n\n $scope.isActive = function(dateObject) {\n if (self.compare(dateObject.date, self.activeDate) === 0) {\n $scope.activeDateId = dateObject.uid;\n return true;\n }\n return false;\n };\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n ngModelOptions = extractOptions(ngModelCtrl);\n\n if ($scope.datepickerOptions.initDate) {\n self.activeDate = dateParser.fromTimezone($scope.datepickerOptions.initDate, ngModelOptions.getOption('timezone')) || new Date();\n $scope.$watch('datepickerOptions.initDate', function(initDate) {\n if (initDate && (ngModelCtrl.$isEmpty(ngModelCtrl.$modelValue) || ngModelCtrl.$invalid)) {\n self.activeDate = dateParser.fromTimezone(initDate, ngModelOptions.getOption('timezone'));\n self.refreshView();\n }\n });\n } else {\n self.activeDate = new Date();\n }\n\n var date = ngModelCtrl.$modelValue ? new Date(ngModelCtrl.$modelValue) : new Date();\n this.activeDate = !isNaN(date) ?\n dateParser.fromTimezone(date, ngModelOptions.getOption('timezone')) :\n dateParser.fromTimezone(new Date(), ngModelOptions.getOption('timezone'));\n\n ngModelCtrl.$render = function() {\n self.render();\n };\n };\n\n this.render = function() {\n if (ngModelCtrl.$viewValue) {\n var date = new Date(ngModelCtrl.$viewValue),\n isValid = !isNaN(date);\n\n if (isValid) {\n this.activeDate = dateParser.fromTimezone(date, ngModelOptions.getOption('timezone'));\n } else if (!$datepickerSuppressError) {\n $log.error('Datepicker directive: \"ng-model\" value must be a Date object');\n }\n }\n this.refreshView();\n };\n\n this.refreshView = function() {\n if (this.element) {\n $scope.selectedDt = null;\n this._refreshView();\n if ($scope.activeDt) {\n $scope.activeDateId = $scope.activeDt.uid;\n }\n\n var date = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n date = dateParser.fromTimezone(date, ngModelOptions.getOption('timezone'));\n ngModelCtrl.$setValidity('dateDisabled', !date ||\n this.element && !this.isDisabled(date));\n }\n };\n\n this.createDateObject = function(date, format) {\n var model = ngModelCtrl.$viewValue ? new Date(ngModelCtrl.$viewValue) : null;\n model = dateParser.fromTimezone(model, ngModelOptions.getOption('timezone'));\n var today = new Date();\n today = dateParser.fromTimezone(today, ngModelOptions.getOption('timezone'));\n var time = this.compare(date, today);\n var dt = {\n date: date,\n label: dateParser.filter(date, format),\n selected: model && this.compare(date, model) === 0,\n disabled: this.isDisabled(date),\n past: time < 0,\n current: time === 0,\n future: time > 0,\n customClass: this.customClass(date) || null\n };\n\n if (model && this.compare(date, model) === 0) {\n $scope.selectedDt = dt;\n }\n\n if (self.activeDate && this.compare(dt.date, self.activeDate) === 0) {\n $scope.activeDt = dt;\n }\n\n return dt;\n };\n\n this.isDisabled = function(date) {\n return $scope.disabled ||\n this.minDate && this.compare(date, this.minDate) < 0 ||\n this.maxDate && this.compare(date, this.maxDate) > 0 ||\n $scope.dateDisabled && $scope.dateDisabled({date: date, mode: $scope.datepickerMode});\n };\n\n this.customClass = function(date) {\n return $scope.customClass({date: date, mode: $scope.datepickerMode});\n };\n\n // Split array into smaller arrays\n this.split = function(arr, size) {\n var arrays = [];\n while (arr.length > 0) {\n arrays.push(arr.splice(0, size));\n }\n return arrays;\n };\n\n $scope.select = function(date) {\n if ($scope.datepickerMode === self.minMode) {\n var dt = ngModelCtrl.$viewValue ? dateParser.fromTimezone(new Date(ngModelCtrl.$viewValue), ngModelOptions.getOption('timezone')) : new Date(0, 0, 0, 0, 0, 0, 0);\n dt.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n dt = dateParser.toTimezone(dt, ngModelOptions.getOption('timezone'));\n ngModelCtrl.$setViewValue(dt);\n ngModelCtrl.$render();\n } else {\n self.activeDate = date;\n setMode(self.modes[self.modes.indexOf($scope.datepickerMode) - 1]);\n\n $scope.$emit('uib:datepicker.mode');\n }\n\n $scope.$broadcast('uib:datepicker.focus');\n };\n\n $scope.move = function(direction) {\n var year = self.activeDate.getFullYear() + direction * (self.step.years || 0),\n month = self.activeDate.getMonth() + direction * (self.step.months || 0);\n self.activeDate.setFullYear(year, month, 1);\n self.refreshView();\n };\n\n $scope.toggleMode = function(direction) {\n direction = direction || 1;\n\n if ($scope.datepickerMode === self.maxMode && direction === 1 ||\n $scope.datepickerMode === self.minMode && direction === -1) {\n return;\n }\n\n setMode(self.modes[self.modes.indexOf($scope.datepickerMode) + direction]);\n\n $scope.$emit('uib:datepicker.mode');\n };\n\n // Key event mapper\n $scope.keys = { 13: 'enter', 32: 'space', 33: 'pageup', 34: 'pagedown', 35: 'end', 36: 'home', 37: 'left', 38: 'up', 39: 'right', 40: 'down' };\n\n var focusElement = function() {\n self.element[0].focus();\n };\n\n // Listen for focus requests from popup directive\n $scope.$on('uib:datepicker.focus', focusElement);\n\n $scope.keydown = function(evt) {\n var key = $scope.keys[evt.which];\n\n if (!key || evt.shiftKey || evt.altKey || $scope.disabled) {\n return;\n }\n\n evt.preventDefault();\n if (!self.shortcutPropagation) {\n evt.stopPropagation();\n }\n\n if (key === 'enter' || key === 'space') {\n if (self.isDisabled(self.activeDate)) {\n return; // do nothing\n }\n $scope.select(self.activeDate);\n } else if (evt.ctrlKey && (key === 'up' || key === 'down')) {\n $scope.toggleMode(key === 'up' ? 1 : -1);\n } else {\n self.handleKeyDown(key, evt);\n self.refreshView();\n }\n };\n\n $element.on('keydown', function(evt) {\n $scope.$apply(function() {\n $scope.keydown(evt);\n });\n });\n\n $scope.$on('$destroy', function() {\n //Clear all watch listeners on destroy\n while (watchListeners.length) {\n watchListeners.shift()();\n }\n });\n\n function setMode(mode) {\n $scope.datepickerMode = mode;\n $scope.datepickerOptions.datepickerMode = mode;\n }\n\n function extractOptions(ngModelCtrl) {\n var ngModelOptions;\n\n if (angular.version.minor < 6) { // in angular < 1.6 $options could be missing\n // guarantee a value\n ngModelOptions = ngModelCtrl.$options ||\n $scope.datepickerOptions.ngModelOptions ||\n datepickerConfig.ngModelOptions ||\n {};\n\n // mimic 1.6+ api\n ngModelOptions.getOption = function (key) {\n return ngModelOptions[key];\n };\n } else { // in angular >=1.6 $options is always present\n // ng-model-options defaults timezone to null; don't let its precedence squash a non-null value\n var timezone = ngModelCtrl.$options.getOption('timezone') ||\n ($scope.datepickerOptions.ngModelOptions ? $scope.datepickerOptions.ngModelOptions.timezone : null) ||\n (datepickerConfig.ngModelOptions ? datepickerConfig.ngModelOptions.timezone : null);\n\n // values passed to createChild override existing values\n ngModelOptions = ngModelCtrl.$options // start with a ModelOptions instance\n .createChild(datepickerConfig.ngModelOptions) // lowest precedence\n .createChild($scope.datepickerOptions.ngModelOptions)\n .createChild(ngModelCtrl.$options) // highest precedence\n .createChild({timezone: timezone}); // to keep from squashing a non-null value\n }\n\n return ngModelOptions;\n }\n}])\n\n.controller('UibDaypickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\n this.step = { months: 1 };\n this.element = $element;\n function getDaysInMonth(year, month) {\n return month === 1 && year % 4 === 0 &&\n (year % 100 !== 0 || year % 400 === 0) ? 29 : DAYS_IN_MONTH[month];\n }\n\n this.init = function(ctrl) {\n angular.extend(ctrl, this);\n scope.showWeeks = ctrl.showWeeks;\n ctrl.refreshView();\n };\n\n this.getDates = function(startDate, n) {\n var dates = new Array(n), current = new Date(startDate), i = 0, date;\n while (i < n) {\n date = new Date(current);\n dates[i++] = date;\n current.setDate(current.getDate() + 1);\n }\n return dates;\n };\n\n this._refreshView = function() {\n var year = this.activeDate.getFullYear(),\n month = this.activeDate.getMonth(),\n firstDayOfMonth = new Date(this.activeDate);\n\n firstDayOfMonth.setFullYear(year, month, 1);\n\n var difference = this.startingDay - firstDayOfMonth.getDay(),\n numDisplayedFromPreviousMonth = difference > 0 ?\n 7 - difference : - difference,\n firstDate = new Date(firstDayOfMonth);\n\n if (numDisplayedFromPreviousMonth > 0) {\n firstDate.setDate(-numDisplayedFromPreviousMonth + 1);\n }\n\n // 42 is the number of days on a six-week calendar\n var days = this.getDates(firstDate, 42);\n for (var i = 0; i < 42; i ++) {\n days[i] = angular.extend(this.createDateObject(days[i], this.formatDay), {\n secondary: days[i].getMonth() !== month,\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.labels = new Array(7);\n for (var j = 0; j < 7; j++) {\n scope.labels[j] = {\n abbr: dateFilter(days[j].date, this.formatDayHeader),\n full: dateFilter(days[j].date, 'EEEE')\n };\n }\n\n scope.title = dateFilter(this.activeDate, this.formatDayTitle);\n scope.rows = this.split(days, 7);\n\n if (scope.showWeeks) {\n scope.weekNumbers = [];\n var thursdayIndex = (4 + 7 - this.startingDay) % 7,\n numWeeks = scope.rows.length;\n for (var curWeek = 0; curWeek < numWeeks; curWeek++) {\n scope.weekNumbers.push(\n getISO8601WeekNumber(scope.rows[curWeek][thursdayIndex].date));\n }\n }\n };\n\n this.compare = function(date1, date2) {\n var _date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate());\n var _date2 = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());\n _date1.setFullYear(date1.getFullYear());\n _date2.setFullYear(date2.getFullYear());\n return _date1 - _date2;\n };\n\n function getISO8601WeekNumber(date) {\n var checkDate = new Date(date);\n checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); // Thursday\n var time = checkDate.getTime();\n checkDate.setMonth(0); // Compare with Jan 1\n checkDate.setDate(1);\n return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;\n }\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getDate();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - 7;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + 7;\n } else if (key === 'pageup' || key === 'pagedown') {\n var month = this.activeDate.getMonth() + (key === 'pageup' ? - 1 : 1);\n this.activeDate.setMonth(month, 1);\n date = Math.min(getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth()), date);\n } else if (key === 'home') {\n date = 1;\n } else if (key === 'end') {\n date = getDaysInMonth(this.activeDate.getFullYear(), this.activeDate.getMonth());\n }\n this.activeDate.setDate(date);\n };\n}])\n\n.controller('UibMonthpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n this.step = { years: 1 };\n this.element = $element;\n\n this.init = function(ctrl) {\n angular.extend(ctrl, this);\n ctrl.refreshView();\n };\n\n this._refreshView = function() {\n var months = new Array(12),\n year = this.activeDate.getFullYear(),\n date;\n\n for (var i = 0; i < 12; i++) {\n date = new Date(this.activeDate);\n date.setFullYear(year, i, 1);\n months[i] = angular.extend(this.createDateObject(date, this.formatMonth), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = dateFilter(this.activeDate, this.formatMonthTitle);\n scope.rows = this.split(months, this.monthColumns);\n scope.yearHeaderColspan = this.monthColumns > 3 ? this.monthColumns - 2 : 1;\n };\n\n this.compare = function(date1, date2) {\n var _date1 = new Date(date1.getFullYear(), date1.getMonth());\n var _date2 = new Date(date2.getFullYear(), date2.getMonth());\n _date1.setFullYear(date1.getFullYear());\n _date2.setFullYear(date2.getFullYear());\n return _date1 - _date2;\n };\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getMonth();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - this.monthColumns;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + this.monthColumns;\n } else if (key === 'pageup' || key === 'pagedown') {\n var year = this.activeDate.getFullYear() + (key === 'pageup' ? - 1 : 1);\n this.activeDate.setFullYear(year);\n } else if (key === 'home') {\n date = 0;\n } else if (key === 'end') {\n date = 11;\n }\n this.activeDate.setMonth(date);\n };\n}])\n\n.controller('UibYearpickerController', ['$scope', '$element', 'dateFilter', function(scope, $element, dateFilter) {\n var columns, range;\n this.element = $element;\n\n function getStartingYear(year) {\n return parseInt((year - 1) / range, 10) * range + 1;\n }\n\n this.yearpickerInit = function() {\n columns = this.yearColumns;\n range = this.yearRows * columns;\n this.step = { years: range };\n };\n\n this._refreshView = function() {\n var years = new Array(range), date;\n\n for (var i = 0, start = getStartingYear(this.activeDate.getFullYear()); i < range; i++) {\n date = new Date(this.activeDate);\n date.setFullYear(start + i, 0, 1);\n years[i] = angular.extend(this.createDateObject(date, this.formatYear), {\n uid: scope.uniqueId + '-' + i\n });\n }\n\n scope.title = [years[0].label, years[range - 1].label].join(' - ');\n scope.rows = this.split(years, columns);\n scope.columns = columns;\n };\n\n this.compare = function(date1, date2) {\n return date1.getFullYear() - date2.getFullYear();\n };\n\n this.handleKeyDown = function(key, evt) {\n var date = this.activeDate.getFullYear();\n\n if (key === 'left') {\n date = date - 1;\n } else if (key === 'up') {\n date = date - columns;\n } else if (key === 'right') {\n date = date + 1;\n } else if (key === 'down') {\n date = date + columns;\n } else if (key === 'pageup' || key === 'pagedown') {\n date += (key === 'pageup' ? - 1 : 1) * range;\n } else if (key === 'home') {\n date = getStartingYear(this.activeDate.getFullYear());\n } else if (key === 'end') {\n date = getStartingYear(this.activeDate.getFullYear()) + range - 1;\n }\n this.activeDate.setFullYear(date);\n };\n}])\n\n.directive('uibDatepicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/datepicker.html';\n },\n scope: {\n datepickerOptions: '=?'\n },\n require: ['uibDatepicker', '^ngModel'],\n restrict: 'A',\n controller: 'UibDatepickerController',\n controllerAs: 'datepicker',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n datepickerCtrl.init(ngModelCtrl);\n }\n };\n})\n\n.directive('uibDaypicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/day.html';\n },\n require: ['^uibDatepicker', 'uibDaypicker'],\n restrict: 'A',\n controller: 'UibDaypickerController',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0],\n daypickerCtrl = ctrls[1];\n\n daypickerCtrl.init(datepickerCtrl);\n }\n };\n})\n\n.directive('uibMonthpicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/month.html';\n },\n require: ['^uibDatepicker', 'uibMonthpicker'],\n restrict: 'A',\n controller: 'UibMonthpickerController',\n link: function(scope, element, attrs, ctrls) {\n var datepickerCtrl = ctrls[0],\n monthpickerCtrl = ctrls[1];\n\n monthpickerCtrl.init(datepickerCtrl);\n }\n };\n})\n\n.directive('uibYearpicker', function() {\n return {\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepicker/year.html';\n },\n require: ['^uibDatepicker', 'uibYearpicker'],\n restrict: 'A',\n controller: 'UibYearpickerController',\n link: function(scope, element, attrs, ctrls) {\n var ctrl = ctrls[0];\n angular.extend(ctrl, ctrls[1]);\n ctrl.yearpickerInit();\n\n ctrl.refreshView();\n }\n };\n});\n\nangular.module('ui.bootstrap.position', [])\n\n/**\n * A set of utility methods for working with the DOM.\n * It is meant to be used where we need to absolute-position elements in\n * relation to another element (this is the case for tooltips, popovers,\n * typeahead suggestions etc.).\n */\n .factory('$uibPosition', ['$document', '$window', function($document, $window) {\n /**\n * Used by scrollbarWidth() function to cache scrollbar's width.\n * Do not access this variable directly, use scrollbarWidth() instead.\n */\n var SCROLLBAR_WIDTH;\n /**\n * scrollbar on body and html element in IE and Edge overlay\n * content and should be considered 0 width.\n */\n var BODY_SCROLLBAR_WIDTH;\n var OVERFLOW_REGEX = {\n normal: /(auto|scroll)/,\n hidden: /(auto|scroll|hidden)/\n };\n var PLACEMENT_REGEX = {\n auto: /\\s?auto?\\s?/i,\n primary: /^(top|bottom|left|right)$/,\n secondary: /^(top|bottom|left|right|center)$/,\n vertical: /^(top|bottom)$/\n };\n var BODY_REGEX = /(HTML|BODY)/;\n\n return {\n\n /**\n * Provides a raw DOM element from a jQuery/jQLite element.\n *\n * @param {element} elem - The element to convert.\n *\n * @returns {element} A HTML element.\n */\n getRawNode: function(elem) {\n return elem.nodeName ? elem : elem[0] || elem;\n },\n\n /**\n * Provides a parsed number for a style property. Strips\n * units and casts invalid numbers to 0.\n *\n * @param {string} value - The style value to parse.\n *\n * @returns {number} A valid number.\n */\n parseStyle: function(value) {\n value = parseFloat(value);\n return isFinite(value) ? value : 0;\n },\n\n /**\n * Provides the closest positioned ancestor.\n *\n * @param {element} element - The element to get the offest parent for.\n *\n * @returns {element} The closest positioned ancestor.\n */\n offsetParent: function(elem) {\n elem = this.getRawNode(elem);\n\n var offsetParent = elem.offsetParent || $document[0].documentElement;\n\n function isStaticPositioned(el) {\n return ($window.getComputedStyle(el).position || 'static') === 'static';\n }\n\n while (offsetParent && offsetParent !== $document[0].documentElement && isStaticPositioned(offsetParent)) {\n offsetParent = offsetParent.offsetParent;\n }\n\n return offsetParent || $document[0].documentElement;\n },\n\n /**\n * Provides the scrollbar width, concept from TWBS measureScrollbar()\n * function in https://github.com/twbs/bootstrap/blob/master/js/modal.js\n * In IE and Edge, scollbar on body and html element overlay and should\n * return a width of 0.\n *\n * @returns {number} The width of the browser scollbar.\n */\n scrollbarWidth: function(isBody) {\n if (isBody) {\n if (angular.isUndefined(BODY_SCROLLBAR_WIDTH)) {\n var bodyElem = $document.find('body');\n bodyElem.addClass('uib-position-body-scrollbar-measure');\n BODY_SCROLLBAR_WIDTH = $window.innerWidth - bodyElem[0].clientWidth;\n BODY_SCROLLBAR_WIDTH = isFinite(BODY_SCROLLBAR_WIDTH) ? BODY_SCROLLBAR_WIDTH : 0;\n bodyElem.removeClass('uib-position-body-scrollbar-measure');\n }\n return BODY_SCROLLBAR_WIDTH;\n }\n\n if (angular.isUndefined(SCROLLBAR_WIDTH)) {\n var scrollElem = angular.element('
');\n $document.find('body').append(scrollElem);\n SCROLLBAR_WIDTH = scrollElem[0].offsetWidth - scrollElem[0].clientWidth;\n SCROLLBAR_WIDTH = isFinite(SCROLLBAR_WIDTH) ? SCROLLBAR_WIDTH : 0;\n scrollElem.remove();\n }\n\n return SCROLLBAR_WIDTH;\n },\n\n /**\n * Provides the padding required on an element to replace the scrollbar.\n *\n * @returns {object} An object with the following properties:\n *
    \n *
  • **scrollbarWidth**: the width of the scrollbar
  • \n *
  • **widthOverflow**: whether the the width is overflowing
  • \n *
  • **right**: the amount of right padding on the element needed to replace the scrollbar
  • \n *
  • **rightOriginal**: the amount of right padding currently on the element
  • \n *
  • **heightOverflow**: whether the the height is overflowing
  • \n *
  • **bottom**: the amount of bottom padding on the element needed to replace the scrollbar
  • \n *
  • **bottomOriginal**: the amount of bottom padding currently on the element
  • \n *
\n */\n scrollbarPadding: function(elem) {\n elem = this.getRawNode(elem);\n\n var elemStyle = $window.getComputedStyle(elem);\n var paddingRight = this.parseStyle(elemStyle.paddingRight);\n var paddingBottom = this.parseStyle(elemStyle.paddingBottom);\n var scrollParent = this.scrollParent(elem, false, true);\n var scrollbarWidth = this.scrollbarWidth(BODY_REGEX.test(scrollParent.tagName));\n\n return {\n scrollbarWidth: scrollbarWidth,\n widthOverflow: scrollParent.scrollWidth > scrollParent.clientWidth,\n right: paddingRight + scrollbarWidth,\n originalRight: paddingRight,\n heightOverflow: scrollParent.scrollHeight > scrollParent.clientHeight,\n bottom: paddingBottom + scrollbarWidth,\n originalBottom: paddingBottom\n };\n },\n\n /**\n * Checks to see if the element is scrollable.\n *\n * @param {element} elem - The element to check.\n * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,\n * default is false.\n *\n * @returns {boolean} Whether the element is scrollable.\n */\n isScrollable: function(elem, includeHidden) {\n elem = this.getRawNode(elem);\n\n var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;\n var elemStyle = $window.getComputedStyle(elem);\n return overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX);\n },\n\n /**\n * Provides the closest scrollable ancestor.\n * A port of the jQuery UI scrollParent method:\n * https://github.com/jquery/jquery-ui/blob/master/ui/scroll-parent.js\n *\n * @param {element} elem - The element to find the scroll parent of.\n * @param {boolean=} [includeHidden=false] - Should scroll style of 'hidden' be considered,\n * default is false.\n * @param {boolean=} [includeSelf=false] - Should the element being passed be\n * included in the scrollable llokup.\n *\n * @returns {element} A HTML element.\n */\n scrollParent: function(elem, includeHidden, includeSelf) {\n elem = this.getRawNode(elem);\n\n var overflowRegex = includeHidden ? OVERFLOW_REGEX.hidden : OVERFLOW_REGEX.normal;\n var documentEl = $document[0].documentElement;\n var elemStyle = $window.getComputedStyle(elem);\n if (includeSelf && overflowRegex.test(elemStyle.overflow + elemStyle.overflowY + elemStyle.overflowX)) {\n return elem;\n }\n var excludeStatic = elemStyle.position === 'absolute';\n var scrollParent = elem.parentElement || documentEl;\n\n if (scrollParent === documentEl || elemStyle.position === 'fixed') {\n return documentEl;\n }\n\n while (scrollParent.parentElement && scrollParent !== documentEl) {\n var spStyle = $window.getComputedStyle(scrollParent);\n if (excludeStatic && spStyle.position !== 'static') {\n excludeStatic = false;\n }\n\n if (!excludeStatic && overflowRegex.test(spStyle.overflow + spStyle.overflowY + spStyle.overflowX)) {\n break;\n }\n scrollParent = scrollParent.parentElement;\n }\n\n return scrollParent;\n },\n\n /**\n * Provides read-only equivalent of jQuery's position function:\n * http://api.jquery.com/position/ - distance to closest positioned\n * ancestor. Does not account for margins by default like jQuery position.\n *\n * @param {element} elem - The element to caclulate the position on.\n * @param {boolean=} [includeMargins=false] - Should margins be accounted\n * for, default is false.\n *\n * @returns {object} An object with the following properties:\n *
    \n *
  • **width**: the width of the element
  • \n *
  • **height**: the height of the element
  • \n *
  • **top**: distance to top edge of offset parent
  • \n *
  • **left**: distance to left edge of offset parent
  • \n *
\n */\n position: function(elem, includeMagins) {\n elem = this.getRawNode(elem);\n\n var elemOffset = this.offset(elem);\n if (includeMagins) {\n var elemStyle = $window.getComputedStyle(elem);\n elemOffset.top -= this.parseStyle(elemStyle.marginTop);\n elemOffset.left -= this.parseStyle(elemStyle.marginLeft);\n }\n var parent = this.offsetParent(elem);\n var parentOffset = {top: 0, left: 0};\n\n if (parent !== $document[0].documentElement) {\n parentOffset = this.offset(parent);\n parentOffset.top += parent.clientTop - parent.scrollTop;\n parentOffset.left += parent.clientLeft - parent.scrollLeft;\n }\n\n return {\n width: Math.round(angular.isNumber(elemOffset.width) ? elemOffset.width : elem.offsetWidth),\n height: Math.round(angular.isNumber(elemOffset.height) ? elemOffset.height : elem.offsetHeight),\n top: Math.round(elemOffset.top - parentOffset.top),\n left: Math.round(elemOffset.left - parentOffset.left)\n };\n },\n\n /**\n * Provides read-only equivalent of jQuery's offset function:\n * http://api.jquery.com/offset/ - distance to viewport. Does\n * not account for borders, margins, or padding on the body\n * element.\n *\n * @param {element} elem - The element to calculate the offset on.\n *\n * @returns {object} An object with the following properties:\n *
    \n *
  • **width**: the width of the element
  • \n *
  • **height**: the height of the element
  • \n *
  • **top**: distance to top edge of viewport
  • \n *
  • **right**: distance to bottom edge of viewport
  • \n *
\n */\n offset: function(elem) {\n elem = this.getRawNode(elem);\n\n var elemBCR = elem.getBoundingClientRect();\n return {\n width: Math.round(angular.isNumber(elemBCR.width) ? elemBCR.width : elem.offsetWidth),\n height: Math.round(angular.isNumber(elemBCR.height) ? elemBCR.height : elem.offsetHeight),\n top: Math.round(elemBCR.top + ($window.pageYOffset || $document[0].documentElement.scrollTop)),\n left: Math.round(elemBCR.left + ($window.pageXOffset || $document[0].documentElement.scrollLeft))\n };\n },\n\n /**\n * Provides offset distance to the closest scrollable ancestor\n * or viewport. Accounts for border and scrollbar width.\n *\n * Right and bottom dimensions represent the distance to the\n * respective edge of the viewport element. If the element\n * edge extends beyond the viewport, a negative value will be\n * reported.\n *\n * @param {element} elem - The element to get the viewport offset for.\n * @param {boolean=} [useDocument=false] - Should the viewport be the document element instead\n * of the first scrollable element, default is false.\n * @param {boolean=} [includePadding=true] - Should the padding on the offset parent element\n * be accounted for, default is true.\n *\n * @returns {object} An object with the following properties:\n *
    \n *
  • **top**: distance to the top content edge of viewport element
  • \n *
  • **bottom**: distance to the bottom content edge of viewport element
  • \n *
  • **left**: distance to the left content edge of viewport element
  • \n *
  • **right**: distance to the right content edge of viewport element
  • \n *
\n */\n viewportOffset: function(elem, useDocument, includePadding) {\n elem = this.getRawNode(elem);\n includePadding = includePadding !== false ? true : false;\n\n var elemBCR = elem.getBoundingClientRect();\n var offsetBCR = {top: 0, left: 0, bottom: 0, right: 0};\n\n var offsetParent = useDocument ? $document[0].documentElement : this.scrollParent(elem);\n var offsetParentBCR = offsetParent.getBoundingClientRect();\n\n offsetBCR.top = offsetParentBCR.top + offsetParent.clientTop;\n offsetBCR.left = offsetParentBCR.left + offsetParent.clientLeft;\n if (offsetParent === $document[0].documentElement) {\n offsetBCR.top += $window.pageYOffset;\n offsetBCR.left += $window.pageXOffset;\n }\n offsetBCR.bottom = offsetBCR.top + offsetParent.clientHeight;\n offsetBCR.right = offsetBCR.left + offsetParent.clientWidth;\n\n if (includePadding) {\n var offsetParentStyle = $window.getComputedStyle(offsetParent);\n offsetBCR.top += this.parseStyle(offsetParentStyle.paddingTop);\n offsetBCR.bottom -= this.parseStyle(offsetParentStyle.paddingBottom);\n offsetBCR.left += this.parseStyle(offsetParentStyle.paddingLeft);\n offsetBCR.right -= this.parseStyle(offsetParentStyle.paddingRight);\n }\n\n return {\n top: Math.round(elemBCR.top - offsetBCR.top),\n bottom: Math.round(offsetBCR.bottom - elemBCR.bottom),\n left: Math.round(elemBCR.left - offsetBCR.left),\n right: Math.round(offsetBCR.right - elemBCR.right)\n };\n },\n\n /**\n * Provides an array of placement values parsed from a placement string.\n * Along with the 'auto' indicator, supported placement strings are:\n *
    \n *
  • top: element on top, horizontally centered on host element.
  • \n *
  • top-left: element on top, left edge aligned with host element left edge.
  • \n *
  • top-right: element on top, lerightft edge aligned with host element right edge.
  • \n *
  • bottom: element on bottom, horizontally centered on host element.
  • \n *
  • bottom-left: element on bottom, left edge aligned with host element left edge.
  • \n *
  • bottom-right: element on bottom, right edge aligned with host element right edge.
  • \n *
  • left: element on left, vertically centered on host element.
  • \n *
  • left-top: element on left, top edge aligned with host element top edge.
  • \n *
  • left-bottom: element on left, bottom edge aligned with host element bottom edge.
  • \n *
  • right: element on right, vertically centered on host element.
  • \n *
  • right-top: element on right, top edge aligned with host element top edge.
  • \n *
  • right-bottom: element on right, bottom edge aligned with host element bottom edge.
  • \n *
\n * A placement string with an 'auto' indicator is expected to be\n * space separated from the placement, i.e: 'auto bottom-left' If\n * the primary and secondary placement values do not match 'top,\n * bottom, left, right' then 'top' will be the primary placement and\n * 'center' will be the secondary placement. If 'auto' is passed, true\n * will be returned as the 3rd value of the array.\n *\n * @param {string} placement - The placement string to parse.\n *\n * @returns {array} An array with the following values\n *
    \n *
  • **[0]**: The primary placement.
  • \n *
  • **[1]**: The secondary placement.
  • \n *
  • **[2]**: If auto is passed: true, else undefined.
  • \n *
\n */\n parsePlacement: function(placement) {\n var autoPlace = PLACEMENT_REGEX.auto.test(placement);\n if (autoPlace) {\n placement = placement.replace(PLACEMENT_REGEX.auto, '');\n }\n\n placement = placement.split('-');\n\n placement[0] = placement[0] || 'top';\n if (!PLACEMENT_REGEX.primary.test(placement[0])) {\n placement[0] = 'top';\n }\n\n placement[1] = placement[1] || 'center';\n if (!PLACEMENT_REGEX.secondary.test(placement[1])) {\n placement[1] = 'center';\n }\n\n if (autoPlace) {\n placement[2] = true;\n } else {\n placement[2] = false;\n }\n\n return placement;\n },\n\n /**\n * Provides coordinates for an element to be positioned relative to\n * another element. Passing 'auto' as part of the placement parameter\n * will enable smart placement - where the element fits. i.e:\n * 'auto left-top' will check to see if there is enough space to the left\n * of the hostElem to fit the targetElem, if not place right (same for secondary\n * top placement). Available space is calculated using the viewportOffset\n * function.\n *\n * @param {element} hostElem - The element to position against.\n * @param {element} targetElem - The element to position.\n * @param {string=} [placement=top] - The placement for the targetElem,\n * default is 'top'. 'center' is assumed as secondary placement for\n * 'top', 'left', 'right', and 'bottom' placements. Available placements are:\n *
    \n *
  • top
  • \n *
  • top-right
  • \n *
  • top-left
  • \n *
  • bottom
  • \n *
  • bottom-left
  • \n *
  • bottom-right
  • \n *
  • left
  • \n *
  • left-top
  • \n *
  • left-bottom
  • \n *
  • right
  • \n *
  • right-top
  • \n *
  • right-bottom
  • \n *
\n * @param {boolean=} [appendToBody=false] - Should the top and left values returned\n * be calculated from the body element, default is false.\n *\n * @returns {object} An object with the following properties:\n *
    \n *
  • **top**: Value for targetElem top.
  • \n *
  • **left**: Value for targetElem left.
  • \n *
  • **placement**: The resolved placement.
  • \n *
\n */\n positionElements: function(hostElem, targetElem, placement, appendToBody) {\n hostElem = this.getRawNode(hostElem);\n targetElem = this.getRawNode(targetElem);\n\n // need to read from prop to support tests.\n var targetWidth = angular.isDefined(targetElem.offsetWidth) ? targetElem.offsetWidth : targetElem.prop('offsetWidth');\n var targetHeight = angular.isDefined(targetElem.offsetHeight) ? targetElem.offsetHeight : targetElem.prop('offsetHeight');\n\n placement = this.parsePlacement(placement);\n\n var hostElemPos = appendToBody ? this.offset(hostElem) : this.position(hostElem);\n var targetElemPos = {top: 0, left: 0, placement: ''};\n\n if (placement[2]) {\n var viewportOffset = this.viewportOffset(hostElem, appendToBody);\n\n var targetElemStyle = $window.getComputedStyle(targetElem);\n var adjustedSize = {\n width: targetWidth + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginLeft) + this.parseStyle(targetElemStyle.marginRight))),\n height: targetHeight + Math.round(Math.abs(this.parseStyle(targetElemStyle.marginTop) + this.parseStyle(targetElemStyle.marginBottom)))\n };\n\n placement[0] = placement[0] === 'top' && adjustedSize.height > viewportOffset.top && adjustedSize.height <= viewportOffset.bottom ? 'bottom' :\n placement[0] === 'bottom' && adjustedSize.height > viewportOffset.bottom && adjustedSize.height <= viewportOffset.top ? 'top' :\n placement[0] === 'left' && adjustedSize.width > viewportOffset.left && adjustedSize.width <= viewportOffset.right ? 'right' :\n placement[0] === 'right' && adjustedSize.width > viewportOffset.right && adjustedSize.width <= viewportOffset.left ? 'left' :\n placement[0];\n\n placement[1] = placement[1] === 'top' && adjustedSize.height - hostElemPos.height > viewportOffset.bottom && adjustedSize.height - hostElemPos.height <= viewportOffset.top ? 'bottom' :\n placement[1] === 'bottom' && adjustedSize.height - hostElemPos.height > viewportOffset.top && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom ? 'top' :\n placement[1] === 'left' && adjustedSize.width - hostElemPos.width > viewportOffset.right && adjustedSize.width - hostElemPos.width <= viewportOffset.left ? 'right' :\n placement[1] === 'right' && adjustedSize.width - hostElemPos.width > viewportOffset.left && adjustedSize.width - hostElemPos.width <= viewportOffset.right ? 'left' :\n placement[1];\n\n if (placement[1] === 'center') {\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n var xOverflow = hostElemPos.width / 2 - targetWidth / 2;\n if (viewportOffset.left + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.right) {\n placement[1] = 'left';\n } else if (viewportOffset.right + xOverflow < 0 && adjustedSize.width - hostElemPos.width <= viewportOffset.left) {\n placement[1] = 'right';\n }\n } else {\n var yOverflow = hostElemPos.height / 2 - adjustedSize.height / 2;\n if (viewportOffset.top + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.bottom) {\n placement[1] = 'top';\n } else if (viewportOffset.bottom + yOverflow < 0 && adjustedSize.height - hostElemPos.height <= viewportOffset.top) {\n placement[1] = 'bottom';\n }\n }\n }\n }\n\n switch (placement[0]) {\n case 'top':\n targetElemPos.top = hostElemPos.top - targetHeight;\n break;\n case 'bottom':\n targetElemPos.top = hostElemPos.top + hostElemPos.height;\n break;\n case 'left':\n targetElemPos.left = hostElemPos.left - targetWidth;\n break;\n case 'right':\n targetElemPos.left = hostElemPos.left + hostElemPos.width;\n break;\n }\n\n switch (placement[1]) {\n case 'top':\n targetElemPos.top = hostElemPos.top;\n break;\n case 'bottom':\n targetElemPos.top = hostElemPos.top + hostElemPos.height - targetHeight;\n break;\n case 'left':\n targetElemPos.left = hostElemPos.left;\n break;\n case 'right':\n targetElemPos.left = hostElemPos.left + hostElemPos.width - targetWidth;\n break;\n case 'center':\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n targetElemPos.left = hostElemPos.left + hostElemPos.width / 2 - targetWidth / 2;\n } else {\n targetElemPos.top = hostElemPos.top + hostElemPos.height / 2 - targetHeight / 2;\n }\n break;\n }\n\n targetElemPos.top = Math.round(targetElemPos.top);\n targetElemPos.left = Math.round(targetElemPos.left);\n targetElemPos.placement = placement[1] === 'center' ? placement[0] : placement[0] + '-' + placement[1];\n\n return targetElemPos;\n },\n\n /**\n * Provides a way to adjust the top positioning after first\n * render to correctly align element to top after content\n * rendering causes resized element height\n *\n * @param {array} placementClasses - The array of strings of classes\n * element should have.\n * @param {object} containerPosition - The object with container\n * position information\n * @param {number} initialHeight - The initial height for the elem.\n * @param {number} currentHeight - The current height for the elem.\n */\n adjustTop: function(placementClasses, containerPosition, initialHeight, currentHeight) {\n if (placementClasses.indexOf('top') !== -1 && initialHeight !== currentHeight) {\n return {\n top: containerPosition.top - currentHeight + 'px'\n };\n }\n },\n\n /**\n * Provides a way for positioning tooltip & dropdown\n * arrows when using placement options beyond the standard\n * left, right, top, or bottom.\n *\n * @param {element} elem - The tooltip/dropdown element.\n * @param {string} placement - The placement for the elem.\n */\n positionArrow: function(elem, placement) {\n elem = this.getRawNode(elem);\n\n var innerElem = elem.querySelector('.tooltip-inner, .popover-inner');\n if (!innerElem) {\n return;\n }\n\n var isTooltip = angular.element(innerElem).hasClass('tooltip-inner');\n\n var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow');\n if (!arrowElem) {\n return;\n }\n\n var arrowCss = {\n top: '',\n bottom: '',\n left: '',\n right: ''\n };\n\n placement = this.parsePlacement(placement);\n if (placement[1] === 'center') {\n // no adjustment necessary - just reset styles\n angular.element(arrowElem).css(arrowCss);\n return;\n }\n\n var borderProp = 'border-' + placement[0] + '-width';\n var borderWidth = $window.getComputedStyle(arrowElem)[borderProp];\n\n var borderRadiusProp = 'border-';\n if (PLACEMENT_REGEX.vertical.test(placement[0])) {\n borderRadiusProp += placement[0] + '-' + placement[1];\n } else {\n borderRadiusProp += placement[1] + '-' + placement[0];\n }\n borderRadiusProp += '-radius';\n var borderRadius = $window.getComputedStyle(isTooltip ? innerElem : elem)[borderRadiusProp];\n\n switch (placement[0]) {\n case 'top':\n arrowCss.bottom = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'bottom':\n arrowCss.top = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'left':\n arrowCss.right = isTooltip ? '0' : '-' + borderWidth;\n break;\n case 'right':\n arrowCss.left = isTooltip ? '0' : '-' + borderWidth;\n break;\n }\n\n arrowCss[placement[1]] = borderRadius;\n\n angular.element(arrowElem).css(arrowCss);\n }\n };\n }]);\n\nangular.module('ui.bootstrap.datepickerPopup', ['ui.bootstrap.datepicker', 'ui.bootstrap.position'])\n\n.value('$datepickerPopupLiteralWarning', true)\n\n.constant('uibDatepickerPopupConfig', {\n altInputFormats: [],\n appendToBody: false,\n clearText: 'Clear',\n closeOnDateSelection: true,\n closeText: 'Done',\n currentText: 'Today',\n datepickerPopup: 'yyyy-MM-dd',\n datepickerPopupTemplateUrl: 'uib/template/datepickerPopup/popup.html',\n datepickerTemplateUrl: 'uib/template/datepicker/datepicker.html',\n html5Types: {\n date: 'yyyy-MM-dd',\n 'datetime-local': 'yyyy-MM-ddTHH:mm:ss.sss',\n 'month': 'yyyy-MM'\n },\n onOpenFocus: true,\n showButtonBar: true,\n placement: 'auto bottom-left'\n})\n\n.controller('UibDatepickerPopupController', ['$scope', '$element', '$attrs', '$compile', '$log', '$parse', '$window', '$document', '$rootScope', '$uibPosition', 'dateFilter', 'uibDateParser', 'uibDatepickerPopupConfig', '$timeout', 'uibDatepickerConfig', '$datepickerPopupLiteralWarning',\nfunction($scope, $element, $attrs, $compile, $log, $parse, $window, $document, $rootScope, $position, dateFilter, dateParser, datepickerPopupConfig, $timeout, datepickerConfig, $datepickerPopupLiteralWarning) {\n var cache = {},\n isHtml5DateInput = false;\n var dateFormat, closeOnDateSelection, appendToBody, onOpenFocus,\n datepickerPopupTemplateUrl, datepickerTemplateUrl, popupEl, datepickerEl, scrollParentEl,\n ngModel, ngModelOptions, $popup, altInputFormats, watchListeners = [];\n\n this.init = function(_ngModel_) {\n ngModel = _ngModel_;\n ngModelOptions = extractOptions(ngModel);\n closeOnDateSelection = angular.isDefined($attrs.closeOnDateSelection) ?\n $scope.$parent.$eval($attrs.closeOnDateSelection) :\n datepickerPopupConfig.closeOnDateSelection;\n appendToBody = angular.isDefined($attrs.datepickerAppendToBody) ?\n $scope.$parent.$eval($attrs.datepickerAppendToBody) :\n datepickerPopupConfig.appendToBody;\n onOpenFocus = angular.isDefined($attrs.onOpenFocus) ?\n $scope.$parent.$eval($attrs.onOpenFocus) : datepickerPopupConfig.onOpenFocus;\n datepickerPopupTemplateUrl = angular.isDefined($attrs.datepickerPopupTemplateUrl) ?\n $attrs.datepickerPopupTemplateUrl :\n datepickerPopupConfig.datepickerPopupTemplateUrl;\n datepickerTemplateUrl = angular.isDefined($attrs.datepickerTemplateUrl) ?\n $attrs.datepickerTemplateUrl : datepickerPopupConfig.datepickerTemplateUrl;\n altInputFormats = angular.isDefined($attrs.altInputFormats) ?\n $scope.$parent.$eval($attrs.altInputFormats) :\n datepickerPopupConfig.altInputFormats;\n\n $scope.showButtonBar = angular.isDefined($attrs.showButtonBar) ?\n $scope.$parent.$eval($attrs.showButtonBar) :\n datepickerPopupConfig.showButtonBar;\n\n if (datepickerPopupConfig.html5Types[$attrs.type]) {\n dateFormat = datepickerPopupConfig.html5Types[$attrs.type];\n isHtml5DateInput = true;\n } else {\n dateFormat = $attrs.uibDatepickerPopup || datepickerPopupConfig.datepickerPopup;\n $attrs.$observe('uibDatepickerPopup', function(value, oldValue) {\n var newDateFormat = value || datepickerPopupConfig.datepickerPopup;\n // Invalidate the $modelValue to ensure that formatters re-run\n // FIXME: Refactor when PR is merged: https://github.com/angular/angular.js/pull/10764\n if (newDateFormat !== dateFormat) {\n dateFormat = newDateFormat;\n ngModel.$modelValue = null;\n\n if (!dateFormat) {\n throw new Error('uibDatepickerPopup must have a date format specified.');\n }\n }\n });\n }\n\n if (!dateFormat) {\n throw new Error('uibDatepickerPopup must have a date format specified.');\n }\n\n if (isHtml5DateInput && $attrs.uibDatepickerPopup) {\n throw new Error('HTML5 date input types do not support custom formats.');\n }\n\n // popup element used to display calendar\n popupEl = angular.element('
');\n\n popupEl.attr({\n 'ng-model': 'date',\n 'ng-change': 'dateSelection(date)',\n 'template-url': datepickerPopupTemplateUrl\n });\n\n // datepicker element\n datepickerEl = angular.element(popupEl.children()[0]);\n datepickerEl.attr('template-url', datepickerTemplateUrl);\n\n if (!$scope.datepickerOptions) {\n $scope.datepickerOptions = {};\n }\n\n if (isHtml5DateInput) {\n if ($attrs.type === 'month') {\n $scope.datepickerOptions.datepickerMode = 'month';\n $scope.datepickerOptions.minMode = 'month';\n }\n }\n\n datepickerEl.attr('datepicker-options', 'datepickerOptions');\n\n if (!isHtml5DateInput) {\n // Internal API to maintain the correct ng-invalid-[key] class\n ngModel.$$parserName = 'date';\n ngModel.$validators.date = validator;\n ngModel.$parsers.unshift(parseDate);\n ngModel.$formatters.push(function(value) {\n if (ngModel.$isEmpty(value)) {\n $scope.date = value;\n return value;\n }\n\n if (angular.isNumber(value)) {\n value = new Date(value);\n }\n\n $scope.date = dateParser.fromTimezone(value, ngModelOptions.getOption('timezone'));\n\n return dateParser.filter($scope.date, dateFormat);\n });\n } else {\n ngModel.$formatters.push(function(value) {\n $scope.date = dateParser.fromTimezone(value, ngModelOptions.getOption('timezone'));\n return value;\n });\n }\n\n // Detect changes in the view from the text box\n ngModel.$viewChangeListeners.push(function() {\n $scope.date = parseDateString(ngModel.$viewValue);\n });\n\n $element.on('keydown', inputKeydownBind);\n\n $popup = $compile(popupEl)($scope);\n // Prevent jQuery cache memory leak (template is now redundant after linking)\n popupEl.remove();\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else {\n $element.after($popup);\n }\n\n $scope.$on('$destroy', function() {\n if ($scope.isOpen === true) {\n if (!$rootScope.$$phase) {\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n }\n }\n\n $popup.remove();\n $element.off('keydown', inputKeydownBind);\n $document.off('click', documentClickBind);\n if (scrollParentEl) {\n scrollParentEl.off('scroll', positionPopup);\n }\n angular.element($window).off('resize', positionPopup);\n\n //Clear all watch listeners on destroy\n while (watchListeners.length) {\n watchListeners.shift()();\n }\n });\n };\n\n $scope.getText = function(key) {\n return $scope[key + 'Text'] || datepickerPopupConfig[key + 'Text'];\n };\n\n $scope.isDisabled = function(date) {\n if (date === 'today') {\n date = dateParser.fromTimezone(new Date(), ngModelOptions.getOption('timezone'));\n }\n\n var dates = {};\n angular.forEach(['minDate', 'maxDate'], function(key) {\n if (!$scope.datepickerOptions[key]) {\n dates[key] = null;\n } else if (angular.isDate($scope.datepickerOptions[key])) {\n dates[key] = new Date($scope.datepickerOptions[key]);\n } else {\n if ($datepickerPopupLiteralWarning) {\n $log.warn('Literal date support has been deprecated, please switch to date object usage');\n }\n\n dates[key] = new Date(dateFilter($scope.datepickerOptions[key], 'medium'));\n }\n });\n\n return $scope.datepickerOptions &&\n dates.minDate && $scope.compare(date, dates.minDate) < 0 ||\n dates.maxDate && $scope.compare(date, dates.maxDate) > 0;\n };\n\n $scope.compare = function(date1, date2) {\n return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate()) - new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());\n };\n\n // Inner change\n $scope.dateSelection = function(dt) {\n $scope.date = dt;\n var date = $scope.date ? dateParser.filter($scope.date, dateFormat) : null; // Setting to NULL is necessary for form validators to function\n $element.val(date);\n ngModel.$setViewValue(date);\n\n if (closeOnDateSelection) {\n $scope.isOpen = false;\n $element[0].focus();\n }\n };\n\n $scope.keydown = function(evt) {\n if (evt.which === 27) {\n evt.stopPropagation();\n $scope.isOpen = false;\n $element[0].focus();\n }\n };\n\n $scope.select = function(date, evt) {\n evt.stopPropagation();\n\n if (date === 'today') {\n var today = new Date();\n if (angular.isDate($scope.date)) {\n date = new Date($scope.date);\n date.setFullYear(today.getFullYear(), today.getMonth(), today.getDate());\n } else {\n date = dateParser.fromTimezone(today, ngModelOptions.getOption('timezone'));\n date.setHours(0, 0, 0, 0);\n }\n }\n $scope.dateSelection(date);\n };\n\n $scope.close = function(evt) {\n evt.stopPropagation();\n\n $scope.isOpen = false;\n $element[0].focus();\n };\n\n $scope.disabled = angular.isDefined($attrs.disabled) || false;\n if ($attrs.ngDisabled) {\n watchListeners.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(disabled) {\n $scope.disabled = disabled;\n }));\n }\n\n $scope.$watch('isOpen', function(value) {\n if (value) {\n if (!$scope.disabled) {\n $timeout(function() {\n positionPopup();\n\n if (onOpenFocus) {\n $scope.$broadcast('uib:datepicker.focus');\n }\n\n $document.on('click', documentClickBind);\n\n var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;\n if (appendToBody || $position.parsePlacement(placement)[2]) {\n scrollParentEl = scrollParentEl || angular.element($position.scrollParent($element));\n if (scrollParentEl) {\n scrollParentEl.on('scroll', positionPopup);\n }\n } else {\n scrollParentEl = null;\n }\n\n angular.element($window).on('resize', positionPopup);\n }, 0, false);\n } else {\n $scope.isOpen = false;\n }\n } else {\n $document.off('click', documentClickBind);\n if (scrollParentEl) {\n scrollParentEl.off('scroll', positionPopup);\n }\n angular.element($window).off('resize', positionPopup);\n }\n });\n\n function cameltoDash(string) {\n return string.replace(/([A-Z])/g, function($1) { return '-' + $1.toLowerCase(); });\n }\n\n function parseDateString(viewValue) {\n var date = dateParser.parse(viewValue, dateFormat, $scope.date);\n if (isNaN(date)) {\n for (var i = 0; i < altInputFormats.length; i++) {\n date = dateParser.parse(viewValue, altInputFormats[i], $scope.date);\n if (!isNaN(date)) {\n return date;\n }\n }\n }\n return date;\n }\n\n function parseDate(viewValue) {\n if (angular.isNumber(viewValue)) {\n // presumably timestamp to date object\n viewValue = new Date(viewValue);\n }\n\n if (!viewValue) {\n return null;\n }\n\n if (angular.isDate(viewValue) && !isNaN(viewValue)) {\n return viewValue;\n }\n\n if (angular.isString(viewValue)) {\n var date = parseDateString(viewValue);\n if (!isNaN(date)) {\n return dateParser.toTimezone(date, ngModelOptions.getOption('timezone'));\n }\n }\n\n return ngModelOptions.getOption('allowInvalid') ? viewValue : undefined;\n }\n\n function validator(modelValue, viewValue) {\n var value = modelValue || viewValue;\n\n if (!$attrs.ngRequired && !value) {\n return true;\n }\n\n if (angular.isNumber(value)) {\n value = new Date(value);\n }\n\n if (!value) {\n return true;\n }\n\n if (angular.isDate(value) && !isNaN(value)) {\n return true;\n }\n\n if (angular.isString(value)) {\n return !isNaN(parseDateString(value));\n }\n\n return false;\n }\n\n function documentClickBind(event) {\n if (!$scope.isOpen && $scope.disabled) {\n return;\n }\n\n var popup = $popup[0];\n var dpContainsTarget = $element[0].contains(event.target);\n // The popup node may not be an element node\n // In some browsers (IE) only element nodes have the 'contains' function\n var popupContainsTarget = popup.contains !== undefined && popup.contains(event.target);\n if ($scope.isOpen && !(dpContainsTarget || popupContainsTarget)) {\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n }\n }\n\n function inputKeydownBind(evt) {\n if (evt.which === 27 && $scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.$apply(function() {\n $scope.isOpen = false;\n });\n $element[0].focus();\n } else if (evt.which === 40 && !$scope.isOpen) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.$apply(function() {\n $scope.isOpen = true;\n });\n }\n }\n\n function positionPopup() {\n if ($scope.isOpen) {\n var dpElement = angular.element($popup[0].querySelector('.uib-datepicker-popup'));\n var placement = $attrs.popupPlacement ? $attrs.popupPlacement : datepickerPopupConfig.placement;\n var position = $position.positionElements($element, dpElement, placement, appendToBody);\n dpElement.css({top: position.top + 'px', left: position.left + 'px'});\n if (dpElement.hasClass('uib-position-measure')) {\n dpElement.removeClass('uib-position-measure');\n }\n }\n }\n\n function extractOptions(ngModelCtrl) {\n var ngModelOptions;\n\n if (angular.version.minor < 6) { // in angular < 1.6 $options could be missing\n // guarantee a value\n ngModelOptions = angular.isObject(ngModelCtrl.$options) ?\n ngModelCtrl.$options :\n {\n timezone: null\n };\n\n // mimic 1.6+ api\n ngModelOptions.getOption = function (key) {\n return ngModelOptions[key];\n };\n } else { // in angular >=1.6 $options is always present\n ngModelOptions = ngModelCtrl.$options;\n }\n\n return ngModelOptions;\n }\n\n $scope.$on('uib:datepicker.mode', function() {\n $timeout(positionPopup, 0, false);\n });\n}])\n\n.directive('uibDatepickerPopup', function() {\n return {\n require: ['ngModel', 'uibDatepickerPopup'],\n controller: 'UibDatepickerPopupController',\n scope: {\n datepickerOptions: '=?',\n isOpen: '=?',\n currentText: '@',\n clearText: '@',\n closeText: '@'\n },\n link: function(scope, element, attrs, ctrls) {\n var ngModel = ctrls[0],\n ctrl = ctrls[1];\n\n ctrl.init(ngModel);\n }\n };\n})\n\n.directive('uibDatepickerPopupWrap', function() {\n return {\n restrict: 'A',\n transclude: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/datepickerPopup/popup.html';\n }\n };\n});\n\nangular.module('ui.bootstrap.debounce', [])\n/**\n * A helper, internal service that debounces a function\n */\n .factory('$$debounce', ['$timeout', function($timeout) {\n return function(callback, debounceTime) {\n var timeoutPromise;\n\n return function() {\n var self = this;\n var args = Array.prototype.slice.call(arguments);\n if (timeoutPromise) {\n $timeout.cancel(timeoutPromise);\n }\n\n timeoutPromise = $timeout(function() {\n callback.apply(self, args);\n }, debounceTime);\n };\n };\n }]);\n\nangular.module('ui.bootstrap.multiMap', [])\n/**\n * A helper, internal data structure that stores all references attached to key\n */\n .factory('$$multiMap', function() {\n return {\n createNew: function() {\n var map = {};\n\n return {\n entries: function() {\n return Object.keys(map).map(function(key) {\n return {\n key: key,\n value: map[key]\n };\n });\n },\n get: function(key) {\n return map[key];\n },\n hasKey: function(key) {\n return !!map[key];\n },\n keys: function() {\n return Object.keys(map);\n },\n put: function(key, value) {\n if (!map[key]) {\n map[key] = [];\n }\n\n map[key].push(value);\n },\n remove: function(key, value) {\n var values = map[key];\n\n if (!values) {\n return;\n }\n\n var idx = values.indexOf(value);\n\n if (idx !== -1) {\n values.splice(idx, 1);\n }\n\n if (!values.length) {\n delete map[key];\n }\n }\n };\n }\n };\n });\n\nangular.module('ui.bootstrap.dropdown', ['ui.bootstrap.multiMap', 'ui.bootstrap.position'])\n\n.constant('uibDropdownConfig', {\n appendToOpenClass: 'uib-dropdown-open',\n openClass: 'open'\n})\n\n.service('uibDropdownService', ['$document', '$rootScope', '$$multiMap', function($document, $rootScope, $$multiMap) {\n var openScope = null;\n var openedContainers = $$multiMap.createNew();\n\n this.isOnlyOpen = function(dropdownScope, appendTo) {\n var openedDropdowns = openedContainers.get(appendTo);\n if (openedDropdowns) {\n var openDropdown = openedDropdowns.reduce(function(toClose, dropdown) {\n if (dropdown.scope === dropdownScope) {\n return dropdown;\n }\n\n return toClose;\n }, {});\n if (openDropdown) {\n return openedDropdowns.length === 1;\n }\n }\n\n return false;\n };\n\n this.open = function(dropdownScope, element, appendTo) {\n if (!openScope) {\n $document.on('click', closeDropdown);\n }\n\n if (openScope && openScope !== dropdownScope) {\n openScope.isOpen = false;\n }\n\n openScope = dropdownScope;\n\n if (!appendTo) {\n return;\n }\n\n var openedDropdowns = openedContainers.get(appendTo);\n if (openedDropdowns) {\n var openedScopes = openedDropdowns.map(function(dropdown) {\n return dropdown.scope;\n });\n if (openedScopes.indexOf(dropdownScope) === -1) {\n openedContainers.put(appendTo, {\n scope: dropdownScope\n });\n }\n } else {\n openedContainers.put(appendTo, {\n scope: dropdownScope\n });\n }\n };\n\n this.close = function(dropdownScope, element, appendTo) {\n if (openScope === dropdownScope) {\n $document.off('click', closeDropdown);\n $document.off('keydown', this.keybindFilter);\n openScope = null;\n }\n\n if (!appendTo) {\n return;\n }\n\n var openedDropdowns = openedContainers.get(appendTo);\n if (openedDropdowns) {\n var dropdownToClose = openedDropdowns.reduce(function(toClose, dropdown) {\n if (dropdown.scope === dropdownScope) {\n return dropdown;\n }\n\n return toClose;\n }, {});\n if (dropdownToClose) {\n openedContainers.remove(appendTo, dropdownToClose);\n }\n }\n };\n\n var closeDropdown = function(evt) {\n // This method may still be called during the same mouse event that\n // unbound this event handler. So check openScope before proceeding.\n if (!openScope || !openScope.isOpen) { return; }\n\n if (evt && openScope.getAutoClose() === 'disabled') { return; }\n\n if (evt && evt.which === 3) { return; }\n\n var toggleElement = openScope.getToggleElement();\n if (evt && toggleElement && toggleElement[0].contains(evt.target)) {\n return;\n }\n\n var dropdownElement = openScope.getDropdownElement();\n if (evt && openScope.getAutoClose() === 'outsideClick' &&\n dropdownElement && dropdownElement[0].contains(evt.target)) {\n return;\n }\n\n openScope.focusToggleElement();\n openScope.isOpen = false;\n\n if (!$rootScope.$$phase) {\n openScope.$apply();\n }\n };\n\n this.keybindFilter = function(evt) {\n if (!openScope) {\n // see this.close as ESC could have been pressed which kills the scope so we can not proceed\n return;\n }\n\n var dropdownElement = openScope.getDropdownElement();\n var toggleElement = openScope.getToggleElement();\n var dropdownElementTargeted = dropdownElement && dropdownElement[0].contains(evt.target);\n var toggleElementTargeted = toggleElement && toggleElement[0].contains(evt.target);\n if (evt.which === 27) {\n evt.stopPropagation();\n openScope.focusToggleElement();\n closeDropdown();\n } else if (openScope.isKeynavEnabled() && [38, 40].indexOf(evt.which) !== -1 && openScope.isOpen && (dropdownElementTargeted || toggleElementTargeted)) {\n evt.preventDefault();\n evt.stopPropagation();\n openScope.focusDropdownEntry(evt.which);\n }\n };\n}])\n\n.controller('UibDropdownController', ['$scope', '$element', '$attrs', '$parse', 'uibDropdownConfig', 'uibDropdownService', '$animate', '$uibPosition', '$document', '$compile', '$templateRequest', function($scope, $element, $attrs, $parse, dropdownConfig, uibDropdownService, $animate, $position, $document, $compile, $templateRequest) {\n var self = this,\n scope = $scope.$new(), // create a child scope so we are not polluting original one\n templateScope,\n appendToOpenClass = dropdownConfig.appendToOpenClass,\n openClass = dropdownConfig.openClass,\n getIsOpen,\n setIsOpen = angular.noop,\n toggleInvoker = $attrs.onToggle ? $parse($attrs.onToggle) : angular.noop,\n keynavEnabled = false,\n selectedOption = null,\n body = $document.find('body');\n\n $element.addClass('dropdown');\n\n this.init = function() {\n if ($attrs.isOpen) {\n getIsOpen = $parse($attrs.isOpen);\n setIsOpen = getIsOpen.assign;\n\n $scope.$watch(getIsOpen, function(value) {\n scope.isOpen = !!value;\n });\n }\n\n keynavEnabled = angular.isDefined($attrs.keyboardNav);\n };\n\n this.toggle = function(open) {\n scope.isOpen = arguments.length ? !!open : !scope.isOpen;\n if (angular.isFunction(setIsOpen)) {\n setIsOpen(scope, scope.isOpen);\n }\n\n return scope.isOpen;\n };\n\n // Allow other directives to watch status\n this.isOpen = function() {\n return scope.isOpen;\n };\n\n scope.getToggleElement = function() {\n return self.toggleElement;\n };\n\n scope.getAutoClose = function() {\n return $attrs.autoClose || 'always'; //or 'outsideClick' or 'disabled'\n };\n\n scope.getElement = function() {\n return $element;\n };\n\n scope.isKeynavEnabled = function() {\n return keynavEnabled;\n };\n\n scope.focusDropdownEntry = function(keyCode) {\n var elems = self.dropdownMenu ? //If append to body is used.\n angular.element(self.dropdownMenu).find('a') :\n $element.find('ul').eq(0).find('a');\n\n switch (keyCode) {\n case 40: {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = 0;\n } else {\n self.selectedOption = self.selectedOption === elems.length - 1 ?\n self.selectedOption :\n self.selectedOption + 1;\n }\n break;\n }\n case 38: {\n if (!angular.isNumber(self.selectedOption)) {\n self.selectedOption = elems.length - 1;\n } else {\n self.selectedOption = self.selectedOption === 0 ?\n 0 : self.selectedOption - 1;\n }\n break;\n }\n }\n elems[self.selectedOption].focus();\n };\n\n scope.getDropdownElement = function() {\n return self.dropdownMenu;\n };\n\n scope.focusToggleElement = function() {\n if (self.toggleElement) {\n self.toggleElement[0].focus();\n }\n };\n\n function removeDropdownMenu() {\n $element.append(self.dropdownMenu);\n }\n\n scope.$watch('isOpen', function(isOpen, wasOpen) {\n var appendTo = null,\n appendToBody = false;\n\n if (angular.isDefined($attrs.dropdownAppendTo)) {\n var appendToEl = $parse($attrs.dropdownAppendTo)(scope);\n if (appendToEl) {\n appendTo = angular.element(appendToEl);\n }\n }\n\n if (angular.isDefined($attrs.dropdownAppendToBody)) {\n var appendToBodyValue = $parse($attrs.dropdownAppendToBody)(scope);\n if (appendToBodyValue !== false) {\n appendToBody = true;\n }\n }\n\n if (appendToBody && !appendTo) {\n appendTo = body;\n }\n\n if (appendTo && self.dropdownMenu) {\n if (isOpen) {\n appendTo.append(self.dropdownMenu);\n $element.on('$destroy', removeDropdownMenu);\n } else {\n $element.off('$destroy', removeDropdownMenu);\n removeDropdownMenu();\n }\n }\n\n if (appendTo && self.dropdownMenu) {\n var pos = $position.positionElements($element, self.dropdownMenu, 'bottom-left', true),\n css,\n rightalign,\n scrollbarPadding,\n scrollbarWidth = 0;\n\n css = {\n top: pos.top + 'px',\n display: isOpen ? 'block' : 'none'\n };\n\n rightalign = self.dropdownMenu.hasClass('dropdown-menu-right');\n if (!rightalign) {\n css.left = pos.left + 'px';\n css.right = 'auto';\n } else {\n css.left = 'auto';\n scrollbarPadding = $position.scrollbarPadding(appendTo);\n\n if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n scrollbarWidth = scrollbarPadding.scrollbarWidth;\n }\n\n css.right = window.innerWidth - scrollbarWidth -\n (pos.left + $element.prop('offsetWidth')) + 'px';\n }\n\n // Need to adjust our positioning to be relative to the appendTo container\n // if it's not the body element\n if (!appendToBody) {\n var appendOffset = $position.offset(appendTo);\n\n css.top = pos.top - appendOffset.top + 'px';\n\n if (!rightalign) {\n css.left = pos.left - appendOffset.left + 'px';\n } else {\n css.right = window.innerWidth -\n (pos.left - appendOffset.left + $element.prop('offsetWidth')) + 'px';\n }\n }\n\n self.dropdownMenu.css(css);\n }\n\n var openContainer = appendTo ? appendTo : $element;\n var dropdownOpenClass = appendTo ? appendToOpenClass : openClass;\n var hasOpenClass = openContainer.hasClass(dropdownOpenClass);\n var isOnlyOpen = uibDropdownService.isOnlyOpen($scope, appendTo);\n\n if (hasOpenClass === !isOpen) {\n var toggleClass;\n if (appendTo) {\n toggleClass = !isOnlyOpen ? 'addClass' : 'removeClass';\n } else {\n toggleClass = isOpen ? 'addClass' : 'removeClass';\n }\n $animate[toggleClass](openContainer, dropdownOpenClass).then(function() {\n if (angular.isDefined(isOpen) && isOpen !== wasOpen) {\n toggleInvoker($scope, { open: !!isOpen });\n }\n });\n }\n\n if (isOpen) {\n if (self.dropdownMenuTemplateUrl) {\n $templateRequest(self.dropdownMenuTemplateUrl).then(function(tplContent) {\n templateScope = scope.$new();\n $compile(tplContent.trim())(templateScope, function(dropdownElement) {\n var newEl = dropdownElement;\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n $document.on('keydown', uibDropdownService.keybindFilter);\n });\n });\n } else {\n $document.on('keydown', uibDropdownService.keybindFilter);\n }\n\n scope.focusToggleElement();\n uibDropdownService.open(scope, $element, appendTo);\n } else {\n uibDropdownService.close(scope, $element, appendTo);\n if (self.dropdownMenuTemplateUrl) {\n if (templateScope) {\n templateScope.$destroy();\n }\n var newEl = angular.element('
    ');\n self.dropdownMenu.replaceWith(newEl);\n self.dropdownMenu = newEl;\n }\n\n self.selectedOption = null;\n }\n\n if (angular.isFunction(setIsOpen)) {\n setIsOpen($scope, isOpen);\n }\n });\n}])\n\n.directive('uibDropdown', function() {\n return {\n controller: 'UibDropdownController',\n link: function(scope, element, attrs, dropdownCtrl) {\n dropdownCtrl.init();\n }\n };\n})\n\n.directive('uibDropdownMenu', function() {\n return {\n restrict: 'A',\n require: '?^uibDropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl || angular.isDefined(attrs.dropdownNested)) {\n return;\n }\n\n element.addClass('dropdown-menu');\n\n var tplUrl = attrs.templateUrl;\n if (tplUrl) {\n dropdownCtrl.dropdownMenuTemplateUrl = tplUrl;\n }\n\n if (!dropdownCtrl.dropdownMenu) {\n dropdownCtrl.dropdownMenu = element;\n }\n }\n };\n})\n\n.directive('uibDropdownToggle', function() {\n return {\n require: '?^uibDropdown',\n link: function(scope, element, attrs, dropdownCtrl) {\n if (!dropdownCtrl) {\n return;\n }\n\n element.addClass('dropdown-toggle');\n\n dropdownCtrl.toggleElement = element;\n\n var toggleDropdown = function(event) {\n event.preventDefault();\n\n if (!element.hasClass('disabled') && !attrs.disabled) {\n scope.$apply(function() {\n dropdownCtrl.toggle();\n });\n }\n };\n\n element.on('click', toggleDropdown);\n\n // WAI-ARIA\n element.attr({ 'aria-haspopup': true, 'aria-expanded': false });\n scope.$watch(dropdownCtrl.isOpen, function(isOpen) {\n element.attr('aria-expanded', !!isOpen);\n });\n\n scope.$on('$destroy', function() {\n element.off('click', toggleDropdown);\n });\n }\n };\n});\n\nangular.module('ui.bootstrap.stackedMap', [])\n/**\n * A helper, internal data structure that acts as a map but also allows getting / removing\n * elements in the LIFO order\n */\n .factory('$$stackedMap', function() {\n return {\n createNew: function() {\n var stack = [];\n\n return {\n add: function(key, value) {\n stack.push({\n key: key,\n value: value\n });\n },\n get: function(key) {\n for (var i = 0; i < stack.length; i++) {\n if (key === stack[i].key) {\n return stack[i];\n }\n }\n },\n keys: function() {\n var keys = [];\n for (var i = 0; i < stack.length; i++) {\n keys.push(stack[i].key);\n }\n return keys;\n },\n top: function() {\n return stack[stack.length - 1];\n },\n remove: function(key) {\n var idx = -1;\n for (var i = 0; i < stack.length; i++) {\n if (key === stack[i].key) {\n idx = i;\n break;\n }\n }\n return stack.splice(idx, 1)[0];\n },\n removeTop: function() {\n return stack.pop();\n },\n length: function() {\n return stack.length;\n }\n };\n }\n };\n });\nangular.module('ui.bootstrap.modal', ['ui.bootstrap.multiMap', 'ui.bootstrap.stackedMap', 'ui.bootstrap.position'])\n/**\n * Pluggable resolve mechanism for the modal resolve resolution\n * Supports UI Router's $resolve service\n */\n .provider('$uibResolve', function() {\n var resolve = this;\n this.resolver = null;\n\n this.setResolver = function(resolver) {\n this.resolver = resolver;\n };\n\n this.$get = ['$injector', '$q', function($injector, $q) {\n var resolver = resolve.resolver ? $injector.get(resolve.resolver) : null;\n return {\n resolve: function(invocables, locals, parent, self) {\n if (resolver) {\n return resolver.resolve(invocables, locals, parent, self);\n }\n\n var promises = [];\n\n angular.forEach(invocables, function(value) {\n if (angular.isFunction(value) || angular.isArray(value)) {\n promises.push($q.resolve($injector.invoke(value)));\n } else if (angular.isString(value)) {\n promises.push($q.resolve($injector.get(value)));\n } else {\n promises.push($q.resolve(value));\n }\n });\n\n return $q.all(promises).then(function(resolves) {\n var resolveObj = {};\n var resolveIter = 0;\n angular.forEach(invocables, function(value, key) {\n resolveObj[key] = resolves[resolveIter++];\n });\n\n return resolveObj;\n });\n }\n };\n }];\n })\n\n/**\n * A helper directive for the $modal service. It creates a backdrop element.\n */\n .directive('uibModalBackdrop', ['$animate', '$injector', '$uibModalStack',\n function($animate, $injector, $modalStack) {\n return {\n restrict: 'A',\n compile: function(tElement, tAttrs) {\n tElement.addClass(tAttrs.backdropClass);\n return linkFn;\n }\n };\n\n function linkFn(scope, element, attrs) {\n if (attrs.modalInClass) {\n $animate.addClass(element, attrs.modalInClass);\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n if (scope.modalOptions.animation) {\n $animate.removeClass(element, attrs.modalInClass).then(done);\n } else {\n done();\n }\n });\n }\n }\n }])\n\n .directive('uibModalWindow', ['$uibModalStack', '$q', '$animateCss', '$document',\n function($modalStack, $q, $animateCss, $document) {\n return {\n scope: {\n index: '@'\n },\n restrict: 'A',\n transclude: true,\n templateUrl: function(tElement, tAttrs) {\n return tAttrs.templateUrl || 'uib/template/modal/window.html';\n },\n link: function(scope, element, attrs) {\n element.addClass(attrs.windowTopClass || '');\n scope.size = attrs.size;\n\n scope.close = function(evt) {\n var modal = $modalStack.getTop();\n if (modal && modal.value.backdrop &&\n modal.value.backdrop !== 'static' &&\n evt.target === evt.currentTarget) {\n evt.preventDefault();\n evt.stopPropagation();\n $modalStack.dismiss(modal.key, 'backdrop click');\n }\n };\n\n // moved from template to fix issue #2280\n element.on('click', scope.close);\n\n // This property is only added to the scope for the purpose of detecting when this directive is rendered.\n // We can detect that by using this property in the template associated with this directive and then use\n // {@link Attribute#$observe} on it. For more details please see {@link TableColumnResize}.\n scope.$isRendered = true;\n\n // Deferred object that will be resolved when this modal is rendered.\n var modalRenderDeferObj = $q.defer();\n // Resolve render promise post-digest\n scope.$$postDigest(function() {\n modalRenderDeferObj.resolve();\n });\n\n modalRenderDeferObj.promise.then(function() {\n var animationPromise = null;\n\n if (attrs.modalInClass) {\n animationPromise = $animateCss(element, {\n addClass: attrs.modalInClass\n }).start();\n\n scope.$on($modalStack.NOW_CLOSING_EVENT, function(e, setIsAsync) {\n var done = setIsAsync();\n $animateCss(element, {\n removeClass: attrs.modalInClass\n }).start().then(done);\n });\n }\n\n\n $q.when(animationPromise).then(function() {\n // Notify {@link $modalStack} that modal is rendered.\n var modal = $modalStack.getTop();\n if (modal) {\n $modalStack.modalRendered(modal.key);\n }\n\n /**\n * If something within the freshly-opened modal already has focus (perhaps via a\n * directive that causes focus) then there's no need to try to focus anything.\n */\n if (!($document[0].activeElement && element[0].contains($document[0].activeElement))) {\n var inputWithAutofocus = element[0].querySelector('[autofocus]');\n /**\n * Auto-focusing of a freshly-opened modal element causes any child elements\n * with the autofocus attribute to lose focus. This is an issue on touch\n * based devices which will show and then hide the onscreen keyboard.\n * Attempts to refocus the autofocus element via JavaScript will not reopen\n * the onscreen keyboard. Fixed by updated the focusing logic to only autofocus\n * the modal element if the modal does not contain an autofocus element.\n */\n if (inputWithAutofocus) {\n inputWithAutofocus.focus();\n } else {\n element[0].focus();\n }\n }\n });\n });\n }\n };\n }])\n\n .directive('uibModalAnimationClass', function() {\n return {\n compile: function(tElement, tAttrs) {\n if (tAttrs.modalAnimation) {\n tElement.addClass(tAttrs.uibModalAnimationClass);\n }\n }\n };\n })\n\n .directive('uibModalTransclude', ['$animate', function($animate) {\n return {\n link: function(scope, element, attrs, controller, transclude) {\n transclude(scope.$parent, function(clone) {\n element.empty();\n $animate.enter(clone, element);\n });\n }\n };\n }])\n\n .factory('$uibModalStack', ['$animate', '$animateCss', '$document',\n '$compile', '$rootScope', '$q', '$$multiMap', '$$stackedMap', '$uibPosition',\n function($animate, $animateCss, $document, $compile, $rootScope, $q, $$multiMap, $$stackedMap, $uibPosition) {\n var OPENED_MODAL_CLASS = 'modal-open';\n\n var backdropDomEl, backdropScope;\n var openedWindows = $$stackedMap.createNew();\n var openedClasses = $$multiMap.createNew();\n var $modalStack = {\n NOW_CLOSING_EVENT: 'modal.stack.now-closing'\n };\n var topModalIndex = 0;\n var previousTopOpenedModal = null;\n var ARIA_HIDDEN_ATTRIBUTE_NAME = 'data-bootstrap-modal-aria-hidden-count';\n\n //Modal focus behavior\n var tabbableSelector = 'a[href], area[href], input:not([disabled]):not([tabindex=\\'-1\\']), ' +\n 'button:not([disabled]):not([tabindex=\\'-1\\']),select:not([disabled]):not([tabindex=\\'-1\\']), textarea:not([disabled]):not([tabindex=\\'-1\\']), ' +\n 'iframe, object, embed, *[tabindex]:not([tabindex=\\'-1\\']), *[contenteditable=true]';\n var scrollbarPadding;\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n\n // TODO: extract into common dependency with tooltip\n function snake_case(name) {\n var separator = '-';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n function isVisible(element) {\n return !!(element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length);\n }\n\n function backdropIndex() {\n var topBackdropIndex = -1;\n var opened = openedWindows.keys();\n for (var i = 0; i < opened.length; i++) {\n if (openedWindows.get(opened[i]).value.backdrop) {\n topBackdropIndex = i;\n }\n }\n\n // If any backdrop exist, ensure that it's index is always\n // right below the top modal\n if (topBackdropIndex > -1 && topBackdropIndex < topModalIndex) {\n topBackdropIndex = topModalIndex;\n }\n return topBackdropIndex;\n }\n\n $rootScope.$watch(backdropIndex, function(newBackdropIndex) {\n if (backdropScope) {\n backdropScope.index = newBackdropIndex;\n }\n });\n\n function removeModalWindow(modalInstance, elementToReceiveFocus) {\n var modalWindow = openedWindows.get(modalInstance).value;\n var appendToElement = modalWindow.appendTo;\n\n //clean up the stack\n openedWindows.remove(modalInstance);\n previousTopOpenedModal = openedWindows.top();\n if (previousTopOpenedModal) {\n topModalIndex = parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10);\n }\n\n removeAfterAnimate(modalWindow.modalDomEl, modalWindow.modalScope, function() {\n var modalBodyClass = modalWindow.openedClass || OPENED_MODAL_CLASS;\n openedClasses.remove(modalBodyClass, modalInstance);\n var areAnyOpen = openedClasses.hasKey(modalBodyClass);\n appendToElement.toggleClass(modalBodyClass, areAnyOpen);\n if (!areAnyOpen && scrollbarPadding && scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n if (scrollbarPadding.originalRight) {\n appendToElement.css({paddingRight: scrollbarPadding.originalRight + 'px'});\n } else {\n appendToElement.css({paddingRight: ''});\n }\n scrollbarPadding = null;\n }\n toggleTopWindowClass(true);\n }, modalWindow.closedDeferred);\n checkRemoveBackdrop();\n\n //move focus to specified element if available, or else to body\n if (elementToReceiveFocus && elementToReceiveFocus.focus) {\n elementToReceiveFocus.focus();\n } else if (appendToElement.focus) {\n appendToElement.focus();\n }\n }\n\n // Add or remove \"windowTopClass\" from the top window in the stack\n function toggleTopWindowClass(toggleSwitch) {\n var modalWindow;\n\n if (openedWindows.length() > 0) {\n modalWindow = openedWindows.top().value;\n modalWindow.modalDomEl.toggleClass(modalWindow.windowTopClass || '', toggleSwitch);\n }\n }\n\n function checkRemoveBackdrop() {\n //remove backdrop if no longer needed\n if (backdropDomEl && backdropIndex() === -1) {\n var backdropScopeRef = backdropScope;\n removeAfterAnimate(backdropDomEl, backdropScope, function() {\n backdropScopeRef = null;\n });\n backdropDomEl = undefined;\n backdropScope = undefined;\n }\n }\n\n function removeAfterAnimate(domEl, scope, done, closedDeferred) {\n var asyncDeferred;\n var asyncPromise = null;\n var setIsAsync = function() {\n if (!asyncDeferred) {\n asyncDeferred = $q.defer();\n asyncPromise = asyncDeferred.promise;\n }\n\n return function asyncDone() {\n asyncDeferred.resolve();\n };\n };\n scope.$broadcast($modalStack.NOW_CLOSING_EVENT, setIsAsync);\n\n // Note that it's intentional that asyncPromise might be null.\n // That's when setIsAsync has not been called during the\n // NOW_CLOSING_EVENT broadcast.\n return $q.when(asyncPromise).then(afterAnimating);\n\n function afterAnimating() {\n if (afterAnimating.done) {\n return;\n }\n afterAnimating.done = true;\n\n $animate.leave(domEl).then(function() {\n if (done) {\n done();\n }\n\n domEl.remove();\n if (closedDeferred) {\n closedDeferred.resolve();\n }\n });\n\n scope.$destroy();\n }\n }\n\n $document.on('keydown', keydownListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('keydown', keydownListener);\n });\n\n function keydownListener(evt) {\n if (evt.isDefaultPrevented()) {\n return evt;\n }\n\n var modal = openedWindows.top();\n if (modal) {\n switch (evt.which) {\n case 27: {\n if (modal.value.keyboard) {\n evt.preventDefault();\n $rootScope.$apply(function() {\n $modalStack.dismiss(modal.key, 'escape key press');\n });\n }\n break;\n }\n case 9: {\n var list = $modalStack.loadFocusElementList(modal);\n var focusChanged = false;\n if (evt.shiftKey) {\n if ($modalStack.isFocusInFirstItem(evt, list) || $modalStack.isModalFocused(evt, modal)) {\n focusChanged = $modalStack.focusLastFocusableElement(list);\n }\n } else {\n if ($modalStack.isFocusInLastItem(evt, list)) {\n focusChanged = $modalStack.focusFirstFocusableElement(list);\n }\n }\n\n if (focusChanged) {\n evt.preventDefault();\n evt.stopPropagation();\n }\n\n break;\n }\n }\n }\n }\n\n $modalStack.open = function(modalInstance, modal) {\n var modalOpener = $document[0].activeElement,\n modalBodyClass = modal.openedClass || OPENED_MODAL_CLASS;\n\n toggleTopWindowClass(false);\n\n // Store the current top first, to determine what index we ought to use\n // for the current top modal\n previousTopOpenedModal = openedWindows.top();\n\n openedWindows.add(modalInstance, {\n deferred: modal.deferred,\n renderDeferred: modal.renderDeferred,\n closedDeferred: modal.closedDeferred,\n modalScope: modal.scope,\n backdrop: modal.backdrop,\n keyboard: modal.keyboard,\n openedClass: modal.openedClass,\n windowTopClass: modal.windowTopClass,\n animation: modal.animation,\n appendTo: modal.appendTo\n });\n\n openedClasses.put(modalBodyClass, modalInstance);\n\n var appendToElement = modal.appendTo,\n currBackdropIndex = backdropIndex();\n\n if (currBackdropIndex >= 0 && !backdropDomEl) {\n backdropScope = $rootScope.$new(true);\n backdropScope.modalOptions = modal;\n backdropScope.index = currBackdropIndex;\n backdropDomEl = angular.element('
    ');\n backdropDomEl.attr({\n 'class': 'modal-backdrop',\n 'ng-style': '{\\'z-index\\': 1040 + (index && 1 || 0) + index*10}',\n 'uib-modal-animation-class': 'fade',\n 'modal-in-class': 'in'\n });\n if (modal.backdropClass) {\n backdropDomEl.addClass(modal.backdropClass);\n }\n\n if (modal.animation) {\n backdropDomEl.attr('modal-animation', 'true');\n }\n $compile(backdropDomEl)(backdropScope);\n $animate.enter(backdropDomEl, appendToElement);\n if ($uibPosition.isScrollable(appendToElement)) {\n scrollbarPadding = $uibPosition.scrollbarPadding(appendToElement);\n if (scrollbarPadding.heightOverflow && scrollbarPadding.scrollbarWidth) {\n appendToElement.css({paddingRight: scrollbarPadding.right + 'px'});\n }\n }\n }\n\n var content;\n if (modal.component) {\n content = document.createElement(snake_case(modal.component.name));\n content = angular.element(content);\n content.attr({\n resolve: '$resolve',\n 'modal-instance': '$uibModalInstance',\n close: '$close($value)',\n dismiss: '$dismiss($value)'\n });\n } else {\n content = modal.content;\n }\n\n // Set the top modal index based on the index of the previous top modal\n topModalIndex = previousTopOpenedModal ? parseInt(previousTopOpenedModal.value.modalDomEl.attr('index'), 10) + 1 : 0;\n var angularDomEl = angular.element('
    ');\n angularDomEl.attr({\n 'class': 'modal',\n 'template-url': modal.windowTemplateUrl,\n 'window-top-class': modal.windowTopClass,\n 'role': 'dialog',\n 'aria-labelledby': modal.ariaLabelledBy,\n 'aria-describedby': modal.ariaDescribedBy,\n 'size': modal.size,\n 'index': topModalIndex,\n 'animate': 'animate',\n 'ng-style': '{\\'z-index\\': 1050 + $$topModalIndex*10, display: \\'block\\'}',\n 'tabindex': -1,\n 'uib-modal-animation-class': 'fade',\n 'modal-in-class': 'in'\n }).append(content);\n if (modal.windowClass) {\n angularDomEl.addClass(modal.windowClass);\n }\n\n if (modal.animation) {\n angularDomEl.attr('modal-animation', 'true');\n }\n\n appendToElement.addClass(modalBodyClass);\n if (modal.scope) {\n // we need to explicitly add the modal index to the modal scope\n // because it is needed by ngStyle to compute the zIndex property.\n modal.scope.$$topModalIndex = topModalIndex;\n }\n $animate.enter($compile(angularDomEl)(modal.scope), appendToElement);\n\n openedWindows.top().value.modalDomEl = angularDomEl;\n openedWindows.top().value.modalOpener = modalOpener;\n\n applyAriaHidden(angularDomEl);\n\n function applyAriaHidden(el) {\n if (!el || el[0].tagName === 'BODY') {\n return;\n }\n\n getSiblings(el).forEach(function(sibling) {\n var elemIsAlreadyHidden = sibling.getAttribute('aria-hidden') === 'true',\n ariaHiddenCount = parseInt(sibling.getAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME), 10);\n\n if (!ariaHiddenCount) {\n ariaHiddenCount = elemIsAlreadyHidden ? 1 : 0;\n }\n\n sibling.setAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME, ariaHiddenCount + 1);\n sibling.setAttribute('aria-hidden', 'true');\n });\n\n return applyAriaHidden(el.parent());\n\n function getSiblings(el) {\n var children = el.parent() ? el.parent().children() : [];\n\n return Array.prototype.filter.call(children, function(child) {\n return child !== el[0];\n });\n }\n }\n };\n\n function broadcastClosing(modalWindow, resultOrReason, closing) {\n return !modalWindow.value.modalScope.$broadcast('modal.closing', resultOrReason, closing).defaultPrevented;\n }\n\n function unhideBackgroundElements() {\n Array.prototype.forEach.call(\n document.querySelectorAll('[' + ARIA_HIDDEN_ATTRIBUTE_NAME + ']'),\n function(hiddenEl) {\n var ariaHiddenCount = parseInt(hiddenEl.getAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME), 10),\n newHiddenCount = ariaHiddenCount - 1;\n hiddenEl.setAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME, newHiddenCount);\n\n if (!newHiddenCount) {\n hiddenEl.removeAttribute(ARIA_HIDDEN_ATTRIBUTE_NAME);\n hiddenEl.removeAttribute('aria-hidden');\n }\n }\n );\n }\n\n $modalStack.close = function(modalInstance, result) {\n var modalWindow = openedWindows.get(modalInstance);\n unhideBackgroundElements();\n if (modalWindow && broadcastClosing(modalWindow, result, true)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.resolve(result);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n\n return !modalWindow;\n };\n\n $modalStack.dismiss = function(modalInstance, reason) {\n var modalWindow = openedWindows.get(modalInstance);\n unhideBackgroundElements();\n if (modalWindow && broadcastClosing(modalWindow, reason, false)) {\n modalWindow.value.modalScope.$$uibDestructionScheduled = true;\n modalWindow.value.deferred.reject(reason);\n removeModalWindow(modalInstance, modalWindow.value.modalOpener);\n return true;\n }\n return !modalWindow;\n };\n\n $modalStack.dismissAll = function(reason) {\n var topModal = this.getTop();\n while (topModal && this.dismiss(topModal.key, reason)) {\n topModal = this.getTop();\n }\n };\n\n $modalStack.getTop = function() {\n return openedWindows.top();\n };\n\n $modalStack.modalRendered = function(modalInstance) {\n var modalWindow = openedWindows.get(modalInstance);\n if (modalWindow) {\n modalWindow.value.renderDeferred.resolve();\n }\n };\n\n $modalStack.focusFirstFocusableElement = function(list) {\n if (list.length > 0) {\n list[0].focus();\n return true;\n }\n return false;\n };\n\n $modalStack.focusLastFocusableElement = function(list) {\n if (list.length > 0) {\n list[list.length - 1].focus();\n return true;\n }\n return false;\n };\n\n $modalStack.isModalFocused = function(evt, modalWindow) {\n if (evt && modalWindow) {\n var modalDomEl = modalWindow.value.modalDomEl;\n if (modalDomEl && modalDomEl.length) {\n return (evt.target || evt.srcElement) === modalDomEl[0];\n }\n }\n return false;\n };\n\n $modalStack.isFocusInFirstItem = function(evt, list) {\n if (list.length > 0) {\n return (evt.target || evt.srcElement) === list[0];\n }\n return false;\n };\n\n $modalStack.isFocusInLastItem = function(evt, list) {\n if (list.length > 0) {\n return (evt.target || evt.srcElement) === list[list.length - 1];\n }\n return false;\n };\n\n $modalStack.loadFocusElementList = function(modalWindow) {\n if (modalWindow) {\n var modalDomE1 = modalWindow.value.modalDomEl;\n if (modalDomE1 && modalDomE1.length) {\n var elements = modalDomE1[0].querySelectorAll(tabbableSelector);\n return elements ?\n Array.prototype.filter.call(elements, function(element) {\n return isVisible(element);\n }) : elements;\n }\n }\n };\n\n return $modalStack;\n }])\n\n .provider('$uibModal', function() {\n var $modalProvider = {\n options: {\n animation: true,\n backdrop: true, //can also be false or 'static'\n keyboard: true\n },\n $get: ['$rootScope', '$q', '$document', '$templateRequest', '$controller', '$uibResolve', '$uibModalStack',\n function ($rootScope, $q, $document, $templateRequest, $controller, $uibResolve, $modalStack) {\n var $modal = {};\n\n function getTemplatePromise(options) {\n return options.template ? $q.when(options.template) :\n $templateRequest(angular.isFunction(options.templateUrl) ?\n options.templateUrl() : options.templateUrl);\n }\n\n var promiseChain = null;\n $modal.getPromiseChain = function() {\n return promiseChain;\n };\n\n $modal.open = function(modalOptions) {\n var modalResultDeferred = $q.defer();\n var modalOpenedDeferred = $q.defer();\n var modalClosedDeferred = $q.defer();\n var modalRenderDeferred = $q.defer();\n\n //prepare an instance of a modal to be injected into controllers and returned to a caller\n var modalInstance = {\n result: modalResultDeferred.promise,\n opened: modalOpenedDeferred.promise,\n closed: modalClosedDeferred.promise,\n rendered: modalRenderDeferred.promise,\n close: function (result) {\n return $modalStack.close(modalInstance, result);\n },\n dismiss: function (reason) {\n return $modalStack.dismiss(modalInstance, reason);\n }\n };\n\n //merge and clean up options\n modalOptions = angular.extend({}, $modalProvider.options, modalOptions);\n modalOptions.resolve = modalOptions.resolve || {};\n modalOptions.appendTo = modalOptions.appendTo || $document.find('body').eq(0);\n\n if (!modalOptions.appendTo.length) {\n throw new Error('appendTo element not found. Make sure that the element passed is in DOM.');\n }\n\n //verify options\n if (!modalOptions.component && !modalOptions.template && !modalOptions.templateUrl) {\n throw new Error('One of component or template or templateUrl options is required.');\n }\n\n var templateAndResolvePromise;\n if (modalOptions.component) {\n templateAndResolvePromise = $q.when($uibResolve.resolve(modalOptions.resolve, {}, null, null));\n } else {\n templateAndResolvePromise =\n $q.all([getTemplatePromise(modalOptions), $uibResolve.resolve(modalOptions.resolve, {}, null, null)]);\n }\n\n function resolveWithTemplate() {\n return templateAndResolvePromise;\n }\n\n // Wait for the resolution of the existing promise chain.\n // Then switch to our own combined promise dependency (regardless of how the previous modal fared).\n // Then add to $modalStack and resolve opened.\n // Finally clean up the chain variable if no subsequent modal has overwritten it.\n var samePromise;\n samePromise = promiseChain = $q.all([promiseChain])\n .then(resolveWithTemplate, resolveWithTemplate)\n .then(function resolveSuccess(tplAndVars) {\n var providedScope = modalOptions.scope || $rootScope;\n\n var modalScope = providedScope.$new();\n modalScope.$close = modalInstance.close;\n modalScope.$dismiss = modalInstance.dismiss;\n\n modalScope.$on('$destroy', function() {\n if (!modalScope.$$uibDestructionScheduled) {\n modalScope.$dismiss('$uibUnscheduledDestruction');\n }\n });\n\n var modal = {\n scope: modalScope,\n deferred: modalResultDeferred,\n renderDeferred: modalRenderDeferred,\n closedDeferred: modalClosedDeferred,\n animation: modalOptions.animation,\n backdrop: modalOptions.backdrop,\n keyboard: modalOptions.keyboard,\n backdropClass: modalOptions.backdropClass,\n windowTopClass: modalOptions.windowTopClass,\n windowClass: modalOptions.windowClass,\n windowTemplateUrl: modalOptions.windowTemplateUrl,\n ariaLabelledBy: modalOptions.ariaLabelledBy,\n ariaDescribedBy: modalOptions.ariaDescribedBy,\n size: modalOptions.size,\n openedClass: modalOptions.openedClass,\n appendTo: modalOptions.appendTo\n };\n\n var component = {};\n var ctrlInstance, ctrlInstantiate, ctrlLocals = {};\n\n if (modalOptions.component) {\n constructLocals(component, false, true, false);\n component.name = modalOptions.component;\n modal.component = component;\n } else if (modalOptions.controller) {\n constructLocals(ctrlLocals, true, false, true);\n\n // the third param will make the controller instantiate later,private api\n // @see https://github.com/angular/angular.js/blob/master/src/ng/controller.js#L126\n ctrlInstantiate = $controller(modalOptions.controller, ctrlLocals, true, modalOptions.controllerAs);\n if (modalOptions.controllerAs && modalOptions.bindToController) {\n ctrlInstance = ctrlInstantiate.instance;\n ctrlInstance.$close = modalScope.$close;\n ctrlInstance.$dismiss = modalScope.$dismiss;\n angular.extend(ctrlInstance, {\n $resolve: ctrlLocals.$scope.$resolve\n }, providedScope);\n }\n\n ctrlInstance = ctrlInstantiate();\n\n if (angular.isFunction(ctrlInstance.$onInit)) {\n ctrlInstance.$onInit();\n }\n }\n\n if (!modalOptions.component) {\n modal.content = tplAndVars[0];\n }\n\n $modalStack.open(modalInstance, modal);\n modalOpenedDeferred.resolve(true);\n\n function constructLocals(obj, template, instanceOnScope, injectable) {\n obj.$scope = modalScope;\n obj.$scope.$resolve = {};\n if (instanceOnScope) {\n obj.$scope.$uibModalInstance = modalInstance;\n } else {\n obj.$uibModalInstance = modalInstance;\n }\n\n var resolves = template ? tplAndVars[1] : tplAndVars;\n angular.forEach(resolves, function(value, key) {\n if (injectable) {\n obj[key] = value;\n }\n\n obj.$scope.$resolve[key] = value;\n });\n }\n }, function resolveError(reason) {\n modalOpenedDeferred.reject(reason);\n modalResultDeferred.reject(reason);\n })['finally'](function() {\n if (promiseChain === samePromise) {\n promiseChain = null;\n }\n });\n\n return modalInstance;\n };\n\n return $modal;\n }\n ]\n };\n\n return $modalProvider;\n });\n\nangular.module('ui.bootstrap.paging', [])\n/**\n * Helper internal service for generating common controller code between the\n * pager and pagination components\n */\n.factory('uibPaging', ['$parse', function($parse) {\n return {\n create: function(ctrl, $scope, $attrs) {\n ctrl.setNumPages = $attrs.numPages ? $parse($attrs.numPages).assign : angular.noop;\n ctrl.ngModelCtrl = { $setViewValue: angular.noop }; // nullModelCtrl\n ctrl._watchers = [];\n\n ctrl.init = function(ngModelCtrl, config) {\n ctrl.ngModelCtrl = ngModelCtrl;\n ctrl.config = config;\n\n ngModelCtrl.$render = function() {\n ctrl.render();\n };\n\n if ($attrs.itemsPerPage) {\n ctrl._watchers.push($scope.$parent.$watch($attrs.itemsPerPage, function(value) {\n ctrl.itemsPerPage = parseInt(value, 10);\n $scope.totalPages = ctrl.calculateTotalPages();\n ctrl.updatePage();\n }));\n } else {\n ctrl.itemsPerPage = config.itemsPerPage;\n }\n\n $scope.$watch('totalItems', function(newTotal, oldTotal) {\n if (angular.isDefined(newTotal) || newTotal !== oldTotal) {\n $scope.totalPages = ctrl.calculateTotalPages();\n ctrl.updatePage();\n }\n });\n };\n\n ctrl.calculateTotalPages = function() {\n var totalPages = ctrl.itemsPerPage < 1 ? 1 : Math.ceil($scope.totalItems / ctrl.itemsPerPage);\n return Math.max(totalPages || 0, 1);\n };\n\n ctrl.render = function() {\n $scope.page = parseInt(ctrl.ngModelCtrl.$viewValue, 10) || 1;\n };\n\n $scope.selectPage = function(page, evt) {\n if (evt) {\n evt.preventDefault();\n }\n\n var clickAllowed = !$scope.ngDisabled || !evt;\n if (clickAllowed && $scope.page !== page && page > 0 && page <= $scope.totalPages) {\n if (evt && evt.target) {\n evt.target.blur();\n }\n ctrl.ngModelCtrl.$setViewValue(page);\n ctrl.ngModelCtrl.$render();\n }\n };\n\n $scope.getText = function(key) {\n return $scope[key + 'Text'] || ctrl.config[key + 'Text'];\n };\n\n $scope.noPrevious = function() {\n return $scope.page === 1;\n };\n\n $scope.noNext = function() {\n return $scope.page === $scope.totalPages;\n };\n\n ctrl.updatePage = function() {\n ctrl.setNumPages($scope.$parent, $scope.totalPages); // Readonly variable\n\n if ($scope.page > $scope.totalPages) {\n $scope.selectPage($scope.totalPages);\n } else {\n ctrl.ngModelCtrl.$render();\n }\n };\n\n $scope.$on('$destroy', function() {\n while (ctrl._watchers.length) {\n ctrl._watchers.shift()();\n }\n });\n }\n };\n}]);\n\nangular.module('ui.bootstrap.pager', ['ui.bootstrap.paging', 'ui.bootstrap.tabindex'])\n\n.controller('UibPagerController', ['$scope', '$attrs', 'uibPaging', 'uibPagerConfig', function($scope, $attrs, uibPaging, uibPagerConfig) {\n $scope.align = angular.isDefined($attrs.align) ? $scope.$parent.$eval($attrs.align) : uibPagerConfig.align;\n\n uibPaging.create(this, $scope, $attrs);\n}])\n\n.constant('uibPagerConfig', {\n itemsPerPage: 10,\n previousText: '« Previous',\n nextText: 'Next »',\n align: true\n})\n\n.directive('uibPager', ['uibPagerConfig', function(uibPagerConfig) {\n return {\n scope: {\n totalItems: '=',\n previousText: '@',\n nextText: '@',\n ngDisabled: '='\n },\n require: ['uibPager', '?ngModel'],\n restrict: 'A',\n controller: 'UibPagerController',\n controllerAs: 'pager',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/pager/pager.html';\n },\n link: function(scope, element, attrs, ctrls) {\n element.addClass('pager');\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n paginationCtrl.init(ngModelCtrl, uibPagerConfig);\n }\n };\n}]);\n\nangular.module('ui.bootstrap.pagination', ['ui.bootstrap.paging', 'ui.bootstrap.tabindex'])\n.controller('UibPaginationController', ['$scope', '$attrs', '$parse', 'uibPaging', 'uibPaginationConfig', function($scope, $attrs, $parse, uibPaging, uibPaginationConfig) {\n var ctrl = this;\n // Setup configuration parameters\n var maxSize = angular.isDefined($attrs.maxSize) ? $scope.$parent.$eval($attrs.maxSize) : uibPaginationConfig.maxSize,\n rotate = angular.isDefined($attrs.rotate) ? $scope.$parent.$eval($attrs.rotate) : uibPaginationConfig.rotate,\n forceEllipses = angular.isDefined($attrs.forceEllipses) ? $scope.$parent.$eval($attrs.forceEllipses) : uibPaginationConfig.forceEllipses,\n boundaryLinkNumbers = angular.isDefined($attrs.boundaryLinkNumbers) ? $scope.$parent.$eval($attrs.boundaryLinkNumbers) : uibPaginationConfig.boundaryLinkNumbers,\n pageLabel = angular.isDefined($attrs.pageLabel) ? function(idx) { return $scope.$parent.$eval($attrs.pageLabel, {$page: idx}); } : angular.identity;\n $scope.boundaryLinks = angular.isDefined($attrs.boundaryLinks) ? $scope.$parent.$eval($attrs.boundaryLinks) : uibPaginationConfig.boundaryLinks;\n $scope.directionLinks = angular.isDefined($attrs.directionLinks) ? $scope.$parent.$eval($attrs.directionLinks) : uibPaginationConfig.directionLinks;\n $attrs.$set('role', 'menu');\n\n uibPaging.create(this, $scope, $attrs);\n\n if ($attrs.maxSize) {\n ctrl._watchers.push($scope.$parent.$watch($parse($attrs.maxSize), function(value) {\n maxSize = parseInt(value, 10);\n ctrl.render();\n }));\n }\n\n // Create page object used in template\n function makePage(number, text, isActive) {\n return {\n number: number,\n text: text,\n active: isActive\n };\n }\n\n function getPages(currentPage, totalPages) {\n var pages = [];\n\n // Default page limits\n var startPage = 1, endPage = totalPages;\n var isMaxSized = angular.isDefined(maxSize) && maxSize < totalPages;\n\n // recompute if maxSize\n if (isMaxSized) {\n if (rotate) {\n // Current page is displayed in the middle of the visible ones\n startPage = Math.max(currentPage - Math.floor(maxSize / 2), 1);\n endPage = startPage + maxSize - 1;\n\n // Adjust if limit is exceeded\n if (endPage > totalPages) {\n endPage = totalPages;\n startPage = endPage - maxSize + 1;\n }\n } else {\n // Visible pages are paginated with maxSize\n startPage = (Math.ceil(currentPage / maxSize) - 1) * maxSize + 1;\n\n // Adjust last page if limit is exceeded\n endPage = Math.min(startPage + maxSize - 1, totalPages);\n }\n }\n\n // Add page number links\n for (var number = startPage; number <= endPage; number++) {\n var page = makePage(number, pageLabel(number), number === currentPage);\n pages.push(page);\n }\n\n // Add links to move between page sets\n if (isMaxSized && maxSize > 0 && (!rotate || forceEllipses || boundaryLinkNumbers)) {\n if (startPage > 1) {\n if (!boundaryLinkNumbers || startPage > 3) { //need ellipsis for all options unless range is too close to beginning\n var previousPageSet = makePage(startPage - 1, '...', false);\n pages.unshift(previousPageSet);\n }\n if (boundaryLinkNumbers) {\n if (startPage === 3) { //need to replace ellipsis when the buttons would be sequential\n var secondPageLink = makePage(2, '2', false);\n pages.unshift(secondPageLink);\n }\n //add the first page\n var firstPageLink = makePage(1, '1', false);\n pages.unshift(firstPageLink);\n }\n }\n\n if (endPage < totalPages) {\n if (!boundaryLinkNumbers || endPage < totalPages - 2) { //need ellipsis for all options unless range is too close to end\n var nextPageSet = makePage(endPage + 1, '...', false);\n pages.push(nextPageSet);\n }\n if (boundaryLinkNumbers) {\n if (endPage === totalPages - 2) { //need to replace ellipsis when the buttons would be sequential\n var secondToLastPageLink = makePage(totalPages - 1, totalPages - 1, false);\n pages.push(secondToLastPageLink);\n }\n //add the last page\n var lastPageLink = makePage(totalPages, totalPages, false);\n pages.push(lastPageLink);\n }\n }\n }\n return pages;\n }\n\n var originalRender = this.render;\n this.render = function() {\n originalRender();\n if ($scope.page > 0 && $scope.page <= $scope.totalPages) {\n $scope.pages = getPages($scope.page, $scope.totalPages);\n }\n };\n}])\n\n.constant('uibPaginationConfig', {\n itemsPerPage: 10,\n boundaryLinks: false,\n boundaryLinkNumbers: false,\n directionLinks: true,\n firstText: 'First',\n previousText: 'Previous',\n nextText: 'Next',\n lastText: 'Last',\n rotate: true,\n forceEllipses: false\n})\n\n.directive('uibPagination', ['$parse', 'uibPaginationConfig', function($parse, uibPaginationConfig) {\n return {\n scope: {\n totalItems: '=',\n firstText: '@',\n previousText: '@',\n nextText: '@',\n lastText: '@',\n ngDisabled:'='\n },\n require: ['uibPagination', '?ngModel'],\n restrict: 'A',\n controller: 'UibPaginationController',\n controllerAs: 'pagination',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/pagination/pagination.html';\n },\n link: function(scope, element, attrs, ctrls) {\n element.addClass('pagination');\n var paginationCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (!ngModelCtrl) {\n return; // do nothing if no ng-model\n }\n\n paginationCtrl.init(ngModelCtrl, uibPaginationConfig);\n }\n };\n}]);\n\n/**\n * The following features are still outstanding: animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, html tooltips, and selector delegation.\n */\nangular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.stackedMap'])\n\n/**\n * The $tooltip service creates tooltip- and popover-like directives as well as\n * houses global options for them.\n */\n.provider('$uibTooltip', function() {\n // The default options tooltip and popover.\n var defaultOptions = {\n placement: 'top',\n placementClassPrefix: '',\n animation: true,\n popupDelay: 0,\n popupCloseDelay: 0,\n useContentExp: false\n };\n\n // Default hide triggers for each show trigger\n var triggerMap = {\n 'mouseenter': 'mouseleave',\n 'click': 'click',\n 'outsideClick': 'outsideClick',\n 'focus': 'blur',\n 'none': ''\n };\n\n // The options specified to the provider globally.\n var globalOptions = {};\n\n /**\n * `options({})` allows global configuration of all tooltips in the\n * application.\n *\n * var app = angular.module( 'App', ['ui.bootstrap.tooltip'], function( $tooltipProvider ) {\n * // place tooltips left instead of top by default\n * $tooltipProvider.options( { placement: 'left' } );\n * });\n */\n\tthis.options = function(value) {\n\t\tangular.extend(globalOptions, value);\n\t};\n\n /**\n * This allows you to extend the set of trigger mappings available. E.g.:\n *\n * $tooltipProvider.setTriggers( { 'openTrigger': 'closeTrigger' } );\n */\n this.setTriggers = function setTriggers(triggers) {\n angular.extend(triggerMap, triggers);\n };\n\n /**\n * This is a helper function for translating camel-case to snake_case.\n */\n function snake_case(name) {\n var regexp = /[A-Z]/g;\n var separator = '-';\n return name.replace(regexp, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n }\n\n /**\n * Returns the actual instance of the $tooltip service.\n * TODO support multiple triggers\n */\n this.$get = ['$window', '$compile', '$timeout', '$document', '$uibPosition', '$interpolate', '$rootScope', '$parse', '$$stackedMap', function($window, $compile, $timeout, $document, $position, $interpolate, $rootScope, $parse, $$stackedMap) {\n var openedTooltips = $$stackedMap.createNew();\n $document.on('keyup', keypressListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('keyup', keypressListener);\n });\n\n function keypressListener(e) {\n if (e.which === 27) {\n var last = openedTooltips.top();\n if (last) {\n last.value.close();\n last = null;\n }\n }\n }\n\n return function $tooltip(ttType, prefix, defaultTriggerShow, options) {\n options = angular.extend({}, defaultOptions, globalOptions, options);\n\n /**\n * Returns an object of show and hide triggers.\n *\n * If a trigger is supplied,\n * it is used to show the tooltip; otherwise, it will use the `trigger`\n * option passed to the `$tooltipProvider.options` method; else it will\n * default to the trigger supplied to this directive factory.\n *\n * The hide trigger is based on the show trigger. If the `trigger` option\n * was passed to the `$tooltipProvider.options` method, it will use the\n * mapped trigger from `triggerMap` or the passed trigger if the map is\n * undefined; otherwise, it uses the `triggerMap` value of the show\n * trigger; else it will just use the show trigger.\n */\n function getTriggers(trigger) {\n var show = (trigger || options.trigger || defaultTriggerShow).split(' ');\n var hide = show.map(function(trigger) {\n return triggerMap[trigger] || trigger;\n });\n return {\n show: show,\n hide: hide\n };\n }\n\n var directiveName = snake_case(ttType);\n\n var startSym = $interpolate.startSymbol();\n var endSym = $interpolate.endSymbol();\n var template =\n '
    ' +\n '
    ';\n\n return {\n compile: function(tElem, tAttrs) {\n var tooltipLinker = $compile(template);\n\n return function link(scope, element, attrs, tooltipCtrl) {\n var tooltip;\n var tooltipLinkedScope;\n var transitionTimeout;\n var showTimeout;\n var hideTimeout;\n var positionTimeout;\n var adjustmentTimeout;\n var appendToBody = angular.isDefined(options.appendToBody) ? options.appendToBody : false;\n var triggers = getTriggers(undefined);\n var hasEnableExp = angular.isDefined(attrs[prefix + 'Enable']);\n var ttScope = scope.$new(true);\n var repositionScheduled = false;\n var isOpenParse = angular.isDefined(attrs[prefix + 'IsOpen']) ? $parse(attrs[prefix + 'IsOpen']) : false;\n var contentParse = options.useContentExp ? $parse(attrs[ttType]) : false;\n var observers = [];\n var lastPlacement;\n\n var positionTooltip = function() {\n // check if tooltip exists and is not empty\n if (!tooltip || !tooltip.html()) { return; }\n\n if (!positionTimeout) {\n positionTimeout = $timeout(function() {\n var ttPosition = $position.positionElements(element, tooltip, ttScope.placement, appendToBody);\n var initialHeight = angular.isDefined(tooltip.offsetHeight) ? tooltip.offsetHeight : tooltip.prop('offsetHeight');\n var elementPos = appendToBody ? $position.offset(element) : $position.position(element);\n tooltip.css({ top: ttPosition.top + 'px', left: ttPosition.left + 'px' });\n var placementClasses = ttPosition.placement.split('-');\n\n if (!tooltip.hasClass(placementClasses[0])) {\n tooltip.removeClass(lastPlacement.split('-')[0]);\n tooltip.addClass(placementClasses[0]);\n }\n\n if (!tooltip.hasClass(options.placementClassPrefix + ttPosition.placement)) {\n tooltip.removeClass(options.placementClassPrefix + lastPlacement);\n tooltip.addClass(options.placementClassPrefix + ttPosition.placement);\n }\n\n adjustmentTimeout = $timeout(function() {\n var currentHeight = angular.isDefined(tooltip.offsetHeight) ? tooltip.offsetHeight : tooltip.prop('offsetHeight');\n var adjustment = $position.adjustTop(placementClasses, elementPos, initialHeight, currentHeight);\n if (adjustment) {\n tooltip.css(adjustment);\n }\n adjustmentTimeout = null;\n }, 0, false);\n\n // first time through tt element will have the\n // uib-position-measure class or if the placement\n // has changed we need to position the arrow.\n if (tooltip.hasClass('uib-position-measure')) {\n $position.positionArrow(tooltip, ttPosition.placement);\n tooltip.removeClass('uib-position-measure');\n } else if (lastPlacement !== ttPosition.placement) {\n $position.positionArrow(tooltip, ttPosition.placement);\n }\n lastPlacement = ttPosition.placement;\n\n positionTimeout = null;\n }, 0, false);\n }\n };\n\n // Set up the correct scope to allow transclusion later\n ttScope.origScope = scope;\n\n // By default, the tooltip is not open.\n // TODO add ability to start tooltip opened\n ttScope.isOpen = false;\n\n function toggleTooltipBind() {\n if (!ttScope.isOpen) {\n showTooltipBind();\n } else {\n hideTooltipBind();\n }\n }\n\n // Show the tooltip with delay if specified, otherwise show it immediately\n function showTooltipBind() {\n if (hasEnableExp && !scope.$eval(attrs[prefix + 'Enable'])) {\n return;\n }\n\n cancelHide();\n prepareTooltip();\n\n if (ttScope.popupDelay) {\n // Do nothing if the tooltip was already scheduled to pop-up.\n // This happens if show is triggered multiple times before any hide is triggered.\n if (!showTimeout) {\n showTimeout = $timeout(show, ttScope.popupDelay, false);\n }\n } else {\n show();\n }\n }\n\n function hideTooltipBind() {\n cancelShow();\n\n if (ttScope.popupCloseDelay) {\n if (!hideTimeout) {\n hideTimeout = $timeout(hide, ttScope.popupCloseDelay, false);\n }\n } else {\n hide();\n }\n }\n\n // Show the tooltip popup element.\n function show() {\n cancelShow();\n cancelHide();\n\n // Don't show empty tooltips.\n if (!ttScope.content) {\n return angular.noop;\n }\n\n createTooltip();\n\n // And show the tooltip.\n ttScope.$evalAsync(function() {\n ttScope.isOpen = true;\n assignIsOpen(true);\n positionTooltip();\n });\n }\n\n function cancelShow() {\n if (showTimeout) {\n $timeout.cancel(showTimeout);\n showTimeout = null;\n }\n\n if (positionTimeout) {\n $timeout.cancel(positionTimeout);\n positionTimeout = null;\n }\n }\n\n // Hide the tooltip popup element.\n function hide() {\n if (!ttScope) {\n return;\n }\n\n // First things first: we don't show it anymore.\n ttScope.$evalAsync(function() {\n if (ttScope) {\n ttScope.isOpen = false;\n assignIsOpen(false);\n // And now we remove it from the DOM. However, if we have animation, we\n // need to wait for it to expire beforehand.\n // FIXME: this is a placeholder for a port of the transitions library.\n // The fade transition in TWBS is 150ms.\n if (ttScope.animation) {\n if (!transitionTimeout) {\n transitionTimeout = $timeout(removeTooltip, 150, false);\n }\n } else {\n removeTooltip();\n }\n }\n });\n }\n\n function cancelHide() {\n if (hideTimeout) {\n $timeout.cancel(hideTimeout);\n hideTimeout = null;\n }\n\n if (transitionTimeout) {\n $timeout.cancel(transitionTimeout);\n transitionTimeout = null;\n }\n }\n\n function createTooltip() {\n // There can only be one tooltip element per directive shown at once.\n if (tooltip) {\n return;\n }\n\n tooltipLinkedScope = ttScope.$new();\n tooltip = tooltipLinker(tooltipLinkedScope, function(tooltip) {\n if (appendToBody) {\n $document.find('body').append(tooltip);\n } else {\n element.after(tooltip);\n }\n });\n\n openedTooltips.add(ttScope, {\n close: hide\n });\n\n prepObservers();\n }\n\n function removeTooltip() {\n cancelShow();\n cancelHide();\n unregisterObservers();\n\n if (tooltip) {\n tooltip.remove();\n \n tooltip = null;\n if (adjustmentTimeout) {\n $timeout.cancel(adjustmentTimeout);\n }\n }\n\n openedTooltips.remove(ttScope);\n \n if (tooltipLinkedScope) {\n tooltipLinkedScope.$destroy();\n tooltipLinkedScope = null;\n }\n }\n\n /**\n * Set the initial scope values. Once\n * the tooltip is created, the observers\n * will be added to keep things in sync.\n */\n function prepareTooltip() {\n ttScope.title = attrs[prefix + 'Title'];\n if (contentParse) {\n ttScope.content = contentParse(scope);\n } else {\n ttScope.content = attrs[ttType];\n }\n\n ttScope.popupClass = attrs[prefix + 'Class'];\n ttScope.placement = angular.isDefined(attrs[prefix + 'Placement']) ? attrs[prefix + 'Placement'] : options.placement;\n var placement = $position.parsePlacement(ttScope.placement);\n lastPlacement = placement[1] ? placement[0] + '-' + placement[1] : placement[0];\n\n var delay = parseInt(attrs[prefix + 'PopupDelay'], 10);\n var closeDelay = parseInt(attrs[prefix + 'PopupCloseDelay'], 10);\n ttScope.popupDelay = !isNaN(delay) ? delay : options.popupDelay;\n ttScope.popupCloseDelay = !isNaN(closeDelay) ? closeDelay : options.popupCloseDelay;\n }\n\n function assignIsOpen(isOpen) {\n if (isOpenParse && angular.isFunction(isOpenParse.assign)) {\n isOpenParse.assign(scope, isOpen);\n }\n }\n\n ttScope.contentExp = function() {\n return ttScope.content;\n };\n\n /**\n * Observe the relevant attributes.\n */\n attrs.$observe('disabled', function(val) {\n if (val) {\n cancelShow();\n }\n\n if (val && ttScope.isOpen) {\n hide();\n }\n });\n\n if (isOpenParse) {\n scope.$watch(isOpenParse, function(val) {\n if (ttScope && !val === ttScope.isOpen) {\n toggleTooltipBind();\n }\n });\n }\n\n function prepObservers() {\n observers.length = 0;\n\n if (contentParse) {\n observers.push(\n scope.$watch(contentParse, function(val) {\n ttScope.content = val;\n if (!val && ttScope.isOpen) {\n hide();\n }\n })\n );\n\n observers.push(\n tooltipLinkedScope.$watch(function() {\n if (!repositionScheduled) {\n repositionScheduled = true;\n tooltipLinkedScope.$$postDigest(function() {\n repositionScheduled = false;\n if (ttScope && ttScope.isOpen) {\n positionTooltip();\n }\n });\n }\n })\n );\n } else {\n observers.push(\n attrs.$observe(ttType, function(val) {\n ttScope.content = val;\n if (!val && ttScope.isOpen) {\n hide();\n } else {\n positionTooltip();\n }\n })\n );\n }\n\n observers.push(\n attrs.$observe(prefix + 'Title', function(val) {\n ttScope.title = val;\n if (ttScope.isOpen) {\n positionTooltip();\n }\n })\n );\n\n observers.push(\n attrs.$observe(prefix + 'Placement', function(val) {\n ttScope.placement = val ? val : options.placement;\n if (ttScope.isOpen) {\n positionTooltip();\n }\n })\n );\n }\n\n function unregisterObservers() {\n if (observers.length) {\n angular.forEach(observers, function(observer) {\n observer();\n });\n observers.length = 0;\n }\n }\n\n // hide tooltips/popovers for outsideClick trigger\n function bodyHideTooltipBind(e) {\n if (!ttScope || !ttScope.isOpen || !tooltip) {\n return;\n }\n // make sure the tooltip/popover link or tool tooltip/popover itself were not clicked\n if (!element[0].contains(e.target) && !tooltip[0].contains(e.target)) {\n hideTooltipBind();\n }\n }\n\n // KeyboardEvent handler to hide the tooltip on Escape key press\n function hideOnEscapeKey(e) {\n if (e.which === 27) {\n hideTooltipBind();\n }\n }\n\n var unregisterTriggers = function() {\n triggers.show.forEach(function(trigger) {\n if (trigger === 'outsideClick') {\n element.off('click', toggleTooltipBind);\n } else {\n element.off(trigger, showTooltipBind);\n element.off(trigger, toggleTooltipBind);\n }\n element.off('keypress', hideOnEscapeKey);\n });\n triggers.hide.forEach(function(trigger) {\n if (trigger === 'outsideClick') {\n $document.off('click', bodyHideTooltipBind);\n } else {\n element.off(trigger, hideTooltipBind);\n }\n });\n };\n\n function prepTriggers() {\n var showTriggers = [], hideTriggers = [];\n var val = scope.$eval(attrs[prefix + 'Trigger']);\n unregisterTriggers();\n\n if (angular.isObject(val)) {\n Object.keys(val).forEach(function(key) {\n showTriggers.push(key);\n hideTriggers.push(val[key]);\n });\n triggers = {\n show: showTriggers,\n hide: hideTriggers\n };\n } else {\n triggers = getTriggers(val);\n }\n\n if (triggers.show !== 'none') {\n triggers.show.forEach(function(trigger, idx) {\n if (trigger === 'outsideClick') {\n element.on('click', toggleTooltipBind);\n $document.on('click', bodyHideTooltipBind);\n } else if (trigger === triggers.hide[idx]) {\n element.on(trigger, toggleTooltipBind);\n } else if (trigger) {\n element.on(trigger, showTooltipBind);\n element.on(triggers.hide[idx], hideTooltipBind);\n }\n element.on('keypress', hideOnEscapeKey);\n });\n }\n }\n\n prepTriggers();\n\n var animation = scope.$eval(attrs[prefix + 'Animation']);\n ttScope.animation = angular.isDefined(animation) ? !!animation : options.animation;\n\n var appendToBodyVal;\n var appendKey = prefix + 'AppendToBody';\n if (appendKey in attrs && attrs[appendKey] === undefined) {\n appendToBodyVal = true;\n } else {\n appendToBodyVal = scope.$eval(attrs[appendKey]);\n }\n\n appendToBody = angular.isDefined(appendToBodyVal) ? appendToBodyVal : appendToBody;\n\n // Make sure tooltip is destroyed and removed.\n scope.$on('$destroy', function onDestroyTooltip() {\n unregisterTriggers();\n removeTooltip();\n ttScope = null;\n });\n };\n }\n };\n };\n }];\n})\n\n// This is mostly ngInclude code but with a custom scope\n.directive('uibTooltipTemplateTransclude', [\n '$animate', '$sce', '$compile', '$templateRequest',\nfunction ($animate, $sce, $compile, $templateRequest) {\n return {\n link: function(scope, elem, attrs) {\n var origScope = scope.$eval(attrs.tooltipTemplateTranscludeScope);\n\n var changeCounter = 0,\n currentScope,\n previousElement,\n currentElement;\n\n var cleanupLastIncludeContent = function() {\n if (previousElement) {\n previousElement.remove();\n previousElement = null;\n }\n\n if (currentScope) {\n currentScope.$destroy();\n currentScope = null;\n }\n\n if (currentElement) {\n $animate.leave(currentElement).then(function() {\n previousElement = null;\n });\n previousElement = currentElement;\n currentElement = null;\n }\n };\n\n scope.$watch($sce.parseAsResourceUrl(attrs.uibTooltipTemplateTransclude), function(src) {\n var thisChangeId = ++changeCounter;\n\n if (src) {\n //set the 2nd param to true to ignore the template request error so that the inner\n //contents and scope can be cleaned up.\n $templateRequest(src, true).then(function(response) {\n if (thisChangeId !== changeCounter) { return; }\n var newScope = origScope.$new();\n var template = response;\n\n var clone = $compile(template)(newScope, function(clone) {\n cleanupLastIncludeContent();\n $animate.enter(clone, elem);\n });\n\n currentScope = newScope;\n currentElement = clone;\n\n currentScope.$emit('$includeContentLoaded', src);\n }, function() {\n if (thisChangeId === changeCounter) {\n cleanupLastIncludeContent();\n scope.$emit('$includeContentError', src);\n }\n });\n scope.$emit('$includeContentRequested', src);\n } else {\n cleanupLastIncludeContent();\n }\n });\n\n scope.$on('$destroy', cleanupLastIncludeContent);\n }\n };\n}])\n\n/**\n * Note that it's intentional that these classes are *not* applied through $animate.\n * They must not be animated as they're expected to be present on the tooltip on\n * initialization.\n */\n.directive('uibTooltipClasses', ['$uibPosition', function($uibPosition) {\n return {\n restrict: 'A',\n link: function(scope, element, attrs) {\n // need to set the primary position so the\n // arrow has space during position measure.\n // tooltip.positionTooltip()\n if (scope.placement) {\n // // There are no top-left etc... classes\n // // in TWBS, so we need the primary position.\n var position = $uibPosition.parsePlacement(scope.placement);\n element.addClass(position[0]);\n }\n\n if (scope.popupClass) {\n element.addClass(scope.popupClass);\n }\n\n if (scope.animation) {\n element.addClass(attrs.tooltipAnimationClass);\n }\n }\n };\n}])\n\n.directive('uibTooltipPopup', function() {\n return {\n restrict: 'A',\n scope: { content: '@' },\n templateUrl: 'uib/template/tooltip/tooltip-popup.html'\n };\n})\n\n.directive('uibTooltip', [ '$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltip', 'tooltip', 'mouseenter');\n}])\n\n.directive('uibTooltipTemplatePopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&', originScope: '&' },\n templateUrl: 'uib/template/tooltip/tooltip-template-popup.html'\n };\n})\n\n.directive('uibTooltipTemplate', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltipTemplate', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}])\n\n.directive('uibTooltipHtmlPopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&' },\n templateUrl: 'uib/template/tooltip/tooltip-html-popup.html'\n };\n})\n\n.directive('uibTooltipHtml', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibTooltipHtml', 'tooltip', 'mouseenter', {\n useContentExp: true\n });\n}]);\n\n/**\n * The following features are still outstanding: popup delay, animation as a\n * function, placement as a function, inside, support for more triggers than\n * just mouse enter/leave, and selector delegatation.\n */\nangular.module('ui.bootstrap.popover', ['ui.bootstrap.tooltip'])\n\n.directive('uibPopoverTemplatePopup', function() {\n return {\n restrict: 'A',\n scope: { uibTitle: '@', contentExp: '&', originScope: '&' },\n templateUrl: 'uib/template/popover/popover-template.html'\n };\n})\n\n.directive('uibPopoverTemplate', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopoverTemplate', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('uibPopoverHtmlPopup', function() {\n return {\n restrict: 'A',\n scope: { contentExp: '&', uibTitle: '@' },\n templateUrl: 'uib/template/popover/popover-html.html'\n };\n})\n\n.directive('uibPopoverHtml', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopoverHtml', 'popover', 'click', {\n useContentExp: true\n });\n}])\n\n.directive('uibPopoverPopup', function() {\n return {\n restrict: 'A',\n scope: { uibTitle: '@', content: '@' },\n templateUrl: 'uib/template/popover/popover.html'\n };\n})\n\n.directive('uibPopover', ['$uibTooltip', function($uibTooltip) {\n return $uibTooltip('uibPopover', 'popover', 'click');\n}]);\n\nangular.module('ui.bootstrap.progressbar', [])\n\n.constant('uibProgressConfig', {\n animate: true,\n max: 100\n})\n\n.controller('UibProgressController', ['$scope', '$attrs', 'uibProgressConfig', function($scope, $attrs, progressConfig) {\n var self = this,\n animate = angular.isDefined($attrs.animate) ? $scope.$parent.$eval($attrs.animate) : progressConfig.animate;\n\n this.bars = [];\n $scope.max = getMaxOrDefault();\n\n this.addBar = function(bar, element, attrs) {\n if (!animate) {\n element.css({'transition': 'none'});\n }\n\n this.bars.push(bar);\n\n bar.max = getMaxOrDefault();\n bar.title = attrs && angular.isDefined(attrs.title) ? attrs.title : 'progressbar';\n\n bar.$watch('value', function(value) {\n bar.recalculatePercentage();\n });\n\n bar.recalculatePercentage = function() {\n var totalPercentage = self.bars.reduce(function(total, bar) {\n bar.percent = +(100 * bar.value / bar.max).toFixed(2);\n return total + bar.percent;\n }, 0);\n\n if (totalPercentage > 100) {\n bar.percent -= totalPercentage - 100;\n }\n };\n\n bar.$on('$destroy', function() {\n element = null;\n self.removeBar(bar);\n });\n };\n\n this.removeBar = function(bar) {\n this.bars.splice(this.bars.indexOf(bar), 1);\n this.bars.forEach(function (bar) {\n bar.recalculatePercentage();\n });\n };\n\n //$attrs.$observe('maxParam', function(maxParam) {\n $scope.$watch('maxParam', function(maxParam) {\n self.bars.forEach(function(bar) {\n bar.max = getMaxOrDefault();\n bar.recalculatePercentage();\n });\n });\n\n function getMaxOrDefault () {\n return angular.isDefined($scope.maxParam) ? $scope.maxParam : progressConfig.max;\n }\n}])\n\n.directive('uibProgress', function() {\n return {\n replace: true,\n transclude: true,\n controller: 'UibProgressController',\n require: 'uibProgress',\n scope: {\n maxParam: '=?max'\n },\n templateUrl: 'uib/template/progressbar/progress.html'\n };\n})\n\n.directive('uibBar', function() {\n return {\n replace: true,\n transclude: true,\n require: '^uibProgress',\n scope: {\n value: '=',\n type: '@'\n },\n templateUrl: 'uib/template/progressbar/bar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, element, attrs);\n }\n };\n})\n\n.directive('uibProgressbar', function() {\n return {\n replace: true,\n transclude: true,\n controller: 'UibProgressController',\n scope: {\n value: '=',\n maxParam: '=?max',\n type: '@'\n },\n templateUrl: 'uib/template/progressbar/progressbar.html',\n link: function(scope, element, attrs, progressCtrl) {\n progressCtrl.addBar(scope, angular.element(element.children()[0]), {title: attrs.title});\n }\n };\n});\n\nangular.module('ui.bootstrap.rating', [])\n\n.constant('uibRatingConfig', {\n max: 5,\n stateOn: null,\n stateOff: null,\n enableReset: true,\n titles: ['one', 'two', 'three', 'four', 'five']\n})\n\n.controller('UibRatingController', ['$scope', '$attrs', 'uibRatingConfig', function($scope, $attrs, ratingConfig) {\n var ngModelCtrl = { $setViewValue: angular.noop },\n self = this;\n\n this.init = function(ngModelCtrl_) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.push(function(value) {\n if (angular.isNumber(value) && value << 0 !== value) {\n value = Math.round(value);\n }\n\n return value;\n });\n\n this.stateOn = angular.isDefined($attrs.stateOn) ? $scope.$parent.$eval($attrs.stateOn) : ratingConfig.stateOn;\n this.stateOff = angular.isDefined($attrs.stateOff) ? $scope.$parent.$eval($attrs.stateOff) : ratingConfig.stateOff;\n this.enableReset = angular.isDefined($attrs.enableReset) ?\n $scope.$parent.$eval($attrs.enableReset) : ratingConfig.enableReset;\n var tmpTitles = angular.isDefined($attrs.titles) ? $scope.$parent.$eval($attrs.titles) : ratingConfig.titles;\n this.titles = angular.isArray(tmpTitles) && tmpTitles.length > 0 ?\n tmpTitles : ratingConfig.titles;\n\n var ratingStates = angular.isDefined($attrs.ratingStates) ?\n $scope.$parent.$eval($attrs.ratingStates) :\n new Array(angular.isDefined($attrs.max) ? $scope.$parent.$eval($attrs.max) : ratingConfig.max);\n $scope.range = this.buildTemplateObjects(ratingStates);\n };\n\n this.buildTemplateObjects = function(states) {\n for (var i = 0, n = states.length; i < n; i++) {\n states[i] = angular.extend({ index: i }, { stateOn: this.stateOn, stateOff: this.stateOff, title: this.getTitle(i) }, states[i]);\n }\n return states;\n };\n\n this.getTitle = function(index) {\n if (index >= this.titles.length) {\n return index + 1;\n }\n\n return this.titles[index];\n };\n\n $scope.rate = function(value) {\n if (!$scope.readonly && value >= 0 && value <= $scope.range.length) {\n var newViewValue = self.enableReset && ngModelCtrl.$viewValue === value ? 0 : value;\n ngModelCtrl.$setViewValue(newViewValue);\n ngModelCtrl.$render();\n }\n };\n\n $scope.enter = function(value) {\n if (!$scope.readonly) {\n $scope.value = value;\n }\n $scope.onHover({value: value});\n };\n\n $scope.reset = function() {\n $scope.value = ngModelCtrl.$viewValue;\n $scope.onLeave();\n };\n\n $scope.onKeydown = function(evt) {\n if (/(37|38|39|40)/.test(evt.which)) {\n evt.preventDefault();\n evt.stopPropagation();\n $scope.rate($scope.value + (evt.which === 38 || evt.which === 39 ? 1 : -1));\n }\n };\n\n this.render = function() {\n $scope.value = ngModelCtrl.$viewValue;\n $scope.title = self.getTitle($scope.value - 1);\n };\n}])\n\n.directive('uibRating', function() {\n return {\n require: ['uibRating', 'ngModel'],\n restrict: 'A',\n scope: {\n readonly: '=?readOnly',\n onHover: '&',\n onLeave: '&'\n },\n controller: 'UibRatingController',\n templateUrl: 'uib/template/rating/rating.html',\n link: function(scope, element, attrs, ctrls) {\n var ratingCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n ratingCtrl.init(ngModelCtrl);\n }\n };\n});\n\nangular.module('ui.bootstrap.tabs', [])\n\n.controller('UibTabsetController', ['$scope', function ($scope) {\n var ctrl = this,\n oldIndex;\n ctrl.tabs = [];\n\n ctrl.select = function(index, evt) {\n if (!destroyed) {\n var previousIndex = findTabIndex(oldIndex);\n var previousSelected = ctrl.tabs[previousIndex];\n if (previousSelected) {\n previousSelected.tab.onDeselect({\n $event: evt,\n $selectedIndex: index\n });\n if (evt && evt.isDefaultPrevented()) {\n return;\n }\n previousSelected.tab.active = false;\n }\n\n var selected = ctrl.tabs[index];\n if (selected) {\n selected.tab.onSelect({\n $event: evt\n });\n selected.tab.active = true;\n ctrl.active = selected.index;\n oldIndex = selected.index;\n } else if (!selected && angular.isDefined(oldIndex)) {\n ctrl.active = null;\n oldIndex = null;\n }\n }\n };\n\n ctrl.addTab = function addTab(tab) {\n ctrl.tabs.push({\n tab: tab,\n index: tab.index\n });\n ctrl.tabs.sort(function(t1, t2) {\n if (t1.index > t2.index) {\n return 1;\n }\n\n if (t1.index < t2.index) {\n return -1;\n }\n\n return 0;\n });\n\n if (tab.index === ctrl.active || !angular.isDefined(ctrl.active) && ctrl.tabs.length === 1) {\n var newActiveIndex = findTabIndex(tab.index);\n ctrl.select(newActiveIndex);\n }\n };\n\n ctrl.removeTab = function removeTab(tab) {\n var index;\n for (var i = 0; i < ctrl.tabs.length; i++) {\n if (ctrl.tabs[i].tab === tab) {\n index = i;\n break;\n }\n }\n\n if (ctrl.tabs[index].index === ctrl.active) {\n var newActiveTabIndex = index === ctrl.tabs.length - 1 ?\n index - 1 : index + 1 % ctrl.tabs.length;\n ctrl.select(newActiveTabIndex);\n }\n\n ctrl.tabs.splice(index, 1);\n };\n\n $scope.$watch('tabset.active', function(val) {\n if (angular.isDefined(val) && val !== oldIndex) {\n ctrl.select(findTabIndex(val));\n }\n });\n\n var destroyed;\n $scope.$on('$destroy', function() {\n destroyed = true;\n });\n\n function findTabIndex(index) {\n for (var i = 0; i < ctrl.tabs.length; i++) {\n if (ctrl.tabs[i].index === index) {\n return i;\n }\n }\n }\n}])\n\n.directive('uibTabset', function() {\n return {\n transclude: true,\n replace: true,\n scope: {},\n bindToController: {\n active: '=?',\n type: '@'\n },\n controller: 'UibTabsetController',\n controllerAs: 'tabset',\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/tabs/tabset.html';\n },\n link: function(scope, element, attrs) {\n scope.vertical = angular.isDefined(attrs.vertical) ?\n scope.$parent.$eval(attrs.vertical) : false;\n scope.justified = angular.isDefined(attrs.justified) ?\n scope.$parent.$eval(attrs.justified) : false;\n }\n };\n})\n\n.directive('uibTab', ['$parse', function($parse) {\n return {\n require: '^uibTabset',\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || 'uib/template/tabs/tab.html';\n },\n transclude: true,\n scope: {\n heading: '@',\n index: '=?',\n classes: '@?',\n onSelect: '&select', //This callback is called in contentHeadingTransclude\n //once it inserts the tab's content into the dom\n onDeselect: '&deselect'\n },\n controller: function() {\n //Empty controller so other directives can require being 'under' a tab\n },\n controllerAs: 'tab',\n link: function(scope, elm, attrs, tabsetCtrl, transclude) {\n scope.disabled = false;\n if (attrs.disable) {\n scope.$parent.$watch($parse(attrs.disable), function(value) {\n scope.disabled = !! value;\n });\n }\n\n if (angular.isUndefined(attrs.index)) {\n if (tabsetCtrl.tabs && tabsetCtrl.tabs.length) {\n scope.index = Math.max.apply(null, tabsetCtrl.tabs.map(function(t) { return t.index; })) + 1;\n } else {\n scope.index = 0;\n }\n }\n\n if (angular.isUndefined(attrs.classes)) {\n scope.classes = '';\n }\n\n scope.select = function(evt) {\n if (!scope.disabled) {\n var index;\n for (var i = 0; i < tabsetCtrl.tabs.length; i++) {\n if (tabsetCtrl.tabs[i].tab === scope) {\n index = i;\n break;\n }\n }\n\n tabsetCtrl.select(index, evt);\n }\n };\n\n tabsetCtrl.addTab(scope);\n scope.$on('$destroy', function() {\n tabsetCtrl.removeTab(scope);\n });\n\n //We need to transclude later, once the content container is ready.\n //when this link happens, we're inside a tab heading.\n scope.$transcludeFn = transclude;\n }\n };\n}])\n\n.directive('uibTabHeadingTransclude', function() {\n return {\n restrict: 'A',\n require: '^uibTab',\n link: function(scope, elm) {\n scope.$watch('headingElement', function updateHeadingElement(heading) {\n if (heading) {\n elm.html('');\n elm.append(heading);\n }\n });\n }\n };\n})\n\n.directive('uibTabContentTransclude', function() {\n return {\n restrict: 'A',\n require: '^uibTabset',\n link: function(scope, elm, attrs) {\n var tab = scope.$eval(attrs.uibTabContentTransclude).tab;\n\n //Now our tab is ready to be transcluded: both the tab heading area\n //and the tab content area are loaded. Transclude 'em both.\n tab.$transcludeFn(tab.$parent, function(contents) {\n angular.forEach(contents, function(node) {\n if (isTabHeading(node)) {\n //Let tabHeadingTransclude know.\n tab.headingElement = node;\n } else {\n elm.append(node);\n }\n });\n });\n }\n };\n\n function isTabHeading(node) {\n return node.tagName && (\n node.hasAttribute('uib-tab-heading') ||\n node.hasAttribute('data-uib-tab-heading') ||\n node.hasAttribute('x-uib-tab-heading') ||\n node.tagName.toLowerCase() === 'uib-tab-heading' ||\n node.tagName.toLowerCase() === 'data-uib-tab-heading' ||\n node.tagName.toLowerCase() === 'x-uib-tab-heading' ||\n node.tagName.toLowerCase() === 'uib:tab-heading'\n );\n }\n});\n\nangular.module('ui.bootstrap.timepicker', [])\n\n.constant('uibTimepickerConfig', {\n hourStep: 1,\n minuteStep: 1,\n secondStep: 1,\n showMeridian: true,\n showSeconds: false,\n meridians: null,\n readonlyInput: false,\n mousewheel: true,\n arrowkeys: true,\n showSpinners: true,\n templateUrl: 'uib/template/timepicker/timepicker.html'\n})\n\n.controller('UibTimepickerController', ['$scope', '$element', '$attrs', '$parse', '$log', '$locale', 'uibTimepickerConfig', function($scope, $element, $attrs, $parse, $log, $locale, timepickerConfig) {\n var hoursModelCtrl, minutesModelCtrl, secondsModelCtrl;\n var selected = new Date(),\n watchers = [],\n ngModelCtrl = { $setViewValue: angular.noop }, // nullModelCtrl\n meridians = angular.isDefined($attrs.meridians) ? $scope.$parent.$eval($attrs.meridians) : timepickerConfig.meridians || $locale.DATETIME_FORMATS.AMPMS,\n padHours = angular.isDefined($attrs.padHours) ? $scope.$parent.$eval($attrs.padHours) : true;\n\n $scope.tabindex = angular.isDefined($attrs.tabindex) ? $attrs.tabindex : 0;\n $element.removeAttr('tabindex');\n\n this.init = function(ngModelCtrl_, inputs) {\n ngModelCtrl = ngModelCtrl_;\n ngModelCtrl.$render = this.render;\n\n ngModelCtrl.$formatters.unshift(function(modelValue) {\n return modelValue ? new Date(modelValue) : null;\n });\n\n var hoursInputEl = inputs.eq(0),\n minutesInputEl = inputs.eq(1),\n secondsInputEl = inputs.eq(2);\n\n hoursModelCtrl = hoursInputEl.controller('ngModel');\n minutesModelCtrl = minutesInputEl.controller('ngModel');\n secondsModelCtrl = secondsInputEl.controller('ngModel');\n\n var mousewheel = angular.isDefined($attrs.mousewheel) ? $scope.$parent.$eval($attrs.mousewheel) : timepickerConfig.mousewheel;\n\n if (mousewheel) {\n this.setupMousewheelEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n }\n\n var arrowkeys = angular.isDefined($attrs.arrowkeys) ? $scope.$parent.$eval($attrs.arrowkeys) : timepickerConfig.arrowkeys;\n if (arrowkeys) {\n this.setupArrowkeyEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n }\n\n $scope.readonlyInput = angular.isDefined($attrs.readonlyInput) ? $scope.$parent.$eval($attrs.readonlyInput) : timepickerConfig.readonlyInput;\n this.setupInputEvents(hoursInputEl, minutesInputEl, secondsInputEl);\n };\n\n var hourStep = timepickerConfig.hourStep;\n if ($attrs.hourStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.hourStep), function(value) {\n hourStep = +value;\n }));\n }\n\n var minuteStep = timepickerConfig.minuteStep;\n if ($attrs.minuteStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.minuteStep), function(value) {\n minuteStep = +value;\n }));\n }\n\n var min;\n watchers.push($scope.$parent.$watch($parse($attrs.min), function(value) {\n var dt = new Date(value);\n min = isNaN(dt) ? undefined : dt;\n }));\n\n var max;\n watchers.push($scope.$parent.$watch($parse($attrs.max), function(value) {\n var dt = new Date(value);\n max = isNaN(dt) ? undefined : dt;\n }));\n\n var disabled = false;\n if ($attrs.ngDisabled) {\n watchers.push($scope.$parent.$watch($parse($attrs.ngDisabled), function(value) {\n disabled = value;\n }));\n }\n\n $scope.noIncrementHours = function() {\n var incrementedSelected = addMinutes(selected, hourStep * 60);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementHours = function() {\n var decrementedSelected = addMinutes(selected, -hourStep * 60);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noIncrementMinutes = function() {\n var incrementedSelected = addMinutes(selected, minuteStep);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementMinutes = function() {\n var decrementedSelected = addMinutes(selected, -minuteStep);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noIncrementSeconds = function() {\n var incrementedSelected = addSeconds(selected, secondStep);\n return disabled || incrementedSelected > max ||\n incrementedSelected < selected && incrementedSelected < min;\n };\n\n $scope.noDecrementSeconds = function() {\n var decrementedSelected = addSeconds(selected, -secondStep);\n return disabled || decrementedSelected < min ||\n decrementedSelected > selected && decrementedSelected > max;\n };\n\n $scope.noToggleMeridian = function() {\n if (selected.getHours() < 12) {\n return disabled || addMinutes(selected, 12 * 60) > max;\n }\n\n return disabled || addMinutes(selected, -12 * 60) < min;\n };\n\n var secondStep = timepickerConfig.secondStep;\n if ($attrs.secondStep) {\n watchers.push($scope.$parent.$watch($parse($attrs.secondStep), function(value) {\n secondStep = +value;\n }));\n }\n\n $scope.showSeconds = timepickerConfig.showSeconds;\n if ($attrs.showSeconds) {\n watchers.push($scope.$parent.$watch($parse($attrs.showSeconds), function(value) {\n $scope.showSeconds = !!value;\n }));\n }\n\n // 12H / 24H mode\n $scope.showMeridian = timepickerConfig.showMeridian;\n if ($attrs.showMeridian) {\n watchers.push($scope.$parent.$watch($parse($attrs.showMeridian), function(value) {\n $scope.showMeridian = !!value;\n\n if (ngModelCtrl.$error.time) {\n // Evaluate from template\n var hours = getHoursFromTemplate(), minutes = getMinutesFromTemplate();\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n refresh();\n }\n } else {\n updateTemplate();\n }\n }));\n }\n\n // Get $scope.hours in 24H mode if valid\n function getHoursFromTemplate() {\n var hours = +$scope.hours;\n var valid = $scope.showMeridian ? hours > 0 && hours < 13 :\n hours >= 0 && hours < 24;\n if (!valid || $scope.hours === '') {\n return undefined;\n }\n\n if ($scope.showMeridian) {\n if (hours === 12) {\n hours = 0;\n }\n if ($scope.meridian === meridians[1]) {\n hours = hours + 12;\n }\n }\n return hours;\n }\n\n function getMinutesFromTemplate() {\n var minutes = +$scope.minutes;\n var valid = minutes >= 0 && minutes < 60;\n if (!valid || $scope.minutes === '') {\n return undefined;\n }\n return minutes;\n }\n\n function getSecondsFromTemplate() {\n var seconds = +$scope.seconds;\n return seconds >= 0 && seconds < 60 ? seconds : undefined;\n }\n\n function pad(value, noPad) {\n if (value === null) {\n return '';\n }\n\n return angular.isDefined(value) && value.toString().length < 2 && !noPad ?\n '0' + value : value.toString();\n }\n\n // Respond on mousewheel spin\n this.setupMousewheelEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n var isScrollingUp = function(e) {\n if (e.originalEvent) {\n e = e.originalEvent;\n }\n //pick correct delta variable depending on event\n var delta = e.wheelDelta ? e.wheelDelta : -e.deltaY;\n return e.detail || delta > 0;\n };\n\n hoursInputEl.on('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementHours() : $scope.decrementHours());\n }\n e.preventDefault();\n });\n\n minutesInputEl.on('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementMinutes() : $scope.decrementMinutes());\n }\n e.preventDefault();\n });\n\n secondsInputEl.on('mousewheel wheel', function(e) {\n if (!disabled) {\n $scope.$apply(isScrollingUp(e) ? $scope.incrementSeconds() : $scope.decrementSeconds());\n }\n e.preventDefault();\n });\n };\n\n // Respond on up/down arrowkeys\n this.setupArrowkeyEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n hoursInputEl.on('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementHours();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementHours();\n $scope.$apply();\n }\n }\n });\n\n minutesInputEl.on('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementMinutes();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementMinutes();\n $scope.$apply();\n }\n }\n });\n\n secondsInputEl.on('keydown', function(e) {\n if (!disabled) {\n if (e.which === 38) { // up\n e.preventDefault();\n $scope.incrementSeconds();\n $scope.$apply();\n } else if (e.which === 40) { // down\n e.preventDefault();\n $scope.decrementSeconds();\n $scope.$apply();\n }\n }\n });\n };\n\n this.setupInputEvents = function(hoursInputEl, minutesInputEl, secondsInputEl) {\n if ($scope.readonlyInput) {\n $scope.updateHours = angular.noop;\n $scope.updateMinutes = angular.noop;\n $scope.updateSeconds = angular.noop;\n return;\n }\n\n var invalidate = function(invalidHours, invalidMinutes, invalidSeconds) {\n ngModelCtrl.$setViewValue(null);\n ngModelCtrl.$setValidity('time', false);\n if (angular.isDefined(invalidHours)) {\n $scope.invalidHours = invalidHours;\n if (hoursModelCtrl) {\n hoursModelCtrl.$setValidity('hours', false);\n }\n }\n\n if (angular.isDefined(invalidMinutes)) {\n $scope.invalidMinutes = invalidMinutes;\n if (minutesModelCtrl) {\n minutesModelCtrl.$setValidity('minutes', false);\n }\n }\n\n if (angular.isDefined(invalidSeconds)) {\n $scope.invalidSeconds = invalidSeconds;\n if (secondsModelCtrl) {\n secondsModelCtrl.$setValidity('seconds', false);\n }\n }\n };\n\n $scope.updateHours = function() {\n var hours = getHoursFromTemplate(),\n minutes = getMinutesFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(hours) && angular.isDefined(minutes)) {\n selected.setHours(hours);\n selected.setMinutes(minutes);\n if (selected < min || selected > max) {\n invalidate(true);\n } else {\n refresh('h');\n }\n } else {\n invalidate(true);\n }\n };\n\n hoursInputEl.on('blur', function(e) {\n ngModelCtrl.$setTouched();\n if (modelIsEmpty()) {\n makeValid();\n } else if ($scope.hours === null || $scope.hours === '') {\n invalidate(true);\n } else if (!$scope.invalidHours && $scope.hours < 10) {\n $scope.$apply(function() {\n $scope.hours = pad($scope.hours, !padHours);\n });\n }\n });\n\n $scope.updateMinutes = function() {\n var minutes = getMinutesFromTemplate(),\n hours = getHoursFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(minutes) && angular.isDefined(hours)) {\n selected.setHours(hours);\n selected.setMinutes(minutes);\n if (selected < min || selected > max) {\n invalidate(undefined, true);\n } else {\n refresh('m');\n }\n } else {\n invalidate(undefined, true);\n }\n };\n\n minutesInputEl.on('blur', function(e) {\n ngModelCtrl.$setTouched();\n if (modelIsEmpty()) {\n makeValid();\n } else if ($scope.minutes === null) {\n invalidate(undefined, true);\n } else if (!$scope.invalidMinutes && $scope.minutes < 10) {\n $scope.$apply(function() {\n $scope.minutes = pad($scope.minutes);\n });\n }\n });\n\n $scope.updateSeconds = function() {\n var seconds = getSecondsFromTemplate();\n\n ngModelCtrl.$setDirty();\n\n if (angular.isDefined(seconds)) {\n selected.setSeconds(seconds);\n refresh('s');\n } else {\n invalidate(undefined, undefined, true);\n }\n };\n\n secondsInputEl.on('blur', function(e) {\n if (modelIsEmpty()) {\n makeValid();\n } else if (!$scope.invalidSeconds && $scope.seconds < 10) {\n $scope.$apply( function() {\n $scope.seconds = pad($scope.seconds);\n });\n }\n });\n\n };\n\n this.render = function() {\n var date = ngModelCtrl.$viewValue;\n\n if (isNaN(date)) {\n ngModelCtrl.$setValidity('time', false);\n $log.error('Timepicker directive: \"ng-model\" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.');\n } else {\n if (date) {\n selected = date;\n }\n\n if (selected < min || selected > max) {\n ngModelCtrl.$setValidity('time', false);\n $scope.invalidHours = true;\n $scope.invalidMinutes = true;\n } else {\n makeValid();\n }\n updateTemplate();\n }\n };\n\n // Call internally when we know that model is valid.\n function refresh(keyboardChange) {\n makeValid();\n ngModelCtrl.$setViewValue(new Date(selected));\n updateTemplate(keyboardChange);\n }\n\n function makeValid() {\n if (hoursModelCtrl) {\n hoursModelCtrl.$setValidity('hours', true);\n }\n\n if (minutesModelCtrl) {\n minutesModelCtrl.$setValidity('minutes', true);\n }\n\n if (secondsModelCtrl) {\n secondsModelCtrl.$setValidity('seconds', true);\n }\n\n ngModelCtrl.$setValidity('time', true);\n $scope.invalidHours = false;\n $scope.invalidMinutes = false;\n $scope.invalidSeconds = false;\n }\n\n function updateTemplate(keyboardChange) {\n if (!ngModelCtrl.$modelValue) {\n $scope.hours = null;\n $scope.minutes = null;\n $scope.seconds = null;\n $scope.meridian = meridians[0];\n } else {\n var hours = selected.getHours(),\n minutes = selected.getMinutes(),\n seconds = selected.getSeconds();\n\n if ($scope.showMeridian) {\n hours = hours === 0 || hours === 12 ? 12 : hours % 12; // Convert 24 to 12 hour system\n }\n\n $scope.hours = keyboardChange === 'h' ? hours : pad(hours, !padHours);\n if (keyboardChange !== 'm') {\n $scope.minutes = pad(minutes);\n }\n $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];\n\n if (keyboardChange !== 's') {\n $scope.seconds = pad(seconds);\n }\n $scope.meridian = selected.getHours() < 12 ? meridians[0] : meridians[1];\n }\n }\n\n function addSecondsToSelected(seconds) {\n selected = addSeconds(selected, seconds);\n refresh();\n }\n\n function addMinutes(selected, minutes) {\n return addSeconds(selected, minutes*60);\n }\n\n function addSeconds(date, seconds) {\n var dt = new Date(date.getTime() + seconds * 1000);\n var newDate = new Date(date);\n newDate.setHours(dt.getHours(), dt.getMinutes(), dt.getSeconds());\n return newDate;\n }\n\n function modelIsEmpty() {\n return ($scope.hours === null || $scope.hours === '') &&\n ($scope.minutes === null || $scope.minutes === '') &&\n (!$scope.showSeconds || $scope.showSeconds && ($scope.seconds === null || $scope.seconds === ''));\n }\n\n $scope.showSpinners = angular.isDefined($attrs.showSpinners) ?\n $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners;\n\n $scope.incrementHours = function() {\n if (!$scope.noIncrementHours()) {\n addSecondsToSelected(hourStep * 60 * 60);\n }\n };\n\n $scope.decrementHours = function() {\n if (!$scope.noDecrementHours()) {\n addSecondsToSelected(-hourStep * 60 * 60);\n }\n };\n\n $scope.incrementMinutes = function() {\n if (!$scope.noIncrementMinutes()) {\n addSecondsToSelected(minuteStep * 60);\n }\n };\n\n $scope.decrementMinutes = function() {\n if (!$scope.noDecrementMinutes()) {\n addSecondsToSelected(-minuteStep * 60);\n }\n };\n\n $scope.incrementSeconds = function() {\n if (!$scope.noIncrementSeconds()) {\n addSecondsToSelected(secondStep);\n }\n };\n\n $scope.decrementSeconds = function() {\n if (!$scope.noDecrementSeconds()) {\n addSecondsToSelected(-secondStep);\n }\n };\n\n $scope.toggleMeridian = function() {\n var minutes = getMinutesFromTemplate(),\n hours = getHoursFromTemplate();\n\n if (!$scope.noToggleMeridian()) {\n if (angular.isDefined(minutes) && angular.isDefined(hours)) {\n addSecondsToSelected(12 * 60 * (selected.getHours() < 12 ? 60 : -60));\n } else {\n $scope.meridian = $scope.meridian === meridians[0] ? meridians[1] : meridians[0];\n }\n }\n };\n\n $scope.blur = function() {\n ngModelCtrl.$setTouched();\n };\n\n $scope.$on('$destroy', function() {\n while (watchers.length) {\n watchers.shift()();\n }\n });\n}])\n\n.directive('uibTimepicker', ['uibTimepickerConfig', function(uibTimepickerConfig) {\n return {\n require: ['uibTimepicker', '?^ngModel'],\n restrict: 'A',\n controller: 'UibTimepickerController',\n controllerAs: 'timepicker',\n scope: {},\n templateUrl: function(element, attrs) {\n return attrs.templateUrl || uibTimepickerConfig.templateUrl;\n },\n link: function(scope, element, attrs, ctrls) {\n var timepickerCtrl = ctrls[0], ngModelCtrl = ctrls[1];\n\n if (ngModelCtrl) {\n timepickerCtrl.init(ngModelCtrl, element.find('input'));\n }\n }\n };\n}]);\n\nangular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap.position'])\n\n/**\n * A helper service that can parse typeahead's syntax (string provided by users)\n * Extracted to a separate service for ease of unit testing\n */\n .factory('uibTypeaheadParser', ['$parse', function($parse) {\n // 000001111111100000000000002222222200000000000000003333333333333330000000000044444444000\n var TYPEAHEAD_REGEXP = /^\\s*([\\s\\S]+?)(?:\\s+as\\s+([\\s\\S]+?))?\\s+for\\s+(?:([\\$\\w][\\$\\w\\d]*))\\s+in\\s+([\\s\\S]+?)$/;\n return {\n parse: function(input) {\n var match = input.match(TYPEAHEAD_REGEXP);\n if (!match) {\n throw new Error(\n 'Expected typeahead specification in form of \"_modelValue_ (as _label_)? for _item_ in _collection_\"' +\n ' but got \"' + input + '\".');\n }\n\n return {\n itemName: match[3],\n source: $parse(match[4]),\n viewMapper: $parse(match[2] || match[1]),\n modelMapper: $parse(match[1])\n };\n }\n };\n }])\n\n .controller('UibTypeaheadController', ['$scope', '$element', '$attrs', '$compile', '$parse', '$q', '$timeout', '$document', '$window', '$rootScope', '$$debounce', '$uibPosition', 'uibTypeaheadParser',\n function(originalScope, element, attrs, $compile, $parse, $q, $timeout, $document, $window, $rootScope, $$debounce, $position, typeaheadParser) {\n var HOT_KEYS = [9, 13, 27, 38, 40];\n var eventDebounceTime = 200;\n var modelCtrl, ngModelOptions;\n //SUPPORTED ATTRIBUTES (OPTIONS)\n\n //minimal no of characters that needs to be entered before typeahead kicks-in\n var minLength = originalScope.$eval(attrs.typeaheadMinLength);\n if (!minLength && minLength !== 0) {\n minLength = 1;\n }\n\n originalScope.$watch(attrs.typeaheadMinLength, function (newVal) {\n minLength = !newVal && newVal !== 0 ? 1 : newVal;\n });\n\n //minimal wait time after last character typed before typeahead kicks-in\n var waitTime = originalScope.$eval(attrs.typeaheadWaitMs) || 0;\n\n //should it restrict model values to the ones selected from the popup only?\n var isEditable = originalScope.$eval(attrs.typeaheadEditable) !== false;\n originalScope.$watch(attrs.typeaheadEditable, function (newVal) {\n isEditable = newVal !== false;\n });\n\n //binding to a variable that indicates if matches are being retrieved asynchronously\n var isLoadingSetter = $parse(attrs.typeaheadLoading).assign || angular.noop;\n\n //a function to determine if an event should cause selection\n var isSelectEvent = attrs.typeaheadShouldSelect ? $parse(attrs.typeaheadShouldSelect) : function(scope, vals) {\n var evt = vals.$event;\n return evt.which === 13 || evt.which === 9;\n };\n\n //a callback executed when a match is selected\n var onSelectCallback = $parse(attrs.typeaheadOnSelect);\n\n //should it select highlighted popup value when losing focus?\n var isSelectOnBlur = angular.isDefined(attrs.typeaheadSelectOnBlur) ? originalScope.$eval(attrs.typeaheadSelectOnBlur) : false;\n\n //binding to a variable that indicates if there were no results after the query is completed\n var isNoResultsSetter = $parse(attrs.typeaheadNoResults).assign || angular.noop;\n\n var inputFormatter = attrs.typeaheadInputFormatter ? $parse(attrs.typeaheadInputFormatter) : undefined;\n\n var appendToBody = attrs.typeaheadAppendToBody ? originalScope.$eval(attrs.typeaheadAppendToBody) : false;\n\n var appendTo = attrs.typeaheadAppendTo ?\n originalScope.$eval(attrs.typeaheadAppendTo) : null;\n\n var focusFirst = originalScope.$eval(attrs.typeaheadFocusFirst) !== false;\n\n //If input matches an item of the list exactly, select it automatically\n var selectOnExact = attrs.typeaheadSelectOnExact ? originalScope.$eval(attrs.typeaheadSelectOnExact) : false;\n\n //binding to a variable that indicates if dropdown is open\n var isOpenSetter = $parse(attrs.typeaheadIsOpen).assign || angular.noop;\n\n var showHint = originalScope.$eval(attrs.typeaheadShowHint) || false;\n\n //INTERNAL VARIABLES\n\n //model setter executed upon match selection\n var parsedModel = $parse(attrs.ngModel);\n var invokeModelSetter = $parse(attrs.ngModel + '($$$p)');\n var $setModelValue = function(scope, newValue) {\n if (angular.isFunction(parsedModel(originalScope)) &&\n ngModelOptions.getOption('getterSetter')) {\n return invokeModelSetter(scope, {$$$p: newValue});\n }\n\n return parsedModel.assign(scope, newValue);\n };\n\n //expressions used by typeahead\n var parserResult = typeaheadParser.parse(attrs.uibTypeahead);\n\n var hasFocus;\n\n //Used to avoid bug in iOS webview where iOS keyboard does not fire\n //mousedown & mouseup events\n //Issue #3699\n var selected;\n\n //create a child scope for the typeahead directive so we are not polluting original scope\n //with typeahead-specific data (matches, query etc.)\n var scope = originalScope.$new();\n var offDestroy = originalScope.$on('$destroy', function() {\n scope.$destroy();\n });\n scope.$on('$destroy', offDestroy);\n\n // WAI-ARIA\n var popupId = 'typeahead-' + scope.$id + '-' + Math.floor(Math.random() * 10000);\n element.attr({\n 'aria-autocomplete': 'list',\n 'aria-expanded': false,\n 'aria-owns': popupId\n });\n\n var inputsContainer, hintInputElem;\n //add read-only input to show hint\n if (showHint) {\n inputsContainer = angular.element('
    ');\n inputsContainer.css('position', 'relative');\n element.after(inputsContainer);\n hintInputElem = element.clone();\n hintInputElem.attr('placeholder', '');\n hintInputElem.attr('tabindex', '-1');\n hintInputElem.val('');\n hintInputElem.css({\n 'position': 'absolute',\n 'top': '0px',\n 'left': '0px',\n 'border-color': 'transparent',\n 'box-shadow': 'none',\n 'opacity': 1,\n 'background': 'none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)',\n 'color': '#999'\n });\n element.css({\n 'position': 'relative',\n 'vertical-align': 'top',\n 'background-color': 'transparent'\n });\n\n if (hintInputElem.attr('id')) {\n hintInputElem.removeAttr('id'); // remove duplicate id if present.\n }\n inputsContainer.append(hintInputElem);\n hintInputElem.after(element);\n }\n\n //pop-up element used to display matches\n var popUpEl = angular.element('
    ');\n popUpEl.attr({\n id: popupId,\n matches: 'matches',\n active: 'activeIdx',\n select: 'select(activeIdx, evt)',\n 'move-in-progress': 'moveInProgress',\n query: 'query',\n position: 'position',\n 'assign-is-open': 'assignIsOpen(isOpen)',\n debounce: 'debounceUpdate'\n });\n //custom item template\n if (angular.isDefined(attrs.typeaheadTemplateUrl)) {\n popUpEl.attr('template-url', attrs.typeaheadTemplateUrl);\n }\n\n if (angular.isDefined(attrs.typeaheadPopupTemplateUrl)) {\n popUpEl.attr('popup-template-url', attrs.typeaheadPopupTemplateUrl);\n }\n\n var resetHint = function() {\n if (showHint) {\n hintInputElem.val('');\n }\n };\n\n var resetMatches = function() {\n scope.matches = [];\n scope.activeIdx = -1;\n element.attr('aria-expanded', false);\n resetHint();\n };\n\n var getMatchId = function(index) {\n return popupId + '-option-' + index;\n };\n\n // Indicate that the specified match is the active (pre-selected) item in the list owned by this typeahead.\n // This attribute is added or removed automatically when the `activeIdx` changes.\n scope.$watch('activeIdx', function(index) {\n if (index < 0) {\n element.removeAttr('aria-activedescendant');\n } else {\n element.attr('aria-activedescendant', getMatchId(index));\n }\n });\n\n var inputIsExactMatch = function(inputValue, index) {\n if (scope.matches.length > index && inputValue) {\n return inputValue.toUpperCase() === scope.matches[index].label.toUpperCase();\n }\n\n return false;\n };\n\n var getMatchesAsync = function(inputValue, evt) {\n var locals = {$viewValue: inputValue};\n isLoadingSetter(originalScope, true);\n isNoResultsSetter(originalScope, false);\n $q.when(parserResult.source(originalScope, locals)).then(function(matches) {\n //it might happen that several async queries were in progress if a user were typing fast\n //but we are interested only in responses that correspond to the current view value\n var onCurrentRequest = inputValue === modelCtrl.$viewValue;\n if (onCurrentRequest && hasFocus) {\n if (matches && matches.length > 0) {\n scope.activeIdx = focusFirst ? 0 : -1;\n isNoResultsSetter(originalScope, false);\n scope.matches.length = 0;\n\n //transform labels\n for (var i = 0; i < matches.length; i++) {\n locals[parserResult.itemName] = matches[i];\n scope.matches.push({\n id: getMatchId(i),\n label: parserResult.viewMapper(scope, locals),\n model: matches[i]\n });\n }\n\n scope.query = inputValue;\n //position pop-up with matches - we need to re-calculate its position each time we are opening a window\n //with matches as a pop-up might be absolute-positioned and position of an input might have changed on a page\n //due to other elements being rendered\n recalculatePosition();\n\n element.attr('aria-expanded', true);\n\n //Select the single remaining option if user input matches\n if (selectOnExact && scope.matches.length === 1 && inputIsExactMatch(inputValue, 0)) {\n if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {\n $$debounce(function() {\n scope.select(0, evt);\n }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);\n } else {\n scope.select(0, evt);\n }\n }\n\n if (showHint) {\n var firstLabel = scope.matches[0].label;\n if (angular.isString(inputValue) &&\n inputValue.length > 0 &&\n firstLabel.slice(0, inputValue.length).toUpperCase() === inputValue.toUpperCase()) {\n hintInputElem.val(inputValue + firstLabel.slice(inputValue.length));\n } else {\n hintInputElem.val('');\n }\n }\n } else {\n resetMatches();\n isNoResultsSetter(originalScope, true);\n }\n }\n if (onCurrentRequest) {\n isLoadingSetter(originalScope, false);\n }\n }, function() {\n resetMatches();\n isLoadingSetter(originalScope, false);\n isNoResultsSetter(originalScope, true);\n });\n };\n\n // bind events only if appendToBody params exist - performance feature\n if (appendToBody) {\n angular.element($window).on('resize', fireRecalculating);\n $document.find('body').on('scroll', fireRecalculating);\n }\n\n // Declare the debounced function outside recalculating for\n // proper debouncing\n var debouncedRecalculate = $$debounce(function() {\n // if popup is visible\n if (scope.matches.length) {\n recalculatePosition();\n }\n\n scope.moveInProgress = false;\n }, eventDebounceTime);\n\n // Default progress type\n scope.moveInProgress = false;\n\n function fireRecalculating() {\n if (!scope.moveInProgress) {\n scope.moveInProgress = true;\n scope.$digest();\n }\n\n debouncedRecalculate();\n }\n\n // recalculate actual position and set new values to scope\n // after digest loop is popup in right position\n function recalculatePosition() {\n scope.position = appendToBody ? $position.offset(element) : $position.position(element);\n scope.position.top += element.prop('offsetHeight');\n }\n\n //we need to propagate user's query so we can higlight matches\n scope.query = undefined;\n\n //Declare the timeout promise var outside the function scope so that stacked calls can be cancelled later\n var timeoutPromise;\n\n var scheduleSearchWithTimeout = function(inputValue) {\n timeoutPromise = $timeout(function() {\n getMatchesAsync(inputValue);\n }, waitTime);\n };\n\n var cancelPreviousTimeout = function() {\n if (timeoutPromise) {\n $timeout.cancel(timeoutPromise);\n }\n };\n\n resetMatches();\n\n scope.assignIsOpen = function (isOpen) {\n isOpenSetter(originalScope, isOpen);\n };\n\n scope.select = function(activeIdx, evt) {\n //called from within the $digest() cycle\n var locals = {};\n var model, item;\n\n selected = true;\n locals[parserResult.itemName] = item = scope.matches[activeIdx].model;\n model = parserResult.modelMapper(originalScope, locals);\n $setModelValue(originalScope, model);\n modelCtrl.$setValidity('editable', true);\n modelCtrl.$setValidity('parse', true);\n\n onSelectCallback(originalScope, {\n $item: item,\n $model: model,\n $label: parserResult.viewMapper(originalScope, locals),\n $event: evt\n });\n\n resetMatches();\n\n //return focus to the input element if a match was selected via a mouse click event\n // use timeout to avoid $rootScope:inprog error\n if (scope.$eval(attrs.typeaheadFocusOnSelect) !== false) {\n $timeout(function() { element[0].focus(); }, 0, false);\n }\n };\n\n //bind keyboard events: arrows up(38) / down(40), enter(13) and tab(9), esc(27)\n element.on('keydown', function(evt) {\n //typeahead is open and an \"interesting\" key was pressed\n if (scope.matches.length === 0 || HOT_KEYS.indexOf(evt.which) === -1) {\n return;\n }\n\n var shouldSelect = isSelectEvent(originalScope, {$event: evt});\n\n /**\n * if there's nothing selected (i.e. focusFirst) and enter or tab is hit\n * or\n * shift + tab is pressed to bring focus to the previous element\n * then clear the results\n */\n if (scope.activeIdx === -1 && shouldSelect || evt.which === 9 && !!evt.shiftKey) {\n resetMatches();\n scope.$digest();\n return;\n }\n\n evt.preventDefault();\n var target;\n switch (evt.which) {\n case 27: // escape\n evt.stopPropagation();\n\n resetMatches();\n originalScope.$digest();\n break;\n case 38: // up arrow\n scope.activeIdx = (scope.activeIdx > 0 ? scope.activeIdx : scope.matches.length) - 1;\n scope.$digest();\n target = popUpEl[0].querySelectorAll('.uib-typeahead-match')[scope.activeIdx];\n target.parentNode.scrollTop = target.offsetTop;\n break;\n case 40: // down arrow\n scope.activeIdx = (scope.activeIdx + 1) % scope.matches.length;\n scope.$digest();\n target = popUpEl[0].querySelectorAll('.uib-typeahead-match')[scope.activeIdx];\n target.parentNode.scrollTop = target.offsetTop;\n break;\n default:\n if (shouldSelect) {\n scope.$apply(function() {\n if (angular.isNumber(scope.debounceUpdate) || angular.isObject(scope.debounceUpdate)) {\n $$debounce(function() {\n scope.select(scope.activeIdx, evt);\n }, angular.isNumber(scope.debounceUpdate) ? scope.debounceUpdate : scope.debounceUpdate['default']);\n } else {\n scope.select(scope.activeIdx, evt);\n }\n });\n }\n }\n });\n\n element.on('focus', function (evt) {\n hasFocus = true;\n if (minLength === 0 && !modelCtrl.$viewValue) {\n $timeout(function() {\n getMatchesAsync(modelCtrl.$viewValue, evt);\n }, 0);\n }\n });\n\n element.on('blur', function(evt) {\n if (isSelectOnBlur && scope.matches.length && scope.activeIdx !== -1 && !selected) {\n selected = true;\n scope.$apply(function() {\n if (angular.isObject(scope.debounceUpdate) && angular.isNumber(scope.debounceUpdate.blur)) {\n $$debounce(function() {\n scope.select(scope.activeIdx, evt);\n }, scope.debounceUpdate.blur);\n } else {\n scope.select(scope.activeIdx, evt);\n }\n });\n }\n if (!isEditable && modelCtrl.$error.editable) {\n modelCtrl.$setViewValue();\n scope.$apply(function() {\n // Reset validity as we are clearing\n modelCtrl.$setValidity('editable', true);\n modelCtrl.$setValidity('parse', true);\n });\n element.val('');\n }\n hasFocus = false;\n selected = false;\n });\n\n // Keep reference to click handler to unbind it.\n var dismissClickHandler = function(evt) {\n // Issue #3973\n // Firefox treats right click as a click on document\n if (element[0] !== evt.target && evt.which !== 3 && scope.matches.length !== 0) {\n resetMatches();\n if (!$rootScope.$$phase) {\n originalScope.$digest();\n }\n }\n };\n\n $document.on('click', dismissClickHandler);\n\n originalScope.$on('$destroy', function() {\n $document.off('click', dismissClickHandler);\n if (appendToBody || appendTo) {\n $popup.remove();\n }\n\n if (appendToBody) {\n angular.element($window).off('resize', fireRecalculating);\n $document.find('body').off('scroll', fireRecalculating);\n }\n // Prevent jQuery cache memory leak\n popUpEl.remove();\n\n if (showHint) {\n inputsContainer.remove();\n }\n });\n\n var $popup = $compile(popUpEl)(scope);\n\n if (appendToBody) {\n $document.find('body').append($popup);\n } else if (appendTo) {\n angular.element(appendTo).eq(0).append($popup);\n } else {\n element.after($popup);\n }\n\n this.init = function(_modelCtrl) {\n modelCtrl = _modelCtrl;\n ngModelOptions = extractOptions(modelCtrl);\n\n scope.debounceUpdate = $parse(ngModelOptions.getOption('debounce'))(originalScope);\n\n //plug into $parsers pipeline to open a typeahead on view changes initiated from DOM\n //$parsers kick-in on all the changes coming from the view as well as manually triggered by $setViewValue\n modelCtrl.$parsers.unshift(function(inputValue) {\n hasFocus = true;\n\n if (minLength === 0 || inputValue && inputValue.length >= minLength) {\n if (waitTime > 0) {\n cancelPreviousTimeout();\n scheduleSearchWithTimeout(inputValue);\n } else {\n getMatchesAsync(inputValue);\n }\n } else {\n isLoadingSetter(originalScope, false);\n cancelPreviousTimeout();\n resetMatches();\n }\n\n if (isEditable) {\n return inputValue;\n }\n\n if (!inputValue) {\n // Reset in case user had typed something previously.\n modelCtrl.$setValidity('editable', true);\n return null;\n }\n\n modelCtrl.$setValidity('editable', false);\n return undefined;\n });\n\n modelCtrl.$formatters.push(function(modelValue) {\n var candidateViewValue, emptyViewValue;\n var locals = {};\n\n // The validity may be set to false via $parsers (see above) if\n // the model is restricted to selected values. If the model\n // is set manually it is considered to be valid.\n if (!isEditable) {\n modelCtrl.$setValidity('editable', true);\n }\n\n if (inputFormatter) {\n locals.$model = modelValue;\n return inputFormatter(originalScope, locals);\n }\n\n //it might happen that we don't have enough info to properly render input value\n //we need to check for this situation and simply return model value if we can't apply custom formatting\n locals[parserResult.itemName] = modelValue;\n candidateViewValue = parserResult.viewMapper(originalScope, locals);\n locals[parserResult.itemName] = undefined;\n emptyViewValue = parserResult.viewMapper(originalScope, locals);\n\n return candidateViewValue !== emptyViewValue ? candidateViewValue : modelValue;\n });\n };\n\n function extractOptions(ngModelCtrl) {\n var ngModelOptions;\n\n if (angular.version.minor < 6) { // in angular < 1.6 $options could be missing\n // guarantee a value\n ngModelOptions = ngModelCtrl.$options || {};\n\n // mimic 1.6+ api\n ngModelOptions.getOption = function (key) {\n return ngModelOptions[key];\n };\n } else { // in angular >=1.6 $options is always present\n ngModelOptions = ngModelCtrl.$options;\n }\n\n return ngModelOptions;\n }\n }])\n\n .directive('uibTypeahead', function() {\n return {\n controller: 'UibTypeaheadController',\n require: ['ngModel', 'uibTypeahead'],\n link: function(originalScope, element, attrs, ctrls) {\n ctrls[1].init(ctrls[0]);\n }\n };\n })\n\n .directive('uibTypeaheadPopup', ['$$debounce', function($$debounce) {\n return {\n scope: {\n matches: '=',\n query: '=',\n active: '=',\n position: '&',\n moveInProgress: '=',\n select: '&',\n assignIsOpen: '&',\n debounce: '&'\n },\n replace: true,\n templateUrl: function(element, attrs) {\n return attrs.popupTemplateUrl || 'uib/template/typeahead/typeahead-popup.html';\n },\n link: function(scope, element, attrs) {\n scope.templateUrl = attrs.templateUrl;\n\n scope.isOpen = function() {\n var isDropdownOpen = scope.matches.length > 0;\n scope.assignIsOpen({ isOpen: isDropdownOpen });\n return isDropdownOpen;\n };\n\n scope.isActive = function(matchIdx) {\n return scope.active === matchIdx;\n };\n\n scope.selectActive = function(matchIdx) {\n scope.active = matchIdx;\n };\n\n scope.selectMatch = function(activeIdx, evt) {\n var debounce = scope.debounce();\n if (angular.isNumber(debounce) || angular.isObject(debounce)) {\n $$debounce(function() {\n scope.select({activeIdx: activeIdx, evt: evt});\n }, angular.isNumber(debounce) ? debounce : debounce['default']);\n } else {\n scope.select({activeIdx: activeIdx, evt: evt});\n }\n };\n }\n };\n }])\n\n .directive('uibTypeaheadMatch', ['$templateRequest', '$compile', '$parse', function($templateRequest, $compile, $parse) {\n return {\n scope: {\n index: '=',\n match: '=',\n query: '='\n },\n link: function(scope, element, attrs) {\n var tplUrl = $parse(attrs.templateUrl)(scope.$parent) || 'uib/template/typeahead/typeahead-match.html';\n $templateRequest(tplUrl).then(function(tplContent) {\n var tplEl = angular.element(tplContent.trim());\n element.replaceWith(tplEl);\n $compile(tplEl)(scope);\n });\n }\n };\n }])\n\n .filter('uibTypeaheadHighlight', ['$sce', '$injector', '$log', function($sce, $injector, $log) {\n var isSanitizePresent;\n isSanitizePresent = $injector.has('$sanitize');\n\n function escapeRegexp(queryToEscape) {\n // Regex: capture the whole query string and replace it with the string that will be used to match\n // the results, for example if the capture is \"a\" the result will be \\a\n return queryToEscape.replace(/([.?*+^$[\\]\\\\(){}|-])/g, '\\\\$1');\n }\n\n function containsHtml(matchItem) {\n return /<.*>/g.test(matchItem);\n }\n\n return function(matchItem, query) {\n if (!isSanitizePresent && containsHtml(matchItem)) {\n $log.warn('Unsafe use of typeahead please use ngSanitize'); // Warn the user about the danger\n }\n matchItem = query ? ('' + matchItem).replace(new RegExp(escapeRegexp(query), 'gi'), '$&') : matchItem; // Replaces the capture string with a the same string inside of a \"strong\" tag\n if (!isSanitizePresent) {\n matchItem = $sce.trustAsHtml(matchItem); // If $sanitize is not present we pack the string in a $sce object for the ng-bind-html directive\n }\n return matchItem;\n };\n }]);\n\nangular.module(\"uib/template/accordion/accordion-group.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/accordion/accordion-group.html\",\n \"
    \\n\" +\n \"

    \\n\" +\n \" {{heading}}\\n\" +\n \"

    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/accordion/accordion.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/accordion/accordion.html\",\n \"
    \");\n}]);\n\nangular.module(\"uib/template/alert/alert.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/alert/alert.html\",\n \"\\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/carousel/carousel.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/carousel/carousel.html\",\n \"
    \\n\" +\n \" 1\\\">\\n\" +\n \" \\n\" +\n \" previous\\n\" +\n \"\\n\" +\n \" 1\\\">\\n\" +\n \" \\n\" +\n \" next\\n\" +\n \"\\n\" +\n \"
      1\\\">\\n\" +\n \"
    1. \\n\" +\n \" slide {{ $index + 1 }} of {{ slides.length }}, currently active\\n\" +\n \"
    2. \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/carousel/slide.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/carousel/slide.html\",\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/datepicker.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/datepicker/datepicker.html\",\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/day.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/datepicker/day.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
    {{::label.abbr}}
    {{ weekNumbers[$index] }}\\n\" +\n \" \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/month.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/datepicker/month.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
    \\n\" +\n \" \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/popup.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/datepicker/popup.html\",\n \"
    \\n\" +\n \"
      \\n\" +\n \"
    • \\n\" +\n \"
    • \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
    • \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepicker/year.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/datepicker/year.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
    \\n\" +\n \" \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/datepickerPopup/popup.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/datepickerPopup/popup.html\",\n \"
      \\n\" +\n \"
    • \\n\" +\n \"
    • \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
    • \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/modal/backdrop.html\", []).run([\"$templateCache\", function($templateCache) {\n $templateCache.put(\"uib/template/modal/backdrop.html\",\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/modal/window.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/modal/window.html\",\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/pager/pager.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/pager/pager.html\",\n \"
  • {{::getText('previous')}}
  • \\n\" +\n \"
  • {{::getText('next')}}
  • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/pagination/pagination.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/pagination/pagination.html\",\n \"
  • {{::getText('first')}}
  • \\n\" +\n \"
  • {{::getText('previous')}}
  • \\n\" +\n \"
  • {{page.text}}
  • \\n\" +\n \"
  • {{::getText('next')}}
  • \\n\" +\n \"
  • {{::getText('last')}}
  • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-html-popup.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-html-popup.html\",\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-popup.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-popup.html\",\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tooltip/tooltip-template-popup.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/tooltip/tooltip-template-popup.html\",\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover-html.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/popover/popover-html.html\",\n \"
    \\n\" +\n \"\\n\" +\n \"
    \\n\" +\n \"

    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover-template.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/popover/popover-template.html\",\n \"
    \\n\" +\n \"\\n\" +\n \"
    \\n\" +\n \"

    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/popover/popover.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/popover/popover.html\",\n \"
    \\n\" +\n \"\\n\" +\n \"
    \\n\" +\n \"

    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/progressbar/bar.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/progressbar/bar.html\",\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/progressbar/progress.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/progressbar/progress.html\",\n \"
    \");\n}]);\n\nangular.module(\"uib/template/progressbar/progressbar.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/progressbar/progressbar.html\",\n \"
    \\n\" +\n \"
    \\n\" +\n \"
    \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/rating/rating.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/rating/rating.html\",\n \"\\n\" +\n \" ({{ $index < value ? '*' : ' ' }})\\n\" +\n \" \\n\" +\n \"\\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tabs/tab.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/tabs/tab.html\",\n \"
  • \\n\" +\n \" {{heading}}\\n\" +\n \"
  • \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/tabs/tabset.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/tabs/tabset.html\",\n \"
    \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/timepicker/timepicker.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/timepicker/timepicker.html\",\n \"\\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \" \\n\" +\n \"
        
      \\n\" +\n \" \\n\" +\n \" :\\n\" +\n \" \\n\" +\n \" :\\n\" +\n \" \\n\" +\n \"
        
      \\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/typeahead/typeahead-match.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/typeahead/typeahead-match.html\",\n \"\\n\" +\n \"\");\n}]);\n\nangular.module(\"uib/template/typeahead/typeahead-popup.html\", []).run([\"$templateCache\", function ($templateCache) {\n $templateCache.put(\"uib/template/typeahead/typeahead-popup.html\",\n \"
        \\n\" +\n \"
      • \\n\" +\n \"
        \\n\" +\n \"
      • \\n\" +\n \"
      \\n\" +\n \"\");\n}]);\nangular.module('ui.bootstrap.carousel').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibCarouselCss && angular.element(document).find('head').prepend(''); angular.$$uibCarouselCss = true; });\nangular.module('ui.bootstrap.datepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerCss = true; });\nangular.module('ui.bootstrap.position').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibPositionCss && angular.element(document).find('head').prepend(''); angular.$$uibPositionCss = true; });\nangular.module('ui.bootstrap.datepickerPopup').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibDatepickerpopupCss && angular.element(document).find('head').prepend(''); angular.$$uibDatepickerpopupCss = true; });\nangular.module('ui.bootstrap.tooltip').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTooltipCss && angular.element(document).find('head').prepend(''); angular.$$uibTooltipCss = true; });\nangular.module('ui.bootstrap.timepicker').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTimepickerCss && angular.element(document).find('head').prepend(''); angular.$$uibTimepickerCss = true; });\nangular.module('ui.bootstrap.typeahead').run(function() {!angular.$$csp().noInlineStyle && !angular.$$uibTypeaheadCss && angular.element(document).find('head').prepend(''); angular.$$uibTypeaheadCss = true; });","require('./dist/ui-bootstrap-tpls');\n\nmodule.exports = 'ui.bootstrap';\n","/*!\nangular-xeditable - 0.10.2\nEdit-in-place for angular.js\nBuild date: 2019-11-01 \n*/\n/**\n * Angular-xeditable module\n *\n */\nangular.module('xeditable', [])\n\n\n/**\n * Default options.\n *\n * @namespace editable-options\n */\n//todo: maybe better have editableDefaults, not options...\n.value('editableOptions', {\n /**\n * Theme. Possible values `bs4`, `bs3`, `bs2`, `default`.\n * Default is `default`\n *\n * @var {string} theme\n * @memberOf editable-options\n */\n theme: 'default',\n /**\n * icon_set. Possible values `font-awesome`, `default`.\n * Default is `default`\n *\n * @var {string} icon set\n * @memberOf editable-options\n */\n icon_set: 'default',\n /**\n * Whether to show buttons for single editable element.\n * Possible values `right`, `no`.\n * Default is `right`\n *\n * @var {string} buttons\n * @memberOf editable-options\n */\n buttons: 'right',\n /**\n * Default value for `blur` attribute of single editable element.\n * Can be `cancel|submit|ignore`.\n * Default is `cancel`\n *\n * @var {string} blurElem\n * @memberOf editable-options\n */\n blurElem: 'cancel',\n /**\n * Default value for `blur` attribute of editable form.\n * Can be `cancel|submit|ignore`.\n * Default is `ignore`.\n *\n * @var {string} blurForm\n * @memberOf editable-options\n */\n blurForm: 'ignore',\n /**\n * How input elements get activated. Possible values: `focus|select|none`.\n * Default is `focus`\n *\n * @var {string} activate\n * @memberOf editable-options\n */\n activate: 'focus',\n /**\n * Whether to disable x-editable. Can be overloaded on each element.\n * Default is `false`\n *\n * @var {boolean} isDisabled\n * @memberOf editable-options\n */\n isDisabled: false,\n\n /**\n * Event, on which the edit mode gets activated.\n * Can be any event.\n * Default is `click`\n *\n * @var {string} activationEvent\n * @memberOf editable-options\n */\n activationEvent: 'click',\n\n /**\n * The default title of the submit button.\n * Default is `Submit`\n *\n * @var {string} submitButtonTitle\n * @memberOf editable-options\n */\n submitButtonTitle: 'Submit',\n\n /**\n * The default aria label of the submit button.\n * Default is `Submit`\n *\n * @var {string} submitButtonAriaLabel\n * @memberOf editable-options\n */\n submitButtonAriaLabel: 'Submit',\n\n /**\n * The default title of the cancel button.\n * Default is `Cancel`\n *\n * @var {string} cancelButtonTitle\n * @memberOf editable-options\n */\n cancelButtonTitle: 'Cancel',\n\n /**\n * The default aria label of the cancel button.\n * Default is `Cancel`\n *\n * @var {string} cancelButtonAriaLabel\n * @memberOf editable-options\n */\n cancelButtonAriaLabel: 'Cancel',\n\n /**\n * The default title of the clear button.\n * Default is `Clear`\n *\n * @var {string} clearButtonTitle\n * @memberOf editable-options\n */\n clearButtonTitle: 'Clear',\n\n /**\n * The default aria label of the clear button.\n * Default is `Clear`\n *\n * @var {string} clearButtonAriaLabel\n * @memberOf editable-options\n */\n clearButtonAriaLabel: 'Clear',\n\n /**\n * Whether to display the clear button.\n * Default is `false`\n *\n * @var {boolean} displayClearButton\n * @memberOf editable-options\n */\n displayClearButton: false\n});\n\n/*\n Angular-ui bootstrap datepicker\n http://angular-ui.github.io/bootstrap/#/datepicker\n */\nangular.module('xeditable').directive('editableBsdate', ['editableDirectiveFactory', '$injector', '$parse',\n function(editableDirectiveFactory, $injector, $parse) {\n\n // Constants from Angular-ui bootstrap datepicker\n var uibDatepickerConfig = $injector.get('uibDatepickerConfig');\n var uibDatepickerPopupConfig = $injector.get('uibDatepickerPopupConfig');\n\n var popupAttrNames = [\n ['eIsOpen', 'is-open'],\n ['eDateDisabled', 'date-disabled'],\n ['eDatepickerPopup', 'uib-datepicker-popup'],\n ['eShowButtonBar', 'show-button-bar'],\n ['eCurrentText', 'current-text'],\n ['eClearText', 'clear-text'],\n ['eCloseText', 'close-text'],\n ['eCloseOnDateSelection', 'close-on-date-selection'],\n ['eDatepickerAppendToBody', 'datepicker-append-to-body'],\n ['eOnOpenFocus', 'on-open-focus'],\n ['eName', 'name'],\n ['eDateDisabled', 'date-disabled'],\n ['eAltInputFormats', 'alt-input-formats'],\n ['eDatepickerTemplateUrl', 'datepicker-template-url']\n ];\n\n var dateOptionsNames = [\n ['eFormatDay', 'formatDay'],\n ['eFormatMonth', 'formatMonth'],\n ['eFormatYear', 'formatYear'],\n ['eFormatDayHeader', 'formatDayHeader'],\n ['eFormatDayTitle', 'formatDayTitle'],\n ['eFormatMonthTitle', 'formatMonthTitle'],\n ['eMaxMode', 'maxMode'],\n ['eMinMode', 'minMode'],\n ['eDatepickerMode', 'datepickerMode']\n ];\n\n return editableDirectiveFactory({\n directiveName: 'editableBsdate',\n inputTpl: '
      ',\n render: function() {\n /** This basically renders a datepicker as in the example shown in\n ** http://angular-ui.github.io/bootstrap/#/datepicker\n ** The attributes are all the same as in the bootstrap-ui datepicker with e- as prefix\n **/\n this.parent.render.call(this);\n\n var attrs = this.attrs;\n var scope = this.scope;\n\n var inputDatePicker = angular.element('');\n\n inputDatePicker.attr('uib-datepicker-popup', attrs.eDatepickerPopupXEditable || uibDatepickerPopupConfig.datepickerPopup );\n inputDatePicker.attr('year-range', attrs.eYearRange || 20);\n inputDatePicker.attr('ng-readonly', attrs.eReadonly || false);\n\n for (var i = popupAttrNames.length - 1; i >= 0; i--) {\n var popupAttr = attrs[popupAttrNames[i][0]];\n if (typeof popupAttr !== 'undefined') {\n inputDatePicker.attr(popupAttrNames[i][1], popupAttr);\n }\n }\n\n if (attrs.eNgChange) {\n inputDatePicker.attr('ng-change', attrs.eNgChange);\n this.inputEl.removeAttr('ng-change');\n }\n\n if (attrs.eStyle) {\n inputDatePicker.attr('style', attrs.eStyle);\n this.inputEl.removeAttr('style');\n }\n\n var dateOptions = {\n maxDate: scope.$eval(attrs.eMaxDate) || uibDatepickerConfig.maxDate,\n minDate: scope.$eval(attrs.eMinDate) || uibDatepickerConfig.minDate,\n showWeeks: attrs.eShowWeeks ? attrs.eShowWeeks.toLowerCase() === 'true' : uibDatepickerConfig.showWeeks,\n startingDay: attrs.eStartingDay || 0,\n initDate: scope.$eval(attrs.eInitDate) || new Date()\n };\n\n if (attrs.eDatepickerOptions) {\n var eDatepickerOptions = $parse(attrs.eDatepickerOptions)(scope);\n angular.extend(dateOptions, eDatepickerOptions);\n }\n\n for (var z = dateOptionsNames.length - 1; z >= 0; z--) {\n var doAttr = attrs[dateOptionsNames[z][0]];\n if (typeof doAttr !== 'undefined') {\n dateOptions[dateOptionsNames[z][1]] = doAttr;\n }\n }\n\n scope.dateOptions = dateOptions;\n\n var showCalendarButton = angular.isDefined(attrs.eShowCalendarButton) ? attrs.eShowCalendarButton : \"true\";\n\n //See if calendar button should be displayed\n if (showCalendarButton === \"true\") {\n var buttonDatePicker = angular.element('');\n var buttonWrapper = angular.element('');\n\n buttonDatePicker.attr('ng-click', attrs.eNgClick);\n\n buttonWrapper.append(buttonDatePicker);\n\n this.inputEl.append(buttonWrapper);\n } else {\n //If no calendar button, display calendar popup on click of input field\n inputDatePicker.attr('ng-click', attrs.eNgClick);\n }\n\n inputDatePicker.attr('datepicker-options', \"dateOptions\");\n\n this.inputEl.prepend(inputDatePicker);\n\n this.inputEl.removeAttr('class');\n this.inputEl.removeAttr('ng-click');\n this.inputEl.removeAttr('is-open');\n this.inputEl.removeAttr('init-date');\n this.inputEl.removeAttr('datepicker-popup');\n this.inputEl.removeAttr('required');\n this.inputEl.removeAttr('ng-model');\n this.inputEl.removeAttr('date-picker-append-to-body');\n this.inputEl.removeAttr('name');\n this.inputEl.attr('class','input-group');\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('change', function() {\n setTimeout(function() {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }, 500);\n });\n\n self.inputEl.bind('keydown', function(e) {\n //submit on tab\n if (e.keyCode === 9 && self.editorEl.attr('blur') === 'submit') {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }\n });\n }\n });\n}]);\n\n/*\nAngular-ui bootstrap editable timepicker\nhttp://angular-ui.github.io/bootstrap/#/timepicker\n*/\nangular.module('xeditable').directive('editableBstime', ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: 'editableBstime',\n inputTpl: '
      ',\n render: function() {\n this.parent.render.call(this);\n\n // timepicker can't update model when ng-model set directly to it\n // see: https://github.com/angular-ui/bootstrap/issues/1141\n // so we wrap it into DIV\n var div = angular.element('
      ');\n\n // move ng-model to wrapping div\n div.attr('ng-model', this.inputEl.attr('ng-model'));\n this.inputEl.removeAttr('ng-model');\n\n // move ng-change to wrapping div\n if(this.attrs.eNgChange) {\n div.attr('ng-change', this.inputEl.attr('ng-change'));\n this.inputEl.removeAttr('ng-change');\n }\n\n // wrap\n this.inputEl.wrap(div);\n }\n });\n}]);\n//checkbox\nangular.module('xeditable').directive('editableCheckbox', ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: 'editableCheckbox',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n this.inputEl.wrap('');\n \n if (this.attrs.eTitle) {\n this.inputEl.parent().append('' + this.attrs.eTitle + '');\n }\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('change', function() {\n setTimeout(function() {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }, 500);\n });\n }\n });\n}]);\n\n// checklist\nangular.module('xeditable').directive('editableChecklist', [\n 'editableDirectiveFactory',\n 'editableNgOptionsParser',\n function(editableDirectiveFactory, editableNgOptionsParser) {\n return editableDirectiveFactory({\n directiveName: 'editableChecklist',\n inputTpl: '',\n useCopy: true,\n render: function() {\n this.parent.render.call(this);\n var parsed = editableNgOptionsParser(this.attrs.eNgOptions);\n var ngChangeHtml = '';\n var ngChecklistComparatorHtml = '';\n var ngDisabled = '';\n\n if (this.attrs.eNgChange) {\n ngChangeHtml = ' ng-change=\"' + this.attrs.eNgChange + '\"';\n }\n\n if (this.attrs.eChecklistComparator) {\n ngChecklistComparatorHtml = ' checklist-comparator=\"' + this.attrs.eChecklistComparator + '\"';\n }\n\n if(this.attrs.eNgDisabled){\n ngDisabled = ' ng-disabled=\"' + this.attrs.eNgDisabled+'\"';\n }\n \n var html = '';\n\n this.inputEl.removeAttr('ng-model');\n this.inputEl.removeAttr('ng-options');\n this.inputEl.removeAttr('ng-change');\n this.inputEl.removeAttr('checklist-comparator');\n this.inputEl.html(html);\n }\n });\n}]);\n\nangular.module('xeditable').directive('editableCombodate', ['editableDirectiveFactory', 'editableCombodate',\n function(editableDirectiveFactory, editableCombodate) {\n return editableDirectiveFactory({\n directiveName: 'editableCombodate',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n\n var options = {\n value: new Date(this.scope.$data)\n };\n var self = this;\n angular.forEach([\"format\", \"template\", \"minYear\", \"maxYear\", \"yearDescending\", \"minuteStep\", \"secondStep\", \"firstItem\", \"errorClass\", \"customClass\", \"roundTime\", \"smartDays\"], function(name) {\n\n var attrName = \"e\" + name.charAt(0).toUpperCase() + name.slice(1);\n\n if (attrName in self.attrs) {\n if (name == \"minYear\" || name == \"maxYear\" || name == \"minuteStep\" || name == \"secondStep\") {\n options[name] = parseInt(self.attrs[attrName], 10);\n } else {\n options[name] = self.attrs[attrName];\n }\n }\n });\n\n var combodate = editableCombodate.getInstance(this.inputEl, options);\n combodate.$widget.find('select').bind('change', function(e) {\n self.scope.$data = combodate.getValue() ?\n moment(combodate.getValue(), combodate.options.format).toDate().toISOString() : null;\n }).change();\n }\n });\n }\n]);\n/*\nInput types: text|password|email|tel|number|url|search|color|date|datetime|datetime-local|time|month|week|file\n*/\n\n(function() {\n\n var camelCase = function(dashDelimitedString) {\n return dashDelimitedString.toLowerCase().replace(/-(.)/g, function(match, word) {\n return word.toUpperCase();\n });\n };\n\n var types = 'text|password|email|tel|number|url|search|color|date|datetime|datetime-local|time|month|week|file'.split('|');\n\n //todo: datalist\n\n // generate directives\n angular.forEach(types, function(type) {\n var directiveName = camelCase('editable' + '-' + type);\n angular.module('xeditable').directive(directiveName, ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: directiveName,\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n\n var attrs = this.attrs;\n var scope = this.scope;\n\n //Add bootstrap simple input groups\n if (attrs.eInputgroupleft || attrs.eInputgroupright) {\n this.inputEl.wrap('
      ');\n\n if (attrs.eInputgroupleft) {\n var inputGroupLeft = angular.element('');\n this.inputEl.parent().prepend(inputGroupLeft);\n }\n\n if (attrs.eInputgroupright) {\n var inputGroupRight = angular.element('');\n this.inputEl.parent().append(inputGroupRight);\n }\n }\n\n // Add label to the input\n if (attrs.eLabel) {\n var label = angular.element('');\n if (attrs.eInputgroupleft || attrs.eInputgroupright) {\n this.inputEl.parent().parent().prepend(label);\n } else {\n this.inputEl.parent().prepend(label);\n }\n }\n\n // Add classes to the form\n if (attrs.eFormclass) {\n this.editorEl.addClass(attrs.eFormclass);\n this.inputEl.removeAttr('formclass');\n }\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('keydown', function(e) {\n //submit on tab\n if (e.keyCode === 9 && self.editorEl.attr('blur') === 'submit') {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }\n });\n }\n });\n }]);\n });\n\n //`range` is bit specific\n angular.module('xeditable').directive('editableRange', ['editableDirectiveFactory', '$interpolate',\n function(editableDirectiveFactory, $interpolate) {\n return editableDirectiveFactory({\n directiveName: 'editableRange',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n this.inputEl.after('' + $interpolate.startSymbol() + '$data' + $interpolate.endSymbol() + '');\n }\n });\n }]);\n\n}());\n\n\n/*\n Tags input directive for AngularJS\n https://github.com/mbenford/ngTagsInput\n */\nangular.module('xeditable').directive('editableTagsInput', ['editableDirectiveFactory', 'editableUtils',\n function(editableDirectiveFactory, editableUtils) {\n var dir = editableDirectiveFactory({\n directiveName: 'editableTagsInput',\n inputTpl: '',\n useCopy: true,\n render: function () {\n this.parent.render.call(this);\n this.inputEl.append(editableUtils.rename('auto-complete', this.attrs.$autoCompleteElement));\n this.inputEl.removeAttr('ng-model');\n this.inputEl.attr('ng-model', '$parent.$data');\n }\n });\n\n var linkOrg = dir.link;\n\n dir.link = function (scope, el, attrs, ctrl) {\n var autoCompleteEl = el.find('editable-tags-input-auto-complete');\n\n attrs.$autoCompleteElement = autoCompleteEl.clone();\n\n autoCompleteEl.remove();\n\n return linkOrg(scope, el, attrs, ctrl);\n };\n\n return dir;\n}]);\n// radiolist\nangular.module('xeditable').directive('editableRadiolist', [\n 'editableDirectiveFactory',\n 'editableNgOptionsParser',\n '$interpolate',\n function(editableDirectiveFactory, editableNgOptionsParser, $interpolate) {\n return editableDirectiveFactory({\n directiveName: 'editableRadiolist',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n var parsed = editableNgOptionsParser(this.attrs.eNgOptions),\n ngChangeHtml = '',\n ngNameHtml = '',\n ngValueFn = isNaN(parsed.locals.valueFn) ? \"'\" + parsed.locals.valueFn + \"'\" : parsed.locals.valueFn,\n ngDisabled = this.attrs.eNgDisabled ? this.attrs.eNgDisabled : false;\n\n if (this.attrs.eNgChange) {\n ngChangeHtml = ' ng-change=\"' + this.attrs.eNgChange + '\"';\n }\n\n if (this.attrs.eName) {\n ngNameHtml = ' name=\"' + this.attrs.eName + '\"';\n }\n\n var html = '';\n\n this.inputEl.removeAttr('ng-model');\n this.inputEl.removeAttr('ng-options');\n this.inputEl.removeAttr('ng-change');\n this.inputEl.html(html);\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('change', function() {\n setTimeout(function() {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }, 500);\n });\n }\n });\n}]);\n\n//select\nangular.module('xeditable').directive('editableSelect', ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: 'editableSelect',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n\n if (this.attrs.ePlaceholder) {\n var placeholder = angular.element('');\n this.inputEl.append(placeholder);\n }\n },\n autosubmit: function() {\n var self = this;\n\n if (!self.attrs.hasOwnProperty(\"eMultiple\")) {\n self.inputEl.bind('change', function () {\n self.scope.$apply(function () {\n self.scope.$form.$submit();\n });\n });\n }\n }\n });\n}]);\n//textarea\nangular.module('xeditable').directive('editableTextarea', ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: 'editableTextarea',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n\n // Add classes to the form\n if (this.attrs.eFormclass) {\n this.editorEl.addClass(this.attrs.eFormclass);\n this.inputEl.removeAttr('formclass');\n }\n },\n addListeners: function() {\n var self = this;\n self.parent.addListeners.call(self);\n // submit textarea by ctrl+enter even with buttons\n if (self.single && self.buttons !== 'no') {\n self.autosubmit();\n }\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('keydown', function(e) {\n if (self.attrs.submitOnEnter) {\n if (e.keyCode === 13 && !e.shiftKey) {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }\n } else if ((e.ctrlKey || e.metaKey) && (e.keyCode === 13) || \n (e.keyCode === 9 && self.editorEl.attr('blur') === 'submit')) {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }\n });\n }\n });\n}]);\n\n/*\n jQuery UI Datepicker for AngularJS\n https://github.com/angular-ui/ui-date\n */\nangular.module('xeditable').directive('editableUidate', ['editableDirectiveFactory',\n function(editableDirectiveFactory) {\n return editableDirectiveFactory({\n directiveName: 'editableUidate',\n inputTpl: '',\n render: function() {\n this.parent.render.call(this);\n this.inputEl.attr('ui-date', this.attrs.eUiDate);\n this.inputEl.attr('placeholder', this.attrs.ePlaceholder);\n }\n });\n}]);\n\n/*\n AngularJS-native version of Select2 and Selectize\n https://github.com/angular-ui/ui-select\n */\nangular.module('xeditable').directive('editableUiSelect',['editableDirectiveFactory', 'editableUtils',\n function(editableDirectiveFactory, editableUtils) {\n var dir = editableDirectiveFactory({\n directiveName: 'editableUiSelect',\n inputTpl: '',\n render: function () {\n this.parent.render.call(this);\n this.inputEl.append(editableUtils.rename('ui-select-match', this.attrs.$matchElement));\n this.inputEl.append(editableUtils.rename('ui-select-choices', this.attrs.$choicesElement));\n this.inputEl.removeAttr('ng-model');\n this.inputEl.attr('ng-model', '$parent.$parent.$data');\n },\n autosubmit: function() {\n var self = this;\n self.inputEl.bind('change', function() {\n setTimeout(function() {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }, 500);\n });\n\n self.inputEl.bind('keydown', function(e) {\n //submit on tab\n if (e.keyCode === 9 && self.editorEl.attr('blur') === 'submit') {\n self.scope.$apply(function() {\n self.scope.$form.$submit();\n });\n }\n });\n }\n });\n\n var linkOrg = dir.link;\n\n dir.link = function (scope, el, attrs, ctrl) {\n var matchEl = el.find('editable-ui-select-match');\n var choicesEl = el.find('editable-ui-select-choices');\n\n attrs.$matchElement = matchEl.clone();\n attrs.$choicesElement = choicesEl.clone();\n\n matchEl.remove();\n choicesEl.remove();\n\n return linkOrg(scope, el, attrs, ctrl);\n };\n\n return dir;\n }]);\n/**\n * EditableController class.\n * Attached to element with `editable-xxx` directive.\n *\n * @namespace editable-element\n */\n/*\nTODO: this file should be refactored to work more clear without closures!\n*/\nangular.module('xeditable').factory('editableController',\n ['$q', 'editableUtils',\n function ($q, editableUtils) {\n\n //EditableController function\n EditableController.$inject = ['$scope', '$attrs', '$element', '$parse', 'editableThemes', 'editableIcons', 'editableOptions', '$rootScope', '$compile', '$q', '$sce', '$templateCache'];\n function EditableController($scope, $attrs, $element, $parse, editableThemes, editableIcons, editableOptions, $rootScope, $compile, $q, $sce, $templateCache) {\n var valueGetter;\n\n //if control is disabled - it does not participate in waiting process\n var inWaiting;\n\n var self = this;\n\n self.scope = $scope;\n self.elem = $element;\n self.attrs = $attrs;\n self.inputEl = null;\n self.editorEl = null;\n self.single = true;\n self.error = '';\n self.theme = editableThemes[$attrs.editableTheme] || editableThemes[editableOptions.theme] || editableThemes['default'];\n self.parent = {};\n\n //will be undefined if icon_set is default and theme is default\n var theme_name = $attrs.editableTheme || editableOptions.theme || 'default';\n // The theme_name will not be correct if the theme set in options is unavailable\n // However, in that case an undefined icon_set is not that bad...\n var icon_set_option = $attrs.editableIconSet || editableOptions.icon_set;\n self.icon_set = icon_set_option === 'default' ? editableIcons.default[theme_name] : editableIcons.external[icon_set_option];\n\n //to be overwritten by directive\n self.inputTpl = '';\n self.directiveName = '';\n\n // with majority of controls copy is not needed, but..\n // copy MUST NOT be used for `select-multiple` with objects as items\n // copy MUST be used for `checklist`\n self.useCopy = false;\n\n //runtime (defaults)\n self.single = null;\n\n /**\n * Attributes defined with `e-*` prefix automatically transferred from original element to\n * control.\n * For example, if you set `\n * then input will appear as ``.\n * See [demo](#text-customize).\n *\n * @var {any|attribute} e-*\n * @memberOf editable-element\n */\n\n /**\n * Whether to show ok/cancel buttons. Values: `right|no`.\n * If set to `no` control automatically submitted when value changed.\n * If control is part of form buttons will never be shown.\n *\n * @var {string|attribute} buttons\n * @memberOf editable-element\n */\n self.buttons = 'right';\n\n /**\n * Whether to show the editable element in a ui-bootstrap popover. Values: `true|false`.\n *\n * @var {boolean|attribute} popover\n * @memberOf editable-element\n */\n self.popover = false;\n\n /**\n * Action when control losses focus. Values: `cancel|submit|ignore`.\n * Has sense only for single editable element.\n * Otherwise, if control is part of form - you should set `blur` of form, not of individual element.\n *\n * @var {string|attribute} blur\n * @memberOf editable-element\n */\n // no real `blur` property as it is transferred to editable form\n\n\n /**\n * Listen to Mouse Down event instead of click: `true|false`.\n * Has sense only for single editable element.\n *\n * @var {string|attribute} usemousedown\n * @memberOf editable-element\n */\n\n //init\n self.init = function (single) {\n self.single = single;\n\n self.name = $attrs.eName || $attrs[self.directiveName];\n /*\n if(!$attrs[directiveName] && !$attrs.eNgModel && ($attrs.eValue === undefined)) {\n throw 'You should provide value for `'+directiveName+'` or `e-value` in editable element!';\n }\n */\n if ($attrs[self.directiveName]) {\n valueGetter = $parse($attrs[self.directiveName]);\n } else {\n throw 'You should provide value for `' + self.directiveName + '` in editable element!';\n }\n\n // settings for single and non-single\n if (!self.single) {\n // hide buttons for non-single\n self.buttons = 'no';\n } else {\n self.buttons = self.attrs.buttons || editableOptions.buttons;\n }\n\n //if name defined --> watch changes and update $data in form\n if ($attrs.eName) {\n self.scope.$watch('$data', function (newVal) {\n self.scope.$form.$data[$attrs.eName] = newVal;\n });\n }\n\n /**\n * Called when control is shown.\n * See [demo](#select-remote).\n *\n * @var {method|attribute} onshow\n * @memberOf editable-element\n */\n if ($attrs.onshow) {\n self.onshow = function () {\n return self.catchError($parse($attrs.onshow)($scope));\n };\n }\n\n /**\n * Called when control is hidden after both save or cancel.\n *\n * @var {method|attribute} onhide\n * @memberOf editable-element\n */\n if ($attrs.onhide) {\n self.onhide = function () {\n return $parse($attrs.onhide)($scope);\n };\n }\n\n /**\n * Called when control is cancelled.\n *\n * @var {method|attribute} oncancel\n * @memberOf editable-element\n */\n if ($attrs.oncancel) {\n self.oncancel = function () {\n return $parse($attrs.oncancel)($scope);\n };\n }\n\n /**\n * Called during submit before value is saved to model.\n * See [demo](#onbeforesave).\n *\n * @var {method|attribute} onbeforesave\n * @memberOf editable-element\n */\n if ($attrs.onbeforesave) {\n self.onbeforesave = function () {\n return self.catchError($parse($attrs.onbeforesave)($scope));\n };\n }\n\n /**\n * Called during submit after value is saved to model.\n * See [demo](#onaftersave).\n *\n * @var {method|attribute} onaftersave\n * @memberOf editable-element\n */\n if ($attrs.onaftersave) {\n self.onaftersave = function () {\n return self.catchError($parse($attrs.onaftersave)($scope));\n };\n }\n\n if ($attrs.popover) {\n self.popover = self.attrs.popover;\n }\n\n // watch change of model to update editable element\n // now only add/remove `editable-empty` class.\n // Initially this method called with newVal = undefined, oldVal = undefined\n // so no need initially call handleEmpty() explicitly\n $scope.$parent.$watch($attrs[self.directiveName], function (newVal, oldVal) {\n self.setLocalValue();\n self.handleEmpty();\n });\n };\n\n self.render = function () {\n var theme = self.theme;\n\n //build input\n self.inputEl = angular.element(self.inputTpl);\n\n //build controls\n self.controlsEl = angular.element(theme.controlsTpl);\n self.controlsEl.append(self.inputEl);\n\n //build buttons\n if (self.buttons !== 'no') {\n self.buttonsEl = angular.element(theme.buttonsTpl);\n self.submitEl = angular.element(theme.submitTpl);\n self.resetEl = angular.element(theme.resetTpl);\n self.cancelEl = angular.element(theme.cancelTpl);\n self.submitEl.attr('title', editableOptions.submitButtonTitle);\n self.submitEl.attr('aria-label', editableOptions.submitButtonAriaLabel);\n self.cancelEl.attr('title', editableOptions.cancelButtonTitle);\n self.cancelEl.attr('aria-label', editableOptions.cancelButtonAriaLabel);\n self.resetEl.attr('title', editableOptions.clearButtonTitle);\n self.resetEl.attr('aria-label', editableOptions.clearButtonAriaLabel);\n\n if (self.icon_set) {\n self.submitEl.find('span').addClass(self.icon_set.ok);\n self.cancelEl.find('span').addClass(self.icon_set.cancel);\n self.resetEl.find('span').addClass(self.icon_set.clear);\n }\n\n self.buttonsEl.append(self.submitEl).append(self.cancelEl);\n\n if (editableOptions.displayClearButton) {\n self.buttonsEl.append(self.resetEl);\n }\n\n self.controlsEl.append(self.buttonsEl);\n\n self.inputEl.addClass('editable-has-buttons');\n }\n\n //build error\n self.errorEl = angular.element(theme.errorTpl);\n self.controlsEl.append(self.errorEl);\n\n //build editor\n self.editorEl = angular.element(self.single ? theme.formTpl : theme.noformTpl);\n self.editorEl.append(self.controlsEl);\n\n // transfer `e-*|data-e-*|x-e-*` attributes\n for (var k in $attrs.$attr) {\n if (k.length <= 1) {\n continue;\n }\n var transferAttr = false;\n var nextLetter = k.substring(1, 2);\n\n // if starts with `e` + uppercase letter\n if (k.substring(0, 1) === 'e' && nextLetter === nextLetter.toUpperCase()) {\n transferAttr = k.substring(1); // cut `e`\n } else {\n continue;\n }\n\n // exclude `form` and `ng-submit`,\n if (transferAttr === 'Form' || transferAttr === 'NgSubmit') {\n continue;\n }\n\n var firstLetter = transferAttr.substring(0, 1);\n var secondLetter = transferAttr.substring(1, 2);\n\n // convert back to lowercase style\n if (secondLetter === secondLetter.toUpperCase() &&\n firstLetter === firstLetter.toUpperCase()) {\n transferAttr = firstLetter.toLowerCase() + '-' + editableUtils.camelToDash(transferAttr.substring(1));\n } else {\n transferAttr = firstLetter.toLowerCase() + editableUtils.camelToDash(transferAttr.substring(1));\n }\n\n // workaround for attributes without value (e.g. `multiple = \"multiple\"`)\n // except for 'e-value'\n var attrValue = (transferAttr !== 'value' && $attrs[k] === '') ? transferAttr : $attrs[k];\n\n // set attributes to input\n self.inputEl.attr(transferAttr, attrValue);\n }\n\n self.inputEl.addClass('editable-input');\n self.inputEl.attr('ng-model', '$parent.$data');\n\n // add directiveName class to editor, e.g. `editable-text`\n self.editorEl.addClass(editableUtils.camelToDash(self.directiveName));\n\n if (self.single) {\n self.editorEl.attr('editable-form', '$form');\n // transfer `blur` to form\n self.editorEl.attr('blur', self.attrs.blur || editableOptions.blurElem);\n }\n\n //apply `postrender` method of theme\n if (angular.isFunction(theme.postrender)) {\n theme.postrender.call(self);\n }\n\n };\n\n // with majority of controls copy is not needed, but..\n // copy MUST NOT be used for `select-multiple` with objects as items\n // copy MUST be used for `checklist`\n self.setLocalValue = function () {\n self.scope.$data = self.useCopy ?\n angular.copy(valueGetter($scope.$parent)) :\n valueGetter($scope.$parent);\n };\n\n // reference of the scope to use for $compile\n var newScope = null;\n //show\n self.show = function () {\n // set value of scope.$data\n self.setLocalValue();\n\n /*\n Originally render() was inside init() method, but some directives polluting editorEl,\n so it is broken on second opening.\n Cloning is not a solution as jqLite can not clone with event handler's.\n */\n self.render();\n\n // insert into DOM\n $element.after(self.editorEl);\n\n // compile (needed to attach ng-* events from markup)\n newScope = $scope.$new();\n $compile(self.editorEl)(newScope);\n\n // attach listeners (`escape`, autosubmit, etc)\n self.addListeners();\n\n // hide element\n $element.addClass('editable-hide');\n\n if (self.popover) {\n var wrapper = angular.element('
      ');\n wrapper.append(self.editorEl);\n self.editorEl = wrapper;\n $templateCache.put('popover.html', self.editorEl[0].outerHTML);\n }\n\n // onshow\n return self.onshow();\n };\n\n //hide\n self.hide = function () {\n\n // destroy the scope to prevent memory leak\n newScope.$destroy();\n\n self.controlsEl.remove();\n self.editorEl.remove();\n $element.removeClass('editable-hide');\n\n if (self.popover) {\n $templateCache.remove('popover.html');\n }\n\n // onhide\n return self.onhide();\n };\n\n // cancel\n self.cancel = function () {\n // oncancel\n self.oncancel();\n // don't call hide() here as it called in form's code\n };\n\n /*\n Called after show to attach listeners\n */\n self.addListeners = function () {\n // bind keyup for `escape`\n self.inputEl.bind('keyup', function (e) {\n if (!self.single) {\n return;\n }\n\n // todo: move this to editable-form!\n switch (e.keyCode) {\n // hide on `escape` press\n case 27:\n self.scope.$apply(function () {\n self.scope.$form.$cancel();\n });\n break;\n }\n });\n\n // autosubmit when `no buttons`\n if (self.single && self.buttons === 'no') {\n self.autosubmit();\n }\n\n // click - mark element as clicked to exclude in document click handler\n self.editorEl.bind('click', function (e) {\n // ignore right/middle button click\n if (e.which && e.which !== 1) {\n return;\n }\n\n if (self.scope.$form.$visible) {\n self.scope.$form._clicked = true;\n }\n });\n };\n\n // setWaiting\n self.setWaiting = function (value) {\n if (value) {\n // participate in waiting only if not disabled\n inWaiting = !self.inputEl.attr('disabled') &&\n !self.inputEl.attr('ng-disabled') &&\n !self.inputEl.attr('ng-enabled');\n if (inWaiting) {\n self.inputEl.attr('disabled', 'disabled');\n if (self.buttonsEl) {\n self.buttonsEl.find('button').attr('disabled', 'disabled');\n }\n }\n } else {\n if (inWaiting) {\n self.inputEl.removeAttr('disabled');\n if (self.buttonsEl) {\n self.buttonsEl.find('button').removeAttr('disabled');\n }\n }\n }\n };\n\n self.activate = function (start, end) {\n setTimeout(function () {\n var el = self.inputEl[0];\n\n if (editableOptions.activate === 'focus' && el.focus) {\n if (start !== undefined && start !== \"\" && el.setSelectionRange) {\n end = end || start;\n el.onfocus = function () {\n setTimeout(function () {\n try {\n this.setSelectionRange(start, end);\n } catch (e) {\n //do nothing, this input doesn't support setSelectionRange\n }\n }.bind(this));\n };\n }\n\n if (self.directiveName == 'editableRadiolist' || self.directiveName == 'editableChecklist' ||\n self.directiveName == 'editableBsdate' || self.directiveName == 'editableTagsInput') {\n //Set focus to first pristine element in the list\n el.querySelector('.ng-pristine').focus();\n } else {\n el.focus();\n }\n } else if (editableOptions.activate === 'select') {\n if (el.select) {\n el.select();\n } else if (el.focus) {\n el.focus();\n }\n }\n }, 0);\n };\n\n self.setError = function (msg) {\n if (!angular.isObject(msg)) {\n $scope.$error = $sce.trustAsHtml(msg);\n self.error = msg;\n }\n };\n\n /*\n Checks that result is string or promise returned string and shows it as error message\n Applied to onshow, onbeforesave, onaftersave\n */\n self.catchError = function (result, noPromise) {\n if (angular.isObject(result) && noPromise !== true) {\n $q.when(result).then(\n //success and fail handlers are equal\n angular.bind(this, function (r) {\n this.catchError(r, true);\n }),\n angular.bind(this, function (r) {\n this.catchError(r, true);\n })\n );\n //check $http error\n } else if (noPromise && angular.isObject(result) && result.status &&\n (result.status !== 200) && result.data && angular.isString(result.data)) {\n this.setError(result.data);\n //set result to string: to let form know that there was error\n result = result.data;\n } else if (angular.isString(result)) {\n this.setError(result);\n }\n return result;\n };\n\n self.save = function () {\n valueGetter.assign($scope.$parent,\n self.useCopy ? angular.copy(self.scope.$data) : self.scope.$data);\n\n // no need to call handleEmpty here as we are watching change of model value\n // self.handleEmpty();\n };\n\n /*\n attach/detach `editable-empty` class to element\n */\n self.handleEmpty = function () {\n var val = valueGetter($scope.$parent);\n var isEmpty = val === null || val === undefined || val === \"\" || (angular.isArray(val) && val.length === 0);\n $element.toggleClass('editable-empty', isEmpty);\n };\n\n /*\n Called when `buttons = \"no\"` to submit automatically\n */\n self.autosubmit = angular.noop;\n\n self.onshow = angular.noop;\n self.onhide = angular.noop;\n self.oncancel = angular.noop;\n self.onbeforesave = angular.noop;\n self.onaftersave = angular.noop;\n }\n\n return EditableController;\n }]);\n\n/*\neditableFactory is used to generate editable directives (see `/directives` folder)\nInside it does several things:\n- detect form for editable element. Form may be one of three types:\n 1. autogenerated form (for single editable elements)\n 2. wrapper form (element wrapped by
      tag)\n 3. linked form (element has `e-form` attribute pointing to existing form)\n\n- attach editableController to element\n\nDepends on: editableController, editableFormFactory\n*/\nangular.module('xeditable').factory('editableDirectiveFactory',\n['$parse', '$compile', 'editableThemes', '$rootScope', '$document', 'editableController', 'editableFormController', 'editableOptions',\nfunction($parse, $compile, editableThemes, $rootScope, $document, editableController, editableFormController, editableOptions) {\n\n //directive object\n return function(overwrites) {\n return {\n restrict: 'A',\n scope: true,\n require: [overwrites.directiveName, '?^form'],\n controller: editableController,\n link: function(scope, elem, attrs, ctrl) {\n // editable controller\n var eCtrl = ctrl[0];\n\n // form controller\n var eFormCtrl;\n\n // this variable indicates is element is bound to some existing form,\n // or it's single element who's form will be generated automatically\n // By default consider single element without any linked form.ß\n var hasForm = false;\n\n // element wrapped by form\n if (ctrl[1]) {\n eFormCtrl = ctrl[1];\n hasForm = attrs.eSingle === undefined;\n } else if (attrs.eForm) { // element not wrapped by , but we have `e-form` attr\n var getter = $parse(attrs.eForm)(scope);\n if (getter) { // form exists in scope (above), e.g. editable column\n eFormCtrl = getter;\n hasForm = true;\n } else if (elem && typeof elem.parents === \"function\" && elem.parents().last().find('form[name=\"'+attrs.eForm+'\"]').length) { // form exists below or not exist at all: check document.forms\n // form is below and not processed yet\n eFormCtrl = null;\n hasForm = true;\n } else {\n // form exists below or not exist at all: check document.forms\n for (var i=0; i<$document[0].forms.length;i++) {\n if ($document[0].forms[i].name === attrs.eForm) {\n // form is below and not processed yet\n eFormCtrl = null;\n hasForm = true;\n break;\n }\n }\n }\n }\n\n /*\n if(hasForm && !attrs.eName) {\n throw 'You should provide `e-name` for editable element inside form!';\n }\n */\n\n //check for `editable-form` attr in form\n /*\n if(eFormCtrl && ) {\n throw 'You should provide `e-name` for editable element inside form!';\n }\n */\n\n // store original props to `parent` before merge\n angular.forEach(overwrites, function(v, k) {\n if(eCtrl[k] !== undefined) {\n eCtrl.parent[k] = eCtrl[k];\n }\n });\n\n // merge overwrites to base editable controller\n angular.extend(eCtrl, overwrites);\n\n // x-editable can be disabled using editableOption or edit-disabled attribute\n var is_disabled = function() {\n return angular.isDefined(attrs.editDisabled) ?\n scope.$eval(attrs.editDisabled) :\n editableOptions.isDisabled;\n };\n\n // init editable ctrl\n eCtrl.init(!hasForm);\n\n // publich editable controller as `$editable` to be referenced in html\n scope.$editable = eCtrl;\n\n // add `editable` class to element\n elem.addClass('editable');\n\n // hasForm\n if(hasForm) {\n if(eFormCtrl) {\n scope.$form = eFormCtrl;\n if(!scope.$form.$addEditable) {\n throw 'Form with editable elements should have `editable-form` attribute.';\n }\n scope.$form.$addEditable(eCtrl);\n } else {\n // future form (below): add editable controller to buffer and add to form later\n $rootScope.$$editableBuffer = $rootScope.$$editableBuffer || {};\n $rootScope.$$editableBuffer[attrs.eForm] = $rootScope.$$editableBuffer[attrs.eForm] || [];\n $rootScope.$$editableBuffer[attrs.eForm].push(eCtrl);\n scope.$form = null; //will be re-assigned later\n }\n // !hasForm\n } else {\n // create editableform controller\n scope.$form = editableFormController();\n // add self to editable controller\n scope.$form.$addEditable(eCtrl);\n\n // if `e-form` provided, publish local $form in scope\n if(attrs.eForm) {\n ($parse(attrs.eForm).assign || angular.noop)(scope.$parent, scope.$form);\n }\n\n // bind click - if no external form defined\n if(!attrs.eForm || attrs.eClickable) {\n elem.addClass('editable-click');\n elem.bind(editableOptions.activationEvent, function(e) {\n e.preventDefault();\n e.editable = eCtrl;\n if(!is_disabled()) {\n scope.$apply(function(){\n scope.$form.$show();\n });\n }\n });\n }\n }\n\n }\n };\n };\n}]);\n\n/*\nReturns editableForm controller\n*/\nangular.module('xeditable').factory('editableFormController',\n ['$parse', '$document', '$rootScope', 'editablePromiseCollection', 'editableUtils', 'editableOptions',\n function ($parse, $document, $rootScope, editablePromiseCollection, editableUtils, editableOptions) {\n\n // array of opened editable forms\n var shown = [];\n\n //Check if the child element correspond or is a descendant of the parent element\n var isSelfOrDescendant = function (parent, child) {\n if (child === parent || (editableOptions.activationEvent === \"focus\" && child === parent.parentNode)) {\n return true;\n }\n\n var node = child.parentNode;\n\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n };\n\n //Check if it is a real blur : if the click event appear on a shown editable elem, this is not a blur.\n var isBlur = function (shown, event) {\n var isBlur = true;\n\n var editables = shown.$editables;\n angular.forEach(editables, function (v) {\n var element = v.editorEl[0];\n if (isSelfOrDescendant(element, event.target))\n isBlur = false;\n\n });\n return isBlur;\n };\n\n var clickHandler = function (e) {\n // ignore right/middle button click\n if (e.which && e.which !== 1) {\n return;\n }\n\n var toCancel = [];\n var toSubmit = [];\n for (var i = 0; i < shown.length; i++) {\n // console.log(\"in for\", shown[i]);\n // exclude clicked\n if (shown[i]._clicked) {\n shown[i]._clicked = false;\n continue;\n }\n\n // exclude waiting\n if (shown[i].$waiting) {\n continue;\n }\n\n if (shown[i]._blur === 'cancel' && isBlur(shown[i], e)) {\n toCancel.push(shown[i]);\n }\n\n if (shown[i]._blur === 'submit' && isBlur(shown[i], e)) {\n toSubmit.push(shown[i]);\n }\n }\n\n if (toCancel.length || toSubmit.length) {\n $rootScope.$apply(function () {\n angular.forEach(toCancel, function (v) { v.$cancel(); });\n angular.forEach(toSubmit, function (v) { v.$submit(); });\n });\n }\n };\n\n\n\n $rootScope.$on('closeEdit', function () {\n for (var i = 0; i < shown.length; i++) {\n shown[i].$hide();\n }\n });\n\n var base = {\n $addEditable: function (editable) {\n //console.log('add editable', editable.elem, editable.elem.bind);\n this.$editables.push(editable);\n\n //'on' is not supported in angular 1.0.8\n editable.elem.bind('$destroy', angular.bind(this, this.$removeEditable, editable));\n\n //bind editable's local $form to self (if not bound yet, below form)\n if (!editable.scope.$form) {\n editable.scope.$form = this;\n }\n\n //if form already shown - call show() of new editable\n if (this.$visible) {\n editable.catchError(editable.show());\n }\n editable.catchError(editable.setWaiting(this.$waiting));\n },\n\n $removeEditable: function (editable) {\n //arrayRemove\n for (var i = 0; i < this.$editables.length; i++) {\n if (this.$editables[i] === editable) {\n this.$editables.splice(i, 1);\n return;\n }\n }\n },\n\n /**\n * Shows form with editable controls.\n *\n * @method $show()\n * @memberOf editable-form\n */\n $show: function () {\n if (this.$visible) {\n return;\n }\n\n this.$visible = true;\n\n var pc = editablePromiseCollection();\n\n //own show\n pc.when(this.$onshow());\n\n //clear errors\n this.$setError(null, '');\n\n //children show\n angular.forEach(this.$editables, function (editable) {\n pc.when(editable.show());\n });\n\n //wait promises and activate\n pc.then({\n onWait: angular.bind(this, this.$setWaiting),\n onTrue: angular.bind(this, this.$activate),\n onFalse: angular.bind(this, this.$activate),\n onString: angular.bind(this, this.$activate)\n });\n\n // add to internal list of shown forms\n // setTimeout needed to prevent closing right after opening (e.g. when trigger by button)\n setTimeout(angular.bind(this, function () {\n // clear `clicked` to get ready for clicks on visible form\n this._clicked = false;\n if (editableUtils.indexOf(shown, this) === -1) {\n shown.push(this);\n }\n }), 0);\n },\n\n /**\n * Sets focus on form field specified by `name`.
      \n * When trying to set the focus on a form field of a new row in the editable table, the `$activate` call needs to be wrapped in a `$timeout` call so that the form is rendered before the `$activate` function is called.\n *\n * @method $activate(name)\n * @param {string} name name of field\n * @memberOf editable-form\n */\n $activate: function (name) {\n var i,\n selectionStart,\n selectionEnd;\n if (this.$editables.length) {\n //activate by name\n if (angular.isString(name)) {\n for (i = 0; i < this.$editables.length; i++) {\n if (this.$editables[i].name === name) {\n this.$editables[i].activate();\n return;\n }\n }\n }\n\n //try activate error field\n for (i = 0; i < this.$editables.length; i++) {\n if (this.$editables[i].error) {\n this.$editables[i].activate();\n return;\n }\n }\n\n\n // bind click to body: cancel|submit|ignore forms\n if (this.$editables[0].attrs.usemousedown === \"true\") {\n $document.bind('mousedown', clickHandler);\n } else {\n $document.bind('click', clickHandler);\n }\n\n //by default activate first field\n selectionStart = this.$editables[0].elem[0].selectionStart ?\n this.$editables[0].elem[0].selectionStart :\n this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length :\n this.$editables[0].elem[0].innerHTML ? this.$editables[0].elem[0].innerHTML.length : 0;\n selectionEnd = this.$editables[0].elem[0].selectionEnd ?\n this.$editables[0].elem[0].selectionEnd :\n this.$editables[0].elem[0].text ? this.$editables[0].elem[0].text.length :\n this.$editables[0].elem[0].innerHTML ? this.$editables[0].elem[0].innerHTML.length : 0;\n this.$editables[0].activate(selectionStart, selectionEnd);\n }\n },\n\n /**\n * Hides form with editable controls without saving.\n *\n * @method $hide()\n * @memberOf editable-form\n */\n $hide: function () {\n if (!this.$visible) {\n return;\n }\n this.$visible = false;\n // self hide\n this.$onhide();\n // children's hide\n angular.forEach(this.$editables, function (editable) {\n editable.hide();\n });\n\n // remove from internal list of shown forms\n editableUtils.arrayRemove(shown, this);\n },\n\n /**\n * Triggers `oncancel` event and calls `$hide()`.\n *\n * @method $cancel()\n * @memberOf editable-form\n */\n $cancel: function () {\n if (!this.$visible) {\n return;\n }\n // self cancel\n this.$oncancel();\n // children's cancel\n angular.forEach(this.$editables, function (editable) {\n editable.cancel();\n });\n // self hide\n this.$hide();\n },\n\n $setWaiting: function (value) {\n this.$waiting = !!value;\n // we can't just set $waiting variable and use it via ng-disabled in children\n // because in editable-row form is not accessible\n angular.forEach(this.$editables, function (editable) {\n editable.setWaiting(!!value);\n });\n },\n\n /**\n * Shows error message for particular field.\n *\n * @method $setError(name, msg)\n * @param {string} name name of field\n * @param {string} msg error message\n * @memberOf editable-form\n */\n $setError: function (name, msg) {\n angular.forEach(this.$editables, function (editable) {\n if (!name || editable.name === name) {\n editable.setError(msg);\n }\n });\n },\n\n $submit: function () {\n if (this.$waiting) {\n return;\n }\n\n //clear errors\n this.$setError(null, '');\n\n //children onbeforesave\n var pc = editablePromiseCollection();\n angular.forEach(this.$editables, function (editable) {\n pc.when(editable.onbeforesave());\n });\n\n /*\n onbeforesave result:\n - true/undefined: save data and close form\n - false: close form without saving\n - string: keep form open and show error\n */\n pc.then({\n onWait: angular.bind(this, this.$setWaiting),\n onTrue: angular.bind(this, checkSelf, true),\n onFalse: angular.bind(this, checkSelf, false),\n onString: angular.bind(this, this.$activate)\n });\n\n //save\n function checkSelf(childrenTrue) {\n var pc = editablePromiseCollection();\n pc.when(this.$onbeforesave());\n pc.then({\n onWait: angular.bind(this, this.$setWaiting),\n onTrue: childrenTrue ? angular.bind(this, this.$save) : angular.bind(this, this.$hide),\n onFalse: angular.bind(this, this.$hide),\n onString: angular.bind(this, this.$activate)\n });\n }\n },\n\n $save: function () {\n // write model for each editable\n angular.forEach(this.$editables, function (editable) {\n editable.save();\n });\n\n //call onaftersave of self and children\n var pc = editablePromiseCollection();\n pc.when(this.$onaftersave());\n angular.forEach(this.$editables, function (editable) {\n pc.when(editable.onaftersave());\n });\n\n /*\n onaftersave result:\n - true/undefined/false: just close form\n - string: keep form open and show error\n */\n pc.then({\n onWait: angular.bind(this, this.$setWaiting),\n onTrue: angular.bind(this, this.$hide),\n onFalse: angular.bind(this, this.$hide),\n onString: angular.bind(this, this.$activate)\n });\n },\n\n $onshow: angular.noop,\n $oncancel: angular.noop,\n $onhide: angular.noop,\n $onbeforesave: angular.noop,\n $onaftersave: angular.noop\n };\n\n return function () {\n return angular.extend({\n $editables: [],\n /**\n * Form visibility flag.\n *\n * @var {bool} $visible\n * @memberOf editable-form\n */\n $visible: false,\n /**\n * Form waiting flag. It becomes `true` when form is loading or saving data.\n *\n * @var {bool} $waiting\n * @memberOf editable-form\n */\n $waiting: false,\n $data: {},\n _clicked: false,\n _blur: null\n }, base);\n };\n }]);\n\n/**\n * EditableForm directive. Should be defined in containing editable controls. \n * It add some usefull methods to form variable exposed to scope by `name=\"myform\"` attribute.\n *\n * @namespace editable-form\n */\nangular.module('xeditable').directive('editableForm',\n ['$rootScope', '$parse', 'editableFormController', 'editableOptions',\n function($rootScope, $parse, editableFormController, editableOptions) {\n return {\n restrict: 'A',\n require: ['form'],\n //require: ['form', 'editableForm'],\n //controller: EditableFormController,\n compile: function() {\n return {\n pre: function(scope, elem, attrs, ctrl) {\n var form = ctrl[0];\n var eForm;\n\n //if `editableForm` has value - publish smartly under this value\n //this is required only for single editor form that is created and removed\n if(attrs.editableForm) {\n if(scope[attrs.editableForm] && scope[attrs.editableForm].$show) {\n eForm = scope[attrs.editableForm];\n angular.extend(form, eForm);\n } else {\n eForm = editableFormController();\n scope[attrs.editableForm] = eForm;\n angular.extend(eForm, form);\n }\n } else { //just merge to form and publish if form has name\n eForm = editableFormController();\n angular.extend(form, eForm);\n }\n\n //read editables from buffer (that appeared before FORM tag)\n var buf = $rootScope.$$editableBuffer;\n var name = form.$name;\n if(name && buf && buf[name]) {\n angular.forEach(buf[name], function(editable) {\n eForm.$addEditable(editable);\n });\n delete buf[name];\n }\n },\n post: function(scope, elem, attrs, ctrl) {\n var eForm;\n\n if(attrs.editableForm && scope[attrs.editableForm] && scope[attrs.editableForm].$show) {\n eForm = scope[attrs.editableForm];\n } else {\n eForm = ctrl[0];\n }\n\n /**\n * Called when form is shown.\n * \n * @var {method|attribute} onshow \n * @memberOf editable-form\n */\n if(attrs.onshow) {\n eForm.$onshow = angular.bind(eForm, $parse(attrs.onshow), scope);\n }\n\n /**\n * Called when form hides after both save or cancel.\n * \n * @var {method|attribute} onhide \n * @memberOf editable-form\n */\n if(attrs.onhide) {\n eForm.$onhide = angular.bind(eForm, $parse(attrs.onhide), scope);\n }\n\n /**\n * Called when form is cancelled.\n * \n * @var {method|attribute} oncancel\n * @memberOf editable-form\n */\n if(attrs.oncancel) {\n eForm.$oncancel = angular.bind(eForm, $parse(attrs.oncancel), scope);\n }\n\n /**\n * Whether form initially rendered in shown state.\n *\n * @var {bool|attribute} shown\n * @memberOf editable-form\n */\n if(attrs.shown && $parse(attrs.shown)(scope)) {\n eForm.$show();\n }\n\n /**\n * Action when form losses focus. Values: `cancel|submit|ignore`.\n * Default is `ignore`.\n * \n * @var {string|attribute} blur\n * @memberOf editable-form\n */\n eForm._blur = attrs.blur || editableOptions.blurForm;\n\n // onbeforesave, onaftersave\n if(!attrs.ngSubmit && !attrs.submit) {\n /**\n * Called after all children `onbeforesave` callbacks but before saving form values\n * to model. \n * If at least one children callback returns `non-string` - it will not not be called. \n * See [editable-form demo](#editable-form) for details.\n * \n * @var {method|attribute} onbeforesave\n * @memberOf editable-form\n * \n */\n if(attrs.onbeforesave) {\n eForm.$onbeforesave = function() {\n return $parse(attrs.onbeforesave)(scope, {$data: eForm.$data});\n };\n }\n\n /**\n * Called when form values are saved to model. \n * See [editable-form demo](#editable-form) for details.\n * \n * @var {method|attribute} onaftersave \n * @memberOf editable-form\n * \n */\n if(attrs.onaftersave) {\n eForm.$onaftersave = function() {\n return $parse(attrs.onaftersave)(scope, {$data: eForm.$data});\n };\n }\n\n elem.bind('submit', function(event) {\n event.preventDefault();\n scope.$apply(function() {\n eForm.$submit();\n });\n });\n }\n\n\n // click - mark form as clicked to exclude in document click handler\n elem.bind('click', function(e) {\n // ignore right/middle button click\n if (e.which && e.which !== 1) {\n return;\n }\n\n if (eForm.$visible) {\n eForm._clicked = true;\n }\n }); \n\n }\n };\n }\n };\n}]);\n/**\n * editablePromiseCollection\n * \n * Collect results of function calls. Shows waiting if there are promises. \n * Finally, applies callbacks if:\n * - onTrue(): all results are true and all promises resolved to true\n * - onFalse(): at least one result is false or promise resolved to false\n * - onString(): at least one result is string or promise rejected or promise resolved to string\n */\n\nangular.module('xeditable').factory('editablePromiseCollection', ['$q', function($q) { \n\n function promiseCollection() {\n return {\n promises: [],\n hasFalse: false,\n hasString: false,\n when: function(result, noPromise) {\n if (result === false) {\n this.hasFalse = true;\n } else if (!noPromise && angular.isObject(result)) {\n this.promises.push($q.when(result));\n } else if (angular.isString(result)){\n this.hasString = true;\n } else { //result === true || result === undefined || result === null\n return;\n }\n },\n //callbacks: onTrue, onFalse, onString\n then: function(callbacks) {\n callbacks = callbacks || {};\n var onTrue = callbacks.onTrue || angular.noop;\n var onFalse = callbacks.onFalse || angular.noop;\n var onString = callbacks.onString || angular.noop;\n var onWait = callbacks.onWait || angular.noop;\n\n var self = this;\n\n if (this.promises.length) {\n onWait(true);\n $q.all(this.promises).then(\n //all resolved \n function(results) {\n onWait(false);\n //check all results via same `when` method (without checking promises)\n angular.forEach(results, function(result) {\n self.when(result, true); \n });\n applyCallback();\n },\n //some rejected\n function(error) { \n onWait(false);\n onString();\n }\n );\n } else {\n applyCallback();\n }\n\n function applyCallback() {\n if (!self.hasString && !self.hasFalse) {\n onTrue();\n } else if (!self.hasString && self.hasFalse) {\n onFalse();\n } else {\n onString();\n }\n }\n\n }\n };\n }\n\n return promiseCollection;\n\n}]);\n\n/**\n * editableUtils\n */\n angular.module('xeditable').factory('editableUtils', [function() {\n return {\n indexOf: function (array, obj) {\n if (array.indexOf) return array.indexOf(obj);\n\n for ( var i = 0; i < array.length; i++) {\n if (obj === array[i]) return i;\n }\n return -1;\n },\n\n arrayRemove: function (array, value) {\n var index = this.indexOf(array, value);\n if (index >= 0) {\n array.splice(index, 1);\n }\n return value;\n },\n\n // copy from https://github.com/angular/angular.js/blob/master/src/Angular.js\n camelToDash: function(str) {\n var SNAKE_CASE_REGEXP = /[A-Z]/g;\n return str.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? '-' : '') + letter.toLowerCase();\n });\n },\n\n dashToCamel: function(str) {\n var SPECIAL_CHARS_REGEXP = /([\\:\\-\\_]+(.))/g;\n var MOZ_HACK_REGEXP = /^moz([A-Z])/;\n return str.\n replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n }).\n replace(MOZ_HACK_REGEXP, 'Moz$1');\n },\n\n rename: function (tag, el) {\n if (el[0] && el[0].attributes) {\n var newEl = angular.element('<' + tag + '/>');\n newEl.html(el.html());\n var attrs = el[0].attributes;\n for (var i = 0; i < attrs.length; ++i) {\n newEl.attr(attrs.item(i).nodeName, attrs.item(i).value);\n }\n return newEl;\n }\n }\n };\n}]);\n\n/**\n * editableNgOptionsParser\n *\n * see: https://github.com/angular/angular.js/blob/master/src/ng/directive/select.js#L131\n */\n angular.module('xeditable').factory('editableNgOptionsParser', [function() {\n //0000111110000000000022220000000000000000000000333300000000000000444444444444444000000000555555555555555000000066666666666666600000000000000007777000000000000000000088888\n var NG_OPTIONS_REGEXP = /^\\s*(.*?)(?:\\s+as\\s+(.*?))?(?:\\s+group\\s+by\\s+(.*))?\\s+for\\s+(?:([\\$\\w][\\$\\w]*)|(?:\\(\\s*([\\$\\w][\\$\\w]*)\\s*,\\s*([\\$\\w][\\$\\w]*)\\s*\\)))\\s+in\\s+(.*?)(?:\\s+track\\s+by\\s+(.*?))?$/;\n\n function parser(optionsExp) {\n var match;\n\n if (! (match = optionsExp.match(NG_OPTIONS_REGEXP))) {\n throw 'ng-options parse error';\n }\n\n var \n displayFn = match[2] || match[1],\n valueName = match[4] || match[6],\n keyName = match[5],\n groupByFn = match[3] || '',\n valueFn = match[2] ? match[1] : valueName,\n valuesFn = match[7],\n track = match[8],\n trackFn = track ? match[8] : null;\n\n var ngRepeat;\n if (keyName === undefined) { // array\n ngRepeat = valueName + ' in ' + valuesFn;\n if (track !== undefined) {\n ngRepeat += ' track by '+trackFn;\n }\n } else { // object\n ngRepeat = '('+keyName+', '+valueName+') in '+valuesFn;\n }\n \n // group not supported yet\n return {\n ngRepeat: ngRepeat,\n locals: {\n valueName: valueName,\n keyName: keyName,\n valueFn: valueFn,\n displayFn: displayFn\n }\n };\n }\n\n return parser;\n}]);\n\n/**\n * editableCombodate\n *\n * angular version of https://github.com/vitalets/combodate\n */\nangular.module('xeditable').factory('editableCombodate', [function() {\n function Combodate(element, options) {\n this.$element = angular.element(element);\n\n if(this.$element[0].nodeName != 'INPUT') {\n throw 'Combodate should be applied to INPUT element';\n }\n\n var currentYear = new Date().getFullYear();\n this.defaults = {\n //in this format value stored in original input\n format: 'YYYY-MM-DD HH:mm',\n //in this format items in dropdowns are displayed\n template: 'D / MMM / YYYY H : mm',\n //initial value, can be `new Date()`\n value: null,\n minYear: 1970,\n maxYear: currentYear,\n yearDescending: true,\n minuteStep: 5,\n secondStep: 1,\n firstItem: 'empty', //'name', 'empty', 'none'\n errorClass: null,\n customClass: '',\n roundTime: true, // whether to round minutes and seconds if step > 1\n smartDays: true // whether days in combo depend on selected month: 31, 30, 28\n };\n\n this.options = angular.extend({}, this.defaults, options);\n this.init();\n }\n\n Combodate.prototype = {\n constructor: Combodate,\n init: function () {\n this.map = {\n //key regexp moment.method\n day: ['D', 'date'], \n month: ['M', 'month'], \n year: ['Y', 'year'], \n hour: ['[Hh]', 'hours'],\n minute: ['m', 'minutes'], \n second: ['s', 'seconds'],\n ampm: ['[Aa]', ''] \n };\n \n this.$widget = angular.element('').html(this.getTemplate());\n \n this.initCombos();\n \n if (this.options.smartDays) {\n var combo = this;\n this.$widget.find('select').bind('change', function(e) {\n // update days count if month or year changes\n if (angular.element(e.target).hasClass('month') || angular.element(e.target).hasClass('year')) {\n combo.fillCombo('day');\n }\n }); \n }\n\n this.$widget.find('select').css('width', 'auto');\n\n // hide original input and insert widget \n this.$element.css('display', 'none').after(this.$widget);\n \n // set initial value\n this.setValue(this.$element.val() || this.options.value);\n },\n \n /*\n Replace tokens in template with ');\n }); \n\n return tpl;\n },\n \n /*\n Initialize combos that presents in template \n */ \n initCombos: function() {\n for (var k in this.map) {\n var c = this.$widget[0].querySelectorAll('.'+k);\n // set properties like this.$day, this.$month etc.\n this['$'+k] = c.length ? angular.element(c) : null;\n // fill with items\n this.fillCombo(k);\n }\n },\n\n /*\n Fill combo with items \n */ \n fillCombo: function(k) {\n var $combo = this['$'+k];\n if (!$combo) {\n return;\n }\n\n // define method name to fill items, e.g `fillDays`\n var f = 'fill' + k.charAt(0).toUpperCase() + k.slice(1); \n var items = this[f]();\n var value = $combo.val();\n\n $combo.html('');\n for(var i=0; i'+items[i][1]+'');\n }\n\n $combo.val(value);\n },\n\n /*\n Initialize items of combos. Handles `firstItem` option \n */\n fillCommon: function(key) {\n var values = [], relTime;\n\n if(this.options.firstItem === 'name') {\n //need both to support moment ver < 2 and >= 2\n relTime = moment.relativeTime || moment.langData()._relativeTime; \n var header = typeof relTime[key] === 'function' ? relTime[key](1, true, key, false) : relTime[key];\n //take last entry (see momentjs lang files structure) \n header = header.split(' ').reverse()[0]; \n values.push(['', header]);\n } else if(this.options.firstItem === 'empty') {\n values.push(['', '']);\n }\n return values;\n }, \n\n\n /*\n fill day\n */\n fillDay: function() {\n var items = this.fillCommon('d'), name, i,\n twoDigit = this.options.template.indexOf('DD') !== -1,\n daysCount = 31;\n\n // detect days count (depends on month and year)\n // originally https://github.com/vitalets/combodate/pull/7\n if (this.options.smartDays && this.$month && this.$year) {\n var month = parseInt(this.$month.val(), 10);\n var year = parseInt(this.$year.val(), 10);\n\n if (!isNaN(month) && !isNaN(year)) {\n daysCount = moment([year, month]).daysInMonth();\n }\n }\n\n for (i = 1; i <= daysCount; i++) {\n name = twoDigit ? this.leadZero(i) : i;\n items.push([i, name]);\n }\n return items;\n },\n \n /*\n fill month\n */\n fillMonth: function() {\n var items = this.fillCommon('M'), name, i, \n longNames = this.options.template.indexOf('MMMM') !== -1,\n shortNames = this.options.template.indexOf('MMM') !== -1,\n twoDigit = this.options.template.indexOf('MM') !== -1;\n\n for(i=0; i<=11; i++) {\n if(longNames) {\n //see https://github.com/timrwood/momentjs.com/pull/36\n name = moment().date(1).month(i).format('MMMM');\n } else if(shortNames) {\n name = moment().date(1).month(i).format('MMM');\n } else if(twoDigit) {\n name = this.leadZero(i+1);\n } else {\n name = i+1;\n }\n items.push([i, name]);\n } \n return items;\n },\n \n /*\n fill year\n */\n fillYear: function() {\n var items = [], name, i, \n longNames = this.options.template.indexOf('YYYY') !== -1;\n\n for(i=this.options.maxYear; i>=this.options.minYear; i--) {\n name = longNames ? i : (i+'').substring(2);\n items[this.options.yearDescending ? 'push' : 'unshift']([i, name]);\n }\n \n items = this.fillCommon('y').concat(items);\n \n return items;\n },\n \n /*\n fill hour\n */\n fillHour: function() {\n var items = this.fillCommon('h'), name, i,\n h12 = this.options.template.indexOf('h') !== -1,\n h24 = this.options.template.indexOf('H') !== -1,\n twoDigit = this.options.template.toLowerCase().indexOf('hh') !== -1,\n min = h12 ? 1 : 0, \n max = h12 ? 12 : 23;\n\n for(i=min; i<=max; i++) {\n name = twoDigit ? this.leadZero(i) : i;\n items.push([i, name]);\n } \n return items;\n },\n\n /*\n fill minute\n */\n fillMinute: function() {\n var items = this.fillCommon('m'), name, i,\n twoDigit = this.options.template.indexOf('mm') !== -1;\n\n for(i=0; i<=59; i+= this.options.minuteStep) {\n name = twoDigit ? this.leadZero(i) : i;\n items.push([i, name]);\n }\n return items;\n },\n \n /*\n fill second\n */\n fillSecond: function() {\n var items = this.fillCommon('s'), name, i,\n twoDigit = this.options.template.indexOf('ss') !== -1;\n\n for(i=0; i<=59; i+= this.options.secondStep) {\n name = twoDigit ? this.leadZero(i) : i;\n items.push([i, name]);\n } \n return items;\n },\n \n /*\n fill ampm\n */\n fillAmpm: function() {\n var ampmL = this.options.template.indexOf('a') !== -1,\n ampmU = this.options.template.indexOf('A') !== -1, \n items = [\n ['am', ampmL ? 'am' : 'AM'],\n ['pm', ampmL ? 'pm' : 'PM']\n ];\n return items;\n },\n\n /*\n Returns current date value from combos. \n If format not specified - `options.format` used.\n If format = `null` - Moment object returned.\n */\n getValue: function(format) {\n var dt, values = {}, \n that = this,\n notSelected = false;\n\n //getting selected values \n angular.forEach(this.map, function(v, k) {\n if(k === 'ampm') {\n return;\n }\n var def = k === 'day' ? 1 : 0;\n\n values[k] = that['$'+k] ? parseInt(that['$'+k].val(), 10) : def; \n \n if(isNaN(values[k])) {\n notSelected = true;\n return false; \n }\n });\n \n //if at least one visible combo not selected - return empty string\n if(notSelected) {\n return '';\n }\n\n //convert hours 12h --> 24h \n if(this.$ampm) {\n //12:00 pm --> 12:00 (24-h format, midday), 12:00 am --> 00:00 (24-h format, midnight, start of day)\n if(values.hour === 12) {\n values.hour = this.$ampm.val() === 'am' ? 0 : 12; \n } else {\n values.hour = this.$ampm.val() === 'am' ? values.hour : values.hour+12;\n }\n }\n \n dt = moment([values.year, values.month, values.day, values.hour, values.minute, values.second]);\n \n //highlight invalid date\n this.highlight(dt);\n\n format = format === undefined ? this.options.format : format;\n if(format === null) {\n return dt.isValid() ? dt : null; \n } else {\n return dt.isValid() ? dt.format(format) : ''; \n }\n },\n\n setValue: function(value) {\n if(!value) {\n return;\n }\n\n // parse in strict mode (third param `true`)\n var dt = typeof value === 'string' ? moment(value, this.options.format, true) : moment(value),\n that = this,\n values = {};\n \n //function to find nearest value in select options\n function getNearest($select, value) {\n var delta = {};\n angular.forEach($select.children('option'), function(opt, i){\n var optValue = angular.element(opt).attr('value');\n\n if(optValue === '') return;\n var distance = Math.abs(optValue - value); \n if(typeof delta.distance === 'undefined' || distance < delta.distance) {\n delta = {value: optValue, distance: distance};\n } \n }); \n return delta.value;\n }\n \n if(dt.isValid()) {\n //read values from date object\n angular.forEach(this.map, function(v, k) {\n if(k === 'ampm') {\n return; \n }\n values[k] = dt[v[1]]();\n });\n\n if(this.$ampm) {\n //12:00 pm --> 12:00 (24-h format, midday), 12:00 am --> 00:00 (24-h format, midnight, start of day)\n if(values.hour >= 12) {\n values.ampm = 'pm';\n if(values.hour > 12) {\n values.hour -= 12;\n }\n } else {\n values.ampm = 'am';\n if(values.hour === 0) {\n values.hour = 12;\n }\n }\n }\n\n angular.forEach(values, function(v, k) {\n //call val() for each existing combo, e.g. this.$hour.val()\n if(that['$'+k]) {\n\n if(k === 'minute' && that.options.minuteStep > 1 && that.options.roundTime) {\n v = getNearest(that['$'+k], v);\n }\n \n if(k === 'second' && that.options.secondStep > 1 && that.options.roundTime) {\n v = getNearest(that['$'+k], v);\n } \n \n that['$'+k].val(v);\n }\n });\n\n // update days count\n if (this.options.smartDays) {\n this.fillCombo('day');\n }\n\n this.$element.val(dt.format(this.options.format)).triggerHandler('change');\n }\n },\n \n /*\n highlight combos if date is invalid\n */\n highlight: function(dt) {\n if(!dt.isValid()) {\n if(this.options.errorClass) {\n this.$widget.addClass(this.options.errorClass);\n } else {\n //store original border color\n if(!this.borderColor) {\n this.borderColor = this.$widget.find('select').css('border-color'); \n }\n this.$widget.find('select').css('border-color', 'red');\n }\n } else {\n if(this.options.errorClass) {\n this.$widget.removeClass(this.options.errorClass);\n } else {\n this.$widget.find('select').css('border-color', this.borderColor);\n } \n }\n },\n \n leadZero: function(v) {\n return v <= 9 ? '0' + v : v; \n },\n \n destroy: function() {\n this.$widget.remove();\n this.$element.removeData('combodate').show();\n }\n\n };\n\n return {\n getInstance: function(element, options) {\n return new Combodate(element, options);\n }\n };\n}]);\n\n/*\nEditable icons:\n- default\n- font-awesome\n\n*/\nangular.module('xeditable').factory('editableIcons', function() {\n\n var icons = {\n //Icon-set to use, defaults to bootstrap icons\n default: {\n 'bs2': {\n ok: 'icon-ok icon-white',\n cancel: 'icon-remove',\n clear: 'icon-trash',\n calendar: 'icon-calendar'\n },\n 'bs3': {\n ok: 'glyphicon glyphicon-ok',\n cancel: 'glyphicon glyphicon-remove',\n clear: 'glyphicon glyphicon-trash',\n calendar: 'glyphicon glyphicon-calendar'\n },\n 'bs4': {\n ok: 'fa fa-check',\n cancel: 'fa fa-times',\n clear: 'fa fa-trash',\n calendar: 'fa fa-calendar'\n }\n },\n external: {\n 'font-awesome': {\n ok: 'fa fa-check',\n cancel: 'fa fa-times',\n clear: 'fa fa-trash',\n calendar: 'fa fa-calendar'\n }\n }\n };\n\n return icons;\n});\n\n/* jshint -W086 */\n/*\nEditable themes:\n- default\n- bootstrap 2\n- bootstrap 3\n- semantic-ui\n\nNote: in postrender() `this` is instance of editableController\n*/\nangular.module('xeditable').factory('editableThemes', function() {\n var themes = {\n //default\n 'default': {\n formTpl: '',\n noformTpl: '',\n controlsTpl: '',\n inputTpl: '',\n errorTpl: '
      ',\n buttonsTpl: '',\n submitTpl: '',\n cancelTpl: '',\n resetTpl: ''\n },\n\n //bs2\n 'bs2': {\n formTpl: '
      ',\n noformTpl: '',\n controlsTpl: '
      ',\n inputTpl: '',\n errorTpl: '
      ',\n buttonsTpl: '',\n submitTpl: '',\n cancelTpl: '',\n resetTpl: '',\n calendarButtonClass: 'btn',\n buttonGroupAppendClass: 'input-append'\n },\n\n //bs3\n 'bs3': {\n formTpl: '
      ',\n noformTpl: '',\n controlsTpl: '
      ',\n inputTpl: '',\n errorTpl: '
      ',\n buttonsTpl: '',\n submitTpl: '',\n cancelTpl: '',\n resetTpl: '',\n\n //bs3 specific prop to change buttons class: btn-sm, btn-lg\n buttonsClass: '',\n //bs3 specific prop to change standard inputs class: input-sm, input-lg\n inputClass: '',\n calendarButtonClass: 'btn btn-default',\n buttonGroupAppendClass: 'input-group-btn',\n postrender: function() {\n //apply `form-control` class to std inputs\n switch(this.directiveName) {\n case 'editableText':\n case 'editableSelect':\n case 'editableTextarea':\n case 'editableEmail':\n case 'editableTel':\n case 'editableNumber':\n case 'editableUrl':\n case 'editableSearch':\n case 'editableDate':\n case 'editableDatetime':\n case 'editableBsdate':\n case 'editableTime':\n case 'editableMonth':\n case 'editableWeek':\n case 'editablePassword':\n case 'editableDatetimeLocal':\n this.inputEl.addClass('form-control');\n if(this.theme.inputClass) {\n // don`t apply `input-sm` and `input-lg` to select multiple\n // should be fixed in bs itself!\n if(this.inputEl.attr('multiple') &&\n (this.theme.inputClass === 'input-sm' || this.theme.inputClass === 'input-lg')) {\n break;\n }\n this.inputEl.addClass(this.theme.inputClass);\n }\n break;\n case 'editableCheckbox':\n this.editorEl.addClass('checkbox');\n }\n\n //apply buttonsClass (bs3 specific!)\n if(this.buttonsEl && this.theme.buttonsClass) {\n this.buttonsEl.find('button').addClass(this.theme.buttonsClass);\n }\n }\n },\n\n //bs4\n 'bs4': {\n formTpl: '
      ',\n noformTpl: '',\n controlsTpl: '
      ',\n inputTpl: '',\n errorTpl: '
      ',\n buttonsTpl: '',\n submitTpl: '',\n cancelTpl: '',\n resetTpl: '',\n\n //bs4 specific prop to change buttons class: btn-sm, btn-lg\n buttonsClass: '',\n //bs4 specific prop to change standard inputs class: form-control-sm, form-control-lg\n inputClass: '',\n calendarButtonClass: 'btn btn-secondary',\n buttonGroupAppendClass: 'input-group-append',\n postrender: function() {\n //apply `form-control` class to std inputs\n switch(this.directiveName) {\n case 'editableText':\n case 'editableSelect':\n case 'editableTextarea':\n case 'editableEmail':\n case 'editableTel':\n case 'editableNumber':\n case 'editableUrl':\n case 'editableSearch':\n case 'editableDate':\n case 'editableDatetime':\n case 'editableBsdate':\n case 'editableTime':\n case 'editableMonth':\n case 'editableWeek':\n case 'editablePassword':\n case 'editableDatetimeLocal':\n this.inputEl.addClass('form-control');\n this.inputEl.attr('ng-class', \"{'is-invalid': $error}\");\n if (this.theme.inputClass) {\n // don`t apply `form-control-sm` and `form-control-lg` to select multiple\n // should be fixed in bs itself!\n if(this.inputEl.attr('multiple') &&\n (this.theme.inputClass === 'form-control-sm' || this.theme.inputClass === 'form-control-lg')) {\n break;\n }\n this.inputEl.addClass(this.theme.inputClass);\n }\n break;\n case 'editableCheckbox':\n this.editorEl.addClass('form-check');\n }\n\n //apply buttonsClass (bs4 specific!)\n if(this.buttonsEl && this.theme.buttonsClass) {\n this.buttonsEl.find('button').addClass(this.theme.buttonsClass);\n }\n }\n },\n\n //semantic-ui\n 'semantic': {\n formTpl: '
      ',\n noformTpl: '',\n controlsTpl: '
      ',\n inputTpl: '',\n errorTpl: '
      ',\n buttonsTpl: '',\n submitTpl: '',\n cancelTpl: '',\n resetTpl: ''\n }\n };\n\n return themes;\n});\n","require('./dist/js/xeditable.js');\nmodule.exports = 'xeditable';\n","/**\n * @license AngularJS v1.8.2\n * (c) 2010-2020 Google LLC. http://angularjs.org\n * License: MIT\n */\n(function(window) {'use strict';\n\n/* exported\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth\n*/\n\nvar minErrConfig = {\n objectMaxDepth: 5,\n urlErrorParamsEnabled: true\n};\n\n/**\n * @ngdoc function\n * @name angular.errorHandlingConfig\n * @module ng\n * @kind function\n *\n * @description\n * Configure several aspects of error handling in AngularJS if used as a setter or return the\n * current configuration if used as a getter. The following options are supported:\n *\n * - **objectMaxDepth**: The maximum depth to which objects are traversed when stringified for error messages.\n *\n * Omitted or undefined options will leave the corresponding configuration values unchanged.\n *\n * @param {Object=} config - The configuration object. May only contain the options that need to be\n * updated. Supported keys:\n *\n * * `objectMaxDepth` **{Number}** - The max depth for stringifying objects. Setting to a\n * non-positive or non-numeric value, removes the max depth limit.\n * Default: 5\n *\n * * `urlErrorParamsEnabled` **{Boolean}** - Specifies whether the generated error url will\n * contain the parameters of the thrown error. Disabling the parameters can be useful if the\n * generated error url is very long.\n *\n * Default: true. When used without argument, it returns the current value.\n */\nfunction errorHandlingConfig(config) {\n if (isObject(config)) {\n if (isDefined(config.objectMaxDepth)) {\n minErrConfig.objectMaxDepth = isValidObjectMaxDepth(config.objectMaxDepth) ? config.objectMaxDepth : NaN;\n }\n if (isDefined(config.urlErrorParamsEnabled) && isBoolean(config.urlErrorParamsEnabled)) {\n minErrConfig.urlErrorParamsEnabled = config.urlErrorParamsEnabled;\n }\n } else {\n return minErrConfig;\n }\n}\n\n/**\n * @private\n * @param {Number} maxDepth\n * @return {boolean}\n */\nfunction isValidObjectMaxDepth(maxDepth) {\n return isNumber(maxDepth) && maxDepth > 0;\n}\n\n\n/**\n * @description\n *\n * This object provides a utility for producing rich Error messages within\n * AngularJS. It can be called as follows:\n *\n * var exampleMinErr = minErr('example');\n * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);\n *\n * The above creates an instance of minErr in the example namespace. The\n * resulting error will have a namespaced error code of example.one. The\n * resulting error will replace {0} with the value of foo, and {1} with the\n * value of bar. The object is not restricted in the number of arguments it can\n * take.\n *\n * If fewer arguments are specified than necessary for interpolation, the extra\n * interpolation markers will be preserved in the final string.\n *\n * Since data will be parsed statically during a build step, some restrictions\n * are applied with respect to how minErr instances are created and called.\n * Instances should have names of the form namespaceMinErr for a minErr created\n * using minErr('namespace'). Error codes, namespaces and template strings\n * should all be static strings, not variables or general expressions.\n *\n * @param {string} module The namespace to use for the new minErr instance.\n * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning\n * error from returned function, for cases when a particular type of error is useful.\n * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance\n */\n\nfunction minErr(module, ErrorConstructor) {\n ErrorConstructor = ErrorConstructor || Error;\n\n var url = 'https://errors.angularjs.org/1.8.2/';\n var regex = url.replace('.', '\\\\.') + '[\\\\s\\\\S]*';\n var errRegExp = new RegExp(regex, 'g');\n\n return function() {\n var code = arguments[0],\n template = arguments[1],\n message = '[' + (module ? module + ':' : '') + code + '] ',\n templateArgs = sliceArgs(arguments, 2).map(function(arg) {\n return toDebugString(arg, minErrConfig.objectMaxDepth);\n }),\n paramPrefix, i;\n\n // A minErr message has two parts: the message itself and the url that contains the\n // encoded message.\n // The message's parameters can contain other error messages which also include error urls.\n // To prevent the messages from getting too long, we strip the error urls from the parameters.\n\n message += template.replace(/\\{\\d+\\}/g, function(match) {\n var index = +match.slice(1, -1);\n\n if (index < templateArgs.length) {\n return templateArgs[index].replace(errRegExp, '');\n }\n\n return match;\n });\n\n message += '\\n' + url + (module ? module + '/' : '') + code;\n\n if (minErrConfig.urlErrorParamsEnabled) {\n for (i = 0, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {\n message += paramPrefix + 'p' + i + '=' + encodeURIComponent(templateArgs[i]);\n }\n }\n\n return new ErrorConstructor(message);\n };\n}\n\n/* We need to tell ESLint what variables are being exported */\n/* exported\n angular,\n msie,\n jqLite,\n jQuery,\n slice,\n splice,\n push,\n toString,\n minErrConfig,\n errorHandlingConfig,\n isValidObjectMaxDepth,\n ngMinErr,\n angularModule,\n uid,\n REGEX_STRING_REGEXP,\n VALIDITY_STATE_PROPERTY,\n\n lowercase,\n uppercase,\n nodeName_,\n isArrayLike,\n forEach,\n forEachSorted,\n reverseParams,\n nextUid,\n setHashKey,\n extend,\n toInt,\n inherit,\n merge,\n noop,\n identity,\n valueFn,\n isUndefined,\n isDefined,\n isObject,\n isBlankObject,\n isString,\n isNumber,\n isNumberNaN,\n isDate,\n isError,\n isArray,\n isFunction,\n isRegExp,\n isWindow,\n isScope,\n isFile,\n isFormData,\n isBlob,\n isBoolean,\n isPromiseLike,\n trim,\n escapeForRegexp,\n isElement,\n makeMap,\n includes,\n arrayRemove,\n copy,\n simpleCompare,\n equals,\n csp,\n jq,\n concat,\n sliceArgs,\n bind,\n toJsonReplacer,\n toJson,\n fromJson,\n convertTimezoneToLocal,\n timezoneToOffset,\n addDateMinutes,\n startingTag,\n tryDecodeURIComponent,\n parseKeyValue,\n toKeyValue,\n encodeUriSegment,\n encodeUriQuery,\n angularInit,\n bootstrap,\n getTestability,\n snake_case,\n bindJQuery,\n assertArg,\n assertArgFn,\n assertNotHasOwnProperty,\n getter,\n getBlockNodes,\n hasOwnProperty,\n createMap,\n stringify,\n UNSAFE_restoreLegacyJqLiteXHTMLReplacement,\n\n NODE_TYPE_ELEMENT,\n NODE_TYPE_ATTRIBUTE,\n NODE_TYPE_TEXT,\n NODE_TYPE_COMMENT,\n NODE_TYPE_DOCUMENT,\n NODE_TYPE_DOCUMENT_FRAGMENT\n*/\n\n////////////////////////////////////\n\n/**\n * @ngdoc module\n * @name ng\n * @module ng\n * @installation\n * @description\n *\n * The ng module is loaded by default when an AngularJS application is started. The module itself\n * contains the essential components for an AngularJS application to function. The table below\n * lists a high level breakdown of each of the services/factories, filters, directives and testing\n * components available within this core module.\n *\n */\n\nvar REGEX_STRING_REGEXP = /^\\/(.+)\\/([a-z]*)$/;\n\n// The name of a form control's ValidityState property.\n// This is used so that it's possible for internal tests to create mock ValidityStates.\nvar VALIDITY_STATE_PROPERTY = 'validity';\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * @private\n *\n * @description Converts the specified string to lowercase.\n * @param {string} string String to be converted to lowercase.\n * @returns {string} Lowercased string.\n */\nvar lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};\n\n/**\n * @private\n *\n * @description Converts the specified string to uppercase.\n * @param {string} string String to be converted to uppercase.\n * @returns {string} Uppercased string.\n */\nvar uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};\n\n\nvar\n msie, // holds major version number for IE, or NaN if UA is not IE.\n jqLite, // delay binding since jQuery could be loaded after us.\n jQuery, // delay binding\n slice = [].slice,\n splice = [].splice,\n push = [].push,\n toString = Object.prototype.toString,\n getPrototypeOf = Object.getPrototypeOf,\n ngMinErr = minErr('ng'),\n\n /** @name angular */\n angular = window.angular || (window.angular = {}),\n angularModule,\n uid = 0;\n\n// Support: IE 9-11 only\n/**\n * documentMode is an IE-only property\n * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx\n */\nmsie = window.document.documentMode;\n\n\n/**\n * @private\n * @param {*} obj\n * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,\n * String ...)\n */\nfunction isArrayLike(obj) {\n\n // `null`, `undefined` and `window` are not array-like\n if (obj == null || isWindow(obj)) return false;\n\n // arrays, strings and jQuery/jqLite objects are array like\n // * jqLite is either the jQuery or jqLite constructor function\n // * we have to check the existence of jqLite first as this method is called\n // via the forEach method when constructing the jqLite object in the first place\n if (isArray(obj) || isString(obj) || (jqLite && obj instanceof jqLite)) return true;\n\n // Support: iOS 8.2 (not reproducible in simulator)\n // \"length\" in obj used to prevent JIT error (gh-11508)\n var length = 'length' in Object(obj) && obj.length;\n\n // NodeList objects (with `item` method) and\n // other objects with suitable length characteristics are array-like\n return isNumber(length) && (length >= 0 && (length - 1) in obj || typeof obj.item === 'function');\n\n}\n\n/**\n * @ngdoc function\n * @name angular.forEach\n * @module ng\n * @kind function\n *\n * @description\n * Invokes the `iterator` function once for each item in `obj` collection, which can be either an\n * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`\n * is the value of an object property or an array element, `key` is the object property key or\n * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.\n *\n * It is worth noting that `.forEach` does not iterate over inherited properties because it filters\n * using the `hasOwnProperty` method.\n *\n * Unlike ES262's\n * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),\n * providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just\n * return the value provided.\n *\n ```js\n var values = {name: 'misko', gender: 'male'};\n var log = [];\n angular.forEach(values, function(value, key) {\n this.push(key + ': ' + value);\n }, log);\n expect(log).toEqual(['name: misko', 'gender: male']);\n ```\n *\n * @param {Object|Array} obj Object to iterate over.\n * @param {Function} iterator Iterator function.\n * @param {Object=} context Object to become context (`this`) for the iterator function.\n * @returns {Object|Array} Reference to `obj`.\n */\n\nfunction forEach(obj, iterator, context) {\n var key, length;\n if (obj) {\n if (isFunction(obj)) {\n for (key in obj) {\n if (key !== 'prototype' && key !== 'length' && key !== 'name' && obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (isArray(obj) || isArrayLike(obj)) {\n var isPrimitive = typeof obj !== 'object';\n for (key = 0, length = obj.length; key < length; key++) {\n if (isPrimitive || key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else if (obj.forEach && obj.forEach !== forEach) {\n obj.forEach(iterator, context, obj);\n } else if (isBlankObject(obj)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in obj) {\n iterator.call(context, obj[key], key, obj);\n }\n } else if (typeof obj.hasOwnProperty === 'function') {\n // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n } else {\n // Slow path for objects which do not have a method `hasOwnProperty`\n for (key in obj) {\n if (hasOwnProperty.call(obj, key)) {\n iterator.call(context, obj[key], key, obj);\n }\n }\n }\n }\n return obj;\n}\n\nfunction forEachSorted(obj, iterator, context) {\n var keys = Object.keys(obj).sort();\n for (var i = 0; i < keys.length; i++) {\n iterator.call(context, obj[keys[i]], keys[i]);\n }\n return keys;\n}\n\n\n/**\n * when using forEach the params are value, key, but it is often useful to have key, value.\n * @param {function(string, *)} iteratorFn\n * @returns {function(*, string)}\n */\nfunction reverseParams(iteratorFn) {\n return function(value, key) {iteratorFn(key, value);};\n}\n\n/**\n * A consistent way of creating unique IDs in angular.\n *\n * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before\n * we hit number precision issues in JavaScript.\n *\n * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M\n *\n * @returns {number} an unique alpha-numeric string\n */\nfunction nextUid() {\n return ++uid;\n}\n\n\n/**\n * Set or clear the hashkey for an object.\n * @param obj object\n * @param h the hashkey (!truthy to delete the hashkey)\n */\nfunction setHashKey(obj, h) {\n if (h) {\n obj.$$hashKey = h;\n } else {\n delete obj.$$hashKey;\n }\n}\n\n\nfunction baseExtend(dst, objs, deep) {\n var h = dst.$$hashKey;\n\n for (var i = 0, ii = objs.length; i < ii; ++i) {\n var obj = objs[i];\n if (!isObject(obj) && !isFunction(obj)) continue;\n var keys = Object.keys(obj);\n for (var j = 0, jj = keys.length; j < jj; j++) {\n var key = keys[j];\n var src = obj[key];\n\n if (deep && isObject(src)) {\n if (isDate(src)) {\n dst[key] = new Date(src.valueOf());\n } else if (isRegExp(src)) {\n dst[key] = new RegExp(src);\n } else if (src.nodeName) {\n dst[key] = src.cloneNode(true);\n } else if (isElement(src)) {\n dst[key] = src.clone();\n } else {\n if (key !== '__proto__') {\n if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};\n baseExtend(dst[key], [src], true);\n }\n }\n } else {\n dst[key] = src;\n }\n }\n }\n\n setHashKey(dst, h);\n return dst;\n}\n\n/**\n * @ngdoc function\n * @name angular.extend\n * @module ng\n * @kind function\n *\n * @description\n * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.\n *\n * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use\n * {@link angular.merge} for this.\n *\n * @param {Object} dst Destination object.\n * @param {...Object} src Source object(s).\n * @returns {Object} Reference to `dst`.\n */\nfunction extend(dst) {\n return baseExtend(dst, slice.call(arguments, 1), false);\n}\n\n\n/**\n* @ngdoc function\n* @name angular.merge\n* @module ng\n* @kind function\n*\n* @description\n* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)\n* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so\n* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.\n*\n* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source\n* objects, performing a deep copy.\n*\n* @deprecated\n* sinceVersion=\"1.6.5\"\n* This function is deprecated, but will not be removed in the 1.x lifecycle.\n* There are edge cases (see {@link angular.merge#known-issues known issues}) that are not\n* supported by this function. We suggest using another, similar library for all-purpose merging,\n* such as [lodash's merge()](https://lodash.com/docs/4.17.4#merge).\n*\n* @knownIssue\n* This is a list of (known) object types that are not handled correctly by this function:\n* - [`Blob`](https://developer.mozilla.org/docs/Web/API/Blob)\n* - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)\n* - [`CanvasGradient`](https://developer.mozilla.org/docs/Web/API/CanvasGradient)\n* - AngularJS {@link $rootScope.Scope scopes};\n*\n* `angular.merge` also does not support merging objects with circular references.\n*\n* @param {Object} dst Destination object.\n* @param {...Object} src Source object(s).\n* @returns {Object} Reference to `dst`.\n*/\nfunction merge(dst) {\n return baseExtend(dst, slice.call(arguments, 1), true);\n}\n\n\n\nfunction toInt(str) {\n return parseInt(str, 10);\n}\n\nvar isNumberNaN = Number.isNaN || function isNumberNaN(num) {\n // eslint-disable-next-line no-self-compare\n return num !== num;\n};\n\n\nfunction inherit(parent, extra) {\n return extend(Object.create(parent), extra);\n}\n\n/**\n * @ngdoc function\n * @name angular.noop\n * @module ng\n * @kind function\n *\n * @description\n * A function that performs no operations. This function can be useful when writing code in the\n * functional style.\n ```js\n function foo(callback) {\n var result = calculateResult();\n (callback || angular.noop)(result);\n }\n ```\n */\nfunction noop() {}\nnoop.$inject = [];\n\n\n/**\n * @ngdoc function\n * @name angular.identity\n * @module ng\n * @kind function\n *\n * @description\n * A function that returns its first argument. This function is useful when writing code in the\n * functional style.\n *\n ```js\n function transformer(transformationFn, value) {\n return (transformationFn || angular.identity)(value);\n };\n\n // E.g.\n function getResult(fn, input) {\n return (fn || angular.identity)(input);\n };\n\n getResult(function(n) { return n * 2; }, 21); // returns 42\n getResult(null, 21); // returns 21\n getResult(undefined, 21); // returns 21\n ```\n *\n * @param {*} value to be returned.\n * @returns {*} the value passed in.\n */\nfunction identity($) {return $;}\nidentity.$inject = [];\n\n\nfunction valueFn(value) {return function valueRef() {return value;};}\n\nfunction hasCustomToString(obj) {\n return isFunction(obj.toString) && obj.toString !== toString;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isUndefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is undefined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is undefined.\n */\nfunction isUndefined(value) {return typeof value === 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDefined\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is defined.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is defined.\n */\nfunction isDefined(value) {return typeof value !== 'undefined';}\n\n\n/**\n * @ngdoc function\n * @name angular.isObject\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not\n * considered to be objects. Note that JavaScript arrays are objects.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Object` but not `null`.\n */\nfunction isObject(value) {\n // http://jsperf.com/isobject4\n return value !== null && typeof value === 'object';\n}\n\n\n/**\n * Determine if a value is an object with a null prototype\n *\n * @returns {boolean} True if `value` is an `Object` with a null prototype\n */\nfunction isBlankObject(value) {\n return value !== null && typeof value === 'object' && !getPrototypeOf(value);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isString\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `String`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `String`.\n */\nfunction isString(value) {return typeof value === 'string';}\n\n\n/**\n * @ngdoc function\n * @name angular.isNumber\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Number`.\n *\n * This includes the \"special\" numbers `NaN`, `+Infinity` and `-Infinity`.\n *\n * If you wish to exclude these then you can use the native\n * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)\n * method.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Number`.\n */\nfunction isNumber(value) {return typeof value === 'number';}\n\n\n/**\n * @ngdoc function\n * @name angular.isDate\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a value is a date.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Date`.\n */\nfunction isDate(value) {\n return toString.call(value) === '[object Date]';\n}\n\n\n/**\n * @ngdoc function\n * @name angular.isArray\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is an `Array`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Array`.\n */\nfunction isArray(arr) {\n return Array.isArray(arr) || arr instanceof Array;\n}\n\n/**\n * @description\n * Determines if a reference is an `Error`.\n * Loosely based on https://www.npmjs.com/package/iserror\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is an `Error`.\n */\nfunction isError(value) {\n var tag = toString.call(value);\n switch (tag) {\n case '[object Error]': return true;\n case '[object Exception]': return true;\n case '[object DOMException]': return true;\n default: return value instanceof Error;\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.isFunction\n * @module ng\n * @kind function\n *\n * @description\n * Determines if a reference is a `Function`.\n *\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `Function`.\n */\nfunction isFunction(value) {return typeof value === 'function';}\n\n\n/**\n * Determines if a value is a regular expression object.\n *\n * @private\n * @param {*} value Reference to check.\n * @returns {boolean} True if `value` is a `RegExp`.\n */\nfunction isRegExp(value) {\n return toString.call(value) === '[object RegExp]';\n}\n\n\n/**\n * Checks if `obj` is a window object.\n *\n * @private\n * @param {*} obj Object to check\n * @returns {boolean} True if `obj` is a window obj.\n */\nfunction isWindow(obj) {\n return obj && obj.window === obj;\n}\n\n\nfunction isScope(obj) {\n return obj && obj.$evalAsync && obj.$watch;\n}\n\n\nfunction isFile(obj) {\n return toString.call(obj) === '[object File]';\n}\n\n\nfunction isFormData(obj) {\n return toString.call(obj) === '[object FormData]';\n}\n\n\nfunction isBlob(obj) {\n return toString.call(obj) === '[object Blob]';\n}\n\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\n\n\nfunction isPromiseLike(obj) {\n return obj && isFunction(obj.then);\n}\n\n\nvar TYPED_ARRAY_REGEXP = /^\\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array]$/;\nfunction isTypedArray(value) {\n return value && isNumber(value.length) && TYPED_ARRAY_REGEXP.test(toString.call(value));\n}\n\nfunction isArrayBuffer(obj) {\n return toString.call(obj) === '[object ArrayBuffer]';\n}\n\n\nvar trim = function(value) {\n return isString(value) ? value.trim() : value;\n};\n\n// Copied from:\n// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021\n// Prereq: s is a string.\nvar escapeForRegexp = function(s) {\n return s\n .replace(/([-()[\\]{}+?*.$^|,:#= 0) {\n array.splice(index, 1);\n }\n return index;\n}\n\n/**\n * @ngdoc function\n * @name angular.copy\n * @module ng\n * @kind function\n *\n * @description\n * Creates a deep copy of `source`, which should be an object or an array. This functions is used\n * internally, mostly in the change-detection code. It is not intended as an all-purpose copy\n * function, and has several limitations (see below).\n *\n * * If no destination is supplied, a copy of the object or array is created.\n * * If a destination is provided, all of its elements (for arrays) or properties (for objects)\n * are deleted and then all elements/properties from the source are copied to it.\n * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.\n * * If `source` is identical to `destination` an exception will be thrown.\n *\n *
      \n *\n *
      \n * Only enumerable properties are taken into account. Non-enumerable properties (both on `source`\n * and on `destination`) will be ignored.\n *
      \n *\n *
      \n * `angular.copy` does not check if destination and source are of the same type. It's the\n * developer's responsibility to make sure they are compatible.\n *
      \n *\n * @knownIssue\n * This is a non-exhaustive list of object types / features that are not handled correctly by\n * `angular.copy`. Note that since this functions is used by the change detection code, this\n * means binding or watching objects of these types (or that include these types) might not work\n * correctly.\n * - [`File`](https://developer.mozilla.org/docs/Web/API/File)\n * - [`Map`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map)\n * - [`ImageData`](https://developer.mozilla.org/docs/Web/API/ImageData)\n * - [`MediaStream`](https://developer.mozilla.org/docs/Web/API/MediaStream)\n * - [`Set`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set)\n * - [`WeakMap`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap)\n * - [`getter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get)/\n * [`setter`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set)\n *\n * @param {*} source The source that will be used to make a copy. Can be any type, including\n * primitives, `null`, and `undefined`.\n * @param {(Object|Array)=} destination Destination into which the source is copied. If provided,\n * must be of the same type as `source`.\n * @returns {*} The copy or updated `destination`, if `destination` was specified.\n *\n * @example\n \n \n
      \n
      \n
      \n
      \n Gender: \n
      \n \n \n
      \n
      form = {{user | json}}
      \n
      leader = {{leader | json}}
      \n
      \n
      \n \n // Module: copyExample\n angular.\n module('copyExample', []).\n controller('ExampleController', ['$scope', function($scope) {\n $scope.leader = {};\n\n $scope.reset = function() {\n // Example with 1 argument\n $scope.user = angular.copy($scope.leader);\n };\n\n $scope.update = function(user) {\n // Example with 2 arguments\n angular.copy(user, $scope.leader);\n };\n\n $scope.reset();\n }]);\n \n
      \n */\nfunction copy(source, destination, maxDepth) {\n var stackSource = [];\n var stackDest = [];\n maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;\n\n if (destination) {\n if (isTypedArray(destination) || isArrayBuffer(destination)) {\n throw ngMinErr('cpta', 'Can\\'t copy! TypedArray destination cannot be mutated.');\n }\n if (source === destination) {\n throw ngMinErr('cpi', 'Can\\'t copy! Source and destination are identical.');\n }\n\n // Empty the destination object\n if (isArray(destination)) {\n destination.length = 0;\n } else {\n forEach(destination, function(value, key) {\n if (key !== '$$hashKey') {\n delete destination[key];\n }\n });\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n return copyRecurse(source, destination, maxDepth);\n }\n\n return copyElement(source, maxDepth);\n\n function copyRecurse(source, destination, maxDepth) {\n maxDepth--;\n if (maxDepth < 0) {\n return '...';\n }\n var h = destination.$$hashKey;\n var key;\n if (isArray(source)) {\n for (var i = 0, ii = source.length; i < ii; i++) {\n destination.push(copyElement(source[i], maxDepth));\n }\n } else if (isBlankObject(source)) {\n // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty\n for (key in source) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n } else if (source && typeof source.hasOwnProperty === 'function') {\n // Slow path, which must rely on hasOwnProperty\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n } else {\n // Slowest path --- hasOwnProperty can't be called as a method\n for (key in source) {\n if (hasOwnProperty.call(source, key)) {\n destination[key] = copyElement(source[key], maxDepth);\n }\n }\n }\n setHashKey(destination, h);\n return destination;\n }\n\n function copyElement(source, maxDepth) {\n // Simple values\n if (!isObject(source)) {\n return source;\n }\n\n // Already copied values\n var index = stackSource.indexOf(source);\n if (index !== -1) {\n return stackDest[index];\n }\n\n if (isWindow(source) || isScope(source)) {\n throw ngMinErr('cpws',\n 'Can\\'t copy! Making copies of Window or Scope instances is not supported.');\n }\n\n var needsRecurse = false;\n var destination = copyType(source);\n\n if (destination === undefined) {\n destination = isArray(source) ? [] : Object.create(getPrototypeOf(source));\n needsRecurse = true;\n }\n\n stackSource.push(source);\n stackDest.push(destination);\n\n return needsRecurse\n ? copyRecurse(source, destination, maxDepth)\n : destination;\n }\n\n function copyType(source) {\n switch (toString.call(source)) {\n case '[object Int8Array]':\n case '[object Int16Array]':\n case '[object Int32Array]':\n case '[object Float32Array]':\n case '[object Float64Array]':\n case '[object Uint8Array]':\n case '[object Uint8ClampedArray]':\n case '[object Uint16Array]':\n case '[object Uint32Array]':\n return new source.constructor(copyElement(source.buffer), source.byteOffset, source.length);\n\n case '[object ArrayBuffer]':\n // Support: IE10\n if (!source.slice) {\n // If we're in this case we know the environment supports ArrayBuffer\n /* eslint-disable no-undef */\n var copied = new ArrayBuffer(source.byteLength);\n new Uint8Array(copied).set(new Uint8Array(source));\n /* eslint-enable */\n return copied;\n }\n return source.slice(0);\n\n case '[object Boolean]':\n case '[object Number]':\n case '[object String]':\n case '[object Date]':\n return new source.constructor(source.valueOf());\n\n case '[object RegExp]':\n var re = new RegExp(source.source, source.toString().match(/[^/]*$/)[0]);\n re.lastIndex = source.lastIndex;\n return re;\n\n case '[object Blob]':\n return new source.constructor([source], {type: source.type});\n }\n\n if (isFunction(source.cloneNode)) {\n return source.cloneNode(true);\n }\n }\n}\n\n\n// eslint-disable-next-line no-self-compare\nfunction simpleCompare(a, b) { return a === b || (a !== a && b !== b); }\n\n\n/**\n * @ngdoc function\n * @name angular.equals\n * @module ng\n * @kind function\n *\n * @description\n * Determines if two objects or two values are equivalent. Supports value types, regular\n * expressions, arrays and objects.\n *\n * Two objects or values are considered equivalent if at least one of the following is true:\n *\n * * Both objects or values pass `===` comparison.\n * * Both objects or values are of the same type and all of their properties are equal by\n * comparing them with `angular.equals`.\n * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)\n * * Both values represent the same regular expression (In JavaScript,\n * /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual\n * representation matches).\n *\n * During a property comparison, properties of `function` type and properties with names\n * that begin with `$` are ignored.\n *\n * Scope and DOMWindow objects are being compared only by identify (`===`).\n *\n * @param {*} o1 Object or value to compare.\n * @param {*} o2 Object or value to compare.\n * @returns {boolean} True if arguments are equal.\n *\n * @example\n \n \n
      \n
      \n

      User 1

      \n Name: \n Age: \n\n

      User 2

      \n Name: \n Age: \n\n
      \n
      \n \n
      \n User 1:
      {{user1 | json}}
      \n User 2:
      {{user2 | json}}
      \n Equal:
      {{result}}
      \n
      \n
      \n
      \n \n angular.module('equalsExample', []).controller('ExampleController', ['$scope', function($scope) {\n $scope.user1 = {};\n $scope.user2 = {};\n $scope.compare = function() {\n $scope.result = angular.equals($scope.user1, $scope.user2);\n };\n }]);\n \n
      \n */\nfunction equals(o1, o2) {\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n // eslint-disable-next-line no-self-compare\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 === t2 && t1 === 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) === o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n if (!isDate(o2)) return false;\n return simpleCompare(o1.getTime(), o2.getTime());\n } else if (isRegExp(o1)) {\n if (!isRegExp(o2)) return false;\n return o1.toString() === o2.toString();\n } else {\n if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||\n isArray(o2) || isDate(o2) || isRegExp(o2)) return false;\n keySet = createMap();\n for (key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) &&\n key.charAt(0) !== '$' &&\n isDefined(o2[key]) &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n return false;\n}\n\nvar csp = function() {\n if (!isDefined(csp.rules)) {\n\n\n var ngCspElement = (window.document.querySelector('[ng-csp]') ||\n window.document.querySelector('[data-ng-csp]'));\n\n if (ngCspElement) {\n var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||\n ngCspElement.getAttribute('data-ng-csp');\n csp.rules = {\n noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),\n noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)\n };\n } else {\n csp.rules = {\n noUnsafeEval: noUnsafeEval(),\n noInlineStyle: false\n };\n }\n }\n\n return csp.rules;\n\n function noUnsafeEval() {\n try {\n // eslint-disable-next-line no-new, no-new-func\n new Function('');\n return false;\n } catch (e) {\n return true;\n }\n }\n};\n\n/**\n * @ngdoc directive\n * @module ng\n * @name ngJq\n *\n * @element ANY\n * @param {string=} ngJq the name of the library available under `window`\n * to be used for angular.element\n * @description\n * Use this directive to force the angular.element library. This should be\n * used to force either jqLite by leaving ng-jq blank or setting the name of\n * the jquery variable under window (eg. jQuery).\n *\n * Since AngularJS looks for this directive when it is loaded (doesn't wait for the\n * DOMContentLoaded event), it must be placed on an element that comes before the script\n * which loads angular. Also, only the first instance of `ng-jq` will be used and all\n * others ignored.\n *\n * @example\n * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.\n ```html\n \n \n ...\n ...\n \n ```\n * @example\n * This example shows how to use a jQuery based library of a different name.\n * The library name must be available at the top most 'window'.\n ```html\n \n \n ...\n ...\n \n ```\n */\nvar jq = function() {\n if (isDefined(jq.name_)) return jq.name_;\n var el;\n var i, ii = ngAttrPrefixes.length, prefix, name;\n for (i = 0; i < ii; ++i) {\n prefix = ngAttrPrefixes[i];\n el = window.document.querySelector('[' + prefix.replace(':', '\\\\:') + 'jq]');\n if (el) {\n name = el.getAttribute(prefix + 'jq');\n break;\n }\n }\n\n return (jq.name_ = name);\n};\n\nfunction concat(array1, array2, index) {\n return array1.concat(slice.call(array2, index));\n}\n\nfunction sliceArgs(args, startIndex) {\n return slice.call(args, startIndex || 0);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.bind\n * @module ng\n * @kind function\n *\n * @description\n * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for\n * `fn`). You can supply optional `args` that are prebound to the function. This feature is also\n * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as\n * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).\n *\n * @param {Object} self Context which `fn` should be evaluated in.\n * @param {function()} fn Function to be bound.\n * @param {...*} args Optional arguments to be prebound to the `fn` function call.\n * @returns {function()} Function that wraps the `fn` with all the specified bindings.\n */\nfunction bind(self, fn) {\n var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];\n if (isFunction(fn) && !(fn instanceof RegExp)) {\n return curryArgs.length\n ? function() {\n return arguments.length\n ? fn.apply(self, concat(curryArgs, arguments, 0))\n : fn.apply(self, curryArgs);\n }\n : function() {\n return arguments.length\n ? fn.apply(self, arguments)\n : fn.call(self);\n };\n } else {\n // In IE, native methods are not functions so they cannot be bound (note: they don't need to be).\n return fn;\n }\n}\n\n\nfunction toJsonReplacer(key, value) {\n var val = value;\n\n if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {\n val = undefined;\n } else if (isWindow(value)) {\n val = '$WINDOW';\n } else if (value && window.document === value) {\n val = '$DOCUMENT';\n } else if (isScope(value)) {\n val = '$SCOPE';\n }\n\n return val;\n}\n\n\n/**\n * @ngdoc function\n * @name angular.toJson\n * @module ng\n * @kind function\n *\n * @description\n * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be\n * stripped since AngularJS uses this notation internally.\n *\n * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.\n * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.\n * If set to an integer, the JSON output will contain that many spaces per indentation.\n * @returns {string|undefined} JSON-ified string representing `obj`.\n * @knownIssue\n *\n * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`\n * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the\n * `Date.prototype.toJSON` method as follows:\n *\n * ```\n * var _DatetoJSON = Date.prototype.toJSON;\n * Date.prototype.toJSON = function() {\n * try {\n * return _DatetoJSON.call(this);\n * } catch(e) {\n * if (e instanceof RangeError) {\n * return null;\n * }\n * throw e;\n * }\n * };\n * ```\n *\n * See https://github.com/angular/angular.js/pull/14221 for more information.\n */\nfunction toJson(obj, pretty) {\n if (isUndefined(obj)) return undefined;\n if (!isNumber(pretty)) {\n pretty = pretty ? 2 : null;\n }\n return JSON.stringify(obj, toJsonReplacer, pretty);\n}\n\n\n/**\n * @ngdoc function\n * @name angular.fromJson\n * @module ng\n * @kind function\n *\n * @description\n * Deserializes a JSON string.\n *\n * @param {string} json JSON string to deserialize.\n * @returns {Object|Array|string|number} Deserialized JSON string.\n */\nfunction fromJson(json) {\n return isString(json)\n ? JSON.parse(json)\n : json;\n}\n\n\nvar ALL_COLONS = /:/g;\nfunction timezoneToOffset(timezone, fallback) {\n // Support: IE 9-11 only, Edge 13-15+\n // IE/Edge do not \"understand\" colon (`:`) in timezone\n timezone = timezone.replace(ALL_COLONS, '');\n var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;\n return isNumberNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;\n}\n\n\nfunction addDateMinutes(date, minutes) {\n date = new Date(date.getTime());\n date.setMinutes(date.getMinutes() + minutes);\n return date;\n}\n\n\nfunction convertTimezoneToLocal(date, timezone, reverse) {\n reverse = reverse ? -1 : 1;\n var dateTimezoneOffset = date.getTimezoneOffset();\n var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));\n}\n\n\n/**\n * @returns {string} Returns the string representation of the element.\n */\nfunction startingTag(element) {\n element = jqLite(element).clone().empty();\n var elemHtml = jqLite('
      ').append(element).html();\n try {\n return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :\n elemHtml.\n match(/^(<[^>]+>)/)[1].\n replace(/^<([\\w-]+)/, function(match, nodeName) {return '<' + lowercase(nodeName);});\n } catch (e) {\n return lowercase(elemHtml);\n }\n\n}\n\n\n/////////////////////////////////////////////////\n\n/**\n * Tries to decode the URI component without throwing an exception.\n *\n * @private\n * @param str value potential URI component to check.\n * @returns {boolean} True if `value` can be decoded\n * with the decodeURIComponent function.\n */\nfunction tryDecodeURIComponent(value) {\n try {\n return decodeURIComponent(value);\n } catch (e) {\n // Ignore any invalid uri component.\n }\n}\n\n\n/**\n * Parses an escaped url query string into key-value pairs.\n * @returns {Object.}\n */\nfunction parseKeyValue(/**string*/keyValue) {\n var obj = {};\n forEach((keyValue || '').split('&'), function(keyValue) {\n var splitPoint, key, val;\n if (keyValue) {\n key = keyValue = keyValue.replace(/\\+/g,'%20');\n splitPoint = keyValue.indexOf('=');\n if (splitPoint !== -1) {\n key = keyValue.substring(0, splitPoint);\n val = keyValue.substring(splitPoint + 1);\n }\n key = tryDecodeURIComponent(key);\n if (isDefined(key)) {\n val = isDefined(val) ? tryDecodeURIComponent(val) : true;\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n } else if (isArray(obj[key])) {\n obj[key].push(val);\n } else {\n obj[key] = [obj[key],val];\n }\n }\n }\n });\n return obj;\n}\n\nfunction toKeyValue(obj) {\n var parts = [];\n forEach(obj, function(value, key) {\n if (isArray(value)) {\n forEach(value, function(arrayValue) {\n parts.push(encodeUriQuery(key, true) +\n (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));\n });\n } else {\n parts.push(encodeUriQuery(key, true) +\n (value === true ? '' : '=' + encodeUriQuery(value, true)));\n }\n });\n return parts.length ? parts.join('&') : '';\n}\n\n\n/**\n * We need our custom method because encodeURIComponent is too aggressive and doesn't follow\n * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path\n * segments:\n * segment = *pchar\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriSegment(val) {\n return encodeUriQuery(val, true).\n replace(/%26/gi, '&').\n replace(/%3D/gi, '=').\n replace(/%2B/gi, '+');\n}\n\n\n/**\n * This method is intended for encoding *key* or *value* parts of query component. We need a custom\n * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be\n * encoded per http://tools.ietf.org/html/rfc3986:\n * query = *( pchar / \"/\" / \"?\" )\n * pchar = unreserved / pct-encoded / sub-delims / \":\" / \"@\"\n * unreserved = ALPHA / DIGIT / \"-\" / \".\" / \"_\" / \"~\"\n * pct-encoded = \"%\" HEXDIG HEXDIG\n * sub-delims = \"!\" / \"$\" / \"&\" / \"'\" / \"(\" / \")\"\n * / \"*\" / \"+\" / \",\" / \";\" / \"=\"\n */\nfunction encodeUriQuery(val, pctEncodeSpaces) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%3B/gi, ';').\n replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));\n}\n\nvar ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];\n\nfunction getNgAttribute(element, ngAttr) {\n var attr, i, ii = ngAttrPrefixes.length;\n for (i = 0; i < ii; ++i) {\n attr = ngAttrPrefixes[i] + ngAttr;\n if (isString(attr = element.getAttribute(attr))) {\n return attr;\n }\n }\n return null;\n}\n\nfunction allowAutoBootstrap(document) {\n var script = document.currentScript;\n\n if (!script) {\n // Support: IE 9-11 only\n // IE does not have `document.currentScript`\n return true;\n }\n\n // If the `currentScript` property has been clobbered just return false, since this indicates a probable attack\n if (!(script instanceof window.HTMLScriptElement || script instanceof window.SVGScriptElement)) {\n return false;\n }\n\n var attributes = script.attributes;\n var srcs = [attributes.getNamedItem('src'), attributes.getNamedItem('href'), attributes.getNamedItem('xlink:href')];\n\n return srcs.every(function(src) {\n if (!src) {\n return true;\n }\n if (!src.value) {\n return false;\n }\n\n var link = document.createElement('a');\n link.href = src.value;\n\n if (document.location.origin === link.origin) {\n // Same-origin resources are always allowed, even for banned URL schemes.\n return true;\n }\n // Disabled bootstrapping unless angular.js was loaded from a known scheme used on the web.\n // This is to prevent angular.js bundled with browser extensions from being used to bypass the\n // content security policy in web pages and other browser extensions.\n switch (link.protocol) {\n case 'http:':\n case 'https:':\n case 'ftp:':\n case 'blob:':\n case 'file:':\n case 'data:':\n return true;\n default:\n return false;\n }\n });\n}\n\n// Cached as it has to run during loading so that document.currentScript is available.\nvar isAutoBootstrapAllowed = allowAutoBootstrap(window.document);\n\n/**\n * @ngdoc directive\n * @name ngApp\n * @module ng\n *\n * @element ANY\n * @param {angular.Module} ngApp an optional application\n * {@link angular.module module} name to load.\n * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be\n * created in \"strict-di\" mode. This means that the application will fail to invoke functions which\n * do not use explicit function annotation (and are thus unsuitable for minification), as described\n * in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in\n * tracking down the root of these bugs.\n *\n * @description\n *\n * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive\n * designates the **root element** of the application and is typically placed near the root element\n * of the page - e.g. on the `` or `` tags.\n *\n * There are a few things to keep in mind when using `ngApp`:\n * - only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`\n * found in the document will be used to define the root element to auto-bootstrap as an\n * application. To run multiple applications in an HTML document you must manually bootstrap them using\n * {@link angular.bootstrap} instead.\n * - AngularJS applications cannot be nested within each other.\n * - Do not use a directive that uses {@link ng.$compile#transclusion transclusion} on the same element as `ngApp`.\n * This includes directives such as {@link ng.ngIf `ngIf`}, {@link ng.ngInclude `ngInclude`} and\n * {@link ngRoute.ngView `ngView`}.\n * Doing this misplaces the app {@link ng.$rootElement `$rootElement`} and the app's {@link auto.$injector injector},\n * causing animations to stop working and making the injector inaccessible from outside the app.\n *\n * You can specify an **AngularJS module** to be used as the root module for the application. This\n * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It\n * should contain the application code needed or have dependencies on other modules that will\n * contain the code. See {@link angular.module} for more information.\n *\n * In the example below if the `ngApp` directive were not placed on the `html` element then the\n * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`\n * would not be resolved to `3`.\n *\n * @example\n *\n * ### Simple Usage\n *\n * `ngApp` is the easiest, and most common way to bootstrap an application.\n *\n \n \n
      \n I can add: {{a}} + {{b}} = {{ a+b }}\n
      \n
      \n \n angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n });\n \n
      \n *\n * @example\n *\n * ### With `ngStrictDi`\n *\n * Using `ngStrictDi`, you would see something like this:\n *\n \n \n
      \n
      \n I can add: {{a}} + {{b}} = {{ a+b }}\n\n

      This renders because the controller does not fail to\n instantiate, by using explicit annotation style (see\n script.js for details)\n

      \n
      \n\n
      \n Name:
      \n Hello, {{name}}!\n\n

      This renders because the controller does not fail to\n instantiate, by using explicit annotation style\n (see script.js for details)\n

      \n
      \n\n
      \n I can add: {{a}} + {{b}} = {{ a+b }}\n\n

      The controller could not be instantiated, due to relying\n on automatic function annotations (which are disabled in\n strict mode). As such, the content of this section is not\n interpolated, and there should be an error in your web console.\n

      \n
      \n
      \n
      \n \n angular.module('ngAppStrictDemo', [])\n // BadController will fail to instantiate, due to relying on automatic function annotation,\n // rather than an explicit annotation\n .controller('BadController', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n })\n // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,\n // due to using explicit annotations using the array style and $inject property, respectively.\n .controller('GoodController1', ['$scope', function($scope) {\n $scope.a = 1;\n $scope.b = 2;\n }])\n .controller('GoodController2', GoodController2);\n function GoodController2($scope) {\n $scope.name = 'World';\n }\n GoodController2.$inject = ['$scope'];\n \n \n div[ng-controller] {\n margin-bottom: 1em;\n -webkit-border-radius: 4px;\n border-radius: 4px;\n border: 1px solid;\n padding: .5em;\n }\n div[ng-controller^=Good] {\n border-color: #d6e9c6;\n background-color: #dff0d8;\n color: #3c763d;\n }\n div[ng-controller^=Bad] {\n border-color: #ebccd1;\n background-color: #f2dede;\n color: #a94442;\n margin-bottom: 0;\n }\n \n
      \n */\nfunction angularInit(element, bootstrap) {\n var appElement,\n module,\n config = {};\n\n // The element `element` has priority over any other element.\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n\n if (!appElement && element.hasAttribute && element.hasAttribute(name)) {\n appElement = element;\n module = element.getAttribute(name);\n }\n });\n forEach(ngAttrPrefixes, function(prefix) {\n var name = prefix + 'app';\n var candidate;\n\n if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\\\:') + ']'))) {\n appElement = candidate;\n module = candidate.getAttribute(name);\n }\n });\n if (appElement) {\n if (!isAutoBootstrapAllowed) {\n window.console.error('AngularJS: disabling automatic bootstrap. \n * \n * \n * \n * ```\n *\n * @param {DOMElement} element DOM element which is the root of AngularJS application.\n * @param {Array=} modules an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n * @param {Object=} config an object for defining configuration options for the application. The\n * following keys are supported:\n *\n * * `strictDi` - disable automatic function annotation for the application. This is meant to\n * assist in finding bugs which break minified code. Defaults to `false`.\n *\n * @returns {auto.$injector} Returns the newly created injector for this app.\n */\nfunction bootstrap(element, modules, config) {\n if (!isObject(config)) config = {};\n var defaultConfig = {\n strictDi: false\n };\n config = extend(defaultConfig, config);\n var doBootstrap = function() {\n element = jqLite(element);\n\n if (element.injector()) {\n var tag = (element[0] === window.document) ? 'document' : startingTag(element);\n // Encode angle brackets to prevent input from being sanitized to empty string #8683.\n throw ngMinErr(\n 'btstrpd',\n 'App already bootstrapped with this element \\'{0}\\'',\n tag.replace(//,'>'));\n }\n\n modules = modules || [];\n modules.unshift(['$provide', function($provide) {\n $provide.value('$rootElement', element);\n }]);\n\n if (config.debugInfoEnabled) {\n // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.\n modules.push(['$compileProvider', function($compileProvider) {\n $compileProvider.debugInfoEnabled(true);\n }]);\n }\n\n modules.unshift('ng');\n var injector = createInjector(modules, config.strictDi);\n injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',\n function bootstrapApply(scope, element, compile, injector) {\n scope.$apply(function() {\n element.data('$injector', injector);\n compile(element)(scope);\n });\n }]\n );\n return injector;\n };\n\n var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;\n var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;\n\n if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {\n config.debugInfoEnabled = true;\n window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');\n }\n\n if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {\n return doBootstrap();\n }\n\n window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');\n angular.resumeBootstrap = function(extraModules) {\n forEach(extraModules, function(module) {\n modules.push(module);\n });\n return doBootstrap();\n };\n\n if (isFunction(angular.resumeDeferredBootstrap)) {\n angular.resumeDeferredBootstrap();\n }\n}\n\n/**\n * @ngdoc function\n * @name angular.reloadWithDebugInfo\n * @module ng\n * @description\n * Use this function to reload the current application with debug information turned on.\n * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.\n *\n * See {@link ng.$compileProvider#debugInfoEnabled} for more.\n */\nfunction reloadWithDebugInfo() {\n window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;\n window.location.reload();\n}\n\n/**\n * @name angular.getTestability\n * @module ng\n * @description\n * Get the testability service for the instance of AngularJS on the given\n * element.\n * @param {DOMElement} element DOM element which is the root of AngularJS application.\n */\nfunction getTestability(rootElement) {\n var injector = angular.element(rootElement).injector();\n if (!injector) {\n throw ngMinErr('test',\n 'no injector found for element argument to getTestability');\n }\n return injector.get('$$testability');\n}\n\nvar SNAKE_CASE_REGEXP = /[A-Z]/g;\nfunction snake_case(name, separator) {\n separator = separator || '_';\n return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {\n return (pos ? separator : '') + letter.toLowerCase();\n });\n}\n\nvar bindJQueryFired = false;\nfunction bindJQuery() {\n var originalCleanData;\n\n if (bindJQueryFired) {\n return;\n }\n\n // bind to jQuery if present;\n var jqName = jq();\n jQuery = isUndefined(jqName) ? window.jQuery : // use jQuery (if present)\n !jqName ? undefined : // use jqLite\n window[jqName]; // use jQuery specified by `ngJq`\n\n // Use jQuery if it exists with proper functionality, otherwise default to us.\n // AngularJS 1.2+ requires jQuery 1.7+ for on()/off() support.\n // AngularJS 1.3+ technically requires at least jQuery 2.1+ but it may work with older\n // versions. It will not work for sure with jQuery <1.7, though.\n if (jQuery && jQuery.fn.on) {\n jqLite = jQuery;\n extend(jQuery.fn, {\n scope: JQLitePrototype.scope,\n isolateScope: JQLitePrototype.isolateScope,\n controller: /** @type {?} */ (JQLitePrototype).controller,\n injector: JQLitePrototype.injector,\n inheritedData: JQLitePrototype.inheritedData\n });\n } else {\n jqLite = JQLite;\n }\n\n // All nodes removed from the DOM via various jqLite/jQuery APIs like .remove()\n // are passed through jqLite/jQuery.cleanData. Monkey-patch this method to fire\n // the $destroy event on all removed nodes.\n originalCleanData = jqLite.cleanData;\n jqLite.cleanData = function(elems) {\n var events;\n for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n events = (jqLite._data(elem) || {}).events;\n if (events && events.$destroy) {\n jqLite(elem).triggerHandler('$destroy');\n }\n }\n originalCleanData(elems);\n };\n\n angular.element = jqLite;\n\n // Prevent double-proxying.\n bindJQueryFired = true;\n}\n\n/**\n * @ngdoc function\n * @name angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement\n * @module ng\n * @kind function\n *\n * @description\n * Restores the pre-1.8 behavior of jqLite that turns XHTML-like strings like\n * `
      ` to `
      ` instead of `
      `.\n * The new behavior is a security fix. Thus, if you need to call this function, please try to adjust\n * your code for this change and remove your use of this function as soon as possible.\n\n * Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read the\n * [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details\n * about the workarounds.\n */\nfunction UNSAFE_restoreLegacyJqLiteXHTMLReplacement() {\n JQLite.legacyXHTMLReplacement = true;\n}\n\n/**\n * throw error if the argument is falsy.\n */\nfunction assertArg(arg, name, reason) {\n if (!arg) {\n throw ngMinErr('areq', 'Argument \\'{0}\\' is {1}', (name || '?'), (reason || 'required'));\n }\n return arg;\n}\n\nfunction assertArgFn(arg, name, acceptArrayAnnotation) {\n if (acceptArrayAnnotation && isArray(arg)) {\n arg = arg[arg.length - 1];\n }\n\n assertArg(isFunction(arg), name, 'not a function, got ' +\n (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));\n return arg;\n}\n\n/**\n * throw error if the name given is hasOwnProperty\n * @param {String} name the name to test\n * @param {String} context the context in which the name is used, such as module or directive\n */\nfunction assertNotHasOwnProperty(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n}\n\n/**\n * Return the value accessible from the object by path. Any undefined traversals are ignored\n * @param {Object} obj starting object\n * @param {String} path path to traverse\n * @param {boolean} [bindFnToScope=true]\n * @returns {Object} value as accessible by path\n */\n//TODO(misko): this function needs to be removed\nfunction getter(obj, path, bindFnToScope) {\n if (!path) return obj;\n var keys = path.split('.');\n var key;\n var lastInstance = obj;\n var len = keys.length;\n\n for (var i = 0; i < len; i++) {\n key = keys[i];\n if (obj) {\n obj = (lastInstance = obj)[key];\n }\n }\n if (!bindFnToScope && isFunction(obj)) {\n return bind(lastInstance, obj);\n }\n return obj;\n}\n\n/**\n * Return the DOM siblings between the first and last node in the given array.\n * @param {Array} array like object\n * @returns {Array} the inputted object or a jqLite collection containing the nodes\n */\nfunction getBlockNodes(nodes) {\n // TODO(perf): update `nodes` instead of creating a new object?\n var node = nodes[0];\n var endNode = nodes[nodes.length - 1];\n var blockNodes;\n\n for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {\n if (blockNodes || nodes[i] !== node) {\n if (!blockNodes) {\n blockNodes = jqLite(slice.call(nodes, 0, i));\n }\n blockNodes.push(node);\n }\n }\n\n return blockNodes || nodes;\n}\n\n\n/**\n * Creates a new object without a prototype. This object is useful for lookup without having to\n * guard against prototypically inherited properties via hasOwnProperty.\n *\n * Related micro-benchmarks:\n * - http://jsperf.com/object-create2\n * - http://jsperf.com/proto-map-lookup/2\n * - http://jsperf.com/for-in-vs-object-keys2\n *\n * @returns {Object}\n */\nfunction createMap() {\n return Object.create(null);\n}\n\nfunction stringify(value) {\n if (value == null) { // null || undefined\n return '';\n }\n switch (typeof value) {\n case 'string':\n break;\n case 'number':\n value = '' + value;\n break;\n default:\n if (hasCustomToString(value) && !isArray(value) && !isDate(value)) {\n value = value.toString();\n } else {\n value = toJson(value);\n }\n }\n\n return value;\n}\n\nvar NODE_TYPE_ELEMENT = 1;\nvar NODE_TYPE_ATTRIBUTE = 2;\nvar NODE_TYPE_TEXT = 3;\nvar NODE_TYPE_COMMENT = 8;\nvar NODE_TYPE_DOCUMENT = 9;\nvar NODE_TYPE_DOCUMENT_FRAGMENT = 11;\n\n/**\n * @ngdoc type\n * @name angular.Module\n * @module ng\n * @description\n *\n * Interface for configuring AngularJS {@link angular.module modules}.\n */\n\nfunction setupModuleLoader(window) {\n\n var $injectorMinErr = minErr('$injector');\n var ngMinErr = minErr('ng');\n\n function ensure(obj, name, factory) {\n return obj[name] || (obj[name] = factory());\n }\n\n var angular = ensure(window, 'angular', Object);\n\n // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap\n angular.$$minErr = angular.$$minErr || minErr;\n\n return ensure(angular, 'module', function() {\n /** @type {Object.} */\n var modules = {};\n\n /**\n * @ngdoc function\n * @name angular.module\n * @module ng\n * @description\n *\n * The `angular.module` is a global place for creating, registering and retrieving AngularJS\n * modules.\n * All modules (AngularJS core or 3rd party) that should be available to an application must be\n * registered using this mechanism.\n *\n * Passing one argument retrieves an existing {@link angular.Module},\n * whereas passing more than one argument creates a new {@link angular.Module}\n *\n *\n * # Module\n *\n * A module is a collection of services, directives, controllers, filters, and configuration information.\n * `angular.module` is used to configure the {@link auto.$injector $injector}.\n *\n * ```js\n * // Create a new module\n * var myModule = angular.module('myModule', []);\n *\n * // register a new service\n * myModule.value('appName', 'MyCoolApp');\n *\n * // configure existing services inside initialization blocks.\n * myModule.config(['$locationProvider', function($locationProvider) {\n * // Configure existing providers\n * $locationProvider.hashPrefix('!');\n * }]);\n * ```\n *\n * Then you can create an injector and load your modules like this:\n *\n * ```js\n * var injector = angular.injector(['ng', 'myModule'])\n * ```\n *\n * However it's more likely that you'll just use\n * {@link ng.directive:ngApp ngApp} or\n * {@link angular.bootstrap} to simplify this process for you.\n *\n * @param {!string} name The name of the module to create or retrieve.\n * @param {!Array.=} requires If specified then new module is being created. If\n * unspecified then the module is being retrieved for further configuration.\n * @param {Function=} configFn Optional configuration function for the module. Same as\n * {@link angular.Module#config Module#config()}.\n * @returns {angular.Module} new module with the {@link angular.Module} api.\n */\n return function module(name, requires, configFn) {\n\n var info = {};\n\n var assertNotHasOwnProperty = function(name, context) {\n if (name === 'hasOwnProperty') {\n throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);\n }\n };\n\n assertNotHasOwnProperty(name, 'module');\n if (requires && modules.hasOwnProperty(name)) {\n modules[name] = null;\n }\n return ensure(modules, name, function() {\n if (!requires) {\n throw $injectorMinErr('nomod', 'Module \\'{0}\\' is not available! You either misspelled ' +\n 'the module name or forgot to load it. If registering a module ensure that you ' +\n 'specify the dependencies as the second argument.', name);\n }\n\n /** @type {!Array.>} */\n var invokeQueue = [];\n\n /** @type {!Array.} */\n var configBlocks = [];\n\n /** @type {!Array.} */\n var runBlocks = [];\n\n var config = invokeLater('$injector', 'invoke', 'push', configBlocks);\n\n /** @type {angular.Module} */\n var moduleInstance = {\n // Private state\n _invokeQueue: invokeQueue,\n _configBlocks: configBlocks,\n _runBlocks: runBlocks,\n\n /**\n * @ngdoc method\n * @name angular.Module#info\n * @module ng\n *\n * @param {Object=} info Information about the module\n * @returns {Object|Module} The current info object for this module if called as a getter,\n * or `this` if called as a setter.\n *\n * @description\n * Read and write custom information about this module.\n * For example you could put the version of the module in here.\n *\n * ```js\n * angular.module('myModule', []).info({ version: '1.0.0' });\n * ```\n *\n * The version could then be read back out by accessing the module elsewhere:\n *\n * ```\n * var version = angular.module('myModule').info().version;\n * ```\n *\n * You can also retrieve this information during runtime via the\n * {@link $injector#modules `$injector.modules`} property:\n *\n * ```js\n * var version = $injector.modules['myModule'].info().version;\n * ```\n */\n info: function(value) {\n if (isDefined(value)) {\n if (!isObject(value)) throw ngMinErr('aobj', 'Argument \\'{0}\\' must be an object', 'value');\n info = value;\n return this;\n }\n return info;\n },\n\n /**\n * @ngdoc property\n * @name angular.Module#requires\n * @module ng\n *\n * @description\n * Holds the list of modules which the injector will load before the current module is\n * loaded.\n */\n requires: requires,\n\n /**\n * @ngdoc property\n * @name angular.Module#name\n * @module ng\n *\n * @description\n * Name of the module.\n */\n name: name,\n\n\n /**\n * @ngdoc method\n * @name angular.Module#provider\n * @module ng\n * @param {string} name service name\n * @param {Function} providerType Construction function for creating new instance of the\n * service.\n * @description\n * See {@link auto.$provide#provider $provide.provider()}.\n */\n provider: invokeLaterAndSetModuleName('$provide', 'provider'),\n\n /**\n * @ngdoc method\n * @name angular.Module#factory\n * @module ng\n * @param {string} name service name\n * @param {Function} providerFunction Function for creating new instance of the service.\n * @description\n * See {@link auto.$provide#factory $provide.factory()}.\n */\n factory: invokeLaterAndSetModuleName('$provide', 'factory'),\n\n /**\n * @ngdoc method\n * @name angular.Module#service\n * @module ng\n * @param {string} name service name\n * @param {Function} constructor A constructor function that will be instantiated.\n * @description\n * See {@link auto.$provide#service $provide.service()}.\n */\n service: invokeLaterAndSetModuleName('$provide', 'service'),\n\n /**\n * @ngdoc method\n * @name angular.Module#value\n * @module ng\n * @param {string} name service name\n * @param {*} object Service instance object.\n * @description\n * See {@link auto.$provide#value $provide.value()}.\n */\n value: invokeLater('$provide', 'value'),\n\n /**\n * @ngdoc method\n * @name angular.Module#constant\n * @module ng\n * @param {string} name constant name\n * @param {*} object Constant value.\n * @description\n * Because the constants are fixed, they get applied before other provide methods.\n * See {@link auto.$provide#constant $provide.constant()}.\n */\n constant: invokeLater('$provide', 'constant', 'unshift'),\n\n /**\n * @ngdoc method\n * @name angular.Module#decorator\n * @module ng\n * @param {string} name The name of the service to decorate.\n * @param {Function} decorFn This function will be invoked when the service needs to be\n * instantiated and should return the decorated service instance.\n * @description\n * See {@link auto.$provide#decorator $provide.decorator()}.\n */\n decorator: invokeLaterAndSetModuleName('$provide', 'decorator', configBlocks),\n\n /**\n * @ngdoc method\n * @name angular.Module#animation\n * @module ng\n * @param {string} name animation name\n * @param {Function} animationFactory Factory function for creating new instance of an\n * animation.\n * @description\n *\n * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.\n *\n *\n * Defines an animation hook that can be later used with\n * {@link $animate $animate} service and directives that use this service.\n *\n * ```js\n * module.animation('.animation-name', function($inject1, $inject2) {\n * return {\n * eventName : function(element, done) {\n * //code to run the animation\n * //once complete, then run done()\n * return function cancellationFunction(element) {\n * //code to cancel the animation\n * }\n * }\n * }\n * })\n * ```\n *\n * See {@link ng.$animateProvider#register $animateProvider.register()} and\n * {@link ngAnimate ngAnimate module} for more information.\n */\n animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#filter\n * @module ng\n * @param {string} name Filter name - this must be a valid AngularJS expression identifier\n * @param {Function} filterFactory Factory function for creating new instance of filter.\n * @description\n * See {@link ng.$filterProvider#register $filterProvider.register()}.\n *\n *
      \n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
      \n */\n filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#controller\n * @module ng\n * @param {string|Object} name Controller name, or an object map of controllers where the\n * keys are the names and the values are the constructors.\n * @param {Function} constructor Controller constructor function.\n * @description\n * See {@link ng.$controllerProvider#register $controllerProvider.register()}.\n */\n controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),\n\n /**\n * @ngdoc method\n * @name angular.Module#directive\n * @module ng\n * @param {string|Object} name Directive name, or an object map of directives where the\n * keys are the names and the values are the factories.\n * @param {Function} directiveFactory Factory function for creating new instance of\n * directives.\n * @description\n * See {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),\n\n /**\n * @ngdoc method\n * @name angular.Module#component\n * @module ng\n * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match ``),\n * or an object map of components where the keys are the names and the values are the component definition objects.\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object})\n *\n * @description\n * See {@link ng.$compileProvider#component $compileProvider.component()}.\n */\n component: invokeLaterAndSetModuleName('$compileProvider', 'component'),\n\n /**\n * @ngdoc method\n * @name angular.Module#config\n * @module ng\n * @param {Function} configFn Execute this function on module load. Useful for service\n * configuration.\n * @description\n * Use this method to configure services by injecting their\n * {@link angular.Module#provider `providers`}, e.g. for adding routes to the\n * {@link ngRoute.$routeProvider $routeProvider}.\n *\n * Note that you can only inject {@link angular.Module#provider `providers`} and\n * {@link angular.Module#constant `constants`} into this function.\n *\n * For more about how to configure services, see\n * {@link providers#provider-recipe Provider Recipe}.\n */\n config: config,\n\n /**\n * @ngdoc method\n * @name angular.Module#run\n * @module ng\n * @param {Function} initializationFn Execute this function after injector creation.\n * Useful for application initialization.\n * @description\n * Use this method to register work which should be performed when the injector is done\n * loading all modules.\n */\n run: function(block) {\n runBlocks.push(block);\n return this;\n }\n };\n\n if (configFn) {\n config(configFn);\n }\n\n return moduleInstance;\n\n /**\n * @param {string} provider\n * @param {string} method\n * @param {String=} insertMethod\n * @returns {angular.Module}\n */\n function invokeLater(provider, method, insertMethod, queue) {\n if (!queue) queue = invokeQueue;\n return function() {\n queue[insertMethod || 'push']([provider, method, arguments]);\n return moduleInstance;\n };\n }\n\n /**\n * @param {string} provider\n * @param {string} method\n * @returns {angular.Module}\n */\n function invokeLaterAndSetModuleName(provider, method, queue) {\n if (!queue) queue = invokeQueue;\n return function(recipeName, factoryFunction) {\n if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;\n queue.push([provider, method, arguments]);\n return moduleInstance;\n };\n }\n });\n };\n });\n\n}\n\n/* global shallowCopy: true */\n\n/**\n * Creates a shallow copy of an object, an array or a primitive.\n *\n * Assumes that there are no proto properties for objects.\n */\nfunction shallowCopy(src, dst) {\n if (isArray(src)) {\n dst = dst || [];\n\n for (var i = 0, ii = src.length; i < ii; i++) {\n dst[i] = src[i];\n }\n } else if (isObject(src)) {\n dst = dst || {};\n\n for (var key in src) {\n if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst || src;\n}\n\n/* exported toDebugString */\n\nfunction serializeObject(obj, maxDepth) {\n var seen = [];\n\n // There is no direct way to stringify object until reaching a specific depth\n // and a very deep object can cause a performance issue, so we copy the object\n // based on this specific depth and then stringify it.\n if (isValidObjectMaxDepth(maxDepth)) {\n // This file is also included in `angular-loader`, so `copy()` might not always be available in\n // the closure. Therefore, it is lazily retrieved as `angular.copy()` when needed.\n obj = angular.copy(obj, null, maxDepth);\n }\n return JSON.stringify(obj, function(key, val) {\n val = toJsonReplacer(key, val);\n if (isObject(val)) {\n\n if (seen.indexOf(val) >= 0) return '...';\n\n seen.push(val);\n }\n return val;\n });\n}\n\nfunction toDebugString(obj, maxDepth) {\n if (typeof obj === 'function') {\n return obj.toString().replace(/ \\{[\\s\\S]*$/, '');\n } else if (isUndefined(obj)) {\n return 'undefined';\n } else if (typeof obj !== 'string') {\n return serializeObject(obj, maxDepth);\n }\n return obj;\n}\n\n/* global angularModule: true,\n version: true,\n\n $CompileProvider,\n\n htmlAnchorDirective,\n inputDirective,\n hiddenInputBrowserCacheDirective,\n formDirective,\n scriptDirective,\n selectDirective,\n optionDirective,\n ngBindDirective,\n ngBindHtmlDirective,\n ngBindTemplateDirective,\n ngClassDirective,\n ngClassEvenDirective,\n ngClassOddDirective,\n ngCloakDirective,\n ngControllerDirective,\n ngFormDirective,\n ngHideDirective,\n ngIfDirective,\n ngIncludeDirective,\n ngIncludeFillContentDirective,\n ngInitDirective,\n ngNonBindableDirective,\n ngPluralizeDirective,\n ngRefDirective,\n ngRepeatDirective,\n ngShowDirective,\n ngStyleDirective,\n ngSwitchDirective,\n ngSwitchWhenDirective,\n ngSwitchDefaultDirective,\n ngOptionsDirective,\n ngTranscludeDirective,\n ngModelDirective,\n ngListDirective,\n ngChangeDirective,\n patternDirective,\n patternDirective,\n requiredDirective,\n requiredDirective,\n minlengthDirective,\n minlengthDirective,\n maxlengthDirective,\n maxlengthDirective,\n ngValueDirective,\n ngModelOptionsDirective,\n ngAttributeAliasDirectives,\n ngEventDirectives,\n\n $AnchorScrollProvider,\n $AnimateProvider,\n $CoreAnimateCssProvider,\n $$CoreAnimateJsProvider,\n $$CoreAnimateQueueProvider,\n $$AnimateRunnerFactoryProvider,\n $$AnimateAsyncRunFactoryProvider,\n $BrowserProvider,\n $CacheFactoryProvider,\n $ControllerProvider,\n $DateProvider,\n $DocumentProvider,\n $$IsDocumentHiddenProvider,\n $ExceptionHandlerProvider,\n $FilterProvider,\n $$ForceReflowProvider,\n $InterpolateProvider,\n $$IntervalFactoryProvider,\n $IntervalProvider,\n $HttpProvider,\n $HttpParamSerializerProvider,\n $HttpParamSerializerJQLikeProvider,\n $HttpBackendProvider,\n $xhrFactoryProvider,\n $jsonpCallbacksProvider,\n $LocationProvider,\n $LogProvider,\n $$MapProvider,\n $ParseProvider,\n $RootScopeProvider,\n $QProvider,\n $$QProvider,\n $$SanitizeUriProvider,\n $SceProvider,\n $SceDelegateProvider,\n $SnifferProvider,\n $$TaskTrackerFactoryProvider,\n $TemplateCacheProvider,\n $TemplateRequestProvider,\n $$TestabilityProvider,\n $TimeoutProvider,\n $$RAFProvider,\n $WindowProvider,\n $$jqLiteProvider,\n $$CookieReaderProvider\n*/\n\n\n/**\n * @ngdoc object\n * @name angular.version\n * @module ng\n * @description\n * An object that contains information about the current AngularJS version.\n *\n * This object has the following properties:\n *\n * - `full` – `{string}` – Full version string, such as \"0.9.18\".\n * - `major` – `{number}` – Major version number, such as \"0\".\n * - `minor` – `{number}` – Minor version number, such as \"9\".\n * - `dot` – `{number}` – Dot version number, such as \"18\".\n * - `codeName` – `{string}` – Code name of the release, such as \"jiggling-armfat\".\n */\nvar version = {\n // These placeholder strings will be replaced by grunt's `build` task.\n // They need to be double- or single-quoted.\n full: '1.8.2',\n major: 1,\n minor: 8,\n dot: 2,\n codeName: 'meteoric-mining'\n};\n\n\nfunction publishExternalAPI(angular) {\n extend(angular, {\n 'errorHandlingConfig': errorHandlingConfig,\n 'bootstrap': bootstrap,\n 'copy': copy,\n 'extend': extend,\n 'merge': merge,\n 'equals': equals,\n 'element': jqLite,\n 'forEach': forEach,\n 'injector': createInjector,\n 'noop': noop,\n 'bind': bind,\n 'toJson': toJson,\n 'fromJson': fromJson,\n 'identity': identity,\n 'isUndefined': isUndefined,\n 'isDefined': isDefined,\n 'isString': isString,\n 'isFunction': isFunction,\n 'isObject': isObject,\n 'isNumber': isNumber,\n 'isElement': isElement,\n 'isArray': isArray,\n 'version': version,\n 'isDate': isDate,\n 'callbacks': {$$counter: 0},\n 'getTestability': getTestability,\n 'reloadWithDebugInfo': reloadWithDebugInfo,\n 'UNSAFE_restoreLegacyJqLiteXHTMLReplacement': UNSAFE_restoreLegacyJqLiteXHTMLReplacement,\n '$$minErr': minErr,\n '$$csp': csp,\n '$$encodeUriSegment': encodeUriSegment,\n '$$encodeUriQuery': encodeUriQuery,\n '$$lowercase': lowercase,\n '$$stringify': stringify,\n '$$uppercase': uppercase\n });\n\n angularModule = setupModuleLoader(window);\n\n angularModule('ng', ['ngLocale'], ['$provide',\n function ngModule($provide) {\n // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.\n $provide.provider({\n $$sanitizeUri: $$SanitizeUriProvider\n });\n $provide.provider('$compile', $CompileProvider).\n directive({\n a: htmlAnchorDirective,\n input: inputDirective,\n textarea: inputDirective,\n form: formDirective,\n script: scriptDirective,\n select: selectDirective,\n option: optionDirective,\n ngBind: ngBindDirective,\n ngBindHtml: ngBindHtmlDirective,\n ngBindTemplate: ngBindTemplateDirective,\n ngClass: ngClassDirective,\n ngClassEven: ngClassEvenDirective,\n ngClassOdd: ngClassOddDirective,\n ngCloak: ngCloakDirective,\n ngController: ngControllerDirective,\n ngForm: ngFormDirective,\n ngHide: ngHideDirective,\n ngIf: ngIfDirective,\n ngInclude: ngIncludeDirective,\n ngInit: ngInitDirective,\n ngNonBindable: ngNonBindableDirective,\n ngPluralize: ngPluralizeDirective,\n ngRef: ngRefDirective,\n ngRepeat: ngRepeatDirective,\n ngShow: ngShowDirective,\n ngStyle: ngStyleDirective,\n ngSwitch: ngSwitchDirective,\n ngSwitchWhen: ngSwitchWhenDirective,\n ngSwitchDefault: ngSwitchDefaultDirective,\n ngOptions: ngOptionsDirective,\n ngTransclude: ngTranscludeDirective,\n ngModel: ngModelDirective,\n ngList: ngListDirective,\n ngChange: ngChangeDirective,\n pattern: patternDirective,\n ngPattern: patternDirective,\n required: requiredDirective,\n ngRequired: requiredDirective,\n minlength: minlengthDirective,\n ngMinlength: minlengthDirective,\n maxlength: maxlengthDirective,\n ngMaxlength: maxlengthDirective,\n ngValue: ngValueDirective,\n ngModelOptions: ngModelOptionsDirective\n }).\n directive({\n ngInclude: ngIncludeFillContentDirective,\n input: hiddenInputBrowserCacheDirective\n }).\n directive(ngAttributeAliasDirectives).\n directive(ngEventDirectives);\n $provide.provider({\n $anchorScroll: $AnchorScrollProvider,\n $animate: $AnimateProvider,\n $animateCss: $CoreAnimateCssProvider,\n $$animateJs: $$CoreAnimateJsProvider,\n $$animateQueue: $$CoreAnimateQueueProvider,\n $$AnimateRunner: $$AnimateRunnerFactoryProvider,\n $$animateAsyncRun: $$AnimateAsyncRunFactoryProvider,\n $browser: $BrowserProvider,\n $cacheFactory: $CacheFactoryProvider,\n $controller: $ControllerProvider,\n $document: $DocumentProvider,\n $$isDocumentHidden: $$IsDocumentHiddenProvider,\n $exceptionHandler: $ExceptionHandlerProvider,\n $filter: $FilterProvider,\n $$forceReflow: $$ForceReflowProvider,\n $interpolate: $InterpolateProvider,\n $interval: $IntervalProvider,\n $$intervalFactory: $$IntervalFactoryProvider,\n $http: $HttpProvider,\n $httpParamSerializer: $HttpParamSerializerProvider,\n $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,\n $httpBackend: $HttpBackendProvider,\n $xhrFactory: $xhrFactoryProvider,\n $jsonpCallbacks: $jsonpCallbacksProvider,\n $location: $LocationProvider,\n $log: $LogProvider,\n $parse: $ParseProvider,\n $rootScope: $RootScopeProvider,\n $q: $QProvider,\n $$q: $$QProvider,\n $sce: $SceProvider,\n $sceDelegate: $SceDelegateProvider,\n $sniffer: $SnifferProvider,\n $$taskTrackerFactory: $$TaskTrackerFactoryProvider,\n $templateCache: $TemplateCacheProvider,\n $templateRequest: $TemplateRequestProvider,\n $$testability: $$TestabilityProvider,\n $timeout: $TimeoutProvider,\n $window: $WindowProvider,\n $$rAF: $$RAFProvider,\n $$jqLite: $$jqLiteProvider,\n $$Map: $$MapProvider,\n $$cookieReader: $$CookieReaderProvider\n });\n }\n ])\n .info({ angularVersion: '1.8.2' });\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* global\n JQLitePrototype: true,\n BOOLEAN_ATTR: true,\n ALIASED_ATTR: true\n*/\n\n//////////////////////////////////\n//JQLite\n//////////////////////////////////\n\n/**\n * @ngdoc function\n * @name angular.element\n * @module ng\n * @kind function\n *\n * @description\n * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.\n *\n * If jQuery is available, `angular.element` is an alias for the\n * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`\n * delegates to AngularJS's built-in subset of jQuery, called \"jQuery lite\" or **jqLite**.\n *\n * jqLite is a tiny, API-compatible subset of jQuery that allows\n * AngularJS to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most\n * commonly needed functionality with the goal of having a very small footprint.\n *\n * To use `jQuery`, simply ensure it is loaded before the `angular.js` file. You can also use the\n * {@link ngJq `ngJq`} directive to specify that jqlite should be used over jQuery, or to use a\n * specific version of jQuery if multiple versions exist on the page.\n *\n *
      **Note:** All element references in AngularJS are always wrapped with jQuery or\n * jqLite (such as the element argument in a directive's compile / link function). They are never raw DOM references.
      \n *\n *
      **Note:** Keep in mind that this function will not find elements\n * by tag name / CSS selector. For lookups by tag name, try instead `angular.element(document).find(...)`\n * or `$document.find()`, or use the standard DOM APIs, e.g. `document.querySelectorAll()`.
      \n *\n * ## AngularJS's jqLite\n * jqLite provides only the following jQuery methods:\n *\n * - [`addClass()`](http://api.jquery.com/addClass/) - Does not support a function as first argument\n * - [`after()`](http://api.jquery.com/after/)\n * - [`append()`](http://api.jquery.com/append/) - Contrary to jQuery, this doesn't clone elements\n * so will not work correctly when invoked on a jqLite object containing more than one DOM node\n * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters\n * - [`bind()`](http://api.jquery.com/bind/) (_deprecated_, use [`on()`](http://api.jquery.com/on/)) - Does not support namespaces, selectors or eventData\n * - [`children()`](http://api.jquery.com/children/) - Does not support selectors\n * - [`clone()`](http://api.jquery.com/clone/)\n * - [`contents()`](http://api.jquery.com/contents/)\n * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`.\n * As a setter, does not convert numbers to strings or append 'px', and also does not have automatic property prefixing.\n * - [`data()`](http://api.jquery.com/data/)\n * - [`detach()`](http://api.jquery.com/detach/)\n * - [`empty()`](http://api.jquery.com/empty/)\n * - [`eq()`](http://api.jquery.com/eq/)\n * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name\n * - [`hasClass()`](http://api.jquery.com/hasClass/)\n * - [`html()`](http://api.jquery.com/html/)\n * - [`next()`](http://api.jquery.com/next/) - Does not support selectors\n * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData\n * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter\n * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors\n * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors\n * - [`prepend()`](http://api.jquery.com/prepend/)\n * - [`prop()`](http://api.jquery.com/prop/)\n * - [`ready()`](http://api.jquery.com/ready/) (_deprecated_, use `angular.element(callback)` instead of `angular.element(document).ready(callback)`)\n * - [`remove()`](http://api.jquery.com/remove/)\n * - [`removeAttr()`](http://api.jquery.com/removeAttr/) - Does not support multiple attributes\n * - [`removeClass()`](http://api.jquery.com/removeClass/) - Does not support a function as first argument\n * - [`removeData()`](http://api.jquery.com/removeData/)\n * - [`replaceWith()`](http://api.jquery.com/replaceWith/)\n * - [`text()`](http://api.jquery.com/text/)\n * - [`toggleClass()`](http://api.jquery.com/toggleClass/) - Does not support a function as first argument\n * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers\n * - [`unbind()`](http://api.jquery.com/unbind/) (_deprecated_, use [`off()`](http://api.jquery.com/off/)) - Does not support namespaces or event object as parameter\n * - [`val()`](http://api.jquery.com/val/)\n * - [`wrap()`](http://api.jquery.com/wrap/)\n *\n * jqLite also provides a method restoring pre-1.8 insecure treatment of XHTML-like tags.\n * This legacy behavior turns input like `
      ` to `
      `\n * instead of `
      ` like version 1.8 & newer do. To restore it, invoke:\n * ```js\n * angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement();\n * ```\n * Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read the\n * [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details\n * about the workarounds.\n *\n * ## jQuery/jqLite Extras\n * AngularJS also provides the following additional methods and events to both jQuery and jqLite:\n *\n * ### Events\n * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event\n * on all DOM nodes being removed. This can be used to clean up any 3rd party bindings to the DOM\n * element before it is removed.\n *\n * ### Methods\n * - `controller(name)` - retrieves the controller of the current element or its parent. By default\n * retrieves controller associated with the `ngController` directive. If `name` is provided as\n * camelCase directive name, then the controller for this directive will be retrieved (e.g.\n * `'ngModel'`).\n * - `injector()` - retrieves the injector of the current element or its parent.\n * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current\n * element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to\n * be enabled.\n * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the\n * current element. This getter should be used only on elements that contain a directive which starts a new isolate\n * scope. Calling `scope()` on this element always returns the original non-isolate scope.\n * Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.\n * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top\n * parent element is reached.\n *\n * @knownIssue You cannot spy on `angular.element` if you are using Jasmine version 1.x. See\n * https://github.com/angular/angular.js/issues/14251 for more information.\n *\n * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.\n * @returns {Object} jQuery object.\n */\n\nJQLite.expando = 'ng339';\n\nvar jqCache = JQLite.cache = {},\n jqId = 1;\n\n/*\n * !!! This is an undocumented \"private\" function !!!\n */\nJQLite._data = function(node) {\n //jQuery always returns an object on cache miss\n return this.cache[node[this.expando]] || {};\n};\n\nfunction jqNextId() { return ++jqId; }\n\n\nvar DASH_LOWERCASE_REGEXP = /-([a-z])/g;\nvar MS_HACK_REGEXP = /^-ms-/;\nvar MOUSE_EVENT_MAP = { mouseleave: 'mouseout', mouseenter: 'mouseover' };\nvar jqLiteMinErr = minErr('jqLite');\n\n/**\n * Converts kebab-case to camelCase.\n * There is also a special case for the ms prefix starting with a lowercase letter.\n * @param name Name to normalize\n */\nfunction cssKebabToCamel(name) {\n return kebabToCamel(name.replace(MS_HACK_REGEXP, 'ms-'));\n}\n\nfunction fnCamelCaseReplace(all, letter) {\n return letter.toUpperCase();\n}\n\n/**\n * Converts kebab-case to camelCase.\n * @param name Name to normalize\n */\nfunction kebabToCamel(name) {\n return name\n .replace(DASH_LOWERCASE_REGEXP, fnCamelCaseReplace);\n}\n\nvar SINGLE_TAG_REGEXP = /^<([\\w-]+)\\s*\\/?>(?:<\\/\\1>|)$/;\nvar HTML_REGEXP = /<|&#?\\w+;/;\nvar TAG_NAME_REGEXP = /<([\\w:-]+)/;\nvar XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:-]+)[^>]*)\\/>/gi;\n\n// Table parts need to be wrapped with `` or they're\n// stripped to their contents when put in a div.\n// XHTML parsers do not magically insert elements in the\n// same way that tag soup parsers do, so we cannot shorten\n// this by omitting or other required elements.\nvar wrapMap = {\n thead: ['table'],\n col: ['colgroup', 'table'],\n tr: ['tbody', 'table'],\n td: ['tr', 'tbody', 'table']\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <10 only\n// IE 9 requires an option wrapper & it needs to have the whole table structure\n// set up in advance; assigning `\"\"` to `tr.innerHTML` doesn't work, etc.\nvar wrapMapIE9 = {\n option: [1, ''],\n _default: [0, '', '']\n};\n\nfor (var key in wrapMap) {\n var wrapMapValueClosing = wrapMap[key];\n var wrapMapValue = wrapMapValueClosing.slice().reverse();\n wrapMapIE9[key] = [wrapMapValue.length, '<' + wrapMapValue.join('><') + '>', ''];\n}\n\nwrapMapIE9.optgroup = wrapMapIE9.option;\n\nfunction jqLiteIsTextNode(html) {\n return !HTML_REGEXP.test(html);\n}\n\nfunction jqLiteAcceptsData(node) {\n // The window object can accept data but has no nodeType\n // Otherwise we are only interested in elements (1) and documents (9)\n var nodeType = node.nodeType;\n return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;\n}\n\nfunction jqLiteHasData(node) {\n for (var key in jqCache[node.ng339]) {\n return true;\n }\n return false;\n}\n\nfunction jqLiteBuildFragment(html, context) {\n var tmp, tag, wrap, finalHtml,\n fragment = context.createDocumentFragment(),\n nodes = [], i;\n\n if (jqLiteIsTextNode(html)) {\n // Convert non-html into a text node\n nodes.push(context.createTextNode(html));\n } else {\n // Convert html into DOM nodes\n tmp = fragment.appendChild(context.createElement('div'));\n tag = (TAG_NAME_REGEXP.exec(html) || ['', ''])[1].toLowerCase();\n finalHtml = JQLite.legacyXHTMLReplacement ?\n html.replace(XHTML_TAG_REGEXP, '<$1>') :\n html;\n\n if (msie < 10) {\n wrap = wrapMapIE9[tag] || wrapMapIE9._default;\n tmp.innerHTML = wrap[1] + finalHtml + wrap[2];\n\n // Descend through wrappers to the right content\n i = wrap[0];\n while (i--) {\n tmp = tmp.firstChild;\n }\n } else {\n wrap = wrapMap[tag] || [];\n\n // Create wrappers & descend into them\n i = wrap.length;\n while (--i > -1) {\n tmp.appendChild(window.document.createElement(wrap[i]));\n tmp = tmp.firstChild;\n }\n\n tmp.innerHTML = finalHtml;\n }\n\n nodes = concat(nodes, tmp.childNodes);\n\n tmp = fragment.firstChild;\n tmp.textContent = '';\n }\n\n // Remove wrapper from fragment\n fragment.textContent = '';\n fragment.innerHTML = ''; // Clear inner HTML\n forEach(nodes, function(node) {\n fragment.appendChild(node);\n });\n\n return fragment;\n}\n\nfunction jqLiteParseHTML(html, context) {\n context = context || window.document;\n var parsed;\n\n if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {\n return [context.createElement(parsed[1])];\n }\n\n if ((parsed = jqLiteBuildFragment(html, context))) {\n return parsed.childNodes;\n }\n\n return [];\n}\n\nfunction jqLiteWrapNode(node, wrapper) {\n var parent = node.parentNode;\n\n if (parent) {\n parent.replaceChild(wrapper, node);\n }\n\n wrapper.appendChild(node);\n}\n\n\n// IE9-11 has no method \"contains\" in SVG element and in Node.prototype. Bug #10259.\nvar jqLiteContains = window.Node.prototype.contains || /** @this */ function(arg) {\n // eslint-disable-next-line no-bitwise\n return !!(this.compareDocumentPosition(arg) & 16);\n};\n\n/////////////////////////////////////////////\nfunction JQLite(element) {\n if (element instanceof JQLite) {\n return element;\n }\n\n var argIsString;\n\n if (isString(element)) {\n element = trim(element);\n argIsString = true;\n }\n if (!(this instanceof JQLite)) {\n if (argIsString && element.charAt(0) !== '<') {\n throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');\n }\n return new JQLite(element);\n }\n\n if (argIsString) {\n jqLiteAddNodes(this, jqLiteParseHTML(element));\n } else if (isFunction(element)) {\n jqLiteReady(element);\n } else {\n jqLiteAddNodes(this, element);\n }\n}\n\nfunction jqLiteClone(element) {\n return element.cloneNode(true);\n}\n\nfunction jqLiteDealoc(element, onlyDescendants) {\n if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]);\n\n if (element.querySelectorAll) {\n jqLite.cleanData(element.querySelectorAll('*'));\n }\n}\n\nfunction isEmptyObject(obj) {\n var name;\n\n for (name in obj) {\n return false;\n }\n return true;\n}\n\nfunction removeIfEmptyData(element) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n\n var events = expandoStore && expandoStore.events;\n var data = expandoStore && expandoStore.data;\n\n if ((!data || isEmptyObject(data)) && (!events || isEmptyObject(events))) {\n delete jqCache[expandoId];\n element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it\n }\n}\n\nfunction jqLiteOff(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');\n\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var handle = expandoStore && expandoStore.handle;\n\n if (!handle) return; //no listeners registered\n\n if (!type) {\n for (type in events) {\n if (type !== '$destroy') {\n element.removeEventListener(type, handle);\n }\n delete events[type];\n }\n } else {\n\n var removeHandler = function(type) {\n var listenerFns = events[type];\n if (isDefined(fn)) {\n arrayRemove(listenerFns || [], fn);\n }\n if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {\n element.removeEventListener(type, handle);\n delete events[type];\n }\n };\n\n forEach(type.split(' '), function(type) {\n removeHandler(type);\n if (MOUSE_EVENT_MAP[type]) {\n removeHandler(MOUSE_EVENT_MAP[type]);\n }\n });\n }\n\n removeIfEmptyData(element);\n}\n\nfunction jqLiteRemoveData(element, name) {\n var expandoId = element.ng339;\n var expandoStore = expandoId && jqCache[expandoId];\n\n if (expandoStore) {\n if (name) {\n delete expandoStore.data[name];\n } else {\n expandoStore.data = {};\n }\n\n removeIfEmptyData(element);\n }\n}\n\n\nfunction jqLiteExpandoStore(element, createIfNecessary) {\n var expandoId = element.ng339,\n expandoStore = expandoId && jqCache[expandoId];\n\n if (createIfNecessary && !expandoStore) {\n element.ng339 = expandoId = jqNextId();\n expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};\n }\n\n return expandoStore;\n}\n\n\nfunction jqLiteData(element, key, value) {\n if (jqLiteAcceptsData(element)) {\n var prop;\n\n var isSimpleSetter = isDefined(value);\n var isSimpleGetter = !isSimpleSetter && key && !isObject(key);\n var massGetter = !key;\n var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);\n var data = expandoStore && expandoStore.data;\n\n if (isSimpleSetter) { // data('key', value)\n data[kebabToCamel(key)] = value;\n } else {\n if (massGetter) { // data()\n return data;\n } else {\n if (isSimpleGetter) { // data('key')\n // don't force creation of expandoStore if it doesn't exist yet\n return data && data[kebabToCamel(key)];\n } else { // mass-setter: data({key1: val1, key2: val2})\n for (prop in key) {\n data[kebabToCamel(prop)] = key[prop];\n }\n }\n }\n }\n }\n}\n\nfunction jqLiteHasClass(element, selector) {\n if (!element.getAttribute) return false;\n return ((' ' + (element.getAttribute('class') || '') + ' ').replace(/[\\n\\t]/g, ' ').\n indexOf(' ' + selector + ' ') > -1);\n}\n\nfunction jqLiteRemoveClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, ' ');\n var newClasses = existingClasses;\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n newClasses = newClasses.replace(' ' + cssClass + ' ', ' ');\n });\n\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\n }\n }\n}\n\nfunction jqLiteAddClass(element, cssClasses) {\n if (cssClasses && element.setAttribute) {\n var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')\n .replace(/[\\n\\t]/g, ' ');\n var newClasses = existingClasses;\n\n forEach(cssClasses.split(' '), function(cssClass) {\n cssClass = trim(cssClass);\n if (newClasses.indexOf(' ' + cssClass + ' ') === -1) {\n newClasses += cssClass + ' ';\n }\n });\n\n if (newClasses !== existingClasses) {\n element.setAttribute('class', trim(newClasses));\n }\n }\n}\n\n\nfunction jqLiteAddNodes(root, elements) {\n // THIS CODE IS VERY HOT. Don't make changes without benchmarking.\n\n if (elements) {\n\n // if a Node (the most common case)\n if (elements.nodeType) {\n root[root.length++] = elements;\n } else {\n var length = elements.length;\n\n // if an Array or NodeList and not a Window\n if (typeof length === 'number' && elements.window !== elements) {\n if (length) {\n for (var i = 0; i < length; i++) {\n root[root.length++] = elements[i];\n }\n }\n } else {\n root[root.length++] = elements;\n }\n }\n }\n}\n\n\nfunction jqLiteController(element, name) {\n return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');\n}\n\nfunction jqLiteInheritedData(element, name, value) {\n // if element is the document object work with the html element instead\n // this makes $(document).scope() possible\n if (element.nodeType === NODE_TYPE_DOCUMENT) {\n element = element.documentElement;\n }\n var names = isArray(name) ? name : [name];\n\n while (element) {\n for (var i = 0, ii = names.length; i < ii; i++) {\n if (isDefined(value = jqLite.data(element, names[i]))) return value;\n }\n\n // If dealing with a document fragment node with a host element, and no parent, use the host\n // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM\n // to lookup parent controllers.\n element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);\n }\n}\n\nfunction jqLiteEmpty(element) {\n jqLiteDealoc(element, true);\n while (element.firstChild) {\n element.removeChild(element.firstChild);\n }\n}\n\nfunction jqLiteRemove(element, keepData) {\n if (!keepData) jqLiteDealoc(element);\n var parent = element.parentNode;\n if (parent) parent.removeChild(element);\n}\n\n\nfunction jqLiteDocumentLoaded(action, win) {\n win = win || window;\n if (win.document.readyState === 'complete') {\n // Force the action to be run async for consistent behavior\n // from the action's point of view\n // i.e. it will definitely not be in a $apply\n win.setTimeout(action);\n } else {\n // No need to unbind this handler as load is only ever called once\n jqLite(win).on('load', action);\n }\n}\n\nfunction jqLiteReady(fn) {\n function trigger() {\n window.document.removeEventListener('DOMContentLoaded', trigger);\n window.removeEventListener('load', trigger);\n fn();\n }\n\n // check if document is already loaded\n if (window.document.readyState === 'complete') {\n window.setTimeout(fn);\n } else {\n // We can not use jqLite since we are not done loading and jQuery could be loaded later.\n\n // Works for modern browsers and IE9\n window.document.addEventListener('DOMContentLoaded', trigger);\n\n // Fallback to window.onload for others\n window.addEventListener('load', trigger);\n }\n}\n\n//////////////////////////////////////////\n// Functions which are declared directly.\n//////////////////////////////////////////\nvar JQLitePrototype = JQLite.prototype = {\n ready: jqLiteReady,\n toString: function() {\n var value = [];\n forEach(this, function(e) { value.push('' + e);});\n return '[' + value.join(', ') + ']';\n },\n\n eq: function(index) {\n return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);\n },\n\n length: 0,\n push: push,\n sort: [].sort,\n splice: [].splice\n};\n\n//////////////////////////////////////////\n// Functions iterating getter/setters.\n// these functions return self on setter and\n// value on get.\n//////////////////////////////////////////\nvar BOOLEAN_ATTR = {};\nforEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {\n BOOLEAN_ATTR[lowercase(value)] = value;\n});\nvar BOOLEAN_ELEMENTS = {};\nforEach('input,select,option,textarea,button,form,details'.split(','), function(value) {\n BOOLEAN_ELEMENTS[value] = true;\n});\nvar ALIASED_ATTR = {\n 'ngMinlength': 'minlength',\n 'ngMaxlength': 'maxlength',\n 'ngMin': 'min',\n 'ngMax': 'max',\n 'ngPattern': 'pattern',\n 'ngStep': 'step'\n};\n\nfunction getBooleanAttrName(element, name) {\n // check dom last since we will most likely fail on name\n var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];\n\n // booleanAttr is here twice to minimize DOM access\n return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;\n}\n\nfunction getAliasedAttrName(name) {\n return ALIASED_ATTR[name];\n}\n\nforEach({\n data: jqLiteData,\n removeData: jqLiteRemoveData,\n hasData: jqLiteHasData,\n cleanData: function jqLiteCleanData(nodes) {\n for (var i = 0, ii = nodes.length; i < ii; i++) {\n jqLiteRemoveData(nodes[i]);\n jqLiteOff(nodes[i]);\n }\n }\n}, function(fn, name) {\n JQLite[name] = fn;\n});\n\nforEach({\n data: jqLiteData,\n inheritedData: jqLiteInheritedData,\n\n scope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);\n },\n\n isolateScope: function(element) {\n // Can't use jqLiteData here directly so we stay compatible with jQuery!\n return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');\n },\n\n controller: jqLiteController,\n\n injector: function(element) {\n return jqLiteInheritedData(element, '$injector');\n },\n\n removeAttr: function(element, name) {\n element.removeAttribute(name);\n },\n\n hasClass: jqLiteHasClass,\n\n css: function(element, name, value) {\n name = cssKebabToCamel(name);\n\n if (isDefined(value)) {\n element.style[name] = value;\n } else {\n return element.style[name];\n }\n },\n\n attr: function(element, name, value) {\n var ret;\n var nodeType = element.nodeType;\n if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT ||\n !element.getAttribute) {\n return;\n }\n\n var lowercasedName = lowercase(name);\n var isBooleanAttr = BOOLEAN_ATTR[lowercasedName];\n\n if (isDefined(value)) {\n // setter\n\n if (value === null || (value === false && isBooleanAttr)) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, isBooleanAttr ? lowercasedName : value);\n }\n } else {\n // getter\n\n ret = element.getAttribute(name);\n\n if (isBooleanAttr && ret !== null) {\n ret = lowercasedName;\n }\n // Normalize non-existing attributes to undefined (as jQuery).\n return ret === null ? undefined : ret;\n }\n },\n\n prop: function(element, name, value) {\n if (isDefined(value)) {\n element[name] = value;\n } else {\n return element[name];\n }\n },\n\n text: (function() {\n getText.$dv = '';\n return getText;\n\n function getText(element, value) {\n if (isUndefined(value)) {\n var nodeType = element.nodeType;\n return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';\n }\n element.textContent = value;\n }\n })(),\n\n val: function(element, value) {\n if (isUndefined(value)) {\n if (element.multiple && nodeName_(element) === 'select') {\n var result = [];\n forEach(element.options, function(option) {\n if (option.selected) {\n result.push(option.value || option.text);\n }\n });\n return result;\n }\n return element.value;\n }\n element.value = value;\n },\n\n html: function(element, value) {\n if (isUndefined(value)) {\n return element.innerHTML;\n }\n jqLiteDealoc(element, true);\n element.innerHTML = value;\n },\n\n empty: jqLiteEmpty\n}, function(fn, name) {\n /**\n * Properties: writes return selection, reads return first value\n */\n JQLite.prototype[name] = function(arg1, arg2) {\n var i, key;\n var nodeCount = this.length;\n\n // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it\n // in a way that survives minification.\n // jqLiteEmpty takes no arguments but is a setter.\n if (fn !== jqLiteEmpty &&\n (isUndefined((fn.length === 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {\n if (isObject(arg1)) {\n\n // we are a write, but the object properties are the key/values\n for (i = 0; i < nodeCount; i++) {\n if (fn === jqLiteData) {\n // data() takes the whole object in jQuery\n fn(this[i], arg1);\n } else {\n for (key in arg1) {\n fn(this[i], key, arg1[key]);\n }\n }\n }\n // return self for chaining\n return this;\n } else {\n // we are a read, so read the first child.\n // TODO: do we still need this?\n var value = fn.$dv;\n // Only if we have $dv do we iterate over all, otherwise it is just the first element.\n var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;\n for (var j = 0; j < jj; j++) {\n var nodeValue = fn(this[j], arg1, arg2);\n value = value ? value + nodeValue : nodeValue;\n }\n return value;\n }\n } else {\n // we are a write, so apply to all children\n for (i = 0; i < nodeCount; i++) {\n fn(this[i], arg1, arg2);\n }\n // return self for chaining\n return this;\n }\n };\n});\n\nfunction createEventHandler(element, events) {\n var eventHandler = function(event, type) {\n // jQuery specific api\n event.isDefaultPrevented = function() {\n return event.defaultPrevented;\n };\n\n var eventFns = events[type || event.type];\n var eventFnsLength = eventFns ? eventFns.length : 0;\n\n if (!eventFnsLength) return;\n\n if (isUndefined(event.immediatePropagationStopped)) {\n var originalStopImmediatePropagation = event.stopImmediatePropagation;\n event.stopImmediatePropagation = function() {\n event.immediatePropagationStopped = true;\n\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n\n if (originalStopImmediatePropagation) {\n originalStopImmediatePropagation.call(event);\n }\n };\n }\n\n event.isImmediatePropagationStopped = function() {\n return event.immediatePropagationStopped === true;\n };\n\n // Some events have special handlers that wrap the real handler\n var handlerWrapper = eventFns.specialHandlerWrapper || defaultHandlerWrapper;\n\n // Copy event handlers in case event handlers array is modified during execution.\n if ((eventFnsLength > 1)) {\n eventFns = shallowCopy(eventFns);\n }\n\n for (var i = 0; i < eventFnsLength; i++) {\n if (!event.isImmediatePropagationStopped()) {\n handlerWrapper(element, event, eventFns[i]);\n }\n }\n };\n\n // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all\n // events on `element`\n eventHandler.elem = element;\n return eventHandler;\n}\n\nfunction defaultHandlerWrapper(element, event, handler) {\n handler.call(element, event);\n}\n\nfunction specialMouseHandlerWrapper(target, event, handler) {\n // Refer to jQuery's implementation of mouseenter & mouseleave\n // Read about mouseenter and mouseleave:\n // http://www.quirksmode.org/js/events_mouse.html#link8\n var related = event.relatedTarget;\n // For mousenter/leave call the handler if related is outside the target.\n // NB: No relatedTarget if the mouse left/entered the browser window\n if (!related || (related !== target && !jqLiteContains.call(target, related))) {\n handler.call(target, event);\n }\n}\n\n//////////////////////////////////////////\n// Functions iterating traversal.\n// These functions chain results into a single\n// selector.\n//////////////////////////////////////////\nforEach({\n removeData: jqLiteRemoveData,\n\n on: function jqLiteOn(element, type, fn, unsupported) {\n if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');\n\n // Do not add event handlers to non-elements because they will not be cleaned up.\n if (!jqLiteAcceptsData(element)) {\n return;\n }\n\n var expandoStore = jqLiteExpandoStore(element, true);\n var events = expandoStore.events;\n var handle = expandoStore.handle;\n\n if (!handle) {\n handle = expandoStore.handle = createEventHandler(element, events);\n }\n\n // http://jsperf.com/string-indexof-vs-split\n var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];\n var i = types.length;\n\n var addHandler = function(type, specialHandlerWrapper, noEventListener) {\n var eventFns = events[type];\n\n if (!eventFns) {\n eventFns = events[type] = [];\n eventFns.specialHandlerWrapper = specialHandlerWrapper;\n if (type !== '$destroy' && !noEventListener) {\n element.addEventListener(type, handle);\n }\n }\n\n eventFns.push(fn);\n };\n\n while (i--) {\n type = types[i];\n if (MOUSE_EVENT_MAP[type]) {\n addHandler(MOUSE_EVENT_MAP[type], specialMouseHandlerWrapper);\n addHandler(type, undefined, true);\n } else {\n addHandler(type);\n }\n }\n },\n\n off: jqLiteOff,\n\n one: function(element, type, fn) {\n element = jqLite(element);\n\n //add the listener twice so that when it is called\n //you can remove the original function and still be\n //able to call element.off(ev, fn) normally\n element.on(type, function onFn() {\n element.off(type, fn);\n element.off(type, onFn);\n });\n element.on(type, fn);\n },\n\n replaceWith: function(element, replaceNode) {\n var index, parent = element.parentNode;\n jqLiteDealoc(element);\n forEach(new JQLite(replaceNode), function(node) {\n if (index) {\n parent.insertBefore(node, index.nextSibling);\n } else {\n parent.replaceChild(node, element);\n }\n index = node;\n });\n },\n\n children: function(element) {\n var children = [];\n forEach(element.childNodes, function(element) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n children.push(element);\n }\n });\n return children;\n },\n\n contents: function(element) {\n return element.contentDocument || element.childNodes || [];\n },\n\n append: function(element, node) {\n var nodeType = element.nodeType;\n if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;\n\n node = new JQLite(node);\n\n for (var i = 0, ii = node.length; i < ii; i++) {\n var child = node[i];\n element.appendChild(child);\n }\n },\n\n prepend: function(element, node) {\n if (element.nodeType === NODE_TYPE_ELEMENT) {\n var index = element.firstChild;\n forEach(new JQLite(node), function(child) {\n element.insertBefore(child, index);\n });\n }\n },\n\n wrap: function(element, wrapNode) {\n jqLiteWrapNode(element, jqLite(wrapNode).eq(0).clone()[0]);\n },\n\n remove: jqLiteRemove,\n\n detach: function(element) {\n jqLiteRemove(element, true);\n },\n\n after: function(element, newElement) {\n var index = element, parent = element.parentNode;\n\n if (parent) {\n newElement = new JQLite(newElement);\n\n for (var i = 0, ii = newElement.length; i < ii; i++) {\n var node = newElement[i];\n parent.insertBefore(node, index.nextSibling);\n index = node;\n }\n }\n },\n\n addClass: jqLiteAddClass,\n removeClass: jqLiteRemoveClass,\n\n toggleClass: function(element, selector, condition) {\n if (selector) {\n forEach(selector.split(' '), function(className) {\n var classCondition = condition;\n if (isUndefined(classCondition)) {\n classCondition = !jqLiteHasClass(element, className);\n }\n (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);\n });\n }\n },\n\n parent: function(element) {\n var parent = element.parentNode;\n return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;\n },\n\n next: function(element) {\n return element.nextElementSibling;\n },\n\n find: function(element, selector) {\n if (element.getElementsByTagName) {\n return element.getElementsByTagName(selector);\n } else {\n return [];\n }\n },\n\n clone: jqLiteClone,\n\n triggerHandler: function(element, event, extraParameters) {\n\n var dummyEvent, eventFnsCopy, handlerArgs;\n var eventName = event.type || event;\n var expandoStore = jqLiteExpandoStore(element);\n var events = expandoStore && expandoStore.events;\n var eventFns = events && events[eventName];\n\n if (eventFns) {\n // Create a dummy event to pass to the handlers\n dummyEvent = {\n preventDefault: function() { this.defaultPrevented = true; },\n isDefaultPrevented: function() { return this.defaultPrevented === true; },\n stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },\n isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },\n stopPropagation: noop,\n type: eventName,\n target: element\n };\n\n // If a custom event was provided then extend our dummy event with it\n if (event.type) {\n dummyEvent = extend(dummyEvent, event);\n }\n\n // Copy event handlers in case event handlers array is modified during execution.\n eventFnsCopy = shallowCopy(eventFns);\n handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];\n\n forEach(eventFnsCopy, function(fn) {\n if (!dummyEvent.isImmediatePropagationStopped()) {\n fn.apply(element, handlerArgs);\n }\n });\n }\n }\n}, function(fn, name) {\n /**\n * chaining functions\n */\n JQLite.prototype[name] = function(arg1, arg2, arg3) {\n var value;\n\n for (var i = 0, ii = this.length; i < ii; i++) {\n if (isUndefined(value)) {\n value = fn(this[i], arg1, arg2, arg3);\n if (isDefined(value)) {\n // any function which returns a value needs to be wrapped\n value = jqLite(value);\n }\n } else {\n jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));\n }\n }\n return isDefined(value) ? value : this;\n };\n});\n\n// bind legacy bind/unbind to on/off\nJQLite.prototype.bind = JQLite.prototype.on;\nJQLite.prototype.unbind = JQLite.prototype.off;\n\n\n// Provider for private $$jqLite service\n/** @this */\nfunction $$jqLiteProvider() {\n this.$get = function $$jqLite() {\n return extend(JQLite, {\n hasClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteHasClass(node, classes);\n },\n addClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteAddClass(node, classes);\n },\n removeClass: function(node, classes) {\n if (node.attr) node = node[0];\n return jqLiteRemoveClass(node, classes);\n }\n });\n };\n}\n\n/**\n * Computes a hash of an 'obj'.\n * Hash of a:\n * string is string\n * number is number as string\n * object is either result of calling $$hashKey function on the object or uniquely generated id,\n * that is also assigned to the $$hashKey property of the object.\n *\n * @param obj\n * @returns {string} hash string such that the same input will have the same hash string.\n * The resulting string key is in 'type:hashKey' format.\n */\nfunction hashKey(obj, nextUidFn) {\n var key = obj && obj.$$hashKey;\n\n if (key) {\n if (typeof key === 'function') {\n key = obj.$$hashKey();\n }\n return key;\n }\n\n var objType = typeof obj;\n if (objType === 'function' || (objType === 'object' && obj !== null)) {\n key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();\n } else {\n key = objType + ':' + obj;\n }\n\n return key;\n}\n\n// A minimal ES2015 Map implementation.\n// Should be bug/feature equivalent to the native implementations of supported browsers\n// (for the features required in Angular).\n// See https://kangax.github.io/compat-table/es6/#test-Map\nvar nanKey = Object.create(null);\nfunction NgMapShim() {\n this._keys = [];\n this._values = [];\n this._lastKey = NaN;\n this._lastIndex = -1;\n}\nNgMapShim.prototype = {\n _idx: function(key) {\n if (key !== this._lastKey) {\n this._lastKey = key;\n this._lastIndex = this._keys.indexOf(key);\n }\n return this._lastIndex;\n },\n _transformKey: function(key) {\n return isNumberNaN(key) ? nanKey : key;\n },\n get: function(key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx !== -1) {\n return this._values[idx];\n }\n },\n has: function(key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n return idx !== -1;\n },\n set: function(key, value) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n idx = this._lastIndex = this._keys.length;\n }\n this._keys[idx] = key;\n this._values[idx] = value;\n\n // Support: IE11\n // Do not `return this` to simulate the partial IE11 implementation\n },\n delete: function(key) {\n key = this._transformKey(key);\n var idx = this._idx(key);\n if (idx === -1) {\n return false;\n }\n this._keys.splice(idx, 1);\n this._values.splice(idx, 1);\n this._lastKey = NaN;\n this._lastIndex = -1;\n return true;\n }\n};\n\n// For now, always use `NgMapShim`, even if `window.Map` is available. Some native implementations\n// are still buggy (often in subtle ways) and can cause hard-to-debug failures. When native `Map`\n// implementations get more stable, we can reconsider switching to `window.Map` (when available).\nvar NgMap = NgMapShim;\n\nvar $$MapProvider = [/** @this */function() {\n this.$get = [function() {\n return NgMap;\n }];\n}];\n\n/**\n * @ngdoc function\n * @module ng\n * @name angular.injector\n * @kind function\n *\n * @description\n * Creates an injector object that can be used for retrieving services as well as for\n * dependency injection (see {@link guide/di dependency injection}).\n *\n * @param {Array.} modules A list of module functions or their aliases. See\n * {@link angular.module}. The `ng` module must be explicitly added.\n * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which\n * disallows argument name annotation inference.\n * @returns {injector} Injector object. See {@link auto.$injector $injector}.\n *\n * @example\n * Typical usage\n * ```js\n * // create an injector\n * var $injector = angular.injector(['ng']);\n *\n * // use the injector to kick off your application\n * // use the type inference to auto inject arguments, or use implicit injection\n * $injector.invoke(function($rootScope, $compile, $document) {\n * $compile($document)($rootScope);\n * $rootScope.$digest();\n * });\n * ```\n *\n * Sometimes you want to get access to the injector of a currently running AngularJS app\n * from outside AngularJS. Perhaps, you want to inject and compile some markup after the\n * application has been bootstrapped. You can do this using the extra `injector()` added\n * to JQuery/jqLite elements. See {@link angular.element}.\n *\n * *This is fairly rare but could be the case if a third party library is injecting the\n * markup.*\n *\n * In the following example a new block of HTML containing a `ng-controller`\n * directive is added to the end of the document body by JQuery. We then compile and link\n * it into the current AngularJS scope.\n *\n * ```js\n * var $div = $('
      {{content.label}}
      ');\n * $(document.body).append($div);\n *\n * angular.element(document).injector().invoke(function($compile) {\n * var scope = angular.element($div).scope();\n * $compile($div)(scope);\n * });\n * ```\n */\n\n\n/**\n * @ngdoc module\n * @name auto\n * @installation\n * @description\n *\n * Implicit module which gets automatically added to each {@link auto.$injector $injector}.\n */\n\nvar ARROW_ARG = /^([^(]+?)=>/;\nvar FN_ARGS = /^[^(]*\\(\\s*([^)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /^\\s*(_?)(\\S+?)\\1\\s*$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\nvar $injectorMinErr = minErr('$injector');\n\nfunction stringifyFn(fn) {\n return Function.prototype.toString.call(fn);\n}\n\nfunction extractArgs(fn) {\n var fnText = stringifyFn(fn).replace(STRIP_COMMENTS, ''),\n args = fnText.match(ARROW_ARG) || fnText.match(FN_ARGS);\n return args;\n}\n\nfunction anonFn(fn) {\n // For anonymous functions, showing at the very least the function signature can help in\n // debugging.\n var args = extractArgs(fn);\n if (args) {\n return 'function(' + (args[1] || '').replace(/[\\s\\r\\n]+/, ' ') + ')';\n }\n return 'fn';\n}\n\nfunction annotate(fn, strictDi, name) {\n var $inject,\n argDecl,\n last;\n\n if (typeof fn === 'function') {\n if (!($inject = fn.$inject)) {\n $inject = [];\n if (fn.length) {\n if (strictDi) {\n if (!isString(name) || !name) {\n name = fn.name || anonFn(fn);\n }\n throw $injectorMinErr('strictdi',\n '{0} is not using explicit annotation and cannot be invoked in strict mode', name);\n }\n argDecl = extractArgs(fn);\n forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {\n arg.replace(FN_ARG, function(all, underscore, name) {\n $inject.push(name);\n });\n });\n }\n fn.$inject = $inject;\n }\n } else if (isArray(fn)) {\n last = fn.length - 1;\n assertArgFn(fn[last], 'fn');\n $inject = fn.slice(0, last);\n } else {\n assertArgFn(fn, 'fn', true);\n }\n return $inject;\n}\n\n///////////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $injector\n *\n * @description\n *\n * `$injector` is used to retrieve object instances as defined by\n * {@link auto.$provide provider}, instantiate types, invoke methods,\n * and load modules.\n *\n * The following always holds true:\n *\n * ```js\n * var $injector = angular.injector();\n * expect($injector.get('$injector')).toBe($injector);\n * expect($injector.invoke(function($injector) {\n * return $injector;\n * })).toBe($injector);\n * ```\n *\n * ## Injection Function Annotation\n *\n * JavaScript does not have annotations, and annotations are needed for dependency injection. The\n * following are all valid ways of annotating function with injection arguments and are equivalent.\n *\n * ```js\n * // inferred (only works if code not minified/obfuscated)\n * $injector.invoke(function(serviceA){});\n *\n * // annotated\n * function explicit(serviceA) {};\n * explicit.$inject = ['serviceA'];\n * $injector.invoke(explicit);\n *\n * // inline\n * $injector.invoke(['serviceA', function(serviceA){}]);\n * ```\n *\n * ### Inference\n *\n * In JavaScript calling `toString()` on a function returns the function definition. The definition\n * can then be parsed and the function arguments can be extracted. This method of discovering\n * annotations is disallowed when the injector is in strict mode.\n * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the\n * argument names.\n *\n * ### `$inject` Annotation\n * By adding an `$inject` property onto a function the injection parameters can be specified.\n *\n * ### Inline\n * As an array of injection names, where the last item in the array is the function to call.\n */\n\n/**\n * @ngdoc property\n * @name $injector#modules\n * @type {Object}\n * @description\n * A hash containing all the modules that have been loaded into the\n * $injector.\n *\n * You can use this property to find out information about a module via the\n * {@link angular.Module#info `myModule.info(...)`} method.\n *\n * For example:\n *\n * ```\n * var info = $injector.modules['ngAnimate'].info();\n * ```\n *\n * **Do not use this property to attempt to modify the modules after the application\n * has been bootstrapped.**\n */\n\n\n/**\n * @ngdoc method\n * @name $injector#get\n *\n * @description\n * Return an instance of the service.\n *\n * @param {string} name The name of the instance to retrieve.\n * @param {string=} caller An optional string to provide the origin of the function call for error messages.\n * @return {*} The instance.\n */\n\n/**\n * @ngdoc method\n * @name $injector#invoke\n *\n * @description\n * Invoke the method and supply the method arguments from the `$injector`.\n *\n * @param {Function|Array.} fn The injectable function to invoke. Function parameters are\n * injected according to the {@link guide/di $inject Annotation} rules.\n * @param {Object=} self The `this` for the invoked method.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {*} the value returned by the invoked `fn` function.\n */\n\n/**\n * @ngdoc method\n * @name $injector#has\n *\n * @description\n * Allows the user to query if the particular service exists.\n *\n * @param {string} name Name of the service to query.\n * @returns {boolean} `true` if injector has given service.\n */\n\n/**\n * @ngdoc method\n * @name $injector#instantiate\n * @description\n * Create a new instance of JS type. The method takes a constructor function, invokes the new\n * operator, and supplies all of the arguments to the constructor function as specified by the\n * constructor annotation.\n *\n * @param {Function} Type Annotated constructor function.\n * @param {Object=} locals Optional object. If preset then any argument names are read from this\n * object first, before the `$injector` is consulted.\n * @returns {Object} new instance of `Type`.\n */\n\n/**\n * @ngdoc method\n * @name $injector#annotate\n *\n * @description\n * Returns an array of service names which the function is requesting for injection. This API is\n * used by the injector to determine which services need to be injected into the function when the\n * function is invoked. There are three ways in which the function can be annotated with the needed\n * dependencies.\n *\n * #### Argument names\n *\n * The simplest form is to extract the dependencies from the arguments of the function. This is done\n * by converting the function into a string using `toString()` method and extracting the argument\n * names.\n * ```js\n * // Given\n * function MyController($scope, $route) {\n * // ...\n * }\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * You can disallow this method by using strict injection mode.\n *\n * This method does not work with code minification / obfuscation. For this reason the following\n * annotation strategies are supported.\n *\n * #### The `$inject` property\n *\n * If a function has an `$inject` property and its value is an array of strings, then the strings\n * represent names of services to be injected into the function.\n * ```js\n * // Given\n * var MyController = function(obfuscatedScope, obfuscatedRoute) {\n * // ...\n * }\n * // Define function dependencies\n * MyController['$inject'] = ['$scope', '$route'];\n *\n * // Then\n * expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);\n * ```\n *\n * #### The array notation\n *\n * It is often desirable to inline Injected functions and that's when setting the `$inject` property\n * is very inconvenient. In these situations using the array notation to specify the dependencies in\n * a way that survives minification is a better choice:\n *\n * ```js\n * // We wish to write this (not minification / obfuscation safe)\n * injector.invoke(function($compile, $rootScope) {\n * // ...\n * });\n *\n * // We are forced to write break inlining\n * var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {\n * // ...\n * };\n * tmpFn.$inject = ['$compile', '$rootScope'];\n * injector.invoke(tmpFn);\n *\n * // To better support inline function the inline annotation is supported\n * injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {\n * // ...\n * }]);\n *\n * // Therefore\n * expect(injector.annotate(\n * ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])\n * ).toEqual(['$compile', '$rootScope']);\n * ```\n *\n * @param {Function|Array.} fn Function for which dependent service names need to\n * be retrieved as described above.\n *\n * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.\n *\n * @returns {Array.} The names of the services which the function requires.\n */\n/**\n * @ngdoc method\n * @name $injector#loadNewModules\n *\n * @description\n *\n * **This is a dangerous API, which you use at your own risk!**\n *\n * Add the specified modules to the current injector.\n *\n * This method will add each of the injectables to the injector and execute all of the config and run\n * blocks for each module passed to the method.\n *\n * If a module has already been loaded into the injector then it will not be loaded again.\n *\n * * The application developer is responsible for loading the code containing the modules; and for\n * ensuring that lazy scripts are not downloaded and executed more often that desired.\n * * Previously compiled HTML will not be affected by newly loaded directives, filters and components.\n * * Modules cannot be unloaded.\n *\n * You can use {@link $injector#modules `$injector.modules`} to check whether a module has been loaded\n * into the injector, which may indicate whether the script has been executed already.\n *\n * @example\n * Here is an example of loading a bundle of modules, with a utility method called `getScript`:\n *\n * ```javascript\n * app.factory('loadModule', function($injector) {\n * return function loadModule(moduleName, bundleUrl) {\n * return getScript(bundleUrl).then(function() { $injector.loadNewModules([moduleName]); });\n * };\n * })\n * ```\n *\n * @param {Array=} mods an array of modules to load into the application.\n * Each item in the array should be the name of a predefined module or a (DI annotated)\n * function that will be invoked by the injector as a `config` block.\n * See: {@link angular.module modules}\n */\n\n\n/**\n * @ngdoc service\n * @name $provide\n *\n * @description\n *\n * The {@link auto.$provide $provide} service has a number of methods for registering components\n * with the {@link auto.$injector $injector}. Many of these functions are also exposed on\n * {@link angular.Module}.\n *\n * An AngularJS **service** is a singleton object created by a **service factory**. These **service\n * factories** are functions which, in turn, are created by a **service provider**.\n * The **service providers** are constructor functions. When instantiated they must contain a\n * property called `$get`, which holds the **service factory** function.\n *\n * When you request a service, the {@link auto.$injector $injector} is responsible for finding the\n * correct **service provider**, instantiating it and then calling its `$get` **service factory**\n * function to get the instance of the **service**.\n *\n * Often services have no configuration options and there is no need to add methods to the service\n * provider. The provider will be no more than a constructor function with a `$get` property. For\n * these cases the {@link auto.$provide $provide} service has additional helper methods to register\n * services without specifying a provider.\n *\n * * {@link auto.$provide#provider provider(name, provider)} - registers a **service provider** with the\n * {@link auto.$injector $injector}\n * * {@link auto.$provide#constant constant(name, obj)} - registers a value/object that can be accessed by\n * providers and services.\n * * {@link auto.$provide#value value(name, obj)} - registers a value/object that can only be accessed by\n * services, not providers.\n * * {@link auto.$provide#factory factory(name, fn)} - registers a service **factory function**\n * that will be wrapped in a **service provider** object, whose `$get` property will contain the\n * given factory function.\n * * {@link auto.$provide#service service(name, Fn)} - registers a **constructor function**\n * that will be wrapped in a **service provider** object, whose `$get` property will instantiate\n * a new object using the given constructor function.\n * * {@link auto.$provide#decorator decorator(name, decorFn)} - registers a **decorator function** that\n * will be able to modify or replace the implementation of another service.\n *\n * See the individual methods for more information and examples.\n */\n\n/**\n * @ngdoc method\n * @name $provide#provider\n * @description\n *\n * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions\n * are constructor functions, whose instances are responsible for \"providing\" a factory for a\n * service.\n *\n * Service provider names start with the name of the service they provide followed by `Provider`.\n * For example, the {@link ng.$log $log} service has a provider called\n * {@link ng.$logProvider $logProvider}.\n *\n * Service provider objects can have additional methods which allow configuration of the provider\n * and its service. Importantly, you can configure what kind of service is created by the `$get`\n * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a\n * method {@link ng.$logProvider#debugEnabled debugEnabled}\n * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the\n * console or not.\n *\n * It is possible to inject other providers into the provider function,\n * but the injected provider must have been defined before the one that requires it.\n *\n * @param {string} name The name of the instance. NOTE: the provider will be available under `name +\n 'Provider'` key.\n * @param {(Object|function())} provider If the provider is:\n *\n * - `Object`: then it should have a `$get` method. The `$get` method will be invoked using\n * {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.\n * - `Constructor`: a new instance of the provider will be created using\n * {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.\n *\n * @returns {Object} registered provider instance\n\n * @example\n *\n * The following example shows how to create a simple event tracking service and register it using\n * {@link auto.$provide#provider $provide.provider()}.\n *\n * ```js\n * // Define the eventTracker provider\n * function EventTrackerProvider() {\n * var trackingUrl = '/track';\n *\n * // A provider method for configuring where the tracked events should been saved\n * this.setTrackingUrl = function(url) {\n * trackingUrl = url;\n * };\n *\n * // The service factory function\n * this.$get = ['$http', function($http) {\n * var trackedEvents = {};\n * return {\n * // Call this to track an event\n * event: function(event) {\n * var count = trackedEvents[event] || 0;\n * count += 1;\n * trackedEvents[event] = count;\n * return count;\n * },\n * // Call this to save the tracked events to the trackingUrl\n * save: function() {\n * $http.post(trackingUrl, trackedEvents);\n * }\n * };\n * }];\n * }\n *\n * describe('eventTracker', function() {\n * var postSpy;\n *\n * beforeEach(module(function($provide) {\n * // Register the eventTracker provider\n * $provide.provider('eventTracker', EventTrackerProvider);\n * }));\n *\n * beforeEach(module(function(eventTrackerProvider) {\n * // Configure eventTracker provider\n * eventTrackerProvider.setTrackingUrl('/custom-track');\n * }));\n *\n * it('tracks events', inject(function(eventTracker) {\n * expect(eventTracker.event('login')).toEqual(1);\n * expect(eventTracker.event('login')).toEqual(2);\n * }));\n *\n * it('saves to the tracking url', inject(function(eventTracker, $http) {\n * postSpy = spyOn($http, 'post');\n * eventTracker.event('login');\n * eventTracker.save();\n * expect(postSpy).toHaveBeenCalled();\n * expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');\n * expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');\n * expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });\n * }));\n * });\n * ```\n */\n\n/**\n * @ngdoc method\n * @name $provide#factory\n * @description\n *\n * Register a **service factory**, which will be called to return the service instance.\n * This is short for registering a service where its provider consists of only a `$get` property,\n * which is the given service factory function.\n * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to\n * configure your service in a provider.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} $getFn The injectable $getFn for the instance creation.\n * Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service\n * ```js\n * $provide.factory('ping', ['$http', function($http) {\n * return function ping() {\n * return $http.send('/ping');\n * };\n * }]);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#service\n * @description\n *\n * Register a **service constructor**, which will be invoked with `new` to create the service\n * instance.\n * This is short for registering a service where its provider's `$get` property is a factory\n * function that returns an instance instantiated by the injector from the service constructor\n * function.\n *\n * Internally it looks a bit like this:\n *\n * ```\n * {\n * $get: function() {\n * return $injector.instantiate(constructor);\n * }\n * }\n * ```\n *\n *\n * You should use {@link auto.$provide#service $provide.service(class)} if you define your service\n * as a type/class.\n *\n * @param {string} name The name of the instance.\n * @param {Function|Array.} constructor An injectable class (constructor function)\n * that will be instantiated.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here is an example of registering a service using\n * {@link auto.$provide#service $provide.service(class)}.\n * ```js\n * var Ping = function($http) {\n * this.$http = $http;\n * };\n *\n * Ping.$inject = ['$http'];\n *\n * Ping.prototype.send = function() {\n * return this.$http.get('/ping');\n * };\n * $provide.service('ping', Ping);\n * ```\n * You would then inject and use this service like this:\n * ```js\n * someModule.controller('Ctrl', ['ping', function(ping) {\n * ping.send();\n * }]);\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#value\n * @description\n *\n * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a\n * number, an array, an object or a function. This is short for registering a service where its\n * provider's `$get` property is a factory function that takes no arguments and returns the **value\n * service**. That also means it is not possible to inject other services into a value service.\n *\n * Value services are similar to constant services, except that they cannot be injected into a\n * module configuration function (see {@link angular.Module#config}) but they can be overridden by\n * an AngularJS {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the instance.\n * @param {*} value The value.\n * @returns {Object} registered provider instance\n *\n * @example\n * Here are some examples of creating value services.\n * ```js\n * $provide.value('ADMIN_USER', 'admin');\n *\n * $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });\n *\n * $provide.value('halfOf', function(value) {\n * return value / 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#constant\n * @description\n *\n * Register a **constant service** with the {@link auto.$injector $injector}, such as a string,\n * a number, an array, an object or a function. Like the {@link auto.$provide#value value}, it is not\n * possible to inject other services into a constant.\n *\n * But unlike {@link auto.$provide#value value}, a constant can be\n * injected into a module configuration function (see {@link angular.Module#config}) and it cannot\n * be overridden by an AngularJS {@link auto.$provide#decorator decorator}.\n *\n * @param {string} name The name of the constant.\n * @param {*} value The constant value.\n * @returns {Object} registered instance\n *\n * @example\n * Here a some examples of creating constants:\n * ```js\n * $provide.constant('SHARD_HEIGHT', 306);\n *\n * $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);\n *\n * $provide.constant('double', function(value) {\n * return value * 2;\n * });\n * ```\n */\n\n\n/**\n * @ngdoc method\n * @name $provide#decorator\n * @description\n *\n * Register a **decorator function** with the {@link auto.$injector $injector}. A decorator function\n * intercepts the creation of a service, allowing it to override or modify the behavior of the\n * service. The return value of the decorator function may be the original service, or a new service\n * that replaces (or wraps and delegates to) the original service.\n *\n * You can find out more about using decorators in the {@link guide/decorators} guide.\n *\n * @param {string} name The name of the service to decorate.\n * @param {Function|Array.} decorator This function will be invoked when the service needs to be\n * provided and should return the decorated service instance. The function is called using\n * the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.\n * Local injection arguments:\n *\n * * `$delegate` - The original service instance, which can be replaced, monkey patched, configured,\n * decorated or delegated to.\n *\n * @example\n * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting\n * calls to {@link ng.$log#error $log.warn()}.\n * ```js\n * $provide.decorator('$log', ['$delegate', function($delegate) {\n * $delegate.warn = $delegate.error;\n * return $delegate;\n * }]);\n * ```\n */\n\n\nfunction createInjector(modulesToLoad, strictDi) {\n strictDi = (strictDi === true);\n var INSTANTIATING = {},\n providerSuffix = 'Provider',\n path = [],\n loadedModules = new NgMap(),\n providerCache = {\n $provide: {\n provider: supportObject(provider),\n factory: supportObject(factory),\n service: supportObject(service),\n value: supportObject(value),\n constant: supportObject(constant),\n decorator: decorator\n }\n },\n providerInjector = (providerCache.$injector =\n createInternalInjector(providerCache, function(serviceName, caller) {\n if (angular.isString(caller)) {\n path.push(caller);\n }\n throw $injectorMinErr('unpr', 'Unknown provider: {0}', path.join(' <- '));\n })),\n instanceCache = {},\n protoInstanceInjector =\n createInternalInjector(instanceCache, function(serviceName, caller) {\n var provider = providerInjector.get(serviceName + providerSuffix, caller);\n return instanceInjector.invoke(\n provider.$get, provider, undefined, serviceName);\n }),\n instanceInjector = protoInstanceInjector;\n\n providerCache['$injector' + providerSuffix] = { $get: valueFn(protoInstanceInjector) };\n instanceInjector.modules = providerInjector.modules = createMap();\n var runBlocks = loadModules(modulesToLoad);\n instanceInjector = protoInstanceInjector.get('$injector');\n instanceInjector.strictDi = strictDi;\n forEach(runBlocks, function(fn) { if (fn) instanceInjector.invoke(fn); });\n\n instanceInjector.loadNewModules = function(mods) {\n forEach(loadModules(mods), function(fn) { if (fn) instanceInjector.invoke(fn); });\n };\n\n\n return instanceInjector;\n\n ////////////////////////////////////\n // $provider\n ////////////////////////////////////\n\n function supportObject(delegate) {\n return function(key, value) {\n if (isObject(key)) {\n forEach(key, reverseParams(delegate));\n } else {\n return delegate(key, value);\n }\n };\n }\n\n function provider(name, provider_) {\n assertNotHasOwnProperty(name, 'service');\n if (isFunction(provider_) || isArray(provider_)) {\n provider_ = providerInjector.instantiate(provider_);\n }\n if (!provider_.$get) {\n throw $injectorMinErr('pget', 'Provider \\'{0}\\' must define $get factory method.', name);\n }\n return (providerCache[name + providerSuffix] = provider_);\n }\n\n function enforceReturnValue(name, factory) {\n return /** @this */ function enforcedReturnValue() {\n var result = instanceInjector.invoke(factory, this);\n if (isUndefined(result)) {\n throw $injectorMinErr('undef', 'Provider \\'{0}\\' must return a value from $get factory method.', name);\n }\n return result;\n };\n }\n\n function factory(name, factoryFn, enforce) {\n return provider(name, {\n $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn\n });\n }\n\n function service(name, constructor) {\n return factory(name, ['$injector', function($injector) {\n return $injector.instantiate(constructor);\n }]);\n }\n\n function value(name, val) { return factory(name, valueFn(val), false); }\n\n function constant(name, value) {\n assertNotHasOwnProperty(name, 'constant');\n providerCache[name] = value;\n instanceCache[name] = value;\n }\n\n function decorator(serviceName, decorFn) {\n var origProvider = providerInjector.get(serviceName + providerSuffix),\n orig$get = origProvider.$get;\n\n origProvider.$get = function() {\n var origInstance = instanceInjector.invoke(orig$get, origProvider);\n return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});\n };\n }\n\n ////////////////////////////////////\n // Module Loading\n ////////////////////////////////////\n function loadModules(modulesToLoad) {\n assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');\n var runBlocks = [], moduleFn;\n forEach(modulesToLoad, function(module) {\n if (loadedModules.get(module)) return;\n loadedModules.set(module, true);\n\n function runInvokeQueue(queue) {\n var i, ii;\n for (i = 0, ii = queue.length; i < ii; i++) {\n var invokeArgs = queue[i],\n provider = providerInjector.get(invokeArgs[0]);\n\n provider[invokeArgs[1]].apply(provider, invokeArgs[2]);\n }\n }\n\n try {\n if (isString(module)) {\n moduleFn = angularModule(module);\n instanceInjector.modules[module] = moduleFn;\n runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);\n runInvokeQueue(moduleFn._invokeQueue);\n runInvokeQueue(moduleFn._configBlocks);\n } else if (isFunction(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else if (isArray(module)) {\n runBlocks.push(providerInjector.invoke(module));\n } else {\n assertArgFn(module, 'module');\n }\n } catch (e) {\n if (isArray(module)) {\n module = module[module.length - 1];\n }\n if (e.message && e.stack && e.stack.indexOf(e.message) === -1) {\n // Safari & FF's stack traces don't contain error.message content\n // unlike those of Chrome and IE\n // So if stack doesn't contain message, we create a new string that contains both.\n // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.\n // eslint-disable-next-line no-ex-assign\n e = e.message + '\\n' + e.stack;\n }\n throw $injectorMinErr('modulerr', 'Failed to instantiate module {0} due to:\\n{1}',\n module, e.stack || e.message || e);\n }\n });\n return runBlocks;\n }\n\n ////////////////////////////////////\n // internal Injector\n ////////////////////////////////////\n\n function createInternalInjector(cache, factory) {\n\n function getService(serviceName, caller) {\n if (cache.hasOwnProperty(serviceName)) {\n if (cache[serviceName] === INSTANTIATING) {\n throw $injectorMinErr('cdep', 'Circular dependency found: {0}',\n serviceName + ' <- ' + path.join(' <- '));\n }\n return cache[serviceName];\n } else {\n try {\n path.unshift(serviceName);\n cache[serviceName] = INSTANTIATING;\n cache[serviceName] = factory(serviceName, caller);\n return cache[serviceName];\n } catch (err) {\n if (cache[serviceName] === INSTANTIATING) {\n delete cache[serviceName];\n }\n throw err;\n } finally {\n path.shift();\n }\n }\n }\n\n\n function injectionArgs(fn, locals, serviceName) {\n var args = [],\n $inject = createInjector.$$annotate(fn, strictDi, serviceName);\n\n for (var i = 0, length = $inject.length; i < length; i++) {\n var key = $inject[i];\n if (typeof key !== 'string') {\n throw $injectorMinErr('itkn',\n 'Incorrect injection token! Expected service name as string, got {0}', key);\n }\n args.push(locals && locals.hasOwnProperty(key) ? locals[key] :\n getService(key, serviceName));\n }\n return args;\n }\n\n function isClass(func) {\n // Support: IE 9-11 only\n // IE 9-11 do not support classes and IE9 leaks with the code below.\n if (msie || typeof func !== 'function') {\n return false;\n }\n var result = func.$$ngIsClass;\n if (!isBoolean(result)) {\n result = func.$$ngIsClass = /^class\\b/.test(stringifyFn(func));\n }\n return result;\n }\n\n function invoke(fn, self, locals, serviceName) {\n if (typeof locals === 'string') {\n serviceName = locals;\n locals = null;\n }\n\n var args = injectionArgs(fn, locals, serviceName);\n if (isArray(fn)) {\n fn = fn[fn.length - 1];\n }\n\n if (!isClass(fn)) {\n // http://jsperf.com/angularjs-invoke-apply-vs-switch\n // #5388\n return fn.apply(self, args);\n } else {\n args.unshift(null);\n return new (Function.prototype.bind.apply(fn, args))();\n }\n }\n\n\n function instantiate(Type, locals, serviceName) {\n // Check if Type is annotated and use just the given function at n-1 as parameter\n // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);\n var ctor = (isArray(Type) ? Type[Type.length - 1] : Type);\n var args = injectionArgs(Type, locals, serviceName);\n // Empty object at position 0 is ignored for invocation with `new`, but required.\n args.unshift(null);\n return new (Function.prototype.bind.apply(ctor, args))();\n }\n\n\n return {\n invoke: invoke,\n instantiate: instantiate,\n get: getService,\n annotate: createInjector.$$annotate,\n has: function(name) {\n return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);\n }\n };\n }\n}\n\ncreateInjector.$$annotate = annotate;\n\n/**\n * @ngdoc provider\n * @name $anchorScrollProvider\n * @this\n *\n * @description\n * Use `$anchorScrollProvider` to disable automatic scrolling whenever\n * {@link ng.$location#hash $location.hash()} changes.\n */\nfunction $AnchorScrollProvider() {\n\n var autoScrollingEnabled = true;\n\n /**\n * @ngdoc method\n * @name $anchorScrollProvider#disableAutoScrolling\n *\n * @description\n * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to\n * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.
      \n * Use this method to disable automatic scrolling.\n *\n * If automatic scrolling is disabled, one must explicitly call\n * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the\n * current hash.\n */\n this.disableAutoScrolling = function() {\n autoScrollingEnabled = false;\n };\n\n /**\n * @ngdoc service\n * @name $anchorScroll\n * @kind function\n * @requires $window\n * @requires $location\n * @requires $rootScope\n *\n * @description\n * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the\n * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified\n * in the\n * [HTML5 spec](http://www.w3.org/html/wg/drafts/html/master/browsers.html#an-indicated-part-of-the-document).\n *\n * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to\n * match any anchor whenever it changes. This can be disabled by calling\n * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.\n *\n * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a\n * vertical scroll-offset (either fixed or dynamic).\n *\n * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of\n * {@link ng.$location#hash $location.hash()} will be used.\n *\n * @property {(number|function|jqLite)} yOffset\n * If set, specifies a vertical scroll-offset. This is often useful when there are fixed\n * positioned elements at the top of the page, such as navbars, headers etc.\n *\n * `yOffset` can be specified in various ways:\n * - **number**: A fixed number of pixels to be used as offset.

      \n * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return\n * a number representing the offset (in pixels).

      \n * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from\n * the top of the page to the element's bottom will be used as offset.
      \n * **Note**: The element will be taken into account only as long as its `position` is set to\n * `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust\n * their height and/or positioning according to the viewport's size.\n *\n *
      \n *
      \n * In order for `yOffset` to work properly, scrolling should take place on the document's root and\n * not some child element.\n *
      \n *\n * @example\n \n \n
      \n Go to bottom\n You're at the bottom!\n
      \n
      \n \n angular.module('anchorScrollExample', [])\n .controller('ScrollController', ['$scope', '$location', '$anchorScroll',\n function($scope, $location, $anchorScroll) {\n $scope.gotoBottom = function() {\n // set the location.hash to the id of\n // the element you wish to scroll to.\n $location.hash('bottom');\n\n // call $anchorScroll()\n $anchorScroll();\n };\n }]);\n \n \n #scrollArea {\n height: 280px;\n overflow: auto;\n }\n\n #bottom {\n display: block;\n margin-top: 2000px;\n }\n \n
      \n *\n *
      \n * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).\n * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.\n *\n * @example\n \n \n \n
      \n Anchor {{x}} of 5\n
      \n
      \n \n angular.module('anchorScrollOffsetExample', [])\n .run(['$anchorScroll', function($anchorScroll) {\n $anchorScroll.yOffset = 50; // always scroll by 50 extra pixels\n }])\n .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',\n function($anchorScroll, $location, $scope) {\n $scope.gotoAnchor = function(x) {\n var newHash = 'anchor' + x;\n if ($location.hash() !== newHash) {\n // set the $location.hash to `newHash` and\n // $anchorScroll will automatically scroll to it\n $location.hash('anchor' + x);\n } else {\n // call $anchorScroll() explicitly,\n // since $location.hash hasn't changed\n $anchorScroll();\n }\n };\n }\n ]);\n \n \n body {\n padding-top: 50px;\n }\n\n .anchor {\n border: 2px dashed DarkOrchid;\n padding: 10px 10px 200px 10px;\n }\n\n .fixed-header {\n background-color: rgba(0, 0, 0, 0.2);\n height: 50px;\n position: fixed;\n top: 0; left: 0; right: 0;\n }\n\n .fixed-header > a {\n display: inline-block;\n margin: 5px 15px;\n }\n \n
      \n */\n this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {\n var document = $window.document;\n\n // Helper function to get first anchor from a NodeList\n // (using `Array#some()` instead of `angular#forEach()` since it's more performant\n // and working in all supported browsers.)\n function getFirstAnchor(list) {\n var result = null;\n Array.prototype.some.call(list, function(element) {\n if (nodeName_(element) === 'a') {\n result = element;\n return true;\n }\n });\n return result;\n }\n\n function getYOffset() {\n\n var offset = scroll.yOffset;\n\n if (isFunction(offset)) {\n offset = offset();\n } else if (isElement(offset)) {\n var elem = offset[0];\n var style = $window.getComputedStyle(elem);\n if (style.position !== 'fixed') {\n offset = 0;\n } else {\n offset = elem.getBoundingClientRect().bottom;\n }\n } else if (!isNumber(offset)) {\n offset = 0;\n }\n\n return offset;\n }\n\n function scrollTo(elem) {\n if (elem) {\n elem.scrollIntoView();\n\n var offset = getYOffset();\n\n if (offset) {\n // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.\n // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the\n // top of the viewport.\n //\n // IF the number of pixels from the top of `elem` to the end of the page's content is less\n // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some\n // way down the page.\n //\n // This is often the case for elements near the bottom of the page.\n //\n // In such cases we do not need to scroll the whole `offset` up, just the difference between\n // the top of the element and the offset, which is enough to align the top of `elem` at the\n // desired position.\n var elemTop = elem.getBoundingClientRect().top;\n $window.scrollBy(0, elemTop - offset);\n }\n } else {\n $window.scrollTo(0, 0);\n }\n }\n\n function scroll(hash) {\n // Allow numeric hashes\n hash = isString(hash) ? hash : isNumber(hash) ? hash.toString() : $location.hash();\n var elm;\n\n // empty hash, scroll to the top of the page\n if (!hash) scrollTo(null);\n\n // element with given id\n else if ((elm = document.getElementById(hash))) scrollTo(elm);\n\n // first anchor with given name :-D\n else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);\n\n // no element and hash === 'top', scroll to the top of the page\n else if (hash === 'top') scrollTo(null);\n }\n\n // does not scroll when user clicks on anchor link that is currently on\n // (no url change, no $location.hash() change), browser native does scroll\n if (autoScrollingEnabled) {\n $rootScope.$watch(function autoScrollWatch() {return $location.hash();},\n function autoScrollWatchAction(newVal, oldVal) {\n // skip the initial scroll if $location.hash is empty\n if (newVal === oldVal && newVal === '') return;\n\n jqLiteDocumentLoaded(function() {\n $rootScope.$evalAsync(scroll);\n });\n });\n }\n\n return scroll;\n }];\n}\n\nvar $animateMinErr = minErr('$animate');\nvar ELEMENT_NODE = 1;\nvar NG_ANIMATE_CLASSNAME = 'ng-animate';\n\nfunction mergeClasses(a,b) {\n if (!a && !b) return '';\n if (!a) return b;\n if (!b) return a;\n if (isArray(a)) a = a.join(' ');\n if (isArray(b)) b = b.join(' ');\n return a + ' ' + b;\n}\n\nfunction extractElementNode(element) {\n for (var i = 0; i < element.length; i++) {\n var elm = element[i];\n if (elm.nodeType === ELEMENT_NODE) {\n return elm;\n }\n }\n}\n\nfunction splitClasses(classes) {\n if (isString(classes)) {\n classes = classes.split(' ');\n }\n\n // Use createMap() to prevent class assumptions involving property names in\n // Object.prototype\n var obj = createMap();\n forEach(classes, function(klass) {\n // sometimes the split leaves empty string values\n // incase extra spaces were applied to the options\n if (klass.length) {\n obj[klass] = true;\n }\n });\n return obj;\n}\n\n// if any other type of options value besides an Object value is\n// passed into the $animate.method() animation then this helper code\n// will be run which will ignore it. While this patch is not the\n// greatest solution to this, a lot of existing plugins depend on\n// $animate to either call the callback (< 1.2) or return a promise\n// that can be changed. This helper function ensures that the options\n// are wiped clean incase a callback function is provided.\nfunction prepareAnimateOptions(options) {\n return isObject(options)\n ? options\n : {};\n}\n\nvar $$CoreAnimateJsProvider = /** @this */ function() {\n this.$get = noop;\n};\n\n// this is prefixed with Core since it conflicts with\n// the animateQueueProvider defined in ngAnimate/animateQueue.js\nvar $$CoreAnimateQueueProvider = /** @this */ function() {\n var postDigestQueue = new NgMap();\n var postDigestElements = [];\n\n this.$get = ['$$AnimateRunner', '$rootScope',\n function($$AnimateRunner, $rootScope) {\n return {\n enabled: noop,\n on: noop,\n off: noop,\n pin: noop,\n\n push: function(element, event, options, domOperation) {\n if (domOperation) {\n domOperation();\n }\n\n options = options || {};\n if (options.from) {\n element.css(options.from);\n }\n if (options.to) {\n element.css(options.to);\n }\n\n if (options.addClass || options.removeClass) {\n addRemoveClassesPostDigest(element, options.addClass, options.removeClass);\n }\n\n var runner = new $$AnimateRunner();\n\n // since there are no animations to run the runner needs to be\n // notified that the animation call is complete.\n runner.complete();\n return runner;\n }\n };\n\n\n function updateData(data, classes, value) {\n var changed = false;\n if (classes) {\n classes = isString(classes) ? classes.split(' ') :\n isArray(classes) ? classes : [];\n forEach(classes, function(className) {\n if (className) {\n changed = true;\n data[className] = value;\n }\n });\n }\n return changed;\n }\n\n function handleCSSClassChanges() {\n forEach(postDigestElements, function(element) {\n var data = postDigestQueue.get(element);\n if (data) {\n var existing = splitClasses(element.attr('class'));\n var toAdd = '';\n var toRemove = '';\n forEach(data, function(status, className) {\n var hasClass = !!existing[className];\n if (status !== hasClass) {\n if (status) {\n toAdd += (toAdd.length ? ' ' : '') + className;\n } else {\n toRemove += (toRemove.length ? ' ' : '') + className;\n }\n }\n });\n\n forEach(element, function(elm) {\n if (toAdd) {\n jqLiteAddClass(elm, toAdd);\n }\n if (toRemove) {\n jqLiteRemoveClass(elm, toRemove);\n }\n });\n postDigestQueue.delete(element);\n }\n });\n postDigestElements.length = 0;\n }\n\n\n function addRemoveClassesPostDigest(element, add, remove) {\n var data = postDigestQueue.get(element) || {};\n\n var classesAdded = updateData(data, add, true);\n var classesRemoved = updateData(data, remove, false);\n\n if (classesAdded || classesRemoved) {\n\n postDigestQueue.set(element, data);\n postDigestElements.push(element);\n\n if (postDigestElements.length === 1) {\n $rootScope.$$postDigest(handleCSSClassChanges);\n }\n }\n }\n }];\n};\n\n/**\n * @ngdoc provider\n * @name $animateProvider\n *\n * @description\n * Default implementation of $animate that doesn't perform any animations, instead just\n * synchronously performs DOM updates and resolves the returned runner promise.\n *\n * In order to enable animations the `ngAnimate` module has to be loaded.\n *\n * To see the functional implementation check out `src/ngAnimate/animate.js`.\n */\nvar $AnimateProvider = ['$provide', /** @this */ function($provide) {\n var provider = this;\n var classNameFilter = null;\n var customFilter = null;\n\n this.$$registeredAnimations = Object.create(null);\n\n /**\n * @ngdoc method\n * @name $animateProvider#register\n *\n * @description\n * Registers a new injectable animation factory function. The factory function produces the\n * animation object which contains callback functions for each event that is expected to be\n * animated.\n *\n * * `eventFn`: `function(element, ... , doneFunction, options)`\n * The element to animate, the `doneFunction` and the options fed into the animation. Depending\n * on the type of animation additional arguments will be injected into the animation function. The\n * list below explains the function signatures for the different animation methods:\n *\n * - setClass: function(element, addedClasses, removedClasses, doneFunction, options)\n * - addClass: function(element, addedClasses, doneFunction, options)\n * - removeClass: function(element, removedClasses, doneFunction, options)\n * - enter, leave, move: function(element, doneFunction, options)\n * - animate: function(element, fromStyles, toStyles, doneFunction, options)\n *\n * Make sure to trigger the `doneFunction` once the animation is fully complete.\n *\n * ```js\n * return {\n * //enter, leave, move signature\n * eventFn : function(element, done, options) {\n * //code to run the animation\n * //once complete, then run done()\n * return function endFunction(wasCancelled) {\n * //code to cancel the animation\n * }\n * }\n * }\n * ```\n *\n * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).\n * @param {Function} factory The factory function that will be executed to return the animation\n * object.\n */\n this.register = function(name, factory) {\n if (name && name.charAt(0) !== '.') {\n throw $animateMinErr('notcsel', 'Expecting class selector starting with \\'.\\' got \\'{0}\\'.', name);\n }\n\n var key = name + '-animation';\n provider.$$registeredAnimations[name.substr(1)] = key;\n $provide.factory(key, factory);\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#customFilter\n *\n * @description\n * Sets and/or returns the custom filter function that is used to \"filter\" animations, i.e.\n * determine if an animation is allowed or not. When no filter is specified (the default), no\n * animation will be blocked. Setting the `customFilter` value will only allow animations for\n * which the filter function's return value is truthy.\n *\n * This allows to easily create arbitrarily complex rules for filtering animations, such as\n * allowing specific events only, or enabling animations on specific subtrees of the DOM, etc.\n * Filtering animations can also boost performance for low-powered devices, as well as\n * applications containing a lot of structural operations.\n *\n *
      \n * **Best Practice:**\n * Keep the filtering function as lean as possible, because it will be called for each DOM\n * action (e.g. insertion, removal, class change) performed by \"animation-aware\" directives.\n * See {@link guide/animations#which-directives-support-animations- here} for a list of built-in\n * directives that support animations.\n * Performing computationally expensive or time-consuming operations on each call of the\n * filtering function can make your animations sluggish.\n *
      \n *\n * **Note:** If present, `customFilter` will be checked before\n * {@link $animateProvider#classNameFilter classNameFilter}.\n *\n * @param {Function=} filterFn - The filter function which will be used to filter all animations.\n * If a falsy value is returned, no animation will be performed. The function will be called\n * with the following arguments:\n * - **node** `{DOMElement}` - The DOM element to be animated.\n * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`\n * etc).\n * - **options** `{Object}` - A collection of options/styles used for the animation.\n * @return {Function} The current filter function or `null` if there is none set.\n */\n this.customFilter = function(filterFn) {\n if (arguments.length === 1) {\n customFilter = isFunction(filterFn) ? filterFn : null;\n }\n\n return customFilter;\n };\n\n /**\n * @ngdoc method\n * @name $animateProvider#classNameFilter\n *\n * @description\n * Sets and/or returns the CSS class regular expression that is checked when performing\n * an animation. Upon bootstrap the classNameFilter value is not set at all and will\n * therefore enable $animate to attempt to perform an animation on any element that is triggered.\n * When setting the `classNameFilter` value, animations will only be performed on elements\n * that successfully match the filter expression. This in turn can boost performance\n * for low-powered devices as well as applications containing a lot of structural operations.\n *\n * **Note:** If present, `classNameFilter` will be checked after\n * {@link $animateProvider#customFilter customFilter}. If `customFilter` is present and returns\n * false, `classNameFilter` will not be checked.\n *\n * @param {RegExp=} expression The className expression which will be checked against all animations\n * @return {RegExp} The current CSS className expression value. If null then there is no expression value\n */\n this.classNameFilter = function(expression) {\n if (arguments.length === 1) {\n classNameFilter = (expression instanceof RegExp) ? expression : null;\n if (classNameFilter) {\n var reservedRegex = new RegExp('[(\\\\s|\\\\/)]' + NG_ANIMATE_CLASSNAME + '[(\\\\s|\\\\/)]');\n if (reservedRegex.test(classNameFilter.toString())) {\n classNameFilter = null;\n throw $animateMinErr('nongcls', '$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the \"{0}\" CSS class.', NG_ANIMATE_CLASSNAME);\n }\n }\n }\n return classNameFilter;\n };\n\n this.$get = ['$$animateQueue', function($$animateQueue) {\n function domInsert(element, parentElement, afterElement) {\n // if for some reason the previous element was removed\n // from the dom sometime before this code runs then let's\n // just stick to using the parent element as the anchor\n if (afterElement) {\n var afterNode = extractElementNode(afterElement);\n if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {\n afterElement = null;\n }\n }\n if (afterElement) {\n afterElement.after(element);\n } else {\n parentElement.prepend(element);\n }\n }\n\n /**\n * @ngdoc service\n * @name $animate\n * @description The $animate service exposes a series of DOM utility methods that provide support\n * for animation hooks. The default behavior is the application of DOM operations, however,\n * when an animation is detected (and animations are enabled), $animate will do the heavy lifting\n * to ensure that animation runs with the triggered DOM operation.\n *\n * By default $animate doesn't trigger any animations. This is because the `ngAnimate` module isn't\n * included and only when it is active then the animation hooks that `$animate` triggers will be\n * functional. Once active then all structural `ng-` directives will trigger animations as they perform\n * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,\n * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.\n *\n * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.\n *\n * To learn more about enabling animation support, click here to visit the\n * {@link ngAnimate ngAnimate module page}.\n */\n return {\n // we don't call it directly since non-existant arguments may\n // be interpreted as null within the sub enabled function\n\n /**\n *\n * @ngdoc method\n * @name $animate#on\n * @kind function\n * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)\n * has fired on the given element or among any of its children. Once the listener is fired, the provided callback\n * is fired with the following params:\n *\n * ```js\n * $animate.on('enter', container,\n * function callback(element, phase) {\n * // cool we detected an enter animation within the container\n * }\n * );\n * ```\n *\n *
      \n * **Note**: Generally, the events that are fired correspond 1:1 to `$animate` method names,\n * e.g. {@link ng.$animate#addClass addClass()} will fire `addClass`, and {@link ng.ngClass}\n * will fire `addClass` if classes are added, and `removeClass` if classes are removed.\n * However, there are two exceptions:\n *\n *
        \n *
      • if both an {@link ng.$animate#addClass addClass()} and a\n * {@link ng.$animate#removeClass removeClass()} action are performed during the same\n * animation, the event fired will be `setClass`. This is true even for `ngClass`.
      • \n *
      • an {@link ng.$animate#animate animate()} call that adds and removes classes will fire\n * the `setClass` event, but if it either removes or adds classes,\n * it will fire `animate` instead.
      • \n *
      \n *\n *
      \n *\n * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)\n * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself\n * as well as among its children\n * @param {Function} callback the callback function that will be fired when the listener is triggered.\n *\n * The arguments present in the callback function are:\n * * `element` - The captured DOM element that the animation was fired on.\n * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).\n * * `data` - an object with these properties:\n * * addClass - `{string|null}` - space-separated CSS classes to add to the element\n * * removeClass - `{string|null}` - space-separated CSS classes to remove from the element\n * * from - `{Object|null}` - CSS properties & values at the beginning of the animation\n * * to - `{Object|null}` - CSS properties & values at the end of the animation\n *\n * Note that the callback does not trigger a scope digest. Wrap your call into a\n * {@link $rootScope.Scope#$apply scope.$apply} to propagate changes to the scope.\n */\n on: $$animateQueue.on,\n\n /**\n *\n * @ngdoc method\n * @name $animate#off\n * @kind function\n * @description Deregisters an event listener based on the event which has been associated with the provided element. This method\n * can be used in three different ways depending on the arguments:\n *\n * ```js\n * // remove all the animation event listeners listening for `enter`\n * $animate.off('enter');\n *\n * // remove listeners for all animation events from the container element\n * $animate.off(container);\n *\n * // remove all the animation event listeners listening for `enter` on the given element and its children\n * $animate.off('enter', container);\n *\n * // remove the event listener function provided by `callback` that is set\n * // to listen for `enter` on the given `container` as well as its children\n * $animate.off('enter', container, callback);\n * ```\n *\n * @param {string|DOMElement} event|container the animation event (e.g. enter, leave, move,\n * addClass, removeClass, etc...), or the container element. If it is the element, all other\n * arguments are ignored.\n * @param {DOMElement=} container the container element the event listener was placed on\n * @param {Function=} callback the callback function that was registered as the listener\n */\n off: $$animateQueue.off,\n\n /**\n * @ngdoc method\n * @name $animate#pin\n * @kind function\n * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists\n * outside of the DOM structure of the AngularJS application. By doing so, any animation triggered via `$animate` can be issued on the\n * element despite being outside the realm of the application or within another application. Say for example if the application\n * was bootstrapped on an element that is somewhere inside of the `` tag, but we wanted to allow for an element to be situated\n * as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind\n * that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.\n *\n * Note that this feature is only active when the `ngAnimate` module is used.\n *\n * @param {DOMElement} element the external element that will be pinned\n * @param {DOMElement} parentElement the host parent element that will be associated with the external element\n */\n pin: $$animateQueue.pin,\n\n /**\n *\n * @ngdoc method\n * @name $animate#enabled\n * @kind function\n * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This\n * function can be called in four ways:\n *\n * ```js\n * // returns true or false\n * $animate.enabled();\n *\n * // changes the enabled state for all animations\n * $animate.enabled(false);\n * $animate.enabled(true);\n *\n * // returns true or false if animations are enabled for an element\n * $animate.enabled(element);\n *\n * // changes the enabled state for an element and its children\n * $animate.enabled(element, true);\n * $animate.enabled(element, false);\n * ```\n *\n * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state\n * @param {boolean=} enabled whether or not the animations will be enabled for the element\n *\n * @return {boolean} whether or not animations are enabled\n */\n enabled: $$animateQueue.enabled,\n\n /**\n * @ngdoc method\n * @name $animate#cancel\n * @kind function\n * @description Cancels the provided animation and applies the end state of the animation.\n * Note that this does not cancel the underlying operation, e.g. the setting of classes or\n * adding the element to the DOM.\n *\n * @param {animationRunner} animationRunner An animation runner returned by an $animate function.\n *\n * @example\n \n \n angular.module('animationExample', ['ngAnimate']).component('cancelExample', {\n templateUrl: 'template.html',\n controller: function($element, $animate) {\n this.runner = null;\n\n this.addClass = function() {\n this.runner = $animate.addClass($element.find('div'), 'red');\n var ctrl = this;\n this.runner.finally(function() {\n ctrl.runner = null;\n });\n };\n\n this.removeClass = function() {\n this.runner = $animate.removeClass($element.find('div'), 'red');\n var ctrl = this;\n this.runner.finally(function() {\n ctrl.runner = null;\n });\n };\n\n this.cancel = function() {\n $animate.cancel(this.runner);\n };\n }\n });\n \n \n

      \n \n \n
      \n \n
      \n

      CSS-Animated Text
      \n

      \n
      \n \n \n \n \n .red-add, .red-remove {\n transition: all 4s cubic-bezier(0.250, 0.460, 0.450, 0.940);\n }\n\n .red,\n .red-add.red-add-active {\n color: #FF0000;\n font-size: 40px;\n }\n\n .red-remove.red-remove-active {\n font-size: 10px;\n color: black;\n }\n\n \n
      \n */\n cancel: function(runner) {\n if (runner.cancel) {\n runner.cancel();\n }\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#enter\n * @kind function\n * @description Inserts the element into the DOM either after the `after` element (if provided) or\n * as the first child within the `parent` element and then triggers an animation.\n * A promise is returned that will be resolved during the next digest once the animation\n * has completed.\n *\n * @param {DOMElement} element the element which will be inserted into the DOM\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n enter: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));\n },\n\n /**\n *\n * @ngdoc method\n * @name $animate#move\n * @kind function\n * @description Inserts (moves) the element into its new position in the DOM either after\n * the `after` element (if provided) or as the first child within the `parent` element\n * and then triggers an animation. A promise is returned that will be resolved\n * during the next digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be moved into the new DOM position\n * @param {DOMElement} parent the parent element which will append the element as\n * a child (so long as the after element is not present)\n * @param {DOMElement=} after the sibling element after which the element will be appended\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n move: function(element, parent, after, options) {\n parent = parent && jqLite(parent);\n after = after && jqLite(after);\n parent = parent || after.parent();\n domInsert(element, parent, after);\n return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));\n },\n\n /**\n * @ngdoc method\n * @name $animate#leave\n * @kind function\n * @description Triggers an animation and then removes the element from the DOM.\n * When the function is called a promise is returned that will be resolved during the next\n * digest once the animation has completed.\n *\n * @param {DOMElement} element the element which will be removed from the DOM\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n leave: function(element, options) {\n return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {\n element.remove();\n });\n },\n\n /**\n * @ngdoc method\n * @name $animate#addClass\n * @kind function\n *\n * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon\n * execution, the addClass operation will only be handled after the next digest and it will not trigger an\n * animation if element already contains the CSS class or if the class is removed at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} animationRunner the animation runner\n */\n addClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addclass, className);\n return $$animateQueue.push(element, 'addClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#removeClass\n * @kind function\n *\n * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon\n * execution, the removeClass operation will only be handled after the next digest and it will not trigger an\n * animation if element does not contain the CSS class or if the class is added at a later step.\n * Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n removeClass: function(element, className, options) {\n options = prepareAnimateOptions(options);\n options.removeClass = mergeClasses(options.removeClass, className);\n return $$animateQueue.push(element, 'removeClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#setClass\n * @kind function\n *\n * @description Performs both the addition and removal of a CSS classes on an element and (during the process)\n * triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and\n * `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has\n * passed. Note that class-based animations are treated differently compared to structural animations\n * (like enter, move and leave) since the CSS classes may be added/removed at different points\n * depending if CSS or JavaScript animations are used.\n *\n * @param {DOMElement} element the element which the CSS classes will be applied to\n * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)\n * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n setClass: function(element, add, remove, options) {\n options = prepareAnimateOptions(options);\n options.addClass = mergeClasses(options.addClass, add);\n options.removeClass = mergeClasses(options.removeClass, remove);\n return $$animateQueue.push(element, 'setClass', options);\n },\n\n /**\n * @ngdoc method\n * @name $animate#animate\n * @kind function\n *\n * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.\n * If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take\n * on the provided styles. For example, if a transition animation is set for the given className, then the provided `from` and\n * `to` styles will be applied alongside the given transition. If the CSS style provided in `from` does not have a corresponding\n * style in `to`, the style in `from` is applied immediately, and no animation is run.\n * If a JavaScript animation is detected then the provided styles will be given in as function parameters into the `animate`\n * method (or as part of the `options` parameter):\n *\n * ```js\n * ngModule.animation('.my-inline-animation', function() {\n * return {\n * animate : function(element, from, to, done, options) {\n * //animation\n * done();\n * }\n * }\n * });\n * ```\n *\n * @param {DOMElement} element the element which the CSS styles will be applied to\n * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.\n * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.\n * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If\n * this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.\n * (Note that if no animation is detected then this value will not be applied to the element.)\n * @param {object=} options an optional collection of options/styles that will be applied to the element.\n * The object can have the following properties:\n *\n * - **addClass** - `{string}` - space-separated CSS classes to add to element\n * - **from** - `{Object}` - CSS properties & values at the beginning of animation. Must have matching `to`\n * - **removeClass** - `{string}` - space-separated CSS classes to remove from element\n * - **to** - `{Object}` - CSS properties & values at end of animation. Must have matching `from`\n *\n * @return {Runner} the animation runner\n */\n animate: function(element, from, to, className, options) {\n options = prepareAnimateOptions(options);\n options.from = options.from ? extend(options.from, from) : from;\n options.to = options.to ? extend(options.to, to) : to;\n\n className = className || 'ng-inline-animate';\n options.tempClasses = mergeClasses(options.tempClasses, className);\n return $$animateQueue.push(element, 'animate', options);\n }\n };\n }];\n}];\n\nvar $$AnimateAsyncRunFactoryProvider = /** @this */ function() {\n this.$get = ['$$rAF', function($$rAF) {\n var waitQueue = [];\n\n function waitForTick(fn) {\n waitQueue.push(fn);\n if (waitQueue.length > 1) return;\n $$rAF(function() {\n for (var i = 0; i < waitQueue.length; i++) {\n waitQueue[i]();\n }\n waitQueue = [];\n });\n }\n\n return function() {\n var passed = false;\n waitForTick(function() {\n passed = true;\n });\n return function(callback) {\n if (passed) {\n callback();\n } else {\n waitForTick(callback);\n }\n };\n };\n }];\n};\n\nvar $$AnimateRunnerFactoryProvider = /** @this */ function() {\n this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',\n function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {\n\n var INITIAL_STATE = 0;\n var DONE_PENDING_STATE = 1;\n var DONE_COMPLETE_STATE = 2;\n\n AnimateRunner.chain = function(chain, callback) {\n var index = 0;\n\n next();\n function next() {\n if (index === chain.length) {\n callback(true);\n return;\n }\n\n chain[index](function(response) {\n if (response === false) {\n callback(false);\n return;\n }\n index++;\n next();\n });\n }\n };\n\n AnimateRunner.all = function(runners, callback) {\n var count = 0;\n var status = true;\n forEach(runners, function(runner) {\n runner.done(onProgress);\n });\n\n function onProgress(response) {\n status = status && response;\n if (++count === runners.length) {\n callback(status);\n }\n }\n };\n\n function AnimateRunner(host) {\n this.setHost(host);\n\n var rafTick = $$animateAsyncRun();\n var timeoutTick = function(fn) {\n $timeout(fn, 0, false);\n };\n\n this._doneCallbacks = [];\n this._tick = function(fn) {\n if ($$isDocumentHidden()) {\n timeoutTick(fn);\n } else {\n rafTick(fn);\n }\n };\n this._state = 0;\n }\n\n AnimateRunner.prototype = {\n setHost: function(host) {\n this.host = host || {};\n },\n\n done: function(fn) {\n if (this._state === DONE_COMPLETE_STATE) {\n fn();\n } else {\n this._doneCallbacks.push(fn);\n }\n },\n\n progress: noop,\n\n getPromise: function() {\n if (!this.promise) {\n var self = this;\n this.promise = $q(function(resolve, reject) {\n self.done(function(status) {\n if (status === false) {\n reject();\n } else {\n resolve();\n }\n });\n });\n }\n return this.promise;\n },\n\n then: function(resolveHandler, rejectHandler) {\n return this.getPromise().then(resolveHandler, rejectHandler);\n },\n\n 'catch': function(handler) {\n return this.getPromise()['catch'](handler);\n },\n\n 'finally': function(handler) {\n return this.getPromise()['finally'](handler);\n },\n\n pause: function() {\n if (this.host.pause) {\n this.host.pause();\n }\n },\n\n resume: function() {\n if (this.host.resume) {\n this.host.resume();\n }\n },\n\n end: function() {\n if (this.host.end) {\n this.host.end();\n }\n this._resolve(true);\n },\n\n cancel: function() {\n if (this.host.cancel) {\n this.host.cancel();\n }\n this._resolve(false);\n },\n\n complete: function(response) {\n var self = this;\n if (self._state === INITIAL_STATE) {\n self._state = DONE_PENDING_STATE;\n self._tick(function() {\n self._resolve(response);\n });\n }\n },\n\n _resolve: function(response) {\n if (this._state !== DONE_COMPLETE_STATE) {\n forEach(this._doneCallbacks, function(fn) {\n fn(response);\n });\n this._doneCallbacks.length = 0;\n this._state = DONE_COMPLETE_STATE;\n }\n }\n };\n\n return AnimateRunner;\n }];\n};\n\n/* exported $CoreAnimateCssProvider */\n\n/**\n * @ngdoc service\n * @name $animateCss\n * @kind object\n * @this\n *\n * @description\n * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,\n * then the `$animateCss` service will actually perform animations.\n *\n * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.\n */\nvar $CoreAnimateCssProvider = function() {\n this.$get = ['$$rAF', '$q', '$$AnimateRunner', function($$rAF, $q, $$AnimateRunner) {\n\n return function(element, initialOptions) {\n // all of the animation functions should create\n // a copy of the options data, however, if a\n // parent service has already created a copy then\n // we should stick to using that\n var options = initialOptions || {};\n if (!options.$$prepared) {\n options = copy(options);\n }\n\n // there is no point in applying the styles since\n // there is no animation that goes on at all in\n // this version of $animateCss.\n if (options.cleanupStyles) {\n options.from = options.to = null;\n }\n\n if (options.from) {\n element.css(options.from);\n options.from = null;\n }\n\n var closed, runner = new $$AnimateRunner();\n return {\n start: run,\n end: run\n };\n\n function run() {\n $$rAF(function() {\n applyAnimationContents();\n if (!closed) {\n runner.complete();\n }\n closed = true;\n });\n return runner;\n }\n\n function applyAnimationContents() {\n if (options.addClass) {\n element.addClass(options.addClass);\n options.addClass = null;\n }\n if (options.removeClass) {\n element.removeClass(options.removeClass);\n options.removeClass = null;\n }\n if (options.to) {\n element.css(options.to);\n options.to = null;\n }\n }\n };\n }];\n};\n\n/* global getHash: true, stripHash: false */\n\nfunction getHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? '' : url.substr(index);\n}\n\nfunction trimEmptyHash(url) {\n return url.replace(/#$/, '');\n}\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $browser\n * @requires $log\n * @description\n * This object has two goals:\n *\n * - hide all the global state in the browser caused by the window object\n * - abstract away all the browser specific features and inconsistencies\n *\n * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`\n * service, which can be used for convenient testing of the application without the interaction with\n * the real browser apis.\n */\n/**\n * @param {object} window The global window object.\n * @param {object} document jQuery wrapped document.\n * @param {object} $log window.console or an object with the same interface.\n * @param {object} $sniffer $sniffer service\n */\nfunction Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {\n var self = this,\n location = window.location,\n history = window.history,\n setTimeout = window.setTimeout,\n clearTimeout = window.clearTimeout,\n pendingDeferIds = {},\n taskTracker = $$taskTrackerFactory($log);\n\n self.isMock = false;\n\n //////////////////////////////////////////////////////////////\n // Task-tracking API\n //////////////////////////////////////////////////////////////\n\n // TODO(vojta): remove this temporary api\n self.$$completeOutstandingRequest = taskTracker.completeTask;\n self.$$incOutstandingRequestCount = taskTracker.incTaskCount;\n\n // TODO(vojta): prefix this method with $$ ?\n self.notifyWhenNoOutstandingRequests = taskTracker.notifyWhenNoPendingTasks;\n\n //////////////////////////////////////////////////////////////\n // URL API\n //////////////////////////////////////////////////////////////\n\n var cachedState, lastHistoryState,\n lastBrowserUrl = location.href,\n baseElement = document.find('base'),\n pendingLocation = null,\n getCurrentState = !$sniffer.history ? noop : function getCurrentState() {\n try {\n return history.state;\n } catch (e) {\n // MSIE can reportedly throw when there is no state (UNCONFIRMED).\n }\n };\n\n cacheState();\n\n /**\n * @name $browser#url\n *\n * @description\n * GETTER:\n * Without any argument, this method just returns current value of `location.href` (with a\n * trailing `#` stripped of if the hash is empty).\n *\n * SETTER:\n * With at least one argument, this method sets url to new value.\n * If html5 history api supported, `pushState`/`replaceState` is used, otherwise\n * `location.href`/`location.replace` is used.\n * Returns its own instance to allow chaining.\n *\n * NOTE: this api is intended for use only by the `$location` service. Please use the\n * {@link ng.$location $location service} to change url.\n *\n * @param {string} url New url (when used as setter)\n * @param {boolean=} replace Should new url replace current history record?\n * @param {object=} state State object to use with `pushState`/`replaceState`\n */\n self.url = function(url, replace, state) {\n // In modern browsers `history.state` is `null` by default; treating it separately\n // from `undefined` would cause `$browser.url('/foo')` to change `history.state`\n // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.\n if (isUndefined(state)) {\n state = null;\n }\n\n // Android Browser BFCache causes location, history reference to become stale.\n if (location !== window.location) location = window.location;\n if (history !== window.history) history = window.history;\n\n // setter\n if (url) {\n var sameState = lastHistoryState === state;\n\n // Normalize the inputted URL\n url = urlResolve(url).href;\n\n // Don't change anything if previous and current URLs and states match. This also prevents\n // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.\n // See https://github.com/angular/angular.js/commit/ffb2701\n if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {\n return self;\n }\n var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);\n lastBrowserUrl = url;\n lastHistoryState = state;\n // Don't use history API if only the hash changed\n // due to a bug in IE10/IE11 which leads\n // to not firing a `hashchange` nor `popstate` event\n // in some cases (see #9143).\n if ($sniffer.history && (!sameBase || !sameState)) {\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\n cacheState();\n } else {\n if (!sameBase) {\n pendingLocation = url;\n }\n if (replace) {\n location.replace(url);\n } else if (!sameBase) {\n location.href = url;\n } else {\n location.hash = getHash(url);\n }\n if (location.href !== url) {\n pendingLocation = url;\n }\n }\n if (pendingLocation) {\n pendingLocation = url;\n }\n return self;\n // getter\n } else {\n // - pendingLocation is needed as browsers don't allow to read out\n // the new location.href if a reload happened or if there is a bug like in iOS 9 (see\n // https://openradar.appspot.com/22186109).\n return trimEmptyHash(pendingLocation || location.href);\n }\n };\n\n /**\n * @name $browser#state\n *\n * @description\n * This method is a getter.\n *\n * Return history.state or null if history.state is undefined.\n *\n * @returns {object} state\n */\n self.state = function() {\n return cachedState;\n };\n\n var urlChangeListeners = [],\n urlChangeInit = false;\n\n function cacheStateAndFireUrlChange() {\n pendingLocation = null;\n fireStateOrUrlChange();\n }\n\n // This variable should be used *only* inside the cacheState function.\n var lastCachedState = null;\n function cacheState() {\n // This should be the only place in $browser where `history.state` is read.\n cachedState = getCurrentState();\n cachedState = isUndefined(cachedState) ? null : cachedState;\n\n // Prevent callbacks fo fire twice if both hashchange & popstate were fired.\n if (equals(cachedState, lastCachedState)) {\n cachedState = lastCachedState;\n }\n\n lastCachedState = cachedState;\n lastHistoryState = cachedState;\n }\n\n function fireStateOrUrlChange() {\n var prevLastHistoryState = lastHistoryState;\n cacheState();\n\n if (lastBrowserUrl === self.url() && prevLastHistoryState === cachedState) {\n return;\n }\n\n lastBrowserUrl = self.url();\n lastHistoryState = cachedState;\n forEach(urlChangeListeners, function(listener) {\n listener(self.url(), cachedState);\n });\n }\n\n /**\n * @name $browser#onUrlChange\n *\n * @description\n * Register callback function that will be called, when url changes.\n *\n * It's only called when the url is changed from outside of AngularJS:\n * - user types different url into address bar\n * - user clicks on history (forward/back) button\n * - user clicks on a link\n *\n * It's not called when url is changed by $browser.url() method\n *\n * The listener gets called with new url as parameter.\n *\n * NOTE: this api is intended for use only by the $location service. Please use the\n * {@link ng.$location $location service} to monitor url changes in AngularJS apps.\n *\n * @param {function(string)} listener Listener function to be called when url changes.\n * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.\n */\n self.onUrlChange = function(callback) {\n // TODO(vojta): refactor to use node's syntax for events\n if (!urlChangeInit) {\n // We listen on both (hashchange/popstate) when available, as some browsers don't\n // fire popstate when user changes the address bar and don't fire hashchange when url\n // changed by push/replaceState\n\n // html5 history api - popstate event\n if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);\n // hashchange event\n jqLite(window).on('hashchange', cacheStateAndFireUrlChange);\n\n urlChangeInit = true;\n }\n\n urlChangeListeners.push(callback);\n return callback;\n };\n\n /**\n * @private\n * Remove popstate and hashchange handler from window.\n *\n * NOTE: this api is intended for use only by $rootScope.\n */\n self.$$applicationDestroyed = function() {\n jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);\n };\n\n /**\n * Checks whether the url has changed outside of AngularJS.\n * Needs to be exported to be able to check for changes that have been done in sync,\n * as hashchange/popstate events fire in async.\n */\n self.$$checkUrlChange = fireStateOrUrlChange;\n\n //////////////////////////////////////////////////////////////\n // Misc API\n //////////////////////////////////////////////////////////////\n\n /**\n * @name $browser#baseHref\n *\n * @description\n * Returns current \n * (always relative - without domain)\n *\n * @returns {string} The current base href\n */\n self.baseHref = function() {\n var href = baseElement.attr('href');\n return href ? href.replace(/^(https?:)?\\/\\/[^/]*/, '') : '';\n };\n\n /**\n * @name $browser#defer\n * @param {function()} fn A function, who's execution should be deferred.\n * @param {number=} [delay=0] Number of milliseconds to defer the function execution.\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] The type of task that is deferred.\n * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.\n *\n * @description\n * Executes a fn asynchronously via `setTimeout(fn, delay)`.\n *\n * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using\n * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed\n * via `$browser.defer.flush()`.\n *\n */\n self.defer = function(fn, delay, taskType) {\n var timeoutId;\n\n delay = delay || 0;\n taskType = taskType || taskTracker.DEFAULT_TASK_TYPE;\n\n taskTracker.incTaskCount(taskType);\n timeoutId = setTimeout(function() {\n delete pendingDeferIds[timeoutId];\n taskTracker.completeTask(fn, taskType);\n }, delay);\n pendingDeferIds[timeoutId] = taskType;\n\n return timeoutId;\n };\n\n\n /**\n * @name $browser#defer.cancel\n *\n * @description\n * Cancels a deferred task identified with `deferId`.\n *\n * @param {*} deferId Token returned by the `$browser.defer` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n self.defer.cancel = function(deferId) {\n if (pendingDeferIds.hasOwnProperty(deferId)) {\n var taskType = pendingDeferIds[deferId];\n delete pendingDeferIds[deferId];\n clearTimeout(deferId);\n taskTracker.completeTask(noop, taskType);\n return true;\n }\n return false;\n };\n\n}\n\n/** @this */\nfunction $BrowserProvider() {\n this.$get = ['$window', '$log', '$sniffer', '$document', '$$taskTrackerFactory',\n function($window, $log, $sniffer, $document, $$taskTrackerFactory) {\n return new Browser($window, $document, $log, $sniffer, $$taskTrackerFactory);\n }];\n}\n\n/**\n * @ngdoc service\n * @name $cacheFactory\n * @this\n *\n * @description\n * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to\n * them.\n *\n * ```js\n *\n * var cache = $cacheFactory('cacheId');\n * expect($cacheFactory.get('cacheId')).toBe(cache);\n * expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();\n *\n * cache.put(\"key\", \"value\");\n * cache.put(\"another key\", \"another value\");\n *\n * // We've specified no options on creation\n * expect(cache.info()).toEqual({id: 'cacheId', size: 2});\n *\n * ```\n *\n *\n * @param {string} cacheId Name or id of the newly created cache.\n * @param {object=} options Options object that specifies the cache behavior. Properties:\n *\n * - `{number=}` `capacity` — turns the cache into LRU cache.\n *\n * @returns {object} Newly created cache object with the following set of methods:\n *\n * - `{object}` `info()` — Returns id, size, and options of cache.\n * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns\n * it.\n * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.\n * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.\n * - `{void}` `removeAll()` — Removes all cached values.\n * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.\n *\n * @example\n \n \n
      \n \n \n \n\n

      Cached Values

      \n
      \n \n : \n \n
      \n\n

      Cache Info

      \n
      \n \n : \n \n
      \n
      \n
      \n \n angular.module('cacheExampleApp', []).\n controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {\n $scope.keys = [];\n $scope.cache = $cacheFactory('cacheId');\n $scope.put = function(key, value) {\n if (angular.isUndefined($scope.cache.get(key))) {\n $scope.keys.push(key);\n }\n $scope.cache.put(key, angular.isUndefined(value) ? null : value);\n };\n }]);\n \n \n p {\n margin: 10px 0 3px;\n }\n \n
      \n */\nfunction $CacheFactoryProvider() {\n\n this.$get = function() {\n var caches = {};\n\n function cacheFactory(cacheId, options) {\n if (cacheId in caches) {\n throw minErr('$cacheFactory')('iid', 'CacheId \\'{0}\\' is already taken!', cacheId);\n }\n\n var size = 0,\n stats = extend({}, options, {id: cacheId}),\n data = createMap(),\n capacity = (options && options.capacity) || Number.MAX_VALUE,\n lruHash = createMap(),\n freshEnd = null,\n staleEnd = null;\n\n /**\n * @ngdoc type\n * @name $cacheFactory.Cache\n *\n * @description\n * A cache object used to store and retrieve data, primarily used by\n * {@link $templateRequest $templateRequest} and the {@link ng.directive:script script}\n * directive to cache templates and other data.\n *\n * ```js\n * angular.module('superCache')\n * .factory('superCache', ['$cacheFactory', function($cacheFactory) {\n * return $cacheFactory('super-cache');\n * }]);\n * ```\n *\n * Example test:\n *\n * ```js\n * it('should behave like a cache', inject(function(superCache) {\n * superCache.put('key', 'value');\n * superCache.put('another key', 'another value');\n *\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 2\n * });\n *\n * superCache.remove('another key');\n * expect(superCache.get('another key')).toBeUndefined();\n *\n * superCache.removeAll();\n * expect(superCache.info()).toEqual({\n * id: 'super-cache',\n * size: 0\n * });\n * }));\n * ```\n */\n return (caches[cacheId] = {\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#put\n * @kind function\n *\n * @description\n * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be\n * retrieved later, and incrementing the size of the cache if the key was not already\n * present in the cache. If behaving like an LRU cache, it will also remove stale\n * entries from the set.\n *\n * It will not insert undefined values into the cache.\n *\n * @param {string} key the key under which the cached data is stored.\n * @param {*} value the value to store alongside the key. If it is undefined, the key\n * will not be stored.\n * @returns {*} the value stored.\n */\n put: function(key, value) {\n if (isUndefined(value)) return;\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key] || (lruHash[key] = {key: key});\n\n refresh(lruEntry);\n }\n\n if (!(key in data)) size++;\n data[key] = value;\n\n if (size > capacity) {\n this.remove(staleEnd.key);\n }\n\n return value;\n },\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#get\n * @kind function\n *\n * @description\n * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the data to be retrieved\n * @returns {*} the value stored.\n */\n get: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n refresh(lruEntry);\n }\n\n return data[key];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#remove\n * @kind function\n *\n * @description\n * Removes an entry from the {@link $cacheFactory.Cache Cache} object.\n *\n * @param {string} key the key of the entry to be removed\n */\n remove: function(key) {\n if (capacity < Number.MAX_VALUE) {\n var lruEntry = lruHash[key];\n\n if (!lruEntry) return;\n\n if (lruEntry === freshEnd) freshEnd = lruEntry.p;\n if (lruEntry === staleEnd) staleEnd = lruEntry.n;\n link(lruEntry.n,lruEntry.p);\n\n delete lruHash[key];\n }\n\n if (!(key in data)) return;\n\n delete data[key];\n size--;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#removeAll\n * @kind function\n *\n * @description\n * Clears the cache object of any entries.\n */\n removeAll: function() {\n data = createMap();\n size = 0;\n lruHash = createMap();\n freshEnd = staleEnd = null;\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#destroy\n * @kind function\n *\n * @description\n * Destroys the {@link $cacheFactory.Cache Cache} object entirely,\n * removing it from the {@link $cacheFactory $cacheFactory} set.\n */\n destroy: function() {\n data = null;\n stats = null;\n lruHash = null;\n delete caches[cacheId];\n },\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory.Cache#info\n * @kind function\n *\n * @description\n * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.\n *\n * @returns {object} an object with the following properties:\n *
        \n *
      • **id**: the id of the cache instance
      • \n *
      • **size**: the number of entries kept in the cache instance
      • \n *
      • **...**: any additional properties from the options object when creating the\n * cache.
      • \n *
      \n */\n info: function() {\n return extend({}, stats, {size: size});\n }\n });\n\n\n /**\n * makes the `entry` the freshEnd of the LRU linked list\n */\n function refresh(entry) {\n if (entry !== freshEnd) {\n if (!staleEnd) {\n staleEnd = entry;\n } else if (staleEnd === entry) {\n staleEnd = entry.n;\n }\n\n link(entry.n, entry.p);\n link(entry, freshEnd);\n freshEnd = entry;\n freshEnd.n = null;\n }\n }\n\n\n /**\n * bidirectionally links two entries of the LRU linked list\n */\n function link(nextEntry, prevEntry) {\n if (nextEntry !== prevEntry) {\n if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify\n if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#info\n *\n * @description\n * Get information about all the caches that have been created\n *\n * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`\n */\n cacheFactory.info = function() {\n var info = {};\n forEach(caches, function(cache, cacheId) {\n info[cacheId] = cache.info();\n });\n return info;\n };\n\n\n /**\n * @ngdoc method\n * @name $cacheFactory#get\n *\n * @description\n * Get access to a cache object by the `cacheId` used when it was created.\n *\n * @param {string} cacheId Name or id of a cache to access.\n * @returns {object} Cache object identified by the cacheId or undefined if no such cache.\n */\n cacheFactory.get = function(cacheId) {\n return caches[cacheId];\n };\n\n\n return cacheFactory;\n };\n}\n\n/**\n * @ngdoc service\n * @name $templateCache\n * @this\n *\n * @description\n * `$templateCache` is a {@link $cacheFactory.Cache Cache object} created by the\n * {@link ng.$cacheFactory $cacheFactory}.\n *\n * The first time a template is used, it is loaded in the template cache for quick retrieval. You\n * can load templates directly into the cache in a `script` tag, by using {@link $templateRequest},\n * or by consuming the `$templateCache` service directly.\n *\n * Adding via the `script` tag:\n *\n * ```html\n * \n * ```\n *\n * **Note:** the `script` tag containing the template does not need to be included in the `head` of\n * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (e.g.\n * element with {@link ngApp} attribute), otherwise the template will be ignored.\n *\n * Adding via the `$templateCache` service:\n *\n * ```js\n * var myApp = angular.module('myApp', []);\n * myApp.run(function($templateCache) {\n * $templateCache.put('templateId.html', 'This is the content of the template');\n * });\n * ```\n *\n * To retrieve the template later, simply use it in your component:\n * ```js\n * myApp.component('myComponent', {\n * templateUrl: 'templateId.html'\n * });\n * ```\n *\n * or get it via the `$templateCache` service:\n * ```js\n * $templateCache.get('templateId.html')\n * ```\n *\n */\nfunction $TemplateCacheProvider() {\n this.$get = ['$cacheFactory', function($cacheFactory) {\n return $cacheFactory('templates');\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables like document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!\n *\n * DOM-related variables:\n *\n * - \"node\" - DOM Node\n * - \"element\" - DOM Element or Node\n * - \"$node\" or \"$element\" - jqLite-wrapped node or element\n *\n *\n * Compiler related stuff:\n *\n * - \"linkFn\" - linking fn of a single directive\n * - \"nodeLinkFn\" - function that aggregates all linking fns for a particular node\n * - \"childLinkFn\" - function that aggregates all linking fns for child nodes of a particular node\n * - \"compositeLinkFn\" - function that aggregates all linking fns for a compilation root (nodeList)\n */\n\n\n/**\n * @ngdoc service\n * @name $compile\n * @kind function\n *\n * @description\n * Compiles an HTML string or DOM into a template and produces a template function, which\n * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.\n *\n * The compilation is a process of walking the DOM tree and matching DOM elements to\n * {@link ng.$compileProvider#directive directives}.\n *\n *
      \n * **Note:** This document is an in-depth reference of all directive options.\n * For a gentle introduction to directives with examples of common use cases,\n * see the {@link guide/directive directive guide}.\n *
      \n *\n * ## Comprehensive Directive API\n *\n * There are many different options for a directive.\n *\n * The difference resides in the return value of the factory function.\n * You can either return a {@link $compile#directive-definition-object Directive Definition Object (see below)}\n * that defines the directive properties, or just the `postLink` function (all other properties will have\n * the default values).\n *\n *
      \n * **Best Practice:** It's recommended to use the \"directive definition object\" form.\n *
      \n *\n * Here's an example directive declared with a Directive Definition Object:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * {@link $compile#-priority- priority}: 0,\n * {@link $compile#-template- template}: '
      ', // or // function(tElement, tAttrs) { ... },\n * // or\n * // {@link $compile#-templateurl- templateUrl}: 'directive.html', // or // function(tElement, tAttrs) { ... },\n * {@link $compile#-transclude- transclude}: false,\n * {@link $compile#-restrict- restrict}: 'A',\n * {@link $compile#-templatenamespace- templateNamespace}: 'html',\n * {@link $compile#-scope- scope}: false,\n * {@link $compile#-controller- controller}: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },\n * {@link $compile#-controlleras- controllerAs}: 'stringIdentifier',\n * {@link $compile#-bindtocontroller- bindToController}: false,\n * {@link $compile#-require- require}: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],\n * {@link $compile#-multielement- multiElement}: false,\n * {@link $compile#-compile- compile}: function compile(tElement, tAttrs, transclude) {\n * return {\n * {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * }\n * // or\n * // return function postLink( ... ) { ... }\n * },\n * // or\n * // {@link $compile#-link- link}: {\n * // {@link $compile#pre-linking-function pre}: function preLink(scope, iElement, iAttrs, controller) { ... },\n * // {@link $compile#post-linking-function post}: function postLink(scope, iElement, iAttrs, controller) { ... }\n * // }\n * // or\n * // {@link $compile#-link- link}: function postLink( ... ) { ... }\n * };\n * return directiveDefinitionObject;\n * });\n * ```\n *\n *
      \n * **Note:** Any unspecified options will use the default value. You can see the default values below.\n *
      \n *\n * Therefore the above can be simplified as:\n *\n * ```js\n * var myModule = angular.module(...);\n *\n * myModule.directive('directiveName', function factory(injectables) {\n * var directiveDefinitionObject = {\n * link: function postLink(scope, iElement, iAttrs) { ... }\n * };\n * return directiveDefinitionObject;\n * // or\n * // return function postLink(scope, iElement, iAttrs) { ... }\n * });\n * ```\n *\n * ### Life-cycle hooks\n * Directive controllers can provide the following methods that are called by AngularJS at points in the life-cycle of the\n * directive:\n * * `$onInit()` - Called on each controller after all the controllers on an element have been constructed and\n * had their bindings initialized (and before the pre & post linking functions for the directives on\n * this element). This is a good place to put initialization code for your controller.\n * * `$onChanges(changesObj)` - Called whenever one-way (`<`) or interpolation (`@`) bindings are updated. The\n * `changesObj` is a hash whose keys are the names of the bound properties that have changed, and the values are an\n * object of the form `{ currentValue, previousValue, isFirstChange() }`. Use this hook to trigger updates within a\n * component such as cloning the bound value to prevent accidental mutation of the outer value. Note that this will\n * also be called when your bindings are initialized.\n * * `$doCheck()` - Called on each turn of the digest cycle. Provides an opportunity to detect and act on\n * changes. Any actions that you wish to take in response to the changes that you detect must be\n * invoked from this hook; implementing this has no effect on when `$onChanges` is called. For example, this hook\n * could be useful if you wish to perform a deep equality check, or to check a Date object, changes to which would not\n * be detected by AngularJS's change detector and thus not trigger `$onChanges`. This hook is invoked with no arguments;\n * if detecting changes, you must store the previous value(s) for comparison to the current values.\n * * `$onDestroy()` - Called on a controller when its containing scope is destroyed. Use this hook for releasing\n * external resources, watches and event handlers. Note that components have their `$onDestroy()` hooks called in\n * the same order as the `$scope.$broadcast` events are triggered, which is top down. This means that parent\n * components will have their `$onDestroy()` hook called before child components.\n * * `$postLink()` - Called after this controller's element and its children have been linked. Similar to the post-link\n * function this hook can be used to set up DOM event handlers and do direct DOM manipulation.\n * Note that child elements that contain `templateUrl` directives will not have been compiled and linked since\n * they are waiting for their template to load asynchronously and their own compilation and linking has been\n * suspended until that occurs.\n *\n * #### Comparison with life-cycle hooks in the new Angular\n * The new Angular also uses life-cycle hooks for its components. While the AngularJS life-cycle hooks are similar there are\n * some differences that you should be aware of, especially when it comes to moving your code from AngularJS to Angular:\n *\n * * AngularJS hooks are prefixed with `$`, such as `$onInit`. Angular hooks are prefixed with `ng`, such as `ngOnInit`.\n * * AngularJS hooks can be defined on the controller prototype or added to the controller inside its constructor.\n * In Angular you can only define hooks on the prototype of the Component class.\n * * Due to the differences in change-detection, you may get many more calls to `$doCheck` in AngularJS than you would to\n * `ngDoCheck` in Angular.\n * * Changes to the model inside `$doCheck` will trigger new turns of the digest loop, which will cause the changes to be\n * propagated throughout the application.\n * Angular does not allow the `ngDoCheck` hook to trigger a change outside of the component. It will either throw an\n * error or do nothing depending upon the state of `enableProdMode()`.\n *\n * #### Life-cycle hook examples\n *\n * This example shows how you can check for mutations to a Date object even though the identity of the object\n * has not changed.\n *\n * \n * \n * angular.module('do-check-module', [])\n * .component('app', {\n * template:\n * 'Month: ' +\n * 'Date: {{ $ctrl.date }}' +\n * '',\n * controller: function() {\n * this.date = new Date();\n * this.month = this.date.getMonth();\n * this.updateDate = function() {\n * this.date.setMonth(this.month);\n * };\n * }\n * })\n * .component('test', {\n * bindings: { date: '<' },\n * template:\n * '
      {{ $ctrl.log | json }}
      ',\n * controller: function() {\n * var previousValue;\n * this.log = [];\n * this.$doCheck = function() {\n * var currentValue = this.date && this.date.valueOf();\n * if (previousValue !== currentValue) {\n * this.log.push('doCheck: date mutated: ' + this.date);\n * previousValue = currentValue;\n * }\n * };\n * }\n * });\n *
      \n * \n * \n * \n *
      \n *\n * This example show how you might use `$doCheck` to trigger changes in your component's inputs even if the\n * actual identity of the component doesn't change. (Be aware that cloning and deep equality checks on large\n * arrays or objects can have a negative impact on your application performance.)\n *\n * \n * \n *
      \n * \n * \n *
      {{ items }}
      \n * \n *
      \n *
      \n * \n * angular.module('do-check-module', [])\n * .component('test', {\n * bindings: { items: '<' },\n * template:\n * '
      {{ $ctrl.log | json }}
      ',\n * controller: function() {\n * this.log = [];\n *\n * this.$doCheck = function() {\n * if (this.items_ref !== this.items) {\n * this.log.push('doCheck: items changed');\n * this.items_ref = this.items;\n * }\n * if (!angular.equals(this.items_clone, this.items)) {\n * this.log.push('doCheck: items mutated');\n * this.items_clone = angular.copy(this.items);\n * }\n * };\n * }\n * });\n *
      \n *
      \n *\n *\n * ### Directive Definition Object\n *\n * The directive definition object provides instructions to the {@link ng.$compile\n * compiler}. The attributes are:\n *\n * #### `multiElement`\n * When this property is set to true (default is `false`), the HTML compiler will collect DOM nodes between\n * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them\n * together as the directive elements. It is recommended that this feature be used on directives\n * which are not strictly behavioral (such as {@link ngClick}), and which\n * do not manipulate or replace child nodes (such as {@link ngInclude}).\n *\n * #### `priority`\n * When there are multiple directives defined on a single DOM element, sometimes it\n * is necessary to specify the order in which the directives are applied. The `priority` is used\n * to sort the directives before their `compile` functions get called. Priority is defined as a\n * number. Directives with greater numerical `priority` are compiled first. Pre-link functions\n * are also run in priority order, but post-link functions are run in reverse order. The order\n * of directives with the same priority is undefined. The default priority is `0`.\n *\n * #### `terminal`\n * If set to true then the current `priority` will be the last set of directives\n * which will execute (any directives at the current priority will still execute\n * as the order of execution on same `priority` is undefined). Note that expressions\n * and other directives used in the directive's template will also be excluded from execution.\n *\n * #### `scope`\n * The scope property can be `false`, `true`, or an object:\n *\n * * **`false` (default):** No scope will be created for the directive. The directive will use its\n * parent's scope.\n *\n * * **`true`:** A new child scope that prototypically inherits from its parent will be created for\n * the directive's element. If multiple directives on the same element request a new scope,\n * only one new scope is created.\n *\n * * **`{...}` (an object hash):** A new \"isolate\" scope is created for the directive's template.\n * The 'isolate' scope differs from normal scope in that it does not prototypically\n * inherit from its parent scope. This is useful when creating reusable components, which should not\n * accidentally read or modify data in the parent scope. Note that an isolate scope\n * directive without a `template` or `templateUrl` will not apply the isolate scope\n * to its children elements.\n *\n * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the\n * directive's element. These local properties are useful for aliasing values for templates. The keys in\n * the object hash map to the name of the property on the isolate scope; the values define how the property\n * is bound to the parent scope, via matching attributes on the directive's element:\n *\n * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is\n * always a string since DOM attributes are strings. If no `attr` name is specified then the\n * attribute name is assumed to be the same as the local name. Given `` and the isolate scope definition `scope: { localName:'@myAttr' }`,\n * the directive's scope property `localName` will reflect the interpolated value of `hello\n * {{name}}`. As the `name` attribute changes so will the `localName` property on the directive's\n * scope. The `name` is read from the parent scope (not the directive's scope).\n *\n * * `=` or `=attr` - set up a bidirectional binding between a local scope property and an expression\n * passed via the attribute `attr`. The expression is evaluated in the context of the parent scope.\n * If no `attr` name is specified then the attribute name is assumed to be the same as the local\n * name. Given `` and the isolate scope definition `scope: {\n * localModel: '=myAttr' }`, the property `localModel` on the directive's scope will reflect the\n * value of `parentModel` on the parent scope. Changes to `parentModel` will be reflected in\n * `localModel` and vice versa. If the binding expression is non-assignable, or if the attribute\n * isn't optional and doesn't exist, an exception\n * ({@link error/$compile/nonassign `$compile:nonassign`}) will be thrown upon discovering changes\n * to the local value, since it will be impossible to sync them back to the parent scope.\n *\n * By default, the {@link ng.$rootScope.Scope#$watch `$watch`}\n * method is used for tracking changes, and the equality check is based on object identity.\n * However, if an object literal or an array literal is passed as the binding expression, the\n * equality check is done by value (using the {@link angular.equals} function). It's also possible\n * to watch the evaluated value shallowly with {@link ng.$rootScope.Scope#$watchCollection\n * `$watchCollection`}: use `=*` or `=*attr`\n *\n * * `<` or `` and directive definition of\n * `scope: { localModel:'` and the isolate scope definition `scope: {\n * localFn:'&myAttr' }`, the isolate scope property `localFn` will point to a function wrapper for\n * the `count = count + value` expression. Often it's desirable to pass data from the isolated scope\n * via an expression to the parent scope. This can be done by passing a map of local variable names\n * and values into the expression wrapper fn. For example, if the expression is `increment(amount)`\n * then we can specify the amount value by calling the `localFn` as `localFn({amount: 22})`.\n *\n * All 4 kinds of bindings (`@`, `=`, `<`, and `&`) can be made optional by adding `?` to the expression.\n * The marker must come after the mode and before the attribute name.\n * See the {@link error/$compile/iscp Invalid Isolate Scope Definition error} for definition examples.\n * This is useful to refine the interface directives provide.\n * One subtle difference between optional and non-optional happens **when the binding attribute is not\n * set**:\n * - the binding is optional: the property will not be defined\n * - the binding is not optional: the property is defined\n *\n * ```js\n *app.directive('testDir', function() {\n return {\n scope: {\n notoptional: '=',\n optional: '=?',\n },\n bindToController: true,\n controller: function() {\n this.$onInit = function() {\n console.log(this.hasOwnProperty('notoptional')) // true\n console.log(this.hasOwnProperty('optional')) // false\n }\n }\n }\n })\n *```\n *\n *\n * ##### Combining directives with different scope defintions\n *\n * In general it's possible to apply more than one directive to one element, but there might be limitations\n * depending on the type of scope required by the directives. The following points will help explain these limitations.\n * For simplicity only two directives are taken into account, but it is also applicable for several directives:\n *\n * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope\n * * **child scope** + **no scope** => Both directives will share one single child scope\n * * **child scope** + **child scope** => Both directives will share one single child scope\n * * **isolated scope** + **no scope** => The isolated directive will use it's own created isolated scope. The other directive will use\n * its parent's scope\n * * **isolated scope** + **child scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives cannot\n * be applied to the same element.\n * * **isolated scope** + **isolated scope** => **Won't work!** Only one scope can be related to one element. Therefore these directives\n * cannot be applied to the same element.\n *\n *\n * #### `bindToController`\n * This property is used to bind scope properties directly to the controller. It can be either\n * `true` or an object hash with the same format as the `scope` property.\n *\n * When an isolate scope is used for a directive (see above), `bindToController: true` will\n * allow a component to have its properties bound to the controller, rather than to scope.\n *\n * After the controller is instantiated, the initial values of the isolate scope bindings will be bound to the controller\n * properties. You can access these bindings once they have been initialized by providing a controller method called\n * `$onInit`, which is called after all the controllers on an element have been constructed and had their bindings\n * initialized.\n *\n * It is also possible to set `bindToController` to an object hash with the same format as the `scope` property.\n * This will set up the scope bindings to the controller directly. Note that `scope` can still be used\n * to define which kind of scope is created. By default, no scope is created. Use `scope: {}` to create an isolate\n * scope (useful for component directives).\n *\n * If both `bindToController` and `scope` are defined and have object hashes, `bindToController` overrides `scope`.\n *\n *\n * #### `controller`\n * Controller constructor function. The controller is instantiated before the\n * pre-linking phase and can be accessed by other directives (see\n * `require` attribute). This allows the directives to communicate with each other and augment\n * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:\n *\n * * `$scope` - Current scope associated with the element\n * * `$element` - Current element\n * * `$attrs` - Current attributes object for the element\n * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:\n * `function([scope], cloneLinkingFn, futureParentElement, slotName)`:\n * * `scope`: (optional) override the scope.\n * * `cloneLinkingFn`: (optional) argument to create clones of the original transcluded content.\n * * `futureParentElement` (optional):\n * * defines the parent to which the `cloneLinkingFn` will add the cloned elements.\n * * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.\n * * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)\n * and when the `cloneLinkingFn` is passed,\n * as those elements need to created and cloned in a special way when they are defined outside their\n * usual containers (e.g. like ``).\n * * See also the `directive.templateNamespace` property.\n * * `slotName`: (optional) the name of the slot to transclude. If falsy (e.g. `null`, `undefined` or `''`)\n * then the default transclusion is provided.\n * The `$transclude` function also has a method on it, `$transclude.isSlotFilled(slotName)`, which returns\n * `true` if the specified slot contains content (i.e. one or more DOM nodes).\n *\n * #### `require`\n * Require another directive and inject its controller as the fourth argument to the linking function. The\n * `require` property can be a string, an array or an object:\n * * a **string** containing the name of the directive to pass to the linking function\n * * an **array** containing the names of directives to pass to the linking function. The argument passed to the\n * linking function will be an array of controllers in the same order as the names in the `require` property\n * * an **object** whose property values are the names of the directives to pass to the linking function. The argument\n * passed to the linking function will also be an object with matching keys, whose values will hold the corresponding\n * controllers.\n *\n * If the `require` property is an object and `bindToController` is truthy, then the required controllers are\n * bound to the controller using the keys of the `require` property. This binding occurs after all the controllers\n * have been constructed but before `$onInit` is called.\n * If the name of the required controller is the same as the local name (the key), the name can be\n * omitted. For example, `{parentDir: '^^'}` is equivalent to `{parentDir: '^^parentDir'}`.\n * See the {@link $compileProvider#component} helper for an example of how this can be used.\n * If no such required directive(s) can be found, or if the directive does not have a controller, then an error is\n * raised (unless no link function is specified and the required controllers are not being bound to the directive\n * controller, in which case error checking is skipped). The name can be prefixed with:\n *\n * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.\n * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.\n * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.\n * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.\n * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass\n * `null` to the `link` fn if not found.\n * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass\n * `null` to the `link` fn if not found.\n *\n *\n * #### `controllerAs`\n * Identifier name for a reference to the controller in the directive's scope.\n * This allows the controller to be referenced from the directive template. This is especially\n * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible\n * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the\n * `controllerAs` reference might overwrite a property that already exists on the parent scope.\n *\n *\n * #### `restrict`\n * String of subset of `EACM` which restricts the directive to a specific directive\n * declaration style. If omitted, the defaults (elements and attributes) are used.\n *\n * * `E` - Element name (default): ``\n * * `A` - Attribute (default): `
      `\n * * `C` - Class: `
      `\n * * `M` - Comment: ``\n *\n *\n * #### `templateNamespace`\n * String representing the document type used by the markup in the template.\n * AngularJS needs this information as those elements need to be created and cloned\n * in a special way when they are defined outside their usual containers like `` and ``.\n *\n * * `html` - All root nodes in the template are HTML. Root nodes may also be\n * top-level elements such as `` or ``.\n * * `svg` - The root nodes in the template are SVG elements (excluding ``).\n * * `math` - The root nodes in the template are MathML elements (excluding ``).\n *\n * If no `templateNamespace` is specified, then the namespace is considered to be `html`.\n *\n * #### `template`\n * HTML markup that may:\n * * Replace the contents of the directive's element (default).\n * * Replace the directive's element itself (if `replace` is true - DEPRECATED).\n * * Wrap the contents of the directive's element (if `transclude` is true).\n *\n * Value may be:\n *\n * * A string. For example `
      {{delete_str}}
      `.\n * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`\n * function api below) and returns a string value.\n *\n *\n * #### `templateUrl`\n * This is similar to `template` but the template is loaded from the specified URL, asynchronously.\n *\n * Because template loading is asynchronous the compiler will suspend compilation of directives on that element\n * for later when the template has been resolved. In the meantime it will continue to compile and link\n * sibling and parent elements as though this element had not contained any directives.\n *\n * The compiler does not suspend the entire compilation to wait for templates to be loaded because this\n * would result in the whole app \"stalling\" until all templates are loaded asynchronously - even in the\n * case when only one deeply nested directive has `templateUrl`.\n *\n * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}.\n *\n * You can specify `templateUrl` as a string representing the URL or as a function which takes two\n * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns\n * a string value representing the url. In either case, the template URL is passed through {@link\n * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.\n *\n *\n * #### `replace`\n *
      \n * **Note:** `replace` is deprecated in AngularJS and has been removed in the new Angular (v2+).\n *
      \n *\n * Specifies what the template should replace. Defaults to `false`.\n *\n * * `true` - the template will replace the directive's element.\n * * `false` - the template will replace the contents of the directive's element.\n *\n * The replacement process migrates all of the attributes / classes from the old element to the new\n * one. See the {@link guide/directive#template-expanding-directive\n * Directives Guide} for an example.\n *\n * There are very few scenarios where element replacement is required for the application function,\n * the main one being reusable custom components that are used within SVG contexts\n * (because SVG doesn't work with custom elements in the DOM tree).\n *\n * #### `transclude`\n * Extract the contents of the element where the directive appears and make it available to the directive.\n * The contents are compiled and provided to the directive as a **transclusion function**. See the\n * {@link $compile#transclusion Transclusion} section below.\n *\n *\n * #### `compile`\n *\n * ```js\n * function compile(tElement, tAttrs, transclude) { ... }\n * ```\n *\n * The compile function deals with transforming the template DOM. Since most directives do not do\n * template transformation, it is not used often. The compile function takes the following arguments:\n *\n * * `tElement` - template element - The element where the directive has been declared. It is\n * safe to do template transformation on the element and child elements only.\n *\n * * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared\n * between all directive compile functions.\n *\n * * `transclude` - [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`\n *\n *
      \n * **Note:** The template instance and the link instance may be different objects if the template has\n * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that\n * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration\n * should be done in a linking function rather than in a compile function.\n *
      \n\n *
      \n * **Note:** The compile function cannot handle directives that recursively use themselves in their\n * own templates or compile functions. Compiling these directives results in an infinite loop and\n * stack overflow errors.\n *\n * This can be avoided by manually using `$compile` in the postLink function to imperatively compile\n * a directive's template instead of relying on automatic template compilation via `template` or\n * `templateUrl` declaration or manual compilation inside the compile function.\n *
      \n *\n *
      \n * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it\n * e.g. does not know about the right outer scope. Please use the transclude function that is passed\n * to the link function instead.\n *
      \n\n * A compile function can have a return value which can be either a function or an object.\n *\n * * returning a (post-link) function - is equivalent to registering the linking function via the\n * `link` property of the config object when the compile function is empty.\n *\n * * returning an object with function(s) registered via `pre` and `post` properties - allows you to\n * control when a linking function should be called during the linking phase. See info about\n * pre-linking and post-linking functions below.\n *\n *\n * #### `link`\n * This property is used only if the `compile` property is not defined.\n *\n * ```js\n * function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }\n * ```\n *\n * The link function is responsible for registering DOM listeners as well as updating the DOM. It is\n * executed after the template has been cloned. This is where most of the directive logic will be\n * put.\n *\n * * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the\n * directive for registering {@link ng.$rootScope.Scope#$watch watches}.\n *\n * * `iElement` - instance element - The element where the directive is to be used. It is safe to\n * manipulate the children of the element only in `postLink` function since the children have\n * already been linked.\n *\n * * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared\n * between all directive linking functions.\n *\n * * `controller` - the directive's required controller instance(s) - Instances are shared\n * among all directives, which allows the directives to use the controllers as a communication\n * channel. The exact value depends on the directive's `require` property:\n * * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one\n * * `string`: the controller instance\n * * `array`: array of controller instances\n *\n * If a required controller cannot be found, and it is optional, the instance is `null`,\n * otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.\n *\n * Note that you can also require the directive's own controller - it will be made available like\n * any other controller.\n *\n * * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.\n * This is the same as the `$transclude` parameter of directive controllers,\n * see {@link ng.$compile#-controller- the controller section for details}.\n * `function([scope], cloneLinkingFn, futureParentElement)`.\n *\n * #### Pre-linking function\n *\n * Executed before the child elements are linked. Not safe to do DOM transformation since the\n * compiler linking function will fail to locate the correct elements for linking.\n *\n * #### Post-linking function\n *\n * Executed after the child elements are linked.\n *\n * Note that child elements that contain `templateUrl` directives will not have been compiled\n * and linked since they are waiting for their template to load asynchronously and their own\n * compilation and linking has been suspended until that occurs.\n *\n * It is safe to do DOM transformation in the post-linking function on elements that are not waiting\n * for their async templates to be resolved.\n *\n *\n * ### Transclusion\n *\n * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and\n * copying them to another part of the DOM, while maintaining their connection to the original AngularJS\n * scope from where they were taken.\n *\n * Transclusion is used (often with {@link ngTransclude}) to insert the\n * original contents of a directive's element into a specified place in the template of the directive.\n * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded\n * content has access to the properties on the scope from which it was taken, even if the directive\n * has isolated scope.\n * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.\n *\n * This makes it possible for the widget to have private state for its template, while the transcluded\n * content has access to its originating scope.\n *\n *
      \n * **Note:** When testing an element transclude directive you must not place the directive at the root of the\n * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives\n * Testing Transclusion Directives}.\n *
      \n *\n * There are three kinds of transclusion depending upon whether you want to transclude just the contents of the\n * directive's element, the entire element or multiple parts of the element contents:\n *\n * * `true` - transclude the content (i.e. the child nodes) of the directive's element.\n * * `'element'` - transclude the whole of the directive's element including any directives on this\n * element that are defined at a lower priority than this directive. When used, the `template`\n * property is ignored.\n * * **`{...}` (an object hash):** - map elements of the content onto transclusion \"slots\" in the template.\n *\n * **Multi-slot transclusion** is declared by providing an object for the `transclude` property.\n *\n * This object is a map where the keys are the name of the slot to fill and the value is an element selector\n * used to match the HTML to the slot. The element selector should be in normalized form (e.g. `myElement`)\n * and will match the standard element variants (e.g. `my-element`, `my:element`, `data-my-element`, etc).\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}.\n *\n * If the element selector is prefixed with a `?` then that slot is optional.\n *\n * For example, the transclude object `{ slotA: '?myCustomElement' }` maps `` elements to\n * the `slotA` slot, which can be accessed via the `$transclude` function or via the {@link ngTransclude} directive.\n *\n * Slots that are not marked as optional (`?`) will trigger a compile time error if there are no matching elements\n * in the transclude content. If you wish to know if an optional slot was filled with content, then you can call\n * `$transclude.isSlotFilled(slotName)` on the transclude function passed to the directive's link function and\n * injectable into the directive's controller.\n *\n *\n * #### Transclusion Functions\n *\n * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion\n * function** to the directive's `link` function and `controller`. This transclusion function is a special\n * **linking function** that will return the compiled contents linked to a new transclusion scope.\n *\n *
      \n * If you are just using {@link ngTransclude} then you don't need to worry about this function, since\n * ngTransclude will deal with it for us.\n *
      \n *\n * If you want to manually control the insertion and removal of the transcluded content in your directive\n * then you must use this transclude function. When you call a transclude function it returns a jqLite/JQuery\n * object that contains the compiled DOM, which is linked to the correct transclusion scope.\n *\n * When you call a transclusion function you can pass in a **clone attach function**. This function accepts\n * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded\n * content and the `scope` is the newly created transclusion scope, which the clone will be linked to.\n *\n *
      \n * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a transclude function\n * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.\n *
      \n *\n * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone\n * attach function**:\n *\n * ```js\n * var transcludedContent, transclusionScope;\n *\n * $transclude(function(clone, scope) {\n * element.append(clone);\n * transcludedContent = clone;\n * transclusionScope = scope;\n * });\n * ```\n *\n * Later, if you want to remove the transcluded content from your DOM then you should also destroy the\n * associated transclusion scope:\n *\n * ```js\n * transcludedContent.remove();\n * transclusionScope.$destroy();\n * ```\n *\n *
      \n * **Best Practice**: if you intend to add and remove transcluded content manually in your directive\n * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),\n * then you are also responsible for calling `$destroy` on the transclusion scope.\n *
      \n *\n * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}\n * automatically destroy their transcluded clones as necessary so you do not need to worry about this if\n * you are simply using {@link ngTransclude} to inject the transclusion into your directive.\n *\n *\n * #### Transclusion Scopes\n *\n * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion\n * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed\n * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it\n * was taken.\n *\n * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look\n * like this:\n *\n * ```html\n *
      \n *
      \n *
      \n *
      \n *
      \n *
      \n * ```\n *\n * The `$parent` scope hierarchy will look like this:\n *\n ```\n - $rootScope\n - isolate\n - transclusion\n ```\n *\n * but the scopes will inherit prototypically from different scopes to their `$parent`.\n *\n ```\n - $rootScope\n - transclusion\n - isolate\n ```\n *\n *\n * ### Attributes\n *\n * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the\n * `link()` or `compile()` functions. It has a variety of uses.\n *\n * * *Accessing normalized attribute names:* Directives like `ngBind` can be expressed in many ways:\n * `ng:bind`, `data-ng-bind`, or `x-ng-bind`. The attributes object allows for normalized access\n * to the attributes.\n *\n * * *Directive inter-communication:* All directives share the same instance of the attributes\n * object which allows the directives to use the attributes object as inter directive\n * communication.\n *\n * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object\n * allowing other directives to read the interpolated value.\n *\n * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes\n * that contain interpolation (e.g. `src=\"{{bar}}\"`). Not only is this very efficient but it's also\n * the only way to easily get the actual value because during the linking phase the interpolation\n * hasn't been evaluated yet and so the value is at this time set to `undefined`.\n *\n * ```js\n * function linkingFn(scope, elm, attrs, ctrl) {\n * // get the attribute value\n * console.log(attrs.ngModel);\n *\n * // change the attribute\n * attrs.$set('ngModel', 'new value');\n *\n * // observe changes to interpolated attribute\n * attrs.$observe('ngModel', function(value) {\n * console.log('ngModel has changed value to ' + value);\n * });\n * }\n * ```\n *\n * ## Example\n *\n *
      \n * **Note**: Typically directives are registered with `module.directive`. The example below is\n * to illustrate how `$compile` works.\n *
      \n *\n \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n \n it('should auto compile', function() {\n var textarea = $('textarea');\n var output = $('div[compile]');\n // The initial state reads 'Hello AngularJS'.\n expect(output.getText()).toBe('Hello AngularJS');\n textarea.clear();\n textarea.sendKeys('{{name}}!');\n expect(output.getText()).toBe('AngularJS!');\n });\n \n
      \n\n *\n *\n * @param {string|DOMElement} element Element or HTML string to compile into a template function.\n * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.\n *\n *
      \n * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it\n * e.g. will not use the right outer scope. Please pass the transclude function as a\n * `parentBoundTranscludeFn` to the link function instead.\n *
      \n *\n * @param {number} maxPriority only apply directives lower than given priority (Only effects the\n * root element(s), not their children)\n * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template\n * (a DOM element/tree) to a scope. Where:\n *\n * * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.\n * * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the\n * `template` and call the `cloneAttachFn` function allowing the caller to attach the\n * cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is\n * called as:
      `cloneAttachFn(clonedElement, scope)` where:\n *\n * * `clonedElement` - is a clone of the original `element` passed into the compiler.\n * * `scope` - is the current scope with which the linking function is working with.\n *\n * * `options` - An optional object hash with linking options. If `options` is provided, then the following\n * keys may be used to control linking behavior:\n *\n * * `parentBoundTranscludeFn` - the transclude function made available to\n * directives; if given, it will be passed through to the link functions of\n * directives found in `element` during compilation.\n * * `transcludeControllers` - an object hash with keys that map controller names\n * to a hash with the key `instance`, which maps to the controller instance;\n * if given, it will make the controllers available to directives on the compileNode:\n * ```\n * {\n * parent: {\n * instance: parentControllerInstance\n * }\n * }\n * ```\n * * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add\n * the cloned elements; only needed for transcludes that are allowed to contain non HTML\n * elements (e.g. SVG elements). See also the `directive.controller` property.\n *\n * Calling the linking function returns the element of the template. It is either the original\n * element passed in, or the clone of the element if the `cloneAttachFn` is provided.\n *\n * After linking the view is not updated until after a call to `$digest`, which typically is done by\n * AngularJS automatically.\n *\n * If you need access to the bound view, there are two ways to do it:\n *\n * - If you are not asking the linking function to clone the template, create the DOM element(s)\n * before you send them to the compiler and keep this reference around.\n * ```js\n * var element = angular.element('

      {{total}}

      ');\n * $compile(element)(scope);\n * ```\n *\n * - if on the other hand, you need the element to be cloned, the view reference from the original\n * example would not point to the clone, but rather to the original template that was cloned. In\n * this case, you can access the clone either via the `cloneAttachFn` or the value returned by the\n * linking function:\n * ```js\n * var templateElement = angular.element('

      {{total}}

      ');\n * var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {\n * // Attach the clone to DOM document at the right place.\n * });\n *\n * // Now we have reference to the cloned DOM via `clonedElement`.\n * // NOTE: The `clonedElement` returned by the linking function is the same as the\n * // `clonedElement` passed to `cloneAttachFn`.\n * ```\n *\n *\n * For information on how the compiler works, see the\n * {@link guide/compiler AngularJS HTML Compiler} section of the Developer Guide.\n *\n * @knownIssue\n *\n * ### Double Compilation\n *\n Double compilation occurs when an already compiled part of the DOM gets\n compiled again. This is an undesired effect and can lead to misbehaving directives, performance issues,\n and memory leaks. Refer to the Compiler Guide {@link guide/compiler#double-compilation-and-how-to-avoid-it\n section on double compilation} for an in-depth explanation and ways to avoid it.\n\n * @knownIssue\n\n ### Issues with `replace: true`\n *\n *
      \n * **Note**: {@link $compile#-replace- `replace: true`} is deprecated and not recommended to use,\n * mainly due to the issues listed here. It has been completely removed in the new Angular.\n *
      \n *\n * #### Attribute values are not merged\n *\n * When a `replace` directive encounters the same attribute on the original and the replace node,\n * it will simply deduplicate the attribute and join the values with a space or with a `;` in case of\n * the `style` attribute.\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * That means attributes that contain AngularJS expressions will not be merged correctly, e.g.\n * {@link ngShow} or {@link ngClass} will cause a {@link $parse} error:\n *\n * ```html\n * Original Node: \n * Replace Template: \n * Result: \n * ```\n *\n * See issue [#5695](https://github.com/angular/angular.js/issues/5695).\n *\n * #### Directives are not deduplicated before compilation\n *\n * When the original node and the replace template declare the same directive(s), they will be\n * {@link guide/compiler#double-compilation-and-how-to-avoid-it compiled twice} because the compiler\n * does not deduplicate them. In many cases, this is not noticeable, but e.g. {@link ngModel} will\n * attach `$formatters` and `$parsers` twice.\n *\n * See issue [#2573](https://github.com/angular/angular.js/issues/2573).\n *\n * #### `transclude: element` in the replace template root can have unexpected effects\n *\n * When the replace template has a directive at the root node that uses\n * {@link $compile#-transclude- `transclude: element`}, e.g.\n * {@link ngIf} or {@link ngRepeat}, the DOM structure or scope inheritance can be incorrect.\n * See the following issues:\n *\n * - Incorrect scope on replaced element:\n * [#9837](https://github.com/angular/angular.js/issues/9837)\n * - Different DOM between `template` and `templateUrl`:\n * [#10612](https://github.com/angular/angular.js/issues/14326)\n *\n */\n\n/**\n * @ngdoc directive\n * @name ngProp\n * @restrict A\n * @element ANY\n *\n * @usage\n *\n * ```html\n * \n * \n * ```\n *\n * or with uppercase letters in property (e.g. \"propName\"):\n *\n *\n * ```html\n * \n * \n * ```\n *\n *\n * @description\n * The `ngProp` directive binds an expression to a DOM element property.\n * `ngProp` allows writing to arbitrary properties by including\n * the property name in the attribute, e.g. `ng-prop-value=\"'my value'\"` binds 'my value' to\n * the `value` property.\n *\n * Usually, it's not necessary to write to properties in AngularJS, as the built-in directives\n * handle the most common use cases (instead of the above example, you would use {@link ngValue}).\n *\n * However, [custom elements](https://developer.mozilla.org/docs/Web/Web_Components/Using_custom_elements)\n * often use custom properties to hold data, and `ngProp` can be used to provide input to these\n * custom elements.\n *\n * ## Binding to camelCase properties\n *\n * Since HTML attributes are case-insensitive, camelCase properties like `innerHTML` must be escaped.\n * AngularJS uses the underscore (_) in front of a character to indicate that it is uppercase, so\n * `innerHTML` must be written as `ng-prop-inner_h_t_m_l=\"expression\"` (Note that this is just an\n * example, and for binding HTML {@link ngBindHtml} should be used.\n *\n * ## Security\n *\n * Binding expressions to arbitrary properties poses a security risk, as properties like `innerHTML`\n * can insert potentially dangerous HTML into the application, e.g. script tags that execute\n * malicious code.\n * For this reason, `ngProp` applies Strict Contextual Escaping with the {@link ng.$sce $sce service}.\n * This means vulnerable properties require their content to be \"trusted\", based on the\n * context of the property. For example, the `innerHTML` is in the `HTML` context, and the\n * `iframe.src` property is in the `RESOURCE_URL` context, which requires that values written to\n * this property are trusted as a `RESOURCE_URL`.\n *\n * This can be set explicitly by calling $sce.trustAs(type, value) on the value that is\n * trusted before passing it to the `ng-prop-*` directive. There are exist shorthand methods for\n * each context type in the form of {@link ng.$sce#trustAsResourceUrl $sce.trustAsResourceUrl()} et al.\n *\n * In some cases you can also rely upon automatic sanitization of untrusted values - see below.\n *\n * Based on the context, other options may exist to mark a value as trusted / configure the behavior\n * of {@link ng.$sce}. For example, to restrict the `RESOURCE_URL` context to specific origins, use\n * the {@link $sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList()}\n * and {@link $sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList()}.\n *\n * {@link ng.$sce#what-trusted-context-types-are-supported- Find out more about the different context types}.\n *\n * ### HTML Sanitization\n *\n * By default, `$sce` will throw an error if it detects untrusted HTML content, and will not bind the\n * content.\n * However, if you include the {@link ngSanitize ngSanitize module}, it will try to sanitize the\n * potentially dangerous HTML, e.g. strip non-trusted tags and attributes when binding to\n * `innerHTML`.\n *\n * @example\n * ### Binding to different contexts\n *\n * \n * \n * angular.module('exampleNgProp', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function($sce) {\n * this.safeContent = 'Safe content';\n * this.unsafeContent = '';\n * this.trustedUnsafeContent = $sce.trustAsHtml(this.unsafeContent);\n * }\n * });\n * \n * \n *
      \n *
      \n * Binding to a property without security context:\n *
      \n * innerText (safeContent)\n *
      \n *\n *
      \n * \"Safe\" content that requires a security context will throw because the contents could potentially be dangerous ...\n *
      \n * innerHTML (safeContent)\n *
      \n *\n *
      \n * ... so that actually dangerous content cannot be executed:\n *
      \n * innerHTML (unsafeContent)\n *
      \n *\n *
      \n * ... but unsafe Content that has been trusted explicitly works - only do this if you are 100% sure!\n *
      \n * innerHTML (trustedUnsafeContent)\n *
      \n *
      \n *
      \n * \n *
      \n *
      \n * \n * .prop-unit {\n * margin-bottom: 10px;\n * }\n *\n * .prop-binding {\n * min-height: 30px;\n * border: 1px solid blue;\n * }\n *\n * .prop-note {\n * font-family: Monospace;\n * }\n * \n *
      \n *\n *\n * @example\n * ### Binding to innerHTML with ngSanitize\n *\n * \n * \n * angular.module('exampleNgProp', ['ngSanitize'])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function($sce) {\n * this.safeContent = 'Safe content';\n * this.unsafeContent = '';\n * this.trustedUnsafeContent = $sce.trustAsHtml(this.unsafeContent);\n * }\n * });\n * \n * \n *
      \n *
      \n * \"Safe\" content will be sanitized ...\n *
      \n * innerHTML (safeContent)\n *
      \n *\n *
      \n * ... as will dangerous content:\n *
      \n * innerHTML (unsafeContent)\n *
      \n *\n *
      \n * ... and content that has been trusted explicitly works the same as without ngSanitize:\n *
      \n * innerHTML (trustedUnsafeContent)\n *
      \n *
      \n *
      \n * \n *
      \n *
      \n * \n * .prop-unit {\n * margin-bottom: 10px;\n * }\n *\n * .prop-binding {\n * min-height: 30px;\n * border: 1px solid blue;\n * }\n *\n * .prop-note {\n * font-family: Monospace;\n * }\n * \n *
      \n *\n */\n\n/** @ngdoc directive\n * @name ngOn\n * @restrict A\n * @element ANY\n *\n * @usage\n *\n * ```html\n * \n * \n * ```\n *\n * or with uppercase letters in property (e.g. \"eventName\"):\n *\n *\n * ```html\n * \n * \n * ```\n *\n * @description\n * The `ngOn` directive adds an event listener to a DOM element via\n * {@link angular.element angular.element().on()}, and evaluates an expression when the event is\n * fired.\n * `ngOn` allows adding listeners for arbitrary events by including\n * the event name in the attribute, e.g. `ng-on-drop=\"onDrop()\"` executes the 'onDrop()' expression\n * when the `drop` event is fired.\n *\n * AngularJS provides specific directives for many events, such as {@link ngClick}, so in most\n * cases it is not necessary to use `ngOn`. However, AngularJS does not support all events\n * (e.g. the `drop` event in the example above), and new events might be introduced in later DOM\n * standards.\n *\n * Another use-case for `ngOn` is listening to\n * [custom events](https://developer.mozilla.org/docs/Web/Guide/Events/Creating_and_triggering_events)\n * fired by\n * [custom elements](https://developer.mozilla.org/docs/Web/Web_Components/Using_custom_elements).\n *\n * ## Binding to camelCase properties\n *\n * Since HTML attributes are case-insensitive, camelCase properties like `myEvent` must be escaped.\n * AngularJS uses the underscore (_) in front of a character to indicate that it is uppercase, so\n * `myEvent` must be written as `ng-on-my_event=\"expression\"`.\n *\n * @example\n * ### Bind to built-in DOM events\n *\n * \n * \n * angular.module('exampleNgOn', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function() {\n * this.clickCount = 0;\n * this.mouseoverCount = 0;\n *\n * this.loadingState = 0;\n * }\n * });\n * \n * \n *
      \n * This is equivalent to `ngClick` and `ngMouseover`:
      \n * Click or mouseover
      \n * clickCount: {{$ctrl.clickCount}}
      \n * mouseover: {{$ctrl.mouseoverCount}}\n *\n *
      \n *\n * For the `error` and `load` event on images no built-in AngularJS directives exist:
      \n *
      \n *
      \n * Image is loading\n * Image load error\n * Image loaded successfully\n *
      \n *
      \n *
      \n * \n *
      \n *
      \n *
      \n *\n *\n * @example\n * ### Bind to custom DOM events\n *\n * \n * \n * angular.module('exampleNgOn', [])\n * .component('main', {\n * templateUrl: 'main.html',\n * controller: function() {\n * this.eventLog = '';\n *\n * this.listener = function($event) {\n * this.eventLog = 'Event with type \"' + $event.type + '\" fired at ' + $event.detail;\n * };\n * }\n * })\n * .component('childComponent', {\n * templateUrl: 'child.html',\n * controller: function($element) {\n * this.fireEvent = function() {\n * var event = new CustomEvent('customtype', { detail: new Date()});\n *\n * $element[0].dispatchEvent(event);\n * };\n * }\n * });\n * \n * \n *
      \n * Event log: {{$ctrl.eventLog}}\n *
      \n * \n \n * \n * \n *
      \n *
      \n *
      \n */\n\nvar $compileMinErr = minErr('$compile');\n\nfunction UNINITIALIZED_VALUE() {}\nvar _UNINITIALIZED_VALUE = new UNINITIALIZED_VALUE();\n\n/**\n * @ngdoc provider\n * @name $compileProvider\n *\n * @description\n */\n$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];\n/** @this */\nfunction $CompileProvider($provide, $$sanitizeUriProvider) {\n var hasDirectives = {},\n Suffix = 'Directive',\n COMMENT_DIRECTIVE_REGEXP = /^\\s*directive:\\s*([\\w-]+)\\s+(.*)$/,\n CLASS_DIRECTIVE_REGEXP = /(([\\w-]+)(?::([^;]+))?;?)/,\n ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),\n REQUIRE_PREFIX_REGEXP = /^(?:(\\^\\^?)?(\\?)?(\\^\\^?)?)?/;\n\n // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes\n // The assumption is that future DOM event attribute names will begin with\n // 'on' and be composed of only English letters.\n var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;\n var bindingCache = createMap();\n\n function parseIsolateBindings(scope, directiveName, isController) {\n var LOCAL_REGEXP = /^([@&]|[=<](\\*?))(\\??)\\s*([\\w$]*)$/;\n\n var bindings = createMap();\n\n forEach(scope, function(definition, scopeName) {\n definition = definition.trim();\n\n if (definition in bindingCache) {\n bindings[scopeName] = bindingCache[definition];\n return;\n }\n var match = definition.match(LOCAL_REGEXP);\n\n if (!match) {\n throw $compileMinErr('iscp',\n 'Invalid {3} for directive \\'{0}\\'.' +\n ' Definition: {... {1}: \\'{2}\\' ...}',\n directiveName, scopeName, definition,\n (isController ? 'controller bindings definition' :\n 'isolate scope definition'));\n }\n\n bindings[scopeName] = {\n mode: match[1][0],\n collection: match[2] === '*',\n optional: match[3] === '?',\n attrName: match[4] || scopeName\n };\n if (match[4]) {\n bindingCache[definition] = bindings[scopeName];\n }\n });\n\n return bindings;\n }\n\n function parseDirectiveBindings(directive, directiveName) {\n var bindings = {\n isolateScope: null,\n bindToController: null\n };\n if (isObject(directive.scope)) {\n if (directive.bindToController === true) {\n bindings.bindToController = parseIsolateBindings(directive.scope,\n directiveName, true);\n bindings.isolateScope = {};\n } else {\n bindings.isolateScope = parseIsolateBindings(directive.scope,\n directiveName, false);\n }\n }\n if (isObject(directive.bindToController)) {\n bindings.bindToController =\n parseIsolateBindings(directive.bindToController, directiveName, true);\n }\n if (bindings.bindToController && !directive.controller) {\n // There is no controller\n throw $compileMinErr('noctrl',\n 'Cannot bind to controller without directive \\'{0}\\'s controller.',\n directiveName);\n }\n return bindings;\n }\n\n function assertValidDirectiveName(name) {\n var letter = name.charAt(0);\n if (!letter || letter !== lowercase(letter)) {\n throw $compileMinErr('baddir', 'Directive/Component name \\'{0}\\' is invalid. The first character must be a lowercase letter', name);\n }\n if (name !== name.trim()) {\n throw $compileMinErr('baddir',\n 'Directive/Component name \\'{0}\\' is invalid. The name should not contain leading or trailing whitespaces',\n name);\n }\n }\n\n function getDirectiveRequire(directive) {\n var require = directive.require || (directive.controller && directive.name);\n\n if (!isArray(require) && isObject(require)) {\n forEach(require, function(value, key) {\n var match = value.match(REQUIRE_PREFIX_REGEXP);\n var name = value.substring(match[0].length);\n if (!name) require[key] = match[0] + key;\n });\n }\n\n return require;\n }\n\n function getDirectiveRestrict(restrict, name) {\n if (restrict && !(isString(restrict) && /[EACM]/.test(restrict))) {\n throw $compileMinErr('badrestrict',\n 'Restrict property \\'{0}\\' of directive \\'{1}\\' is invalid',\n restrict,\n name);\n }\n\n return restrict || 'EA';\n }\n\n /**\n * @ngdoc method\n * @name $compileProvider#directive\n * @kind function\n *\n * @description\n * Register a new directive with the compiler.\n *\n * @param {string|Object} name Name of the directive in camel-case (i.e. `ngBind` which will match\n * as `ng-bind`), or an object map of directives where the keys are the names and the values\n * are the factories.\n * @param {Function|Array} directiveFactory An injectable directive factory function. See the\n * {@link guide/directive directive guide} and the {@link $compile compile API} for more info.\n * @returns {ng.$compileProvider} Self for chaining.\n */\n this.directive = function registerDirective(name, directiveFactory) {\n assertArg(name, 'name');\n assertNotHasOwnProperty(name, 'directive');\n if (isString(name)) {\n assertValidDirectiveName(name);\n assertArg(directiveFactory, 'directiveFactory');\n if (!hasDirectives.hasOwnProperty(name)) {\n hasDirectives[name] = [];\n $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',\n function($injector, $exceptionHandler) {\n var directives = [];\n forEach(hasDirectives[name], function(directiveFactory, index) {\n try {\n var directive = $injector.invoke(directiveFactory);\n if (isFunction(directive)) {\n directive = { compile: valueFn(directive) };\n } else if (!directive.compile && directive.link) {\n directive.compile = valueFn(directive.link);\n }\n directive.priority = directive.priority || 0;\n directive.index = index;\n directive.name = directive.name || name;\n directive.require = getDirectiveRequire(directive);\n directive.restrict = getDirectiveRestrict(directive.restrict, name);\n directive.$$moduleName = directiveFactory.$$moduleName;\n directives.push(directive);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n return directives;\n }]);\n }\n hasDirectives[name].push(directiveFactory);\n } else {\n forEach(name, reverseParams(registerDirective));\n }\n return this;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#component\n * @module ng\n * @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match ``),\n * or an object map of components where the keys are the names and the values are the component definition objects.\n * @param {Object} options Component definition object (a simplified\n * {@link ng.$compile#directive-definition-object directive definition object}),\n * with the following properties (all optional):\n *\n * - `controller` – `{(string|function()=}` – controller constructor function that should be\n * associated with newly created scope or the name of a {@link ng.$compile#-controller-\n * registered controller} if passed as a string. An empty `noop` function by default.\n * - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.\n * If present, the controller will be published to scope under the `controllerAs` name.\n * If not present, this will default to be `$ctrl`.\n * - `template` – `{string=|function()=}` – html template as a string or a function that\n * returns an html template as a string which should be used as the contents of this component.\n * Empty string by default.\n *\n * If `template` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html\n * template that should be used as the contents of this component.\n *\n * If `templateUrl` is a function, then it is {@link auto.$injector#invoke injected} with\n * the following locals:\n *\n * - `$element` - Current element\n * - `$attrs` - Current attributes object for the element\n *\n * - `bindings` – `{object=}` – defines bindings between DOM attributes and component properties.\n * Component properties are always bound to the component controller and not to the scope.\n * See {@link ng.$compile#-bindtocontroller- `bindToController`}.\n * - `transclude` – `{boolean=}` – whether {@link $compile#transclusion content transclusion} is enabled.\n * Disabled by default.\n * - `require` - `{Object=}` - requires the controllers of other directives and binds them to\n * this component's controller. The object keys specify the property names under which the required\n * controllers (object values) will be bound. See {@link ng.$compile#-require- `require`}.\n * - `$...` – additional properties to attach to the directive factory function and the controller\n * constructor function. (This is used by the component router to annotate)\n *\n * @returns {ng.$compileProvider} the compile provider itself, for chaining of function calls.\n * @description\n * Register a **component definition** with the compiler. This is a shorthand for registering a special\n * type of directive, which represents a self-contained UI component in your application. Such components\n * are always isolated (i.e. `scope: {}`) and are always restricted to elements (i.e. `restrict: 'E'`).\n *\n * Component definitions are very simple and do not require as much configuration as defining general\n * directives. Component definitions usually consist only of a template and a controller backing it.\n *\n * In order to make the definition easier, components enforce best practices like use of `controllerAs`,\n * `bindToController`. They always have **isolate scope** and are restricted to elements.\n *\n * Here are a few examples of how you would usually define components:\n *\n * ```js\n * var myMod = angular.module(...);\n * myMod.component('myComp', {\n * template: '
      My name is {{$ctrl.name}}
      ',\n * controller: function() {\n * this.name = 'shahar';\n * }\n * });\n *\n * myMod.component('myComp', {\n * template: '
      My name is {{$ctrl.name}}
      ',\n * bindings: {name: '@'}\n * });\n *\n * myMod.component('myComp', {\n * templateUrl: 'views/my-comp.html',\n * controller: 'MyCtrl',\n * controllerAs: 'ctrl',\n * bindings: {name: '@'}\n * });\n *\n * ```\n * For more examples, and an in-depth guide, see the {@link guide/component component guide}.\n *\n *
      \n * See also {@link ng.$compileProvider#directive $compileProvider.directive()}.\n */\n this.component = function registerComponent(name, options) {\n if (!isString(name)) {\n forEach(name, reverseParams(bind(this, registerComponent)));\n return this;\n }\n\n var controller = options.controller || function() {};\n\n function factory($injector) {\n function makeInjectable(fn) {\n if (isFunction(fn) || isArray(fn)) {\n return /** @this */ function(tElement, tAttrs) {\n return $injector.invoke(fn, this, {$element: tElement, $attrs: tAttrs});\n };\n } else {\n return fn;\n }\n }\n\n var template = (!options.template && !options.templateUrl ? '' : options.template);\n var ddo = {\n controller: controller,\n controllerAs: identifierForController(options.controller) || options.controllerAs || '$ctrl',\n template: makeInjectable(template),\n templateUrl: makeInjectable(options.templateUrl),\n transclude: options.transclude,\n scope: {},\n bindToController: options.bindings || {},\n restrict: 'E',\n require: options.require\n };\n\n // Copy annotations (starting with $) over to the DDO\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') ddo[key] = val;\n });\n\n return ddo;\n }\n\n // TODO(pete) remove the following `forEach` before we release 1.6.0\n // The component-router@0.2.0 looks for the annotations on the controller constructor\n // Nothing in AngularJS looks for annotations on the factory function but we can't remove\n // it from 1.5.x yet.\n\n // Copy any annotation properties (starting with $) over to the factory and controller constructor functions\n // These could be used by libraries such as the new component router\n forEach(options, function(val, key) {\n if (key.charAt(0) === '$') {\n factory[key] = val;\n // Don't try to copy over annotations to named controller\n if (isFunction(controller)) controller[key] = val;\n }\n });\n\n factory.$inject = ['$injector'];\n\n return this.directive(name, factory);\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationTrustedUrlList\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at preventing XSS attacks via html links.\n *\n * Any url about to be assigned to a[href] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationTrustedUrlList`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationTrustedUrlList = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.aHrefSanitizationTrustedUrlList(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.aHrefSanitizationTrustedUrlList();\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#aHrefSanitizationWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $compileProvider#aHrefSanitizationTrustedUrlList\n * aHrefSanitizationTrustedUrlList} instead.\n */\n Object.defineProperty(this, 'aHrefSanitizationWhitelist', {\n get: function() {\n return this.aHrefSanitizationTrustedUrlList;\n },\n set: function(value) {\n this.aHrefSanitizationTrustedUrlList = value;\n }\n });\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationTrustedUrlList\n * @kind function\n *\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via html links.\n *\n * Any url about to be assigned to img[src] via data-binding is first normalized and turned into\n * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationTrustedUrlList`\n * regular expression. If a match is found, the original url is written into the dom. Otherwise,\n * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationTrustedUrlList = function(regexp) {\n if (isDefined(regexp)) {\n $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList(regexp);\n return this;\n } else {\n return $$sanitizeUriProvider.imgSrcSanitizationTrustedUrlList();\n }\n };\n\n\n /**\n * @ngdoc method\n * @name $compileProvider#imgSrcSanitizationWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $compileProvider#imgSrcSanitizationTrustedUrlList\n * imgSrcSanitizationTrustedUrlList} instead.\n */\n Object.defineProperty(this, 'imgSrcSanitizationWhitelist', {\n get: function() {\n return this.imgSrcSanitizationTrustedUrlList;\n },\n set: function(value) {\n this.imgSrcSanitizationTrustedUrlList = value;\n }\n });\n\n /**\n * @ngdoc method\n * @name $compileProvider#debugInfoEnabled\n *\n * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the\n * current debugInfoEnabled state\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable/disable various debug runtime information in the compiler such as adding\n * binding information and a reference to the current scope on to DOM elements.\n * If enabled, the compiler will add the following to DOM elements that have been bound to the scope\n * * `ng-binding` CSS class\n * * `ng-scope` and `ng-isolated-scope` CSS classes\n * * `$binding` data property containing an array of the binding expressions\n * * Data properties used by the {@link angular.element#methods `scope()`/`isolateScope()` methods} to return\n * the element's scope.\n * * Placeholder comments will contain information about what directive and binding caused the placeholder.\n * E.g. ``.\n *\n * You may want to disable this in production for a significant performance boost. See\n * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.\n *\n * The default value is true.\n */\n var debugInfoEnabled = true;\n this.debugInfoEnabled = function(enabled) {\n if (isDefined(enabled)) {\n debugInfoEnabled = enabled;\n return this;\n }\n return debugInfoEnabled;\n };\n\n /**\n * @ngdoc method\n * @name $compileProvider#strictComponentBindingsEnabled\n *\n * @param {boolean=} enabled update the strictComponentBindingsEnabled state if provided,\n * otherwise return the current strictComponentBindingsEnabled state.\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n *\n * @kind function\n *\n * @description\n * Call this method to enable / disable the strict component bindings check. If enabled, the\n * compiler will enforce that all scope / controller bindings of a\n * {@link $compileProvider#directive directive} / {@link $compileProvider#component component}\n * that are not set as optional with `?`, must be provided when the directive is instantiated.\n * If not provided, the compiler will throw the\n * {@link error/$compile/missingattr $compile:missingattr error}.\n *\n * The default value is false.\n */\n var strictComponentBindingsEnabled = false;\n this.strictComponentBindingsEnabled = function(enabled) {\n if (isDefined(enabled)) {\n strictComponentBindingsEnabled = enabled;\n return this;\n }\n return strictComponentBindingsEnabled;\n };\n\n var TTL = 10;\n /**\n * @ngdoc method\n * @name $compileProvider#onChangesTtl\n * @description\n *\n * Sets the number of times `$onChanges` hooks can trigger new changes before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result\n * in several iterations of calls to these hooks. However if an application needs more than the default 10\n * iterations to stabilize then you should investigate what is causing the model to continuously change during\n * the `$onChanges` hook execution.\n *\n * Increasing the TTL could have performance implications, so you should not change it without proper justification.\n *\n * @param {number} limit The number of `$onChanges` hook iterations.\n * @returns {number|object} the current limit (or `this` if called as a setter for chaining)\n */\n this.onChangesTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n return this;\n }\n return TTL;\n };\n\n var commentDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#commentDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on comments should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on comments for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check comments when looking for directives.\n * This should however only be used if you are sure that no comment directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on comments\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.commentDirectivesEnabled = function(value) {\n if (arguments.length) {\n commentDirectivesEnabledConfig = value;\n return this;\n }\n return commentDirectivesEnabledConfig;\n };\n\n\n var cssClassDirectivesEnabledConfig = true;\n /**\n * @ngdoc method\n * @name $compileProvider#cssClassDirectivesEnabled\n * @description\n *\n * It indicates to the compiler\n * whether or not directives on element classes should be compiled.\n * Defaults to `true`.\n *\n * Calling this function with false disables the compilation of directives\n * on element classes for the whole application.\n * This results in a compilation performance gain,\n * as the compiler doesn't have to check element classes when looking for directives.\n * This should however only be used if you are sure that no class directives are used in\n * the application (including any 3rd party directives).\n *\n * @param {boolean} enabled `false` if the compiler may ignore directives on element classes\n * @returns {boolean|object} the current value (or `this` if called as a setter for chaining)\n */\n this.cssClassDirectivesEnabled = function(value) {\n if (arguments.length) {\n cssClassDirectivesEnabledConfig = value;\n return this;\n }\n return cssClassDirectivesEnabledConfig;\n };\n\n\n /**\n * The security context of DOM Properties.\n * @private\n */\n var PROP_CONTEXTS = createMap();\n\n /**\n * @ngdoc method\n * @name $compileProvider#addPropertySecurityContext\n * @description\n *\n * Defines the security context for DOM properties bound by ng-prop-*.\n *\n * @param {string} elementName The element name or '*' to match any element.\n * @param {string} propertyName The DOM property name.\n * @param {string} ctx The {@link $sce} security context in which this value is safe for use, e.g. `$sce.URL`\n * @returns {object} `this` for chaining\n */\n this.addPropertySecurityContext = function(elementName, propertyName, ctx) {\n var key = (elementName.toLowerCase() + '|' + propertyName.toLowerCase());\n\n if (key in PROP_CONTEXTS && PROP_CONTEXTS[key] !== ctx) {\n throw $compileMinErr('ctxoverride', 'Property context \\'{0}.{1}\\' already set to \\'{2}\\', cannot override to \\'{3}\\'.', elementName, propertyName, PROP_CONTEXTS[key], ctx);\n }\n\n PROP_CONTEXTS[key] = ctx;\n return this;\n };\n\n /* Default property contexts.\n *\n * Copy of https://github.com/angular/angular/blob/6.0.6/packages/compiler/src/schema/dom_security_schema.ts#L31-L58\n * Changing:\n * - SecurityContext.* => SCE_CONTEXTS/$sce.*\n * - STYLE => CSS\n * - various URL => MEDIA_URL\n * - *|formAction, form|action URL => RESOURCE_URL (like the attribute)\n */\n (function registerNativePropertyContexts() {\n function registerContext(ctx, values) {\n forEach(values, function(v) { PROP_CONTEXTS[v.toLowerCase()] = ctx; });\n }\n\n registerContext(SCE_CONTEXTS.HTML, [\n 'iframe|srcdoc',\n '*|innerHTML',\n '*|outerHTML'\n ]);\n registerContext(SCE_CONTEXTS.CSS, ['*|style']);\n registerContext(SCE_CONTEXTS.URL, [\n 'area|href', 'area|ping',\n 'a|href', 'a|ping',\n 'blockquote|cite',\n 'body|background',\n 'del|cite',\n 'input|src',\n 'ins|cite',\n 'q|cite'\n ]);\n registerContext(SCE_CONTEXTS.MEDIA_URL, [\n 'audio|src',\n 'img|src', 'img|srcset',\n 'source|src', 'source|srcset',\n 'track|src',\n 'video|src', 'video|poster'\n ]);\n registerContext(SCE_CONTEXTS.RESOURCE_URL, [\n '*|formAction',\n 'applet|code', 'applet|codebase',\n 'base|href',\n 'embed|src',\n 'frame|src',\n 'form|action',\n 'head|profile',\n 'html|manifest',\n 'iframe|src',\n 'link|href',\n 'media|src',\n 'object|codebase', 'object|data',\n 'script|src'\n ]);\n })();\n\n\n this.$get = [\n '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',\n '$controller', '$rootScope', '$sce', '$animate',\n function($injector, $interpolate, $exceptionHandler, $templateRequest, $parse,\n $controller, $rootScope, $sce, $animate) {\n\n var SIMPLE_ATTR_NAME = /^\\w/;\n var specialAttrHolder = window.document.createElement('div');\n\n\n var commentDirectivesEnabled = commentDirectivesEnabledConfig;\n var cssClassDirectivesEnabled = cssClassDirectivesEnabledConfig;\n\n\n var onChangesTtl = TTL;\n // The onChanges hooks should all be run together in a single digest\n // When changes occur, the call to trigger their hooks will be added to this queue\n var onChangesQueue;\n\n // This function is called in a $$postDigest to trigger all the onChanges hooks in a single digest\n function flushOnChangesQueue() {\n try {\n if (!(--onChangesTtl)) {\n // We have hit the TTL limit so reset everything\n onChangesQueue = undefined;\n throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\\n', TTL);\n }\n // We must run this hook in an apply since the $$postDigest runs outside apply\n $rootScope.$apply(function() {\n for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {\n try {\n onChangesQueue[i]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n // Reset the queue to trigger a new schedule next time there is a change\n onChangesQueue = undefined;\n });\n } finally {\n onChangesTtl++;\n }\n }\n\n\n function sanitizeSrcset(value, invokeType) {\n if (!value) {\n return value;\n }\n if (!isString(value)) {\n throw $compileMinErr('srcset', 'Can\\'t pass trusted values to `{0}`: \"{1}\"', invokeType, value.toString());\n }\n\n // Such values are a bit too complex to handle automatically inside $sce.\n // Instead, we sanitize each of the URIs individually, which works, even dynamically.\n\n // It's not possible to work around this using `$sce.trustAsMediaUrl`.\n // If you want to programmatically set explicitly trusted unsafe URLs, you should use\n // `$sce.trustAsHtml` on the whole `img` tag and inject it into the DOM using the\n // `ng-bind-html` directive.\n\n var result = '';\n\n // first check if there are spaces because it's not the same pattern\n var trimmedSrcset = trim(value);\n // ( 999x ,| 999w ,| ,|, )\n var srcPattern = /(\\s+\\d+x\\s*,|\\s+\\d+w\\s*,|\\s+,|,\\s+)/;\n var pattern = /\\s/.test(trimmedSrcset) ? srcPattern : /(,)/;\n\n // split srcset into tuple of uri and descriptor except for the last item\n var rawUris = trimmedSrcset.split(pattern);\n\n // for each tuples\n var nbrUrisWith2parts = Math.floor(rawUris.length / 2);\n for (var i = 0; i < nbrUrisWith2parts; i++) {\n var innerIdx = i * 2;\n // sanitize the uri\n result += $sce.getTrustedMediaUrl(trim(rawUris[innerIdx]));\n // add the descriptor\n result += ' ' + trim(rawUris[innerIdx + 1]);\n }\n\n // split the last item into uri and descriptor\n var lastTuple = trim(rawUris[i * 2]).split(/\\s/);\n\n // sanitize the last uri\n result += $sce.getTrustedMediaUrl(trim(lastTuple[0]));\n\n // and add the last descriptor if any\n if (lastTuple.length === 2) {\n result += (' ' + trim(lastTuple[1]));\n }\n return result;\n }\n\n\n function Attributes(element, attributesToCopy) {\n if (attributesToCopy) {\n var keys = Object.keys(attributesToCopy);\n var i, l, key;\n\n for (i = 0, l = keys.length; i < l; i++) {\n key = keys[i];\n this[key] = attributesToCopy[key];\n }\n } else {\n this.$attr = {};\n }\n\n this.$$element = element;\n }\n\n Attributes.prototype = {\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$normalize\n * @kind function\n *\n * @description\n * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or\n * `data-`) to its normalized, camelCase form.\n *\n * Also there is special case for Moz prefix starting with upper case letter.\n *\n * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}\n *\n * @param {string} name Name to normalize\n */\n $normalize: directiveNormalize,\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$addClass\n * @kind function\n *\n * @description\n * Adds the CSS class value specified by the classVal parameter to the element. If animations\n * are enabled then an animation will be triggered for the class addition.\n *\n * @param {string} classVal The className value that will be added to the element\n */\n $addClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.addClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$removeClass\n * @kind function\n *\n * @description\n * Removes the CSS class value specified by the classVal parameter from the element. If\n * animations are enabled then an animation will be triggered for the class removal.\n *\n * @param {string} classVal The className value that will be removed from the element\n */\n $removeClass: function(classVal) {\n if (classVal && classVal.length > 0) {\n $animate.removeClass(this.$$element, classVal);\n }\n },\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$updateClass\n * @kind function\n *\n * @description\n * Adds and removes the appropriate CSS class values to the element based on the difference\n * between the new and old CSS class values (specified as newClasses and oldClasses).\n *\n * @param {string} newClasses The current CSS className value\n * @param {string} oldClasses The former CSS className value\n */\n $updateClass: function(newClasses, oldClasses) {\n var toAdd = tokenDifference(newClasses, oldClasses);\n if (toAdd && toAdd.length) {\n $animate.addClass(this.$$element, toAdd);\n }\n\n var toRemove = tokenDifference(oldClasses, newClasses);\n if (toRemove && toRemove.length) {\n $animate.removeClass(this.$$element, toRemove);\n }\n },\n\n /**\n * Set a normalized attribute on the element in a way such that all directives\n * can share the attribute. This function properly handles boolean attributes.\n * @param {string} key Normalized key. (ie ngAttribute)\n * @param {string|boolean} value The value to set. If `null` attribute will be deleted.\n * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.\n * Defaults to true.\n * @param {string=} attrName Optional none normalized name. Defaults to key.\n */\n $set: function(key, value, writeAttr, attrName) {\n // TODO: decide whether or not to throw an error if \"class\"\n // is set through this function since it may cause $updateClass to\n // become unstable.\n\n var node = this.$$element[0],\n booleanKey = getBooleanAttrName(node, key),\n aliasedKey = getAliasedAttrName(key),\n observer = key,\n nodeName;\n\n if (booleanKey) {\n this.$$element.prop(key, value);\n attrName = booleanKey;\n } else if (aliasedKey) {\n this[aliasedKey] = value;\n observer = aliasedKey;\n }\n\n this[key] = value;\n\n // translate normalized key to actual key\n if (attrName) {\n this.$attr[key] = attrName;\n } else {\n attrName = this.$attr[key];\n if (!attrName) {\n this.$attr[key] = attrName = snake_case(key, '-');\n }\n }\n\n nodeName = nodeName_(this.$$element);\n\n // Sanitize img[srcset] values.\n if (nodeName === 'img' && key === 'srcset') {\n this[key] = value = sanitizeSrcset(value, '$set(\\'srcset\\', value)');\n }\n\n if (writeAttr !== false) {\n if (value === null || isUndefined(value)) {\n this.$$element.removeAttr(attrName);\n } else {\n if (SIMPLE_ATTR_NAME.test(attrName)) {\n // jQuery skips special boolean attrs treatment in XML nodes for\n // historical reasons and hence AngularJS cannot freely call\n // `.attr(attrName, false) with such attributes. To avoid issues\n // in XHTML, call `removeAttr` in such cases instead.\n // See https://github.com/jquery/jquery/issues/4249\n if (booleanKey && value === false) {\n this.$$element.removeAttr(attrName);\n } else {\n this.$$element.attr(attrName, value);\n }\n } else {\n setSpecialAttr(this.$$element[0], attrName, value);\n }\n }\n }\n\n // fire observers\n var $$observers = this.$$observers;\n if ($$observers) {\n forEach($$observers[observer], function(fn) {\n try {\n fn(value);\n } catch (e) {\n $exceptionHandler(e);\n }\n });\n }\n },\n\n\n /**\n * @ngdoc method\n * @name $compile.directive.Attributes#$observe\n * @kind function\n *\n * @description\n * Observes an interpolated attribute.\n *\n * The observer function will be invoked once during the next `$digest` following\n * compilation. The observer is then invoked whenever the interpolated value\n * changes.\n *\n * @param {string} key Normalized key. (ie ngAttribute) .\n * @param {function(interpolatedValue)} fn Function that will be called whenever\n the interpolated value of the attribute changes.\n * See the {@link guide/interpolation#how-text-and-attribute-bindings-work Interpolation\n * guide} for more info.\n * @returns {function()} Returns a deregistration function for this observer.\n */\n $observe: function(key, fn) {\n var attrs = this,\n $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),\n listeners = ($$observers[key] || ($$observers[key] = []));\n\n listeners.push(fn);\n $rootScope.$evalAsync(function() {\n if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {\n // no one registered attribute interpolation function, so lets call it manually\n fn(attrs[key]);\n }\n });\n\n return function() {\n arrayRemove(listeners, fn);\n };\n }\n };\n\n function setSpecialAttr(element, attrName, value) {\n // Attributes names that do not start with letters (such as `(click)`) cannot be set using `setAttribute`\n // so we have to jump through some hoops to get such an attribute\n // https://github.com/angular/angular.js/pull/13318\n specialAttrHolder.innerHTML = '';\n var attributes = specialAttrHolder.firstChild.attributes;\n var attribute = attributes[0];\n // We have to remove the attribute from its container element before we can add it to the destination element\n attributes.removeNamedItem(attribute.name);\n attribute.value = value;\n element.attributes.setNamedItem(attribute);\n }\n\n function safeAddClass($element, className) {\n try {\n $element.addClass(className);\n } catch (e) {\n // ignore, since it means that we are trying to set class on\n // SVG element, where class name is read-only.\n }\n }\n\n\n var startSymbol = $interpolate.startSymbol(),\n endSymbol = $interpolate.endSymbol(),\n denormalizeTemplate = (startSymbol === '{{' && endSymbol === '}}')\n ? identity\n : function denormalizeTemplate(template) {\n return template.replace(/\\{\\{/g, startSymbol).replace(/}}/g, endSymbol);\n },\n NG_PREFIX_BINDING = /^ng(Attr|Prop|On)([A-Z].*)$/;\n var MULTI_ELEMENT_DIR_RE = /^(.+)Start$/;\n\n compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {\n var bindings = $element.data('$binding') || [];\n\n if (isArray(binding)) {\n bindings = bindings.concat(binding);\n } else {\n bindings.push(binding);\n }\n\n $element.data('$binding', bindings);\n } : noop;\n\n compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {\n safeAddClass($element, 'ng-binding');\n } : noop;\n\n compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {\n var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';\n $element.data(dataName, scope);\n } : noop;\n\n compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {\n safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');\n } : noop;\n\n compile.$$createComment = function(directiveName, comment) {\n var content = '';\n if (debugInfoEnabled) {\n content = ' ' + (directiveName || '') + ': ';\n if (comment) content += comment + ' ';\n }\n return window.document.createComment(content);\n };\n\n return compile;\n\n //================================\n\n function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,\n previousCompileContext) {\n if (!($compileNodes instanceof jqLite)) {\n // jquery always rewraps, whereas we need to preserve the original selector so that we can\n // modify it.\n $compileNodes = jqLite($compileNodes);\n }\n var compositeLinkFn =\n compileNodes($compileNodes, transcludeFn, $compileNodes,\n maxPriority, ignoreDirective, previousCompileContext);\n compile.$$addScopeClass($compileNodes);\n var namespace = null;\n return function publicLinkFn(scope, cloneConnectFn, options) {\n if (!$compileNodes) {\n throw $compileMinErr('multilink', 'This element has already been linked.');\n }\n assertArg(scope, 'scope');\n\n if (previousCompileContext && previousCompileContext.needsNewScope) {\n // A parent directive did a replace and a directive on this element asked\n // for transclusion, which caused us to lose a layer of element on which\n // we could hold the new transclusion scope, so we will create it manually\n // here.\n scope = scope.$parent.$new();\n }\n\n options = options || {};\n var parentBoundTranscludeFn = options.parentBoundTranscludeFn,\n transcludeControllers = options.transcludeControllers,\n futureParentElement = options.futureParentElement;\n\n // When `parentBoundTranscludeFn` is passed, it is a\n // `controllersBoundTransclude` function (it was previously passed\n // as `transclude` to directive.link) so we must unwrap it to get\n // its `boundTranscludeFn`\n if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {\n parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;\n }\n\n if (!namespace) {\n namespace = detectNamespaceForChildElements(futureParentElement);\n }\n var $linkNode;\n if (namespace !== 'html') {\n // When using a directive with replace:true and templateUrl the $compileNodes\n // (or a child element inside of them)\n // might change, so we need to recreate the namespace adapted compileNodes\n // for call to the link function.\n // Note: This will already clone the nodes...\n $linkNode = jqLite(\n wrapTemplate(namespace, jqLite('
      ').append($compileNodes).html())\n );\n } else if (cloneConnectFn) {\n // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart\n // and sometimes changes the structure of the DOM.\n $linkNode = JQLitePrototype.clone.call($compileNodes);\n } else {\n $linkNode = $compileNodes;\n }\n\n if (transcludeControllers) {\n for (var controllerName in transcludeControllers) {\n $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);\n }\n }\n\n compile.$$addScopeInfo($linkNode, scope);\n\n if (cloneConnectFn) cloneConnectFn($linkNode, scope);\n if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);\n\n if (!cloneConnectFn) {\n $compileNodes = compositeLinkFn = null;\n }\n return $linkNode;\n };\n }\n\n function detectNamespaceForChildElements(parentElement) {\n // TODO: Make this detect MathML as well...\n var node = parentElement && parentElement[0];\n if (!node) {\n return 'html';\n } else {\n return nodeName_(node) !== 'foreignobject' && toString.call(node).match(/SVG/) ? 'svg' : 'html';\n }\n }\n\n /**\n * Compile function matches each node in nodeList against the directives. Once all directives\n * for a particular node are collected their compile functions are executed. The compile\n * functions return values - the linking functions - are combined into a composite linking\n * function, which is the a linking function for the node.\n *\n * @param {NodeList} nodeList an array of nodes or NodeList to compile\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new child of the transcluded parent scope.\n * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then\n * the rootElement must be set the jqLite collection of the compile root. This is\n * needed so that the jqLite collection items can be replaced with widgets.\n * @param {number=} maxPriority Max directive priority.\n * @returns {Function} A composite linking function of all of the matched directives or null.\n */\n function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,\n previousCompileContext) {\n var linkFns = [],\n // `nodeList` can be either an element's `.childNodes` (live NodeList)\n // or a jqLite/jQuery collection or an array\n notLiveList = isArray(nodeList) || (nodeList instanceof jqLite),\n attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;\n\n\n for (var i = 0; i < nodeList.length; i++) {\n attrs = new Attributes();\n\n // Support: IE 11 only\n // Workaround for #11781 and #14924\n if (msie === 11) {\n mergeConsecutiveTextNodes(nodeList, i, notLiveList);\n }\n\n // We must always refer to `nodeList[i]` hereafter,\n // since the nodes can be replaced underneath us.\n directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,\n ignoreDirective);\n\n nodeLinkFn = (directives.length)\n ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,\n null, [], [], previousCompileContext)\n : null;\n\n if (nodeLinkFn && nodeLinkFn.scope) {\n compile.$$addScopeClass(attrs.$$element);\n }\n\n childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||\n !(childNodes = nodeList[i].childNodes) ||\n !childNodes.length)\n ? null\n : compileNodes(childNodes,\n nodeLinkFn ? (\n (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)\n && nodeLinkFn.transclude) : transcludeFn);\n\n if (nodeLinkFn || childLinkFn) {\n linkFns.push(i, nodeLinkFn, childLinkFn);\n linkFnFound = true;\n nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;\n }\n\n //use the previous context only for the first element in the virtual group\n previousCompileContext = null;\n }\n\n // return a linking function if we have found anything, null otherwise\n return linkFnFound ? compositeLinkFn : null;\n\n function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {\n var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;\n var stableNodeList;\n\n\n if (nodeLinkFnFound) {\n // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our\n // offsets don't get screwed up\n var nodeListLength = nodeList.length;\n stableNodeList = new Array(nodeListLength);\n\n // create a sparse array by only copying the elements which have a linkFn\n for (i = 0; i < linkFns.length; i += 3) {\n idx = linkFns[i];\n stableNodeList[idx] = nodeList[idx];\n }\n } else {\n stableNodeList = nodeList;\n }\n\n for (i = 0, ii = linkFns.length; i < ii;) {\n node = stableNodeList[linkFns[i++]];\n nodeLinkFn = linkFns[i++];\n childLinkFn = linkFns[i++];\n\n if (nodeLinkFn) {\n if (nodeLinkFn.scope) {\n childScope = scope.$new();\n compile.$$addScopeInfo(jqLite(node), childScope);\n } else {\n childScope = scope;\n }\n\n if (nodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(\n scope, nodeLinkFn.transclude, parentBoundTranscludeFn);\n\n } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {\n childBoundTranscludeFn = parentBoundTranscludeFn;\n\n } else if (!parentBoundTranscludeFn && transcludeFn) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);\n\n } else {\n childBoundTranscludeFn = null;\n }\n\n nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn);\n\n } else if (childLinkFn) {\n childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);\n }\n }\n }\n }\n\n function mergeConsecutiveTextNodes(nodeList, idx, notLiveList) {\n var node = nodeList[idx];\n var parent = node.parentNode;\n var sibling;\n\n if (node.nodeType !== NODE_TYPE_TEXT) {\n return;\n }\n\n while (true) {\n sibling = parent ? node.nextSibling : nodeList[idx + 1];\n if (!sibling || sibling.nodeType !== NODE_TYPE_TEXT) {\n break;\n }\n\n node.nodeValue = node.nodeValue + sibling.nodeValue;\n\n if (sibling.parentNode) {\n sibling.parentNode.removeChild(sibling);\n }\n if (notLiveList && sibling === nodeList[idx + 1]) {\n nodeList.splice(idx + 1, 1);\n }\n }\n }\n\n function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {\n function boundTranscludeFn(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {\n\n if (!transcludedScope) {\n transcludedScope = scope.$new(false, containingScope);\n transcludedScope.$$transcluded = true;\n }\n\n return transcludeFn(transcludedScope, cloneFn, {\n parentBoundTranscludeFn: previousBoundTranscludeFn,\n transcludeControllers: controllers,\n futureParentElement: futureParentElement\n });\n }\n\n // We need to attach the transclusion slots onto the `boundTranscludeFn`\n // so that they are available inside the `controllersBoundTransclude` function\n var boundSlots = boundTranscludeFn.$$slots = createMap();\n for (var slotName in transcludeFn.$$slots) {\n if (transcludeFn.$$slots[slotName]) {\n boundSlots[slotName] = createBoundTranscludeFn(scope, transcludeFn.$$slots[slotName], previousBoundTranscludeFn);\n } else {\n boundSlots[slotName] = null;\n }\n }\n\n return boundTranscludeFn;\n }\n\n /**\n * Looks for directives on the given node and adds them to the directive collection which is\n * sorted.\n *\n * @param node Node to search.\n * @param directives An array to which the directives are added to. This array is sorted before\n * the function returns.\n * @param attrs The shared attrs object which is used to populate the normalized attributes.\n * @param {number=} maxPriority Max directive priority.\n */\n function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n var nodeType = node.nodeType,\n attrsMap = attrs.$attr,\n match,\n nodeName,\n className;\n\n switch (nodeType) {\n case NODE_TYPE_ELEMENT: /* Element */\n\n nodeName = nodeName_(node);\n\n // use the node name: \n addDirective(directives,\n directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective);\n\n // iterate over the attributes\n for (var attr, name, nName, value, ngPrefixMatch, nAttrs = node.attributes,\n j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {\n var attrStartName = false;\n var attrEndName = false;\n\n var isNgAttr = false, isNgProp = false, isNgEvent = false;\n var multiElementMatch;\n\n attr = nAttrs[j];\n name = attr.name;\n value = attr.value;\n\n nName = directiveNormalize(name.toLowerCase());\n\n // Support ng-attr-*, ng-prop-* and ng-on-*\n if ((ngPrefixMatch = nName.match(NG_PREFIX_BINDING))) {\n isNgAttr = ngPrefixMatch[1] === 'Attr';\n isNgProp = ngPrefixMatch[1] === 'Prop';\n isNgEvent = ngPrefixMatch[1] === 'On';\n\n // Normalize the non-prefixed name\n name = name.replace(PREFIX_REGEXP, '')\n .toLowerCase()\n .substr(4 + ngPrefixMatch[1].length).replace(/_(.)/g, function(match, letter) {\n return letter.toUpperCase();\n });\n\n // Support *-start / *-end multi element directives\n } else if ((multiElementMatch = nName.match(MULTI_ELEMENT_DIR_RE)) && directiveIsMultiElement(multiElementMatch[1])) {\n attrStartName = name;\n attrEndName = name.substr(0, name.length - 5) + 'end';\n name = name.substr(0, name.length - 6);\n }\n\n if (isNgProp || isNgEvent) {\n attrs[nName] = value;\n attrsMap[nName] = attr.name;\n\n if (isNgProp) {\n addPropertyDirective(node, directives, nName, name);\n } else {\n addEventDirective(directives, nName, name);\n }\n } else {\n // Update nName for cases where a prefix was removed\n // NOTE: the .toLowerCase() is unnecessary and causes https://github.com/angular/angular.js/issues/16624 for ng-attr-*\n nName = directiveNormalize(name.toLowerCase());\n attrsMap[nName] = name;\n\n if (isNgAttr || !attrs.hasOwnProperty(nName)) {\n attrs[nName] = value;\n if (getBooleanAttrName(node, nName)) {\n attrs[nName] = true; // presence means true\n }\n }\n\n addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);\n addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,\n attrEndName);\n }\n }\n\n if (nodeName === 'input' && node.getAttribute('type') === 'hidden') {\n // Hidden input elements can have strange behaviour when navigating back to the page\n // This tells the browser not to try to cache and reinstate previous values\n node.setAttribute('autocomplete', 'off');\n }\n\n // use class as directive\n if (!cssClassDirectivesEnabled) break;\n className = node.className;\n if (isObject(className)) {\n // Maybe SVGAnimatedString\n className = className.animVal;\n }\n if (isString(className) && className !== '') {\n while ((match = CLASS_DIRECTIVE_REGEXP.exec(className))) {\n nName = directiveNormalize(match[2]);\n if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[3]);\n }\n className = className.substr(match.index + match[0].length);\n }\n }\n break;\n case NODE_TYPE_TEXT: /* Text Node */\n addTextInterpolateDirective(directives, node.nodeValue);\n break;\n case NODE_TYPE_COMMENT: /* Comment */\n if (!commentDirectivesEnabled) break;\n collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective);\n break;\n }\n\n directives.sort(byPriority);\n return directives;\n }\n\n function collectCommentDirectives(node, directives, attrs, maxPriority, ignoreDirective) {\n // function created because of performance, try/catch disables\n // the optimization of the whole function #14848\n try {\n var match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);\n if (match) {\n var nName = directiveNormalize(match[1]);\n if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {\n attrs[nName] = trim(match[2]);\n }\n }\n } catch (e) {\n // turns out that under some circumstances IE9 throws errors when one attempts to read\n // comment's node value.\n // Just ignore it and continue. (Can't seem to reproduce in test case.)\n }\n }\n\n /**\n * Given a node with a directive-start it collects all of the siblings until it finds\n * directive-end.\n * @param node\n * @param attrStart\n * @param attrEnd\n * @returns {*}\n */\n function groupScan(node, attrStart, attrEnd) {\n var nodes = [];\n var depth = 0;\n if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {\n do {\n if (!node) {\n throw $compileMinErr('uterdir',\n 'Unterminated attribute, found \\'{0}\\' but no matching \\'{1}\\' found.',\n attrStart, attrEnd);\n }\n if (node.nodeType === NODE_TYPE_ELEMENT) {\n if (node.hasAttribute(attrStart)) depth++;\n if (node.hasAttribute(attrEnd)) depth--;\n }\n nodes.push(node);\n node = node.nextSibling;\n } while (depth > 0);\n } else {\n nodes.push(node);\n }\n\n return jqLite(nodes);\n }\n\n /**\n * Wrapper for linking function which converts normal linking function into a grouped\n * linking function.\n * @param linkFn\n * @param attrStart\n * @param attrEnd\n * @returns {Function}\n */\n function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {\n return function groupedElementsLink(scope, element, attrs, controllers, transcludeFn) {\n element = groupScan(element[0], attrStart, attrEnd);\n return linkFn(scope, element, attrs, controllers, transcludeFn);\n };\n }\n\n /**\n * A function generator that is used to support both eager and lazy compilation\n * linking function.\n * @param eager\n * @param $compileNodes\n * @param transcludeFn\n * @param maxPriority\n * @param ignoreDirective\n * @param previousCompileContext\n * @returns {Function}\n */\n function compilationGenerator(eager, $compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext) {\n var compiled;\n\n if (eager) {\n return compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n }\n return /** @this */ function lazyCompilation() {\n if (!compiled) {\n compiled = compile($compileNodes, transcludeFn, maxPriority, ignoreDirective, previousCompileContext);\n\n // Null out all of these references in order to make them eligible for garbage collection\n // since this is a potentially long lived closure\n $compileNodes = transcludeFn = previousCompileContext = null;\n }\n return compiled.apply(this, arguments);\n };\n }\n\n /**\n * Once the directives have been collected, their compile functions are executed. This method\n * is responsible for inlining directive templates as well as terminating the application\n * of the directives if the terminal directive has been reached.\n *\n * @param {Array} directives Array of collected directives to execute their compile function.\n * this needs to be pre-sorted by priority order.\n * @param {Node} compileNode The raw DOM node to apply the compile functions to\n * @param {Object} templateAttrs The shared attribute function\n * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the\n * scope argument is auto-generated to the new\n * child of the transcluded parent scope.\n * @param {JQLite} jqCollection If we are working on the root of the compile tree then this\n * argument has the root jqLite array so that we can replace nodes\n * on it.\n * @param {Object=} originalReplaceDirective An optional directive that will be ignored when\n * compiling the transclusion.\n * @param {Array.} preLinkFns\n * @param {Array.} postLinkFns\n * @param {Object} previousCompileContext Context used for previous compilation of the current\n * node\n * @returns {Function} linkFn\n */\n function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,\n jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,\n previousCompileContext) {\n previousCompileContext = previousCompileContext || {};\n\n var terminalPriority = -Number.MAX_VALUE,\n newScopeDirective = previousCompileContext.newScopeDirective,\n controllerDirectives = previousCompileContext.controllerDirectives,\n newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,\n templateDirective = previousCompileContext.templateDirective,\n nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,\n hasTranscludeDirective = false,\n hasTemplate = false,\n hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,\n $compileNode = templateAttrs.$$element = jqLite(compileNode),\n directive,\n directiveName,\n $template,\n replaceDirective = originalReplaceDirective,\n childTranscludeFn = transcludeFn,\n linkFn,\n didScanForMultipleTransclusion = false,\n mightHaveMultipleTransclusionError = false,\n directiveValue;\n\n // executes all directives on the current element\n for (var i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n var attrStart = directive.$$start;\n var attrEnd = directive.$$end;\n\n // collect multiblock sections\n if (attrStart) {\n $compileNode = groupScan(compileNode, attrStart, attrEnd);\n }\n $template = undefined;\n\n if (terminalPriority > directive.priority) {\n break; // prevent further processing of directives\n }\n\n directiveValue = directive.scope;\n\n if (directiveValue) {\n\n // skip the check for directives with async templates, we'll check the derived sync\n // directive when the template arrives\n if (!directive.templateUrl) {\n if (isObject(directiveValue)) {\n // This directive is trying to add an isolated scope.\n // Check that there is no scope of any kind already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,\n directive, $compileNode);\n newIsolateScopeDirective = directive;\n } else {\n // This directive is trying to add a child scope.\n // Check that there is no isolated scope already\n assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,\n $compileNode);\n }\n }\n\n newScopeDirective = newScopeDirective || directive;\n }\n\n directiveName = directive.name;\n\n // If we encounter a condition that can result in transclusion on the directive,\n // then scan ahead in the remaining directives for others that may cause a multiple\n // transclusion error to be thrown during the compilation process. If a matching directive\n // is found, then we know that when we encounter a transcluded directive, we need to eagerly\n // compile the `transclude` function rather than doing it lazily in order to throw\n // exceptions at the correct time\n if (!didScanForMultipleTransclusion && ((directive.replace && (directive.templateUrl || directive.template))\n || (directive.transclude && !directive.$$tlb))) {\n var candidateDirective;\n\n for (var scanningIndex = i + 1; (candidateDirective = directives[scanningIndex++]);) {\n if ((candidateDirective.transclude && !candidateDirective.$$tlb)\n || (candidateDirective.replace && (candidateDirective.templateUrl || candidateDirective.template))) {\n mightHaveMultipleTransclusionError = true;\n break;\n }\n }\n\n didScanForMultipleTransclusion = true;\n }\n\n if (!directive.templateUrl && directive.controller) {\n controllerDirectives = controllerDirectives || createMap();\n assertNoDuplicate('\\'' + directiveName + '\\' controller',\n controllerDirectives[directiveName], directive, $compileNode);\n controllerDirectives[directiveName] = directive;\n }\n\n directiveValue = directive.transclude;\n\n if (directiveValue) {\n hasTranscludeDirective = true;\n\n // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.\n // This option should only be used by directives that know how to safely handle element transclusion,\n // where the transcluded nodes are added or replaced after linking.\n if (!directive.$$tlb) {\n assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);\n nonTlbTranscludeDirective = directive;\n }\n\n if (directiveValue === 'element') {\n hasElementTranscludeDirective = true;\n terminalPriority = directive.priority;\n $template = $compileNode;\n $compileNode = templateAttrs.$$element =\n jqLite(compile.$$createComment(directiveName, templateAttrs[directiveName]));\n compileNode = $compileNode[0];\n replaceWith(jqCollection, sliceArgs($template), compileNode);\n\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, terminalPriority,\n replaceDirective && replaceDirective.name, {\n // Don't pass in:\n // - controllerDirectives - otherwise we'll create duplicates controllers\n // - newIsolateScopeDirective or templateDirective - combining templates with\n // element transclusion doesn't make sense.\n //\n // We need only nonTlbTranscludeDirective so that we prevent putting transclusion\n // on the same element more than once.\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n } else {\n\n var slots = createMap();\n\n if (!isObject(directiveValue)) {\n $template = jqLite(jqLiteClone(compileNode)).contents();\n } else {\n\n // We have transclusion slots,\n // collect them up, compile them and store their transclusion functions\n $template = window.document.createDocumentFragment();\n\n var slotMap = createMap();\n var filledSlots = createMap();\n\n // Parse the element selectors\n forEach(directiveValue, function(elementSelector, slotName) {\n // If an element selector starts with a ? then it is optional\n var optional = (elementSelector.charAt(0) === '?');\n elementSelector = optional ? elementSelector.substring(1) : elementSelector;\n\n slotMap[elementSelector] = slotName;\n\n // We explicitly assign `null` since this implies that a slot was defined but not filled.\n // Later when calling boundTransclusion functions with a slot name we only error if the\n // slot is `undefined`\n slots[slotName] = null;\n\n // filledSlots contains `true` for all slots that are either optional or have been\n // filled. This is used to check that we have not missed any required slots\n filledSlots[slotName] = optional;\n });\n\n // Add the matching elements into their slot\n forEach($compileNode.contents(), function(node) {\n var slotName = slotMap[directiveNormalize(nodeName_(node))];\n if (slotName) {\n filledSlots[slotName] = true;\n slots[slotName] = slots[slotName] || window.document.createDocumentFragment();\n slots[slotName].appendChild(node);\n } else {\n $template.appendChild(node);\n }\n });\n\n // Check for required slots that were not filled\n forEach(filledSlots, function(filled, slotName) {\n if (!filled) {\n throw $compileMinErr('reqslot', 'Required transclusion slot `{0}` was not filled.', slotName);\n }\n });\n\n for (var slotName in slots) {\n if (slots[slotName]) {\n // Only define a transclusion function if the slot was filled\n var slotCompileNodes = jqLite(slots[slotName].childNodes);\n slots[slotName] = compilationGenerator(mightHaveMultipleTransclusionError, slotCompileNodes, transcludeFn);\n }\n }\n\n $template = jqLite($template.childNodes);\n }\n\n $compileNode.empty(); // clear contents\n childTranscludeFn = compilationGenerator(mightHaveMultipleTransclusionError, $template, transcludeFn, undefined,\n undefined, { needsNewScope: directive.$$isolateScope || directive.$$newScope});\n childTranscludeFn.$$slots = slots;\n }\n }\n\n if (directive.template) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n directiveValue = (isFunction(directive.template))\n ? directive.template($compileNode, templateAttrs)\n : directive.template;\n\n directiveValue = denormalizeTemplate(directiveValue);\n\n if (directive.replace) {\n replaceDirective = directive;\n if (jqLiteIsTextNode(directiveValue)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));\n }\n compileNode = $template[0];\n\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n 'Template for directive \\'{0}\\' must have exactly one root element. {1}',\n directiveName, '');\n }\n\n replaceWith(jqCollection, $compileNode, compileNode);\n\n var newTemplateAttrs = {$attr: {}};\n\n // combine directives from the original node and from the template:\n // - take the array of directives for this element\n // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)\n // - collect directives from the template and sort them by priority\n // - combine directives as: processed + template + unprocessed\n var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);\n var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));\n\n if (newIsolateScopeDirective || newScopeDirective) {\n // The original directive caused the current element to be replaced but this element\n // also needs to have a new scope, so we need to tell the template directives\n // that they would need to get their scope from further up, if they require transclusion\n markDirectiveScope(templateDirectives, newIsolateScopeDirective, newScopeDirective);\n }\n directives = directives.concat(templateDirectives).concat(unprocessedDirectives);\n mergeTemplateAttributes(templateAttrs, newTemplateAttrs);\n\n ii = directives.length;\n } else {\n $compileNode.html(directiveValue);\n }\n }\n\n if (directive.templateUrl) {\n hasTemplate = true;\n assertNoDuplicate('template', templateDirective, directive, $compileNode);\n templateDirective = directive;\n\n if (directive.replace) {\n replaceDirective = directive;\n }\n\n // eslint-disable-next-line no-func-assign\n nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,\n templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {\n controllerDirectives: controllerDirectives,\n newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,\n newIsolateScopeDirective: newIsolateScopeDirective,\n templateDirective: templateDirective,\n nonTlbTranscludeDirective: nonTlbTranscludeDirective\n });\n ii = directives.length;\n } else if (directive.compile) {\n try {\n linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);\n var context = directive.$$originalDirective || directive;\n if (isFunction(linkFn)) {\n addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);\n } else if (linkFn) {\n addLinkFns(bind(context, linkFn.pre), bind(context, linkFn.post), attrStart, attrEnd);\n }\n } catch (e) {\n $exceptionHandler(e, startingTag($compileNode));\n }\n }\n\n if (directive.terminal) {\n nodeLinkFn.terminal = true;\n terminalPriority = Math.max(terminalPriority, directive.priority);\n }\n\n }\n\n nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;\n nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;\n nodeLinkFn.templateOnThisElement = hasTemplate;\n nodeLinkFn.transclude = childTranscludeFn;\n\n previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;\n\n // might be normal or delayed nodeLinkFn depending on if templateUrl is present\n return nodeLinkFn;\n\n ////////////////////\n\n function addLinkFns(pre, post, attrStart, attrEnd) {\n if (pre) {\n if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);\n pre.require = directive.require;\n pre.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n pre = cloneAndAnnotateFn(pre, {isolateScope: true});\n }\n preLinkFns.push(pre);\n }\n if (post) {\n if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);\n post.require = directive.require;\n post.directiveName = directiveName;\n if (newIsolateScopeDirective === directive || directive.$$isolateScope) {\n post = cloneAndAnnotateFn(post, {isolateScope: true});\n }\n postLinkFns.push(post);\n }\n }\n\n function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn) {\n var i, ii, linkFn, isolateScope, controllerScope, elementControllers, transcludeFn, $element,\n attrs, scopeBindingInfo;\n\n if (compileNode === linkNode) {\n attrs = templateAttrs;\n $element = templateAttrs.$$element;\n } else {\n $element = jqLite(linkNode);\n attrs = new Attributes($element, templateAttrs);\n }\n\n controllerScope = scope;\n if (newIsolateScopeDirective) {\n isolateScope = scope.$new(true);\n } else if (newScopeDirective) {\n controllerScope = scope.$parent;\n }\n\n if (boundTranscludeFn) {\n // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`\n // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`\n transcludeFn = controllersBoundTransclude;\n transcludeFn.$$boundTransclude = boundTranscludeFn;\n // expose the slots on the `$transclude` function\n transcludeFn.isSlotFilled = function(slotName) {\n return !!boundTranscludeFn.$$slots[slotName];\n };\n }\n\n if (controllerDirectives) {\n elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective);\n }\n\n if (newIsolateScopeDirective) {\n // Initialize isolate scope bindings for new isolate scope directive.\n compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||\n templateDirective === newIsolateScopeDirective.$$originalDirective)));\n compile.$$addScopeClass($element, true);\n isolateScope.$$isolateBindings =\n newIsolateScopeDirective.$$isolateBindings;\n scopeBindingInfo = initializeDirectiveBindings(scope, attrs, isolateScope,\n isolateScope.$$isolateBindings,\n newIsolateScopeDirective);\n if (scopeBindingInfo.removeWatches) {\n isolateScope.$on('$destroy', scopeBindingInfo.removeWatches);\n }\n }\n\n // Initialize bindToController bindings\n for (var name in elementControllers) {\n var controllerDirective = controllerDirectives[name];\n var controller = elementControllers[name];\n var bindings = controllerDirective.$$bindings.bindToController;\n\n controller.instance = controller();\n $element.data('$' + controllerDirective.name + 'Controller', controller.instance);\n controller.bindingInfo =\n initializeDirectiveBindings(controllerScope, attrs, controller.instance, bindings, controllerDirective);\n }\n\n // Bind the required controllers to the controller, if `require` is an object and `bindToController` is truthy\n forEach(controllerDirectives, function(controllerDirective, name) {\n var require = controllerDirective.require;\n if (controllerDirective.bindToController && !isArray(require) && isObject(require)) {\n extend(elementControllers[name].instance, getControllers(name, require, $element, elementControllers));\n }\n });\n\n // Handle the init and destroy lifecycle hooks on all controllers that have them\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$onChanges)) {\n try {\n controllerInstance.$onChanges(controller.bindingInfo.initialChanges);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$onInit)) {\n try {\n controllerInstance.$onInit();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n if (isFunction(controllerInstance.$doCheck)) {\n controllerScope.$watch(function() { controllerInstance.$doCheck(); });\n controllerInstance.$doCheck();\n }\n if (isFunction(controllerInstance.$onDestroy)) {\n controllerScope.$on('$destroy', function callOnDestroyHook() {\n controllerInstance.$onDestroy();\n });\n }\n });\n\n // PRELINKING\n for (i = 0, ii = preLinkFns.length; i < ii; i++) {\n linkFn = preLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // RECURSION\n // We only pass the isolate scope, if the isolate directive has a template,\n // otherwise the child elements do not belong to the isolate directive.\n var scopeToChild = scope;\n if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {\n scopeToChild = isolateScope;\n }\n if (childLinkFn) {\n childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);\n }\n\n // POSTLINKING\n for (i = postLinkFns.length - 1; i >= 0; i--) {\n linkFn = postLinkFns[i];\n invokeLinkFn(linkFn,\n linkFn.isolateScope ? isolateScope : scope,\n $element,\n attrs,\n linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),\n transcludeFn\n );\n }\n\n // Trigger $postLink lifecycle hooks\n forEach(elementControllers, function(controller) {\n var controllerInstance = controller.instance;\n if (isFunction(controllerInstance.$postLink)) {\n controllerInstance.$postLink();\n }\n });\n\n // This is the function that is injected as `$transclude`.\n // Note: all arguments are optional!\n function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement, slotName) {\n var transcludeControllers;\n // No scope passed in:\n if (!isScope(scope)) {\n slotName = futureParentElement;\n futureParentElement = cloneAttachFn;\n cloneAttachFn = scope;\n scope = undefined;\n }\n\n if (hasElementTranscludeDirective) {\n transcludeControllers = elementControllers;\n }\n if (!futureParentElement) {\n futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;\n }\n if (slotName) {\n // slotTranscludeFn can be one of three things:\n // * a transclude function - a filled slot\n // * `null` - an optional slot that was not filled\n // * `undefined` - a slot that was not declared (i.e. invalid)\n var slotTranscludeFn = boundTranscludeFn.$$slots[slotName];\n if (slotTranscludeFn) {\n return slotTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n } else if (isUndefined(slotTranscludeFn)) {\n throw $compileMinErr('noslot',\n 'No parent directive that requires a transclusion with slot name \"{0}\". ' +\n 'Element: {1}',\n slotName, startingTag($element));\n }\n } else {\n return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);\n }\n }\n }\n }\n\n function getControllers(directiveName, require, $element, elementControllers) {\n var value;\n\n if (isString(require)) {\n var match = require.match(REQUIRE_PREFIX_REGEXP);\n var name = require.substring(match[0].length);\n var inheritType = match[1] || match[3];\n var optional = match[2] === '?';\n\n //If only parents then start at the parent element\n if (inheritType === '^^') {\n $element = $element.parent();\n //Otherwise attempt getting the controller from elementControllers in case\n //the element is transcluded (and has no data) and to avoid .data if possible\n } else {\n value = elementControllers && elementControllers[name];\n value = value && value.instance;\n }\n\n if (!value) {\n var dataName = '$' + name + 'Controller';\n\n if (inheritType === '^^' && $element[0] && $element[0].nodeType === NODE_TYPE_DOCUMENT) {\n // inheritedData() uses the documentElement when it finds the document, so we would\n // require from the element itself.\n value = null;\n } else {\n value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);\n }\n }\n\n if (!value && !optional) {\n throw $compileMinErr('ctreq',\n 'Controller \\'{0}\\', required by directive \\'{1}\\', can\\'t be found!',\n name, directiveName);\n }\n } else if (isArray(require)) {\n value = [];\n for (var i = 0, ii = require.length; i < ii; i++) {\n value[i] = getControllers(directiveName, require[i], $element, elementControllers);\n }\n } else if (isObject(require)) {\n value = {};\n forEach(require, function(controller, property) {\n value[property] = getControllers(directiveName, controller, $element, elementControllers);\n });\n }\n\n return value || null;\n }\n\n function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope, newIsolateScopeDirective) {\n var elementControllers = createMap();\n for (var controllerKey in controllerDirectives) {\n var directive = controllerDirectives[controllerKey];\n var locals = {\n $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,\n $element: $element,\n $attrs: attrs,\n $transclude: transcludeFn\n };\n\n var controller = directive.controller;\n if (controller === '@') {\n controller = attrs[directive.name];\n }\n\n var controllerInstance = $controller(controller, locals, true, directive.controllerAs);\n\n // For directives with element transclusion the element is a comment.\n // In this case .data will not attach any data.\n // Instead, we save the controllers for the element in a local hash and attach to .data\n // later, once we have the actual element.\n elementControllers[directive.name] = controllerInstance;\n $element.data('$' + directive.name + 'Controller', controllerInstance.instance);\n }\n return elementControllers;\n }\n\n // Depending upon the context in which a directive finds itself it might need to have a new isolated\n // or child scope created. For instance:\n // * if the directive has been pulled into a template because another directive with a higher priority\n // asked for element transclusion\n // * if the directive itself asks for transclusion but it is at the root of a template and the original\n // element was replaced. See https://github.com/angular/angular.js/issues/12936\n function markDirectiveScope(directives, isolateScope, newScope) {\n for (var j = 0, jj = directives.length; j < jj; j++) {\n directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});\n }\n }\n\n /**\n * looks up the directive and decorates it with exception handling and proper parameters. We\n * call this the boundDirective.\n *\n * @param {string} name name of the directive to look up.\n * @param {string} location The directive must be found in specific format.\n * String containing any of theses characters:\n *\n * * `E`: element name\n * * `A': attribute\n * * `C`: class\n * * `M`: comment\n * @returns {boolean} true if directive was added.\n */\n function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,\n endAttrName) {\n if (name === ignoreDirective) return null;\n var match = null;\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&\n directive.restrict.indexOf(location) !== -1) {\n if (startAttrName) {\n directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});\n }\n if (!directive.$$bindings) {\n var bindings = directive.$$bindings =\n parseDirectiveBindings(directive, directive.name);\n if (isObject(bindings.isolateScope)) {\n directive.$$isolateBindings = bindings.isolateScope;\n }\n }\n tDirectives.push(directive);\n match = directive;\n }\n }\n }\n return match;\n }\n\n\n /**\n * looks up the directive and returns true if it is a multi-element directive,\n * and therefore requires DOM nodes between -start and -end markers to be grouped\n * together.\n *\n * @param {string} name name of the directive to look up.\n * @returns true if directive was registered as multi-element.\n */\n function directiveIsMultiElement(name) {\n if (hasDirectives.hasOwnProperty(name)) {\n for (var directive, directives = $injector.get(name + Suffix),\n i = 0, ii = directives.length; i < ii; i++) {\n directive = directives[i];\n if (directive.multiElement) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * When the element is replaced with HTML template then the new attributes\n * on the template need to be merged with the existing attributes in the DOM.\n * The desired effect is to have both of the attributes present.\n *\n * @param {object} dst destination attributes (original DOM)\n * @param {object} src source attributes (from the directive template)\n */\n function mergeTemplateAttributes(dst, src) {\n var srcAttr = src.$attr,\n dstAttr = dst.$attr;\n\n // reapply the old attributes to the new element\n forEach(dst, function(value, key) {\n if (key.charAt(0) !== '$') {\n if (src[key] && src[key] !== value) {\n if (value.length) {\n value += (key === 'style' ? ';' : ' ') + src[key];\n } else {\n value = src[key];\n }\n }\n dst.$set(key, value, true, srcAttr[key]);\n }\n });\n\n // copy the new attributes on the old attrs object\n forEach(src, function(value, key) {\n // Check if we already set this attribute in the loop above.\n // `dst` will never contain hasOwnProperty as DOM parser won't let it.\n // You will get an \"InvalidCharacterError: DOM Exception 5\" error if you\n // have an attribute like \"has-own-property\" or \"data-has-own-property\", etc.\n if (!dst.hasOwnProperty(key) && key.charAt(0) !== '$') {\n dst[key] = value;\n\n if (key !== 'class' && key !== 'style') {\n dstAttr[key] = srcAttr[key];\n }\n }\n });\n }\n\n\n function compileTemplateUrl(directives, $compileNode, tAttrs,\n $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {\n var linkQueue = [],\n afterTemplateNodeLinkFn,\n afterTemplateChildLinkFn,\n beforeTemplateCompileNode = $compileNode[0],\n origAsyncDirective = directives.shift(),\n derivedSyncDirective = inherit(origAsyncDirective, {\n templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective\n }),\n templateUrl = (isFunction(origAsyncDirective.templateUrl))\n ? origAsyncDirective.templateUrl($compileNode, tAttrs)\n : origAsyncDirective.templateUrl,\n templateNamespace = origAsyncDirective.templateNamespace;\n\n $compileNode.empty();\n\n $templateRequest(templateUrl)\n .then(function(content) {\n var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;\n\n content = denormalizeTemplate(content);\n\n if (origAsyncDirective.replace) {\n if (jqLiteIsTextNode(content)) {\n $template = [];\n } else {\n $template = removeComments(wrapTemplate(templateNamespace, trim(content)));\n }\n compileNode = $template[0];\n\n if ($template.length !== 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {\n throw $compileMinErr('tplrt',\n 'Template for directive \\'{0}\\' must have exactly one root element. {1}',\n origAsyncDirective.name, templateUrl);\n }\n\n tempTemplateAttrs = {$attr: {}};\n replaceWith($rootElement, $compileNode, compileNode);\n var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);\n\n if (isObject(origAsyncDirective.scope)) {\n // the original directive that caused the template to be loaded async required\n // an isolate scope\n markDirectiveScope(templateDirectives, true);\n }\n directives = templateDirectives.concat(directives);\n mergeTemplateAttributes(tAttrs, tempTemplateAttrs);\n } else {\n compileNode = beforeTemplateCompileNode;\n $compileNode.html(content);\n }\n\n directives.unshift(derivedSyncDirective);\n\n afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,\n childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,\n previousCompileContext);\n forEach($rootElement, function(node, i) {\n if (node === compileNode) {\n $rootElement[i] = $compileNode[0];\n }\n });\n afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);\n\n while (linkQueue.length) {\n var scope = linkQueue.shift(),\n beforeTemplateLinkNode = linkQueue.shift(),\n linkRootElement = linkQueue.shift(),\n boundTranscludeFn = linkQueue.shift(),\n linkNode = $compileNode[0];\n\n if (scope.$$destroyed) continue;\n\n if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {\n var oldClasses = beforeTemplateLinkNode.className;\n\n if (!(previousCompileContext.hasElementTranscludeDirective &&\n origAsyncDirective.replace)) {\n // it was cloned therefore we have to clone as well.\n linkNode = jqLiteClone(compileNode);\n }\n replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);\n\n // Copy in CSS classes from original node\n safeAddClass(jqLite(linkNode), oldClasses);\n }\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n } else {\n childBoundTranscludeFn = boundTranscludeFn;\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,\n childBoundTranscludeFn);\n }\n linkQueue = null;\n }).catch(function(error) {\n if (isError(error)) {\n $exceptionHandler(error);\n }\n });\n\n return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {\n var childBoundTranscludeFn = boundTranscludeFn;\n if (scope.$$destroyed) return;\n if (linkQueue) {\n linkQueue.push(scope,\n node,\n rootElement,\n childBoundTranscludeFn);\n } else {\n if (afterTemplateNodeLinkFn.transcludeOnThisElement) {\n childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);\n }\n afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn);\n }\n };\n }\n\n\n /**\n * Sorting function for bound directives.\n */\n function byPriority(a, b) {\n var diff = b.priority - a.priority;\n if (diff !== 0) return diff;\n if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;\n return a.index - b.index;\n }\n\n function assertNoDuplicate(what, previousDirective, directive, element) {\n\n function wrapModuleNameIfDefined(moduleName) {\n return moduleName ?\n (' (module: ' + moduleName + ')') :\n '';\n }\n\n if (previousDirective) {\n throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',\n previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),\n directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));\n }\n }\n\n\n function addTextInterpolateDirective(directives, text) {\n var interpolateFn = $interpolate(text, true);\n if (interpolateFn) {\n directives.push({\n priority: 0,\n compile: function textInterpolateCompileFn(templateNode) {\n var templateNodeParent = templateNode.parent(),\n hasCompileParent = !!templateNodeParent.length;\n\n // When transcluding a template that has bindings in the root\n // we don't have a parent and thus need to add the class during linking fn.\n if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);\n\n return function textInterpolateLinkFn(scope, node) {\n var parent = node.parent();\n if (!hasCompileParent) compile.$$addBindingClass(parent);\n compile.$$addBindingInfo(parent, interpolateFn.expressions);\n scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {\n node[0].nodeValue = value;\n });\n };\n }\n });\n }\n }\n\n\n function wrapTemplate(type, template) {\n type = lowercase(type || 'html');\n switch (type) {\n case 'svg':\n case 'math':\n var wrapper = window.document.createElement('div');\n wrapper.innerHTML = '<' + type + '>' + template + '';\n return wrapper.childNodes[0].childNodes;\n default:\n return template;\n }\n }\n\n\n function getTrustedAttrContext(nodeName, attrNormalizedName) {\n if (attrNormalizedName === 'srcdoc') {\n return $sce.HTML;\n }\n // All nodes with src attributes require a RESOURCE_URL value, except for\n // img and various html5 media nodes, which require the MEDIA_URL context.\n if (attrNormalizedName === 'src' || attrNormalizedName === 'ngSrc') {\n if (['img', 'video', 'audio', 'source', 'track'].indexOf(nodeName) === -1) {\n return $sce.RESOURCE_URL;\n }\n return $sce.MEDIA_URL;\n } else if (attrNormalizedName === 'xlinkHref') {\n // Some xlink:href are okay, most aren't\n if (nodeName === 'image') return $sce.MEDIA_URL;\n if (nodeName === 'a') return $sce.URL;\n return $sce.RESOURCE_URL;\n } else if (\n // Formaction\n (nodeName === 'form' && attrNormalizedName === 'action') ||\n // If relative URLs can go where they are not expected to, then\n // all sorts of trust issues can arise.\n (nodeName === 'base' && attrNormalizedName === 'href') ||\n // links can be stylesheets or imports, which can run script in the current origin\n (nodeName === 'link' && attrNormalizedName === 'href')\n ) {\n return $sce.RESOURCE_URL;\n } else if (nodeName === 'a' && (attrNormalizedName === 'href' ||\n attrNormalizedName === 'ngHref')) {\n return $sce.URL;\n }\n }\n\n function getTrustedPropContext(nodeName, propNormalizedName) {\n var prop = propNormalizedName.toLowerCase();\n return PROP_CONTEXTS[nodeName + '|' + prop] || PROP_CONTEXTS['*|' + prop];\n }\n\n function sanitizeSrcsetPropertyValue(value) {\n return sanitizeSrcset($sce.valueOf(value), 'ng-prop-srcset');\n }\n function addPropertyDirective(node, directives, attrName, propName) {\n if (EVENT_HANDLER_ATTR_REGEXP.test(propName)) {\n throw $compileMinErr('nodomevents', 'Property bindings for HTML DOM event properties are disallowed');\n }\n\n var nodeName = nodeName_(node);\n var trustedContext = getTrustedPropContext(nodeName, propName);\n\n var sanitizer = identity;\n // Sanitize img[srcset] + source[srcset] values.\n if (propName === 'srcset' && (nodeName === 'img' || nodeName === 'source')) {\n sanitizer = sanitizeSrcsetPropertyValue;\n } else if (trustedContext) {\n sanitizer = $sce.getTrusted.bind($sce, trustedContext);\n }\n\n directives.push({\n priority: 100,\n compile: function ngPropCompileFn(_, attr) {\n var ngPropGetter = $parse(attr[attrName]);\n var ngPropWatch = $parse(attr[attrName], function sceValueOf(val) {\n // Unwrap the value to compare the actual inner safe value, not the wrapper object.\n return $sce.valueOf(val);\n });\n\n return {\n pre: function ngPropPreLinkFn(scope, $element) {\n function applyPropValue() {\n var propValue = ngPropGetter(scope);\n $element[0][propName] = sanitizer(propValue);\n }\n\n applyPropValue();\n scope.$watch(ngPropWatch, applyPropValue);\n }\n };\n }\n });\n }\n\n function addEventDirective(directives, attrName, eventName) {\n directives.push(\n createEventDirective($parse, $rootScope, $exceptionHandler, attrName, eventName, /*forceAsync=*/false)\n );\n }\n\n function addAttrInterpolateDirective(node, directives, value, name, isNgAttr) {\n var nodeName = nodeName_(node);\n var trustedContext = getTrustedAttrContext(nodeName, name);\n var mustHaveExpression = !isNgAttr;\n var allOrNothing = ALL_OR_NOTHING_ATTRS[name] || isNgAttr;\n\n var interpolateFn = $interpolate(value, mustHaveExpression, trustedContext, allOrNothing);\n\n // no interpolation found -> ignore\n if (!interpolateFn) return;\n\n if (name === 'multiple' && nodeName === 'select') {\n throw $compileMinErr('selmulti',\n 'Binding to the \\'multiple\\' attribute is not supported. Element: {0}',\n startingTag(node));\n }\n\n if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {\n throw $compileMinErr('nodomevents', 'Interpolations for HTML DOM event attributes are disallowed');\n }\n\n directives.push({\n priority: 100,\n compile: function() {\n return {\n pre: function attrInterpolatePreLinkFn(scope, element, attr) {\n var $$observers = (attr.$$observers || (attr.$$observers = createMap()));\n\n // If the attribute has changed since last $interpolate()ed\n var newValue = attr[name];\n if (newValue !== value) {\n // we need to interpolate again since the attribute value has been updated\n // (e.g. by another directive's compile function)\n // ensure unset/empty values make interpolateFn falsy\n interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);\n value = newValue;\n }\n\n // if attribute was updated so that there is no interpolation going on we don't want to\n // register any observers\n if (!interpolateFn) return;\n\n // initialize attr object so that it's ready in case we need the value for isolate\n // scope initialization, otherwise the value would not be available from isolate\n // directive's linking fn during linking phase\n attr[name] = interpolateFn(scope);\n\n ($$observers[name] || ($$observers[name] = [])).$$inter = true;\n (attr.$$observers && attr.$$observers[name].$$scope || scope).\n $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {\n //special case for class attribute addition + removal\n //so that class changes can tap into the animation\n //hooks provided by the $animate service. Be sure to\n //skip animations when the first digest occurs (when\n //both the new and the old values are the same) since\n //the CSS classes are the non-interpolated values\n if (name === 'class' && newValue !== oldValue) {\n attr.$updateClass(newValue, oldValue);\n } else {\n attr.$set(name, newValue);\n }\n });\n }\n };\n }\n });\n }\n\n\n /**\n * This is a special jqLite.replaceWith, which can replace items which\n * have no parents, provided that the containing jqLite collection is provided.\n *\n * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes\n * in the root of the tree.\n * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep\n * the shell, but replace its DOM node reference.\n * @param {Node} newNode The new DOM node.\n */\n function replaceWith($rootElement, elementsToRemove, newNode) {\n var firstElementToRemove = elementsToRemove[0],\n removeCount = elementsToRemove.length,\n parent = firstElementToRemove.parentNode,\n i, ii;\n\n if ($rootElement) {\n for (i = 0, ii = $rootElement.length; i < ii; i++) {\n if ($rootElement[i] === firstElementToRemove) {\n $rootElement[i++] = newNode;\n for (var j = i, j2 = j + removeCount - 1,\n jj = $rootElement.length;\n j < jj; j++, j2++) {\n if (j2 < jj) {\n $rootElement[j] = $rootElement[j2];\n } else {\n delete $rootElement[j];\n }\n }\n $rootElement.length -= removeCount - 1;\n\n // If the replaced element is also the jQuery .context then replace it\n // .context is a deprecated jQuery api, so we should set it only when jQuery set it\n // http://api.jquery.com/context/\n if ($rootElement.context === firstElementToRemove) {\n $rootElement.context = newNode;\n }\n break;\n }\n }\n }\n\n if (parent) {\n parent.replaceChild(newNode, firstElementToRemove);\n }\n\n // Append all the `elementsToRemove` to a fragment. This will...\n // - remove them from the DOM\n // - allow them to still be traversed with .nextSibling\n // - allow a single fragment.qSA to fetch all elements being removed\n var fragment = window.document.createDocumentFragment();\n for (i = 0; i < removeCount; i++) {\n fragment.appendChild(elementsToRemove[i]);\n }\n\n if (jqLite.hasData(firstElementToRemove)) {\n // Copy over user data (that includes AngularJS's $scope etc.). Don't copy private\n // data here because there's no public interface in jQuery to do that and copying over\n // event listeners (which is the main use of private data) wouldn't work anyway.\n jqLite.data(newNode, jqLite.data(firstElementToRemove));\n\n // Remove $destroy event listeners from `firstElementToRemove`\n jqLite(firstElementToRemove).off('$destroy');\n }\n\n // Cleanup any data/listeners on the elements and children.\n // This includes invoking the $destroy event on any elements with listeners.\n jqLite.cleanData(fragment.querySelectorAll('*'));\n\n // Update the jqLite collection to only contain the `newNode`\n for (i = 1; i < removeCount; i++) {\n delete elementsToRemove[i];\n }\n elementsToRemove[0] = newNode;\n elementsToRemove.length = 1;\n }\n\n\n function cloneAndAnnotateFn(fn, annotation) {\n return extend(function() { return fn.apply(null, arguments); }, fn, annotation);\n }\n\n\n function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {\n try {\n linkFn(scope, $element, attrs, controllers, transcludeFn);\n } catch (e) {\n $exceptionHandler(e, startingTag($element));\n }\n }\n\n function strictBindingsCheck(attrName, directiveName) {\n if (strictComponentBindingsEnabled) {\n throw $compileMinErr('missingattr',\n 'Attribute \\'{0}\\' of \\'{1}\\' is non-optional and must be set!',\n attrName, directiveName);\n }\n }\n\n // Set up $watches for isolate scope and controller bindings.\n function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {\n var removeWatchCollection = [];\n var initialChanges = {};\n var changes;\n\n forEach(bindings, function initializeBinding(definition, scopeName) {\n var attrName = definition.attrName,\n optional = definition.optional,\n mode = definition.mode, // @, =, <, or &\n lastValue,\n parentGet, parentSet, compare, removeWatch;\n\n switch (mode) {\n\n case '@':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n destination[scopeName] = attrs[attrName] = undefined;\n\n }\n removeWatch = attrs.$observe(attrName, function(value) {\n if (isString(value) || isBoolean(value)) {\n var oldValue = destination[scopeName];\n recordChanges(scopeName, value, oldValue);\n destination[scopeName] = value;\n }\n });\n attrs.$$observers[attrName].$$scope = scope;\n lastValue = attrs[attrName];\n if (isString(lastValue)) {\n // If the attribute has been provided then we trigger an interpolation to ensure\n // the value is there for use in the link fn\n destination[scopeName] = $interpolate(lastValue)(scope);\n } else if (isBoolean(lastValue)) {\n // If the attributes is one of the BOOLEAN_ATTR then AngularJS will have converted\n // the value to boolean rather than a string, so we special case this situation\n destination[scopeName] = lastValue;\n }\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n removeWatchCollection.push(removeWatch);\n break;\n\n case '=':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n if (parentGet.literal) {\n compare = equals;\n } else {\n compare = simpleCompare;\n }\n parentSet = parentGet.assign || function() {\n // reset the change, or we will throw this exception on every $digest\n lastValue = destination[scopeName] = parentGet(scope);\n throw $compileMinErr('nonassign',\n 'Expression \\'{0}\\' in attribute \\'{1}\\' used with directive \\'{2}\\' is non-assignable!',\n attrs[attrName], attrName, directive.name);\n };\n lastValue = destination[scopeName] = parentGet(scope);\n var parentValueWatch = function parentValueWatch(parentValue) {\n if (!compare(parentValue, destination[scopeName])) {\n // we are out of sync and need to copy\n if (!compare(parentValue, lastValue)) {\n // parent changed and it has precedence\n destination[scopeName] = parentValue;\n } else {\n // if the parent can be assigned then do so\n parentSet(scope, parentValue = destination[scopeName]);\n }\n }\n lastValue = parentValue;\n return lastValue;\n };\n parentValueWatch.$stateful = true;\n if (definition.collection) {\n removeWatch = scope.$watchCollection(attrs[attrName], parentValueWatch);\n } else {\n removeWatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);\n }\n removeWatchCollection.push(removeWatch);\n break;\n\n case '<':\n if (!hasOwnProperty.call(attrs, attrName)) {\n if (optional) break;\n strictBindingsCheck(attrName, directive.name);\n attrs[attrName] = undefined;\n }\n if (optional && !attrs[attrName]) break;\n\n parentGet = $parse(attrs[attrName]);\n var isLiteral = parentGet.literal;\n\n var initialValue = destination[scopeName] = parentGet(scope);\n initialChanges[scopeName] = new SimpleChange(_UNINITIALIZED_VALUE, destination[scopeName]);\n\n removeWatch = scope[definition.collection ? '$watchCollection' : '$watch'](parentGet, function parentValueWatchAction(newValue, oldValue) {\n if (oldValue === newValue) {\n if (oldValue === initialValue || (isLiteral && equals(oldValue, initialValue))) {\n return;\n }\n oldValue = initialValue;\n }\n recordChanges(scopeName, newValue, oldValue);\n destination[scopeName] = newValue;\n });\n\n removeWatchCollection.push(removeWatch);\n break;\n\n case '&':\n if (!optional && !hasOwnProperty.call(attrs, attrName)) {\n strictBindingsCheck(attrName, directive.name);\n }\n // Don't assign Object.prototype method to scope\n parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;\n\n // Don't assign noop to destination if expression is not valid\n if (parentGet === noop && optional) break;\n\n destination[scopeName] = function(locals) {\n return parentGet(scope, locals);\n };\n break;\n }\n });\n\n function recordChanges(key, currentValue, previousValue) {\n if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) {\n // If we have not already scheduled the top level onChangesQueue handler then do so now\n if (!onChangesQueue) {\n scope.$$postDigest(flushOnChangesQueue);\n onChangesQueue = [];\n }\n // If we have not already queued a trigger of onChanges for this controller then do so now\n if (!changes) {\n changes = {};\n onChangesQueue.push(triggerOnChangesHook);\n }\n // If the has been a change on this property already then we need to reuse the previous value\n if (changes[key]) {\n previousValue = changes[key].previousValue;\n }\n // Store this change\n changes[key] = new SimpleChange(previousValue, currentValue);\n }\n }\n\n function triggerOnChangesHook() {\n destination.$onChanges(changes);\n // Now clear the changes so that we schedule onChanges when more changes arrive\n changes = undefined;\n }\n\n return {\n initialChanges: initialChanges,\n removeWatches: removeWatchCollection.length && function removeWatches() {\n for (var i = 0, ii = removeWatchCollection.length; i < ii; ++i) {\n removeWatchCollection[i]();\n }\n }\n };\n }\n }];\n}\n\nfunction SimpleChange(previous, current) {\n this.previousValue = previous;\n this.currentValue = current;\n}\nSimpleChange.prototype.isFirstChange = function() { return this.previousValue === _UNINITIALIZED_VALUE; };\n\n\nvar PREFIX_REGEXP = /^((?:x|data)[:\\-_])/i;\nvar SPECIAL_CHARS_REGEXP = /[:\\-_]+(.)/g;\n\n/**\n * Converts all accepted directives format into proper directive name.\n * @param name Name to normalize\n */\nfunction directiveNormalize(name) {\n return name\n .replace(PREFIX_REGEXP, '')\n .replace(SPECIAL_CHARS_REGEXP, function(_, letter, offset) {\n return offset ? letter.toUpperCase() : letter;\n });\n}\n\n/**\n * @ngdoc type\n * @name $compile.directive.Attributes\n *\n * @description\n * A shared object between directive compile / linking functions which contains normalized DOM\n * element attributes. The values reflect current binding state `{{ }}`. The normalization is\n * needed since all of these are treated as equivalent in AngularJS:\n *\n * ```\n * \n * ```\n */\n\n/**\n * @ngdoc property\n * @name $compile.directive.Attributes#$attr\n *\n * @description\n * A map of DOM element attribute names to the normalized name. This is\n * needed to do reverse lookup from normalized name back to actual name.\n */\n\n\n/**\n * @ngdoc method\n * @name $compile.directive.Attributes#$set\n * @kind function\n *\n * @description\n * Set DOM element attribute value.\n *\n *\n * @param {string} name Normalized element attribute name of the property to modify. The name is\n * reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}\n * property to the original name.\n * @param {string} value Value to set the attribute to. The value can be an interpolated string.\n */\n\n\n\n/**\n * Closure compiler type information\n */\n\nfunction nodesetLinkingFn(\n /* angular.Scope */ scope,\n /* NodeList */ nodeList,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction directiveLinkingFn(\n /* nodesetLinkingFn */ nodesetLinkingFn,\n /* angular.Scope */ scope,\n /* Node */ node,\n /* Element */ rootElement,\n /* function(Function) */ boundTranscludeFn\n) {}\n\nfunction tokenDifference(str1, str2) {\n var values = '',\n tokens1 = str1.split(/\\s+/),\n tokens2 = str2.split(/\\s+/);\n\n outer:\n for (var i = 0; i < tokens1.length; i++) {\n var token = tokens1[i];\n for (var j = 0; j < tokens2.length; j++) {\n if (token === tokens2[j]) continue outer;\n }\n values += (values.length > 0 ? ' ' : '') + token;\n }\n return values;\n}\n\nfunction removeComments(jqNodes) {\n jqNodes = jqLite(jqNodes);\n var i = jqNodes.length;\n\n if (i <= 1) {\n return jqNodes;\n }\n\n while (i--) {\n var node = jqNodes[i];\n if (node.nodeType === NODE_TYPE_COMMENT ||\n (node.nodeType === NODE_TYPE_TEXT && node.nodeValue.trim() === '')) {\n splice.call(jqNodes, i, 1);\n }\n }\n return jqNodes;\n}\n\nvar $controllerMinErr = minErr('$controller');\n\n\nvar CNTRL_REG = /^(\\S+)(\\s+as\\s+([\\w$]+))?$/;\nfunction identifierForController(controller, ident) {\n if (ident && isString(ident)) return ident;\n if (isString(controller)) {\n var match = CNTRL_REG.exec(controller);\n if (match) return match[3];\n }\n}\n\n\n/**\n * @ngdoc provider\n * @name $controllerProvider\n * @this\n *\n * @description\n * The {@link ng.$controller $controller service} is used by AngularJS to create new\n * controllers.\n *\n * This provider allows controller registration via the\n * {@link ng.$controllerProvider#register register} method.\n */\nfunction $ControllerProvider() {\n var controllers = {};\n\n /**\n * @ngdoc method\n * @name $controllerProvider#has\n * @param {string} name Controller name to check.\n */\n this.has = function(name) {\n return controllers.hasOwnProperty(name);\n };\n\n /**\n * @ngdoc method\n * @name $controllerProvider#register\n * @param {string|Object} name Controller name, or an object map of controllers where the keys are\n * the names and the values are the constructors.\n * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI\n * annotations in the array notation).\n */\n this.register = function(name, constructor) {\n assertNotHasOwnProperty(name, 'controller');\n if (isObject(name)) {\n extend(controllers, name);\n } else {\n controllers[name] = constructor;\n }\n };\n\n this.$get = ['$injector', function($injector) {\n\n /**\n * @ngdoc service\n * @name $controller\n * @requires $injector\n *\n * @param {Function|string} constructor If called with a function then it's considered to be the\n * controller constructor function. Otherwise it's considered to be a string which is used\n * to retrieve the controller constructor using the following steps:\n *\n * * check if a controller with given name is registered via `$controllerProvider`\n * * check if evaluating the string on the current scope returns a constructor\n *\n * The string can use the `controller as property` syntax, where the controller instance is published\n * as the specified property on the `scope`; the `scope` must be injected into `locals` param for this\n * to work correctly.\n *\n * @param {Object} locals Injection locals for Controller.\n * @return {Object} Instance of given controller.\n *\n * @description\n * `$controller` service is responsible for instantiating controllers.\n *\n * It's just a simple call to {@link auto.$injector $injector}, but extracted into\n * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).\n */\n return function $controller(expression, locals, later, ident) {\n // PRIVATE API:\n // param `later` --- indicates that the controller's constructor is invoked at a later time.\n // If true, $controller will allocate the object with the correct\n // prototype chain, but will not invoke the controller until a returned\n // callback is invoked.\n // param `ident` --- An optional label which overrides the label parsed from the controller\n // expression, if any.\n var instance, match, constructor, identifier;\n later = later === true;\n if (ident && isString(ident)) {\n identifier = ident;\n }\n\n if (isString(expression)) {\n match = expression.match(CNTRL_REG);\n if (!match) {\n throw $controllerMinErr('ctrlfmt',\n 'Badly formed controller string \\'{0}\\'. ' +\n 'Must match `__name__ as __id__` or `__name__`.', expression);\n }\n constructor = match[1];\n identifier = identifier || match[3];\n expression = controllers.hasOwnProperty(constructor)\n ? controllers[constructor]\n : getter(locals.$scope, constructor, true);\n\n if (!expression) {\n throw $controllerMinErr('ctrlreg',\n 'The controller with the name \\'{0}\\' is not registered.', constructor);\n }\n\n assertArgFn(expression, constructor, true);\n }\n\n if (later) {\n // Instantiate controller later:\n // This machinery is used to create an instance of the object before calling the\n // controller's constructor itself.\n //\n // This allows properties to be added to the controller before the constructor is\n // invoked. Primarily, this is used for isolate scope bindings in $compile.\n //\n // This feature is not intended for use by applications, and is thus not documented\n // publicly.\n // Object creation: http://jsperf.com/create-constructor/2\n var controllerPrototype = (isArray(expression) ?\n expression[expression.length - 1] : expression).prototype;\n instance = Object.create(controllerPrototype || null);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return extend(function $controllerInit() {\n var result = $injector.invoke(expression, instance, locals, constructor);\n if (result !== instance && (isObject(result) || isFunction(result))) {\n instance = result;\n if (identifier) {\n // If result changed, re-assign controllerAs value to scope.\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n }\n return instance;\n }, {\n instance: instance,\n identifier: identifier\n });\n }\n\n instance = $injector.instantiate(expression, locals, constructor);\n\n if (identifier) {\n addIdentifier(locals, identifier, instance, constructor || expression.name);\n }\n\n return instance;\n };\n\n function addIdentifier(locals, identifier, instance, name) {\n if (!(locals && isObject(locals.$scope))) {\n throw minErr('$controller')('noscp',\n 'Cannot export controller \\'{0}\\' as \\'{1}\\'! No $scope object provided via `locals`.',\n name, identifier);\n }\n\n locals.$scope[identifier] = instance;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $document\n * @requires $window\n * @this\n *\n * @description\n * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.\n *\n * @example\n \n \n
      \n

      $document title:

      \n

      window.document title:

      \n
      \n
      \n \n angular.module('documentExample', [])\n .controller('ExampleController', ['$scope', '$document', function($scope, $document) {\n $scope.title = $document[0].title;\n $scope.windowTitle = angular.element(window.document)[0].title;\n }]);\n \n
      \n */\nfunction $DocumentProvider() {\n this.$get = ['$window', function(window) {\n return jqLite(window.document);\n }];\n}\n\n\n/**\n * @private\n * @this\n * Listens for document visibility change and makes the current status accessible.\n */\nfunction $$IsDocumentHiddenProvider() {\n this.$get = ['$document', '$rootScope', function($document, $rootScope) {\n var doc = $document[0];\n var hidden = doc && doc.hidden;\n\n $document.on('visibilitychange', changeListener);\n\n $rootScope.$on('$destroy', function() {\n $document.off('visibilitychange', changeListener);\n });\n\n function changeListener() {\n hidden = doc.hidden;\n }\n\n return function() {\n return hidden;\n };\n }];\n}\n\n/**\n * @ngdoc service\n * @name $exceptionHandler\n * @requires ng.$log\n * @this\n *\n * @description\n * Any uncaught exception in AngularJS expressions is delegated to this service.\n * The default implementation simply delegates to `$log.error` which logs it into\n * the browser console.\n *\n * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by\n * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.\n *\n * ## Example:\n *\n * The example below will overwrite the default `$exceptionHandler` in order to (a) log uncaught\n * errors to the backend for later inspection by the developers and (b) to use `$log.warn()` instead\n * of `$log.error()`.\n *\n * ```js\n * angular.\n * module('exceptionOverwrite', []).\n * factory('$exceptionHandler', ['$log', 'logErrorsToBackend', function($log, logErrorsToBackend) {\n * return function myExceptionHandler(exception, cause) {\n * logErrorsToBackend(exception, cause);\n * $log.warn(exception, cause);\n * };\n * }]);\n * ```\n *\n *
      \n * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`\n * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}\n * (unless executed during a digest).\n *\n * If you wish, you can manually delegate exceptions, e.g.\n * `try { ... } catch(e) { $exceptionHandler(e); }`\n *\n * @param {Error} exception Exception associated with the error.\n * @param {string=} cause Optional information about the context in which\n * the error was thrown.\n *\n */\nfunction $ExceptionHandlerProvider() {\n this.$get = ['$log', function($log) {\n return function(exception, cause) {\n $log.error.apply($log, arguments);\n };\n }];\n}\n\nvar $$ForceReflowProvider = /** @this */ function() {\n this.$get = ['$document', function($document) {\n return function(domNode) {\n //the line below will force the browser to perform a repaint so\n //that all the animated elements within the animation frame will\n //be properly updated and drawn on screen. This is required to\n //ensure that the preparation animation is properly flushed so that\n //the active state picks up from there. DO NOT REMOVE THIS LINE.\n //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH\n //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND\n //WILL TAKE YEARS AWAY FROM YOUR LIFE.\n if (domNode) {\n if (!domNode.nodeType && domNode instanceof jqLite) {\n domNode = domNode[0];\n }\n } else {\n domNode = $document[0].body;\n }\n return domNode.offsetWidth + 1;\n };\n }];\n};\n\nvar APPLICATION_JSON = 'application/json';\nvar CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};\nvar JSON_START = /^\\[|^\\{(?!\\{)/;\nvar JSON_ENDS = {\n '[': /]$/,\n '{': /}$/\n};\nvar JSON_PROTECTION_PREFIX = /^\\)]\\}',?\\n/;\nvar $httpMinErr = minErr('$http');\n\nfunction serializeValue(v) {\n if (isObject(v)) {\n return isDate(v) ? v.toISOString() : toJson(v);\n }\n return v;\n}\n\n\n/** @this */\nfunction $HttpParamSerializerProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializer\n * @description\n *\n * Default {@link $http `$http`} params serializer that converts objects to strings\n * according to the following rules:\n *\n * * `{'foo': 'bar'}` results in `foo=bar`\n * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)\n * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)\n * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D` (stringified and encoded representation of an object)\n *\n * Note that serializer will sort the request parameters alphabetically.\n */\n\n this.$get = function() {\n return function ngParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n forEachSorted(params, function(value, key) {\n if (value === null || isUndefined(value) || isFunction(value)) return;\n if (isArray(value)) {\n forEach(value, function(v) {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));\n });\n } else {\n parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));\n }\n });\n\n return parts.join('&');\n };\n };\n}\n\n/** @this */\nfunction $HttpParamSerializerJQLikeProvider() {\n /**\n * @ngdoc service\n * @name $httpParamSerializerJQLike\n *\n * @description\n *\n * Alternative {@link $http `$http`} params serializer that follows\n * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.\n * The serializer will also sort the params alphabetically.\n *\n * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:\n *\n * ```js\n * $http({\n * url: myUrl,\n * method: 'GET',\n * params: myParams,\n * paramSerializer: '$httpParamSerializerJQLike'\n * });\n * ```\n *\n * It is also possible to set it as the default `paramSerializer` in the\n * {@link $httpProvider#defaults `$httpProvider`}.\n *\n * Additionally, you can inject the serializer and use it explicitly, for example to serialize\n * form data for submission:\n *\n * ```js\n * .controller(function($http, $httpParamSerializerJQLike) {\n * //...\n *\n * $http({\n * url: myUrl,\n * method: 'POST',\n * data: $httpParamSerializerJQLike(myData),\n * headers: {\n * 'Content-Type': 'application/x-www-form-urlencoded'\n * }\n * });\n *\n * });\n * ```\n *\n */\n this.$get = function() {\n return function jQueryLikeParamSerializer(params) {\n if (!params) return '';\n var parts = [];\n serialize(params, '', true);\n return parts.join('&');\n\n function serialize(toSerialize, prefix, topLevel) {\n if (isArray(toSerialize)) {\n forEach(toSerialize, function(value, index) {\n serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');\n });\n } else if (isObject(toSerialize) && !isDate(toSerialize)) {\n forEachSorted(toSerialize, function(value, key) {\n serialize(value, prefix +\n (topLevel ? '' : '[') +\n key +\n (topLevel ? '' : ']'));\n });\n } else {\n if (isFunction(toSerialize)) {\n toSerialize = toSerialize();\n }\n parts.push(encodeUriQuery(prefix) + '=' +\n (toSerialize == null ? '' : encodeUriQuery(serializeValue(toSerialize))));\n }\n }\n };\n };\n}\n\nfunction defaultHttpResponseTransform(data, headers) {\n if (isString(data)) {\n // Strip json vulnerability protection prefix and trim whitespace\n var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();\n\n if (tempData) {\n var contentType = headers('Content-Type');\n var hasJsonContentType = contentType && (contentType.indexOf(APPLICATION_JSON) === 0);\n\n if (hasJsonContentType || isJsonLike(tempData)) {\n try {\n data = fromJson(tempData);\n } catch (e) {\n if (!hasJsonContentType) {\n return data;\n }\n throw $httpMinErr('baddata', 'Data must be a valid JSON object. Received: \"{0}\". ' +\n 'Parse error: \"{1}\"', data, e);\n }\n }\n }\n }\n\n return data;\n}\n\nfunction isJsonLike(str) {\n var jsonStart = str.match(JSON_START);\n return jsonStart && JSON_ENDS[jsonStart[0]].test(str);\n}\n\n/**\n * Parse headers into key value object\n *\n * @param {string} headers Raw headers as a string\n * @returns {Object} Parsed headers as key value object\n */\nfunction parseHeaders(headers) {\n var parsed = createMap(), i;\n\n function fillInParsed(key, val) {\n if (key) {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n\n if (isString(headers)) {\n forEach(headers.split('\\n'), function(line) {\n i = line.indexOf(':');\n fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));\n });\n } else if (isObject(headers)) {\n forEach(headers, function(headerVal, headerKey) {\n fillInParsed(lowercase(headerKey), trim(headerVal));\n });\n }\n\n return parsed;\n}\n\n\n/**\n * Returns a function that provides access to parsed headers.\n *\n * Headers are lazy parsed when first requested.\n * @see parseHeaders\n *\n * @param {(string|Object)} headers Headers to provide access to.\n * @returns {function(string=)} Returns a getter function which if called with:\n *\n * - if called with an argument returns a single header value or null\n * - if called with no arguments returns an object containing all headers.\n */\nfunction headersGetter(headers) {\n var headersObj;\n\n return function(name) {\n if (!headersObj) headersObj = parseHeaders(headers);\n\n if (name) {\n var value = headersObj[lowercase(name)];\n if (value === undefined) {\n value = null;\n }\n return value;\n }\n\n return headersObj;\n };\n}\n\n\n/**\n * Chain all given functions\n *\n * This function is used for both request and response transforming\n *\n * @param {*} data Data to transform.\n * @param {function(string=)} headers HTTP headers getter fn.\n * @param {number} status HTTP status code of the response.\n * @param {(Function|Array.)} fns Function or an array of functions.\n * @returns {*} Transformed data.\n */\nfunction transformData(data, headers, status, fns) {\n if (isFunction(fns)) {\n return fns(data, headers, status);\n }\n\n forEach(fns, function(fn) {\n data = fn(data, headers, status);\n });\n\n return data;\n}\n\n\nfunction isSuccess(status) {\n return 200 <= status && status < 300;\n}\n\n\n/**\n * @ngdoc provider\n * @name $httpProvider\n * @this\n *\n * @description\n * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.\n */\nfunction $HttpProvider() {\n /**\n * @ngdoc property\n * @name $httpProvider#defaults\n * @description\n *\n * Object containing default values for all {@link ng.$http $http} requests.\n *\n * - **`defaults.cache`** - {boolean|Object} - A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of HTTP responses\n * by default. See {@link $http#caching $http Caching} for more information.\n *\n * - **`defaults.headers`** - {Object} - Default headers for all $http requests.\n * Refer to {@link ng.$http#setting-http-headers $http} for documentation on\n * setting default headers.\n * - **`defaults.headers.common`**\n * - **`defaults.headers.post`**\n * - **`defaults.headers.put`**\n * - **`defaults.headers.patch`**\n *\n * - **`defaults.jsonpCallbackParam`** - `{string}` - the name of the query parameter that passes the name of the\n * callback in a JSONP request. The value of this parameter will be replaced with the expression generated by the\n * {@link $jsonpCallbacks} service. Defaults to `'callback'`.\n *\n * - **`defaults.paramSerializer`** - `{string|function(Object):string}` - A function\n * used to the prepare string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.\n * Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.\n *\n * - **`defaults.transformRequest`** -\n * `{Array|function(data, headersGetter)}` -\n * An array of functions (or a single function) which are applied to the request data.\n * By default, this is an array with one request transformation function:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * - **`defaults.transformResponse`** -\n * `{Array|function(data, headersGetter, status)}` -\n * An array of functions (or a single function) which are applied to the response data. By default,\n * this is an array which applies one response transformation function that does two things:\n *\n * - If XSRF prefix is detected, strip it\n * (see {@link ng.$http#security-considerations Security Considerations in the $http docs}).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.\n * Defaults value is `'XSRF-TOKEN'`.\n *\n * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the\n * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.\n *\n */\n var defaults = this.defaults = {\n // transform incoming response data\n transformResponse: [defaultHttpResponseTransform],\n\n // transform outgoing request data\n transformRequest: [function(d) {\n return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;\n }],\n\n // default headers\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n },\n post: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n put: shallowCopy(CONTENT_TYPE_APPLICATION_JSON),\n patch: shallowCopy(CONTENT_TYPE_APPLICATION_JSON)\n },\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n paramSerializer: '$httpParamSerializer',\n\n jsonpCallbackParam: 'callback'\n };\n\n var useApplyAsync = false;\n /**\n * @ngdoc method\n * @name $httpProvider#useApplyAsync\n * @description\n *\n * Configure $http service to combine processing of multiple http responses received at around\n * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in\n * significant performance improvement for bigger applications that make many HTTP requests\n * concurrently (common during application bootstrap).\n *\n * Defaults to false. If no value is specified, returns the current configured value.\n *\n * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred\n * \"apply\" on the next tick, giving time for subsequent requests in a roughly ~10ms window\n * to load and share the same digest cycle.\n *\n * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.\n * otherwise, returns the current configured value.\n */\n this.useApplyAsync = function(value) {\n if (isDefined(value)) {\n useApplyAsync = !!value;\n return this;\n }\n return useApplyAsync;\n };\n\n /**\n * @ngdoc property\n * @name $httpProvider#interceptors\n * @description\n *\n * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}\n * pre-processing of request or postprocessing of responses.\n *\n * These service factories are ordered by request, i.e. they are applied in the same order as the\n * array, on request, but reverse order, on response.\n *\n * {@link ng.$http#interceptors Interceptors detailed info}\n */\n var interceptorFactories = this.interceptors = [];\n\n /**\n * @ngdoc property\n * @name $httpProvider#xsrfTrustedOrigins\n * @description\n *\n * Array containing URLs whose origins are trusted to receive the XSRF token. See the\n * {@link ng.$http#security-considerations Security Considerations} sections for more details on\n * XSRF.\n *\n * **Note:** An \"origin\" consists of the [URI scheme](https://en.wikipedia.org/wiki/URI_scheme),\n * the [hostname](https://en.wikipedia.org/wiki/Hostname) and the\n * [port number](https://en.wikipedia.org/wiki/Port_(computer_networking). For `http:` and\n * `https:`, the port number can be omitted if using th default ports (80 and 443 respectively).\n * Examples: `http://example.com`, `https://api.example.com:9876`\n *\n *
      \n * It is not possible to trust specific URLs/paths. The `path`, `query` and `fragment` parts\n * of a URL will be ignored. For example, `https://foo.com/path/bar?query=baz#fragment` will be\n * treated as `https://foo.com`, meaning that **all** requests to URLs starting with\n * `https://foo.com/` will include the XSRF token.\n *
      \n *\n * @example\n *\n * ```js\n * // App served from `https://example.com/`.\n * angular.\n * module('xsrfTrustedOriginsExample', []).\n * config(['$httpProvider', function($httpProvider) {\n * $httpProvider.xsrfTrustedOrigins.push('https://api.example.com');\n * }]).\n * run(['$http', function($http) {\n * // The XSRF token will be sent.\n * $http.get('https://api.example.com/preferences').then(...);\n *\n * // The XSRF token will NOT be sent.\n * $http.get('https://stats.example.com/activity').then(...);\n * }]);\n * ```\n */\n var xsrfTrustedOrigins = this.xsrfTrustedOrigins = [];\n\n /**\n * @ngdoc property\n * @name $httpProvider#xsrfWhitelistedOrigins\n * @description\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This property is deprecated. Use {@link $httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}\n * instead.\n */\n Object.defineProperty(this, 'xsrfWhitelistedOrigins', {\n get: function() {\n return this.xsrfTrustedOrigins;\n },\n set: function(origins) {\n this.xsrfTrustedOrigins = origins;\n }\n });\n\n this.$get = ['$browser', '$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector', '$sce',\n function($browser, $httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector, $sce) {\n\n var defaultCache = $cacheFactory('$http');\n\n /**\n * Make sure that default param serializer is exposed as a function\n */\n defaults.paramSerializer = isString(defaults.paramSerializer) ?\n $injector.get(defaults.paramSerializer) : defaults.paramSerializer;\n\n /**\n * Interceptors stored in reverse order. Inner interceptors before outer interceptors.\n * The reversal is needed so that we can build up the interception chain around the\n * server request.\n */\n var reversedInterceptors = [];\n\n forEach(interceptorFactories, function(interceptorFactory) {\n reversedInterceptors.unshift(isString(interceptorFactory)\n ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));\n });\n\n /**\n * A function to check request URLs against a list of allowed origins.\n */\n var urlIsAllowedOrigin = urlIsAllowedOriginFactory(xsrfTrustedOrigins);\n\n /**\n * @ngdoc service\n * @kind function\n * @name $http\n * @requires ng.$httpBackend\n * @requires $cacheFactory\n * @requires $rootScope\n * @requires $q\n * @requires $injector\n *\n * @description\n * The `$http` service is a core AngularJS service that facilitates communication with the remote\n * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)\n * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).\n *\n * For unit testing applications that use `$http` service, see\n * {@link ngMock.$httpBackend $httpBackend mock}.\n *\n * For a higher level of abstraction, please check out the {@link ngResource.$resource\n * $resource} service.\n *\n * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by\n * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage\n * it is important to familiarize yourself with these APIs and the guarantees they provide.\n *\n *\n * ## General usage\n * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —\n * that is used to generate an HTTP request and returns a {@link ng.$q promise} that is\n * resolved (request success) or rejected (request failure) with a\n * {@link ng.$http#$http-returns response} object.\n *\n * ```js\n * // Simple GET request example:\n * $http({\n * method: 'GET',\n * url: '/someUrl'\n * }).then(function successCallback(response) {\n * // this callback will be called asynchronously\n * // when the response is available\n * }, function errorCallback(response) {\n * // called asynchronously if an error occurs\n * // or server returns response with an error status.\n * });\n * ```\n *\n *\n * ## Shortcut methods\n *\n * Shortcut methods are also available. All shortcut methods require passing in the URL, and\n * request data must be passed in for POST/PUT requests. An optional config can be passed as the\n * last argument.\n *\n * ```js\n * $http.get('/someUrl', config).then(successCallback, errorCallback);\n * $http.post('/someUrl', data, config).then(successCallback, errorCallback);\n * ```\n *\n * Complete list of shortcut methods:\n *\n * - {@link ng.$http#get $http.get}\n * - {@link ng.$http#head $http.head}\n * - {@link ng.$http#post $http.post}\n * - {@link ng.$http#put $http.put}\n * - {@link ng.$http#delete $http.delete}\n * - {@link ng.$http#jsonp $http.jsonp}\n * - {@link ng.$http#patch $http.patch}\n *\n *\n * ## Writing Unit Tests that use $http\n * When unit testing (using {@link ngMock ngMock}), it is necessary to call\n * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending\n * request using trained responses.\n *\n * ```\n * $httpBackend.expectGET(...);\n * $http.get(...);\n * $httpBackend.flush();\n * ```\n *\n * ## Setting HTTP Headers\n *\n * The $http service will automatically add certain HTTP headers to all requests. These defaults\n * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration\n * object, which currently contains this default configuration:\n *\n * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):\n * - Accept: application/json, text/plain, \\*/\\*\n * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)\n * - `Content-Type: application/json`\n * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)\n * - `Content-Type: application/json`\n *\n * To add or overwrite these defaults, simply add or remove a property from these configuration\n * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object\n * with the lowercased HTTP method name as the key, e.g.\n * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.\n *\n * The defaults can also be set at runtime via the `$http.defaults` object in the same\n * fashion. For example:\n *\n * ```\n * module.run(function($http) {\n * $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w';\n * });\n * ```\n *\n * In addition, you can supply a `headers` property in the config object passed when\n * calling `$http(config)`, which overrides the defaults without changing them globally.\n *\n * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,\n * Use the `headers` property, setting the desired header to `undefined`. For example:\n *\n * ```js\n * var req = {\n * method: 'POST',\n * url: 'http://example.com',\n * headers: {\n * 'Content-Type': undefined\n * },\n * data: { test: 'test' }\n * }\n *\n * $http(req).then(function(){...}, function(){...});\n * ```\n *\n * ## Transforming Requests and Responses\n *\n * Both requests and responses can be transformed using transformation functions: `transformRequest`\n * and `transformResponse`. These properties can be a single function that returns\n * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,\n * which allows you to `push` or `unshift` a new transformation function into the transformation chain.\n *\n *
      \n * **Note:** AngularJS does not make a copy of the `data` parameter before it is passed into the `transformRequest` pipeline.\n * That means changes to the properties of `data` are not local to the transform function (since Javascript passes objects by reference).\n * For example, when calling `$http.get(url, $scope.myObject)`, modifications to the object's properties in a transformRequest\n * function will be reflected on the scope and in any templates where the object is data-bound.\n * To prevent this, transform functions should have no side-effects.\n * If you need to modify properties, it is recommended to make a copy of the data, or create new object to return.\n *
      \n *\n * ### Default Transformations\n *\n * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and\n * `defaults.transformResponse` properties. If a request does not provide its own transformations\n * then these will be applied.\n *\n * You can augment or replace the default transformations by modifying these properties by adding to or\n * replacing the array.\n *\n * AngularJS provides the following default transformations:\n *\n * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`) is\n * an array with one function that does the following:\n *\n * - If the `data` property of the request configuration object contains an object, serialize it\n * into JSON format.\n *\n * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`) is\n * an array with one function that does the following:\n *\n * - If XSRF prefix is detected, strip it (see Security Considerations section below).\n * - If the `Content-Type` is `application/json` or the response looks like JSON,\n * deserialize it using a JSON parser.\n *\n *\n * ### Overriding the Default Transformations Per Request\n *\n * If you wish to override the request/response transformations only for a single request then provide\n * `transformRequest` and/or `transformResponse` properties on the configuration object passed\n * into `$http`.\n *\n * Note that if you provide these properties on the config object the default transformations will be\n * overwritten. If you wish to augment the default transformations then you must include them in your\n * local transformation array.\n *\n * The following code demonstrates adding a new response transformation to be run after the default response\n * transformations have been run.\n *\n * ```js\n * function appendTransform(defaults, transform) {\n *\n * // We can't guarantee that the default transformation is an array\n * defaults = angular.isArray(defaults) ? defaults : [defaults];\n *\n * // Append the new transformation to the defaults\n * return defaults.concat(transform);\n * }\n *\n * $http({\n * url: '...',\n * method: 'GET',\n * transformResponse: appendTransform($http.defaults.transformResponse, function(value) {\n * return doTransform(value);\n * })\n * });\n * ```\n *\n *\n * ## Caching\n *\n * {@link ng.$http `$http`} responses are not cached by default. To enable caching, you must\n * set the config.cache value or the default cache value to TRUE or to a cache object (created\n * with {@link ng.$cacheFactory `$cacheFactory`}). If defined, the value of config.cache takes\n * precedence over the default cache value.\n *\n * In order to:\n * * cache all responses - set the default cache value to TRUE or to a cache object\n * * cache a specific response - set config.cache value to TRUE or to a cache object\n *\n * If caching is enabled, but neither the default cache nor config.cache are set to a cache object,\n * then the default `$cacheFactory(\"$http\")` object is used.\n *\n * The default cache value can be set by updating the\n * {@link ng.$http#defaults `$http.defaults.cache`} property or the\n * {@link $httpProvider#defaults `$httpProvider.defaults.cache`} property.\n *\n * When caching is enabled, {@link ng.$http `$http`} stores the response from the server using\n * the relevant cache object. The next time the same request is made, the response is returned\n * from the cache without sending a request to the server.\n *\n * Take note that:\n *\n * * Only GET and JSONP requests are cached.\n * * The cache key is the request URL including search parameters; headers are not considered.\n * * Cached responses are returned asynchronously, in the same way as responses from the server.\n * * If multiple identical requests are made using the same cache, which is not yet populated,\n * one request will be made to the server and remaining requests will return the same response.\n * * A cache-control header on the response does not affect if or how responses are cached.\n *\n *\n * ## Interceptors\n *\n * Before you start creating interceptors, be sure to understand the\n * {@link ng.$q $q and deferred/promise APIs}.\n *\n * For purposes of global error handling, authentication, or any kind of synchronous or\n * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be\n * able to intercept requests before they are handed to the server and\n * responses before they are handed over to the application code that\n * initiated these requests. The interceptors leverage the {@link ng.$q\n * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.\n *\n * The interceptors are service factories that are registered with the `$httpProvider` by\n * adding them to the `$httpProvider.interceptors` array. The factory is called and\n * injected with dependencies (if specified) and returns the interceptor.\n *\n * There are two kinds of interceptors (and two kinds of rejection interceptors):\n *\n * * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to\n * modify the `config` object or create a new one. The function needs to return the `config`\n * object directly, or a promise containing the `config` or a new `config` object.\n * * `requestError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n * * `response`: interceptors get called with http `response` object. The function is free to\n * modify the `response` object or create a new one. The function needs to return the `response`\n * object directly, or as a promise containing the `response` or a new `response` object.\n * * `responseError`: interceptor gets called when a previous interceptor threw an error or\n * resolved with a rejection.\n *\n *\n * ```js\n * // register the interceptor as a service\n * $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {\n * return {\n * // optional method\n * 'request': function(config) {\n * // do something on success\n * return config;\n * },\n *\n * // optional method\n * 'requestError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * },\n *\n *\n *\n * // optional method\n * 'response': function(response) {\n * // do something on success\n * return response;\n * },\n *\n * // optional method\n * 'responseError': function(rejection) {\n * // do something on error\n * if (canRecover(rejection)) {\n * return responseOrNewPromise\n * }\n * return $q.reject(rejection);\n * }\n * };\n * });\n *\n * $httpProvider.interceptors.push('myHttpInterceptor');\n *\n *\n * // alternatively, register the interceptor via an anonymous factory\n * $httpProvider.interceptors.push(function($q, dependency1, dependency2) {\n * return {\n * 'request': function(config) {\n * // same as above\n * },\n *\n * 'response': function(response) {\n * // same as above\n * }\n * };\n * });\n * ```\n *\n * ## Security Considerations\n *\n * When designing web applications, consider security threats from:\n *\n * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)\n *\n * Both server and the client must cooperate in order to eliminate these threats. AngularJS comes\n * pre-configured with strategies that address these issues, but for this to work backend server\n * cooperation is required.\n *\n * ### JSON Vulnerability Protection\n *\n * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)\n * allows third party website to turn your JSON resource URL into\n * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To\n * counter this your server can prefix all JSON requests with following string `\")]}',\\n\"`.\n * AngularJS will automatically strip the prefix before processing it as JSON.\n *\n * For example if your server needs to return:\n * ```js\n * ['one','two']\n * ```\n *\n * which is vulnerable to attack, your server can return:\n * ```js\n * )]}',\n * ['one','two']\n * ```\n *\n * AngularJS will strip the prefix, before processing the JSON.\n *\n *\n * ### Cross Site Request Forgery (XSRF) Protection\n *\n * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is an attack technique by\n * which the attacker can trick an authenticated user into unknowingly executing actions on your\n * website. AngularJS provides a mechanism to counter XSRF. When performing XHR requests, the\n * $http service reads a token from a cookie (by default, `XSRF-TOKEN`) and sets it as an HTTP\n * header (by default `X-XSRF-TOKEN`). Since only JavaScript that runs on your domain could read\n * the cookie, your server can be assured that the XHR came from JavaScript running on your\n * domain.\n *\n * To take advantage of this, your server needs to set a token in a JavaScript readable session\n * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the\n * server can verify that the cookie matches the `X-XSRF-TOKEN` HTTP header, and therefore be\n * sure that only JavaScript running on your domain could have sent the request. The token must\n * be unique for each user and must be verifiable by the server (to prevent the JavaScript from\n * making up its own tokens). We recommend that the token is a digest of your site's\n * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography))\n * for added security.\n *\n * The header will — by default — **not** be set for cross-domain requests. This\n * prevents unauthorized servers (e.g. malicious or compromised 3rd-party APIs) from gaining\n * access to your users' XSRF tokens and exposing them to Cross Site Request Forgery. If you\n * want to, you can trust additional origins to also receive the XSRF token, by adding them\n * to {@link ng.$httpProvider#xsrfTrustedOrigins xsrfTrustedOrigins}. This might be\n * useful, for example, if your application, served from `example.com`, needs to access your API\n * at `api.example.com`.\n * See {@link ng.$httpProvider#xsrfTrustedOrigins $httpProvider.xsrfTrustedOrigins} for\n * more details.\n *\n *
      \n * **Warning**
      \n * Only trusted origins that you have control over and make sure you understand the\n * implications of doing so.\n *
      \n *\n * The name of the cookie and the header can be specified using the `xsrfCookieName` and\n * `xsrfHeaderName` properties of either `$httpProvider.defaults` at config-time,\n * `$http.defaults` at run-time, or the per-request config object.\n *\n * In order to prevent collisions in environments where multiple AngularJS apps share the\n * same domain or subdomain, we recommend that each application uses a unique cookie name.\n *\n *\n * @param {object} config Object describing the request to be made and how it should be\n * processed. The object has following properties:\n *\n * - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)\n * - **url** – `{string|TrustedObject}` – Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * - **params** – `{Object.}` – Map of strings or objects which will be serialized\n * with the `paramSerializer` and appended as GET parameters.\n * - **data** – `{string|Object}` – Data to be sent as the request message data.\n * - **headers** – `{Object}` – Map of strings or functions which return strings representing\n * HTTP headers to send to the server. If the return value of a function is null, the\n * header will not be sent. Functions accept a config object as an argument.\n * - **eventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest object.\n * To bind events to the XMLHttpRequest upload object, use `uploadEventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **uploadEventHandlers** - `{Object}` - Event listeners to be bound to the XMLHttpRequest upload\n * object. To bind events to the XMLHttpRequest object, use `eventHandlers`.\n * The handler will be called in the context of a `$apply` block.\n * - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.\n * - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.\n * - **transformRequest** –\n * `{function(data, headersGetter)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * request body and headers and returns its transformed (typically serialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **transformResponse** –\n * `{function(data, headersGetter, status)|Array.}` –\n * transform function or an array of such functions. The transform function takes the http\n * response body, headers and status and returns its transformed (typically deserialized) version.\n * See {@link ng.$http#overriding-the-default-transformations-per-request\n * Overriding the Default Transformations}\n * - **paramSerializer** - `{string|function(Object):string}` - A function used to\n * prepare the string representation of request parameters (specified as an object).\n * If specified as string, it is interpreted as function registered with the\n * {@link $injector $injector}, which means you can create your own serializer\n * by registering it as a {@link auto.$provide#service service}.\n * The default serializer is the {@link $httpParamSerializer $httpParamSerializer};\n * alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}\n * - **cache** – `{boolean|Object}` – A boolean value or object created with\n * {@link ng.$cacheFactory `$cacheFactory`} to enable or disable caching of the HTTP response.\n * See {@link $http#caching $http Caching} for more information.\n * - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}\n * that should abort the request when resolved.\n *\n * A numerical timeout or a promise returned from {@link ng.$timeout $timeout}, will set\n * the `xhrStatus` in the {@link $http#$http-returns response} to \"timeout\", and any other\n * resolved promise will set it to \"abort\", following standard XMLHttpRequest behavior.\n *\n * - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the\n * XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)\n * for more information.\n * - **responseType** - `{string}` - see\n * [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).\n *\n * @returns {HttpPromise} A {@link ng.$q `Promise}` that will be resolved (request success)\n * or rejected (request failure) with a response object.\n *\n * The response object has these properties:\n *\n * - **data** – `{string|Object}` – The response body transformed with\n * the transform functions.\n * - **status** – `{number}` – HTTP status code of the response.\n * - **headers** – `{function([headerName])}` – Header getter function.\n * - **config** – `{Object}` – The configuration object that was used\n * to generate the request.\n * - **statusText** – `{string}` – HTTP status text of the response.\n * - **xhrStatus** – `{string}` – Status of the XMLHttpRequest\n * (`complete`, `error`, `timeout` or `abort`).\n *\n *\n * A response status code between 200 and 299 is considered a success status\n * and will result in the success callback being called. Any response status\n * code outside of that range is considered an error status and will result\n * in the error callback being called.\n * Also, status codes less than -1 are normalized to zero. -1 usually means\n * the request was aborted, e.g. using a `config.timeout`. More information\n * about the status might be available in the `xhrStatus` property.\n *\n * Note that if the response is a redirect, XMLHttpRequest will transparently\n * follow it, meaning that the outcome (success or error) will be determined\n * by the final response status code.\n *\n *\n * @property {Array.} pendingRequests Array of config objects for currently pending\n * requests. This is primarily meant to be used for debugging purposes.\n *\n *\n * @example\n\n\n
      \n \n \n
      \n \n \n \n
      http status code: {{status}}
      \n
      http response data: {{data}}
      \n
      \n
      \n\n angular.module('httpExample', [])\n .config(['$sceDelegateProvider', function($sceDelegateProvider) {\n // We must add the JSONP endpoint that we are using to the trusted list to show that we trust it\n $sceDelegateProvider.trustedResourceUrlList([\n 'self',\n 'https://angularjs.org/**'\n ]);\n }])\n .controller('FetchController', ['$scope', '$http', '$templateCache',\n function($scope, $http, $templateCache) {\n $scope.method = 'GET';\n $scope.url = 'http-hello.html';\n\n $scope.fetch = function() {\n $scope.code = null;\n $scope.response = null;\n\n $http({method: $scope.method, url: $scope.url, cache: $templateCache}).\n then(function(response) {\n $scope.status = response.status;\n $scope.data = response.data;\n }, function(response) {\n $scope.data = response.data || 'Request failed';\n $scope.status = response.status;\n });\n };\n\n $scope.updateModel = function(method, url) {\n $scope.method = method;\n $scope.url = url;\n };\n }]);\n\n\n Hello, $http!\n\n\n var status = element(by.binding('status'));\n var data = element(by.binding('data'));\n var fetchBtn = element(by.id('fetchbtn'));\n var sampleGetBtn = element(by.id('samplegetbtn'));\n var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));\n\n it('should make an xhr GET request', function() {\n sampleGetBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('200');\n expect(data.getText()).toMatch(/Hello, \\$http!/);\n });\n\n// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185\n// it('should make a JSONP request to angularjs.org', function() {\n// var sampleJsonpBtn = element(by.id('samplejsonpbtn'));\n// sampleJsonpBtn.click();\n// fetchBtn.click();\n// expect(status.getText()).toMatch('200');\n// expect(data.getText()).toMatch(/Super Hero!/);\n// });\n\n it('should make JSONP request to invalid URL and invoke the error handler',\n function() {\n invalidJsonpBtn.click();\n fetchBtn.click();\n expect(status.getText()).toMatch('0');\n expect(data.getText()).toMatch('Request failed');\n });\n\n
      \n */\n function $http(requestConfig) {\n\n if (!isObject(requestConfig)) {\n throw minErr('$http')('badreq', 'Http request configuration must be an object. Received: {0}', requestConfig);\n }\n\n if (!isString($sce.valueOf(requestConfig.url))) {\n throw minErr('$http')('badreq', 'Http request configuration url must be a string or a $sce trusted object. Received: {0}', requestConfig.url);\n }\n\n var config = extend({\n method: 'get',\n transformRequest: defaults.transformRequest,\n transformResponse: defaults.transformResponse,\n paramSerializer: defaults.paramSerializer,\n jsonpCallbackParam: defaults.jsonpCallbackParam\n }, requestConfig);\n\n config.headers = mergeHeaders(requestConfig);\n config.method = uppercase(config.method);\n config.paramSerializer = isString(config.paramSerializer) ?\n $injector.get(config.paramSerializer) : config.paramSerializer;\n\n $browser.$$incOutstandingRequestCount('$http');\n\n var requestInterceptors = [];\n var responseInterceptors = [];\n var promise = $q.resolve(config);\n\n // apply interceptors\n forEach(reversedInterceptors, function(interceptor) {\n if (interceptor.request || interceptor.requestError) {\n requestInterceptors.unshift(interceptor.request, interceptor.requestError);\n }\n if (interceptor.response || interceptor.responseError) {\n responseInterceptors.push(interceptor.response, interceptor.responseError);\n }\n });\n\n promise = chainInterceptors(promise, requestInterceptors);\n promise = promise.then(serverRequest);\n promise = chainInterceptors(promise, responseInterceptors);\n promise = promise.finally(completeOutstandingRequest);\n\n return promise;\n\n\n function chainInterceptors(promise, interceptors) {\n for (var i = 0, ii = interceptors.length; i < ii;) {\n var thenFn = interceptors[i++];\n var rejectFn = interceptors[i++];\n\n promise = promise.then(thenFn, rejectFn);\n }\n\n interceptors.length = 0;\n\n return promise;\n }\n\n function completeOutstandingRequest() {\n $browser.$$completeOutstandingRequest(noop, '$http');\n }\n\n function executeHeaderFns(headers, config) {\n var headerContent, processedHeaders = {};\n\n forEach(headers, function(headerFn, header) {\n if (isFunction(headerFn)) {\n headerContent = headerFn(config);\n if (headerContent != null) {\n processedHeaders[header] = headerContent;\n }\n } else {\n processedHeaders[header] = headerFn;\n }\n });\n\n return processedHeaders;\n }\n\n function mergeHeaders(config) {\n var defHeaders = defaults.headers,\n reqHeaders = extend({}, config.headers),\n defHeaderName, lowercaseDefHeaderName, reqHeaderName;\n\n defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);\n\n // using for-in instead of forEach to avoid unnecessary iteration after header has been found\n defaultHeadersIteration:\n for (defHeaderName in defHeaders) {\n lowercaseDefHeaderName = lowercase(defHeaderName);\n\n for (reqHeaderName in reqHeaders) {\n if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {\n continue defaultHeadersIteration;\n }\n }\n\n reqHeaders[defHeaderName] = defHeaders[defHeaderName];\n }\n\n // execute if header value is a function for merged headers\n return executeHeaderFns(reqHeaders, shallowCopy(config));\n }\n\n function serverRequest(config) {\n var headers = config.headers;\n var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);\n\n // strip content-type if data is undefined\n if (isUndefined(reqData)) {\n forEach(headers, function(value, header) {\n if (lowercase(header) === 'content-type') {\n delete headers[header];\n }\n });\n }\n\n if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {\n config.withCredentials = defaults.withCredentials;\n }\n\n // send request\n return sendReq(config, reqData).then(transformResponse, transformResponse);\n }\n\n function transformResponse(response) {\n // make a copy since the response must be cacheable\n var resp = extend({}, response);\n resp.data = transformData(response.data, response.headers, response.status,\n config.transformResponse);\n return (isSuccess(response.status))\n ? resp\n : $q.reject(resp);\n }\n }\n\n $http.pendingRequests = [];\n\n /**\n * @ngdoc method\n * @name $http#get\n *\n * @description\n * Shortcut method to perform `GET` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#delete\n *\n * @description\n * Shortcut method to perform `DELETE` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#head\n *\n * @description\n * Shortcut method to perform `HEAD` request.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#jsonp\n *\n * @description\n * Shortcut method to perform `JSONP` request.\n *\n * Note that, since JSONP requests are sensitive because the response is given full access to the browser,\n * the url must be declared, via {@link $sce} as a trusted resource URL.\n * You can trust a URL by adding it to the trusted resource URL list via\n * {@link $sceDelegateProvider#trustedResourceUrlList `$sceDelegateProvider.trustedResourceUrlList`} or\n * by explicitly trusting the URL via {@link $sce#trustAsResourceUrl `$sce.trustAsResourceUrl(url)`}.\n *\n * You should avoid generating the URL for the JSONP request from user provided data.\n * Provide additional query parameters via `params` property of the `config` parameter, rather than\n * modifying the URL itself.\n *\n * JSONP requests must specify a callback to be used in the response from the server. This callback\n * is passed as a query parameter in the request. You must specify the name of this parameter by\n * setting the `jsonpCallbackParam` property on the request config object.\n *\n * ```\n * $http.jsonp('some/trusted/url', {jsonpCallbackParam: 'callback'})\n * ```\n *\n * You can also specify a default callback parameter name in `$http.defaults.jsonpCallbackParam`.\n * Initially this is set to `'callback'`.\n *\n *
      \n * You can no longer use the `JSON_CALLBACK` string as a placeholder for specifying where the callback\n * parameter value should go.\n *
      \n *\n * If you would like to customise where and how the callbacks are stored then try overriding\n * or decorating the {@link $jsonpCallbacks} service.\n *\n * @param {string|TrustedObject} url Absolute or relative URL of the resource that is being requested;\n * or an object created by a call to `$sce.trustAsResourceUrl(url)`.\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n createShortMethods('get', 'delete', 'head', 'jsonp');\n\n /**\n * @ngdoc method\n * @name $http#post\n *\n * @description\n * Shortcut method to perform `POST` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#put\n *\n * @description\n * Shortcut method to perform `PUT` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n\n /**\n * @ngdoc method\n * @name $http#patch\n *\n * @description\n * Shortcut method to perform `PATCH` request.\n *\n * @param {string} url Relative or absolute URL specifying the destination of the request\n * @param {*} data Request content\n * @param {Object=} config Optional configuration object. See {@link ng.$http#$http-arguments `$http()` arguments}.\n * @returns {HttpPromise} A Promise that will be resolved or rejected with a response object.\n * See {@link ng.$http#$http-returns `$http()` return value}.\n */\n createShortMethodsWithData('post', 'put', 'patch');\n\n /**\n * @ngdoc property\n * @name $http#defaults\n *\n * @description\n * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of\n * default headers, withCredentials as well as request and response transformations.\n *\n * See \"Setting HTTP Headers\" and \"Transforming Requests and Responses\" sections above.\n */\n $http.defaults = defaults;\n\n\n return $http;\n\n\n function createShortMethods(names) {\n forEach(arguments, function(name) {\n $http[name] = function(url, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url\n }));\n };\n });\n }\n\n\n function createShortMethodsWithData(name) {\n forEach(arguments, function(name) {\n $http[name] = function(url, data, config) {\n return $http(extend({}, config || {}, {\n method: name,\n url: url,\n data: data\n }));\n };\n });\n }\n\n\n /**\n * Makes the request.\n *\n * !!! ACCESSES CLOSURE VARS:\n * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests\n */\n function sendReq(config, reqData) {\n var deferred = $q.defer(),\n promise = deferred.promise,\n cache,\n cachedResp,\n reqHeaders = config.headers,\n isJsonp = lowercase(config.method) === 'jsonp',\n url = config.url;\n\n if (isJsonp) {\n // JSONP is a pretty sensitive operation where we're allowing a script to have full access to\n // our DOM and JS space. So we require that the URL satisfies SCE.RESOURCE_URL.\n url = $sce.getTrustedResourceUrl(url);\n } else if (!isString(url)) {\n // If it is not a string then the URL must be a $sce trusted object\n url = $sce.valueOf(url);\n }\n\n url = buildUrl(url, config.paramSerializer(config.params));\n\n if (isJsonp) {\n // Check the url and add the JSONP callback placeholder\n url = sanitizeJsonpCallbackParam(url, config.jsonpCallbackParam);\n }\n\n $http.pendingRequests.push(config);\n promise.then(removePendingReq, removePendingReq);\n\n if ((config.cache || defaults.cache) && config.cache !== false &&\n (config.method === 'GET' || config.method === 'JSONP')) {\n cache = isObject(config.cache) ? config.cache\n : isObject(/** @type {?} */ (defaults).cache)\n ? /** @type {?} */ (defaults).cache\n : defaultCache;\n }\n\n if (cache) {\n cachedResp = cache.get(url);\n if (isDefined(cachedResp)) {\n if (isPromiseLike(cachedResp)) {\n // cached request has already been sent, but there is no response yet\n cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);\n } else {\n // serving from cache\n if (isArray(cachedResp)) {\n resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3], cachedResp[4]);\n } else {\n resolvePromise(cachedResp, 200, {}, 'OK', 'complete');\n }\n }\n } else {\n // put the promise for the non-transformed response into cache as a placeholder\n cache.put(url, promise);\n }\n }\n\n\n // if we won't have the response in cache, set the xsrf headers and\n // send the request to the backend\n if (isUndefined(cachedResp)) {\n var xsrfValue = urlIsAllowedOrigin(config.url)\n ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]\n : undefined;\n if (xsrfValue) {\n reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;\n }\n\n $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,\n config.withCredentials, config.responseType,\n createApplyHandlers(config.eventHandlers),\n createApplyHandlers(config.uploadEventHandlers));\n }\n\n return promise;\n\n function createApplyHandlers(eventHandlers) {\n if (eventHandlers) {\n var applyHandlers = {};\n forEach(eventHandlers, function(eventHandler, key) {\n applyHandlers[key] = function(event) {\n if (useApplyAsync) {\n $rootScope.$applyAsync(callEventHandler);\n } else if ($rootScope.$$phase) {\n callEventHandler();\n } else {\n $rootScope.$apply(callEventHandler);\n }\n\n function callEventHandler() {\n eventHandler(event);\n }\n };\n });\n return applyHandlers;\n }\n }\n\n\n /**\n * Callback registered to $httpBackend():\n * - caches the response if desired\n * - resolves the raw $http promise\n * - calls $apply\n */\n function done(status, response, headersString, statusText, xhrStatus) {\n if (cache) {\n if (isSuccess(status)) {\n cache.put(url, [status, response, parseHeaders(headersString), statusText, xhrStatus]);\n } else {\n // remove promise from the cache\n cache.remove(url);\n }\n }\n\n function resolveHttpPromise() {\n resolvePromise(response, status, headersString, statusText, xhrStatus);\n }\n\n if (useApplyAsync) {\n $rootScope.$applyAsync(resolveHttpPromise);\n } else {\n resolveHttpPromise();\n if (!$rootScope.$$phase) $rootScope.$apply();\n }\n }\n\n\n /**\n * Resolves the raw $http promise.\n */\n function resolvePromise(response, status, headers, statusText, xhrStatus) {\n //status: HTTP response status code, 0, -1 (aborted by timeout / promise)\n status = status >= -1 ? status : 0;\n\n (isSuccess(status) ? deferred.resolve : deferred.reject)({\n data: response,\n status: status,\n headers: headersGetter(headers),\n config: config,\n statusText: statusText,\n xhrStatus: xhrStatus\n });\n }\n\n function resolvePromiseWithResult(result) {\n resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText, result.xhrStatus);\n }\n\n function removePendingReq() {\n var idx = $http.pendingRequests.indexOf(config);\n if (idx !== -1) $http.pendingRequests.splice(idx, 1);\n }\n }\n\n\n function buildUrl(url, serializedParams) {\n if (serializedParams.length > 0) {\n url += ((url.indexOf('?') === -1) ? '?' : '&') + serializedParams;\n }\n return url;\n }\n\n function sanitizeJsonpCallbackParam(url, cbKey) {\n var parts = url.split('?');\n if (parts.length > 2) {\n // Throw if the url contains more than one `?` query indicator\n throw $httpMinErr('badjsonp', 'Illegal use more than one \"?\", in url, \"{1}\"', url);\n }\n var params = parseKeyValue(parts[1]);\n forEach(params, function(value, key) {\n if (value === 'JSON_CALLBACK') {\n // Throw if the url already contains a reference to JSON_CALLBACK\n throw $httpMinErr('badjsonp', 'Illegal use of JSON_CALLBACK in url, \"{0}\"', url);\n }\n if (key === cbKey) {\n // Throw if the callback param was already provided\n throw $httpMinErr('badjsonp', 'Illegal use of callback param, \"{0}\", in url, \"{1}\"', cbKey, url);\n }\n });\n\n // Add in the JSON_CALLBACK callback param value\n url += ((url.indexOf('?') === -1) ? '?' : '&') + cbKey + '=JSON_CALLBACK';\n\n return url;\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $xhrFactory\n * @this\n *\n * @description\n * Factory function used to create XMLHttpRequest objects.\n *\n * Replace or decorate this service to create your own custom XMLHttpRequest objects.\n *\n * ```\n * angular.module('myApp', [])\n * .factory('$xhrFactory', function() {\n * return function createXhr(method, url) {\n * return new window.XMLHttpRequest({mozSystem: true});\n * };\n * });\n * ```\n *\n * @param {string} method HTTP method of the request (GET, POST, PUT, ..)\n * @param {string} url URL of the request.\n */\nfunction $xhrFactoryProvider() {\n this.$get = function() {\n return function createXhr() {\n return new window.XMLHttpRequest();\n };\n };\n}\n\n/**\n * @ngdoc service\n * @name $httpBackend\n * @requires $jsonpCallbacks\n * @requires $document\n * @requires $xhrFactory\n * @this\n *\n * @description\n * HTTP backend used by the {@link ng.$http service} that delegates to\n * XMLHttpRequest object or JSONP and deals with browser incompatibilities.\n *\n * You should never need to use this service directly, instead use the higher-level abstractions:\n * {@link ng.$http $http} or {@link ngResource.$resource $resource}.\n *\n * During testing this implementation is swapped with {@link ngMock.$httpBackend mock\n * $httpBackend} which can be trained with responses.\n */\nfunction $HttpBackendProvider() {\n this.$get = ['$browser', '$jsonpCallbacks', '$document', '$xhrFactory', function($browser, $jsonpCallbacks, $document, $xhrFactory) {\n return createHttpBackend($browser, $xhrFactory, $browser.defer, $jsonpCallbacks, $document[0]);\n }];\n}\n\nfunction createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {\n // TODO(vojta): fix the signature\n return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {\n url = url || $browser.url();\n\n if (lowercase(method) === 'jsonp') {\n var callbackPath = callbacks.createCallback(url);\n var jsonpDone = jsonpReq(url, callbackPath, function(status, text) {\n // jsonpReq only ever sets status to 200 (OK), 404 (ERROR) or -1 (WAITING)\n var response = (status === 200) && callbacks.getResponse(callbackPath);\n completeRequest(callback, status, response, '', text, 'complete');\n callbacks.removeCallback(callbackPath);\n });\n } else {\n\n var xhr = createXhr(method, url);\n var abortedByTimeout = false;\n\n xhr.open(method, url, true);\n forEach(headers, function(value, key) {\n if (isDefined(value)) {\n xhr.setRequestHeader(key, value);\n }\n });\n\n xhr.onload = function requestLoaded() {\n var statusText = xhr.statusText || '';\n\n // responseText is the old-school way of retrieving response (supported by IE9)\n // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)\n var response = ('response' in xhr) ? xhr.response : xhr.responseText;\n\n // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)\n var status = xhr.status === 1223 ? 204 : xhr.status;\n\n // fix status code when it is 0 (0 status is undocumented).\n // Occurs when accessing file resources or on Android 4.1 stock browser\n // while retrieving files from application cache.\n if (status === 0) {\n status = response ? 200 : urlResolve(url).protocol === 'file' ? 404 : 0;\n }\n\n completeRequest(callback,\n status,\n response,\n xhr.getAllResponseHeaders(),\n statusText,\n 'complete');\n };\n\n var requestError = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'error');\n };\n\n var requestAborted = function() {\n completeRequest(callback, -1, null, null, '', abortedByTimeout ? 'timeout' : 'abort');\n };\n\n var requestTimeout = function() {\n // The response is always empty\n // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error\n completeRequest(callback, -1, null, null, '', 'timeout');\n };\n\n xhr.onerror = requestError;\n xhr.ontimeout = requestTimeout;\n xhr.onabort = requestAborted;\n\n forEach(eventHandlers, function(value, key) {\n xhr.addEventListener(key, value);\n });\n\n forEach(uploadEventHandlers, function(value, key) {\n xhr.upload.addEventListener(key, value);\n });\n\n if (withCredentials) {\n xhr.withCredentials = true;\n }\n\n if (responseType) {\n try {\n xhr.responseType = responseType;\n } catch (e) {\n // WebKit added support for the json responseType value on 09/03/2013\n // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are\n // known to throw when setting the value \"json\" as the response type. Other older\n // browsers implementing the responseType\n //\n // The json response type can be ignored if not supported, because JSON payloads are\n // parsed on the client-side regardless.\n if (responseType !== 'json') {\n throw e;\n }\n }\n }\n\n xhr.send(isUndefined(post) ? null : post);\n }\n\n // Since we are using xhr.abort() when a request times out, we have to set a flag that\n // indicates to requestAborted if the request timed out or was aborted.\n //\n // http.timeout = numerical timeout timeout\n // http.timeout = $timeout timeout\n // http.timeout = promise abort\n // xhr.abort() abort (The xhr object is normally inaccessible, but\n // can be exposed with the xhrFactory)\n if (timeout > 0) {\n var timeoutId = $browserDefer(function() {\n timeoutRequest('timeout');\n }, timeout);\n } else if (isPromiseLike(timeout)) {\n timeout.then(function() {\n timeoutRequest(isDefined(timeout.$$timeoutId) ? 'timeout' : 'abort');\n });\n }\n\n function timeoutRequest(reason) {\n abortedByTimeout = reason === 'timeout';\n if (jsonpDone) {\n jsonpDone();\n }\n if (xhr) {\n xhr.abort();\n }\n }\n\n function completeRequest(callback, status, response, headersString, statusText, xhrStatus) {\n // cancel timeout and subsequent timeout promise resolution\n if (isDefined(timeoutId)) {\n $browserDefer.cancel(timeoutId);\n }\n jsonpDone = xhr = null;\n\n callback(status, response, headersString, statusText, xhrStatus);\n }\n };\n\n function jsonpReq(url, callbackPath, done) {\n url = url.replace('JSON_CALLBACK', callbackPath);\n // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:\n // - fetches local scripts via XHR and evals them\n // - adds and immediately removes script elements from the document\n var script = rawDocument.createElement('script'), callback = null;\n script.type = 'text/javascript';\n script.src = url;\n script.async = true;\n\n callback = function(event) {\n script.removeEventListener('load', callback);\n script.removeEventListener('error', callback);\n rawDocument.body.removeChild(script);\n script = null;\n var status = -1;\n var text = 'unknown';\n\n if (event) {\n if (event.type === 'load' && !callbacks.wasCalled(callbackPath)) {\n event = { type: 'error' };\n }\n text = event.type;\n status = event.type === 'error' ? 404 : 200;\n }\n\n if (done) {\n done(status, text);\n }\n };\n\n script.addEventListener('load', callback);\n script.addEventListener('error', callback);\n rawDocument.body.appendChild(script);\n return callback;\n }\n}\n\nvar $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');\n$interpolateMinErr.throwNoconcat = function(text) {\n throw $interpolateMinErr('noconcat',\n 'Error while interpolating: {0}\\nStrict Contextual Escaping disallows ' +\n 'interpolations that concatenate multiple expressions when a trusted value is ' +\n 'required. See http://docs.angularjs.org/api/ng.$sce', text);\n};\n\n$interpolateMinErr.interr = function(text, err) {\n return $interpolateMinErr('interr', 'Can\\'t interpolate: {0}\\n{1}', text, err.toString());\n};\n\n/**\n * @ngdoc provider\n * @name $interpolateProvider\n * @this\n *\n * @description\n *\n * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.\n *\n *
      \n * This feature is sometimes used to mix different markup languages, e.g. to wrap an AngularJS\n * template within a Python Jinja template (or any other template language). Mixing templating\n * languages is **very dangerous**. The embedding template language will not safely escape AngularJS\n * expressions, so any user-controlled values in the template will cause Cross Site Scripting (XSS)\n * security bugs!\n *
      \n *\n * @example\n\n\n\n
      \n //demo.label//\n
      \n
      \n\n it('should interpolate binding with custom symbols', function() {\n expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');\n });\n\n
      \n */\nfunction $InterpolateProvider() {\n var startSymbol = '{{';\n var endSymbol = '}}';\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#startSymbol\n * @description\n * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.\n *\n * @param {string=} value new value to set the starting symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.startSymbol = function(value) {\n if (value) {\n startSymbol = value;\n return this;\n }\n return startSymbol;\n };\n\n /**\n * @ngdoc method\n * @name $interpolateProvider#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * @param {string=} value new value to set the ending symbol to.\n * @returns {string|self} Returns the symbol when used as getter and self if used as setter.\n */\n this.endSymbol = function(value) {\n if (value) {\n endSymbol = value;\n return this;\n }\n return endSymbol;\n };\n\n\n this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {\n var startSymbolLength = startSymbol.length,\n endSymbolLength = endSymbol.length,\n escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),\n escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');\n\n function escape(ch) {\n return '\\\\\\\\\\\\' + ch;\n }\n\n function unescapeText(text) {\n return text.replace(escapedStartRegexp, startSymbol).\n replace(escapedEndRegexp, endSymbol);\n }\n\n // TODO: this is the same as the constantWatchDelegate in parse.js\n function constantWatchDelegate(scope, listener, objectEquality, constantInterp) {\n var unwatch = scope.$watch(function constantInterpolateWatch(scope) {\n unwatch();\n return constantInterp(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n\n /**\n * @ngdoc service\n * @name $interpolate\n * @kind function\n *\n * @requires $parse\n * @requires $sce\n *\n * @description\n *\n * Compiles a string with markup into an interpolation function. This service is used by the\n * HTML {@link ng.$compile $compile} service for data binding. See\n * {@link ng.$interpolateProvider $interpolateProvider} for configuring the\n * interpolation markup.\n *\n *\n * ```js\n * var $interpolate = ...; // injected\n * var exp = $interpolate('Hello {{name | uppercase}}!');\n * expect(exp({name:'AngularJS'})).toEqual('Hello ANGULARJS!');\n * ```\n *\n * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is\n * `true`, the interpolation function will return `undefined` unless all embedded expressions\n * evaluate to a value other than `undefined`.\n *\n * ```js\n * var $interpolate = ...; // injected\n * var context = {greeting: 'Hello', name: undefined };\n *\n * // default \"forgiving\" mode\n * var exp = $interpolate('{{greeting}} {{name}}!');\n * expect(exp(context)).toEqual('Hello !');\n *\n * // \"allOrNothing\" mode\n * exp = $interpolate('{{greeting}} {{name}}!', false, null, true);\n * expect(exp(context)).toBeUndefined();\n * context.name = 'AngularJS';\n * expect(exp(context)).toEqual('Hello AngularJS!');\n * ```\n *\n * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.\n *\n * #### Escaped Interpolation\n * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers\n * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).\n * It will be rendered as a regular start/end marker, and will not be interpreted as an expression\n * or binding.\n *\n * This enables web-servers to prevent script injection attacks and defacing attacks, to some\n * degree, while also enabling code examples to work without relying on the\n * {@link ng.directive:ngNonBindable ngNonBindable} directive.\n *\n * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,\n * replacing angle brackets (<, >) with &lt; and &gt; respectively, and replacing all\n * interpolation start/end markers with their escaped counterparts.**\n *\n * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered\n * output when the $interpolate service processes the text. So, for HTML elements interpolated\n * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter\n * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,\n * this is typically useful only when user-data is used in rendering a template from the server, or\n * when otherwise untrusted data is used by a directive.\n *\n * \n * \n *
      \n *

      {{apptitle}}: \\{\\{ username = \"defaced value\"; \\}\\}\n *

      \n *

      {{username}} attempts to inject code which will deface the\n * application, but fails to accomplish their task, because the server has correctly\n * escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)\n * characters.

      \n *

      Instead, the result of the attempted script injection is visible, and can be removed\n * from the database by an administrator.

      \n *
      \n *
      \n *
      \n *\n * @knownIssue\n * It is currently not possible for an interpolated expression to contain the interpolation end\n * symbol. For example, `{{ '}}' }}` will be incorrectly interpreted as `{{ ' }}` + `' }}`, i.e.\n * an interpolated expression consisting of a single-quote (`'`) and the `' }}` string.\n *\n * @knownIssue\n * All directives and components must use the standard `{{` `}}` interpolation symbols\n * in their templates. If you change the application interpolation symbols the {@link $compile}\n * service will attempt to denormalize the standard symbols to the custom symbols.\n * The denormalization process is not clever enough to know not to replace instances of the standard\n * symbols where they would not normally be treated as interpolation symbols. For example in the following\n * code snippet the closing braces of the literal object will get incorrectly denormalized:\n *\n * ```\n *
      \n * ```\n *\n * See https://github.com/angular/angular.js/pull/14610#issuecomment-219401099 for more information.\n *\n * @param {string} text The text with markup to interpolate.\n * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have\n * embedded expression in order to return an interpolation function. Strings with no\n * embedded expression will return null for the interpolation function.\n * @param {string=} trustedContext when provided, the returned function passes the interpolated\n * result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,\n * trustedContext)} before returning it. Refer to the {@link ng.$sce $sce} service that\n * provides Strict Contextual Escaping for details.\n * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined\n * unless all embedded expressions evaluate to a value other than `undefined`.\n * @returns {function(context)} an interpolation function which is used to compute the\n * interpolated string. The function has these parameters:\n *\n * - `context`: evaluation context for all expressions embedded in the interpolated text\n */\n function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {\n var contextAllowsConcatenation = trustedContext === $sce.URL || trustedContext === $sce.MEDIA_URL;\n\n // Provide a quick exit and simplified result function for text with no interpolation\n if (!text.length || text.indexOf(startSymbol) === -1) {\n if (mustHaveExpression) return;\n\n var unescapedText = unescapeText(text);\n if (contextAllowsConcatenation) {\n unescapedText = $sce.getTrusted(trustedContext, unescapedText);\n }\n var constantInterp = valueFn(unescapedText);\n constantInterp.exp = text;\n constantInterp.expressions = [];\n constantInterp.$$watchDelegate = constantWatchDelegate;\n\n return constantInterp;\n }\n\n allOrNothing = !!allOrNothing;\n var startIndex,\n endIndex,\n index = 0,\n expressions = [],\n parseFns,\n textLength = text.length,\n exp,\n concat = [],\n expressionPositions = [],\n singleExpression;\n\n\n while (index < textLength) {\n if (((startIndex = text.indexOf(startSymbol, index)) !== -1) &&\n ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) !== -1)) {\n if (index !== startIndex) {\n concat.push(unescapeText(text.substring(index, startIndex)));\n }\n exp = text.substring(startIndex + startSymbolLength, endIndex);\n expressions.push(exp);\n index = endIndex + endSymbolLength;\n expressionPositions.push(concat.length);\n concat.push(''); // Placeholder that will get replaced with the evaluated expression.\n } else {\n // we did not find an interpolation, so we have to add the remainder to the separators array\n if (index !== textLength) {\n concat.push(unescapeText(text.substring(index)));\n }\n break;\n }\n }\n\n singleExpression = concat.length === 1 && expressionPositions.length === 1;\n // Intercept expression if we need to stringify concatenated inputs, which may be SCE trusted\n // objects rather than simple strings\n // (we don't modify the expression if the input consists of only a single trusted input)\n var interceptor = contextAllowsConcatenation && singleExpression ? undefined : parseStringifyInterceptor;\n parseFns = expressions.map(function(exp) { return $parse(exp, interceptor); });\n\n // Concatenating expressions makes it hard to reason about whether some combination of\n // concatenated values are unsafe to use and could easily lead to XSS. By requiring that a\n // single expression be used for some $sce-managed secure contexts (RESOURCE_URLs mostly),\n // we ensure that the value that's used is assigned or constructed by some JS code somewhere\n // that is more testable or make it obvious that you bound the value to some user controlled\n // value. This helps reduce the load when auditing for XSS issues.\n\n // Note that URL and MEDIA_URL $sce contexts do not need this, since `$sce` can sanitize the values\n // passed to it. In that case, `$sce.getTrusted` will be called on either the single expression\n // or on the overall concatenated string (losing trusted types used in the mix, by design).\n // Both these methods will sanitize plain strings. Also, HTML could be included, but since it's\n // only used in srcdoc attributes, this would not be very useful.\n\n if (!mustHaveExpression || expressions.length) {\n var compute = function(values) {\n for (var i = 0, ii = expressions.length; i < ii; i++) {\n if (allOrNothing && isUndefined(values[i])) return;\n concat[expressionPositions[i]] = values[i];\n }\n\n if (contextAllowsConcatenation) {\n // If `singleExpression` then `concat[0]` might be a \"trusted\" value or `null`, rather than a string\n return $sce.getTrusted(trustedContext, singleExpression ? concat[0] : concat.join(''));\n } else if (trustedContext && concat.length > 1) {\n // This context does not allow more than one part, e.g. expr + string or exp + exp.\n $interpolateMinErr.throwNoconcat(text);\n }\n // In an unprivileged context or only one part: just concatenate and return.\n return concat.join('');\n };\n\n return extend(function interpolationFn(context) {\n var i = 0;\n var ii = expressions.length;\n var values = new Array(ii);\n\n try {\n for (; i < ii; i++) {\n values[i] = parseFns[i](context);\n }\n\n return compute(values);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n\n }, {\n // all of these properties are undocumented for now\n exp: text, //just for compatibility with regular watchers created via $watch\n expressions: expressions,\n $$watchDelegate: function(scope, listener) {\n var lastValue;\n return scope.$watchGroup(parseFns, /** @this */ function interpolateFnWatcher(values, oldValues) {\n var currValue = compute(values);\n listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);\n lastValue = currValue;\n });\n }\n });\n }\n\n function parseStringifyInterceptor(value) {\n try {\n // In concatenable contexts, getTrusted comes at the end, to avoid sanitizing individual\n // parts of a full URL. We don't care about losing the trustedness here.\n // In non-concatenable contexts, where there is only one expression, this interceptor is\n // not applied to the expression.\n value = (trustedContext && !contextAllowsConcatenation) ?\n $sce.getTrusted(trustedContext, value) :\n $sce.valueOf(value);\n return allOrNothing && !isDefined(value) ? value : stringify(value);\n } catch (err) {\n $exceptionHandler($interpolateMinErr.interr(text, err));\n }\n }\n }\n\n\n /**\n * @ngdoc method\n * @name $interpolate#startSymbol\n * @description\n * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.\n *\n * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change\n * the symbol.\n *\n * @returns {string} start symbol.\n */\n $interpolate.startSymbol = function() {\n return startSymbol;\n };\n\n\n /**\n * @ngdoc method\n * @name $interpolate#endSymbol\n * @description\n * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.\n *\n * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change\n * the symbol.\n *\n * @returns {string} end symbol.\n */\n $interpolate.endSymbol = function() {\n return endSymbol;\n };\n\n return $interpolate;\n }];\n}\n\nvar $intervalMinErr = minErr('$interval');\n\n/** @this */\nfunction $IntervalProvider() {\n this.$get = ['$$intervalFactory', '$window',\n function($$intervalFactory, $window) {\n var intervals = {};\n var setIntervalFn = function(tick, delay, deferred) {\n var id = $window.setInterval(tick, delay);\n intervals[id] = deferred;\n return id;\n };\n var clearIntervalFn = function(id) {\n $window.clearInterval(id);\n delete intervals[id];\n };\n\n /**\n * @ngdoc service\n * @name $interval\n *\n * @description\n * AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay`\n * milliseconds.\n *\n * The return value of registering an interval function is a promise. This promise will be\n * notified upon each tick of the interval, and will be resolved after `count` iterations, or\n * run indefinitely if `count` is not defined. The value of the notification will be the\n * number of iterations that have run.\n * To cancel an interval, call `$interval.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to\n * move forward by `millis` milliseconds and trigger any functions scheduled to run in that\n * time.\n *\n *
      \n * **Note**: Intervals created by this service must be explicitly destroyed when you are finished\n * with them. In particular they are not automatically destroyed when a controller's scope or a\n * directive's element are destroyed.\n * You should take this into consideration and make sure to always cancel the interval at the\n * appropriate moment. See the example below for more details on how and when to do this.\n *
      \n *\n * @param {function()} fn A function that should be called repeatedly. If no additional arguments\n * are passed (see below), the function is called with the current iteration count.\n * @param {number} delay Number of milliseconds between each function call.\n * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat\n * indefinitely.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete.\n *\n * @example\n * \n * \n * \n *\n *
      \n *
      \n *
      \n * Current time is: \n *
      \n * Blood 1 : {{blood_1}}\n * Blood 2 : {{blood_2}}\n * \n * \n * \n *
      \n *
      \n *\n *
      \n *
      \n */\n var interval = $$intervalFactory(setIntervalFn, clearIntervalFn);\n\n /**\n * @ngdoc method\n * @name $interval#cancel\n *\n * @description\n * Cancels a task associated with the `promise`.\n *\n * @param {Promise=} promise returned by the `$interval` function.\n * @returns {boolean} Returns `true` if the task was successfully canceled.\n */\n interval.cancel = function(promise) {\n if (!promise) return false;\n\n if (!promise.hasOwnProperty('$$intervalId')) {\n throw $intervalMinErr('badprom',\n '`$interval.cancel()` called with a promise that was not generated by `$interval()`.');\n }\n\n if (!intervals.hasOwnProperty(promise.$$intervalId)) return false;\n\n var id = promise.$$intervalId;\n var deferred = intervals[id];\n\n // Interval cancels should not report an unhandled promise.\n markQExceptionHandled(deferred.promise);\n deferred.reject('canceled');\n clearIntervalFn(id);\n\n return true;\n };\n\n return interval;\n }];\n}\n\n/** @this */\nfunction $$IntervalFactoryProvider() {\n this.$get = ['$browser', '$q', '$$q', '$rootScope',\n function($browser, $q, $$q, $rootScope) {\n return function intervalFactory(setIntervalFn, clearIntervalFn) {\n return function intervalFn(fn, delay, count, invokeApply) {\n var hasParams = arguments.length > 4,\n args = hasParams ? sliceArgs(arguments, 4) : [],\n iteration = 0,\n skipApply = isDefined(invokeApply) && !invokeApply,\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise;\n\n count = isDefined(count) ? count : 0;\n\n function callback() {\n if (!hasParams) {\n fn(iteration);\n } else {\n fn.apply(null, args);\n }\n }\n\n function tick() {\n if (skipApply) {\n $browser.defer(callback);\n } else {\n $rootScope.$evalAsync(callback);\n }\n deferred.notify(iteration++);\n\n if (count > 0 && iteration >= count) {\n deferred.resolve(iteration);\n clearIntervalFn(promise.$$intervalId);\n }\n\n if (!skipApply) $rootScope.$apply();\n }\n\n promise.$$intervalId = setIntervalFn(tick, delay, deferred, skipApply);\n\n return promise;\n };\n };\n }];\n}\n\n/**\n * @ngdoc service\n * @name $jsonpCallbacks\n * @requires $window\n * @description\n * This service handles the lifecycle of callbacks to handle JSONP requests.\n * Override this service if you wish to customise where the callbacks are stored and\n * how they vary compared to the requested url.\n */\nvar $jsonpCallbacksProvider = /** @this */ function() {\n this.$get = function() {\n var callbacks = angular.callbacks;\n var callbackMap = {};\n\n function createCallback(callbackId) {\n var callback = function(data) {\n callback.data = data;\n callback.called = true;\n };\n callback.id = callbackId;\n return callback;\n }\n\n return {\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#createCallback\n * @param {string} url the url of the JSONP request\n * @returns {string} the callback path to send to the server as part of the JSONP request\n * @description\n * {@link $httpBackend} calls this method to create a callback and get hold of the path to the callback\n * to pass to the server, which will be used to call the callback with its payload in the JSONP response.\n */\n createCallback: function(url) {\n var callbackId = '_' + (callbacks.$$counter++).toString(36);\n var callbackPath = 'angular.callbacks.' + callbackId;\n var callback = createCallback(callbackId);\n callbackMap[callbackPath] = callbacks[callbackId] = callback;\n return callbackPath;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#wasCalled\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {boolean} whether the callback has been called, as a result of the JSONP response\n * @description\n * {@link $httpBackend} calls this method to find out whether the JSONP response actually called the\n * callback that was passed in the request.\n */\n wasCalled: function(callbackPath) {\n return callbackMap[callbackPath].called;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#getResponse\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @returns {*} the data received from the response via the registered callback\n * @description\n * {@link $httpBackend} calls this method to get hold of the data that was provided to the callback\n * in the JSONP response.\n */\n getResponse: function(callbackPath) {\n return callbackMap[callbackPath].data;\n },\n /**\n * @ngdoc method\n * @name $jsonpCallbacks#removeCallback\n * @param {string} callbackPath the path to the callback that was sent in the JSONP request\n * @description\n * {@link $httpBackend} calls this method to remove the callback after the JSONP request has\n * completed or timed-out.\n */\n removeCallback: function(callbackPath) {\n var callback = callbackMap[callbackPath];\n delete callbacks[callback.id];\n delete callbackMap[callbackPath];\n }\n };\n };\n};\n\n/**\n * @ngdoc service\n * @name $locale\n *\n * @description\n * $locale service provides localization rules for various AngularJS components. As of right now the\n * only public api is:\n *\n * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)\n */\n\n/* global stripHash: true */\n\nvar PATH_MATCH = /^([^?#]*)(\\?([^#]*))?(#(.*))?$/,\n DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};\nvar $locationMinErr = minErr('$location');\n\n\n/**\n * Encode path using encodeUriSegment, ignoring forward slashes\n *\n * @param {string} path Path to encode\n * @returns {string}\n */\nfunction encodePath(path) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n // decode forward slashes to prevent them from being double encoded\n segments[i] = encodeUriSegment(segments[i].replace(/%2F/g, '/'));\n }\n\n return segments.join('/');\n}\n\nfunction decodePath(path, html5Mode) {\n var segments = path.split('/'),\n i = segments.length;\n\n while (i--) {\n segments[i] = decodeURIComponent(segments[i]);\n if (html5Mode) {\n // encode forward slashes to prevent them from being mistaken for path separators\n segments[i] = segments[i].replace(/\\//g, '%2F');\n }\n }\n\n return segments.join('/');\n}\n\nfunction normalizePath(pathValue, searchValue, hashValue) {\n var search = toKeyValue(searchValue),\n hash = hashValue ? '#' + encodeUriSegment(hashValue) : '',\n path = encodePath(pathValue);\n\n return path + (search ? '?' + search : '') + hash;\n}\n\nfunction parseAbsoluteUrl(absoluteUrl, locationObj) {\n var parsedUrl = urlResolve(absoluteUrl);\n\n locationObj.$$protocol = parsedUrl.protocol;\n locationObj.$$host = parsedUrl.hostname;\n locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;\n}\n\nvar DOUBLE_SLASH_REGEX = /^\\s*[\\\\/]{2,}/;\nfunction parseAppUrl(url, locationObj, html5Mode) {\n\n if (DOUBLE_SLASH_REGEX.test(url)) {\n throw $locationMinErr('badpath', 'Invalid url \"{0}\".', url);\n }\n\n var prefixed = (url.charAt(0) !== '/');\n if (prefixed) {\n url = '/' + url;\n }\n var match = urlResolve(url);\n var path = prefixed && match.pathname.charAt(0) === '/' ? match.pathname.substring(1) : match.pathname;\n locationObj.$$path = decodePath(path, html5Mode);\n locationObj.$$search = parseKeyValue(match.search);\n locationObj.$$hash = decodeURIComponent(match.hash);\n\n // make sure path starts with '/';\n if (locationObj.$$path && locationObj.$$path.charAt(0) !== '/') {\n locationObj.$$path = '/' + locationObj.$$path;\n }\n}\n\nfunction startsWith(str, search) {\n return str.slice(0, search.length) === search;\n}\n\n/**\n *\n * @param {string} base\n * @param {string} url\n * @returns {string} returns text from `url` after `base` or `undefined` if it does not begin with\n * the expected string.\n */\nfunction stripBaseUrl(base, url) {\n if (startsWith(url, base)) {\n return url.substr(base.length);\n }\n}\n\nfunction stripHash(url) {\n var index = url.indexOf('#');\n return index === -1 ? url : url.substr(0, index);\n}\n\nfunction stripFile(url) {\n return url.substr(0, stripHash(url).lastIndexOf('/') + 1);\n}\n\n/* return the server only (scheme://host:port) */\nfunction serverBase(url) {\n return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));\n}\n\n\n/**\n * LocationHtml5Url represents a URL\n * This object is exposed as $location service when HTML5 mode is enabled and supported\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} basePrefix URL path prefix\n */\nfunction LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {\n this.$$html5 = true;\n basePrefix = basePrefix || '';\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given HTML5 (regular) URL string into properties\n * @param {string} url HTML5 URL\n * @private\n */\n this.$$parse = function(url) {\n var pathUrl = stripBaseUrl(appBaseNoFile, url);\n if (!isString(pathUrl)) {\n throw $locationMinErr('ipthprfx', 'Invalid url \"{0}\", missing path prefix \"{1}\".', url,\n appBaseNoFile);\n }\n\n parseAppUrl(pathUrl, this, true);\n\n if (!this.$$path) {\n this.$$path = '/';\n }\n\n this.$$compose();\n };\n\n this.$$normalizeUrl = function(url) {\n return appBaseNoFile + url.substr(1); // first char is always '/'\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n var appUrl, prevAppUrl;\n var rewrittenUrl;\n\n\n if (isDefined(appUrl = stripBaseUrl(appBase, url))) {\n prevAppUrl = appUrl;\n if (basePrefix && isDefined(appUrl = stripBaseUrl(basePrefix, appUrl))) {\n rewrittenUrl = appBaseNoFile + (stripBaseUrl('/', appUrl) || appUrl);\n } else {\n rewrittenUrl = appBase + prevAppUrl;\n }\n } else if (isDefined(appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBaseNoFile + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when developer doesn't opt into html5 mode.\n * It also serves as the base class for html5 mode fallback on legacy browsers.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {\n\n parseAbsoluteUrl(appBase, this);\n\n\n /**\n * Parse given hashbang URL into properties\n * @param {string} url Hashbang URL\n * @private\n */\n this.$$parse = function(url) {\n var withoutBaseUrl = stripBaseUrl(appBase, url) || stripBaseUrl(appBaseNoFile, url);\n var withoutHashUrl;\n\n if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {\n\n // The rest of the URL starts with a hash so we have\n // got either a hashbang path or a plain hash fragment\n withoutHashUrl = stripBaseUrl(hashPrefix, withoutBaseUrl);\n if (isUndefined(withoutHashUrl)) {\n // There was no hashbang prefix so we just have a hash fragment\n withoutHashUrl = withoutBaseUrl;\n }\n\n } else {\n // There was no hashbang path nor hash fragment:\n // If we are in HTML5 mode we use what is left as the path;\n // Otherwise we ignore what is left\n if (this.$$html5) {\n withoutHashUrl = withoutBaseUrl;\n } else {\n withoutHashUrl = '';\n if (isUndefined(withoutBaseUrl)) {\n appBase = url;\n /** @type {?} */ (this).replace();\n }\n }\n }\n\n parseAppUrl(withoutHashUrl, this, false);\n\n this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);\n\n this.$$compose();\n\n /*\n * In Windows, on an anchor node on documents loaded from\n * the filesystem, the browser will return a pathname\n * prefixed with the drive name ('/C:/path') when a\n * pathname without a drive is set:\n * * a.setAttribute('href', '/foo')\n * * a.pathname === '/C:/foo' //true\n *\n * Inside of AngularJS, we're always using pathnames that\n * do not include drive names for routing.\n */\n function removeWindowsDriveName(path, url, base) {\n /*\n Matches paths for file protocol on windows,\n such as /C:/foo/bar, and captures only /foo/bar.\n */\n var windowsFilePathExp = /^\\/[A-Z]:(\\/.*)/;\n\n var firstPathSegmentMatch;\n\n //Get the relative path from the input URL.\n if (startsWith(url, base)) {\n url = url.replace(base, '');\n }\n\n // The input URL intentionally contains a first path segment that ends with a colon.\n if (windowsFilePathExp.exec(url)) {\n return path;\n }\n\n firstPathSegmentMatch = windowsFilePathExp.exec(path);\n return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;\n }\n };\n\n this.$$normalizeUrl = function(url) {\n return appBase + (url ? hashPrefix + url : '');\n };\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (stripHash(appBase) === stripHash(url)) {\n this.$$parse(url);\n return true;\n }\n return false;\n };\n}\n\n\n/**\n * LocationHashbangUrl represents URL\n * This object is exposed as $location service when html5 history api is enabled but the browser\n * does not support it.\n *\n * @constructor\n * @param {string} appBase application base URL\n * @param {string} appBaseNoFile application base URL stripped of any filename\n * @param {string} hashPrefix hashbang prefix\n */\nfunction LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {\n this.$$html5 = true;\n LocationHashbangUrl.apply(this, arguments);\n\n this.$$parseLinkUrl = function(url, relHref) {\n if (relHref && relHref[0] === '#') {\n // special case for links to hash fragments:\n // keep the old url and only replace the hash fragment\n this.hash(relHref.slice(1));\n return true;\n }\n\n var rewrittenUrl;\n var appUrl;\n\n if (appBase === stripHash(url)) {\n rewrittenUrl = url;\n } else if ((appUrl = stripBaseUrl(appBaseNoFile, url))) {\n rewrittenUrl = appBase + hashPrefix + appUrl;\n } else if (appBaseNoFile === url + '/') {\n rewrittenUrl = appBaseNoFile;\n }\n if (rewrittenUrl) {\n this.$$parse(rewrittenUrl);\n }\n return !!rewrittenUrl;\n };\n\n this.$$normalizeUrl = function(url) {\n // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'\n return appBase + hashPrefix + url;\n };\n}\n\n\nvar locationPrototype = {\n\n /**\n * Ensure absolute URL is initialized.\n * @private\n */\n $$absUrl:'',\n\n /**\n * Are we in html5 mode?\n * @private\n */\n $$html5: false,\n\n /**\n * Has any change been replacing?\n * @private\n */\n $$replace: false,\n\n /**\n * Compose url and update `url` and `absUrl` property\n * @private\n */\n $$compose: function() {\n this.$$url = normalizePath(this.$$path, this.$$search, this.$$hash);\n this.$$absUrl = this.$$normalizeUrl(this.$$url);\n this.$$urlUpdatedByLocation = true;\n },\n\n /**\n * @ngdoc method\n * @name $location#absUrl\n *\n * @description\n * This method is getter only.\n *\n * Return full URL representation with all segments encoded according to rules specified in\n * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var absUrl = $location.absUrl();\n * // => \"http://example.com/#/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @return {string} full URL\n */\n absUrl: locationGetter('$$absUrl'),\n\n /**\n * @ngdoc method\n * @name $location#url\n *\n * @description\n * This method is getter / setter.\n *\n * Return URL (e.g. `/path?a=b#hash`) when called without any parameter.\n *\n * Change path, search and hash, when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var url = $location.url();\n * // => \"/some/path?foo=bar&baz=xoxo\"\n * ```\n *\n * @param {string=} url New URL without base prefix (e.g. `/path?a=b#hash`)\n * @return {string} url\n */\n url: function(url) {\n if (isUndefined(url)) {\n return this.$$url;\n }\n\n var match = PATH_MATCH.exec(url);\n if (match[1] || url === '') this.path(decodeURIComponent(match[1]));\n if (match[2] || match[1] || url === '') this.search(match[3] || '');\n this.hash(match[5] || '');\n\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#protocol\n *\n * @description\n * This method is getter only.\n *\n * Return protocol of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var protocol = $location.protocol();\n * // => \"http\"\n * ```\n *\n * @return {string} protocol of current URL\n */\n protocol: locationGetter('$$protocol'),\n\n /**\n * @ngdoc method\n * @name $location#host\n *\n * @description\n * This method is getter only.\n *\n * Return host of current URL.\n *\n * Note: compared to the non-AngularJS version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var host = $location.host();\n * // => \"example.com\"\n *\n * // given URL http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo\n * host = $location.host();\n * // => \"example.com\"\n * host = location.host;\n * // => \"example.com:8080\"\n * ```\n *\n * @return {string} host of current URL.\n */\n host: locationGetter('$$host'),\n\n /**\n * @ngdoc method\n * @name $location#port\n *\n * @description\n * This method is getter only.\n *\n * Return port of current URL.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var port = $location.port();\n * // => 80\n * ```\n *\n * @return {Number} port\n */\n port: locationGetter('$$port'),\n\n /**\n * @ngdoc method\n * @name $location#path\n *\n * @description\n * This method is getter / setter.\n *\n * Return path of current URL when called without any parameter.\n *\n * Change path when called with parameter and return `$location`.\n *\n * Note: Path should always begin with forward slash (/), this method will add the forward slash\n * if it is missing.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var path = $location.path();\n * // => \"/some/path\"\n * ```\n *\n * @param {(string|number)=} path New path\n * @return {(string|object)} path if called with no parameters, or `$location` if called with a parameter\n */\n path: locationGetterSetter('$$path', function(path) {\n path = path !== null ? path.toString() : '';\n return path.charAt(0) === '/' ? path : '/' + path;\n }),\n\n /**\n * @ngdoc method\n * @name $location#search\n *\n * @description\n * This method is getter / setter.\n *\n * Return search part (as object) of current URL when called without any parameter.\n *\n * Change search part when called with parameter and return `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo\n * var searchObject = $location.search();\n * // => {foo: 'bar', baz: 'xoxo'}\n *\n * // set foo to 'yipee'\n * $location.search('foo', 'yipee');\n * // $location.search() => {foo: 'yipee', baz: 'xoxo'}\n * ```\n *\n * @param {string|Object.|Object.>} search New search params - string or\n * hash object.\n *\n * When called with a single argument the method acts as a setter, setting the `search` component\n * of `$location` to the specified value.\n *\n * If the argument is a hash object containing an array of values, these values will be encoded\n * as duplicate search parameters in the URL.\n *\n * @param {(string|Number|Array|boolean)=} paramValue If `search` is a string or number, then `paramValue`\n * will override only a single search property.\n *\n * If `paramValue` is an array, it will override the property of the `search` component of\n * `$location` specified via the first argument.\n *\n * If `paramValue` is `null`, the property specified via the first argument will be deleted.\n *\n * If `paramValue` is `true`, the property specified via the first argument will be added with no\n * value nor trailing equal sign.\n *\n * @return {Object} If called with no arguments returns the parsed `search` object. If called with\n * one or more arguments returns `$location` object itself.\n */\n search: function(search, paramValue) {\n switch (arguments.length) {\n case 0:\n return this.$$search;\n case 1:\n if (isString(search) || isNumber(search)) {\n search = search.toString();\n this.$$search = parseKeyValue(search);\n } else if (isObject(search)) {\n search = copy(search, {});\n // remove object undefined or null properties\n forEach(search, function(value, key) {\n if (value == null) delete search[key];\n });\n\n this.$$search = search;\n } else {\n throw $locationMinErr('isrcharg',\n 'The first argument of the `$location#search()` call must be a string or an object.');\n }\n break;\n default:\n if (isUndefined(paramValue) || paramValue === null) {\n delete this.$$search[search];\n } else {\n this.$$search[search] = paramValue;\n }\n }\n\n this.$$compose();\n return this;\n },\n\n /**\n * @ngdoc method\n * @name $location#hash\n *\n * @description\n * This method is getter / setter.\n *\n * Returns the hash fragment when called without any parameters.\n *\n * Changes the hash fragment when called with a parameter and returns `$location`.\n *\n *\n * ```js\n * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue\n * var hash = $location.hash();\n * // => \"hashValue\"\n * ```\n *\n * @param {(string|number)=} hash New hash fragment\n * @return {string} hash\n */\n hash: locationGetterSetter('$$hash', function(hash) {\n return hash !== null ? hash.toString() : '';\n }),\n\n /**\n * @ngdoc method\n * @name $location#replace\n *\n * @description\n * If called, all changes to $location during the current `$digest` will replace the current history\n * record, instead of adding a new one.\n */\n replace: function() {\n this.$$replace = true;\n return this;\n }\n};\n\nforEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {\n Location.prototype = Object.create(locationPrototype);\n\n /**\n * @ngdoc method\n * @name $location#state\n *\n * @description\n * This method is getter / setter.\n *\n * Return the history state object when called without any parameter.\n *\n * Change the history state object when called with one parameter and return `$location`.\n * The state object is later passed to `pushState` or `replaceState`.\n *\n * NOTE: This method is supported only in HTML5 mode and only in browsers supporting\n * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support\n * older browsers (like IE9 or Android < 4.0), don't use this method.\n *\n * @param {object=} state State object for pushState or replaceState\n * @return {object} state\n */\n Location.prototype.state = function(state) {\n if (!arguments.length) {\n return this.$$state;\n }\n\n if (Location !== LocationHtml5Url || !this.$$html5) {\n throw $locationMinErr('nostate', 'History API state support is available only ' +\n 'in HTML5 mode and only in browsers supporting HTML5 History API');\n }\n // The user might modify `stateObject` after invoking `$location.state(stateObject)`\n // but we're changing the $$state reference to $browser.state() during the $digest\n // so the modification window is narrow.\n this.$$state = isUndefined(state) ? null : state;\n this.$$urlUpdatedByLocation = true;\n\n return this;\n };\n});\n\n\nfunction locationGetter(property) {\n return /** @this */ function() {\n return this[property];\n };\n}\n\n\nfunction locationGetterSetter(property, preprocess) {\n return /** @this */ function(value) {\n if (isUndefined(value)) {\n return this[property];\n }\n\n this[property] = preprocess(value);\n this.$$compose();\n\n return this;\n };\n}\n\n\n/**\n * @ngdoc service\n * @name $location\n *\n * @requires $rootElement\n *\n * @description\n * The $location service parses the URL in the browser address bar (based on the\n * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL\n * available to your application. Changes to the URL in the address bar are reflected into\n * $location service and changes to $location are reflected into the browser address bar.\n *\n * **The $location service:**\n *\n * - Exposes the current URL in the browser address bar, so you can\n * - Watch and observe the URL.\n * - Change the URL.\n * - Synchronizes the URL with the browser when the user\n * - Changes the address bar.\n * - Clicks the back or forward button (or clicks a History link).\n * - Clicks on a link.\n * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).\n *\n * For more information see {@link guide/$location Developer Guide: Using $location}\n */\n\n/**\n * @ngdoc provider\n * @name $locationProvider\n * @this\n *\n * @description\n * Use the `$locationProvider` to configure how the application deep linking paths are stored.\n */\nfunction $LocationProvider() {\n var hashPrefix = '!',\n html5Mode = {\n enabled: false,\n requireBase: true,\n rewriteLinks: true\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#hashPrefix\n * @description\n * The default value for the prefix is `'!'`.\n * @param {string=} prefix Prefix for hash part (containing path and search)\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.hashPrefix = function(prefix) {\n if (isDefined(prefix)) {\n hashPrefix = prefix;\n return this;\n } else {\n return hashPrefix;\n }\n };\n\n /**\n * @ngdoc method\n * @name $locationProvider#html5Mode\n * @description\n * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.\n * If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported\n * properties:\n * - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to\n * change urls where supported. Will fall back to hash-prefixed paths in browsers that do not\n * support `pushState`.\n * - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies\n * whether or not a tag is required to be present. If `enabled` and `requireBase` are\n * true, and a base tag is not present, an error will be thrown when `$location` is injected.\n * See the {@link guide/$location $location guide for more information}\n * - **rewriteLinks** - `{boolean|string}` - (default: `true`) When html5Mode is enabled,\n * enables/disables URL rewriting for relative links. If set to a string, URL rewriting will\n * only happen on links with an attribute that matches the given string. For example, if set\n * to `'internal-link'`, then the URL will only be rewritten for `` links.\n * Note that [attribute name normalization](guide/directive#normalization) does not apply\n * here, so `'internalLink'` will **not** match `'internal-link'`.\n *\n * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter\n */\n this.html5Mode = function(mode) {\n if (isBoolean(mode)) {\n html5Mode.enabled = mode;\n return this;\n } else if (isObject(mode)) {\n\n if (isBoolean(mode.enabled)) {\n html5Mode.enabled = mode.enabled;\n }\n\n if (isBoolean(mode.requireBase)) {\n html5Mode.requireBase = mode.requireBase;\n }\n\n if (isBoolean(mode.rewriteLinks) || isString(mode.rewriteLinks)) {\n html5Mode.rewriteLinks = mode.rewriteLinks;\n }\n\n return this;\n } else {\n return html5Mode;\n }\n };\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeStart\n * @eventType broadcast on root scope\n * @description\n * Broadcasted before a URL will change.\n *\n * This change can be prevented by calling\n * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more\n * details about event object. Upon successful change\n * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n /**\n * @ngdoc event\n * @name $location#$locationChangeSuccess\n * @eventType broadcast on root scope\n * @description\n * Broadcasted after a URL was changed.\n *\n * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when\n * the browser supports the HTML5 History API.\n *\n * @param {Object} angularEvent Synthetic event object.\n * @param {string} newUrl New URL\n * @param {string=} oldUrl URL that was before it was changed.\n * @param {string=} newState New history state object\n * @param {string=} oldState History state object that was before it was changed.\n */\n\n this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',\n function($rootScope, $browser, $sniffer, $rootElement, $window) {\n var $location,\n LocationMode,\n baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''\n initialUrl = $browser.url(),\n appBase;\n\n if (html5Mode.enabled) {\n if (!baseHref && html5Mode.requireBase) {\n throw $locationMinErr('nobase',\n '$location in HTML5 mode requires a tag to be present!');\n }\n appBase = serverBase(initialUrl) + (baseHref || '/');\n LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;\n } else {\n appBase = stripHash(initialUrl);\n LocationMode = LocationHashbangUrl;\n }\n var appBaseNoFile = stripFile(appBase);\n\n $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);\n $location.$$parseLinkUrl(initialUrl, initialUrl);\n\n $location.$$state = $browser.state();\n\n var IGNORE_URI_REGEXP = /^\\s*(javascript|mailto):/i;\n\n // Determine if two URLs are equal despite potentially having different encoding/normalizing\n // such as $location.absUrl() vs $browser.url()\n // See https://github.com/angular/angular.js/issues/16592\n function urlsEqual(a, b) {\n return a === b || urlResolve(a).href === urlResolve(b).href;\n }\n\n function setBrowserUrlWithFallback(url, replace, state) {\n var oldUrl = $location.url();\n var oldState = $location.$$state;\n try {\n $browser.url(url, replace, state);\n\n // Make sure $location.state() returns referentially identical (not just deeply equal)\n // state object; this makes possible quick checking if the state changed in the digest\n // loop. Checking deep equality would be too expensive.\n $location.$$state = $browser.state();\n } catch (e) {\n // Restore old values if pushState fails\n $location.url(oldUrl);\n $location.$$state = oldState;\n\n throw e;\n }\n }\n\n $rootElement.on('click', function(event) {\n var rewriteLinks = html5Mode.rewriteLinks;\n // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)\n // currently we open nice url link and redirect then\n\n if (!rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which === 2 || event.button === 2) return;\n\n var elm = jqLite(event.target);\n\n // traverse the DOM up to find first A tag\n while (nodeName_(elm[0]) !== 'a') {\n // ignore rewriting if no A tag (reached root element, or no parent - removed from document)\n if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;\n }\n\n if (isString(rewriteLinks) && isUndefined(elm.attr(rewriteLinks))) return;\n\n var absHref = elm.prop('href');\n // get the actual href attribute - see\n // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx\n var relHref = elm.attr('href') || elm.attr('xlink:href');\n\n if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {\n // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during\n // an animation.\n absHref = urlResolve(absHref.animVal).href;\n }\n\n // Ignore when url is started with javascript: or mailto:\n if (IGNORE_URI_REGEXP.test(absHref)) return;\n\n if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {\n if ($location.$$parseLinkUrl(absHref, relHref)) {\n // We do a preventDefault for all urls that are part of the AngularJS application,\n // in html5mode and also without, so that we are able to abort navigation without\n // getting double entries in the location history.\n event.preventDefault();\n // update location manually\n if ($location.absUrl() !== $browser.url()) {\n $rootScope.$apply();\n }\n }\n }\n });\n\n\n // rewrite hashbang url <> html5 url\n if ($location.absUrl() !== initialUrl) {\n $browser.url($location.absUrl(), true);\n }\n\n var initializing = true;\n\n // update $location when $browser url changes\n $browser.onUrlChange(function(newUrl, newState) {\n\n if (!startsWith(newUrl, appBaseNoFile)) {\n // If we are navigating outside of the app then force a reload\n $window.location.href = newUrl;\n return;\n }\n\n $rootScope.$evalAsync(function() {\n var oldUrl = $location.absUrl();\n var oldState = $location.$$state;\n var defaultPrevented;\n $location.$$parse(newUrl);\n $location.$$state = newState;\n\n defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n newState, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n setBrowserUrlWithFallback(oldUrl, false, oldState);\n } else {\n initializing = false;\n afterLocationChange(oldUrl, oldState);\n }\n });\n if (!$rootScope.$$phase) $rootScope.$digest();\n });\n\n // update browser\n $rootScope.$watch(function $locationWatch() {\n if (initializing || $location.$$urlUpdatedByLocation) {\n $location.$$urlUpdatedByLocation = false;\n\n var oldUrl = $browser.url();\n var newUrl = $location.absUrl();\n var oldState = $browser.state();\n var currentReplace = $location.$$replace;\n var urlOrStateChanged = !urlsEqual(oldUrl, newUrl) ||\n ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);\n\n if (initializing || urlOrStateChanged) {\n initializing = false;\n\n $rootScope.$evalAsync(function() {\n var newUrl = $location.absUrl();\n var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,\n $location.$$state, oldState).defaultPrevented;\n\n // if the location was changed by a `$locationChangeStart` handler then stop\n // processing this location change\n if ($location.absUrl() !== newUrl) return;\n\n if (defaultPrevented) {\n $location.$$parse(oldUrl);\n $location.$$state = oldState;\n } else {\n if (urlOrStateChanged) {\n setBrowserUrlWithFallback(newUrl, currentReplace,\n oldState === $location.$$state ? null : $location.$$state);\n }\n afterLocationChange(oldUrl, oldState);\n }\n });\n }\n }\n\n $location.$$replace = false;\n\n // we don't need to return anything because $evalAsync will make the digest loop dirty when\n // there is a change\n });\n\n return $location;\n\n function afterLocationChange(oldUrl, oldState) {\n $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,\n $location.$$state, oldState);\n }\n}];\n}\n\n/**\n * @ngdoc service\n * @name $log\n * @requires $window\n *\n * @description\n * Simple service for logging. Default implementation safely writes the message\n * into the browser's console (if present).\n *\n * The main purpose of this service is to simplify debugging and troubleshooting.\n *\n * To reveal the location of the calls to `$log` in the JavaScript console,\n * you can \"blackbox\" the AngularJS source in your browser:\n *\n * [Mozilla description of blackboxing](https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Black_box_a_source).\n * [Chrome description of blackboxing](https://developer.chrome.com/devtools/docs/blackboxing).\n *\n * Note: Not all browsers support blackboxing.\n *\n * The default is to log `debug` messages. You can use\n * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.\n *\n * @example\n \n \n angular.module('logExample', [])\n .controller('LogController', ['$scope', '$log', function($scope, $log) {\n $scope.$log = $log;\n $scope.message = 'Hello World!';\n }]);\n \n \n
      \n

      Reload this page with open console, enter text and hit the log button...

      \n \n \n \n \n \n \n
      \n
      \n
      \n */\n\n/**\n * @ngdoc provider\n * @name $logProvider\n * @this\n *\n * @description\n * Use the `$logProvider` to configure how the application logs messages\n */\nfunction $LogProvider() {\n var debug = true,\n self = this;\n\n /**\n * @ngdoc method\n * @name $logProvider#debugEnabled\n * @description\n * @param {boolean=} flag enable or disable debug level messages\n * @returns {*} current value if used as getter or itself (chaining) if used as setter\n */\n this.debugEnabled = function(flag) {\n if (isDefined(flag)) {\n debug = flag;\n return this;\n } else {\n return debug;\n }\n };\n\n this.$get = ['$window', function($window) {\n // Support: IE 9-11, Edge 12-14+\n // IE/Edge display errors in such a way that it requires the user to click in 4 places\n // to see the stack trace. There is no way to feature-detect it so there's a chance\n // of the user agent sniffing to go wrong but since it's only about logging, this shouldn't\n // break apps. Other browsers display errors in a sensible way and some of them map stack\n // traces along source maps if available so it makes sense to let browsers display it\n // as they want.\n var formatStackTrace = msie || /\\bEdge\\//.test($window.navigator && $window.navigator.userAgent);\n\n return {\n /**\n * @ngdoc method\n * @name $log#log\n *\n * @description\n * Write a log message\n */\n log: consoleLog('log'),\n\n /**\n * @ngdoc method\n * @name $log#info\n *\n * @description\n * Write an information message\n */\n info: consoleLog('info'),\n\n /**\n * @ngdoc method\n * @name $log#warn\n *\n * @description\n * Write a warning message\n */\n warn: consoleLog('warn'),\n\n /**\n * @ngdoc method\n * @name $log#error\n *\n * @description\n * Write an error message\n */\n error: consoleLog('error'),\n\n /**\n * @ngdoc method\n * @name $log#debug\n *\n * @description\n * Write a debug message\n */\n debug: (function() {\n var fn = consoleLog('debug');\n\n return function() {\n if (debug) {\n fn.apply(self, arguments);\n }\n };\n })()\n };\n\n function formatError(arg) {\n if (isError(arg)) {\n if (arg.stack && formatStackTrace) {\n arg = (arg.message && arg.stack.indexOf(arg.message) === -1)\n ? 'Error: ' + arg.message + '\\n' + arg.stack\n : arg.stack;\n } else if (arg.sourceURL) {\n arg = arg.message + '\\n' + arg.sourceURL + ':' + arg.line;\n }\n }\n return arg;\n }\n\n function consoleLog(type) {\n var console = $window.console || {},\n logFn = console[type] || console.log || noop;\n\n return function() {\n var args = [];\n forEach(arguments, function(arg) {\n args.push(formatError(arg));\n });\n // Support: IE 9 only\n // console methods don't inherit from Function.prototype in IE 9 so we can't\n // call `logFn.apply(console, args)` directly.\n return Function.prototype.apply.call(logFn, console, args);\n };\n }\n }];\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\nvar $parseMinErr = minErr('$parse');\n\nvar objectValueOf = {}.constructor.prototype.valueOf;\n\n// Sandboxing AngularJS Expressions\n// ------------------------------\n// AngularJS expressions are no longer sandboxed. So it is now even easier to access arbitrary JS code by\n// various means such as obtaining a reference to native JS functions like the Function constructor.\n//\n// As an example, consider the following AngularJS expression:\n//\n// {}.toString.constructor('alert(\"evil JS code\")')\n//\n// It is important to realize that if you create an expression from a string that contains user provided\n// content then it is possible that your application contains a security vulnerability to an XSS style attack.\n//\n// See https://docs.angularjs.org/guide/security\n\n\nfunction getStringValue(name) {\n // Property names must be strings. This means that non-string objects cannot be used\n // as keys in an object. Any non-string object, including a number, is typecasted\n // into a string via the toString method.\n // -- MDN, https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Property_accessors#Property_names\n //\n // So, to ensure that we are checking the same `name` that JavaScript would use, we cast it\n // to a string. It's not always possible. If `name` is an object and its `toString` method is\n // 'broken' (doesn't return a string, isn't a function, etc.), an error will be thrown:\n //\n // TypeError: Cannot convert object to primitive value\n //\n // For performance reasons, we don't catch this error here and allow it to propagate up the call\n // stack. Note that you'll get the same error in JavaScript if you try to access a property using\n // such a 'broken' object as a key.\n return name + '';\n}\n\n\nvar OPERATORS = createMap();\nforEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });\nvar ESCAPE = {'n':'\\n', 'f':'\\f', 'r':'\\r', 't':'\\t', 'v':'\\v', '\\'':'\\'', '\"':'\"'};\n\n\n/////////////////////////////////////////\n\n\n/**\n * @constructor\n */\nvar Lexer = function Lexer(options) {\n this.options = options;\n};\n\nLexer.prototype = {\n constructor: Lexer,\n\n lex: function(text) {\n this.text = text;\n this.index = 0;\n this.tokens = [];\n\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n if (ch === '\"' || ch === '\\'') {\n this.readString(ch);\n } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {\n this.readNumber();\n } else if (this.isIdentifierStart(this.peekMultichar())) {\n this.readIdent();\n } else if (this.is(ch, '(){}[].,;:?')) {\n this.tokens.push({index: this.index, text: ch});\n this.index++;\n } else if (this.isWhitespace(ch)) {\n this.index++;\n } else {\n var ch2 = ch + this.peek();\n var ch3 = ch2 + this.peek(2);\n var op1 = OPERATORS[ch];\n var op2 = OPERATORS[ch2];\n var op3 = OPERATORS[ch3];\n if (op1 || op2 || op3) {\n var token = op3 ? ch3 : (op2 ? ch2 : ch);\n this.tokens.push({index: this.index, text: token, operator: true});\n this.index += token.length;\n } else {\n this.throwError('Unexpected next character ', this.index, this.index + 1);\n }\n }\n }\n return this.tokens;\n },\n\n is: function(ch, chars) {\n return chars.indexOf(ch) !== -1;\n },\n\n peek: function(i) {\n var num = i || 1;\n return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;\n },\n\n isNumber: function(ch) {\n return ('0' <= ch && ch <= '9') && typeof ch === 'string';\n },\n\n isWhitespace: function(ch) {\n // IE treats non-breaking space as \\u00A0\n return (ch === ' ' || ch === '\\r' || ch === '\\t' ||\n ch === '\\n' || ch === '\\v' || ch === '\\u00A0');\n },\n\n isIdentifierStart: function(ch) {\n return this.options.isIdentifierStart ?\n this.options.isIdentifierStart(ch, this.codePointAt(ch)) :\n this.isValidIdentifierStart(ch);\n },\n\n isValidIdentifierStart: function(ch) {\n return ('a' <= ch && ch <= 'z' ||\n 'A' <= ch && ch <= 'Z' ||\n '_' === ch || ch === '$');\n },\n\n isIdentifierContinue: function(ch) {\n return this.options.isIdentifierContinue ?\n this.options.isIdentifierContinue(ch, this.codePointAt(ch)) :\n this.isValidIdentifierContinue(ch);\n },\n\n isValidIdentifierContinue: function(ch, cp) {\n return this.isValidIdentifierStart(ch, cp) || this.isNumber(ch);\n },\n\n codePointAt: function(ch) {\n if (ch.length === 1) return ch.charCodeAt(0);\n // eslint-disable-next-line no-bitwise\n return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00;\n },\n\n peekMultichar: function() {\n var ch = this.text.charAt(this.index);\n var peek = this.peek();\n if (!peek) {\n return ch;\n }\n var cp1 = ch.charCodeAt(0);\n var cp2 = peek.charCodeAt(0);\n if (cp1 >= 0xD800 && cp1 <= 0xDBFF && cp2 >= 0xDC00 && cp2 <= 0xDFFF) {\n return ch + peek;\n }\n return ch;\n },\n\n isExpOperator: function(ch) {\n return (ch === '-' || ch === '+' || this.isNumber(ch));\n },\n\n throwError: function(error, start, end) {\n end = end || this.index;\n var colStr = (isDefined(start)\n ? 's ' + start + '-' + this.index + ' [' + this.text.substring(start, end) + ']'\n : ' ' + end);\n throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',\n error, colStr, this.text);\n },\n\n readNumber: function() {\n var number = '';\n var start = this.index;\n while (this.index < this.text.length) {\n var ch = lowercase(this.text.charAt(this.index));\n if (ch === '.' || this.isNumber(ch)) {\n number += ch;\n } else {\n var peekCh = this.peek();\n if (ch === 'e' && this.isExpOperator(peekCh)) {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n peekCh && this.isNumber(peekCh) &&\n number.charAt(number.length - 1) === 'e') {\n number += ch;\n } else if (this.isExpOperator(ch) &&\n (!peekCh || !this.isNumber(peekCh)) &&\n number.charAt(number.length - 1) === 'e') {\n this.throwError('Invalid exponent');\n } else {\n break;\n }\n }\n this.index++;\n }\n this.tokens.push({\n index: start,\n text: number,\n constant: true,\n value: Number(number)\n });\n },\n\n readIdent: function() {\n var start = this.index;\n this.index += this.peekMultichar().length;\n while (this.index < this.text.length) {\n var ch = this.peekMultichar();\n if (!this.isIdentifierContinue(ch)) {\n break;\n }\n this.index += ch.length;\n }\n this.tokens.push({\n index: start,\n text: this.text.slice(start, this.index),\n identifier: true\n });\n },\n\n readString: function(quote) {\n var start = this.index;\n this.index++;\n var string = '';\n var rawString = quote;\n var escape = false;\n while (this.index < this.text.length) {\n var ch = this.text.charAt(this.index);\n rawString += ch;\n if (escape) {\n if (ch === 'u') {\n var hex = this.text.substring(this.index + 1, this.index + 5);\n if (!hex.match(/[\\da-f]{4}/i)) {\n this.throwError('Invalid unicode escape [\\\\u' + hex + ']');\n }\n this.index += 4;\n string += String.fromCharCode(parseInt(hex, 16));\n } else {\n var rep = ESCAPE[ch];\n string = string + (rep || ch);\n }\n escape = false;\n } else if (ch === '\\\\') {\n escape = true;\n } else if (ch === quote) {\n this.index++;\n this.tokens.push({\n index: start,\n text: rawString,\n constant: true,\n value: string\n });\n return;\n } else {\n string += ch;\n }\n this.index++;\n }\n this.throwError('Unterminated quote', start);\n }\n};\n\nvar AST = function AST(lexer, options) {\n this.lexer = lexer;\n this.options = options;\n};\n\nAST.Program = 'Program';\nAST.ExpressionStatement = 'ExpressionStatement';\nAST.AssignmentExpression = 'AssignmentExpression';\nAST.ConditionalExpression = 'ConditionalExpression';\nAST.LogicalExpression = 'LogicalExpression';\nAST.BinaryExpression = 'BinaryExpression';\nAST.UnaryExpression = 'UnaryExpression';\nAST.CallExpression = 'CallExpression';\nAST.MemberExpression = 'MemberExpression';\nAST.Identifier = 'Identifier';\nAST.Literal = 'Literal';\nAST.ArrayExpression = 'ArrayExpression';\nAST.Property = 'Property';\nAST.ObjectExpression = 'ObjectExpression';\nAST.ThisExpression = 'ThisExpression';\nAST.LocalsExpression = 'LocalsExpression';\n\n// Internal use only\nAST.NGValueParameter = 'NGValueParameter';\n\nAST.prototype = {\n ast: function(text) {\n this.text = text;\n this.tokens = this.lexer.lex(text);\n\n var value = this.program();\n\n if (this.tokens.length !== 0) {\n this.throwError('is an unexpected token', this.tokens[0]);\n }\n\n return value;\n },\n\n program: function() {\n var body = [];\n while (true) {\n if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))\n body.push(this.expressionStatement());\n if (!this.expect(';')) {\n return { type: AST.Program, body: body};\n }\n }\n },\n\n expressionStatement: function() {\n return { type: AST.ExpressionStatement, expression: this.filterChain() };\n },\n\n filterChain: function() {\n var left = this.expression();\n while (this.expect('|')) {\n left = this.filter(left);\n }\n return left;\n },\n\n expression: function() {\n return this.assignment();\n },\n\n assignment: function() {\n var result = this.ternary();\n if (this.expect('=')) {\n if (!isAssignable(result)) {\n throw $parseMinErr('lval', 'Trying to assign a value to a non l-value');\n }\n\n result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};\n }\n return result;\n },\n\n ternary: function() {\n var test = this.logicalOR();\n var alternate;\n var consequent;\n if (this.expect('?')) {\n alternate = this.expression();\n if (this.consume(':')) {\n consequent = this.expression();\n return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};\n }\n }\n return test;\n },\n\n logicalOR: function() {\n var left = this.logicalAND();\n while (this.expect('||')) {\n left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };\n }\n return left;\n },\n\n logicalAND: function() {\n var left = this.equality();\n while (this.expect('&&')) {\n left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};\n }\n return left;\n },\n\n equality: function() {\n var left = this.relational();\n var token;\n while ((token = this.expect('==','!=','===','!=='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };\n }\n return left;\n },\n\n relational: function() {\n var left = this.additive();\n var token;\n while ((token = this.expect('<', '>', '<=', '>='))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };\n }\n return left;\n },\n\n additive: function() {\n var left = this.multiplicative();\n var token;\n while ((token = this.expect('+','-'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };\n }\n return left;\n },\n\n multiplicative: function() {\n var left = this.unary();\n var token;\n while ((token = this.expect('*','/','%'))) {\n left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };\n }\n return left;\n },\n\n unary: function() {\n var token;\n if ((token = this.expect('+', '-', '!'))) {\n return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };\n } else {\n return this.primary();\n }\n },\n\n primary: function() {\n var primary;\n if (this.expect('(')) {\n primary = this.filterChain();\n this.consume(')');\n } else if (this.expect('[')) {\n primary = this.arrayDeclaration();\n } else if (this.expect('{')) {\n primary = this.object();\n } else if (this.selfReferential.hasOwnProperty(this.peek().text)) {\n primary = copy(this.selfReferential[this.consume().text]);\n } else if (this.options.literals.hasOwnProperty(this.peek().text)) {\n primary = { type: AST.Literal, value: this.options.literals[this.consume().text]};\n } else if (this.peek().identifier) {\n primary = this.identifier();\n } else if (this.peek().constant) {\n primary = this.constant();\n } else {\n this.throwError('not a primary expression', this.peek());\n }\n\n var next;\n while ((next = this.expect('(', '[', '.'))) {\n if (next.text === '(') {\n primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };\n this.consume(')');\n } else if (next.text === '[') {\n primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };\n this.consume(']');\n } else if (next.text === '.') {\n primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };\n } else {\n this.throwError('IMPOSSIBLE');\n }\n }\n return primary;\n },\n\n filter: function(baseExpression) {\n var args = [baseExpression];\n var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};\n\n while (this.expect(':')) {\n args.push(this.expression());\n }\n\n return result;\n },\n\n parseArguments: function() {\n var args = [];\n if (this.peekToken().text !== ')') {\n do {\n args.push(this.filterChain());\n } while (this.expect(','));\n }\n return args;\n },\n\n identifier: function() {\n var token = this.consume();\n if (!token.identifier) {\n this.throwError('is not a valid identifier', token);\n }\n return { type: AST.Identifier, name: token.text };\n },\n\n constant: function() {\n // TODO check that it is a constant\n return { type: AST.Literal, value: this.consume().value };\n },\n\n arrayDeclaration: function() {\n var elements = [];\n if (this.peekToken().text !== ']') {\n do {\n if (this.peek(']')) {\n // Support trailing commas per ES5.1.\n break;\n }\n elements.push(this.expression());\n } while (this.expect(','));\n }\n this.consume(']');\n\n return { type: AST.ArrayExpression, elements: elements };\n },\n\n object: function() {\n var properties = [], property;\n if (this.peekToken().text !== '}') {\n do {\n if (this.peek('}')) {\n // Support trailing commas per ES5.1.\n break;\n }\n property = {type: AST.Property, kind: 'init'};\n if (this.peek().constant) {\n property.key = this.constant();\n property.computed = false;\n this.consume(':');\n property.value = this.expression();\n } else if (this.peek().identifier) {\n property.key = this.identifier();\n property.computed = false;\n if (this.peek(':')) {\n this.consume(':');\n property.value = this.expression();\n } else {\n property.value = property.key;\n }\n } else if (this.peek('[')) {\n this.consume('[');\n property.key = this.expression();\n this.consume(']');\n property.computed = true;\n this.consume(':');\n property.value = this.expression();\n } else {\n this.throwError('invalid key', this.peek());\n }\n properties.push(property);\n } while (this.expect(','));\n }\n this.consume('}');\n\n return {type: AST.ObjectExpression, properties: properties };\n },\n\n throwError: function(msg, token) {\n throw $parseMinErr('syntax',\n 'Syntax Error: Token \\'{0}\\' {1} at column {2} of the expression [{3}] starting at [{4}].',\n token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));\n },\n\n consume: function(e1) {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n\n var token = this.expect(e1);\n if (!token) {\n this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());\n }\n return token;\n },\n\n peekToken: function() {\n if (this.tokens.length === 0) {\n throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);\n }\n return this.tokens[0];\n },\n\n peek: function(e1, e2, e3, e4) {\n return this.peekAhead(0, e1, e2, e3, e4);\n },\n\n peekAhead: function(i, e1, e2, e3, e4) {\n if (this.tokens.length > i) {\n var token = this.tokens[i];\n var t = token.text;\n if (t === e1 || t === e2 || t === e3 || t === e4 ||\n (!e1 && !e2 && !e3 && !e4)) {\n return token;\n }\n }\n return false;\n },\n\n expect: function(e1, e2, e3, e4) {\n var token = this.peek(e1, e2, e3, e4);\n if (token) {\n this.tokens.shift();\n return token;\n }\n return false;\n },\n\n selfReferential: {\n 'this': {type: AST.ThisExpression },\n '$locals': {type: AST.LocalsExpression }\n }\n};\n\nfunction ifDefined(v, d) {\n return typeof v !== 'undefined' ? v : d;\n}\n\nfunction plusFn(l, r) {\n if (typeof l === 'undefined') return r;\n if (typeof r === 'undefined') return l;\n return l + r;\n}\n\nfunction isStateless($filter, filterName) {\n var fn = $filter(filterName);\n return !fn.$stateful;\n}\n\nvar PURITY_ABSOLUTE = 1;\nvar PURITY_RELATIVE = 2;\n\n// Detect nodes which could depend on non-shallow state of objects\nfunction isPure(node, parentIsPure) {\n switch (node.type) {\n // Computed members might invoke a stateful toString()\n case AST.MemberExpression:\n if (node.computed) {\n return false;\n }\n break;\n\n // Unary always convert to primative\n case AST.UnaryExpression:\n return PURITY_ABSOLUTE;\n\n // The binary + operator can invoke a stateful toString().\n case AST.BinaryExpression:\n return node.operator !== '+' ? PURITY_ABSOLUTE : false;\n\n // Functions / filters probably read state from within objects\n case AST.CallExpression:\n return false;\n }\n\n return (undefined === parentIsPure) ? PURITY_RELATIVE : parentIsPure;\n}\n\nfunction findConstantAndWatchExpressions(ast, $filter, parentIsPure) {\n var allConstants;\n var argsToWatch;\n var isStatelessFilter;\n\n var astIsPure = ast.isPure = isPure(ast, parentIsPure);\n\n switch (ast.type) {\n case AST.Program:\n allConstants = true;\n forEach(ast.body, function(expr) {\n findConstantAndWatchExpressions(expr.expression, $filter, astIsPure);\n allConstants = allConstants && expr.expression.constant;\n });\n ast.constant = allConstants;\n break;\n case AST.Literal:\n ast.constant = true;\n ast.toWatch = [];\n break;\n case AST.UnaryExpression:\n findConstantAndWatchExpressions(ast.argument, $filter, astIsPure);\n ast.constant = ast.argument.constant;\n ast.toWatch = ast.argument.toWatch;\n break;\n case AST.BinaryExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);\n break;\n case AST.LogicalExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.ConditionalExpression:\n findConstantAndWatchExpressions(ast.test, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.alternate, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.consequent, $filter, astIsPure);\n ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.Identifier:\n ast.constant = false;\n ast.toWatch = [ast];\n break;\n case AST.MemberExpression:\n findConstantAndWatchExpressions(ast.object, $filter, astIsPure);\n if (ast.computed) {\n findConstantAndWatchExpressions(ast.property, $filter, astIsPure);\n }\n ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);\n ast.toWatch = ast.constant ? [] : [ast];\n break;\n case AST.CallExpression:\n isStatelessFilter = ast.filter ? isStateless($filter, ast.callee.name) : false;\n allConstants = isStatelessFilter;\n argsToWatch = [];\n forEach(ast.arguments, function(expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = isStatelessFilter ? argsToWatch : [ast];\n break;\n case AST.AssignmentExpression:\n findConstantAndWatchExpressions(ast.left, $filter, astIsPure);\n findConstantAndWatchExpressions(ast.right, $filter, astIsPure);\n ast.constant = ast.left.constant && ast.right.constant;\n ast.toWatch = [ast];\n break;\n case AST.ArrayExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.elements, function(expr) {\n findConstantAndWatchExpressions(expr, $filter, astIsPure);\n allConstants = allConstants && expr.constant;\n argsToWatch.push.apply(argsToWatch, expr.toWatch);\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ObjectExpression:\n allConstants = true;\n argsToWatch = [];\n forEach(ast.properties, function(property) {\n findConstantAndWatchExpressions(property.value, $filter, astIsPure);\n allConstants = allConstants && property.value.constant;\n argsToWatch.push.apply(argsToWatch, property.value.toWatch);\n if (property.computed) {\n //`{[key]: value}` implicitly does `key.toString()` which may be non-pure\n findConstantAndWatchExpressions(property.key, $filter, /*parentIsPure=*/false);\n allConstants = allConstants && property.key.constant;\n argsToWatch.push.apply(argsToWatch, property.key.toWatch);\n }\n });\n ast.constant = allConstants;\n ast.toWatch = argsToWatch;\n break;\n case AST.ThisExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n case AST.LocalsExpression:\n ast.constant = false;\n ast.toWatch = [];\n break;\n }\n}\n\nfunction getInputs(body) {\n if (body.length !== 1) return;\n var lastExpression = body[0].expression;\n var candidate = lastExpression.toWatch;\n if (candidate.length !== 1) return candidate;\n return candidate[0] !== lastExpression ? candidate : undefined;\n}\n\nfunction isAssignable(ast) {\n return ast.type === AST.Identifier || ast.type === AST.MemberExpression;\n}\n\nfunction assignableAST(ast) {\n if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {\n return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};\n }\n}\n\nfunction isLiteral(ast) {\n return ast.body.length === 0 ||\n ast.body.length === 1 && (\n ast.body[0].expression.type === AST.Literal ||\n ast.body[0].expression.type === AST.ArrayExpression ||\n ast.body[0].expression.type === AST.ObjectExpression);\n}\n\nfunction isConstant(ast) {\n return ast.constant;\n}\n\nfunction ASTCompiler($filter) {\n this.$filter = $filter;\n}\n\nASTCompiler.prototype = {\n compile: function(ast) {\n var self = this;\n this.state = {\n nextId: 0,\n filters: {},\n fn: {vars: [], body: [], own: {}},\n assign: {vars: [], body: [], own: {}},\n inputs: []\n };\n findConstantAndWatchExpressions(ast, self.$filter);\n var extra = '';\n var assignable;\n this.stage = 'assign';\n if ((assignable = assignableAST(ast))) {\n this.state.computing = 'assign';\n var result = this.nextId();\n this.recurse(assignable, result);\n this.return_(result);\n extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');\n }\n var toWatch = getInputs(ast.body);\n self.stage = 'inputs';\n forEach(toWatch, function(watch, key) {\n var fnKey = 'fn' + key;\n self.state[fnKey] = {vars: [], body: [], own: {}};\n self.state.computing = fnKey;\n var intoId = self.nextId();\n self.recurse(watch, intoId);\n self.return_(intoId);\n self.state.inputs.push({name: fnKey, isPure: watch.isPure});\n watch.watchId = key;\n });\n this.state.computing = 'fn';\n this.stage = 'main';\n this.recurse(ast);\n var fnString =\n // The build and minification steps remove the string \"use strict\" from the code, but this is done using a regex.\n // This is a workaround for this until we do a better job at only removing the prefix only when we should.\n '\"' + this.USE + ' ' + this.STRICT + '\";\\n' +\n this.filterPrefix() +\n 'var fn=' + this.generateFunction('fn', 's,l,a,i') +\n extra +\n this.watchFns() +\n 'return fn;';\n\n // eslint-disable-next-line no-new-func\n var fn = (new Function('$filter',\n 'getStringValue',\n 'ifDefined',\n 'plus',\n fnString))(\n this.$filter,\n getStringValue,\n ifDefined,\n plusFn);\n this.state = this.stage = undefined;\n return fn;\n },\n\n USE: 'use',\n\n STRICT: 'strict',\n\n watchFns: function() {\n var result = [];\n var inputs = this.state.inputs;\n var self = this;\n forEach(inputs, function(input) {\n result.push('var ' + input.name + '=' + self.generateFunction(input.name, 's'));\n if (input.isPure) {\n result.push(input.name, '.isPure=' + JSON.stringify(input.isPure) + ';');\n }\n });\n if (inputs.length) {\n result.push('fn.inputs=[' + inputs.map(function(i) { return i.name; }).join(',') + '];');\n }\n return result.join('');\n },\n\n generateFunction: function(name, params) {\n return 'function(' + params + '){' +\n this.varsPrefix(name) +\n this.body(name) +\n '};';\n },\n\n filterPrefix: function() {\n var parts = [];\n var self = this;\n forEach(this.state.filters, function(id, filter) {\n parts.push(id + '=$filter(' + self.escape(filter) + ')');\n });\n if (parts.length) return 'var ' + parts.join(',') + ';';\n return '';\n },\n\n varsPrefix: function(section) {\n return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';\n },\n\n body: function(section) {\n return this.state[section].body.join('');\n },\n\n recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var left, right, self = this, args, expression, computed;\n recursionFn = recursionFn || noop;\n if (!skipWatchIdCheck && isDefined(ast.watchId)) {\n intoId = intoId || this.nextId();\n this.if_('i',\n this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),\n this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)\n );\n return;\n }\n switch (ast.type) {\n case AST.Program:\n forEach(ast.body, function(expression, pos) {\n self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });\n if (pos !== ast.body.length - 1) {\n self.current().body.push(right, ';');\n } else {\n self.return_(right);\n }\n });\n break;\n case AST.Literal:\n expression = this.escape(ast.value);\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.UnaryExpression:\n this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });\n expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.BinaryExpression:\n this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });\n this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });\n if (ast.operator === '+') {\n expression = this.plus(left, right);\n } else if (ast.operator === '-') {\n expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);\n } else {\n expression = '(' + left + ')' + ast.operator + '(' + right + ')';\n }\n this.assign(intoId, expression);\n recursionFn(expression);\n break;\n case AST.LogicalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.left, intoId);\n self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));\n recursionFn(intoId);\n break;\n case AST.ConditionalExpression:\n intoId = intoId || this.nextId();\n self.recurse(ast.test, intoId);\n self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));\n recursionFn(intoId);\n break;\n case AST.Identifier:\n intoId = intoId || this.nextId();\n if (nameId) {\n nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');\n nameId.computed = false;\n nameId.name = ast.name;\n }\n self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),\n function() {\n self.if_(self.stage === 'inputs' || 's', function() {\n if (create && create !== 1) {\n self.if_(\n self.isNull(self.nonComputedMember('s', ast.name)),\n self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));\n }\n self.assign(intoId, self.nonComputedMember('s', ast.name));\n });\n }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))\n );\n recursionFn(intoId);\n break;\n case AST.MemberExpression:\n left = nameId && (nameId.context = this.nextId()) || this.nextId();\n intoId = intoId || this.nextId();\n self.recurse(ast.object, left, undefined, function() {\n self.if_(self.notNull(left), function() {\n if (ast.computed) {\n right = self.nextId();\n self.recurse(ast.property, right);\n self.getStringValue(right);\n if (create && create !== 1) {\n self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));\n }\n expression = self.computedMember(left, right);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = true;\n nameId.name = right;\n }\n } else {\n if (create && create !== 1) {\n self.if_(self.isNull(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));\n }\n expression = self.nonComputedMember(left, ast.property.name);\n self.assign(intoId, expression);\n if (nameId) {\n nameId.computed = false;\n nameId.name = ast.property.name;\n }\n }\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n }, !!create);\n break;\n case AST.CallExpression:\n intoId = intoId || this.nextId();\n if (ast.filter) {\n right = self.filter(ast.callee.name);\n args = [];\n forEach(ast.arguments, function(expr) {\n var argument = self.nextId();\n self.recurse(expr, argument);\n args.push(argument);\n });\n expression = right + '(' + args.join(',') + ')';\n self.assign(intoId, expression);\n recursionFn(intoId);\n } else {\n right = self.nextId();\n left = {};\n args = [];\n self.recurse(ast.callee, right, left, function() {\n self.if_(self.notNull(right), function() {\n forEach(ast.arguments, function(expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n if (left.name) {\n expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';\n } else {\n expression = right + '(' + args.join(',') + ')';\n }\n self.assign(intoId, expression);\n }, function() {\n self.assign(intoId, 'undefined');\n });\n recursionFn(intoId);\n });\n }\n break;\n case AST.AssignmentExpression:\n right = this.nextId();\n left = {};\n this.recurse(ast.left, undefined, left, function() {\n self.if_(self.notNull(left.context), function() {\n self.recurse(ast.right, right);\n expression = self.member(left.context, left.name, left.computed) + ast.operator + right;\n self.assign(intoId, expression);\n recursionFn(intoId || expression);\n });\n }, 1);\n break;\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n self.recurse(expr, ast.constant ? undefined : self.nextId(), undefined, function(argument) {\n args.push(argument);\n });\n });\n expression = '[' + args.join(',') + ']';\n this.assign(intoId, expression);\n recursionFn(intoId || expression);\n break;\n case AST.ObjectExpression:\n args = [];\n computed = false;\n forEach(ast.properties, function(property) {\n if (property.computed) {\n computed = true;\n }\n });\n if (computed) {\n intoId = intoId || this.nextId();\n this.assign(intoId, '{}');\n forEach(ast.properties, function(property) {\n if (property.computed) {\n left = self.nextId();\n self.recurse(property.key, left);\n } else {\n left = property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value);\n }\n right = self.nextId();\n self.recurse(property.value, right);\n self.assign(self.member(intoId, left, property.computed), right);\n });\n } else {\n forEach(ast.properties, function(property) {\n self.recurse(property.value, ast.constant ? undefined : self.nextId(), undefined, function(expr) {\n args.push(self.escape(\n property.key.type === AST.Identifier ? property.key.name :\n ('' + property.key.value)) +\n ':' + expr);\n });\n });\n expression = '{' + args.join(',') + '}';\n this.assign(intoId, expression);\n }\n recursionFn(intoId || expression);\n break;\n case AST.ThisExpression:\n this.assign(intoId, 's');\n recursionFn(intoId || 's');\n break;\n case AST.LocalsExpression:\n this.assign(intoId, 'l');\n recursionFn(intoId || 'l');\n break;\n case AST.NGValueParameter:\n this.assign(intoId, 'v');\n recursionFn(intoId || 'v');\n break;\n }\n },\n\n getHasOwnProperty: function(element, property) {\n var key = element + '.' + property;\n var own = this.current().own;\n if (!own.hasOwnProperty(key)) {\n own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');\n }\n return own[key];\n },\n\n assign: function(id, value) {\n if (!id) return;\n this.current().body.push(id, '=', value, ';');\n return id;\n },\n\n filter: function(filterName) {\n if (!this.state.filters.hasOwnProperty(filterName)) {\n this.state.filters[filterName] = this.nextId(true);\n }\n return this.state.filters[filterName];\n },\n\n ifDefined: function(id, defaultValue) {\n return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';\n },\n\n plus: function(left, right) {\n return 'plus(' + left + ',' + right + ')';\n },\n\n return_: function(id) {\n this.current().body.push('return ', id, ';');\n },\n\n if_: function(test, alternate, consequent) {\n if (test === true) {\n alternate();\n } else {\n var body = this.current().body;\n body.push('if(', test, '){');\n alternate();\n body.push('}');\n if (consequent) {\n body.push('else{');\n consequent();\n body.push('}');\n }\n }\n },\n\n not: function(expression) {\n return '!(' + expression + ')';\n },\n\n isNull: function(expression) {\n return expression + '==null';\n },\n\n notNull: function(expression) {\n return expression + '!=null';\n },\n\n nonComputedMember: function(left, right) {\n var SAFE_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/;\n var UNSAFE_CHARACTERS = /[^$_a-zA-Z0-9]/g;\n if (SAFE_IDENTIFIER.test(right)) {\n return left + '.' + right;\n } else {\n return left + '[\"' + right.replace(UNSAFE_CHARACTERS, this.stringEscapeFn) + '\"]';\n }\n },\n\n computedMember: function(left, right) {\n return left + '[' + right + ']';\n },\n\n member: function(left, right, computed) {\n if (computed) return this.computedMember(left, right);\n return this.nonComputedMember(left, right);\n },\n\n getStringValue: function(item) {\n this.assign(item, 'getStringValue(' + item + ')');\n },\n\n lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {\n var self = this;\n return function() {\n self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);\n };\n },\n\n lazyAssign: function(id, value) {\n var self = this;\n return function() {\n self.assign(id, value);\n };\n },\n\n stringEscapeRegex: /[^ a-zA-Z0-9]/g,\n\n stringEscapeFn: function(c) {\n return '\\\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);\n },\n\n escape: function(value) {\n if (isString(value)) return '\\'' + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + '\\'';\n if (isNumber(value)) return value.toString();\n if (value === true) return 'true';\n if (value === false) return 'false';\n if (value === null) return 'null';\n if (typeof value === 'undefined') return 'undefined';\n\n throw $parseMinErr('esc', 'IMPOSSIBLE');\n },\n\n nextId: function(skip, init) {\n var id = 'v' + (this.state.nextId++);\n if (!skip) {\n this.current().vars.push(id + (init ? '=' + init : ''));\n }\n return id;\n },\n\n current: function() {\n return this.state[this.state.computing];\n }\n};\n\n\nfunction ASTInterpreter($filter) {\n this.$filter = $filter;\n}\n\nASTInterpreter.prototype = {\n compile: function(ast) {\n var self = this;\n findConstantAndWatchExpressions(ast, self.$filter);\n var assignable;\n var assign;\n if ((assignable = assignableAST(ast))) {\n assign = this.recurse(assignable);\n }\n var toWatch = getInputs(ast.body);\n var inputs;\n if (toWatch) {\n inputs = [];\n forEach(toWatch, function(watch, key) {\n var input = self.recurse(watch);\n input.isPure = watch.isPure;\n watch.input = input;\n inputs.push(input);\n watch.watchId = key;\n });\n }\n var expressions = [];\n forEach(ast.body, function(expression) {\n expressions.push(self.recurse(expression.expression));\n });\n var fn = ast.body.length === 0 ? noop :\n ast.body.length === 1 ? expressions[0] :\n function(scope, locals) {\n var lastValue;\n forEach(expressions, function(exp) {\n lastValue = exp(scope, locals);\n });\n return lastValue;\n };\n if (assign) {\n fn.assign = function(scope, value, locals) {\n return assign(scope, locals, value);\n };\n }\n if (inputs) {\n fn.inputs = inputs;\n }\n return fn;\n },\n\n recurse: function(ast, context, create) {\n var left, right, self = this, args;\n if (ast.input) {\n return this.inputs(ast.input, ast.watchId);\n }\n switch (ast.type) {\n case AST.Literal:\n return this.value(ast.value, context);\n case AST.UnaryExpression:\n right = this.recurse(ast.argument);\n return this['unary' + ast.operator](right, context);\n case AST.BinaryExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.LogicalExpression:\n left = this.recurse(ast.left);\n right = this.recurse(ast.right);\n return this['binary' + ast.operator](left, right, context);\n case AST.ConditionalExpression:\n return this['ternary?:'](\n this.recurse(ast.test),\n this.recurse(ast.alternate),\n this.recurse(ast.consequent),\n context\n );\n case AST.Identifier:\n return self.identifier(ast.name, context, create);\n case AST.MemberExpression:\n left = this.recurse(ast.object, false, !!create);\n if (!ast.computed) {\n right = ast.property.name;\n }\n if (ast.computed) right = this.recurse(ast.property);\n return ast.computed ?\n this.computedMember(left, right, context, create) :\n this.nonComputedMember(left, right, context, create);\n case AST.CallExpression:\n args = [];\n forEach(ast.arguments, function(expr) {\n args.push(self.recurse(expr));\n });\n if (ast.filter) right = this.$filter(ast.callee.name);\n if (!ast.filter) right = this.recurse(ast.callee, true);\n return ast.filter ?\n function(scope, locals, assign, inputs) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n var value = right.apply(undefined, values, inputs);\n return context ? {context: undefined, name: undefined, value: value} : value;\n } :\n function(scope, locals, assign, inputs) {\n var rhs = right(scope, locals, assign, inputs);\n var value;\n if (rhs.value != null) {\n var values = [];\n for (var i = 0; i < args.length; ++i) {\n values.push(args[i](scope, locals, assign, inputs));\n }\n value = rhs.value.apply(rhs.context, values);\n }\n return context ? {value: value} : value;\n };\n case AST.AssignmentExpression:\n left = this.recurse(ast.left, true, 1);\n right = this.recurse(ast.right);\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n lhs.context[lhs.name] = rhs;\n return context ? {value: rhs} : rhs;\n };\n case AST.ArrayExpression:\n args = [];\n forEach(ast.elements, function(expr) {\n args.push(self.recurse(expr));\n });\n return function(scope, locals, assign, inputs) {\n var value = [];\n for (var i = 0; i < args.length; ++i) {\n value.push(args[i](scope, locals, assign, inputs));\n }\n return context ? {value: value} : value;\n };\n case AST.ObjectExpression:\n args = [];\n forEach(ast.properties, function(property) {\n if (property.computed) {\n args.push({key: self.recurse(property.key),\n computed: true,\n value: self.recurse(property.value)\n });\n } else {\n args.push({key: property.key.type === AST.Identifier ?\n property.key.name :\n ('' + property.key.value),\n computed: false,\n value: self.recurse(property.value)\n });\n }\n });\n return function(scope, locals, assign, inputs) {\n var value = {};\n for (var i = 0; i < args.length; ++i) {\n if (args[i].computed) {\n value[args[i].key(scope, locals, assign, inputs)] = args[i].value(scope, locals, assign, inputs);\n } else {\n value[args[i].key] = args[i].value(scope, locals, assign, inputs);\n }\n }\n return context ? {value: value} : value;\n };\n case AST.ThisExpression:\n return function(scope) {\n return context ? {value: scope} : scope;\n };\n case AST.LocalsExpression:\n return function(scope, locals) {\n return context ? {value: locals} : locals;\n };\n case AST.NGValueParameter:\n return function(scope, locals, assign) {\n return context ? {value: assign} : assign;\n };\n }\n },\n\n 'unary+': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = +arg;\n } else {\n arg = 0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary-': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = argument(scope, locals, assign, inputs);\n if (isDefined(arg)) {\n arg = -arg;\n } else {\n arg = -0;\n }\n return context ? {value: arg} : arg;\n };\n },\n 'unary!': function(argument, context) {\n return function(scope, locals, assign, inputs) {\n var arg = !argument(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary+': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = plusFn(lhs, rhs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary-': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs = right(scope, locals, assign, inputs);\n var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);\n return context ? {value: arg} : arg;\n };\n },\n 'binary*': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary/': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary%': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary===': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary==': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary!=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n // eslint-disable-next-line eqeqeq\n var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary<=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary>=': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary&&': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'binary||': function(left, right, context) {\n return function(scope, locals, assign, inputs) {\n var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n 'ternary?:': function(test, alternate, consequent, context) {\n return function(scope, locals, assign, inputs) {\n var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);\n return context ? {value: arg} : arg;\n };\n },\n value: function(value, context) {\n return function() { return context ? {context: undefined, name: undefined, value: value} : value; };\n },\n identifier: function(name, context, create) {\n return function(scope, locals, assign, inputs) {\n var base = locals && (name in locals) ? locals : scope;\n if (create && create !== 1 && base && base[name] == null) {\n base[name] = {};\n }\n var value = base ? base[name] : undefined;\n if (context) {\n return {context: base, name: name, value: value};\n } else {\n return value;\n }\n };\n },\n computedMember: function(left, right, context, create) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n var rhs;\n var value;\n if (lhs != null) {\n rhs = right(scope, locals, assign, inputs);\n rhs = getStringValue(rhs);\n if (create && create !== 1) {\n if (lhs && !(lhs[rhs])) {\n lhs[rhs] = {};\n }\n }\n value = lhs[rhs];\n }\n if (context) {\n return {context: lhs, name: rhs, value: value};\n } else {\n return value;\n }\n };\n },\n nonComputedMember: function(left, right, context, create) {\n return function(scope, locals, assign, inputs) {\n var lhs = left(scope, locals, assign, inputs);\n if (create && create !== 1) {\n if (lhs && lhs[right] == null) {\n lhs[right] = {};\n }\n }\n var value = lhs != null ? lhs[right] : undefined;\n if (context) {\n return {context: lhs, name: right, value: value};\n } else {\n return value;\n }\n };\n },\n inputs: function(input, watchId) {\n return function(scope, value, locals, inputs) {\n if (inputs) return inputs[watchId];\n return input(scope, value, locals);\n };\n }\n};\n\n/**\n * @constructor\n */\nfunction Parser(lexer, $filter, options) {\n this.ast = new AST(lexer, options);\n this.astCompiler = options.csp ? new ASTInterpreter($filter) :\n new ASTCompiler($filter);\n}\n\nParser.prototype = {\n constructor: Parser,\n\n parse: function(text) {\n var ast = this.getAst(text);\n var fn = this.astCompiler.compile(ast.ast);\n fn.literal = isLiteral(ast.ast);\n fn.constant = isConstant(ast.ast);\n fn.oneTime = ast.oneTime;\n return fn;\n },\n\n getAst: function(exp) {\n var oneTime = false;\n exp = exp.trim();\n\n if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {\n oneTime = true;\n exp = exp.substring(2);\n }\n return {\n ast: this.ast.ast(exp),\n oneTime: oneTime\n };\n }\n};\n\nfunction getValueOf(value) {\n return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);\n}\n\n///////////////////////////////////\n\n/**\n * @ngdoc service\n * @name $parse\n * @kind function\n *\n * @description\n *\n * Converts AngularJS {@link guide/expression expression} into a function.\n *\n * ```js\n * var getter = $parse('user.name');\n * var setter = getter.assign;\n * var context = {user:{name:'AngularJS'}};\n * var locals = {user:{name:'local'}};\n *\n * expect(getter(context)).toEqual('AngularJS');\n * setter(context, 'newValue');\n * expect(context.user.name).toEqual('newValue');\n * expect(getter(context, locals)).toEqual('local');\n * ```\n *\n *\n * @param {string} expression String expression to compile.\n * @returns {function(context, locals)} a function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the strings\n * are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values in\n * `context`.\n *\n * The returned function also has the following properties:\n * * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript\n * literal.\n * * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript\n * constant literals.\n * * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be\n * set to a function to change its value on the given context.\n *\n */\n\n\n/**\n * @ngdoc provider\n * @name $parseProvider\n * @this\n *\n * @description\n * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}\n * service.\n */\nfunction $ParseProvider() {\n var cache = createMap();\n var literals = {\n 'true': true,\n 'false': false,\n 'null': null,\n 'undefined': undefined\n };\n var identStart, identContinue;\n\n /**\n * @ngdoc method\n * @name $parseProvider#addLiteral\n * @description\n *\n * Configure $parse service to add literal values that will be present as literal at expressions.\n *\n * @param {string} literalName Token for the literal value. The literal name value must be a valid literal name.\n * @param {*} literalValue Value for this literal. All literal values must be primitives or `undefined`.\n *\n **/\n this.addLiteral = function(literalName, literalValue) {\n literals[literalName] = literalValue;\n };\n\n /**\n * @ngdoc method\n * @name $parseProvider#setIdentifierFns\n *\n * @description\n *\n * Allows defining the set of characters that are allowed in AngularJS expressions. The function\n * `identifierStart` will get called to know if a given character is a valid character to be the\n * first character for an identifier. The function `identifierContinue` will get called to know if\n * a given character is a valid character to be a follow-up identifier character. The functions\n * `identifierStart` and `identifierContinue` will receive as arguments the single character to be\n * identifier and the character code point. These arguments will be `string` and `numeric`. Keep in\n * mind that the `string` parameter can be two characters long depending on the character\n * representation. It is expected for the function to return `true` or `false`, whether that\n * character is allowed or not.\n *\n * Since this function will be called extensively, keep the implementation of these functions fast,\n * as the performance of these functions have a direct impact on the expressions parsing speed.\n *\n * @param {function=} identifierStart The function that will decide whether the given character is\n * a valid identifier start character.\n * @param {function=} identifierContinue The function that will decide whether the given character is\n * a valid identifier continue character.\n */\n this.setIdentifierFns = function(identifierStart, identifierContinue) {\n identStart = identifierStart;\n identContinue = identifierContinue;\n return this;\n };\n\n this.$get = ['$filter', function($filter) {\n var noUnsafeEval = csp().noUnsafeEval;\n var $parseOptions = {\n csp: noUnsafeEval,\n literals: copy(literals),\n isIdentifierStart: isFunction(identStart) && identStart,\n isIdentifierContinue: isFunction(identContinue) && identContinue\n };\n $parse.$$getAst = $$getAst;\n return $parse;\n\n function $parse(exp, interceptorFn) {\n var parsedExpression, cacheKey;\n\n switch (typeof exp) {\n case 'string':\n exp = exp.trim();\n cacheKey = exp;\n\n parsedExpression = cache[cacheKey];\n\n if (!parsedExpression) {\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n parsedExpression = parser.parse(exp);\n\n cache[cacheKey] = addWatchDelegate(parsedExpression);\n }\n return addInterceptor(parsedExpression, interceptorFn);\n\n case 'function':\n return addInterceptor(exp, interceptorFn);\n\n default:\n return addInterceptor(noop, interceptorFn);\n }\n }\n\n function $$getAst(exp) {\n var lexer = new Lexer($parseOptions);\n var parser = new Parser(lexer, $filter, $parseOptions);\n return parser.getAst(exp).ast;\n }\n\n function expressionInputDirtyCheck(newValue, oldValueOfValue, compareObjectIdentity) {\n\n if (newValue == null || oldValueOfValue == null) { // null/undefined\n return newValue === oldValueOfValue;\n }\n\n if (typeof newValue === 'object') {\n\n // attempt to convert the value to a primitive type\n // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can\n // be cheaply dirty-checked\n newValue = getValueOf(newValue);\n\n if (typeof newValue === 'object' && !compareObjectIdentity) {\n // objects/arrays are not supported - deep-watching them would be too expensive\n return false;\n }\n\n // fall-through to the primitive equality check\n }\n\n //Primitive or NaN\n // eslint-disable-next-line no-self-compare\n return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);\n }\n\n function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var inputExpressions = parsedExpression.inputs;\n var lastResult;\n\n if (inputExpressions.length === 1) {\n var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails\n inputExpressions = inputExpressions[0];\n return scope.$watch(function expressionInputWatch(scope) {\n var newInputValue = inputExpressions(scope);\n if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf, inputExpressions.isPure)) {\n lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);\n oldInputValueOf = newInputValue && getValueOf(newInputValue);\n }\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n var oldInputValueOfValues = [];\n var oldInputValues = [];\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails\n oldInputValues[i] = null;\n }\n\n return scope.$watch(function expressionInputsWatch(scope) {\n var changed = false;\n\n for (var i = 0, ii = inputExpressions.length; i < ii; i++) {\n var newInputValue = inputExpressions[i](scope);\n if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i], inputExpressions[i].isPure))) {\n oldInputValues[i] = newInputValue;\n oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);\n }\n }\n\n if (changed) {\n lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);\n }\n\n return lastResult;\n }, listener, objectEquality, prettyPrintExpression);\n }\n\n function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {\n var isDone = parsedExpression.literal ? isAllDefined : isDefined;\n var unwatch, lastValue;\n\n var exp = parsedExpression.$$intercepted || parsedExpression;\n var post = parsedExpression.$$interceptor || identity;\n\n var useInputs = parsedExpression.inputs && !exp.inputs;\n\n // Propogate the literal/inputs/constant attributes\n // ... but not oneTime since we are handling it\n oneTimeWatch.literal = parsedExpression.literal;\n oneTimeWatch.constant = parsedExpression.constant;\n oneTimeWatch.inputs = parsedExpression.inputs;\n\n // Allow other delegates to run on this wrapped expression\n addWatchDelegate(oneTimeWatch);\n\n unwatch = scope.$watch(oneTimeWatch, listener, objectEquality, prettyPrintExpression);\n\n return unwatch;\n\n function unwatchIfDone() {\n if (isDone(lastValue)) {\n unwatch();\n }\n }\n\n function oneTimeWatch(scope, locals, assign, inputs) {\n lastValue = useInputs && inputs ? inputs[0] : exp(scope, locals, assign, inputs);\n if (isDone(lastValue)) {\n scope.$$postDigest(unwatchIfDone);\n }\n return post(lastValue);\n }\n }\n\n function isAllDefined(value) {\n var allDefined = true;\n forEach(value, function(val) {\n if (!isDefined(val)) allDefined = false;\n });\n return allDefined;\n }\n\n function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {\n var unwatch = scope.$watch(function constantWatch(scope) {\n unwatch();\n return parsedExpression(scope);\n }, listener, objectEquality);\n return unwatch;\n }\n\n function addWatchDelegate(parsedExpression) {\n if (parsedExpression.constant) {\n parsedExpression.$$watchDelegate = constantWatchDelegate;\n } else if (parsedExpression.oneTime) {\n parsedExpression.$$watchDelegate = oneTimeWatchDelegate;\n } else if (parsedExpression.inputs) {\n parsedExpression.$$watchDelegate = inputsWatchDelegate;\n }\n\n return parsedExpression;\n }\n\n function chainInterceptors(first, second) {\n function chainedInterceptor(value) {\n return second(first(value));\n }\n chainedInterceptor.$stateful = first.$stateful || second.$stateful;\n chainedInterceptor.$$pure = first.$$pure && second.$$pure;\n\n return chainedInterceptor;\n }\n\n function addInterceptor(parsedExpression, interceptorFn) {\n if (!interceptorFn) return parsedExpression;\n\n // Extract any existing interceptors out of the parsedExpression\n // to ensure the original parsedExpression is always the $$intercepted\n if (parsedExpression.$$interceptor) {\n interceptorFn = chainInterceptors(parsedExpression.$$interceptor, interceptorFn);\n parsedExpression = parsedExpression.$$intercepted;\n }\n\n var useInputs = false;\n\n var fn = function interceptedExpression(scope, locals, assign, inputs) {\n var value = useInputs && inputs ? inputs[0] : parsedExpression(scope, locals, assign, inputs);\n return interceptorFn(value);\n };\n\n // Maintain references to the interceptor/intercepted\n fn.$$intercepted = parsedExpression;\n fn.$$interceptor = interceptorFn;\n\n // Propogate the literal/oneTime/constant attributes\n fn.literal = parsedExpression.literal;\n fn.oneTime = parsedExpression.oneTime;\n fn.constant = parsedExpression.constant;\n\n // Treat the interceptor like filters.\n // If it is not $stateful then only watch its inputs.\n // If the expression itself has no inputs then use the full expression as an input.\n if (!interceptorFn.$stateful) {\n useInputs = !parsedExpression.inputs;\n fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];\n\n if (!interceptorFn.$$pure) {\n fn.inputs = fn.inputs.map(function(e) {\n // Remove the isPure flag of inputs when it is not absolute because they are now wrapped in a\n // non-pure interceptor function.\n if (e.isPure === PURITY_RELATIVE) {\n return function depurifier(s) { return e(s); };\n }\n return e;\n });\n }\n }\n\n return addWatchDelegate(fn);\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $q\n * @requires $rootScope\n *\n * @description\n * A service that helps you run functions asynchronously, and use their return values (or exceptions)\n * when they are done processing.\n *\n * This is a [Promises/A+](https://promisesaplus.com/)-compliant implementation of promises/deferred\n * objects inspired by [Kris Kowal's Q](https://github.com/kriskowal/q).\n *\n * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred\n * implementations, and the other which resembles ES6 (ES2015) promises to some degree.\n *\n * ## $q constructor\n *\n * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`\n * function as the first argument. This is similar to the native Promise implementation from ES6,\n * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n *\n * While the constructor-style use is supported, not all of the supporting methods from ES6 promises are\n * available yet.\n *\n * It can be used like so:\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * // perform some asynchronous operation, resolve or reject the promise when appropriate.\n * return $q(function(resolve, reject) {\n * setTimeout(function() {\n * if (okToGreet(name)) {\n * resolve('Hello, ' + name + '!');\n * } else {\n * reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n * });\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * });\n * ```\n *\n * Note: progress/notify callbacks are not currently supported via the ES6-style interface.\n *\n * Note: unlike ES6 behavior, an exception thrown in the constructor function will NOT implicitly reject the promise.\n *\n * However, the more traditional CommonJS-style usage is still available, and documented below.\n *\n * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an\n * interface for interacting with an object that represents the result of an action that is\n * performed asynchronously, and may or may not be finished at any given point in time.\n *\n * From the perspective of dealing with error handling, deferred and promise APIs are to\n * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.\n *\n * ```js\n * // for the purpose of this example let's assume that variables `$q` and `okToGreet`\n * // are available in the current lexical scope (they could have been injected or passed in).\n *\n * function asyncGreet(name) {\n * var deferred = $q.defer();\n *\n * setTimeout(function() {\n * deferred.notify('About to greet ' + name + '.');\n *\n * if (okToGreet(name)) {\n * deferred.resolve('Hello, ' + name + '!');\n * } else {\n * deferred.reject('Greeting ' + name + ' is not allowed.');\n * }\n * }, 1000);\n *\n * return deferred.promise;\n * }\n *\n * var promise = asyncGreet('Robin Hood');\n * promise.then(function(greeting) {\n * alert('Success: ' + greeting);\n * }, function(reason) {\n * alert('Failed: ' + reason);\n * }, function(update) {\n * alert('Got notification: ' + update);\n * });\n * ```\n *\n * At first it might not be obvious why this extra complexity is worth the trouble. The payoff\n * comes in the way of guarantees that promise and deferred APIs make, see\n * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.\n *\n * Additionally the promise api allows for composition that is very hard to do with the\n * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.\n * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the\n * section on serial or parallel joining of promises.\n *\n * ## The Deferred API\n *\n * A new instance of deferred is constructed by calling `$q.defer()`.\n *\n * The purpose of the deferred object is to expose the associated Promise instance as well as APIs\n * that can be used for signaling the successful or unsuccessful completion, as well as the status\n * of the task.\n *\n * **Methods**\n *\n * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection\n * constructed via `$q.reject`, the promise will be rejected instead.\n * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to\n * resolving it with a rejection constructed via `$q.reject`.\n * - `notify(value)` - provides updates on the status of the promise's execution. This may be called\n * multiple times before the promise is either resolved or rejected.\n *\n * **Properties**\n *\n * - promise – `{Promise}` – promise object associated with this deferred.\n *\n *\n * ## The Promise API\n *\n * A new promise instance is created when a deferred instance is created and can be retrieved by\n * calling `deferred.promise`.\n *\n * The purpose of the promise object is to allow for interested parties to get access to the result\n * of the deferred task when it completes.\n *\n * **Methods**\n *\n * - `then(successCallback, [errorCallback], [notifyCallback])` – regardless of when the promise was or\n * will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously\n * as soon as the result is available. The callbacks are called with a single argument: the result\n * or rejection reason. Additionally, the notify callback may be called zero or more times to\n * provide a progress indication, before the promise is resolved or rejected.\n *\n * This method *returns a new promise* which is resolved or rejected via the return value of the\n * `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved\n * with the value which is resolved in that promise using\n * [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).\n * It also notifies via the return value of the `notifyCallback` method. The promise cannot be\n * resolved or rejected from the notifyCallback method. The errorCallback and notifyCallback\n * arguments are optional.\n *\n * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`\n *\n * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,\n * but to do so without modifying the final value. This is useful to release resources or do some\n * clean-up that needs to be done whether the promise was rejected or resolved. See the [full\n * specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for\n * more information.\n *\n * ## Chaining promises\n *\n * Because calling the `then` method of a promise returns a new derived promise, it is easily\n * possible to create a chain of promises:\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * return result + 1;\n * });\n *\n * // promiseB will be resolved immediately after promiseA is resolved and its value\n * // will be the result of promiseA incremented by 1\n * ```\n *\n * It is possible to create chains of any length and since a promise can be resolved with another\n * promise (which will defer its resolution further), it is possible to pause/defer resolution of\n * the promises at any point in the chain. This makes it possible to implement powerful APIs like\n * $http's response interceptors.\n *\n *\n * ## Differences between Kris Kowal's Q and $q\n *\n * There are two main differences:\n *\n * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation\n * mechanism in AngularJS, which means faster propagation of resolution or rejection into your\n * models and avoiding unnecessary browser repaints, which would result in flickering UI.\n * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains\n * all the important functionality needed for common async tasks.\n *\n * ## Testing\n *\n * ```js\n * it('should simulate promise', inject(function($q, $rootScope) {\n * var deferred = $q.defer();\n * var promise = deferred.promise;\n * var resolvedValue;\n *\n * promise.then(function(value) { resolvedValue = value; });\n * expect(resolvedValue).toBeUndefined();\n *\n * // Simulate resolving of promise\n * deferred.resolve(123);\n * // Note that the 'then' function does not get called synchronously.\n * // This is because we want the promise API to always be async, whether or not\n * // it got called synchronously or asynchronously.\n * expect(resolvedValue).toBeUndefined();\n *\n * // Propagate promise resolution to 'then' functions using $apply().\n * $rootScope.$apply();\n * expect(resolvedValue).toEqual(123);\n * }));\n * ```\n *\n * @param {function(function, function)} resolver Function which is responsible for resolving or\n * rejecting the newly created promise. The first parameter is a function which resolves the\n * promise, the second parameter is a function which rejects the promise.\n *\n * @returns {Promise} The newly created promise.\n */\n/**\n * @ngdoc provider\n * @name $qProvider\n * @this\n *\n * @description\n */\nfunction $QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {\n return qFactory(function(callback) {\n $rootScope.$evalAsync(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n\n /**\n * @ngdoc method\n * @name $qProvider#errorOnUnhandledRejections\n * @kind function\n *\n * @description\n * Retrieves or overrides whether to generate an error when a rejected promise is not handled.\n * This feature is enabled by default.\n *\n * @param {boolean=} value Whether to generate an error when a rejected promise is not handled.\n * @returns {boolean|ng.$qProvider} Current value when called without a new value or self for\n * chaining otherwise.\n */\n this.errorOnUnhandledRejections = function(value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n}\n\n/** @this */\nfunction $$QProvider() {\n var errorOnUnhandledRejections = true;\n this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {\n return qFactory(function(callback) {\n $browser.defer(callback);\n }, $exceptionHandler, errorOnUnhandledRejections);\n }];\n\n this.errorOnUnhandledRejections = function(value) {\n if (isDefined(value)) {\n errorOnUnhandledRejections = value;\n return this;\n } else {\n return errorOnUnhandledRejections;\n }\n };\n}\n\n/**\n * Constructs a promise manager.\n *\n * @param {function(function)} nextTick Function for executing functions in the next turn.\n * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for\n * debugging purposes.\n * @param {boolean=} errorOnUnhandledRejections Whether an error should be generated on unhandled\n * promises rejections.\n * @returns {object} Promise manager.\n */\nfunction qFactory(nextTick, exceptionHandler, errorOnUnhandledRejections) {\n var $qMinErr = minErr('$q', TypeError);\n var queueSize = 0;\n var checkQueue = [];\n\n /**\n * @ngdoc method\n * @name ng.$q#defer\n * @kind function\n *\n * @description\n * Creates a `Deferred` object which represents a task which will finish in the future.\n *\n * @returns {Deferred} Returns a new instance of deferred.\n */\n function defer() {\n return new Deferred();\n }\n\n function Deferred() {\n var promise = this.promise = new Promise();\n //Non prototype methods necessary to support unbound execution :/\n this.resolve = function(val) { resolvePromise(promise, val); };\n this.reject = function(reason) { rejectPromise(promise, reason); };\n this.notify = function(progress) { notifyPromise(promise, progress); };\n }\n\n\n function Promise() {\n this.$$state = { status: 0 };\n }\n\n extend(Promise.prototype, {\n then: function(onFulfilled, onRejected, progressBack) {\n if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {\n return this;\n }\n var result = new Promise();\n\n this.$$state.pending = this.$$state.pending || [];\n this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);\n if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);\n\n return result;\n },\n\n 'catch': function(callback) {\n return this.then(null, callback);\n },\n\n 'finally': function(callback, progressBack) {\n return this.then(function(value) {\n return handleCallback(value, resolve, callback);\n }, function(error) {\n return handleCallback(error, reject, callback);\n }, progressBack);\n }\n });\n\n function processQueue(state) {\n var fn, promise, pending;\n\n pending = state.pending;\n state.processScheduled = false;\n state.pending = undefined;\n try {\n for (var i = 0, ii = pending.length; i < ii; ++i) {\n markQStateExceptionHandled(state);\n promise = pending[i][0];\n fn = pending[i][state.status];\n try {\n if (isFunction(fn)) {\n resolvePromise(promise, fn(state.value));\n } else if (state.status === 1) {\n resolvePromise(promise, state.value);\n } else {\n rejectPromise(promise, state.value);\n }\n } catch (e) {\n rejectPromise(promise, e);\n // This error is explicitly marked for being passed to the $exceptionHandler\n if (e && e.$$passToExceptionHandler === true) {\n exceptionHandler(e);\n }\n }\n }\n } finally {\n --queueSize;\n if (errorOnUnhandledRejections && queueSize === 0) {\n nextTick(processChecks);\n }\n }\n }\n\n function processChecks() {\n // eslint-disable-next-line no-unmodified-loop-condition\n while (!queueSize && checkQueue.length) {\n var toCheck = checkQueue.shift();\n if (!isStateExceptionHandled(toCheck)) {\n markQStateExceptionHandled(toCheck);\n var errorMessage = 'Possibly unhandled rejection: ' + toDebugString(toCheck.value);\n if (isError(toCheck.value)) {\n exceptionHandler(toCheck.value, errorMessage);\n } else {\n exceptionHandler(errorMessage);\n }\n }\n }\n }\n\n function scheduleProcessQueue(state) {\n if (errorOnUnhandledRejections && !state.pending && state.status === 2 && !isStateExceptionHandled(state)) {\n if (queueSize === 0 && checkQueue.length === 0) {\n nextTick(processChecks);\n }\n checkQueue.push(state);\n }\n if (state.processScheduled || !state.pending) return;\n state.processScheduled = true;\n ++queueSize;\n nextTick(function() { processQueue(state); });\n }\n\n function resolvePromise(promise, val) {\n if (promise.$$state.status) return;\n if (val === promise) {\n $$reject(promise, $qMinErr(\n 'qcycle',\n 'Expected promise to be resolved with value other than itself \\'{0}\\'',\n val));\n } else {\n $$resolve(promise, val);\n }\n\n }\n\n function $$resolve(promise, val) {\n var then;\n var done = false;\n try {\n if (isObject(val) || isFunction(val)) then = val.then;\n if (isFunction(then)) {\n promise.$$state.status = -1;\n then.call(val, doResolve, doReject, doNotify);\n } else {\n promise.$$state.value = val;\n promise.$$state.status = 1;\n scheduleProcessQueue(promise.$$state);\n }\n } catch (e) {\n doReject(e);\n }\n\n function doResolve(val) {\n if (done) return;\n done = true;\n $$resolve(promise, val);\n }\n function doReject(val) {\n if (done) return;\n done = true;\n $$reject(promise, val);\n }\n function doNotify(progress) {\n notifyPromise(promise, progress);\n }\n }\n\n function rejectPromise(promise, reason) {\n if (promise.$$state.status) return;\n $$reject(promise, reason);\n }\n\n function $$reject(promise, reason) {\n promise.$$state.value = reason;\n promise.$$state.status = 2;\n scheduleProcessQueue(promise.$$state);\n }\n\n function notifyPromise(promise, progress) {\n var callbacks = promise.$$state.pending;\n\n if ((promise.$$state.status <= 0) && callbacks && callbacks.length) {\n nextTick(function() {\n var callback, result;\n for (var i = 0, ii = callbacks.length; i < ii; i++) {\n result = callbacks[i][0];\n callback = callbacks[i][3];\n try {\n notifyPromise(result, isFunction(callback) ? callback(progress) : progress);\n } catch (e) {\n exceptionHandler(e);\n }\n }\n });\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#reject\n * @kind function\n *\n * @description\n * Creates a promise that is resolved as rejected with the specified `reason`. This api should be\n * used to forward rejection in a chain of promises. If you are dealing with the last promise in\n * a promise chain, you don't need to worry about it.\n *\n * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of\n * `reject` as the `throw` keyword in JavaScript. This also means that if you \"catch\" an error via\n * a promise error callback and you want to forward the error to the promise derived from the\n * current promise, you have to \"rethrow\" the error by returning a rejection constructed via\n * `reject`.\n *\n * ```js\n * promiseB = promiseA.then(function(result) {\n * // success: do something and resolve promiseB\n * // with the old or a new result\n * return result;\n * }, function(reason) {\n * // error: handle the error if possible and\n * // resolve promiseB with newPromiseOrValue,\n * // otherwise forward the rejection to promiseB\n * if (canHandle(reason)) {\n * // handle the error and recover\n * return newPromiseOrValue;\n * }\n * return $q.reject(reason);\n * });\n * ```\n *\n * @param {*} reason Constant, message, exception or an object representing the rejection reason.\n * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.\n */\n function reject(reason) {\n var result = new Promise();\n rejectPromise(result, reason);\n return result;\n }\n\n function handleCallback(value, resolver, callback) {\n var callbackOutput = null;\n try {\n if (isFunction(callback)) callbackOutput = callback();\n } catch (e) {\n return reject(e);\n }\n if (isPromiseLike(callbackOutput)) {\n return callbackOutput.then(function() {\n return resolver(value);\n }, reject);\n } else {\n return resolver(value);\n }\n }\n\n /**\n * @ngdoc method\n * @name $q#when\n * @kind function\n *\n * @description\n * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.\n * This is useful when you are dealing with an object that might or might not be a promise, or if\n * the promise comes from a source that can't be trusted.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n\n\n function when(value, callback, errback, progressBack) {\n var result = new Promise();\n resolvePromise(result, value);\n return result.then(callback, errback, progressBack);\n }\n\n /**\n * @ngdoc method\n * @name $q#resolve\n * @kind function\n *\n * @description\n * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.\n *\n * @param {*} value Value or a promise\n * @param {Function=} successCallback\n * @param {Function=} errorCallback\n * @param {Function=} progressCallback\n * @returns {Promise} Returns a promise of the passed value or promise\n */\n var resolve = when;\n\n /**\n * @ngdoc method\n * @name $q#all\n * @kind function\n *\n * @description\n * Combines multiple promises into a single promise that is resolved when all of the input\n * promises are resolved.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,\n * each value corresponding to the promise at the same index/key in the `promises` array/hash.\n * If any of the promises is resolved with a rejection, this resulting promise will be rejected\n * with the same rejection value.\n */\n\n function all(promises) {\n var result = new Promise(),\n counter = 0,\n results = isArray(promises) ? [] : {};\n\n forEach(promises, function(promise, key) {\n counter++;\n when(promise).then(function(value) {\n results[key] = value;\n if (!(--counter)) resolvePromise(result, results);\n }, function(reason) {\n rejectPromise(result, reason);\n });\n });\n\n if (counter === 0) {\n resolvePromise(result, results);\n }\n\n return result;\n }\n\n /**\n * @ngdoc method\n * @name $q#race\n * @kind function\n *\n * @description\n * Returns a promise that resolves or rejects as soon as one of those promises\n * resolves or rejects, with the value or reason from that promise.\n *\n * @param {Array.|Object.} promises An array or hash of promises.\n * @returns {Promise} a promise that resolves or rejects as soon as one of the `promises`\n * resolves or rejects, with the value or reason from that promise.\n */\n\n function race(promises) {\n var deferred = defer();\n\n forEach(promises, function(promise) {\n when(promise).then(deferred.resolve, deferred.reject);\n });\n\n return deferred.promise;\n }\n\n function $Q(resolver) {\n if (!isFunction(resolver)) {\n throw $qMinErr('norslvr', 'Expected resolverFn, got \\'{0}\\'', resolver);\n }\n\n var promise = new Promise();\n\n function resolveFn(value) {\n resolvePromise(promise, value);\n }\n\n function rejectFn(reason) {\n rejectPromise(promise, reason);\n }\n\n resolver(resolveFn, rejectFn);\n\n return promise;\n }\n\n // Let's make the instanceof operator work for promises, so that\n // `new $q(fn) instanceof $q` would evaluate to true.\n $Q.prototype = Promise.prototype;\n\n $Q.defer = defer;\n $Q.reject = reject;\n $Q.when = when;\n $Q.resolve = resolve;\n $Q.all = all;\n $Q.race = race;\n\n return $Q;\n}\n\nfunction isStateExceptionHandled(state) {\n return !!state.pur;\n}\nfunction markQStateExceptionHandled(state) {\n state.pur = true;\n}\nfunction markQExceptionHandled(q) {\n // Built-in `$q` promises will always have a `$$state` property. This check is to allow\n // overwriting `$q` with a different promise library (e.g. Bluebird + angular-bluebird-promises).\n // (Currently, this is the only method that might be called with a promise, even if it is not\n // created by the built-in `$q`.)\n if (q.$$state) {\n markQStateExceptionHandled(q.$$state);\n }\n}\n\n/** @this */\nfunction $$RAFProvider() { //rAF\n this.$get = ['$window', '$timeout', function($window, $timeout) {\n var requestAnimationFrame = $window.requestAnimationFrame ||\n $window.webkitRequestAnimationFrame;\n\n var cancelAnimationFrame = $window.cancelAnimationFrame ||\n $window.webkitCancelAnimationFrame ||\n $window.webkitCancelRequestAnimationFrame;\n\n var rafSupported = !!requestAnimationFrame;\n var raf = rafSupported\n ? function(fn) {\n var id = requestAnimationFrame(fn);\n return function() {\n cancelAnimationFrame(id);\n };\n }\n : function(fn) {\n var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666\n return function() {\n $timeout.cancel(timer);\n };\n };\n\n raf.supported = rafSupported;\n\n return raf;\n }];\n}\n\n/**\n * DESIGN NOTES\n *\n * The design decisions behind the scope are heavily favored for speed and memory consumption.\n *\n * The typical use of scope is to watch the expressions, which most of the time return the same\n * value as last time so we optimize the operation.\n *\n * Closures construction is expensive in terms of speed as well as memory:\n * - No closures, instead use prototypical inheritance for API\n * - Internal state needs to be stored on scope directly, which means that private state is\n * exposed as $$____ properties\n *\n * Loop operations are optimized by using while(count--) { ... }\n * - This means that in order to keep the same order of execution as addition we have to add\n * items to the array at the beginning (unshift) instead of at the end (push)\n *\n * Child scopes are created and removed often\n * - Using an array would be slow since inserts in the middle are expensive; so we use linked lists\n *\n * There are fewer watches than observers. This is why you don't want the observer to be implemented\n * in the same way as watch. Watch requires return of the initialization function which is expensive\n * to construct.\n */\n\n\n/**\n * @ngdoc provider\n * @name $rootScopeProvider\n * @description\n *\n * Provider for the $rootScope service.\n */\n\n/**\n * @ngdoc method\n * @name $rootScopeProvider#digestTtl\n * @description\n *\n * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and\n * assuming that the model is unstable.\n *\n * The current default is 10 iterations.\n *\n * In complex applications it's possible that the dependencies between `$watch`s will result in\n * several digest iterations. However if an application needs more than the default 10 digest\n * iterations for its model to stabilize then you should investigate what is causing the model to\n * continuously change during the digest.\n *\n * Increasing the TTL could have performance implications, so you should not change it without\n * proper justification.\n *\n * @param {number} limit The number of digest iterations.\n */\n\n\n/**\n * @ngdoc service\n * @name $rootScope\n * @this\n *\n * @description\n *\n * Every application has a single root {@link ng.$rootScope.Scope scope}.\n * All other scopes are descendant scopes of the root scope. Scopes provide separation\n * between the model and the view, via a mechanism for watching the model for changes.\n * They also provide event emission/broadcast and subscription facility. See the\n * {@link guide/scope developer guide on scopes}.\n */\nfunction $RootScopeProvider() {\n var TTL = 10;\n var $rootScopeMinErr = minErr('$rootScope');\n var lastDirtyWatch = null;\n var applyAsyncId = null;\n\n this.digestTtl = function(value) {\n if (arguments.length) {\n TTL = value;\n }\n return TTL;\n };\n\n function createChildScopeClass(parent) {\n function ChildScope() {\n this.$$watchers = this.$$nextSibling =\n this.$$childHead = this.$$childTail = null;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$id = nextUid();\n this.$$ChildScope = null;\n this.$$suspended = false;\n }\n ChildScope.prototype = parent;\n return ChildScope;\n }\n\n this.$get = ['$exceptionHandler', '$parse', '$browser',\n function($exceptionHandler, $parse, $browser) {\n\n function destroyChildScope($event) {\n $event.currentScope.$$destroyed = true;\n }\n\n function cleanUpScope($scope) {\n\n // Support: IE 9 only\n if (msie === 9) {\n // There is a memory leak in IE9 if all child scopes are not disconnected\n // completely when a scope is destroyed. So this code will recurse up through\n // all this scopes children\n //\n // See issue https://github.com/angular/angular.js/issues/10706\n if ($scope.$$childHead) {\n cleanUpScope($scope.$$childHead);\n }\n if ($scope.$$nextSibling) {\n cleanUpScope($scope.$$nextSibling);\n }\n }\n\n // The code below works around IE9 and V8's memory leaks\n //\n // See:\n // - https://code.google.com/p/v8/issues/detail?id=2073#c26\n // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909\n // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451\n\n $scope.$parent = $scope.$$nextSibling = $scope.$$prevSibling = $scope.$$childHead =\n $scope.$$childTail = $scope.$root = $scope.$$watchers = null;\n }\n\n /**\n * @ngdoc type\n * @name $rootScope.Scope\n *\n * @description\n * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the\n * {@link auto.$injector $injector}. Child scopes are created using the\n * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when\n * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for\n * an in-depth introduction and usage examples.\n *\n *\n * ## Inheritance\n * A scope can inherit from a parent scope, as in this example:\n * ```js\n var parent = $rootScope;\n var child = parent.$new();\n\n parent.salutation = \"Hello\";\n expect(child.salutation).toEqual('Hello');\n\n child.salutation = \"Welcome\";\n expect(child.salutation).toEqual('Welcome');\n expect(parent.salutation).toEqual('Hello');\n * ```\n *\n * When interacting with `Scope` in tests, additional helper methods are available on the\n * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional\n * details.\n *\n *\n * @param {Object.=} providers Map of service factory which need to be\n * provided for the current scope. Defaults to {@link ng}.\n * @param {Object.=} instanceCache Provides pre-instantiated services which should\n * append/override services provided by `providers`. This is handy\n * when unit-testing and having the need to override a default\n * service.\n * @returns {Object} Newly created scope.\n *\n */\n function Scope() {\n this.$id = nextUid();\n this.$$phase = this.$parent = this.$$watchers =\n this.$$nextSibling = this.$$prevSibling =\n this.$$childHead = this.$$childTail = null;\n this.$root = this;\n this.$$destroyed = false;\n this.$$suspended = false;\n this.$$listeners = {};\n this.$$listenerCount = {};\n this.$$watchersCount = 0;\n this.$$isolateBindings = null;\n }\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$id\n *\n * @description\n * Unique scope ID (monotonically increasing) useful for debugging.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$parent\n *\n * @description\n * Reference to the parent scope.\n */\n\n /**\n * @ngdoc property\n * @name $rootScope.Scope#$root\n *\n * @description\n * Reference to the root scope.\n */\n\n Scope.prototype = {\n constructor: Scope,\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$new\n * @kind function\n *\n * @description\n * Creates a new child {@link ng.$rootScope.Scope scope}.\n *\n * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.\n * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.\n *\n * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is\n * desired for the scope and its child scopes to be permanently detached from the parent and\n * thus stop participating in model change detection and listener notification by invoking.\n *\n * @param {boolean} isolate If true, then the scope does not prototypically inherit from the\n * parent scope. The scope is isolated, as it can not see parent scope properties.\n * When creating widgets, it is useful for the widget to not accidentally read parent\n * state.\n *\n * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`\n * of the newly created scope. Defaults to `this` scope if not provided.\n * This is used when creating a transclude scope to correctly place it\n * in the scope hierarchy while maintaining the correct prototypical\n * inheritance.\n *\n * @returns {Object} The newly created child scope.\n *\n */\n $new: function(isolate, parent) {\n var child;\n\n parent = parent || this;\n\n if (isolate) {\n child = new Scope();\n child.$root = this.$root;\n } else {\n // Only create a child scope class if somebody asks for one,\n // but cache it to allow the VM to optimize lookups.\n if (!this.$$ChildScope) {\n this.$$ChildScope = createChildScopeClass(this);\n }\n child = new this.$$ChildScope();\n }\n child.$parent = parent;\n child.$$prevSibling = parent.$$childTail;\n if (parent.$$childHead) {\n parent.$$childTail.$$nextSibling = child;\n parent.$$childTail = child;\n } else {\n parent.$$childHead = parent.$$childTail = child;\n }\n\n // When the new scope is not isolated or we inherit from `this`, and\n // the parent scope is destroyed, the property `$$destroyed` is inherited\n // prototypically. In all other cases, this property needs to be set\n // when the parent scope is destroyed.\n // The listener needs to be added after the parent is set\n if (isolate || parent !== this) child.$on('$destroy', destroyChildScope);\n\n return child;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watch\n * @kind function\n *\n * @description\n * Registers a `listener` callback to be executed whenever the `watchExpression` changes.\n *\n * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest\n * $digest()} and should return the value that will be watched. (`watchExpression` should not change\n * its value when executed multiple times with the same input because it may be executed multiple\n * times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be\n * [idempotent](http://en.wikipedia.org/wiki/Idempotence).)\n * - The `listener` is called only when the value from the current `watchExpression` and the\n * previous call to `watchExpression` are not equal (with the exception of the initial run,\n * see below). Inequality is determined according to reference inequality,\n * [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)\n * via the `!==` Javascript operator, unless `objectEquality == true`\n * (see next point)\n * - When `objectEquality == true`, inequality of the `watchExpression` is determined\n * according to the {@link angular.equals} function. To save the value of the object for\n * later comparison, the {@link angular.copy} function is used. This therefore means that\n * watching complex objects will have adverse memory and performance implications.\n * - This should not be used to watch for changes in objects that are (or contain)\n * [File](https://developer.mozilla.org/docs/Web/API/File) objects due to limitations with {@link angular.copy `angular.copy`}.\n * - The watch `listener` may change the model, which may trigger other `listener`s to fire.\n * This is achieved by rerunning the watchers until no changes are detected. The rerun\n * iteration limit is 10 to prevent an infinite loop deadlock.\n *\n *\n * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,\n * you can register a `watchExpression` function with no `listener`. (Be prepared for\n * multiple calls to your `watchExpression` because it will execute multiple times in a\n * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)\n *\n * After a watcher is registered with the scope, the `listener` fn is called asynchronously\n * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the\n * watcher. In rare cases, this is undesirable because the listener is called when the result\n * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you\n * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the\n * listener was called due to initialization.\n *\n *\n *\n * @example\n * ```js\n // let's assume that scope was dependency injected as the $rootScope\n var scope = $rootScope;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n\n\n\n // Using a function as a watchExpression\n var food;\n scope.foodCounter = 0;\n expect(scope.foodCounter).toEqual(0);\n scope.$watch(\n // This function returns the value being watched. It is called for each turn of the $digest loop\n function() { return food; },\n // This is the change listener, called when the value returned from the above function changes\n function(newValue, oldValue) {\n if ( newValue !== oldValue ) {\n // Only increment the counter if the value changed\n scope.foodCounter = scope.foodCounter + 1;\n }\n }\n );\n // No digest has been run so the counter will be zero\n expect(scope.foodCounter).toEqual(0);\n\n // Run the digest but since food has not changed count will still be zero\n scope.$digest();\n expect(scope.foodCounter).toEqual(0);\n\n // Update food and run digest. Now the counter will increment\n food = 'cheeseburger';\n scope.$digest();\n expect(scope.foodCounter).toEqual(1);\n\n * ```\n *\n *\n *\n * @param {(function()|string)} watchExpression Expression that is evaluated on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers\n * a call to the `listener`.\n *\n * - `string`: Evaluated as {@link guide/expression expression}\n * - `function(scope)`: called with current `scope` as a parameter.\n * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value\n * of `watchExpression` changes.\n *\n * - `newVal` contains the current value of the `watchExpression`\n * - `oldVal` contains the previous value of the `watchExpression`\n * - `scope` refers to the current scope\n * @param {boolean=} [objectEquality=false] Compare for object equality using {@link angular.equals} instead of\n * comparing for reference equality.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {\n var get = $parse(watchExp);\n var fn = isFunction(listener) ? listener : noop;\n\n if (get.$$watchDelegate) {\n return get.$$watchDelegate(this, fn, objectEquality, get, watchExp);\n }\n var scope = this,\n array = scope.$$watchers,\n watcher = {\n fn: fn,\n last: initWatchVal,\n get: get,\n exp: prettyPrintExpression || watchExp,\n eq: !!objectEquality\n };\n\n lastDirtyWatch = null;\n\n if (!array) {\n array = scope.$$watchers = [];\n array.$$digestWatchIndex = -1;\n }\n // we use unshift since we use a while loop in $digest for speed.\n // the while loop reads in reverse order.\n array.unshift(watcher);\n array.$$digestWatchIndex++;\n incrementWatchersCount(this, 1);\n\n return function deregisterWatch() {\n var index = arrayRemove(array, watcher);\n if (index >= 0) {\n incrementWatchersCount(scope, -1);\n if (index < array.$$digestWatchIndex) {\n array.$$digestWatchIndex--;\n }\n }\n lastDirtyWatch = null;\n };\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchGroup\n * @kind function\n *\n * @description\n * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.\n * If any one expression in the collection changes the `listener` is executed.\n *\n * - The items in the `watchExpressions` array are observed via the standard `$watch` operation. Their return\n * values are examined for changes on every call to `$digest`.\n * - The `listener` is called whenever any expression in the `watchExpressions` array changes.\n *\n * @param {Array.} watchExpressions Array of expressions that will be individually\n * watched using {@link ng.$rootScope.Scope#$watch $watch()}\n *\n * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any\n * expression in `watchExpressions` changes\n * The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching\n * those of `watchExpression`\n * The `scope` refers to the current scope.\n * @returns {function()} Returns a de-registration function for all listeners.\n */\n $watchGroup: function(watchExpressions, listener) {\n var oldValues = new Array(watchExpressions.length);\n var newValues = new Array(watchExpressions.length);\n var deregisterFns = [];\n var self = this;\n var changeReactionScheduled = false;\n var firstRun = true;\n\n if (!watchExpressions.length) {\n // No expressions means we call the listener ASAP\n var shouldCall = true;\n self.$evalAsync(function() {\n if (shouldCall) listener(newValues, newValues, self);\n });\n return function deregisterWatchGroup() {\n shouldCall = false;\n };\n }\n\n if (watchExpressions.length === 1) {\n // Special case size of one\n return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {\n newValues[0] = value;\n oldValues[0] = oldValue;\n listener(newValues, (value === oldValue) ? newValues : oldValues, scope);\n });\n }\n\n forEach(watchExpressions, function(expr, i) {\n var unwatchFn = self.$watch(expr, function watchGroupSubAction(value) {\n newValues[i] = value;\n if (!changeReactionScheduled) {\n changeReactionScheduled = true;\n self.$evalAsync(watchGroupAction);\n }\n });\n deregisterFns.push(unwatchFn);\n });\n\n function watchGroupAction() {\n changeReactionScheduled = false;\n\n try {\n if (firstRun) {\n firstRun = false;\n listener(newValues, newValues, self);\n } else {\n listener(newValues, oldValues, self);\n }\n } finally {\n for (var i = 0; i < watchExpressions.length; i++) {\n oldValues[i] = newValues[i];\n }\n }\n }\n\n return function deregisterWatchGroup() {\n while (deregisterFns.length) {\n deregisterFns.shift()();\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$watchCollection\n * @kind function\n *\n * @description\n * Shallow watches the properties of an object and fires whenever any of the properties change\n * (for arrays, this implies watching the array items; for object maps, this implies watching\n * the properties). If a change is detected, the `listener` callback is fired.\n *\n * - The `obj` collection is observed via standard $watch operation and is examined on every\n * call to $digest() to see if any items have been added, removed, or moved.\n * - The `listener` is called whenever anything within the `obj` has changed. Examples include\n * adding, removing, and moving items belonging to an object or array.\n *\n *\n * @example\n * ```js\n $scope.names = ['igor', 'matias', 'misko', 'james'];\n $scope.dataCount = 4;\n\n $scope.$watchCollection('names', function(newNames, oldNames) {\n $scope.dataCount = newNames.length;\n });\n\n expect($scope.dataCount).toEqual(4);\n $scope.$digest();\n\n //still at 4 ... no changes\n expect($scope.dataCount).toEqual(4);\n\n $scope.names.pop();\n $scope.$digest();\n\n //now there's been a change\n expect($scope.dataCount).toEqual(3);\n * ```\n *\n *\n * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The\n * expression value should evaluate to an object or an array which is observed on each\n * {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the\n * collection will trigger a call to the `listener`.\n *\n * @param {function(newCollection, oldCollection, scope)} listener a callback function called\n * when a change is detected.\n * - The `newCollection` object is the newly modified data obtained from the `obj` expression\n * - The `oldCollection` object is a copy of the former collection data.\n * Due to performance considerations, the`oldCollection` value is computed only if the\n * `listener` function declares two or more arguments.\n * - The `scope` argument refers to the current scope.\n *\n * @returns {function()} Returns a de-registration function for this listener. When the\n * de-registration function is executed, the internal watch operation is terminated.\n */\n $watchCollection: function(obj, listener) {\n // Mark the interceptor as\n // ... $$pure when literal since the instance will change when any input changes\n $watchCollectionInterceptor.$$pure = $parse(obj).literal;\n // ... $stateful when non-literal since we must read the state of the collection\n $watchCollectionInterceptor.$stateful = !$watchCollectionInterceptor.$$pure;\n\n var self = this;\n // the current value, updated on each dirty-check run\n var newValue;\n // a shallow copy of the newValue from the last dirty-check run,\n // updated to match newValue during dirty-check run\n var oldValue;\n // a shallow copy of the newValue from when the last change happened\n var veryOldValue;\n // only track veryOldValue if the listener is asking for it\n var trackVeryOldValue = (listener.length > 1);\n var changeDetected = 0;\n var changeDetector = $parse(obj, $watchCollectionInterceptor);\n var internalArray = [];\n var internalObject = {};\n var initRun = true;\n var oldLength = 0;\n\n function $watchCollectionInterceptor(_value) {\n newValue = _value;\n var newLength, key, bothNaN, newItem, oldItem;\n\n // If the new value is undefined, then return undefined as the watch may be a one-time watch\n if (isUndefined(newValue)) return;\n\n if (!isObject(newValue)) { // if primitive\n if (oldValue !== newValue) {\n oldValue = newValue;\n changeDetected++;\n }\n } else if (isArrayLike(newValue)) {\n if (oldValue !== internalArray) {\n // we are transitioning from something which was not an array into array.\n oldValue = internalArray;\n oldLength = oldValue.length = 0;\n changeDetected++;\n }\n\n newLength = newValue.length;\n\n if (oldLength !== newLength) {\n // if lengths do not match we need to trigger change notification\n changeDetected++;\n oldValue.length = oldLength = newLength;\n }\n // copy the items to oldValue and look for changes.\n for (var i = 0; i < newLength; i++) {\n oldItem = oldValue[i];\n newItem = newValue[i];\n\n // eslint-disable-next-line no-self-compare\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[i] = newItem;\n }\n }\n } else {\n if (oldValue !== internalObject) {\n // we are transitioning from something which was not an object into object.\n oldValue = internalObject = {};\n oldLength = 0;\n changeDetected++;\n }\n // copy the items to oldValue and look for changes.\n newLength = 0;\n for (key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n newLength++;\n newItem = newValue[key];\n oldItem = oldValue[key];\n\n if (key in oldValue) {\n // eslint-disable-next-line no-self-compare\n bothNaN = (oldItem !== oldItem) && (newItem !== newItem);\n if (!bothNaN && (oldItem !== newItem)) {\n changeDetected++;\n oldValue[key] = newItem;\n }\n } else {\n oldLength++;\n oldValue[key] = newItem;\n changeDetected++;\n }\n }\n }\n if (oldLength > newLength) {\n // we used to have more keys, need to find them and destroy them.\n changeDetected++;\n for (key in oldValue) {\n if (!hasOwnProperty.call(newValue, key)) {\n oldLength--;\n delete oldValue[key];\n }\n }\n }\n }\n return changeDetected;\n }\n\n function $watchCollectionAction() {\n if (initRun) {\n initRun = false;\n listener(newValue, newValue, self);\n } else {\n listener(newValue, veryOldValue, self);\n }\n\n // make a copy for the next time a collection is changed\n if (trackVeryOldValue) {\n if (!isObject(newValue)) {\n //primitive\n veryOldValue = newValue;\n } else if (isArrayLike(newValue)) {\n veryOldValue = new Array(newValue.length);\n for (var i = 0; i < newValue.length; i++) {\n veryOldValue[i] = newValue[i];\n }\n } else { // if object\n veryOldValue = {};\n for (var key in newValue) {\n if (hasOwnProperty.call(newValue, key)) {\n veryOldValue[key] = newValue[key];\n }\n }\n }\n }\n }\n\n return this.$watch(changeDetector, $watchCollectionAction);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$digest\n * @kind function\n *\n * @description\n * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and\n * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change\n * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}\n * until no more listeners are firing. This means that it is possible to get into an infinite\n * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of\n * iterations exceeds 10.\n *\n * Usually, you don't call `$digest()` directly in\n * {@link ng.directive:ngController controllers} or in\n * {@link ng.$compileProvider#directive directives}.\n * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within\n * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.\n *\n * If you want to be notified whenever `$digest()` is called,\n * you can register a `watchExpression` function with\n * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.\n *\n * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.\n *\n * @example\n * ```js\n var scope = ...;\n scope.name = 'misko';\n scope.counter = 0;\n\n expect(scope.counter).toEqual(0);\n scope.$watch('name', function(newValue, oldValue) {\n scope.counter = scope.counter + 1;\n });\n expect(scope.counter).toEqual(0);\n\n scope.$digest();\n // the listener is always called during the first $digest loop after it was registered\n expect(scope.counter).toEqual(1);\n\n scope.$digest();\n // but now it will not be called unless the value changes\n expect(scope.counter).toEqual(1);\n\n scope.name = 'adam';\n scope.$digest();\n expect(scope.counter).toEqual(2);\n * ```\n *\n */\n $digest: function() {\n var watch, value, last, fn, get,\n watchers,\n dirty, ttl = TTL,\n next, current, target = asyncQueue.length ? $rootScope : this,\n watchLog = [],\n logIdx, asyncTask;\n\n beginPhase('$digest');\n // Check for changes to browser url that happened in sync before the call to $digest\n $browser.$$checkUrlChange();\n\n if (this === $rootScope && applyAsyncId !== null) {\n // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then\n // cancel the scheduled $apply and flush the queue of expressions to be evaluated.\n $browser.defer.cancel(applyAsyncId);\n flushApplyAsync();\n }\n\n lastDirtyWatch = null;\n\n do { // \"while dirty\" loop\n dirty = false;\n current = target;\n\n // It's safe for asyncQueuePosition to be a local variable here because this loop can't\n // be reentered recursively. Calling $digest from a function passed to $evalAsync would\n // lead to a '$digest already in progress' error.\n for (var asyncQueuePosition = 0; asyncQueuePosition < asyncQueue.length; asyncQueuePosition++) {\n try {\n asyncTask = asyncQueue[asyncQueuePosition];\n fn = asyncTask.fn;\n fn(asyncTask.scope, asyncTask.locals);\n } catch (e) {\n $exceptionHandler(e);\n }\n lastDirtyWatch = null;\n }\n asyncQueue.length = 0;\n\n traverseScopesLoop:\n do { // \"traverse the scopes\" loop\n if ((watchers = !current.$$suspended && current.$$watchers)) {\n // process our watches\n watchers.$$digestWatchIndex = watchers.length;\n while (watchers.$$digestWatchIndex--) {\n try {\n watch = watchers[watchers.$$digestWatchIndex];\n // Most common watches are on primitives, in which case we can short\n // circuit it with === operator, only when === fails do we use .equals\n if (watch) {\n get = watch.get;\n if ((value = get(current)) !== (last = watch.last) &&\n !(watch.eq\n ? equals(value, last)\n : (isNumberNaN(value) && isNumberNaN(last)))) {\n dirty = true;\n lastDirtyWatch = watch;\n watch.last = watch.eq ? copy(value, null) : value;\n fn = watch.fn;\n fn(value, ((last === initWatchVal) ? value : last), current);\n if (ttl < 5) {\n logIdx = 4 - ttl;\n if (!watchLog[logIdx]) watchLog[logIdx] = [];\n watchLog[logIdx].push({\n msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,\n newVal: value,\n oldVal: last\n });\n }\n } else if (watch === lastDirtyWatch) {\n // If the most recently dirty watcher is now clean, short circuit since the remaining watchers\n // have already been tested.\n dirty = false;\n break traverseScopesLoop;\n }\n }\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $broadcast\n // (though it differs due to having the extra check for $$suspended and does not\n // check $$listenerCount)\n if (!(next = ((!current.$$suspended && current.$$watchersCount && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n } while ((current = next));\n\n // `break traverseScopesLoop;` takes us to here\n\n if ((dirty || asyncQueue.length) && !(ttl--)) {\n clearPhase();\n throw $rootScopeMinErr('infdig',\n '{0} $digest() iterations reached. Aborting!\\n' +\n 'Watchers fired in the last 5 iterations: {1}',\n TTL, watchLog);\n }\n\n } while (dirty || asyncQueue.length);\n\n clearPhase();\n\n // postDigestQueuePosition isn't local here because this loop can be reentered recursively.\n while (postDigestQueuePosition < postDigestQueue.length) {\n try {\n postDigestQueue[postDigestQueuePosition++]();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n postDigestQueue.length = postDigestQueuePosition = 0;\n\n // Check for changes to browser url that happened during the $digest\n // (for which no event is fired; e.g. via `history.pushState()`)\n $browser.$$checkUrlChange();\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$suspend\n * @kind function\n *\n * @description\n * Suspend watchers of this scope subtree so that they will not be invoked during digest.\n *\n * This can be used to optimize your application when you know that running those watchers\n * is redundant.\n *\n * **Warning**\n *\n * Suspending scopes from the digest cycle can have unwanted and difficult to debug results.\n * Only use this approach if you are confident that you know what you are doing and have\n * ample tests to ensure that bindings get updated as you expect.\n *\n * Some of the things to consider are:\n *\n * * Any external event on a directive/component will not trigger a digest while the hosting\n * scope is suspended - even if the event handler calls `$apply()` or `$rootScope.$digest()`.\n * * Transcluded content exists on a scope that inherits from outside a directive but exists\n * as a child of the directive's containing scope. If the containing scope is suspended the\n * transcluded scope will also be suspended, even if the scope from which the transcluded\n * scope inherits is not suspended.\n * * Multiple directives trying to manage the suspended status of a scope can confuse each other:\n * * A call to `$suspend()` on an already suspended scope is a no-op.\n * * A call to `$resume()` on a non-suspended scope is a no-op.\n * * If two directives suspend a scope, then one of them resumes the scope, the scope will no\n * longer be suspended. This could result in the other directive believing a scope to be\n * suspended when it is not.\n * * If a parent scope is suspended then all its descendants will be also excluded from future\n * digests whether or not they have been suspended themselves. Note that this also applies to\n * isolate child scopes.\n * * Calling `$digest()` directly on a descendant of a suspended scope will still run the watchers\n * for that scope and its descendants. When digesting we only check whether the current scope is\n * locally suspended, rather than checking whether it has a suspended ancestor.\n * * Calling `$resume()` on a scope that has a suspended ancestor will not cause the scope to be\n * included in future digests until all its ancestors have been resumed.\n * * Resolved promises, e.g. from explicit `$q` deferreds and `$http` calls, trigger `$apply()`\n * against the `$rootScope` and so will still trigger a global digest even if the promise was\n * initiated by a component that lives on a suspended scope.\n */\n $suspend: function() {\n this.$$suspended = true;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$isSuspended\n * @kind function\n *\n * @description\n * Call this method to determine if this scope has been explicitly suspended. It will not\n * tell you whether an ancestor has been suspended.\n * To determine if this scope will be excluded from a digest triggered at the $rootScope,\n * for example, you must check all its ancestors:\n *\n * ```\n * function isExcludedFromDigest(scope) {\n * while(scope) {\n * if (scope.$isSuspended()) return true;\n * scope = scope.$parent;\n * }\n * return false;\n * ```\n *\n * Be aware that a scope may not be included in digests if it has a suspended ancestor,\n * even if `$isSuspended()` returns false.\n *\n * @returns true if the current scope has been suspended.\n */\n $isSuspended: function() {\n return this.$$suspended;\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$resume\n * @kind function\n *\n * @description\n * Resume watchers of this scope subtree in case it was suspended.\n *\n * See {@link $rootScope.Scope#$suspend} for information about the dangers of using this approach.\n */\n $resume: function() {\n this.$$suspended = false;\n },\n\n /**\n * @ngdoc event\n * @name $rootScope.Scope#$destroy\n * @eventType broadcast on scope being destroyed\n *\n * @description\n * Broadcasted when a scope and its children are being destroyed.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$destroy\n * @kind function\n *\n * @description\n * Removes the current scope (and all of its children) from the parent scope. Removal implies\n * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer\n * propagate to the current scope and its children. Removal also implies that the current\n * scope is eligible for garbage collection.\n *\n * The `$destroy()` is usually used by directives such as\n * {@link ng.directive:ngRepeat ngRepeat} for managing the\n * unrolling of the loop.\n *\n * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.\n * Application code can register a `$destroy` event handler that will give it a chance to\n * perform any necessary cleanup.\n *\n * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to\n * clean up DOM bindings before an element is removed from the DOM.\n */\n $destroy: function() {\n // We can't destroy a scope that has been already destroyed.\n if (this.$$destroyed) return;\n var parent = this.$parent;\n\n this.$broadcast('$destroy');\n this.$$destroyed = true;\n\n if (this === $rootScope) {\n //Remove handlers attached to window when $rootScope is removed\n $browser.$$applicationDestroyed();\n }\n\n incrementWatchersCount(this, -this.$$watchersCount);\n for (var eventName in this.$$listenerCount) {\n decrementListenerCount(this, this.$$listenerCount[eventName], eventName);\n }\n\n // sever all the references to parent scopes (after this cleanup, the current scope should\n // not be retained by any of our references and should be eligible for garbage collection)\n if (parent && parent.$$childHead === this) parent.$$childHead = this.$$nextSibling;\n if (parent && parent.$$childTail === this) parent.$$childTail = this.$$prevSibling;\n if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;\n if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;\n\n // Disable listeners, watchers and apply/digest methods\n this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;\n this.$on = this.$watch = this.$watchGroup = function() { return noop; };\n this.$$listeners = {};\n\n // Disconnect the next sibling to prevent `cleanUpScope` destroying those too\n this.$$nextSibling = null;\n cleanUpScope(this);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$eval\n * @kind function\n *\n * @description\n * Executes the `expression` on the current scope and returns the result. Any exceptions in\n * the expression are propagated (uncaught). This is useful when evaluating AngularJS\n * expressions.\n *\n * @example\n * ```js\n var scope = ng.$rootScope.Scope();\n scope.a = 1;\n scope.b = 2;\n\n expect(scope.$eval('a+b')).toEqual(3);\n expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);\n * ```\n *\n * @param {(string|function())=} expression An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n * @returns {*} The result of evaluating the expression.\n */\n $eval: function(expr, locals) {\n return $parse(expr)(this, locals);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$evalAsync\n * @kind function\n *\n * @description\n * Executes the expression on the current scope at a later point in time.\n *\n * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only\n * that:\n *\n * - it will execute after the function that scheduled the evaluation (preferably before DOM\n * rendering).\n * - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after\n * `expression` execution.\n *\n * Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle\n * will be scheduled. However, it is encouraged to always call code that changes the model\n * from within an `$apply` call. That includes code evaluated via `$evalAsync`.\n *\n * @param {(string|function())=} expression An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with the current `scope` parameter.\n *\n * @param {(object)=} locals Local variables object, useful for overriding values in scope.\n */\n $evalAsync: function(expr, locals) {\n // if we are outside of an $digest loop and this is the first time we are scheduling async\n // task also schedule async auto-flush\n if (!$rootScope.$$phase && !asyncQueue.length) {\n $browser.defer(function() {\n if (asyncQueue.length) {\n $rootScope.$digest();\n }\n }, null, '$evalAsync');\n }\n\n asyncQueue.push({scope: this, fn: $parse(expr), locals: locals});\n },\n\n $$postDigest: function(fn) {\n postDigestQueue.push(fn);\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$apply\n * @kind function\n *\n * @description\n * `$apply()` is used to execute an expression in AngularJS from outside of the AngularJS\n * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).\n * Because we are calling into the AngularJS framework we need to perform proper scope life\n * cycle of {@link ng.$exceptionHandler exception handling},\n * {@link ng.$rootScope.Scope#$digest executing watches}.\n *\n * **Life cycle: Pseudo-Code of `$apply()`**\n *\n * ```js\n function $apply(expr) {\n try {\n return $eval(expr);\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n $root.$digest();\n }\n }\n * ```\n *\n *\n * Scope's `$apply()` method transitions through the following stages:\n *\n * 1. The {@link guide/expression expression} is executed using the\n * {@link ng.$rootScope.Scope#$eval $eval()} method.\n * 2. Any exceptions from the execution of the expression are forwarded to the\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the\n * expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.\n *\n *\n * @param {(string|function())=} exp An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n *\n * @returns {*} The result of evaluating the expression.\n */\n $apply: function(expr) {\n try {\n beginPhase('$apply');\n try {\n return this.$eval(expr);\n } finally {\n clearPhase();\n }\n } catch (e) {\n $exceptionHandler(e);\n } finally {\n try {\n $rootScope.$digest();\n } catch (e) {\n $exceptionHandler(e);\n // eslint-disable-next-line no-unsafe-finally\n throw e;\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$applyAsync\n * @kind function\n *\n * @description\n * Schedule the invocation of $apply to occur at a later time. The actual time difference\n * varies across browsers, but is typically around ~10 milliseconds.\n *\n * This can be used to queue up multiple expressions which need to be evaluated in the same\n * digest.\n *\n * @param {(string|function())=} exp An AngularJS expression to be executed.\n *\n * - `string`: execute using the rules as defined in {@link guide/expression expression}.\n * - `function(scope)`: execute the function with current `scope` parameter.\n */\n $applyAsync: function(expr) {\n var scope = this;\n if (expr) {\n applyAsyncQueue.push($applyAsyncExpression);\n }\n expr = $parse(expr);\n scheduleApplyAsync();\n\n function $applyAsyncExpression() {\n scope.$eval(expr);\n }\n },\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$on\n * @kind function\n *\n * @description\n * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for\n * discussion of event life cycle.\n *\n * The event listener function format is: `function(event, args...)`. The `event` object\n * passed into the listener has the following attributes:\n *\n * - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or\n * `$broadcast`-ed.\n * - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the\n * event propagates through the scope hierarchy, this property is set to null.\n * - `name` - `{string}`: name of the event.\n * - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel\n * further event propagation (available only for events that were `$emit`-ed).\n * - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag\n * to true.\n * - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.\n *\n * @param {string} name Event name to listen on.\n * @param {function(event, ...args)} listener Function to call when the event is emitted.\n * @returns {function()} Returns a deregistration function for this listener.\n */\n $on: function(name, listener) {\n var namedListeners = this.$$listeners[name];\n if (!namedListeners) {\n this.$$listeners[name] = namedListeners = [];\n }\n namedListeners.push(listener);\n\n var current = this;\n do {\n if (!current.$$listenerCount[name]) {\n current.$$listenerCount[name] = 0;\n }\n current.$$listenerCount[name]++;\n } while ((current = current.$parent));\n\n var self = this;\n return function() {\n var indexOfListener = namedListeners.indexOf(listener);\n if (indexOfListener !== -1) {\n // Use delete in the hope of the browser deallocating the memory for the array entry,\n // while not shifting the array indexes of other listeners.\n // See issue https://github.com/angular/angular.js/issues/16135\n delete namedListeners[indexOfListener];\n decrementListenerCount(self, 1, name);\n }\n };\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$emit\n * @kind function\n *\n * @description\n * Dispatches an event `name` upwards through the scope hierarchy notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$emit` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event traverses upwards toward the root scope and calls all\n * registered listeners along the way. The event will stop propagating if one of the listeners\n * cancels it.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to emit.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).\n */\n $emit: function(name, args) {\n var empty = [],\n namedListeners,\n scope = this,\n stopPropagation = false,\n event = {\n name: name,\n targetScope: scope,\n stopPropagation: function() {stopPropagation = true;},\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n },\n listenerArgs = concat([event], arguments, 1),\n i, length;\n\n do {\n namedListeners = scope.$$listeners[name] || empty;\n event.currentScope = scope;\n for (i = 0, length = namedListeners.length; i < length; i++) {\n\n // if listeners were deregistered, defragment the array\n if (!namedListeners[i]) {\n namedListeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n try {\n //allow all listeners attached to the current scope to run\n namedListeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n //if any listener on the current scope stops propagation, prevent bubbling\n if (stopPropagation) {\n break;\n }\n //traverse upwards\n scope = scope.$parent;\n } while (scope);\n\n event.currentScope = null;\n\n return event;\n },\n\n\n /**\n * @ngdoc method\n * @name $rootScope.Scope#$broadcast\n * @kind function\n *\n * @description\n * Dispatches an event `name` downwards to all child scopes (and their children) notifying the\n * registered {@link ng.$rootScope.Scope#$on} listeners.\n *\n * The event life cycle starts at the scope on which `$broadcast` was called. All\n * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get\n * notified. Afterwards, the event propagates to all direct and indirect scopes of the current\n * scope and calls all registered listeners along the way. The event cannot be canceled.\n *\n * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed\n * onto the {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * @param {string} name Event name to broadcast.\n * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.\n * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}\n */\n $broadcast: function(name, args) {\n var target = this,\n current = target,\n next = target,\n event = {\n name: name,\n targetScope: target,\n preventDefault: function() {\n event.defaultPrevented = true;\n },\n defaultPrevented: false\n };\n\n if (!target.$$listenerCount[name]) return event;\n\n var listenerArgs = concat([event], arguments, 1),\n listeners, i, length;\n\n //down while you can, then up and next sibling or up and next sibling until back at root\n while ((current = next)) {\n event.currentScope = current;\n listeners = current.$$listeners[name] || [];\n for (i = 0, length = listeners.length; i < length; i++) {\n // if listeners were deregistered, defragment the array\n if (!listeners[i]) {\n listeners.splice(i, 1);\n i--;\n length--;\n continue;\n }\n\n try {\n listeners[i].apply(null, listenerArgs);\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n\n // Insanity Warning: scope depth-first traversal\n // yes, this code is a bit crazy, but it works and we have tests to prove it!\n // this piece should be kept in sync with the traversal in $digest\n // (though it differs due to having the extra check for $$listenerCount and\n // does not check $$suspended)\n if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||\n (current !== target && current.$$nextSibling)))) {\n while (current !== target && !(next = current.$$nextSibling)) {\n current = current.$parent;\n }\n }\n }\n\n event.currentScope = null;\n return event;\n }\n };\n\n var $rootScope = new Scope();\n\n //The internal queues. Expose them on the $rootScope for debugging/testing purposes.\n var asyncQueue = $rootScope.$$asyncQueue = [];\n var postDigestQueue = $rootScope.$$postDigestQueue = [];\n var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];\n\n var postDigestQueuePosition = 0;\n\n return $rootScope;\n\n\n function beginPhase(phase) {\n if ($rootScope.$$phase) {\n throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);\n }\n\n $rootScope.$$phase = phase;\n }\n\n function clearPhase() {\n $rootScope.$$phase = null;\n }\n\n function incrementWatchersCount(current, count) {\n do {\n current.$$watchersCount += count;\n } while ((current = current.$parent));\n }\n\n function decrementListenerCount(current, count, name) {\n do {\n current.$$listenerCount[name] -= count;\n\n if (current.$$listenerCount[name] === 0) {\n delete current.$$listenerCount[name];\n }\n } while ((current = current.$parent));\n }\n\n /**\n * function used as an initial value for watchers.\n * because it's unique we can easily tell it apart from other values\n */\n function initWatchVal() {}\n\n function flushApplyAsync() {\n while (applyAsyncQueue.length) {\n try {\n applyAsyncQueue.shift()();\n } catch (e) {\n $exceptionHandler(e);\n }\n }\n applyAsyncId = null;\n }\n\n function scheduleApplyAsync() {\n if (applyAsyncId === null) {\n applyAsyncId = $browser.defer(function() {\n $rootScope.$apply(flushApplyAsync);\n }, null, '$applyAsync');\n }\n }\n }];\n}\n\n/**\n * @ngdoc service\n * @name $rootElement\n *\n * @description\n * The root element of AngularJS application. This is either the element where {@link\n * ng.directive:ngApp ngApp} was declared or the element passed into\n * {@link angular.bootstrap}. The element represents the root element of application. It is also the\n * location where the application's {@link auto.$injector $injector} service gets\n * published, and can be retrieved using `$rootElement.injector()`.\n */\n\n\n// the implementation is in angular.bootstrap\n\n/**\n * @this\n * @description\n * Private service to sanitize uris for links and images. Used by $compile and $sanitize.\n */\nfunction $$SanitizeUriProvider() {\n\n var aHrefSanitizationTrustedUrlList = /^\\s*(https?|s?ftp|mailto|tel|file):/,\n imgSrcSanitizationTrustedUrlList = /^\\s*((https?|ftp|file|blob):|data:image\\/)/;\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during a[href] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via HTML anchor links.\n *\n * Any url due to be assigned to an `a[href]` attribute via interpolation is marked as requiring\n * the $sce.URL security context. When interpolation occurs a call is made to `$sce.trustAsUrl(url)`\n * which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize the potentially malicious URL.\n *\n * If the URL matches the `aHrefSanitizationTrustedUrlList` regular expression, it is returned unchanged.\n *\n * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written\n * to the DOM it is inactive and potentially malicious code will not be executed.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.aHrefSanitizationTrustedUrlList = function(regexp) {\n if (isDefined(regexp)) {\n aHrefSanitizationTrustedUrlList = regexp;\n return this;\n }\n return aHrefSanitizationTrustedUrlList;\n };\n\n\n /**\n * @description\n * Retrieves or overrides the default regular expression that is used for determining trusted safe\n * urls during img[src] sanitization.\n *\n * The sanitization is a security measure aimed at prevent XSS attacks via HTML image src links.\n *\n * Any URL due to be assigned to an `img[src]` attribute via interpolation is marked as requiring\n * the $sce.MEDIA_URL security context. When interpolation occurs a call is made to\n * `$sce.trustAsMediaUrl(url)` which in turn may call `$$sanitizeUri(url, isMedia)` to sanitize\n * the potentially malicious URL.\n *\n * If the URL matches the `imgSrcSanitizationTrustedUrlList` regular expression, it is returned\n * unchanged.\n *\n * If there is no match the URL is returned prefixed with `'unsafe:'` to ensure that when it is written\n * to the DOM it is inactive and potentially malicious code will not be executed.\n *\n * @param {RegExp=} regexp New regexp to trust urls with.\n * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for\n * chaining otherwise.\n */\n this.imgSrcSanitizationTrustedUrlList = function(regexp) {\n if (isDefined(regexp)) {\n imgSrcSanitizationTrustedUrlList = regexp;\n return this;\n }\n return imgSrcSanitizationTrustedUrlList;\n };\n\n this.$get = function() {\n return function sanitizeUri(uri, isMediaUrl) {\n // if (!uri) return uri;\n var regex = isMediaUrl ? imgSrcSanitizationTrustedUrlList : aHrefSanitizationTrustedUrlList;\n var normalizedVal = urlResolve(uri && uri.trim()).href;\n if (normalizedVal !== '' && !normalizedVal.match(regex)) {\n return 'unsafe:' + normalizedVal;\n }\n return uri;\n };\n };\n}\n\n/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n * Any commits to this file should be reviewed with security in mind. *\n * Changes to this file can potentially create security vulnerabilities. *\n * An approval from 2 Core members with history of modifying *\n * this file is required. *\n * *\n * Does the change somehow allow for arbitrary javascript to be executed? *\n * Or allows for someone to change the prototype of built-in objects? *\n * Or gives undesired access to variables likes document or window? *\n * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */\n\n/* exported $SceProvider, $SceDelegateProvider */\n\nvar $sceMinErr = minErr('$sce');\n\nvar SCE_CONTEXTS = {\n // HTML is used when there's HTML rendered (e.g. ng-bind-html, iframe srcdoc binding).\n HTML: 'html',\n\n // Style statements or stylesheets. Currently unused in AngularJS.\n CSS: 'css',\n\n // An URL used in a context where it refers to the source of media, which are not expected to be run\n // as scripts, such as an image, audio, video, etc.\n MEDIA_URL: 'mediaUrl',\n\n // An URL used in a context where it does not refer to a resource that loads code.\n // A value that can be trusted as a URL can also trusted as a MEDIA_URL.\n URL: 'url',\n\n // RESOURCE_URL is a subtype of URL used where the referred-to resource could be interpreted as\n // code. (e.g. ng-include, script src binding, templateUrl)\n // A value that can be trusted as a RESOURCE_URL, can also trusted as a URL and a MEDIA_URL.\n RESOURCE_URL: 'resourceUrl',\n\n // Script. Currently unused in AngularJS.\n JS: 'js'\n};\n\n// Helper functions follow.\n\nvar UNDERSCORE_LOWERCASE_REGEXP = /_([a-z])/g;\n\nfunction snakeToCamel(name) {\n return name\n .replace(UNDERSCORE_LOWERCASE_REGEXP, fnCamelCaseReplace);\n}\n\nfunction adjustMatcher(matcher) {\n if (matcher === 'self') {\n return matcher;\n } else if (isString(matcher)) {\n // Strings match exactly except for 2 wildcards - '*' and '**'.\n // '*' matches any character except those from the set ':/.?&'.\n // '**' matches any character (like .* in a RegExp).\n // More than 2 *'s raises an error as it's ill defined.\n if (matcher.indexOf('***') > -1) {\n throw $sceMinErr('iwcard',\n 'Illegal sequence *** in string matcher. String: {0}', matcher);\n }\n matcher = escapeForRegexp(matcher).\n replace(/\\\\\\*\\\\\\*/g, '.*').\n replace(/\\\\\\*/g, '[^:/.?&;]*');\n return new RegExp('^' + matcher + '$');\n } else if (isRegExp(matcher)) {\n // The only other type of matcher allowed is a Regexp.\n // Match entire URL / disallow partial matches.\n // Flags are reset (i.e. no global, ignoreCase or multiline)\n return new RegExp('^' + matcher.source + '$');\n } else {\n throw $sceMinErr('imatcher',\n 'Matchers may only be \"self\", string patterns or RegExp objects');\n }\n}\n\n\nfunction adjustMatchers(matchers) {\n var adjustedMatchers = [];\n if (isDefined(matchers)) {\n forEach(matchers, function(matcher) {\n adjustedMatchers.push(adjustMatcher(matcher));\n });\n }\n return adjustedMatchers;\n}\n\n\n/**\n * @ngdoc service\n * @name $sceDelegate\n * @kind function\n *\n * @description\n *\n * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict\n * Contextual Escaping (SCE)} services to AngularJS.\n *\n * For an overview of this service and the functionnality it provides in AngularJS, see the main\n * page for {@link ng.$sce SCE}. The current page is targeted for developers who need to alter how\n * SCE works in their application, which shouldn't be needed in most cases.\n *\n *
      \n * AngularJS strongly relies on contextual escaping for the security of bindings: disabling or\n * modifying this might cause cross site scripting (XSS) vulnerabilities. For libraries owners,\n * changes to this service will also influence users, so be extra careful and document your changes.\n *
      \n *\n * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of\n * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS. This is\n * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to\n * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things\n * work because `$sce` delegates to `$sceDelegate` for these operations.\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.\n *\n * The default instance of `$sceDelegate` should work out of the box with little pain. While you\n * can override it completely to change the behavior of `$sce`, the common case would\n * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting\n * your own trusted and banned resource lists for trusting URLs used for loading AngularJS resources\n * such as templates. Refer {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * $sceDelegateProvider.trustedResourceUrlList} and {@link\n * ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList}\n */\n\n/**\n * @ngdoc provider\n * @name $sceDelegateProvider\n * @this\n *\n * @description\n *\n * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate\n * $sceDelegate service}, used as a delegate for {@link ng.$sce Strict Contextual Escaping (SCE)}.\n *\n * The `$sceDelegateProvider` allows one to get/set the `trustedResourceUrlList` and\n * `bannedResourceUrlList` used to ensure that the URLs used for sourcing AngularJS templates and\n * other script-running URLs are safe (all places that use the `$sce.RESOURCE_URL` context). See\n * {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * $sceDelegateProvider.trustedResourceUrlList} and\n * {@link ng.$sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider.bannedResourceUrlList},\n *\n * For the general details about this service in AngularJS, read the main page for {@link ng.$sce\n * Strict Contextual Escaping (SCE)}.\n *\n * **Example**: Consider the following case.
      \n *\n * - your app is hosted at url `http://myapp.example.com/`\n * - but some of your templates are hosted on other domains you control such as\n * `http://srv01.assets.example.com/`, `http://srv02.assets.example.com/`, etc.\n * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.\n *\n * Here is what a secure configuration for this scenario might look like:\n *\n * ```\n * angular.module('myApp', []).config(function($sceDelegateProvider) {\n * $sceDelegateProvider.trustedResourceUrlList([\n * // Allow same origin resource loads.\n * 'self',\n * // Allow loading from our assets domain. Notice the difference between * and **.\n * 'http://srv*.assets.example.com/**'\n * ]);\n *\n * // The banned resource URL list overrides the trusted resource URL list so the open redirect\n * // here is blocked.\n * $sceDelegateProvider.bannedResourceUrlList([\n * 'http://myapp.example.com/clickThru**'\n * ]);\n * });\n * ```\n * Note that an empty trusted resource URL list will block every resource URL from being loaded, and will require\n * you to manually mark each one as trusted with `$sce.trustAsResourceUrl`. However, templates\n * requested by {@link ng.$templateRequest $templateRequest} that are present in\n * {@link ng.$templateCache $templateCache} will not go through this check. If you have a mechanism\n * to populate your templates in that cache at config time, then it is a good idea to remove 'self'\n * from the trusted resource URL lsit. This helps to mitigate the security impact of certain types\n * of issues, like for instance attacker-controlled `ng-includes`.\n */\n\nfunction $SceDelegateProvider() {\n this.SCE_CONTEXTS = SCE_CONTEXTS;\n\n // Resource URLs can also be trusted by policy.\n var trustedResourceUrlList = ['self'],\n bannedResourceUrlList = [];\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#trustedResourceUrlList\n * @kind function\n *\n * @param {Array=} trustedResourceUrlList When provided, replaces the trustedResourceUrlList with\n * the value provided. This must be an array or null. A snapshot of this array is used so\n * further changes to the array are ignored.\n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.\n *\n * @return {Array} The currently set trusted resource URL array.\n *\n * @description\n * Sets/Gets the list trusted of resource URLs.\n *\n * The **default value** when no `trustedResourceUrlList` has been explicitly set is `['self']`\n * allowing only same origin resource requests.\n *\n *
      \n * **Note:** the default `trustedResourceUrlList` of 'self' is not recommended if your app shares\n * its origin with other apps! It is a good idea to limit it to only your application's directory.\n *
      \n */\n this.trustedResourceUrlList = function(value) {\n if (arguments.length) {\n trustedResourceUrlList = adjustMatchers(value);\n }\n return trustedResourceUrlList;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlWhitelist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $sceDelegateProvider#trustedResourceUrlList\n * trustedResourceUrlList} instead.\n */\n Object.defineProperty(this, 'resourceUrlWhitelist', {\n get: function() {\n return this.trustedResourceUrlList;\n },\n set: function(value) {\n this.trustedResourceUrlList = value;\n }\n });\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#bannedResourceUrlList\n * @kind function\n *\n * @param {Array=} bannedResourceUrlList When provided, replaces the `bannedResourceUrlList` with\n * the value provided. This must be an array or null. A snapshot of this array is used so\n * further changes to the array are ignored.

      \n * Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items\n * allowed in this array.

      \n * The typical usage for the `bannedResourceUrlList` is to **block\n * [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as\n * these would otherwise be trusted but actually return content from the redirected domain.\n *

      \n * Finally, **the banned resource URL list overrides the trusted resource URL list** and has\n * the final say.\n *\n * @return {Array} The currently set `bannedResourceUrlList` array.\n *\n * @description\n * Sets/Gets the `bannedResourceUrlList` of trusted resource URLs.\n *\n * The **default value** when no trusted resource URL list has been explicitly set is the empty\n * array (i.e. there is no `bannedResourceUrlList`.)\n */\n this.bannedResourceUrlList = function(value) {\n if (arguments.length) {\n bannedResourceUrlList = adjustMatchers(value);\n }\n return bannedResourceUrlList;\n };\n\n /**\n * @ngdoc method\n * @name $sceDelegateProvider#resourceUrlBlacklist\n * @kind function\n *\n * @deprecated\n * sinceVersion=\"1.8.1\"\n *\n * This method is deprecated. Use {@link $sceDelegateProvider#bannedResourceUrlList\n * bannedResourceUrlList} instead.\n */\n Object.defineProperty(this, 'resourceUrlBlacklist', {\n get: function() {\n return this.bannedResourceUrlList;\n },\n set: function(value) {\n this.bannedResourceUrlList = value;\n }\n });\n\n this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) {\n\n var htmlSanitizer = function htmlSanitizer(html) {\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n };\n\n if ($injector.has('$sanitize')) {\n htmlSanitizer = $injector.get('$sanitize');\n }\n\n\n function matchUrl(matcher, parsedUrl) {\n if (matcher === 'self') {\n return urlIsSameOrigin(parsedUrl) || urlIsSameOriginAsBaseUrl(parsedUrl);\n } else {\n // definitely a regex. See adjustMatchers()\n return !!matcher.exec(parsedUrl.href);\n }\n }\n\n function isResourceUrlAllowedByPolicy(url) {\n var parsedUrl = urlResolve(url.toString());\n var i, n, allowed = false;\n // Ensure that at least one item from the trusted resource URL list allows this url.\n for (i = 0, n = trustedResourceUrlList.length; i < n; i++) {\n if (matchUrl(trustedResourceUrlList[i], parsedUrl)) {\n allowed = true;\n break;\n }\n }\n if (allowed) {\n // Ensure that no item from the banned resource URL list has blocked this url.\n for (i = 0, n = bannedResourceUrlList.length; i < n; i++) {\n if (matchUrl(bannedResourceUrlList[i], parsedUrl)) {\n allowed = false;\n break;\n }\n }\n }\n return allowed;\n }\n\n function generateHolderType(Base) {\n var holderType = function TrustedValueHolderType(trustedValue) {\n this.$$unwrapTrustedValue = function() {\n return trustedValue;\n };\n };\n if (Base) {\n holderType.prototype = new Base();\n }\n holderType.prototype.valueOf = function sceValueOf() {\n return this.$$unwrapTrustedValue();\n };\n holderType.prototype.toString = function sceToString() {\n return this.$$unwrapTrustedValue().toString();\n };\n return holderType;\n }\n\n var trustedValueHolderBase = generateHolderType(),\n byType = {};\n\n byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.MEDIA_URL] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.URL] = generateHolderType(byType[SCE_CONTEXTS.MEDIA_URL]);\n byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);\n byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);\n\n /**\n * @ngdoc method\n * @name $sceDelegate#trustAs\n *\n * @description\n * Returns a trusted representation of the parameter for the specified context. This trusted\n * object will later on be used as-is, without any security check, by bindings or directives\n * that require this security context.\n * For instance, marking a string as trusted for the `$sce.HTML` context will entirely bypass\n * the potential `$sanitize` call in corresponding `$sce.HTML` bindings or directives, such as\n * `ng-bind-html`. Note that in most cases you won't need to call this function: if you have the\n * sanitizer loaded, passing the value itself will render all the HTML that does not pose a\n * security risk.\n *\n * See {@link ng.$sceDelegate#getTrusted getTrusted} for the function that will consume those\n * trusted values, and {@link ng.$sce $sce} for general documentation about strict contextual\n * escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that should be considered trusted.\n * @return {*} A trusted representation of value, that can be used in the given context.\n */\n function trustAs(type, trustedValue) {\n var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n if (!Constructor) {\n throw $sceMinErr('icontext',\n 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',\n type, trustedValue);\n }\n if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {\n return trustedValue;\n }\n // All the current contexts in SCE_CONTEXTS happen to be strings. In order to avoid trusting\n // mutable objects, we ensure here that the value passed in is actually a string.\n if (typeof trustedValue !== 'string') {\n throw $sceMinErr('itype',\n 'Attempted to trust a non-string value in a content requiring a string: Context: {0}',\n type);\n }\n return new Constructor(trustedValue);\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#valueOf\n *\n * @description\n * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.\n *\n * If the passed parameter is not a value that had been returned by {@link\n * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, it must be returned as-is.\n *\n * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}\n * call or anything else.\n * @return {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} if `value` is the result of such a call. Otherwise, returns\n * `value` unchanged.\n */\n function valueOf(maybeTrusted) {\n if (maybeTrusted instanceof trustedValueHolderBase) {\n return maybeTrusted.$$unwrapTrustedValue();\n } else {\n return maybeTrusted;\n }\n }\n\n /**\n * @ngdoc method\n * @name $sceDelegate#getTrusted\n *\n * @description\n * Given an object and a security context in which to assign it, returns a value that's safe to\n * use in this context, which was represented by the parameter. To do so, this function either\n * unwraps the safe type it has been given (for instance, a {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} result), or it might try to sanitize the value given, depending on\n * the context and sanitizer availablility.\n *\n * The contexts that can be sanitized are $sce.MEDIA_URL, $sce.URL and $sce.HTML. The first two are available\n * by default, and the third one relies on the `$sanitize` service (which may be loaded through\n * the `ngSanitize` module). Furthermore, for $sce.RESOURCE_URL context, a plain string may be\n * accepted if the resource url policy defined by {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * `$sceDelegateProvider.trustedResourceUrlList`} and {@link ng.$sceDelegateProvider#bannedResourceUrlList\n * `$sceDelegateProvider.bannedResourceUrlList`} accepts that resource.\n *\n * This function will throw if the safe type isn't appropriate for this context, or if the\n * value given cannot be accepted in the context (which might be caused by sanitization not\n * being available, or the value not being recognized as safe).\n *\n *

      \n * Disabling auto-escaping is extremely dangerous, it usually creates a Cross Site Scripting\n * (XSS) vulnerability in your application.\n *
      \n *\n * @param {string} type The context in which this value is to be used (such as `$sce.HTML`).\n * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs\n * `$sceDelegate.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n function getTrusted(type, maybeTrusted) {\n if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {\n return maybeTrusted;\n }\n var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);\n // If maybeTrusted is a trusted class instance or subclass instance, then unwrap and return\n // as-is.\n if (constructor && maybeTrusted instanceof constructor) {\n return maybeTrusted.$$unwrapTrustedValue();\n }\n\n // If maybeTrusted is a trusted class instance but not of the correct trusted type\n // then unwrap it and allow it to pass through to the rest of the checks\n if (isFunction(maybeTrusted.$$unwrapTrustedValue)) {\n maybeTrusted = maybeTrusted.$$unwrapTrustedValue();\n }\n\n // If we get here, then we will either sanitize the value or throw an exception.\n if (type === SCE_CONTEXTS.MEDIA_URL || type === SCE_CONTEXTS.URL) {\n // we attempt to sanitize non-resource URLs\n return $$sanitizeUri(maybeTrusted.toString(), type === SCE_CONTEXTS.MEDIA_URL);\n } else if (type === SCE_CONTEXTS.RESOURCE_URL) {\n if (isResourceUrlAllowedByPolicy(maybeTrusted)) {\n return maybeTrusted;\n } else {\n throw $sceMinErr('insecurl',\n 'Blocked loading resource from url not allowed by $sceDelegate policy. URL: {0}',\n maybeTrusted.toString());\n }\n } else if (type === SCE_CONTEXTS.HTML) {\n // htmlSanitizer throws its own error when no sanitizer is available.\n return htmlSanitizer(maybeTrusted);\n }\n // Default error when the $sce service has no way to make the input safe.\n throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');\n }\n\n return { trustAs: trustAs,\n getTrusted: getTrusted,\n valueOf: valueOf };\n }];\n}\n\n\n/**\n * @ngdoc provider\n * @name $sceProvider\n * @this\n *\n * @description\n *\n * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.\n * - enable/disable Strict Contextual Escaping (SCE) in a module\n * - override the default implementation with a custom delegate\n *\n * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.\n */\n\n/**\n * @ngdoc service\n * @name $sce\n * @kind function\n *\n * @description\n *\n * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.\n *\n * ## Strict Contextual Escaping\n *\n * Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render\n * trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and\n * (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier.\n *\n * ### Overview\n *\n * To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in\n * HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically\n * run security checks on them (sanitizations, trusted URL resource, depending on context), or throw\n * when it cannot guarantee the security of the result. That behavior depends strongly on contexts:\n * HTML can be sanitized, but template URLs cannot, for instance.\n *\n * To illustrate this, consider the `ng-bind-html` directive. It renders its value directly as HTML:\n * we call that the *context*. When given an untrusted input, AngularJS will attempt to sanitize it\n * before rendering if a sanitizer is available, and throw otherwise. To bypass sanitization and\n * render the input as-is, you will need to mark it as trusted for that context before attempting\n * to bind it.\n *\n * As of version 1.2, AngularJS ships with SCE enabled by default.\n *\n * ### In practice\n *\n * Here's an example of a binding in a privileged context:\n *\n * ```\n * \n *
      \n * ```\n *\n * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user. With SCE\n * disabled, this application allows the user to render arbitrary HTML into the DIV, which would\n * be an XSS security bug. In a more realistic example, one may be rendering user comments, blog\n * articles, etc. via bindings. (HTML is just one example of a context where rendering user\n * controlled input creates security vulnerabilities.)\n *\n * For the case of HTML, you might use a library, either on the client side, or on the server side,\n * to sanitize unsafe HTML before binding to the value and rendering it in the document.\n *\n * How would you ensure that every place that used these types of bindings was bound to a value that\n * was sanitized by your library (or returned as safe for rendering by your server?) How can you\n * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some\n * properties/fields and forgot to update the binding to the sanitized value?\n *\n * To be secure by default, AngularJS makes sure bindings go through that sanitization, or\n * any similar validation process, unless there's a good reason to trust the given value in this\n * context. That trust is formalized with a function call. This means that as a developer, you\n * can assume all untrusted bindings are safe. Then, to audit your code for binding security issues,\n * you just need to ensure the values you mark as trusted indeed are safe - because they were\n * received from your server, sanitized by your library, etc. You can organize your codebase to\n * help with this - perhaps allowing only the files in a specific directory to do this.\n * Ensuring that the internal API exposed by that code doesn't markup arbitrary values as safe then\n * becomes a more manageable task.\n *\n * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}\n * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to\n * build the trusted versions of your values.\n *\n * ### How does it work?\n *\n * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted\n * $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as\n * a way to enforce the required security context in your data sink. Directives use {@link\n * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs\n * the {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals. Also,\n * when binding without directives, AngularJS will understand the context of your bindings\n * automatically.\n *\n * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link\n * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}. Here's the actual code (slightly\n * simplified):\n *\n * ```\n * var ngBindHtmlDirective = ['$sce', function($sce) {\n * return function(scope, element, attr) {\n * scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {\n * element.html(value || '');\n * });\n * };\n * }];\n * ```\n *\n * ### Impact on loading templates\n *\n * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as\n * `templateUrl`'s specified by {@link guide/directive directives}.\n *\n * By default, AngularJS only loads templates from the same domain and protocol as the application\n * document. This is done by calling {@link ng.$sce#getTrustedResourceUrl\n * $sce.getTrustedResourceUrl} on the template URL. To load templates from other domains and/or\n * protocols, you may either add them to the {@link ng.$sceDelegateProvider#trustedResourceUrlList\n * trustedResourceUrlList} or {@link ng.$sce#trustAsResourceUrl wrap them} into trusted values.\n *\n * *Please note*:\n * The browser's\n * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)\n * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)\n * policy apply in addition to this and may further restrict whether the template is successfully\n * loaded. This means that without the right CORS policy, loading templates from a different domain\n * won't work on all browsers. Also, loading templates from `file://` URL does not work on some\n * browsers.\n *\n * ### This feels like too much overhead\n *\n * It's important to remember that SCE only applies to interpolation expressions.\n *\n * If your expressions are constant literals, they're automatically trusted and you don't need to\n * call `$sce.trustAs` on them (e.g.\n * `
      implicitly trusted'\">
      `) just works (remember to include the\n * `ngSanitize` module). The `$sceDelegate` will also use the `$sanitize` service if it is available\n * when binding untrusted values to `$sce.HTML` context.\n * AngularJS provides an implementation in `angular-sanitize.js`, and if you\n * wish to use it, you will also need to depend on the {@link ngSanitize `ngSanitize`} module in\n * your application.\n *\n * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load\n * templates in `ng-include` from your application's domain without having to even know about SCE.\n * It blocks loading templates from other domains or loading templates over http from an https\n * served document. You can change these by setting your own custom {@link\n * ng.$sceDelegateProvider#trustedResourceUrlList trusted resource URL list} and {@link\n * ng.$sceDelegateProvider#bannedResourceUrlList banned resource URL list} for matching such URLs.\n *\n * This significantly reduces the overhead. It is far easier to pay the small overhead and have an\n * application that's secure and can be audited to verify that with much more ease than bolting\n * security onto an application later.\n *\n * \n * ### What trusted context types are supported?\n *\n * | Context | Notes |\n * |---------------------|----------------|\n * | `$sce.HTML` | For HTML that's safe to source into the application. The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |\n * | `$sce.CSS` | For CSS that's safe to source into the application. Currently unused. Feel free to use it in your own directives. |\n * | `$sce.MEDIA_URL` | For URLs that are safe to render as media. Is automatically converted from string by sanitizing when needed. |\n * | `$sce.URL` | For URLs that are safe to follow as links. Is automatically converted from string by sanitizing when needed. Note that `$sce.URL` makes a stronger statement about the URL than `$sce.MEDIA_URL` does and therefore contexts requiring values trusted for `$sce.URL` can be used anywhere that values trusted for `$sce.MEDIA_URL` are required.|\n * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application. Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)

      Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` or `$sce.MEDIA_URL` do and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` or `$sce.MEDIA_URL` are required.

      The {@link $sceDelegateProvider#trustedResourceUrlList $sceDelegateProvider#trustedResourceUrlList()} and {@link $sceDelegateProvider#bannedResourceUrlList $sceDelegateProvider#bannedResourceUrlList()} can be used to restrict trusted origins for `RESOURCE_URL` |\n * | `$sce.JS` | For JavaScript that is safe to execute in your application's context. Currently unused. Feel free to use it in your own directives. |\n *\n *\n *
      \n * Be aware that, before AngularJS 1.7.0, `a[href]` and `img[src]` used to sanitize their\n * interpolated values directly rather than rely upon {@link ng.$sce#getTrusted `$sce.getTrusted`}.\n *\n * **As of 1.7.0, this is no longer the case.**\n *\n * Now such interpolations are marked as requiring `$sce.URL` (for `a[href]`) or `$sce.MEDIA_URL`\n * (for `img[src]`), so that the sanitization happens (via `$sce.getTrusted...`) when the `$interpolate`\n * service evaluates the expressions.\n *
      \n *\n * There are no CSS or JS context bindings in AngularJS currently, so their corresponding `$sce.trustAs`\n * functions aren't useful yet. This might evolve.\n *\n * ### Format of items in {@link ng.$sceDelegateProvider#trustedResourceUrlList trustedResourceUrlList}/{@link ng.$sceDelegateProvider#bannedResourceUrlList bannedResourceUrlList} \n *\n * Each element in these arrays must be one of the following:\n *\n * - **'self'**\n * - The special **string**, `'self'`, can be used to match against all URLs of the **same\n * domain** as the application document using the **same protocol**.\n * - **String** (except the special value `'self'`)\n * - The string is matched against the full *normalized / absolute URL* of the resource\n * being tested (substring matches are not good enough.)\n * - There are exactly **two wildcard sequences** - `*` and `**`. All other characters\n * match themselves.\n * - `*`: matches zero or more occurrences of any character other than one of the following 6\n * characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'. It's a useful wildcard for use\n * for matching resource URL lists.\n * - `**`: matches zero or more occurrences of *any* character. As such, it's not\n * appropriate for use in a scheme, domain, etc. as it would match too much. (e.g.\n * http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might\n * not have been the intention.) Its usage at the very end of the path is ok. (e.g.\n * http://foo.example.com/templates/**).\n * - **RegExp** (*see caveat below*)\n * - *Caveat*: While regular expressions are powerful and offer great flexibility, their syntax\n * (and all the inevitable escaping) makes them *harder to maintain*. It's easy to\n * accidentally introduce a bug when one updates a complex expression (imho, all regexes should\n * have good test coverage). For instance, the use of `.` in the regex is correct only in a\n * small number of cases. A `.` character in the regex used when matching the scheme or a\n * subdomain could be matched against a `:` or literal `.` that was likely not intended. It\n * is highly recommended to use the string patterns and only fall back to regular expressions\n * as a last resort.\n * - The regular expression must be an instance of RegExp (i.e. not a string.) It is\n * matched against the **entire** *normalized / absolute URL* of the resource being tested\n * (even when the RegExp did not have the `^` and `$` codes.) In addition, any flags\n * present on the RegExp (such as multiline, global, ignoreCase) are ignored.\n * - If you are generating your JavaScript from some other templating engine (not\n * recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),\n * remember to escape your regular expression (and be aware that you might need more than\n * one level of escaping depending on your templating engine and the way you interpolated\n * the value.) Do make use of your platform's escaping mechanism as it might be good\n * enough before coding your own. E.g. Ruby has\n * [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)\n * and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).\n * Javascript lacks a similar built in function for escaping. Take a look at Google\n * Closure library's [goog.string.regExpEscape(s)](\n * http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).\n *\n * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.\n *\n * ### Show me an example using SCE.\n *\n * \n * \n *
      \n *

      \n * User comments
      \n * By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when\n * $sanitize is available. If $sanitize isn't available, this results in an error instead of an\n * exploit.\n *
      \n *
      \n * {{userComment.name}}:\n * \n *
      \n *
      \n *
      \n *
      \n *
      \n *\n * \n * angular.module('mySceApp', ['ngSanitize'])\n * .controller('AppController', ['$http', '$templateCache', '$sce',\n * function AppController($http, $templateCache, $sce) {\n * var self = this;\n * $http.get('test_data.json', {cache: $templateCache}).then(function(response) {\n * self.userComments = response.data;\n * });\n * self.explicitlyTrustedHtml = $sce.trustAsHtml(\n * 'Hover over this text.');\n * }]);\n * \n *\n * \n * [\n * { \"name\": \"Alice\",\n * \"htmlComment\":\n * \"Is anyone reading this?\"\n * },\n * { \"name\": \"Bob\",\n * \"htmlComment\": \"Yes! Am I the only other one?\"\n * }\n * ]\n * \n *\n * \n * describe('SCE doc demo', function() {\n * it('should sanitize untrusted values', function() {\n * expect(element.all(by.css('.htmlComment')).first().getAttribute('innerHTML'))\n * .toBe('Is anyone reading this?');\n * });\n *\n * it('should NOT sanitize explicitly trusted values', function() {\n * expect(element(by.id('explicitlyTrustedHtml')).getAttribute('innerHTML')).toBe(\n * 'Hover over this text.');\n * });\n * });\n * \n *
      \n *\n *\n *\n * ## Can I disable SCE completely?\n *\n * Yes, you can. However, this is strongly discouraged. SCE gives you a lot of security benefits\n * for little coding overhead. It will be much harder to take an SCE disabled application and\n * either secure it on your own or enable SCE at a later stage. It might make sense to disable SCE\n * for cases where you have a lot of existing code that was written before SCE was introduced and\n * you're migrating them a module at a time. Also do note that this is an app-wide setting, so if\n * you are writing a library, you will cause security bugs applications using it.\n *\n * That said, here's how you can completely disable SCE:\n *\n * ```\n * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {\n * // Completely disable SCE. For demonstration purposes only!\n * // Do not use in new projects or libraries.\n * $sceProvider.enabled(false);\n * });\n * ```\n *\n */\n\nfunction $SceProvider() {\n var enabled = true;\n\n /**\n * @ngdoc method\n * @name $sceProvider#enabled\n * @kind function\n *\n * @param {boolean=} value If provided, then enables/disables SCE application-wide.\n * @return {boolean} True if SCE is enabled, false otherwise.\n *\n * @description\n * Enables/disables SCE and returns the current value.\n */\n this.enabled = function(value) {\n if (arguments.length) {\n enabled = !!value;\n }\n return enabled;\n };\n\n\n /* Design notes on the default implementation for SCE.\n *\n * The API contract for the SCE delegate\n * -------------------------------------\n * The SCE delegate object must provide the following 3 methods:\n *\n * - trustAs(contextEnum, value)\n * This method is used to tell the SCE service that the provided value is OK to use in the\n * contexts specified by contextEnum. It must return an object that will be accepted by\n * getTrusted() for a compatible contextEnum and return this value.\n *\n * - valueOf(value)\n * For values that were not produced by trustAs(), return them as is. For values that were\n * produced by trustAs(), return the corresponding input value to trustAs. Basically, if\n * trustAs is wrapping the given values into some type, this operation unwraps it when given\n * such a value.\n *\n * - getTrusted(contextEnum, value)\n * This function should return the value that is safe to use in the context specified by\n * contextEnum or throw and exception otherwise.\n *\n * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be\n * opaque or wrapped in some holder object. That happens to be an implementation detail. For\n * instance, an implementation could maintain a registry of all trusted objects by context. In\n * such a case, trustAs() would return the same object that was passed in. getTrusted() would\n * return the same object passed in if it was found in the registry under a compatible context or\n * throw an exception otherwise. An implementation might only wrap values some of the time based\n * on some criteria. getTrusted() might return a value and not throw an exception for special\n * constants or objects even if not wrapped. All such implementations fulfill this contract.\n *\n *\n * A note on the inheritance model for SCE contexts\n * ------------------------------------------------\n * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types. This\n * is purely an implementation details.\n *\n * The contract is simply this:\n *\n * getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)\n * will also succeed.\n *\n * Inheritance happens to capture this in a natural way. In some future, we may not use\n * inheritance anymore. That is OK because no code outside of sce.js and sceSpecs.js would need to\n * be aware of this detail.\n */\n\n this.$get = ['$parse', '$sceDelegate', function(\n $parse, $sceDelegate) {\n // Support: IE 9-11 only\n // Prereq: Ensure that we're not running in IE<11 quirks mode. In that mode, IE < 11 allow\n // the \"expression(javascript expression)\" syntax which is insecure.\n if (enabled && msie < 8) {\n throw $sceMinErr('iequirks',\n 'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +\n 'mode. You can fix this by adding the text to the top of your HTML ' +\n 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');\n }\n\n var sce = shallowCopy(SCE_CONTEXTS);\n\n /**\n * @ngdoc method\n * @name $sce#isEnabled\n * @kind function\n *\n * @return {Boolean} True if SCE is enabled, false otherwise. If you want to set the value, you\n * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.\n *\n * @description\n * Returns a boolean indicating if SCE is enabled.\n */\n sce.isEnabled = function() {\n return enabled;\n };\n sce.trustAs = $sceDelegate.trustAs;\n sce.getTrusted = $sceDelegate.getTrusted;\n sce.valueOf = $sceDelegate.valueOf;\n\n if (!enabled) {\n sce.trustAs = sce.getTrusted = function(type, value) { return value; };\n sce.valueOf = identity;\n }\n\n /**\n * @ngdoc method\n * @name $sce#parseAs\n *\n * @description\n * Converts AngularJS {@link guide/expression expression} into a function. This is like {@link\n * ng.$parse $parse} and is identical when the expression is a literal constant. Otherwise, it\n * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,\n * *result*)}\n *\n * @param {string} type The SCE context in which this result will be used.\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n sce.parseAs = function sceParseAs(type, expr) {\n var parsed = $parse(expr);\n if (parsed.literal && parsed.constant) {\n return parsed;\n } else {\n return $parse(expr, function(value) {\n return sce.getTrusted(type, value);\n });\n }\n };\n\n /**\n * @ngdoc method\n * @name $sce#trustAs\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}. As such, returns a\n * wrapped object that represents your value, and the trust you have in its safety for the given\n * context. AngularJS can then use that value as-is in bindings of the specified secure context.\n * This is used in bindings for `ng-bind-html`, `ng-include`, and most `src` attribute\n * interpolations. See {@link ng.$sce $sce} for strict contextual escaping.\n *\n * @param {string} type The context in which this value is safe for use, e.g. `$sce.URL`,\n * `$sce.RESOURCE_URL`, `$sce.HTML`, `$sce.JS` or `$sce.CSS`.\n *\n * @param {*} value The value that that should be considered trusted.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in the context you specified.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsHtml\n *\n * @description\n * Shorthand method. `$sce.trustAsHtml(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.HTML` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.HTML` context (like `ng-bind-html`).\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsCss\n *\n * @description\n * Shorthand method. `$sce.trustAsCss(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.CSS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.CSS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant\n * of your `value` in `$sce.CSS` context. This context is currently unused, so there are\n * almost no reasons to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.URL` context. That context is currently unused, so there are almost no reasons\n * to use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.trustAsResourceUrl(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.RESOURCE_URL` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.RESOURCE_URL` context (template URLs in `ng-include`, most `src` attribute\n * bindings, ...)\n */\n\n /**\n * @ngdoc method\n * @name $sce#trustAsJs\n *\n * @description\n * Shorthand method. `$sce.trustAsJs(value)` →\n * {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}\n *\n * @param {*} value The value to mark as trusted for `$sce.JS` context.\n * @return {*} A wrapped version of value that can be used as a trusted variant of your `value`\n * in `$sce.JS` context. That context is currently unused, so there are almost no reasons to\n * use this function so far.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrusted\n *\n * @description\n * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}. As such,\n * takes any input, and either returns a value that's safe to use in the specified context,\n * or throws an exception. This function is aware of trusted values created by the `trustAs`\n * function and its shorthands, and when contexts are appropriate, returns the unwrapped value\n * as-is. Finally, this function can also throw when there is no way to turn `maybeTrusted` in a\n * safe value (e.g., no sanitization is available or possible.)\n *\n * @param {string} type The context in which this value is to be used.\n * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs\n * `$sce.trustAs`} call, or anything else (which will not be considered trusted.)\n * @return {*} A version of the value that's safe to use in the given context, or throws an\n * exception if this is impossible.\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedHtml\n *\n * @description\n * Shorthand method. `$sce.getTrustedHtml(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.HTML, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedCss\n *\n * @description\n * Shorthand method. `$sce.getTrustedCss(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.CSS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedResourceUrl\n *\n * @description\n * Shorthand method. `$sce.getTrustedResourceUrl(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}\n *\n * @param {*} value The value to pass to `$sceDelegate.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#getTrustedJs\n *\n * @description\n * Shorthand method. `$sce.getTrustedJs(value)` →\n * {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}\n *\n * @param {*} value The value to pass to `$sce.getTrusted`.\n * @return {*} The return value of `$sce.getTrusted($sce.JS, value)`\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsHtml\n *\n * @description\n * Shorthand method. `$sce.parseAsHtml(expression string)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsCss\n *\n * @description\n * Shorthand method. `$sce.parseAsCss(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsResourceUrl\n *\n * @description\n * Shorthand method. `$sce.parseAsResourceUrl(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n /**\n * @ngdoc method\n * @name $sce#parseAsJs\n *\n * @description\n * Shorthand method. `$sce.parseAsJs(value)` →\n * {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}\n *\n * @param {string} expression String expression to compile.\n * @return {function(context, locals)} A function which represents the compiled expression:\n *\n * * `context` – `{object}` – an object against which any expressions embedded in the\n * strings are evaluated against (typically a scope object).\n * * `locals` – `{object=}` – local variables context object, useful for overriding values\n * in `context`.\n */\n\n // Shorthand delegations.\n var parse = sce.parseAs,\n getTrusted = sce.getTrusted,\n trustAs = sce.trustAs;\n\n forEach(SCE_CONTEXTS, function(enumValue, name) {\n var lName = lowercase(name);\n sce[snakeToCamel('parse_as_' + lName)] = function(expr) {\n return parse(enumValue, expr);\n };\n sce[snakeToCamel('get_trusted_' + lName)] = function(value) {\n return getTrusted(enumValue, value);\n };\n sce[snakeToCamel('trust_as_' + lName)] = function(value) {\n return trustAs(enumValue, value);\n };\n });\n\n return sce;\n }];\n}\n\n/* exported $SnifferProvider */\n\n/**\n * !!! This is an undocumented \"private\" service !!!\n *\n * @name $sniffer\n * @requires $window\n * @requires $document\n * @this\n *\n * @property {boolean} history Does the browser support html5 history api ?\n * @property {boolean} transitions Does the browser support CSS transition events ?\n * @property {boolean} animations Does the browser support CSS animation events ?\n *\n * @description\n * This is very simple implementation of testing browser's features.\n */\nfunction $SnifferProvider() {\n this.$get = ['$window', '$document', function($window, $document) {\n var eventSupport = {},\n // Chrome Packaged Apps are not allowed to access `history.pushState`.\n // If not sandboxed, they can be detected by the presence of `chrome.app.runtime`\n // (see https://developer.chrome.com/apps/api_index). If sandboxed, they can be detected by\n // the presence of an extension runtime ID and the absence of other Chrome runtime APIs\n // (see https://developer.chrome.com/apps/manifest/sandbox).\n // (NW.js apps have access to Chrome APIs, but do support `history`.)\n isNw = $window.nw && $window.nw.process,\n isChromePackagedApp =\n !isNw &&\n $window.chrome &&\n ($window.chrome.app && $window.chrome.app.runtime ||\n !$window.chrome.app && $window.chrome.runtime && $window.chrome.runtime.id),\n hasHistoryPushState = !isChromePackagedApp && $window.history && $window.history.pushState,\n android =\n toInt((/android (\\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),\n boxee = /Boxee/i.test(($window.navigator || {}).userAgent),\n document = $document[0] || {},\n bodyStyle = document.body && document.body.style,\n transitions = false,\n animations = false;\n\n if (bodyStyle) {\n // Support: Android <5, Blackberry Browser 10, default Chrome in Android 4.4.x\n // Mentioned browsers need a -webkit- prefix for transitions & animations.\n transitions = !!('transition' in bodyStyle || 'webkitTransition' in bodyStyle);\n animations = !!('animation' in bodyStyle || 'webkitAnimation' in bodyStyle);\n }\n\n\n return {\n // Android has history.pushState, but it does not update location correctly\n // so let's not use the history API at all.\n // http://code.google.com/p/android/issues/detail?id=17471\n // https://github.com/angular/angular.js/issues/904\n\n // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has\n // so let's not use the history API also\n // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined\n history: !!(hasHistoryPushState && !(android < 4) && !boxee),\n hasEvent: function(event) {\n // Support: IE 9-11 only\n // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have\n // it. In particular the event is not fired when backspace or delete key are pressed or\n // when cut operation is performed.\n // IE10+ implements 'input' event but it erroneously fires under various situations,\n // e.g. when placeholder changes, or a form is focused.\n if (event === 'input' && msie) return false;\n\n if (isUndefined(eventSupport[event])) {\n var divElm = document.createElement('div');\n eventSupport[event] = 'on' + event in divElm;\n }\n\n return eventSupport[event];\n },\n csp: csp(),\n transitions: transitions,\n animations: animations,\n android: android\n };\n }];\n}\n\n/**\n * ! This is a private undocumented service !\n *\n * @name $$taskTrackerFactory\n * @description\n * A function to create `TaskTracker` instances.\n *\n * A `TaskTracker` can keep track of pending tasks (grouped by type) and can notify interested\n * parties when all pending tasks (or tasks of a specific type) have been completed.\n *\n * @param {$log} log - A logger instance (such as `$log`). Used to log error during callback\n * execution.\n *\n * @this\n */\nfunction $$TaskTrackerFactoryProvider() {\n this.$get = valueFn(function(log) { return new TaskTracker(log); });\n}\n\nfunction TaskTracker(log) {\n var self = this;\n var taskCounts = {};\n var taskCallbacks = [];\n\n var ALL_TASKS_TYPE = self.ALL_TASKS_TYPE = '$$all$$';\n var DEFAULT_TASK_TYPE = self.DEFAULT_TASK_TYPE = '$$default$$';\n\n /**\n * Execute the specified function and decrement the appropriate `taskCounts` counter.\n * If the counter reaches 0, all corresponding `taskCallbacks` are executed.\n *\n * @param {Function} fn - The function to execute.\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task that is being completed.\n */\n self.completeTask = completeTask;\n\n /**\n * Increase the task count for the specified task type (or the default task type if non is\n * specified).\n *\n * @param {string=} [taskType=DEFAULT_TASK_TYPE] - The type of task whose count will be increased.\n */\n self.incTaskCount = incTaskCount;\n\n /**\n * Execute the specified callback when all pending tasks have been completed.\n *\n * If there are no pending tasks, the callback is executed immediately. You can optionally limit\n * the tasks that will be waited for to a specific type, by passing a `taskType`.\n *\n * @param {function} callback - The function to call when there are no pending tasks.\n * @param {string=} [taskType=ALL_TASKS_TYPE] - The type of tasks that will be waited for.\n */\n self.notifyWhenNoPendingTasks = notifyWhenNoPendingTasks;\n\n function completeTask(fn, taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n\n try {\n fn();\n } finally {\n decTaskCount(taskType);\n\n var countForType = taskCounts[taskType];\n var countForAll = taskCounts[ALL_TASKS_TYPE];\n\n // If at least one of the queues (`ALL_TASKS_TYPE` or `taskType`) is empty, run callbacks.\n if (!countForAll || !countForType) {\n var getNextCallback = !countForAll ? getLastCallback : getLastCallbackForType;\n var nextCb;\n\n while ((nextCb = getNextCallback(taskType))) {\n try {\n nextCb();\n } catch (e) {\n log.error(e);\n }\n }\n }\n }\n }\n\n function decTaskCount(taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n if (taskCounts[taskType]) {\n taskCounts[taskType]--;\n taskCounts[ALL_TASKS_TYPE]--;\n }\n }\n\n function getLastCallback() {\n var cbInfo = taskCallbacks.pop();\n return cbInfo && cbInfo.cb;\n }\n\n function getLastCallbackForType(taskType) {\n for (var i = taskCallbacks.length - 1; i >= 0; --i) {\n var cbInfo = taskCallbacks[i];\n if (cbInfo.type === taskType) {\n taskCallbacks.splice(i, 1);\n return cbInfo.cb;\n }\n }\n }\n\n function incTaskCount(taskType) {\n taskType = taskType || DEFAULT_TASK_TYPE;\n taskCounts[taskType] = (taskCounts[taskType] || 0) + 1;\n taskCounts[ALL_TASKS_TYPE] = (taskCounts[ALL_TASKS_TYPE] || 0) + 1;\n }\n\n function notifyWhenNoPendingTasks(callback, taskType) {\n taskType = taskType || ALL_TASKS_TYPE;\n if (!taskCounts[taskType]) {\n callback();\n } else {\n taskCallbacks.push({type: taskType, cb: callback});\n }\n }\n}\n\nvar $templateRequestMinErr = minErr('$templateRequest');\n\n/**\n * @ngdoc provider\n * @name $templateRequestProvider\n * @this\n *\n * @description\n * Used to configure the options passed to the {@link $http} service when making a template request.\n *\n * For example, it can be used for specifying the \"Accept\" header that is sent to the server, when\n * requesting a template.\n */\nfunction $TemplateRequestProvider() {\n\n var httpOptions;\n\n /**\n * @ngdoc method\n * @name $templateRequestProvider#httpOptions\n * @description\n * The options to be passed to the {@link $http} service when making the request.\n * You can use this to override options such as the \"Accept\" header for template requests.\n *\n * The {@link $templateRequest} will set the `cache` and the `transformResponse` properties of the\n * options if not overridden here.\n *\n * @param {string=} value new value for the {@link $http} options.\n * @returns {string|self} Returns the {@link $http} options when used as getter and self if used as setter.\n */\n this.httpOptions = function(val) {\n if (val) {\n httpOptions = val;\n return this;\n }\n return httpOptions;\n };\n\n /**\n * @ngdoc service\n * @name $templateRequest\n *\n * @description\n * The `$templateRequest` service runs security checks then downloads the provided template using\n * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request\n * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the\n * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the\n * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted\n * when `tpl` is of type string and `$templateCache` has the matching entry.\n *\n * If you want to pass custom options to the `$http` service, such as setting the Accept header you\n * can configure this via {@link $templateRequestProvider#httpOptions}.\n *\n * `$templateRequest` is used internally by {@link $compile}, {@link ngRoute.$route}, and directives such\n * as {@link ngInclude} to download and cache templates.\n *\n * 3rd party modules should use `$templateRequest` if their services or directives are loading\n * templates.\n *\n * @param {string|TrustedResourceUrl} tpl The HTTP request template URL\n * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty\n *\n * @return {Promise} a promise for the HTTP response data of the given URL.\n *\n * @property {number} totalPendingRequests total amount of pending template requests being downloaded.\n */\n this.$get = ['$exceptionHandler', '$templateCache', '$http', '$q', '$sce',\n function($exceptionHandler, $templateCache, $http, $q, $sce) {\n\n function handleRequestFn(tpl, ignoreRequestError) {\n handleRequestFn.totalPendingRequests++;\n\n // We consider the template cache holds only trusted templates, so\n // there's no need to go through adding the template again to the trusted\n // resources for keys that already are included in there. This also makes\n // AngularJS accept any script directive, no matter its name. However, we\n // still need to unwrap trusted types.\n if (!isString(tpl) || isUndefined($templateCache.get(tpl))) {\n tpl = $sce.getTrustedResourceUrl(tpl);\n }\n\n var transformResponse = $http.defaults && $http.defaults.transformResponse;\n\n if (isArray(transformResponse)) {\n transformResponse = transformResponse.filter(function(transformer) {\n return transformer !== defaultHttpResponseTransform;\n });\n } else if (transformResponse === defaultHttpResponseTransform) {\n transformResponse = null;\n }\n\n return $http.get(tpl, extend({\n cache: $templateCache,\n transformResponse: transformResponse\n }, httpOptions))\n .finally(function() {\n handleRequestFn.totalPendingRequests--;\n })\n .then(function(response) {\n return $templateCache.put(tpl, response.data);\n }, handleError);\n\n function handleError(resp) {\n if (!ignoreRequestError) {\n resp = $templateRequestMinErr('tpload',\n 'Failed to load template: {0} (HTTP status: {1} {2})',\n tpl, resp.status, resp.statusText);\n\n $exceptionHandler(resp);\n }\n\n return $q.reject(resp);\n }\n }\n\n handleRequestFn.totalPendingRequests = 0;\n\n return handleRequestFn;\n }\n ];\n}\n\n/** @this */\nfunction $$TestabilityProvider() {\n this.$get = ['$rootScope', '$browser', '$location',\n function($rootScope, $browser, $location) {\n\n /**\n * @name $testability\n *\n * @description\n * The private $$testability service provides a collection of methods for use when debugging\n * or by automated test and debugging tools.\n */\n var testability = {};\n\n /**\n * @name $$testability#findBindings\n *\n * @description\n * Returns an array of elements that are bound (via ng-bind or {{}})\n * to expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The binding expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression. Filters and whitespace are ignored.\n */\n testability.findBindings = function(element, expression, opt_exactMatch) {\n var bindings = element.getElementsByClassName('ng-binding');\n var matches = [];\n forEach(bindings, function(binding) {\n var dataBinding = angular.element(binding).data('$binding');\n if (dataBinding) {\n forEach(dataBinding, function(bindingName) {\n if (opt_exactMatch) {\n var matcher = new RegExp('(^|\\\\s)' + escapeForRegexp(expression) + '(\\\\s|\\\\||$)');\n if (matcher.test(bindingName)) {\n matches.push(binding);\n }\n } else {\n if (bindingName.indexOf(expression) !== -1) {\n matches.push(binding);\n }\n }\n });\n }\n });\n return matches;\n };\n\n /**\n * @name $$testability#findModels\n *\n * @description\n * Returns an array of elements that are two-way found via ng-model to\n * expressions matching the input.\n *\n * @param {Element} element The element root to search from.\n * @param {string} expression The model expression to match.\n * @param {boolean} opt_exactMatch If true, only returns exact matches\n * for the expression.\n */\n testability.findModels = function(element, expression, opt_exactMatch) {\n var prefixes = ['ng-', 'data-ng-', 'ng\\\\:'];\n for (var p = 0; p < prefixes.length; ++p) {\n var attributeEquals = opt_exactMatch ? '=' : '*=';\n var selector = '[' + prefixes[p] + 'model' + attributeEquals + '\"' + expression + '\"]';\n var elements = element.querySelectorAll(selector);\n if (elements.length) {\n return elements;\n }\n }\n };\n\n /**\n * @name $$testability#getLocation\n *\n * @description\n * Shortcut for getting the location in a browser agnostic way. Returns\n * the path, search, and hash. (e.g. /path?a=b#hash)\n */\n testability.getLocation = function() {\n return $location.url();\n };\n\n /**\n * @name $$testability#setLocation\n *\n * @description\n * Shortcut for navigating to a location without doing a full page reload.\n *\n * @param {string} url The location url (path, search and hash,\n * e.g. /path?a=b#hash) to go to.\n */\n testability.setLocation = function(url) {\n if (url !== $location.url()) {\n $location.url(url);\n $rootScope.$digest();\n }\n };\n\n /**\n * @name $$testability#whenStable\n *\n * @description\n * Calls the callback when all pending tasks are completed.\n *\n * Types of tasks waited for include:\n * - Pending timeouts (via {@link $timeout}).\n * - Pending HTTP requests (via {@link $http}).\n * - In-progress route transitions (via {@link $route}).\n * - Pending tasks scheduled via {@link $rootScope#$applyAsync}.\n * - Pending tasks scheduled via {@link $rootScope#$evalAsync}.\n * These include tasks scheduled via `$evalAsync()` indirectly (such as {@link $q} promises).\n *\n * @param {function} callback\n */\n testability.whenStable = function(callback) {\n $browser.notifyWhenNoOutstandingRequests(callback);\n };\n\n return testability;\n }];\n}\n\nvar $timeoutMinErr = minErr('$timeout');\n\n/** @this */\nfunction $TimeoutProvider() {\n this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',\n function($rootScope, $browser, $q, $$q, $exceptionHandler) {\n\n var deferreds = {};\n\n\n /**\n * @ngdoc service\n * @name $timeout\n *\n * @description\n * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch\n * block and delegates any exceptions to\n * {@link ng.$exceptionHandler $exceptionHandler} service.\n *\n * The return value of calling `$timeout` is a promise, which will be resolved when\n * the delay has passed and the timeout function, if provided, is executed.\n *\n * To cancel a timeout request, call `$timeout.cancel(promise)`.\n *\n * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to\n * synchronously flush the queue of deferred functions.\n *\n * If you only want a promise that will be resolved after some specified delay\n * then you can call `$timeout` without the `fn` function.\n *\n * @param {function()=} fn A function, whose execution should be delayed.\n * @param {number=} [delay=0] Delay in milliseconds.\n * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise\n * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.\n * @param {...*=} Pass additional parameters to the executed function.\n * @returns {Promise} Promise that will be resolved when the timeout is reached. The promise\n * will be resolved with the return value of the `fn` function.\n *\n */\n function timeout(fn, delay, invokeApply) {\n if (!isFunction(fn)) {\n invokeApply = delay;\n delay = fn;\n fn = noop;\n }\n\n var args = sliceArgs(arguments, 3),\n skipApply = (isDefined(invokeApply) && !invokeApply),\n deferred = (skipApply ? $$q : $q).defer(),\n promise = deferred.promise,\n timeoutId;\n\n timeoutId = $browser.defer(function() {\n try {\n deferred.resolve(fn.apply(null, args));\n } catch (e) {\n deferred.reject(e);\n $exceptionHandler(e);\n } finally {\n delete deferreds[promise.$$timeoutId];\n }\n\n if (!skipApply) $rootScope.$apply();\n }, delay, '$timeout');\n\n promise.$$timeoutId = timeoutId;\n deferreds[timeoutId] = deferred;\n\n return promise;\n }\n\n\n /**\n * @ngdoc method\n * @name $timeout#cancel\n *\n * @description\n * Cancels a task associated with the `promise`. As a result of this, the promise will be\n * resolved with a rejection.\n *\n * @param {Promise=} promise Promise returned by the `$timeout` function.\n * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully\n * canceled.\n */\n timeout.cancel = function(promise) {\n if (!promise) return false;\n\n if (!promise.hasOwnProperty('$$timeoutId')) {\n throw $timeoutMinErr('badprom',\n '`$timeout.cancel()` called with a promise that was not generated by `$timeout()`.');\n }\n\n if (!deferreds.hasOwnProperty(promise.$$timeoutId)) return false;\n\n var id = promise.$$timeoutId;\n var deferred = deferreds[id];\n\n // Timeout cancels should not report an unhandled promise.\n markQExceptionHandled(deferred.promise);\n deferred.reject('canceled');\n delete deferreds[id];\n\n return $browser.defer.cancel(id);\n };\n\n return timeout;\n }];\n}\n\n// NOTE: The usage of window and document instead of $window and $document here is\n// deliberate. This service depends on the specific behavior of anchor nodes created by the\n// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and\n// cause us to break tests. In addition, when the browser resolves a URL for XHR, it\n// doesn't know about mocked locations and resolves URLs to the real document - which is\n// exactly the behavior needed here. There is little value is mocking these out for this\n// service.\nvar urlParsingNode = window.document.createElement('a');\nvar originUrl = urlResolve(window.location.href);\nvar baseUrlParsingNode;\n\nurlParsingNode.href = 'http://[::1]';\n\n// Support: IE 9-11 only, Edge 16-17 only (fixed in 18 Preview)\n// IE/Edge don't wrap IPv6 addresses' hostnames in square brackets\n// when parsed out of an anchor element.\nvar ipv6InBrackets = urlParsingNode.hostname === '[::1]';\n\n/**\n *\n * Implementation Notes for non-IE browsers\n * ----------------------------------------\n * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,\n * results both in the normalizing and parsing of the URL. Normalizing means that a relative\n * URL will be resolved into an absolute URL in the context of the application document.\n * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related\n * properties are all populated to reflect the normalized URL. This approach has wide\n * compatibility - Safari 1+, Mozilla 1+ etc. See\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n *\n * Implementation Notes for IE\n * ---------------------------\n * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other\n * browsers. However, the parsed components will not be set if the URL assigned did not specify\n * them. (e.g. if you assign a.href = \"foo\", then a.protocol, a.host, etc. will be empty.) We\n * work around that by performing the parsing in a 2nd step by taking a previously normalized\n * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the\n * properties such as protocol, hostname, port, etc.\n *\n * References:\n * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement\n * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html\n * http://url.spec.whatwg.org/#urlutils\n * https://github.com/angular/angular.js/pull/2902\n * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/\n *\n * @kind function\n * @param {string|object} url The URL to be parsed. If `url` is not a string, it will be returned\n * unchanged.\n * @description Normalizes and parses a URL.\n * @returns {object} Returns the normalized URL as a dictionary.\n *\n * | member name | Description |\n * |---------------|------------------------------------------------------------------------|\n * | href | A normalized version of the provided URL if it was not an absolute URL |\n * | protocol | The protocol without the trailing colon |\n * | host | The host and port (if the port is non-default) of the normalizedUrl |\n * | search | The search params, minus the question mark |\n * | hash | The hash string, minus the hash symbol |\n * | hostname | The hostname |\n * | port | The port, without \":\" |\n * | pathname | The pathname, beginning with \"/\" |\n *\n */\nfunction urlResolve(url) {\n if (!isString(url)) return url;\n\n var href = url;\n\n // Support: IE 9-11 only\n if (msie) {\n // Normalize before parse. Refer Implementation Notes on why this is\n // done in two steps on IE.\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n var hostname = urlParsingNode.hostname;\n\n if (!ipv6InBrackets && hostname.indexOf(':') > -1) {\n hostname = '[' + hostname + ']';\n }\n\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/')\n ? urlParsingNode.pathname\n : '/' + urlParsingNode.pathname\n };\n}\n\n/**\n * Parse a request URL and determine whether this is a same-origin request as the application\n * document.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the request is for the same origin as the application document.\n */\nfunction urlIsSameOrigin(requestUrl) {\n return urlsAreSameOrigin(requestUrl, originUrl);\n}\n\n/**\n * Parse a request URL and determine whether it is same-origin as the current document base URL.\n *\n * Note: The base URL is usually the same as the document location (`location.href`) but can\n * be overriden by using the `` tag.\n *\n * @param {string|object} requestUrl The url of the request as a string that will be resolved\n * or a parsed URL object.\n * @returns {boolean} Whether the URL is same-origin as the document base URL.\n */\nfunction urlIsSameOriginAsBaseUrl(requestUrl) {\n return urlsAreSameOrigin(requestUrl, getBaseUrl());\n}\n\n/**\n * Create a function that can check a URL's origin against a list of allowed/trusted origins.\n * The current location's origin is implicitly trusted.\n *\n * @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.\n *\n * @returns {Function} - A function that receives a URL (string or parsed URL object) and returns\n * whether it is of an allowed origin.\n */\nfunction urlIsAllowedOriginFactory(trustedOriginUrls) {\n var parsedAllowedOriginUrls = [originUrl].concat(trustedOriginUrls.map(urlResolve));\n\n /**\n * Check whether the specified URL (string or parsed URL object) has an origin that is allowed\n * based on a list of trusted-origin URLs. The current location's origin is implicitly\n * trusted.\n *\n * @param {string|Object} requestUrl - The URL to be checked (provided as a string that will be\n * resolved or a parsed URL object).\n *\n * @returns {boolean} - Whether the specified URL is of an allowed origin.\n */\n return function urlIsAllowedOrigin(requestUrl) {\n var parsedUrl = urlResolve(requestUrl);\n return parsedAllowedOriginUrls.some(urlsAreSameOrigin.bind(null, parsedUrl));\n };\n}\n\n/**\n * Determine if two URLs share the same origin.\n *\n * @param {string|Object} url1 - First URL to compare as a string or a normalized URL in the form of\n * a dictionary object returned by `urlResolve()`.\n * @param {string|object} url2 - Second URL to compare as a string or a normalized URL in the form\n * of a dictionary object returned by `urlResolve()`.\n *\n * @returns {boolean} - True if both URLs have the same origin, and false otherwise.\n */\nfunction urlsAreSameOrigin(url1, url2) {\n url1 = urlResolve(url1);\n url2 = urlResolve(url2);\n\n return (url1.protocol === url2.protocol &&\n url1.host === url2.host);\n}\n\n/**\n * Returns the current document base URL.\n * @returns {string}\n */\nfunction getBaseUrl() {\n if (window.document.baseURI) {\n return window.document.baseURI;\n }\n\n // `document.baseURI` is available everywhere except IE\n if (!baseUrlParsingNode) {\n baseUrlParsingNode = window.document.createElement('a');\n baseUrlParsingNode.href = '.';\n\n // Work-around for IE bug described in Implementation Notes. The fix in `urlResolve()` is not\n // suitable here because we need to track changes to the base URL.\n baseUrlParsingNode = baseUrlParsingNode.cloneNode(false);\n }\n return baseUrlParsingNode.href;\n}\n\n/**\n * @ngdoc service\n * @name $window\n * @this\n *\n * @description\n * A reference to the browser's `window` object. While `window`\n * is globally available in JavaScript, it causes testability problems, because\n * it is a global variable. In AngularJS we always refer to it through the\n * `$window` service, so it may be overridden, removed or mocked for testing.\n *\n * Expressions, like the one defined for the `ngClick` directive in the example\n * below, are evaluated with respect to the current scope. Therefore, there is\n * no risk of inadvertently coding in a dependency on a global value in such an\n * expression.\n *\n * @example\n \n \n \n
      \n \n \n
      \n
      \n \n it('should display the greeting in the input box', function() {\n element(by.model('greeting')).sendKeys('Hello, E2E Tests');\n // If we click the button it will block the test runner\n // element(':button').click();\n });\n \n
      \n */\nfunction $WindowProvider() {\n this.$get = valueFn(window);\n}\n\n/**\n * @name $$cookieReader\n * @requires $document\n *\n * @description\n * This is a private service for reading cookies used by $http and ngCookies\n *\n * @return {Object} a key/value map of the current cookies\n */\nfunction $$CookieReader($document) {\n var rawDocument = $document[0] || {};\n var lastCookies = {};\n var lastCookieString = '';\n\n function safeGetCookie(rawDocument) {\n try {\n return rawDocument.cookie || '';\n } catch (e) {\n return '';\n }\n }\n\n function safeDecodeURIComponent(str) {\n try {\n return decodeURIComponent(str);\n } catch (e) {\n return str;\n }\n }\n\n return function() {\n var cookieArray, cookie, i, index, name;\n var currentCookieString = safeGetCookie(rawDocument);\n\n if (currentCookieString !== lastCookieString) {\n lastCookieString = currentCookieString;\n cookieArray = lastCookieString.split('; ');\n lastCookies = {};\n\n for (i = 0; i < cookieArray.length; i++) {\n cookie = cookieArray[i];\n index = cookie.indexOf('=');\n if (index > 0) { //ignore nameless cookies\n name = safeDecodeURIComponent(cookie.substring(0, index));\n // the first value that is seen for a cookie is the most\n // specific one. values for the same cookie name that\n // follow are for less specific paths.\n if (isUndefined(lastCookies[name])) {\n lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));\n }\n }\n }\n }\n return lastCookies;\n };\n}\n\n$$CookieReader.$inject = ['$document'];\n\n/** @this */\nfunction $$CookieReaderProvider() {\n this.$get = $$CookieReader;\n}\n\n/* global currencyFilter: true,\n dateFilter: true,\n filterFilter: true,\n jsonFilter: true,\n limitToFilter: true,\n lowercaseFilter: true,\n numberFilter: true,\n orderByFilter: true,\n uppercaseFilter: true,\n */\n\n/**\n * @ngdoc provider\n * @name $filterProvider\n * @description\n *\n * Filters are just functions which transform input to an output. However filters need to be\n * Dependency Injected. To achieve this a filter definition consists of a factory function which is\n * annotated with dependencies and is responsible for creating a filter function.\n *\n *
      \n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
      \n *\n * ```js\n * // Filter registration\n * function MyModule($provide, $filterProvider) {\n * // create a service to demonstrate injection (not always needed)\n * $provide.value('greet', function(name){\n * return 'Hello ' + name + '!';\n * });\n *\n * // register a filter factory which uses the\n * // greet service to demonstrate DI.\n * $filterProvider.register('greet', function(greet){\n * // return the filter function which uses the greet service\n * // to generate salutation\n * return function(text) {\n * // filters need to be forgiving so check input validity\n * return text && greet(text) || text;\n * };\n * });\n * }\n * ```\n *\n * The filter function is registered with the `$injector` under the filter name suffix with\n * `Filter`.\n *\n * ```js\n * it('should be the same instance', inject(\n * function($filterProvider) {\n * $filterProvider.register('reverse', function(){\n * return ...;\n * });\n * },\n * function($filter, reverseFilter) {\n * expect($filter('reverse')).toBe(reverseFilter);\n * });\n * ```\n *\n *\n * For more information about how AngularJS filters work, and how to create your own filters, see\n * {@link guide/filter Filters} in the AngularJS Developer Guide.\n */\n\n/**\n * @ngdoc service\n * @name $filter\n * @kind function\n * @description\n * Filters are used for formatting data displayed to the user.\n *\n * They can be used in view templates, controllers or services. AngularJS comes\n * with a collection of [built-in filters](api/ng/filter), but it is easy to\n * define your own as well.\n *\n * The general syntax in templates is as follows:\n *\n * ```html\n * {{ expression [| filter_name[:parameter_value] ... ] }}\n * ```\n *\n * @param {String} name Name of the filter function to retrieve\n * @return {Function} the filter function\n * @example\n \n \n
      \n

      {{ originalText }}

      \n

      {{ filteredText }}

      \n
      \n
      \n\n \n angular.module('filterExample', [])\n .controller('MainCtrl', function($scope, $filter) {\n $scope.originalText = 'hello';\n $scope.filteredText = $filter('uppercase')($scope.originalText);\n });\n \n
      \n */\n$FilterProvider.$inject = ['$provide'];\n/** @this */\nfunction $FilterProvider($provide) {\n var suffix = 'Filter';\n\n /**\n * @ngdoc method\n * @name $filterProvider#register\n * @param {string|Object} name Name of the filter function, or an object map of filters where\n * the keys are the filter names and the values are the filter factories.\n *\n *
      \n * **Note:** Filter names must be valid AngularJS {@link expression} identifiers, such as `uppercase` or `orderBy`.\n * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace\n * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores\n * (`myapp_subsection_filterx`).\n *
      \n * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.\n * @returns {Object} Registered filter instance, or if a map of filters was provided then a map\n * of the registered filter instances.\n */\n function register(name, factory) {\n if (isObject(name)) {\n var filters = {};\n forEach(name, function(filter, key) {\n filters[key] = register(key, filter);\n });\n return filters;\n } else {\n return $provide.factory(name + suffix, factory);\n }\n }\n this.register = register;\n\n this.$get = ['$injector', function($injector) {\n return function(name) {\n return $injector.get(name + suffix);\n };\n }];\n\n ////////////////////////////////////////\n\n /* global\n currencyFilter: false,\n dateFilter: false,\n filterFilter: false,\n jsonFilter: false,\n limitToFilter: false,\n lowercaseFilter: false,\n numberFilter: false,\n orderByFilter: false,\n uppercaseFilter: false\n */\n\n register('currency', currencyFilter);\n register('date', dateFilter);\n register('filter', filterFilter);\n register('json', jsonFilter);\n register('limitTo', limitToFilter);\n register('lowercase', lowercaseFilter);\n register('number', numberFilter);\n register('orderBy', orderByFilter);\n register('uppercase', uppercaseFilter);\n}\n\n/**\n * @ngdoc filter\n * @name filter\n * @kind function\n *\n * @description\n * Selects a subset of items from `array` and returns it as a new array.\n *\n * @param {Array} array The source array.\n *
      \n * **Note**: If the array contains objects that reference themselves, filtering is not possible.\n *
      \n * @param {string|Object|function()} expression The predicate to be used for selecting items from\n * `array`.\n *\n * Can be one of:\n *\n * - `string`: The string is used for matching against the contents of the `array`. All strings or\n * objects with string properties in `array` that match this string will be returned. This also\n * applies to nested object properties.\n * The predicate can be negated by prefixing the string with `!`.\n *\n * - `Object`: A pattern object can be used to filter specific properties on objects contained\n * by `array`. For example `{name:\"M\", phone:\"1\"}` predicate will return an array of items\n * which have property `name` containing \"M\" and property `phone` containing \"1\". A special\n * property name (`$` by default) can be used (e.g. as in `{$: \"text\"}`) to accept a match\n * against any property of the object or its nested object properties. That's equivalent to the\n * simple substring match with a `string` as described above. The special property name can be\n * overwritten, using the `anyPropertyKey` parameter.\n * The predicate can be negated by prefixing the string with `!`.\n * For example `{name: \"!M\"}` predicate will return an array of items which have property `name`\n * not containing \"M\".\n *\n * Note that a named property will match properties on the same level only, while the special\n * `$` property will match properties on the same level or deeper. E.g. an array item like\n * `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but\n * **will** be matched by `{$: 'John'}`.\n *\n * - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.\n * The function is called for each element of the array, with the element, its index, and\n * the entire array itself as arguments.\n *\n * The final result is an array of those elements that the predicate returned true for.\n *\n * @param {function(actual, expected)|true|false} [comparator] Comparator which is used in\n * determining if values retrieved using `expression` (when it is not a function) should be\n * considered a match based on the expected value (from the filter expression) and actual\n * value (from the object in the array).\n *\n * Can be one of:\n *\n * - `function(actual, expected)`:\n * The function will be given the object value and the predicate value to compare and\n * should return true if both values should be considered equal.\n *\n * - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.\n * This is essentially strict comparison of expected and actual.\n *\n * - `false`: A short hand for a function which will look for a substring match in a case\n * insensitive way. Primitive values are converted to strings. Objects are not compared against\n * primitives, unless they have a custom `toString` method (e.g. `Date` objects).\n *\n *\n * Defaults to `false`.\n *\n * @param {string} [anyPropertyKey] The special property name that matches against any property.\n * By default `$`.\n *\n * @example\n \n \n
      \n\n \n
      \n \n \n \n \n \n
      NamePhone
      {{friend.name}}{{friend.phone}}
      \n
      \n
      \n
      \n
      \n
      \n \n \n \n \n \n \n
      NamePhone
      {{friendObj.name}}{{friendObj.phone}}
      \n \n \n var expectFriendNames = function(expectedNames, key) {\n element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {\n arr.forEach(function(wd, i) {\n expect(wd.getText()).toMatch(expectedNames[i]);\n });\n });\n };\n\n it('should search across all fields when filtering with a string', function() {\n var searchText = element(by.model('searchText'));\n searchText.clear();\n searchText.sendKeys('m');\n expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');\n\n searchText.clear();\n searchText.sendKeys('76');\n expectFriendNames(['John', 'Julie'], 'friend');\n });\n\n it('should search in specific fields when filtering with a predicate object', function() {\n var searchAny = element(by.model('search.$'));\n searchAny.clear();\n searchAny.sendKeys('i');\n expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');\n });\n it('should use a equal comparison when comparator is true', function() {\n var searchName = element(by.model('search.name'));\n var strict = element(by.model('strict'));\n searchName.clear();\n searchName.sendKeys('Julie');\n strict.click();\n expectFriendNames(['Julie'], 'friendObj');\n });\n \n \n */\n\nfunction filterFilter() {\n return function(array, expression, comparator, anyPropertyKey) {\n if (!isArrayLike(array)) {\n if (array == null) {\n return array;\n } else {\n throw minErr('filter')('notarray', 'Expected array but received: {0}', array);\n }\n }\n\n anyPropertyKey = anyPropertyKey || '$';\n var expressionType = getTypeForFilter(expression);\n var predicateFn;\n var matchAgainstAnyProp;\n\n switch (expressionType) {\n case 'function':\n predicateFn = expression;\n break;\n case 'boolean':\n case 'null':\n case 'number':\n case 'string':\n matchAgainstAnyProp = true;\n // falls through\n case 'object':\n predicateFn = createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n break;\n default:\n return array;\n }\n\n return Array.prototype.filter.call(array, predicateFn);\n };\n}\n\n// Helper functions for `filterFilter`\nfunction createPredicateFn(expression, comparator, anyPropertyKey, matchAgainstAnyProp) {\n var shouldMatchPrimitives = isObject(expression) && (anyPropertyKey in expression);\n var predicateFn;\n\n if (comparator === true) {\n comparator = equals;\n } else if (!isFunction(comparator)) {\n comparator = function(actual, expected) {\n if (isUndefined(actual)) {\n // No substring matching against `undefined`\n return false;\n }\n if ((actual === null) || (expected === null)) {\n // No substring matching against `null`; only match against `null`\n return actual === expected;\n }\n if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {\n // Should not compare primitives against objects, unless they have custom `toString` method\n return false;\n }\n\n actual = lowercase('' + actual);\n expected = lowercase('' + expected);\n return actual.indexOf(expected) !== -1;\n };\n }\n\n predicateFn = function(item) {\n if (shouldMatchPrimitives && !isObject(item)) {\n return deepCompare(item, expression[anyPropertyKey], comparator, anyPropertyKey, false);\n }\n return deepCompare(item, expression, comparator, anyPropertyKey, matchAgainstAnyProp);\n };\n\n return predicateFn;\n}\n\nfunction deepCompare(actual, expected, comparator, anyPropertyKey, matchAgainstAnyProp, dontMatchWholeObject) {\n var actualType = getTypeForFilter(actual);\n var expectedType = getTypeForFilter(expected);\n\n if ((expectedType === 'string') && (expected.charAt(0) === '!')) {\n return !deepCompare(actual, expected.substring(1), comparator, anyPropertyKey, matchAgainstAnyProp);\n } else if (isArray(actual)) {\n // In case `actual` is an array, consider it a match\n // if ANY of it's items matches `expected`\n return actual.some(function(item) {\n return deepCompare(item, expected, comparator, anyPropertyKey, matchAgainstAnyProp);\n });\n }\n\n switch (actualType) {\n case 'object':\n var key;\n if (matchAgainstAnyProp) {\n for (key in actual) {\n // Under certain, rare, circumstances, key may not be a string and `charAt` will be undefined\n // See: https://github.com/angular/angular.js/issues/15644\n if (key.charAt && (key.charAt(0) !== '$') &&\n deepCompare(actual[key], expected, comparator, anyPropertyKey, true)) {\n return true;\n }\n }\n return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, anyPropertyKey, false);\n } else if (expectedType === 'object') {\n for (key in expected) {\n var expectedVal = expected[key];\n if (isFunction(expectedVal) || isUndefined(expectedVal)) {\n continue;\n }\n\n var matchAnyProperty = key === anyPropertyKey;\n var actualVal = matchAnyProperty ? actual : actual[key];\n if (!deepCompare(actualVal, expectedVal, comparator, anyPropertyKey, matchAnyProperty, matchAnyProperty)) {\n return false;\n }\n }\n return true;\n } else {\n return comparator(actual, expected);\n }\n case 'function':\n return false;\n default:\n return comparator(actual, expected);\n }\n}\n\n// Used for easily differentiating between `null` and actual `object`\nfunction getTypeForFilter(val) {\n return (val === null) ? 'null' : typeof val;\n}\n\nvar MAX_DIGITS = 22;\nvar DECIMAL_SEP = '.';\nvar ZERO_CHAR = '0';\n\n/**\n * @ngdoc filter\n * @name currency\n * @kind function\n *\n * @description\n * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default\n * symbol for current locale is used.\n *\n * @param {number} amount Input to filter.\n * @param {string=} symbol Currency symbol or identifier to be displayed.\n * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale\n * @returns {string} Formatted number.\n *\n *\n * @example\n \n \n \n
      \n
      \n default currency symbol ($): {{amount | currency}}
      \n custom currency identifier (USD$): {{amount | currency:\"USD$\"}}
      \n no fractions (0): {{amount | currency:\"USD$\":0}}\n
      \n
      \n \n it('should init with 1234.56', function() {\n expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');\n expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');\n });\n it('should update', function() {\n if (browser.params.browser === 'safari') {\n // Safari does not understand the minus key. See\n // https://github.com/angular/protractor/issues/481\n return;\n }\n element(by.model('amount')).clear();\n element(by.model('amount')).sendKeys('-1234');\n expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');\n expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');\n expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');\n });\n \n
      \n */\ncurrencyFilter.$inject = ['$locale'];\nfunction currencyFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(amount, currencySymbol, fractionSize) {\n if (isUndefined(currencySymbol)) {\n currencySymbol = formats.CURRENCY_SYM;\n }\n\n if (isUndefined(fractionSize)) {\n fractionSize = formats.PATTERNS[1].maxFrac;\n }\n\n // If the currency symbol is empty, trim whitespace around the symbol\n var currencySymbolRe = !currencySymbol ? /\\s*\\u00A4\\s*/g : /\\u00A4/g;\n\n // if null or undefined pass it through\n return (amount == null)\n ? amount\n : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).\n replace(currencySymbolRe, currencySymbol);\n };\n}\n\n/**\n * @ngdoc filter\n * @name number\n * @kind function\n *\n * @description\n * Formats a number as text.\n *\n * If the input is null or undefined, it will just be returned.\n * If the input is infinite (Infinity or -Infinity), the Infinity symbol '∞' or '-∞' is returned, respectively.\n * If the input is not a number an empty string is returned.\n *\n *\n * @param {number|string} number Number to format.\n * @param {(number|string)=} fractionSize Number of decimal places to round the number to.\n * If this is not provided then the fraction size is computed from the current locale's number\n * formatting pattern. In the case of the default locale, it will be 3.\n * @returns {string} Number rounded to `fractionSize` appropriately formatted based on the current\n * locale (e.g., in the en_US locale it will have \".\" as the decimal separator and\n * include \",\" group separators after each third digit).\n *\n * @example\n \n \n \n
      \n
      \n Default formatting: {{val | number}}
      \n No fractions: {{val | number:0}}
      \n Negative number: {{-val | number:4}}\n
      \n
      \n \n it('should format numbers', function() {\n expect(element(by.id('number-default')).getText()).toBe('1,234.568');\n expect(element(by.binding('val | number:0')).getText()).toBe('1,235');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');\n });\n\n it('should update', function() {\n element(by.model('val')).clear();\n element(by.model('val')).sendKeys('3374.333');\n expect(element(by.id('number-default')).getText()).toBe('3,374.333');\n expect(element(by.binding('val | number:0')).getText()).toBe('3,374');\n expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');\n });\n \n
      \n */\nnumberFilter.$inject = ['$locale'];\nfunction numberFilter($locale) {\n var formats = $locale.NUMBER_FORMATS;\n return function(number, fractionSize) {\n\n // if null or undefined pass it through\n return (number == null)\n ? number\n : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,\n fractionSize);\n };\n}\n\n/**\n * Parse a number (as a string) into three components that can be used\n * for formatting the number.\n *\n * (Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/)\n *\n * @param {string} numStr The number to parse\n * @return {object} An object describing this number, containing the following keys:\n * - d : an array of digits containing leading zeros as necessary\n * - i : the number of the digits in `d` that are to the left of the decimal point\n * - e : the exponent for numbers that would need more than `MAX_DIGITS` digits in `d`\n *\n */\nfunction parse(numStr) {\n var exponent = 0, digits, numberOfIntegerDigits;\n var i, j, zeros;\n\n // Decimal point?\n if ((numberOfIntegerDigits = numStr.indexOf(DECIMAL_SEP)) > -1) {\n numStr = numStr.replace(DECIMAL_SEP, '');\n }\n\n // Exponential form?\n if ((i = numStr.search(/e/i)) > 0) {\n // Work out the exponent.\n if (numberOfIntegerDigits < 0) numberOfIntegerDigits = i;\n numberOfIntegerDigits += +numStr.slice(i + 1);\n numStr = numStr.substring(0, i);\n } else if (numberOfIntegerDigits < 0) {\n // There was no decimal point or exponent so it is an integer.\n numberOfIntegerDigits = numStr.length;\n }\n\n // Count the number of leading zeros.\n for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) { /* empty */ }\n\n if (i === (zeros = numStr.length)) {\n // The digits are all zero.\n digits = [0];\n numberOfIntegerDigits = 1;\n } else {\n // Count the number of trailing zeros\n zeros--;\n while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;\n\n // Trailing zeros are insignificant so ignore them\n numberOfIntegerDigits -= i;\n digits = [];\n // Convert string to array of digits without leading/trailing zeros.\n for (j = 0; i <= zeros; i++, j++) {\n digits[j] = +numStr.charAt(i);\n }\n }\n\n // If the number overflows the maximum allowed digits then use an exponent.\n if (numberOfIntegerDigits > MAX_DIGITS) {\n digits = digits.splice(0, MAX_DIGITS - 1);\n exponent = numberOfIntegerDigits - 1;\n numberOfIntegerDigits = 1;\n }\n\n return { d: digits, e: exponent, i: numberOfIntegerDigits };\n}\n\n/**\n * Round the parsed number to the specified number of decimal places\n * This function changed the parsedNumber in-place\n */\nfunction roundNumber(parsedNumber, fractionSize, minFrac, maxFrac) {\n var digits = parsedNumber.d;\n var fractionLen = digits.length - parsedNumber.i;\n\n // determine fractionSize if it is not specified; `+fractionSize` converts it to a number\n fractionSize = (isUndefined(fractionSize)) ? Math.min(Math.max(minFrac, fractionLen), maxFrac) : +fractionSize;\n\n // The index of the digit to where rounding is to occur\n var roundAt = fractionSize + parsedNumber.i;\n var digit = digits[roundAt];\n\n if (roundAt > 0) {\n // Drop fractional digits beyond `roundAt`\n digits.splice(Math.max(parsedNumber.i, roundAt));\n\n // Set non-fractional digits beyond `roundAt` to 0\n for (var j = roundAt; j < digits.length; j++) {\n digits[j] = 0;\n }\n } else {\n // We rounded to zero so reset the parsedNumber\n fractionLen = Math.max(0, fractionLen);\n parsedNumber.i = 1;\n digits.length = Math.max(1, roundAt = fractionSize + 1);\n digits[0] = 0;\n for (var i = 1; i < roundAt; i++) digits[i] = 0;\n }\n\n if (digit >= 5) {\n if (roundAt - 1 < 0) {\n for (var k = 0; k > roundAt; k--) {\n digits.unshift(0);\n parsedNumber.i++;\n }\n digits.unshift(1);\n parsedNumber.i++;\n } else {\n digits[roundAt - 1]++;\n }\n }\n\n // Pad out with zeros to get the required fraction length\n for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);\n\n\n // Do any carrying, e.g. a digit was rounded up to 10\n var carry = digits.reduceRight(function(carry, d, i, digits) {\n d = d + carry;\n digits[i] = d % 10;\n return Math.floor(d / 10);\n }, 0);\n if (carry) {\n digits.unshift(carry);\n parsedNumber.i++;\n }\n}\n\n/**\n * Format a number into a string\n * @param {number} number The number to format\n * @param {{\n * minFrac, // the minimum number of digits required in the fraction part of the number\n * maxFrac, // the maximum number of digits required in the fraction part of the number\n * gSize, // number of digits in each group of separated digits\n * lgSize, // number of digits in the last group of digits before the decimal separator\n * negPre, // the string to go in front of a negative number (e.g. `-` or `(`))\n * posPre, // the string to go in front of a positive number\n * negSuf, // the string to go after a negative number (e.g. `)`)\n * posSuf // the string to go after a positive number\n * }} pattern\n * @param {string} groupSep The string to separate groups of number (e.g. `,`)\n * @param {string} decimalSep The string to act as the decimal separator (e.g. `.`)\n * @param {[type]} fractionSize The size of the fractional part of the number\n * @return {string} The number formatted as a string\n */\nfunction formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {\n\n if (!(isString(number) || isNumber(number)) || isNaN(number)) return '';\n\n var isInfinity = !isFinite(number);\n var isZero = false;\n var numStr = Math.abs(number) + '',\n formattedText = '',\n parsedNumber;\n\n if (isInfinity) {\n formattedText = '\\u221e';\n } else {\n parsedNumber = parse(numStr);\n\n roundNumber(parsedNumber, fractionSize, pattern.minFrac, pattern.maxFrac);\n\n var digits = parsedNumber.d;\n var integerLen = parsedNumber.i;\n var exponent = parsedNumber.e;\n var decimals = [];\n isZero = digits.reduce(function(isZero, d) { return isZero && !d; }, true);\n\n // pad zeros for small numbers\n while (integerLen < 0) {\n digits.unshift(0);\n integerLen++;\n }\n\n // extract decimals digits\n if (integerLen > 0) {\n decimals = digits.splice(integerLen, digits.length);\n } else {\n decimals = digits;\n digits = [0];\n }\n\n // format the integer digits with grouping separators\n var groups = [];\n if (digits.length >= pattern.lgSize) {\n groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));\n }\n while (digits.length > pattern.gSize) {\n groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));\n }\n if (digits.length) {\n groups.unshift(digits.join(''));\n }\n formattedText = groups.join(groupSep);\n\n // append the decimal digits\n if (decimals.length) {\n formattedText += decimalSep + decimals.join('');\n }\n\n if (exponent) {\n formattedText += 'e+' + exponent;\n }\n }\n if (number < 0 && !isZero) {\n return pattern.negPre + formattedText + pattern.negSuf;\n } else {\n return pattern.posPre + formattedText + pattern.posSuf;\n }\n}\n\nfunction padNumber(num, digits, trim, negWrap) {\n var neg = '';\n if (num < 0 || (negWrap && num <= 0)) {\n if (negWrap) {\n num = -num + 1;\n } else {\n num = -num;\n neg = '-';\n }\n }\n num = '' + num;\n while (num.length < digits) num = ZERO_CHAR + num;\n if (trim) {\n num = num.substr(num.length - digits);\n }\n return neg + num;\n}\n\n\nfunction dateGetter(name, size, offset, trim, negWrap) {\n offset = offset || 0;\n return function(date) {\n var value = date['get' + name]();\n if (offset > 0 || value > -offset) {\n value += offset;\n }\n if (value === 0 && offset === -12) value = 12;\n return padNumber(value, size, trim, negWrap);\n };\n}\n\nfunction dateStrGetter(name, shortForm, standAlone) {\n return function(date, formats) {\n var value = date['get' + name]();\n var propPrefix = (standAlone ? 'STANDALONE' : '') + (shortForm ? 'SHORT' : '');\n var get = uppercase(propPrefix + name);\n\n return formats[get][value];\n };\n}\n\nfunction timeZoneGetter(date, formats, offset) {\n var zone = -1 * offset;\n var paddedZone = (zone >= 0) ? '+' : '';\n\n paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +\n padNumber(Math.abs(zone % 60), 2);\n\n return paddedZone;\n}\n\nfunction getFirstThursdayOfYear(year) {\n // 0 = index of January\n var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();\n // 4 = index of Thursday (+1 to account for 1st = 5)\n // 11 = index of *next* Thursday (+1 account for 1st = 12)\n return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);\n}\n\nfunction getThursdayThisWeek(datetime) {\n return new Date(datetime.getFullYear(), datetime.getMonth(),\n // 4 = index of Thursday\n datetime.getDate() + (4 - datetime.getDay()));\n}\n\nfunction weekGetter(size) {\n return function(date) {\n var firstThurs = getFirstThursdayOfYear(date.getFullYear()),\n thisThurs = getThursdayThisWeek(date);\n\n var diff = +thisThurs - +firstThurs,\n result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week\n\n return padNumber(result, size);\n };\n}\n\nfunction ampmGetter(date, formats) {\n return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];\n}\n\nfunction eraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];\n}\n\nfunction longEraGetter(date, formats) {\n return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];\n}\n\nvar DATE_FORMATS = {\n yyyy: dateGetter('FullYear', 4, 0, false, true),\n yy: dateGetter('FullYear', 2, 0, true, true),\n y: dateGetter('FullYear', 1, 0, false, true),\n MMMM: dateStrGetter('Month'),\n MMM: dateStrGetter('Month', true),\n MM: dateGetter('Month', 2, 1),\n M: dateGetter('Month', 1, 1),\n LLLL: dateStrGetter('Month', false, true),\n dd: dateGetter('Date', 2),\n d: dateGetter('Date', 1),\n HH: dateGetter('Hours', 2),\n H: dateGetter('Hours', 1),\n hh: dateGetter('Hours', 2, -12),\n h: dateGetter('Hours', 1, -12),\n mm: dateGetter('Minutes', 2),\n m: dateGetter('Minutes', 1),\n ss: dateGetter('Seconds', 2),\n s: dateGetter('Seconds', 1),\n // while ISO 8601 requires fractions to be prefixed with `.` or `,`\n // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions\n sss: dateGetter('Milliseconds', 3),\n EEEE: dateStrGetter('Day'),\n EEE: dateStrGetter('Day', true),\n a: ampmGetter,\n Z: timeZoneGetter,\n ww: weekGetter(2),\n w: weekGetter(1),\n G: eraGetter,\n GG: eraGetter,\n GGG: eraGetter,\n GGGG: longEraGetter\n};\n\nvar DATE_FORMATS_SPLIT = /((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))([\\s\\S]*)/,\n NUMBER_STRING = /^-?\\d+$/;\n\n/**\n * @ngdoc filter\n * @name date\n * @kind function\n *\n * @description\n * Formats `date` to a string based on the requested `format`.\n *\n * `format` string can be composed of the following elements:\n *\n * * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)\n * * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)\n * * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)\n * * `'MMMM'`: Month in year (January-December)\n * * `'MMM'`: Month in year (Jan-Dec)\n * * `'MM'`: Month in year, padded (01-12)\n * * `'M'`: Month in year (1-12)\n * * `'LLLL'`: Stand-alone month in year (January-December)\n * * `'dd'`: Day in month, padded (01-31)\n * * `'d'`: Day in month (1-31)\n * * `'EEEE'`: Day in Week,(Sunday-Saturday)\n * * `'EEE'`: Day in Week, (Sun-Sat)\n * * `'HH'`: Hour in day, padded (00-23)\n * * `'H'`: Hour in day (0-23)\n * * `'hh'`: Hour in AM/PM, padded (01-12)\n * * `'h'`: Hour in AM/PM, (1-12)\n * * `'mm'`: Minute in hour, padded (00-59)\n * * `'m'`: Minute in hour (0-59)\n * * `'ss'`: Second in minute, padded (00-59)\n * * `'s'`: Second in minute (0-59)\n * * `'sss'`: Millisecond in second, padded (000-999)\n * * `'a'`: AM/PM marker\n * * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)\n * * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year\n * * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year\n * * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')\n * * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')\n *\n * `format` string can also be one of the following predefined\n * {@link guide/i18n localizable formats}:\n *\n * * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale\n * (e.g. Sep 3, 2010 12:05:08 PM)\n * * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US locale (e.g. 9/3/10 12:05 PM)\n * * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US locale\n * (e.g. Friday, September 3, 2010)\n * * `'longDate'`: equivalent to `'MMMM d, y'` for en_US locale (e.g. September 3, 2010)\n * * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US locale (e.g. Sep 3, 2010)\n * * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)\n * * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)\n * * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)\n *\n * `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.\n * `\"h 'in the morning'\"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence\n * (e.g. `\"h 'o''clock'\"`).\n *\n * Any other characters in the `format` string will be output as-is.\n *\n * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or\n * number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its\n * shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is\n * specified in the string input, the time is considered to be in the local timezone.\n * @param {string=} format Formatting rules (see Description). If not specified,\n * `mediumDate` is used.\n * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * @returns {string} Formatted string or the input if input is not recognized as date/millis.\n *\n * @example\n \n \n {{1288323623006 | date:'medium'}}:\n {{1288323623006 | date:'medium'}}
      \n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}:\n {{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}
      \n {{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}:\n {{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}
      \n {{1288323623006 | date:\"MM/dd/yyyy 'at' h:mma\"}}:\n {{'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"}}
      \n
      \n \n it('should format date', function() {\n expect(element(by.binding(\"1288323623006 | date:'medium'\")).getText()).\n toMatch(/Oct 2\\d, 2010 \\d{1,2}:\\d{2}:\\d{2} (AM|PM)/);\n expect(element(by.binding(\"1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'\")).getText()).\n toMatch(/2010-10-2\\d \\d{2}:\\d{2}:\\d{2} (-|\\+)?\\d{4}/);\n expect(element(by.binding(\"'1288323623006' | date:'MM/dd/yyyy @ h:mma'\")).getText()).\n toMatch(/10\\/2\\d\\/2010 @ \\d{1,2}:\\d{2}(AM|PM)/);\n expect(element(by.binding(\"'1288323623006' | date:\\\"MM/dd/yyyy 'at' h:mma\\\"\")).getText()).\n toMatch(/10\\/2\\d\\/2010 at \\d{1,2}:\\d{2}(AM|PM)/);\n });\n \n
      \n */\ndateFilter.$inject = ['$locale'];\nfunction dateFilter($locale) {\n\n\n var R_ISO8601_STR = /^(\\d{4})-?(\\d\\d)-?(\\d\\d)(?:T(\\d\\d)(?::?(\\d\\d)(?::?(\\d\\d)(?:\\.(\\d+))?)?)?(Z|([+-])(\\d\\d):?(\\d\\d))?)?$/;\n // 1 2 3 4 5 6 7 8 9 10 11\n function jsonStringToDate(string) {\n var match;\n if ((match = string.match(R_ISO8601_STR))) {\n var date = new Date(0),\n tzHour = 0,\n tzMin = 0,\n dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,\n timeSetter = match[8] ? date.setUTCHours : date.setHours;\n\n if (match[9]) {\n tzHour = toInt(match[9] + match[10]);\n tzMin = toInt(match[9] + match[11]);\n }\n dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));\n var h = toInt(match[4] || 0) - tzHour;\n var m = toInt(match[5] || 0) - tzMin;\n var s = toInt(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n }\n return string;\n }\n\n\n return function(date, format, timezone) {\n var text = '',\n parts = [],\n fn, match;\n\n format = format || 'mediumDate';\n format = $locale.DATETIME_FORMATS[format] || format;\n if (isString(date)) {\n date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);\n }\n\n if (isNumber(date)) {\n date = new Date(date);\n }\n\n if (!isDate(date) || !isFinite(date.getTime())) {\n return date;\n }\n\n while (format) {\n match = DATE_FORMATS_SPLIT.exec(format);\n if (match) {\n parts = concat(parts, match, 1);\n format = parts.pop();\n } else {\n parts.push(format);\n format = null;\n }\n }\n\n var dateTimezoneOffset = date.getTimezoneOffset();\n if (timezone) {\n dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);\n date = convertTimezoneToLocal(date, timezone, true);\n }\n forEach(parts, function(value) {\n fn = DATE_FORMATS[value];\n text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)\n : value === '\\'\\'' ? '\\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\\'');\n });\n\n return text;\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name json\n * @kind function\n *\n * @description\n * Allows you to convert a JavaScript object into JSON string.\n *\n * This filter is mostly useful for debugging. When using the double curly {{value}} notation\n * the binding is automatically converted to JSON.\n *\n * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.\n * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.\n * @returns {string} JSON string.\n *\n *\n * @example\n \n \n
      {{ {'name':'value'} | json }}
      \n
      {{ {'name':'value'} | json:4 }}
      \n
      \n \n it('should jsonify filtered objects', function() {\n expect(element(by.id('default-spacing')).getText()).toMatch(/\\{\\n {2}\"name\": ?\"value\"\\n}/);\n expect(element(by.id('custom-spacing')).getText()).toMatch(/\\{\\n {4}\"name\": ?\"value\"\\n}/);\n });\n \n
      \n *\n */\nfunction jsonFilter() {\n return function(object, spacing) {\n if (isUndefined(spacing)) {\n spacing = 2;\n }\n return toJson(object, spacing);\n };\n}\n\n\n/**\n * @ngdoc filter\n * @name lowercase\n * @kind function\n * @description\n * Converts string to lowercase.\n *\n * See the {@link ng.uppercase uppercase filter documentation} for a functionally identical example.\n *\n * @see angular.lowercase\n */\nvar lowercaseFilter = valueFn(lowercase);\n\n\n/**\n * @ngdoc filter\n * @name uppercase\n * @kind function\n * @description\n * Converts string to uppercase.\n * @example\n \n \n \n
      \n \n

      {{title}}

      \n \n

      {{title | uppercase}}

      \n
      \n
      \n
      \n */\nvar uppercaseFilter = valueFn(uppercase);\n\n/**\n * @ngdoc filter\n * @name limitTo\n * @kind function\n *\n * @description\n * Creates a new array or string containing only a specified number of elements. The elements are\n * taken from either the beginning or the end of the source array, string or number, as specified by\n * the value and sign (positive or negative) of `limit`. Other array-like objects are also supported\n * (e.g. array subclasses, NodeLists, jqLite/jQuery collections etc). If a number is used as input,\n * it is converted to a string.\n *\n * @param {Array|ArrayLike|string|number} input - Array/array-like, string or number to be limited.\n * @param {string|number} limit - The length of the returned array or string. If the `limit` number\n * is positive, `limit` number of items from the beginning of the source array/string are copied.\n * If the number is negative, `limit` number of items from the end of the source array/string\n * are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,\n * the input will be returned unchanged.\n * @param {(string|number)=} begin - Index at which to begin limitation. As a negative index,\n * `begin` indicates an offset from the end of `input`. Defaults to `0`.\n * @returns {Array|string} A new sub-array or substring of length `limit` or less if the input had\n * less than `limit` elements.\n *\n * @example\n \n \n \n
      \n \n

      Output numbers: {{ numbers | limitTo:numLimit }}

      \n \n

      Output letters: {{ letters | limitTo:letterLimit }}

      \n \n

      Output long number: {{ longNumber | limitTo:longNumberLimit }}

      \n
      \n
      \n \n var numLimitInput = element(by.model('numLimit'));\n var letterLimitInput = element(by.model('letterLimit'));\n var longNumberLimitInput = element(by.model('longNumberLimit'));\n var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));\n var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));\n var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));\n\n it('should limit the number array to first three items', function() {\n expect(numLimitInput.getAttribute('value')).toBe('3');\n expect(letterLimitInput.getAttribute('value')).toBe('3');\n expect(longNumberLimitInput.getAttribute('value')).toBe('3');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');\n expect(limitedLetters.getText()).toEqual('Output letters: abc');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 234');\n });\n\n // There is a bug in safari and protractor that doesn't like the minus key\n // it('should update the output when -3 is entered', function() {\n // numLimitInput.clear();\n // numLimitInput.sendKeys('-3');\n // letterLimitInput.clear();\n // letterLimitInput.sendKeys('-3');\n // longNumberLimitInput.clear();\n // longNumberLimitInput.sendKeys('-3');\n // expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');\n // expect(limitedLetters.getText()).toEqual('Output letters: ghi');\n // expect(limitedLongNumber.getText()).toEqual('Output long number: 342');\n // });\n\n it('should not exceed the maximum size of input array', function() {\n numLimitInput.clear();\n numLimitInput.sendKeys('100');\n letterLimitInput.clear();\n letterLimitInput.sendKeys('100');\n longNumberLimitInput.clear();\n longNumberLimitInput.sendKeys('100');\n expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');\n expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');\n expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');\n });\n \n
      \n*/\nfunction limitToFilter() {\n return function(input, limit, begin) {\n if (Math.abs(Number(limit)) === Infinity) {\n limit = Number(limit);\n } else {\n limit = toInt(limit);\n }\n if (isNumberNaN(limit)) return input;\n\n if (isNumber(input)) input = input.toString();\n if (!isArrayLike(input)) return input;\n\n begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);\n begin = (begin < 0) ? Math.max(0, input.length + begin) : begin;\n\n if (limit >= 0) {\n return sliceFn(input, begin, begin + limit);\n } else {\n if (begin === 0) {\n return sliceFn(input, limit, input.length);\n } else {\n return sliceFn(input, Math.max(0, begin + limit), begin);\n }\n }\n };\n}\n\nfunction sliceFn(input, begin, end) {\n if (isString(input)) return input.slice(begin, end);\n\n return slice.call(input, begin, end);\n}\n\n/**\n * @ngdoc filter\n * @name orderBy\n * @kind function\n *\n * @description\n * Returns an array containing the items from the specified `collection`, ordered by a `comparator`\n * function based on the values computed using the `expression` predicate.\n *\n * For example, `[{id: 'foo'}, {id: 'bar'}] | orderBy:'id'` would result in\n * `[{id: 'bar'}, {id: 'foo'}]`.\n *\n * The `collection` can be an Array or array-like object (e.g. NodeList, jQuery object, TypedArray,\n * String, etc).\n *\n * The `expression` can be a single predicate, or a list of predicates each serving as a tie-breaker\n * for the preceding one. The `expression` is evaluated against each item and the output is used\n * for comparing with other items.\n *\n * You can change the sorting order by setting `reverse` to `true`. By default, items are sorted in\n * ascending order.\n *\n * The comparison is done using the `comparator` function. If none is specified, a default, built-in\n * comparator is used (see below for details - in a nutshell, it compares numbers numerically and\n * strings alphabetically).\n *\n * ### Under the hood\n *\n * Ordering the specified `collection` happens in two phases:\n *\n * 1. All items are passed through the predicate (or predicates), and the returned values are saved\n * along with their type (`string`, `number` etc). For example, an item `{label: 'foo'}`, passed\n * through a predicate that extracts the value of the `label` property, would be transformed to:\n * ```\n * {\n * value: 'foo',\n * type: 'string',\n * index: ...\n * }\n * ```\n * **Note:** `null` values use `'null'` as their type.\n * 2. The comparator function is used to sort the items, based on the derived values, types and\n * indices.\n *\n * If you use a custom comparator, it will be called with pairs of objects of the form\n * `{value: ..., type: '...', index: ...}` and is expected to return `0` if the objects are equal\n * (as far as the comparator is concerned), `-1` if the 1st one should be ranked higher than the\n * second, or `1` otherwise.\n *\n * In order to ensure that the sorting will be deterministic across platforms, if none of the\n * specified predicates can distinguish between two items, `orderBy` will automatically introduce a\n * dummy predicate that returns the item's index as `value`.\n * (If you are using a custom comparator, make sure it can handle this predicate as well.)\n *\n * If a custom comparator still can't distinguish between two items, then they will be sorted based\n * on their index using the built-in comparator.\n *\n * Finally, in an attempt to simplify things, if a predicate returns an object as the extracted\n * value for an item, `orderBy` will try to convert that object to a primitive value, before passing\n * it to the comparator. The following rules govern the conversion:\n *\n * 1. If the object has a `valueOf()` method that returns a primitive, its return value will be\n * used instead.
      \n * (If the object has a `valueOf()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 2. If the object has a custom `toString()` method (i.e. not the one inherited from `Object`) that\n * returns a primitive, its return value will be used instead.
      \n * (If the object has a `toString()` method that returns another object, then the returned object\n * will be used in subsequent steps.)\n * 3. No conversion; the object itself is used.\n *\n * ### The default comparator\n *\n * The default, built-in comparator should be sufficient for most usecases. In short, it compares\n * numbers numerically, strings alphabetically (and case-insensitively), for objects falls back to\n * using their index in the original collection, sorts values of different types by type and puts\n * `undefined` and `null` values at the end of the sorted list.\n *\n * More specifically, it follows these steps to determine the relative order of items:\n *\n * 1. If the compared values are of different types:\n * - If one of the values is undefined, consider it \"greater than\" the other.\n * - Else if one of the values is null, consider it \"greater than\" the other.\n * - Else compare the types themselves alphabetically.\n * 2. If both values are of type `string`, compare them alphabetically in a case- and\n * locale-insensitive way.\n * 3. If both values are objects, compare their indices instead.\n * 4. Otherwise, return:\n * - `0`, if the values are equal (by strict equality comparison, i.e. using `===`).\n * - `-1`, if the 1st value is \"less than\" the 2nd value (compared using the `<` operator).\n * - `1`, otherwise.\n *\n * **Note:** If you notice numbers not being sorted as expected, make sure they are actually being\n * saved as numbers and not strings.\n * **Note:** For the purpose of sorting, `null` and `undefined` are considered \"greater than\"\n * any other value (with undefined \"greater than\" null). This effectively means that `null`\n * and `undefined` values end up at the end of a list sorted in ascending order.\n * **Note:** `null` values use `'null'` as their type to be able to distinguish them from objects.\n *\n * @param {Array|ArrayLike} collection - The collection (array or array-like object) to sort.\n * @param {(Function|string|Array.)=} expression - A predicate (or list of\n * predicates) to be used by the comparator to determine the order of elements.\n *\n * Can be one of:\n *\n * - `Function`: A getter function. This function will be called with each item as argument and\n * the return value will be used for sorting.\n * - `string`: An AngularJS expression. This expression will be evaluated against each item and the\n * result will be used for sorting. For example, use `'label'` to sort by a property called\n * `label` or `'label.substring(0, 3)'` to sort by the first 3 characters of the `label`\n * property.
      \n * (The result of a constant expression is interpreted as a property name to be used for\n * comparison. For example, use `'\"special name\"'` (note the extra pair of quotes) to sort by a\n * property called `special name`.)
      \n * An expression can be optionally prefixed with `+` or `-` to control the sorting direction,\n * ascending or descending. For example, `'+label'` or `'-label'`. If no property is provided,\n * (e.g. `'+'` or `'-'`), the collection element itself is used in comparisons.\n * - `Array`: An array of function and/or string predicates. If a predicate cannot determine the\n * relative order of two items, the next predicate is used as a tie-breaker.\n *\n * **Note:** If the predicate is missing or empty then it defaults to `'+'`.\n *\n * @param {boolean=} reverse - If `true`, reverse the sorting order.\n * @param {(Function)=} comparator - The comparator function used to determine the relative order of\n * value pairs. If omitted, the built-in comparator will be used.\n *\n * @returns {Array} - The sorted array.\n *\n *\n * @example\n * ### Ordering a table with `ngRepeat`\n *\n * The example below demonstrates a simple {@link ngRepeat ngRepeat}, where the data is sorted by\n * age in descending order (expression is set to `'-age'`). The `comparator` is not set, which means\n * it defaults to the built-in comparator.\n *\n \n \n
      \n \n \n \n \n \n \n \n \n \n \n \n
      NamePhone NumberAge
      {{friend.name}}{{friend.phone}}{{friend.age}}
      \n
      \n
      \n \n angular.module('orderByExample1', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var names = element.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by age in reverse order', function() {\n expect(names.get(0).getText()).toBe('Adam');\n expect(names.get(1).getText()).toBe('Julie');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('John');\n });\n \n
      \n *
      \n *\n * @example\n * ### Changing parameters dynamically\n *\n * All parameters can be changed dynamically. The next example shows how you can make the columns of\n * a table sortable, by binding the `expression` and `reverse` parameters to scope properties.\n *\n \n \n
      \n
      Sort by = {{propertyName}}; reverse = {{reverse}}
      \n
      \n \n
      \n \n \n \n \n \n \n \n \n \n \n \n
      \n \n \n \n \n \n \n \n \n
      {{friend.name}}{{friend.phone}}{{friend.age}}
      \n
      \n
      \n \n angular.module('orderByExample2', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = friends;\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = ($scope.propertyName === propertyName) ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
      \n *
      \n *\n * @example\n * ### Using `orderBy` inside a controller\n *\n * It is also possible to call the `orderBy` filter manually, by injecting `orderByFilter`, and\n * calling it with the desired parameters. (Alternatively, you could inject the `$filter` factory\n * and retrieve the `orderBy` filter with `$filter('orderBy')`.)\n *\n \n \n
      \n
      Sort by = {{propertyName}}; reverse = {{reverse}}
      \n
      \n \n
      \n \n \n \n \n \n \n \n \n \n \n \n
      \n \n \n \n \n \n \n \n \n
      {{friend.name}}{{friend.phone}}{{friend.age}}
      \n
      \n
      \n \n angular.module('orderByExample3', [])\n .controller('ExampleController', ['$scope', 'orderByFilter', function($scope, orderBy) {\n var friends = [\n {name: 'John', phone: '555-1212', age: 10},\n {name: 'Mary', phone: '555-9876', age: 19},\n {name: 'Mike', phone: '555-4321', age: 21},\n {name: 'Adam', phone: '555-5678', age: 35},\n {name: 'Julie', phone: '555-8765', age: 29}\n ];\n\n $scope.propertyName = 'age';\n $scope.reverse = true;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n\n $scope.sortBy = function(propertyName) {\n $scope.reverse = (propertyName !== null && $scope.propertyName === propertyName)\n ? !$scope.reverse : false;\n $scope.propertyName = propertyName;\n $scope.friends = orderBy(friends, $scope.propertyName, $scope.reverse);\n };\n }]);\n \n \n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n\n .sortorder:after {\n content: '\\25b2'; // BLACK UP-POINTING TRIANGLE\n }\n .sortorder.reverse:after {\n content: '\\25bc'; // BLACK DOWN-POINTING TRIANGLE\n }\n \n \n // Element locators\n var unsortButton = element(by.partialButtonText('unsorted'));\n var nameHeader = element(by.partialButtonText('Name'));\n var phoneHeader = element(by.partialButtonText('Phone'));\n var ageHeader = element(by.partialButtonText('Age'));\n var firstName = element(by.repeater('friends').column('friend.name').row(0));\n var lastName = element(by.repeater('friends').column('friend.name').row(4));\n\n it('should sort friends by some property, when clicking on the column header', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n phoneHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Mary');\n\n nameHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('Mike');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n });\n\n it('should sort friends in reverse order, when clicking on the same column', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Adam');\n\n ageHeader.click();\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n });\n\n it('should restore the original order, when clicking \"Set to unsorted\"', function() {\n expect(firstName.getText()).toBe('Adam');\n expect(lastName.getText()).toBe('John');\n\n unsortButton.click();\n expect(firstName.getText()).toBe('John');\n expect(lastName.getText()).toBe('Julie');\n });\n \n
      \n *
      \n *\n * @example\n * ### Using a custom comparator\n *\n * If you have very specific requirements about the way items are sorted, you can pass your own\n * comparator function. For example, you might need to compare some strings in a locale-sensitive\n * way. (When specifying a custom comparator, you also need to pass a value for the `reverse`\n * argument - passing `false` retains the default sorting order, i.e. ascending.)\n *\n \n \n
      \n
      \n

      Locale-sensitive Comparator

      \n \n \n \n \n \n \n \n \n \n
      NameFavorite Letter
      {{friend.name}}{{friend.favoriteLetter}}
      \n
      \n
      \n

      Default Comparator

      \n \n \n \n \n \n \n \n \n \n
      NameFavorite Letter
      {{friend.name}}{{friend.favoriteLetter}}
      \n
      \n
      \n
      \n \n angular.module('orderByExample4', [])\n .controller('ExampleController', ['$scope', function($scope) {\n $scope.friends = [\n {name: 'John', favoriteLetter: 'Ä'},\n {name: 'Mary', favoriteLetter: 'Ü'},\n {name: 'Mike', favoriteLetter: 'Ö'},\n {name: 'Adam', favoriteLetter: 'H'},\n {name: 'Julie', favoriteLetter: 'Z'}\n ];\n\n $scope.localeSensitiveComparator = function(v1, v2) {\n // If we don't get strings, just compare by index\n if (v1.type !== 'string' || v2.type !== 'string') {\n return (v1.index < v2.index) ? -1 : 1;\n }\n\n // Compare strings alphabetically, taking locale into account\n return v1.value.localeCompare(v2.value);\n };\n }]);\n \n \n .friends-container {\n display: inline-block;\n margin: 0 30px;\n }\n\n .friends {\n border-collapse: collapse;\n }\n\n .friends th {\n border-bottom: 1px solid;\n }\n .friends td, .friends th {\n border-left: 1px solid;\n padding: 5px 10px;\n }\n .friends td:first-child, .friends th:first-child {\n border-left: none;\n }\n \n \n // Element locators\n var container = element(by.css('.custom-comparator'));\n var names = container.all(by.repeater('friends').column('friend.name'));\n\n it('should sort friends by favorite letter (in correct alphabetical order)', function() {\n expect(names.get(0).getText()).toBe('John');\n expect(names.get(1).getText()).toBe('Adam');\n expect(names.get(2).getText()).toBe('Mike');\n expect(names.get(3).getText()).toBe('Mary');\n expect(names.get(4).getText()).toBe('Julie');\n });\n \n
      \n *\n */\norderByFilter.$inject = ['$parse'];\nfunction orderByFilter($parse) {\n return function(array, sortPredicate, reverseOrder, compareFn) {\n\n if (array == null) return array;\n if (!isArrayLike(array)) {\n throw minErr('orderBy')('notarray', 'Expected array but received: {0}', array);\n }\n\n if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }\n if (sortPredicate.length === 0) { sortPredicate = ['+']; }\n\n var predicates = processPredicates(sortPredicate);\n\n var descending = reverseOrder ? -1 : 1;\n\n // Define the `compare()` function. Use a default comparator if none is specified.\n var compare = isFunction(compareFn) ? compareFn : defaultCompare;\n\n // The next three lines are a version of a Swartzian Transform idiom from Perl\n // (sometimes called the Decorate-Sort-Undecorate idiom)\n // See https://en.wikipedia.org/wiki/Schwartzian_transform\n var compareValues = Array.prototype.map.call(array, getComparisonObject);\n compareValues.sort(doComparison);\n array = compareValues.map(function(item) { return item.value; });\n\n return array;\n\n function getComparisonObject(value, index) {\n // NOTE: We are adding an extra `tieBreaker` value based on the element's index.\n // This will be used to keep the sort stable when none of the input predicates can\n // distinguish between two elements.\n return {\n value: value,\n tieBreaker: {value: index, type: 'number', index: index},\n predicateValues: predicates.map(function(predicate) {\n return getPredicateValue(predicate.get(value), index);\n })\n };\n }\n\n function doComparison(v1, v2) {\n for (var i = 0, ii = predicates.length; i < ii; i++) {\n var result = compare(v1.predicateValues[i], v2.predicateValues[i]);\n if (result) {\n return result * predicates[i].descending * descending;\n }\n }\n\n return (compare(v1.tieBreaker, v2.tieBreaker) || defaultCompare(v1.tieBreaker, v2.tieBreaker)) * descending;\n }\n };\n\n function processPredicates(sortPredicates) {\n return sortPredicates.map(function(predicate) {\n var descending = 1, get = identity;\n\n if (isFunction(predicate)) {\n get = predicate;\n } else if (isString(predicate)) {\n if ((predicate.charAt(0) === '+' || predicate.charAt(0) === '-')) {\n descending = predicate.charAt(0) === '-' ? -1 : 1;\n predicate = predicate.substring(1);\n }\n if (predicate !== '') {\n get = $parse(predicate);\n if (get.constant) {\n var key = get();\n get = function(value) { return value[key]; };\n }\n }\n }\n return {get: get, descending: descending};\n });\n }\n\n function isPrimitive(value) {\n switch (typeof value) {\n case 'number': /* falls through */\n case 'boolean': /* falls through */\n case 'string':\n return true;\n default:\n return false;\n }\n }\n\n function objectValue(value) {\n // If `valueOf` is a valid function use that\n if (isFunction(value.valueOf)) {\n value = value.valueOf();\n if (isPrimitive(value)) return value;\n }\n // If `toString` is a valid function and not the one from `Object.prototype` use that\n if (hasCustomToString(value)) {\n value = value.toString();\n if (isPrimitive(value)) return value;\n }\n\n return value;\n }\n\n function getPredicateValue(value, index) {\n var type = typeof value;\n if (value === null) {\n type = 'null';\n } else if (type === 'object') {\n value = objectValue(value);\n }\n return {value: value, type: type, index: index};\n }\n\n function defaultCompare(v1, v2) {\n var result = 0;\n var type1 = v1.type;\n var type2 = v2.type;\n\n if (type1 === type2) {\n var value1 = v1.value;\n var value2 = v2.value;\n\n if (type1 === 'string') {\n // Compare strings case-insensitively\n value1 = value1.toLowerCase();\n value2 = value2.toLowerCase();\n } else if (type1 === 'object') {\n // For basic objects, use the position of the object\n // in the collection instead of the value\n if (isObject(value1)) value1 = v1.index;\n if (isObject(value2)) value2 = v2.index;\n }\n\n if (value1 !== value2) {\n result = value1 < value2 ? -1 : 1;\n }\n } else {\n result = (type1 === 'undefined') ? 1 :\n (type2 === 'undefined') ? -1 :\n (type1 === 'null') ? 1 :\n (type2 === 'null') ? -1 :\n (type1 < type2) ? -1 : 1;\n }\n\n return result;\n }\n}\n\nfunction ngDirective(directive) {\n if (isFunction(directive)) {\n directive = {\n link: directive\n };\n }\n directive.restrict = directive.restrict || 'AC';\n return valueFn(directive);\n}\n\n/**\n * @ngdoc directive\n * @name a\n * @restrict E\n *\n * @description\n * Modifies the default behavior of the html a tag so that the default action is prevented when\n * the href attribute is empty.\n *\n * For dynamically creating `href` attributes for a tags, see the {@link ng.ngHref `ngHref`} directive.\n */\nvar htmlAnchorDirective = valueFn({\n restrict: 'E',\n compile: function(element, attr) {\n if (!attr.href && !attr.xlinkHref) {\n return function(scope, element) {\n // If the linked element is not an anchor tag anymore, do nothing\n if (element[0].nodeName.toLowerCase() !== 'a') return;\n\n // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.\n var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?\n 'xlink:href' : 'href';\n element.on('click', function(event) {\n // if we have no href url, then don't navigate anywhere.\n if (!element.attr(href)) {\n event.preventDefault();\n }\n });\n };\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngHref\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in an href attribute will\n * make the link go to the wrong URL if the user clicks it before\n * AngularJS has a chance to replace the `{{hash}}` markup with its\n * value. Until AngularJS replaces the markup the link will be broken\n * and will most likely return a 404 error. The `ngHref` directive\n * solves this problem.\n *\n * The wrong way to write it:\n * ```html\n * link1\n * ```\n *\n * The correct way to write it:\n * ```html\n * link1\n * ```\n *\n * @element A\n * @param {template} ngHref any string which can contain `{{}}` markup.\n *\n * @example\n * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes\n * in links and their different behaviors:\n \n \n
      \n link 1 (link, don't reload)
      \n link 2 (link, don't reload)
      \n link 3 (link, reload!)
      \n anchor (link, don't reload)
      \n anchor (no link)
      \n link (link, change location)\n
      \n \n it('should execute ng-click but not reload when href without value', function() {\n element(by.id('link-1')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('1');\n expect(element(by.id('link-1')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when href empty string', function() {\n element(by.id('link-2')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('2');\n expect(element(by.id('link-2')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click and change url when ng-href specified', function() {\n expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\\/123$/);\n\n element(by.id('link-3')).click();\n\n // At this point, we navigate away from an AngularJS page, so we need\n // to use browser.driver to get the base webdriver.\n\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/123$/);\n });\n }, 5000, 'page should navigate to /123');\n });\n\n it('should execute ng-click but not reload when href empty string and name specified', function() {\n element(by.id('link-4')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('4');\n expect(element(by.id('link-4')).getAttribute('href')).toBe('');\n });\n\n it('should execute ng-click but not reload when no href but name specified', function() {\n element(by.id('link-5')).click();\n expect(element(by.model('value')).getAttribute('value')).toEqual('5');\n expect(element(by.id('link-5')).getAttribute('href')).toBe(null);\n });\n\n it('should only change url when only ng-href', function() {\n element(by.model('value')).clear();\n element(by.model('value')).sendKeys('6');\n expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\\/6$/);\n\n element(by.id('link-6')).click();\n\n // At this point, we navigate away from an AngularJS page, so we need\n // to use browser.driver to get the base webdriver.\n browser.wait(function() {\n return browser.driver.getCurrentUrl().then(function(url) {\n return url.match(/\\/6$/);\n });\n }, 5000, 'page should navigate to /6');\n });\n \n
      \n */\n\n/**\n * @ngdoc directive\n * @name ngSrc\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in a `src` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrc` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrc any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngSrcset\n * @restrict A\n * @priority 99\n *\n * @description\n * Using AngularJS markup like `{{hash}}` in a `srcset` attribute doesn't\n * work right: The browser will fetch from the URL with the literal\n * text `{{hash}}` until AngularJS replaces the expression inside\n * `{{hash}}`. The `ngSrcset` directive solves this problem.\n *\n * The buggy way to write it:\n * ```html\n * \"Description\"/\n * ```\n *\n * The correct way to write it:\n * ```html\n * \"Description\"\n * ```\n *\n * @element IMG\n * @param {template} ngSrcset any string which can contain `{{}}` markup.\n */\n\n/**\n * @ngdoc directive\n * @name ngDisabled\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * This directive sets the `disabled` attribute on the element (typically a form control,\n * e.g. `input`, `button`, `select` etc.) if the\n * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `disabled`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
      \n \n
      \n \n it('should toggle button', function() {\n expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();\n });\n \n
      \n *\n * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,\n * then the `disabled` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngChecked\n * @restrict A\n * @priority 100\n *\n * @description\n * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.\n *\n * Note that this directive should not be used together with {@link ngModel `ngModel`},\n * as this can lead to unexpected behavior.\n *\n * A special directive is necessary because we cannot use interpolation inside the `checked`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
      \n \n
      \n \n it('should check both checkBoxes', function() {\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeFalsy();\n element(by.model('leader')).click();\n expect(element(by.id('checkFollower')).getAttribute('checked')).toBeTruthy();\n });\n \n
      \n *\n * @element INPUT\n * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,\n * then the `checked` attribute will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngReadonly\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `readonly` attribute on the element, if the expression inside `ngReadonly` is truthy.\n * Note that `readonly` applies only to `input` elements with specific types. [See the input docs on\n * MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-readonly) for more information.\n *\n * A special directive is necessary because we cannot use interpolation inside the `readonly`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * @example\n \n \n
      \n \n
      \n \n it('should toggle readonly attr', function() {\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeFalsy();\n element(by.model('checked')).click();\n expect(element(by.css('[type=\"text\"]')).getAttribute('readonly')).toBeTruthy();\n });\n \n
      \n *\n * @element INPUT\n * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,\n * then special attribute \"readonly\" will be set on the element\n */\n\n\n/**\n * @ngdoc directive\n * @name ngSelected\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `selected` attribute on the element, if the expression inside `ngSelected` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `selected`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n *
      \n * **Note:** `ngSelected` does not interact with the `select` and `ngModel` directives, it only\n * sets the `selected` attribute on the element. If you are using `ngModel` on the select, you\n * should not use `ngSelected` on the options, as `ngModel` will set the select value and\n * selected options.\n *
      \n *\n * @example\n \n \n
      \n \n
      \n \n it('should select Greetings!', function() {\n expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();\n element(by.model('selected')).click();\n expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();\n });\n \n
      \n *\n * @element OPTION\n * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,\n * then special attribute \"selected\" will be set on the element\n */\n\n/**\n * @ngdoc directive\n * @name ngOpen\n * @restrict A\n * @priority 100\n *\n * @description\n *\n * Sets the `open` attribute on the element, if the expression inside `ngOpen` is truthy.\n *\n * A special directive is necessary because we cannot use interpolation inside the `open`\n * attribute. See the {@link guide/interpolation interpolation guide} for more info.\n *\n * ## A note about browser compatibility\n *\n * Internet Explorer and Edge do not support the `details` element, it is\n * recommended to use {@link ng.ngShow} and {@link ng.ngHide} instead.\n *\n * @example\n \n \n
      \n
      \n List\n
        \n
      • Apple
      • \n
      • Orange
      • \n
      • Durian
      • \n
      \n
      \n
      \n \n it('should toggle open', function() {\n expect(element(by.id('details')).getAttribute('open')).toBeFalsy();\n element(by.model('open')).click();\n expect(element(by.id('details')).getAttribute('open')).toBeTruthy();\n });\n \n
      \n *\n * @element DETAILS\n * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,\n * then special attribute \"open\" will be set on the element\n */\n\nvar ngAttributeAliasDirectives = {};\n\n// boolean attrs are evaluated\nforEach(BOOLEAN_ATTR, function(propName, attrName) {\n // binding to multiple is not supported\n if (propName === 'multiple') return;\n\n function defaultLinkFn(scope, element, attr) {\n scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {\n attr.$set(attrName, !!value);\n });\n }\n\n var normalized = directiveNormalize('ng-' + attrName);\n var linkFn = defaultLinkFn;\n\n if (propName === 'checked') {\n linkFn = function(scope, element, attr) {\n // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input\n if (attr.ngModel !== attr[normalized]) {\n defaultLinkFn(scope, element, attr);\n }\n };\n }\n\n ngAttributeAliasDirectives[normalized] = function() {\n return {\n restrict: 'A',\n priority: 100,\n link: linkFn\n };\n };\n});\n\n// aliased input attrs are evaluated\nforEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {\n ngAttributeAliasDirectives[ngAttr] = function() {\n return {\n priority: 100,\n link: function(scope, element, attr) {\n //special case ngPattern when a literal regular expression value\n //is used as the expression (this way we don't have to watch anything).\n if (ngAttr === 'ngPattern' && attr.ngPattern.charAt(0) === '/') {\n var match = attr.ngPattern.match(REGEX_STRING_REGEXP);\n if (match) {\n attr.$set('ngPattern', new RegExp(match[1], match[2]));\n return;\n }\n }\n\n scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {\n attr.$set(ngAttr, value);\n });\n }\n };\n };\n});\n\n// ng-src, ng-srcset, ng-href are interpolated\nforEach(['src', 'srcset', 'href'], function(attrName) {\n var normalized = directiveNormalize('ng-' + attrName);\n ngAttributeAliasDirectives[normalized] = ['$sce', function($sce) {\n return {\n priority: 99, // it needs to run after the attributes are interpolated\n link: function(scope, element, attr) {\n var propName = attrName,\n name = attrName;\n\n if (attrName === 'href' &&\n toString.call(element.prop('href')) === '[object SVGAnimatedString]') {\n name = 'xlinkHref';\n attr.$attr[name] = 'xlink:href';\n propName = null;\n }\n\n // We need to sanitize the url at least once, in case it is a constant\n // non-interpolated attribute.\n attr.$set(normalized, $sce.getTrustedMediaUrl(attr[normalized]));\n\n attr.$observe(normalized, function(value) {\n if (!value) {\n if (attrName === 'href') {\n attr.$set(name, null);\n }\n return;\n }\n\n attr.$set(name, value);\n\n // Support: IE 9-11 only\n // On IE, if \"ng:src\" directive declaration is used and \"src\" attribute doesn't exist\n // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need\n // to set the property as well to achieve the desired effect.\n // We use attr[attrName] value since $set might have sanitized the url.\n if (msie && propName) element.prop(propName, attr[name]);\n });\n }\n };\n }];\n});\n\n/* global -nullFormCtrl, -PENDING_CLASS, -SUBMITTED_CLASS\n */\nvar nullFormCtrl = {\n $addControl: noop,\n $getControls: valueFn([]),\n $$renameControl: nullFormRenameControl,\n $removeControl: noop,\n $setValidity: noop,\n $setDirty: noop,\n $setPristine: noop,\n $setSubmitted: noop,\n $$setSubmitted: noop\n},\nPENDING_CLASS = 'ng-pending',\nSUBMITTED_CLASS = 'ng-submitted';\n\nfunction nullFormRenameControl(control, name) {\n control.$name = name;\n}\n\n/**\n * @ngdoc type\n * @name form.FormController\n *\n * @property {boolean} $pristine True if user has not interacted with the form yet.\n * @property {boolean} $dirty True if user has already interacted with the form.\n * @property {boolean} $valid True if all of the containing forms and controls are valid.\n * @property {boolean} $invalid True if at least one containing control or form is invalid.\n * @property {boolean} $submitted True if user has submitted the form even if its invalid.\n *\n * @property {Object} $pending An object hash, containing references to controls or forms with\n * pending validators, where:\n *\n * - keys are validations tokens (error names).\n * - values are arrays of controls or forms that have a pending validator for the given error name.\n *\n * See {@link form.FormController#$error $error} for a list of built-in validation tokens.\n *\n * @property {Object} $error An object hash, containing references to controls or forms with failing\n * validators, where:\n *\n * - keys are validation tokens (error names),\n * - values are arrays of controls or forms that have a failing validator for the given error name.\n *\n * Built-in validation tokens:\n * - `email`\n * - `max`\n * - `maxlength`\n * - `min`\n * - `minlength`\n * - `number`\n * - `pattern`\n * - `required`\n * - `url`\n * - `date`\n * - `datetimelocal`\n * - `time`\n * - `week`\n * - `month`\n *\n * @description\n * `FormController` keeps track of all its controls and nested forms as well as the state of them,\n * such as being valid/invalid or dirty/pristine.\n *\n * Each {@link ng.directive:form form} directive creates an instance\n * of `FormController`.\n *\n */\n//asks for $scope to fool the BC controller module\nFormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];\nfunction FormController($element, $attrs, $scope, $animate, $interpolate) {\n this.$$controls = [];\n\n // init state\n this.$error = {};\n this.$$success = {};\n this.$pending = undefined;\n this.$name = $interpolate($attrs.name || $attrs.ngForm || '')($scope);\n this.$dirty = false;\n this.$pristine = true;\n this.$valid = true;\n this.$invalid = false;\n this.$submitted = false;\n this.$$parentForm = nullFormCtrl;\n\n this.$$element = $element;\n this.$$animate = $animate;\n\n setupValidity(this);\n}\n\nFormController.prototype = {\n /**\n * @ngdoc method\n * @name form.FormController#$rollbackViewValue\n *\n * @description\n * Rollback all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is typically needed by the reset button of\n * a form that uses `ng-model-options` to pend updates.\n */\n $rollbackViewValue: function() {\n forEach(this.$$controls, function(control) {\n control.$rollbackViewValue();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$commitViewValue\n *\n * @description\n * Commit all form controls pending updates to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function() {\n forEach(this.$$controls, function(control) {\n control.$commitViewValue();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$addControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Register a control with the form. Input elements using ngModelController do this automatically\n * when they are linked.\n *\n * Note that the current state of the control will not be reflected on the new parent form. This\n * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`\n * state.\n *\n * However, if the method is used programmatically, for example by adding dynamically created controls,\n * or controls that have been previously removed without destroying their corresponding DOM element,\n * it's the developers responsibility to make sure the current state propagates to the parent form.\n *\n * For example, if an input control is added that is already `$dirty` and has `$error` properties,\n * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.\n */\n $addControl: function(control) {\n // Breaking change - before, inputs whose name was \"hasOwnProperty\" were quietly ignored\n // and not added to the scope. Now we throw an error.\n assertNotHasOwnProperty(control.$name, 'input');\n this.$$controls.push(control);\n\n if (control.$name) {\n this[control.$name] = control;\n }\n\n control.$$parentForm = this;\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$getControls\n * @returns {Array} the controls that are currently part of this form\n *\n * @description\n * This method returns a **shallow copy** of the controls that are currently part of this form.\n * The controls can be instances of {@link form.FormController `FormController`}\n * ({@link ngForm \"child-forms\"}) and of {@link ngModel.NgModelController `NgModelController`}.\n * If you need access to the controls of child-forms, you have to call `$getControls()`\n * recursively on them.\n * This can be used for example to iterate over all controls to validate them.\n *\n * The controls can be accessed normally, but adding to, or removing controls from the array has\n * no effect on the form. Instead, use {@link form.FormController#$addControl `$addControl()`} and\n * {@link form.FormController#$removeControl `$removeControl()`} for this use-case.\n * Likewise, adding a control to, or removing a control from the form is not reflected\n * in the shallow copy. That means you should get a fresh copy from `$getControls()` every time\n * you need access to the controls.\n */\n $getControls: function() {\n return shallowCopy(this.$$controls);\n },\n\n // Private API: rename a form control\n $$renameControl: function(control, newName) {\n var oldName = control.$name;\n\n if (this[oldName] === control) {\n delete this[oldName];\n }\n this[newName] = control;\n control.$name = newName;\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$removeControl\n * @param {object} control control object, either a {@link form.FormController} or an\n * {@link ngModel.NgModelController}\n *\n * @description\n * Deregister a control from the form.\n *\n * Input elements using ngModelController do this automatically when they are destroyed.\n *\n * Note that only the removed control's validation state (`$errors`etc.) will be removed from the\n * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be\n * different from case to case. For example, removing the only `$dirty` control from a form may or\n * may not mean that the form is still `$dirty`.\n */\n $removeControl: function(control) {\n if (control.$name && this[control.$name] === control) {\n delete this[control.$name];\n }\n forEach(this.$pending, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$error, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n forEach(this.$$success, function(value, name) {\n // eslint-disable-next-line no-invalid-this\n this.$setValidity(name, null, control);\n }, this);\n\n arrayRemove(this.$$controls, control);\n control.$$parentForm = nullFormCtrl;\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setDirty\n *\n * @description\n * Sets the form to a dirty state.\n *\n * This method can be called to add the 'ng-dirty' class and set the form to a dirty\n * state (ng-dirty class). This method will also propagate to parent forms.\n */\n $setDirty: function() {\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$dirty = true;\n this.$pristine = false;\n this.$$parentForm.$setDirty();\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setPristine\n *\n * @description\n * Sets the form to its pristine state.\n *\n * This method sets the form's `$pristine` state to true, the `$dirty` state to false, removes\n * the `ng-dirty` class and adds the `ng-pristine` class. Additionally, it sets the `$submitted`\n * state to false.\n *\n * This method will also propagate to all the controls contained in this form.\n *\n * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after\n * saving or resetting it.\n */\n $setPristine: function() {\n this.$$animate.setClass(this.$$element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);\n this.$dirty = false;\n this.$pristine = true;\n this.$submitted = false;\n forEach(this.$$controls, function(control) {\n control.$setPristine();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setUntouched\n *\n * @description\n * Sets the form to its untouched state.\n *\n * This method can be called to remove the 'ng-touched' class and set the form controls to their\n * untouched state (ng-untouched class).\n *\n * Setting a form controls back to their untouched state is often useful when setting the form\n * back to its pristine state.\n */\n $setUntouched: function() {\n forEach(this.$$controls, function(control) {\n control.$setUntouched();\n });\n },\n\n /**\n * @ngdoc method\n * @name form.FormController#$setSubmitted\n *\n * @description\n * Sets the form to its `$submitted` state. This will also set `$submitted` on all child and\n * parent forms of the form.\n */\n $setSubmitted: function() {\n var rootForm = this;\n while (rootForm.$$parentForm && (rootForm.$$parentForm !== nullFormCtrl)) {\n rootForm = rootForm.$$parentForm;\n }\n rootForm.$$setSubmitted();\n },\n\n $$setSubmitted: function() {\n this.$$animate.addClass(this.$$element, SUBMITTED_CLASS);\n this.$submitted = true;\n forEach(this.$$controls, function(control) {\n if (control.$$setSubmitted) {\n control.$$setSubmitted();\n }\n });\n }\n};\n\n/**\n * @ngdoc method\n * @name form.FormController#$setValidity\n *\n * @description\n * Change the validity state of the form, and notify the parent form (if any).\n *\n * Application developers will rarely need to call this method directly. It is used internally, by\n * {@link ngModel.NgModelController#$setValidity NgModelController.$setValidity()}, to propagate a\n * control's validity state to the parent `FormController`.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be\n * assigned to either `$error[validationErrorKey]` or `$pending[validationErrorKey]` (for\n * unfulfilled `$asyncValidators`), so that it is available for data-binding. The\n * `validationErrorKey` should be in camelCase and will get converted into dash-case for\n * class name. Example: `myError` will result in `ng-valid-my-error` and\n * `ng-invalid-my-error` classes and can be bound to as `{{ someForm.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending\n * (undefined), or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by AngularJS when validators do not run because of parse errors and when\n * `$asyncValidators` do not run because any of the `$validators` failed.\n * @param {NgModelController | FormController} controller - The controller whose validity state is\n * triggering the change.\n */\naddSetValidityMethod({\n clazz: FormController,\n set: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n object[property] = [controller];\n } else {\n var index = list.indexOf(controller);\n if (index === -1) {\n list.push(controller);\n }\n }\n },\n unset: function(object, property, controller) {\n var list = object[property];\n if (!list) {\n return;\n }\n arrayRemove(list, controller);\n if (list.length === 0) {\n delete object[property];\n }\n }\n});\n\n/**\n * @ngdoc directive\n * @name ngForm\n * @restrict EAC\n *\n * @description\n * Helper directive that makes it possible to create control groups inside a\n * {@link ng.directive:form `form`} directive.\n * These \"child forms\" can be used, for example, to determine the validity of a sub-group of\n * controls.\n *\n *
      \n * **Note**: `ngForm` cannot be used as a replacement for `
      `, because it lacks its\n * [built-in HTML functionality](https://html.spec.whatwg.org/#the-form-element).\n * Specifically, you cannot submit `ngForm` like a `` tag. That means,\n * you cannot send data to the server with `ngForm`, or integrate it with\n * {@link ng.directive:ngSubmit `ngSubmit`}.\n *
      \n *\n * @param {string=} ngForm|name Name of the form. If specified, the form controller will\n * be published into the related scope, under this name.\n *\n */\n\n /**\n * @ngdoc directive\n * @name form\n * @restrict E\n *\n * @description\n * Directive that instantiates\n * {@link form.FormController FormController}.\n *\n * If the `name` attribute is specified, the form controller is published onto the current scope under\n * this name.\n *\n * ## Alias: {@link ng.directive:ngForm `ngForm`}\n *\n * In AngularJS, forms can be nested. This means that the outer form is valid when all of the child\n * forms are valid as well. However, browsers do not allow nesting of `` elements, so\n * AngularJS provides the {@link ng.directive:ngForm `ngForm`} directive, which behaves identically to\n * `form` but can be nested. Nested forms can be useful, for example, if the validity of a sub-group\n * of controls needs to be determined.\n *\n * ## CSS classes\n * - `ng-valid` is set if the form is valid.\n * - `ng-invalid` is set if the form is invalid.\n * - `ng-pending` is set if the form is pending.\n * - `ng-pristine` is set if the form is pristine.\n * - `ng-dirty` is set if the form is dirty.\n * - `ng-submitted` is set if the form was submitted.\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n *\n * ## Submitting a form and preventing the default action\n *\n * Since the role of forms in client-side AngularJS applications is different than in classical\n * roundtrip apps, it is desirable for the browser not to translate the form submission into a full\n * page reload that sends the data to the server. Instead some javascript logic should be triggered\n * to handle the form submission in an application-specific way.\n *\n * For this reason, AngularJS prevents the default action (form submission to the server) unless the\n * `` element has an `action` attribute specified.\n *\n * You can use one of the following two ways to specify what javascript method should be called when\n * a form is submitted:\n *\n * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element\n * - {@link ng.directive:ngClick ngClick} directive on the first\n * button or input field of type submit (input[type=submit])\n *\n * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}\n * or {@link ng.directive:ngClick ngClick} directives.\n * This is because of the following form submission rules in the HTML specification:\n *\n * - If a form has only one input field then hitting enter in this field triggers form submit\n * (`ngSubmit`)\n * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter\n * doesn't trigger submit\n * - if a form has one or more input fields and one or more buttons or input[type=submit] then\n * hitting enter in any of the input fields will trigger the click handler on the *first* button or\n * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)\n *\n * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is\n * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * @animations\n * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.\n * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any\n * other validations that are performed within the form. Animations in ngForm are similar to how\n * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well\n * as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style a form element\n * that has been rendered as invalid after it has been validated:\n *\n *
      \n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-form {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-form.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * 
      \n *\n * @example\n \n \n \n \n \n userType: \n Required!
      \n userType = {{userType}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n \n
      \n \n it('should initialize to model', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n expect(userType.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n var userType = element(by.binding('userType'));\n var valid = element(by.binding('myForm.input.$valid'));\n var userInput = element(by.model('userType'));\n\n userInput.clear();\n userInput.sendKeys('');\n\n expect(userType.getText()).toEqual('userType =');\n expect(valid.getText()).toContain('false');\n });\n \n
      \n *\n * @param {string=} name Name of the form. If specified, the form controller will be published into\n * related scope, under this name.\n */\nvar formDirectiveFactory = function(isNgForm) {\n return ['$timeout', '$parse', function($timeout, $parse) {\n var formDirective = {\n name: 'form',\n restrict: isNgForm ? 'EAC' : 'E',\n require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form\n controller: FormController,\n compile: function ngFormCompile(formElement, attr) {\n // Setup initial state of the control\n formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);\n\n var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);\n\n return {\n pre: function ngFormPreLink(scope, formElement, attr, ctrls) {\n var controller = ctrls[0];\n\n // if `action` attr is not present on the form, prevent the default action (submission)\n if (!('action' in attr)) {\n // we can't use jq events because if a form is destroyed during submission the default\n // action is not prevented. see #1238\n //\n // IE 9 is not affected because it doesn't fire a submit event and try to do a full\n // page reload if the form was destroyed by submission of the form via a click handler\n // on a button in the form. Looks like an IE9 specific bug.\n var handleFormSubmission = function(event) {\n scope.$apply(function() {\n controller.$commitViewValue();\n controller.$setSubmitted();\n });\n\n event.preventDefault();\n };\n\n formElement[0].addEventListener('submit', handleFormSubmission);\n\n // unregister the preventDefault listener so that we don't not leak memory but in a\n // way that will achieve the prevention of the default action.\n formElement.on('$destroy', function() {\n $timeout(function() {\n formElement[0].removeEventListener('submit', handleFormSubmission);\n }, 0, false);\n });\n }\n\n var parentFormCtrl = ctrls[1] || controller.$$parentForm;\n parentFormCtrl.$addControl(controller);\n\n var setter = nameAttr ? getSetter(controller.$name) : noop;\n\n if (nameAttr) {\n setter(scope, controller);\n attr.$observe(nameAttr, function(newValue) {\n if (controller.$name === newValue) return;\n setter(scope, undefined);\n controller.$$parentForm.$$renameControl(controller, newValue);\n setter = getSetter(controller.$name);\n setter(scope, controller);\n });\n }\n formElement.on('$destroy', function() {\n controller.$$parentForm.$removeControl(controller);\n setter(scope, undefined);\n extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards\n });\n }\n };\n }\n };\n\n return formDirective;\n\n function getSetter(expression) {\n if (expression === '') {\n //create an assignable expression, so forms with an empty name can be renamed later\n return $parse('this[\"\"]').assign;\n }\n return $parse(expression).assign || noop;\n }\n }];\n};\n\nvar formDirective = formDirectiveFactory();\nvar ngFormDirective = formDirectiveFactory(true);\n\n\n\n// helper methods\nfunction setupValidity(instance) {\n instance.$$classCache = {};\n instance.$$classCache[INVALID_CLASS] = !(instance.$$classCache[VALID_CLASS] = instance.$$element.hasClass(VALID_CLASS));\n}\nfunction addSetValidityMethod(context) {\n var clazz = context.clazz,\n set = context.set,\n unset = context.unset;\n\n clazz.prototype.$setValidity = function(validationErrorKey, state, controller) {\n if (isUndefined(state)) {\n createAndSet(this, '$pending', validationErrorKey, controller);\n } else {\n unsetAndCleanup(this, '$pending', validationErrorKey, controller);\n }\n if (!isBoolean(state)) {\n unset(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n } else {\n if (state) {\n unset(this.$error, validationErrorKey, controller);\n set(this.$$success, validationErrorKey, controller);\n } else {\n set(this.$error, validationErrorKey, controller);\n unset(this.$$success, validationErrorKey, controller);\n }\n }\n if (this.$pending) {\n cachedToggleClass(this, PENDING_CLASS, true);\n this.$valid = this.$invalid = undefined;\n toggleValidationCss(this, '', null);\n } else {\n cachedToggleClass(this, PENDING_CLASS, false);\n this.$valid = isObjectEmpty(this.$error);\n this.$invalid = !this.$valid;\n toggleValidationCss(this, '', this.$valid);\n }\n\n // re-read the state as the set/unset methods could have\n // combined state in this.$error[validationError] (used for forms),\n // where setting/unsetting only increments/decrements the value,\n // and does not replace it.\n var combinedState;\n if (this.$pending && this.$pending[validationErrorKey]) {\n combinedState = undefined;\n } else if (this.$error[validationErrorKey]) {\n combinedState = false;\n } else if (this.$$success[validationErrorKey]) {\n combinedState = true;\n } else {\n combinedState = null;\n }\n\n toggleValidationCss(this, validationErrorKey, combinedState);\n this.$$parentForm.$setValidity(validationErrorKey, combinedState, this);\n };\n\n function createAndSet(ctrl, name, value, controller) {\n if (!ctrl[name]) {\n ctrl[name] = {};\n }\n set(ctrl[name], value, controller);\n }\n\n function unsetAndCleanup(ctrl, name, value, controller) {\n if (ctrl[name]) {\n unset(ctrl[name], value, controller);\n }\n if (isObjectEmpty(ctrl[name])) {\n ctrl[name] = undefined;\n }\n }\n\n function cachedToggleClass(ctrl, className, switchValue) {\n if (switchValue && !ctrl.$$classCache[className]) {\n ctrl.$$animate.addClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = true;\n } else if (!switchValue && ctrl.$$classCache[className]) {\n ctrl.$$animate.removeClass(ctrl.$$element, className);\n ctrl.$$classCache[className] = false;\n }\n }\n\n function toggleValidationCss(ctrl, validationErrorKey, isValid) {\n validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';\n\n cachedToggleClass(ctrl, VALID_CLASS + validationErrorKey, isValid === true);\n cachedToggleClass(ctrl, INVALID_CLASS + validationErrorKey, isValid === false);\n }\n}\n\nfunction isObjectEmpty(obj) {\n if (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n }\n return true;\n}\n\n/* global\n VALID_CLASS: false,\n INVALID_CLASS: false,\n PRISTINE_CLASS: false,\n DIRTY_CLASS: false,\n ngModelMinErr: false\n*/\n\n// Regex code was initially obtained from SO prior to modification: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231\nvar ISO_DATE_REGEXP = /^\\d{4,}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+(?:[+-][0-2]\\d:[0-5]\\d|Z)$/;\n// See valid URLs in RFC3987 (http://tools.ietf.org/html/rfc3987)\n// Note: We are being more lenient, because browsers are too.\n// 1. Scheme\n// 2. Slashes\n// 3. Username\n// 4. Password\n// 5. Hostname\n// 6. Port\n// 7. Path\n// 8. Query\n// 9. Fragment\n// 1111111111111111 222 333333 44444 55555555555555555555555 666 77777777 8888888 999\nvar URL_REGEXP = /^[a-z][a-z\\d.+-]*:\\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\\s:/?#]+|\\[[a-f\\d:]+])(?::\\d+)?(?:\\/[^?#]*)?(?:\\?[^#]*)?(?:#.*)?$/i;\n// eslint-disable-next-line max-len\nvar EMAIL_REGEXP = /^(?=.{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])?)*$/;\nvar NUMBER_REGEXP = /^\\s*(-|\\+)?(\\d+|(\\d*(\\.\\d*)))([eE][+-]?\\d+)?\\s*$/;\nvar DATE_REGEXP = /^(\\d{4,})-(\\d{2})-(\\d{2})$/;\nvar DATETIMELOCAL_REGEXP = /^(\\d{4,})-(\\d\\d)-(\\d\\d)T(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\nvar WEEK_REGEXP = /^(\\d{4,})-W(\\d\\d)$/;\nvar MONTH_REGEXP = /^(\\d{4,})-(\\d\\d)$/;\nvar TIME_REGEXP = /^(\\d\\d):(\\d\\d)(?::(\\d\\d)(\\.\\d{1,3})?)?$/;\n\nvar PARTIAL_VALIDATION_EVENTS = 'keydown wheel mousedown';\nvar PARTIAL_VALIDATION_TYPES = createMap();\nforEach('date,datetime-local,month,time,week'.split(','), function(type) {\n PARTIAL_VALIDATION_TYPES[type] = true;\n});\n\nvar inputType = {\n\n /**\n * @ngdoc input\n * @name input[text]\n *\n * @description\n * Standard HTML text input with AngularJS data binding, inherited by most of the `input` elements.\n *\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Adds `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
      \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.\n * This parameter is ignored for input[type=password] controls, which will never trim the\n * input.\n *\n * @example\n \n \n \n
      \n \n
      \n \n Required!\n \n Single word only!\n
      \n text = {{example.text}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var text = element(by.binding('example.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('guest');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if multi word', function() {\n input.clear();\n input.sendKeys('hello world');\n\n expect(valid.getText()).toContain('false');\n });\n \n
      \n */\n 'text': textInputType,\n\n /**\n * @ngdoc input\n * @name input[date]\n *\n * @description\n * Input with date validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601\n * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many\n * modern browsers do not yet support this input type, it is important to provide cues to users on the\n * expected input format via a placeholder or label.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a\n * valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `min=\"{{minDate | date:'yyyy-MM-dd'}}\"`). Note that `min` will also add native HTML5\n * constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be\n * a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute\n * (e.g. `max=\"{{maxDate | date:'yyyy-MM-dd'}}\"`). Note that `max` will also add native HTML5\n * constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n \n
      \n \n Required!\n \n Not a valid date!\n
      \n value = {{example.value | date: \"yyyy-MM-dd\"}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value | date: \"yyyy-MM-dd\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (see https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10-22');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
      \n */\n 'date': createDateInputType('date', DATE_REGEXP,\n createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),\n 'yyyy-MM-dd'),\n\n /**\n * @ngdoc input\n * @name input[datetime-local]\n *\n * @description\n * Input with datetime validation and transformation. In browsers that do not yet support\n * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * The format of the displayed time can be adjusted with the\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`\n * and `timeStripZeroSeconds`.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `min=\"{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `min` will also add native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation\n * inside this attribute (e.g. `max=\"{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}\"`).\n * Note that `max` will also add native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n \n
      \n \n Required!\n \n Not a valid date!\n
      \n value = {{example.value | date: \"yyyy-MM-ddTHH:mm:ss\"}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value | date: \"yyyy-MM-ddTHH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2010-12-28T14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01-01T23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
      \n */\n 'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,\n createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),\n 'yyyy-MM-ddTHH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[time]\n *\n * @description\n * Input with time validation and transformation. In browsers that do not yet support\n * the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a\n * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions}. By default,\n * this is the timezone of the browser.\n *\n * The format of the displayed time can be adjusted with the\n * {@link ng.directive:ngModelOptions#ngModelOptions-arguments ngModelOptions} `timeSecondsFormat`\n * and `timeStripZeroSeconds`.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minTime | date:'HH:mm:ss'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxTime | date:'HH:mm:ss'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the\n * `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the\n * `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n \n
      \n \n Required!\n \n Not a valid date!\n
      \n value = {{example.value | date: \"HH:mm:ss\"}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value | date: \"HH:mm:ss\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('14:57:00');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('23:59:00');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
      \n */\n 'time': createDateInputType('time', TIME_REGEXP,\n createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),\n 'HH:mm:ss.sss'),\n\n /**\n * @ngdoc input\n * @name input[week]\n *\n * @description\n * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support\n * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * week format (yyyy-W##), for example: `2013-W02`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n *\n * The value of the resulting Date object will be set to Thursday at 00:00:00 of the requested week,\n * due to ISO-8601 week numbering standards. Information on ISO's system for numbering the weeks of the\n * year can be found at: https://en.wikipedia.org/wiki/ISO_8601#Week_dates\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minWeek | date:'yyyy-Www'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxWeek | date:'yyyy-Www'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n
      \n \n Required!\n \n Not a valid date!\n
      \n value = {{example.value | date: \"yyyy-Www\"}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value | date: \"yyyy-Www\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-W01');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-W01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
      \n */\n 'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),\n\n /**\n * @ngdoc input\n * @name input[month]\n *\n * @description\n * Input with month validation and transformation. In browsers that do not yet support\n * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601\n * month format (yyyy-MM), for example: `2009-01`.\n *\n * The model must always be a Date object, otherwise AngularJS will throw an error.\n * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.\n * If the model is not set to the first of the month, the next view to model update will set it\n * to the first of the month.\n *\n * The timezone to be used to read/write the `Date` instance in the model can be defined using\n * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `min=\"{{minMonth | date:'yyyy-MM'}}\"`). Note that `min` will also add\n * native HTML5 constraint validation.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this\n * attribute (e.g. `max=\"{{maxMonth | date:'yyyy-MM'}}\"`). Note that `max` will also add\n * native HTML5 constraint validation.\n * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string\n * the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.\n * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string\n * the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.\n\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n \n
      \n \n Required!\n \n Not a valid month!\n
      \n value = {{example.value | date: \"yyyy-MM\"}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value | date: \"yyyy-MM\"'));\n var valid = element(by.binding('myForm.input.$valid'));\n\n // currently protractor/webdriver does not support\n // sending keys to all known HTML5 input controls\n // for various browsers (https://github.com/angular/protractor/issues/562).\n function setInput(val) {\n // set the value of the element and force validation.\n var scr = \"var ipt = document.getElementById('exampleInput'); \" +\n \"ipt.value = '\" + val + \"';\" +\n \"angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('\" + val + \"'); });\";\n browser.executeScript(scr);\n }\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('2013-10');\n expect(valid.getText()).toContain('myForm.input.$valid = true');\n });\n\n it('should be invalid if empty', function() {\n setInput('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n\n it('should be invalid if over max', function() {\n setInput('2015-01');\n expect(value.getText()).toContain('');\n expect(valid.getText()).toContain('myForm.input.$valid = false');\n });\n \n
      \n */\n 'month': createDateInputType('month', MONTH_REGEXP,\n createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),\n 'yyyy-MM'),\n\n /**\n * @ngdoc input\n * @name input[number]\n *\n * @description\n * Text input with number validation and transformation. Sets the `number` validation\n * error if not a valid number.\n *\n *
      \n * The model must always be of type `number` otherwise AngularJS will throw an error.\n * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}\n * error docs for more information and an example of how to convert your model if necessary.\n *
      \n *\n *\n *\n * @knownIssue\n *\n * ### HTML5 constraint validation and `allowInvalid`\n *\n * In browsers that follow the\n * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),\n * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.\n * If a non-number is entered in the input, the browser will report the value as an empty string,\n * which means the view / model values in `ngModel` and subsequently the scope value\n * will also be an empty string.\n *\n * @knownIssue\n *\n * ### Large numbers and `step` validation\n *\n * The `step` validation will not work correctly for very large numbers (e.g. 9999999999) due to\n * Javascript's arithmetic limitations. If you need to handle large numbers, purpose-built\n * libraries (e.g. https://github.com/MikeMcl/big.js/), can be included into AngularJS by\n * {@link guide/forms#modifying-built-in-validators overwriting the validators}\n * for `number` and / or `step`, or by {@link guide/forms#custom-validation applying custom validators}\n * to an `input[text]` element. The source for `input[number]` type can be used as a starting\n * point for both implementations.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.\n * Can be interpolated.\n * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.\n * Can be interpolated.\n * @param {string=} ngMin Like `min`, sets the `min` validation error key if the value entered is less than `ngMin`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} ngMax Like `max`, sets the `max` validation error key if the value entered is greater than `ngMax`,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} step Sets the `step` validation error key if the value entered does not fit the `step` constraint.\n * Can be interpolated.\n * @param {string=} ngStep Like `step`, sets the `step` validation error key if the value entered does not fit the `ngStep` constraint,\n * but does not trigger HTML5 native validation. Takes an expression.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
      \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n
      \n \n Required!\n \n Not valid number!\n
      \n value = {{example.value}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n
      \n
      \n \n var value = element(by.binding('example.value'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('example.value'));\n\n it('should initialize to model', function() {\n expect(value.getText()).toContain('12');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if over max', function() {\n input.clear();\n input.sendKeys('123');\n expect(value.getText()).toEqual('value =');\n expect(valid.getText()).toContain('false');\n });\n \n
      \n */\n 'number': numberInputType,\n\n\n /**\n * @ngdoc input\n * @name input[url]\n *\n * @description\n * Text input with URL validation. Sets the `url` validation error key if the content is not a\n * valid URL.\n *\n *
      \n * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex\n * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify\n * the built-in validators (see the {@link guide/forms Forms guide})\n *
      \n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
      \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n
      \n \n var text = element(by.binding('url.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('url.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('http://google.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not url', function() {\n input.clear();\n input.sendKeys('box');\n\n expect(valid.getText()).toContain('false');\n });\n \n
      \n */\n 'url': urlInputType,\n\n\n /**\n * @ngdoc input\n * @name input[email]\n *\n * @description\n * Text input with email validation. Sets the `email` validation error key if not a valid email\n * address.\n *\n *
      \n * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex\n * used in Chromium, which may not fulfill your app's requirements.\n * If you need stricter (e.g. requiring a top-level domain), or more relaxed validation\n * (e.g. allowing IPv6 address literals) you can use `ng-pattern` or\n * modify the built-in validators (see the {@link guide/forms Forms guide}).\n *
      \n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of\n * any length.\n * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string\n * that contains the regular expression body that will be converted to a regular expression\n * as in the ngPattern directive.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
      \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n \n
      \n \n Required!\n \n Not valid email!\n
      \n text = {{email.text}}
      \n myForm.input.$valid = {{myForm.input.$valid}}
      \n myForm.input.$error = {{myForm.input.$error}}
      \n myForm.$valid = {{myForm.$valid}}
      \n myForm.$error.required = {{!!myForm.$error.required}}
      \n myForm.$error.email = {{!!myForm.$error.email}}
      \n
      \n
      \n \n var text = element(by.binding('email.text'));\n var valid = element(by.binding('myForm.input.$valid'));\n var input = element(by.model('email.text'));\n\n it('should initialize to model', function() {\n expect(text.getText()).toContain('me@example.com');\n expect(valid.getText()).toContain('true');\n });\n\n it('should be invalid if empty', function() {\n input.clear();\n input.sendKeys('');\n expect(text.getText()).toEqual('text =');\n expect(valid.getText()).toContain('false');\n });\n\n it('should be invalid if not email', function() {\n input.clear();\n input.sendKeys('xxx');\n\n expect(valid.getText()).toContain('false');\n });\n \n
      \n */\n 'email': emailInputType,\n\n\n /**\n * @ngdoc input\n * @name input[radio]\n *\n * @description\n * HTML radio button.\n *\n * **Note:**
      \n * All inputs controlled by {@link ngModel ngModel} (including those of type `radio`) will use the\n * value of their `name` attribute to determine the property under which their\n * {@link ngModel.NgModelController NgModelController} will be published on the parent\n * {@link form.FormController FormController}. Thus, if you use the same `name` for multiple\n * inputs of a form (e.g. a group of radio inputs), only _one_ `NgModelController` will be\n * published on the parent `FormController` under that name. The rest of the controllers will\n * continue to work as expected, but you won't be able to access them as properties on the parent\n * `FormController`.\n *\n *
      \n *

      \n * In plain HTML forms, the `name` attribute is used to identify groups of radio inputs, so\n * that the browser can manage their state (checked/unchecked) based on the state of other\n * inputs in the same group.\n *

      \n *

      \n * In AngularJS forms, this is not necessary. The input's state will be updated based on the\n * value of the underlying model data.\n *

      \n *
      \n *\n *
      \n * If you omit the `name` attribute on a radio input, `ngModel` will automatically assign it a\n * unique name.\n *
      \n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string} value The value to which the `ngModel` expression should be set when selected.\n * Note that `value` only supports `string` values, i.e. the scope model needs to be a string,\n * too. Use `ngValue` if you need complex models (`number`, `object`, ...).\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {string} ngValue AngularJS expression to which `ngModel` will be be set when the radio\n * is selected. Should be used instead of the `value` attribute if you need\n * a non-string `ngModel` (`boolean`, `array`, ...).\n *\n * @example\n \n \n \n
      \n
      \n
      \n
      \n color = {{color.name | json}}
      \n
      \n Note that `ng-value=\"specialValue\"` sets radio item's value to be the value of `$scope.specialValue`.\n
      \n \n it('should change state', function() {\n var inputs = element.all(by.model('color.name'));\n var color = element(by.binding('color.name'));\n\n expect(color.getText()).toContain('blue');\n\n inputs.get(0).click();\n expect(color.getText()).toContain('red');\n\n inputs.get(1).click();\n expect(color.getText()).toContain('green');\n });\n \n
      \n */\n 'radio': radioInputType,\n\n /**\n * @ngdoc input\n * @name input[range]\n *\n * @description\n * Native range input with validation and transformation.\n *\n * The model for the range input must always be a `Number`.\n *\n * IE9 and other browsers that do not support the `range` type fall back\n * to a text input without any default values for `min`, `max` and `step`. Model binding,\n * validation and number parsing are nevertheless supported.\n *\n * Browsers that support range (latest Chrome, Safari, Firefox, Edge) treat `input[range]`\n * in a way that never allows the input to hold an invalid value. That means:\n * - any non-numerical value is set to `(max + min) / 2`.\n * - any numerical value that is less than the current min val, or greater than the current max val\n * is set to the min / max val respectively.\n * - additionally, the current `step` is respected, so the nearest value that satisfies a step\n * is used.\n *\n * See the [HTML Spec on input[type=range]](https://www.w3.org/TR/html5/forms.html#range-state-(type=range))\n * for more info.\n *\n * This has the following consequences for AngularJS:\n *\n * Since the element value should always reflect the current model value, a range input\n * will set the bound ngModel expression to the value that the browser has set for the\n * input element. For example, in the following input ``,\n * if the application sets `model.value = null`, the browser will set the input to `'50'`.\n * AngularJS will then set the model to `50`, to prevent input and model value being out of sync.\n *\n * That means the model for range will immediately be set to `50` after `ngModel` has been\n * initialized. It also means a range input can never have the required error.\n *\n * This does not only affect changes to the model value, but also to the values of the `min`,\n * `max`, and `step` attributes. When these change in a way that will cause the browser to modify\n * the input value, AngularJS will also update the model value.\n *\n * Automatic value adjustment also means that a range input element can never have the `required`,\n * `min`, or `max` errors.\n *\n * However, `step` is currently only fully implemented by Firefox. Other browsers have problems\n * when the step value changes dynamically - they do not adjust the element value correctly, but\n * instead may set the `stepMismatch` error. If that's the case, the AngularJS will set the `step`\n * error on the input, and set the model to `undefined`.\n *\n * Note that `input[range]` is not compatible with`ngMax`, `ngMin`, and `ngStep`, because they do\n * not set the `min` and `max` attributes, which means that the browser won't automatically adjust\n * the input value based on their values, and will always assume min = 0, max = 100, and step = 1.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} min Sets the `min` validation to ensure that the value entered is greater\n * than `min`. Can be interpolated.\n * @param {string=} max Sets the `max` validation to ensure that the value entered is less than `max`.\n * Can be interpolated.\n * @param {string=} step Sets the `step` validation to ensure that the value entered matches the `step`\n * Can be interpolated.\n * @param {expression=} ngChange AngularJS expression to be executed when the ngModel value changes due\n * to user interaction with the input element.\n * @param {expression=} ngChecked If the expression is truthy, then the `checked` attribute will be set on the\n * element. **Note** : `ngChecked` should not be used alongside `ngModel`.\n * Checkout {@link ng.directive:ngChecked ngChecked} for usage.\n *\n * @example\n \n \n \n
      \n\n Model as range: \n
      \n Model as number:
      \n Min:
      \n Max:
      \n value = {{value}}
      \n myForm.range.$valid = {{myForm.range.$valid}}
      \n myForm.range.$error = {{myForm.range.$error}}\n
      \n
      \n
      \n\n * ## Range Input with ngMin & ngMax attributes\n\n * @example\n \n \n \n
      \n Model as range: \n
      \n Model as number:
      \n Min:
      \n Max:
      \n value = {{value}}
      \n myForm.range.$valid = {{myForm.range.$valid}}
      \n myForm.range.$error = {{myForm.range.$error}}\n
      \n
      \n
      \n\n */\n 'range': rangeInputType,\n\n /**\n * @ngdoc input\n * @name input[checkbox]\n *\n * @description\n * HTML checkbox.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {expression=} ngTrueValue The value to which the expression should be set when selected.\n * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n *\n * @example\n \n \n \n
      \n
      \n
      \n value1 = {{checkboxModel.value1}}
      \n value2 = {{checkboxModel.value2}}
      \n
      \n
      \n \n it('should change state', function() {\n var value1 = element(by.binding('checkboxModel.value1'));\n var value2 = element(by.binding('checkboxModel.value2'));\n\n expect(value1.getText()).toContain('true');\n expect(value2.getText()).toContain('YES');\n\n element(by.model('checkboxModel.value1')).click();\n element(by.model('checkboxModel.value2')).click();\n\n expect(value1.getText()).toContain('false');\n expect(value2.getText()).toContain('NO');\n });\n \n
      \n */\n 'checkbox': checkboxInputType,\n\n 'hidden': noop,\n 'button': noop,\n 'submit': noop,\n 'reset': noop,\n 'file': noop\n};\n\nfunction stringBasedInputType(ctrl) {\n ctrl.$formatters.push(function(value) {\n return ctrl.$isEmpty(value) ? value : value.toString();\n });\n}\n\nfunction textInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n}\n\nfunction baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n var type = lowercase(element[0].type);\n\n // In composition mode, users are still inputting intermediate text buffer,\n // hold the listener until composition is done.\n // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent\n if (!$sniffer.android) {\n var composing = false;\n\n element.on('compositionstart', function() {\n composing = true;\n });\n\n // Support: IE9+\n element.on('compositionupdate', function(ev) {\n // End composition when ev.data is empty string on 'compositionupdate' event.\n // When the input de-focusses (e.g. by clicking away), IE triggers 'compositionupdate'\n // instead of 'compositionend'.\n if (isUndefined(ev.data) || ev.data === '') {\n composing = false;\n }\n });\n\n element.on('compositionend', function() {\n composing = false;\n listener();\n });\n }\n\n var timeout;\n\n var listener = function(ev) {\n if (timeout) {\n $browser.defer.cancel(timeout);\n timeout = null;\n }\n if (composing) return;\n var value = element.val(),\n event = ev && ev.type;\n\n // By default we will trim the value\n // If the attribute ng-trim exists we will avoid trimming\n // If input type is 'password', the value is never trimmed\n if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {\n value = trim(value);\n }\n\n // If a control is suffering from bad input (due to native validators), browsers discard its\n // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the\n // control's value is the same empty value twice in a row.\n if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {\n ctrl.$setViewValue(value, event);\n }\n };\n\n // if the browser does support \"input\" event, we are fine - except on IE9 which doesn't fire the\n // input event on backspace, delete or cut\n if ($sniffer.hasEvent('input')) {\n element.on('input', listener);\n } else {\n var deferListener = function(ev, input, origValue) {\n if (!timeout) {\n timeout = $browser.defer(function() {\n timeout = null;\n if (!input || input.value !== origValue) {\n listener(ev);\n }\n });\n }\n };\n\n element.on('keydown', /** @this */ function(event) {\n var key = event.keyCode;\n\n // ignore\n // command modifiers arrows\n if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;\n\n deferListener(event, this, this.value);\n });\n\n // if user modifies input value using context menu in IE, we need \"paste\", \"cut\" and \"drop\" events to catch it\n if ($sniffer.hasEvent('paste')) {\n element.on('paste cut drop', deferListener);\n }\n }\n\n // if user paste into input using mouse on older browser\n // or form autocomplete on newer browser, we need \"change\" event to catch it\n element.on('change', listener);\n\n // Some native input types (date-family) have the ability to change validity without\n // firing any input/change events.\n // For these event types, when native validators are present and the browser supports the type,\n // check for validity changes on various DOM events.\n if (PARTIAL_VALIDATION_TYPES[type] && ctrl.$$hasNativeValidators && type === attr.type) {\n element.on(PARTIAL_VALIDATION_EVENTS, /** @this */ function(ev) {\n if (!timeout) {\n var validity = this[VALIDITY_STATE_PROPERTY];\n var origBadInput = validity.badInput;\n var origTypeMismatch = validity.typeMismatch;\n timeout = $browser.defer(function() {\n timeout = null;\n if (validity.badInput !== origBadInput || validity.typeMismatch !== origTypeMismatch) {\n listener(ev);\n }\n });\n }\n });\n }\n\n ctrl.$render = function() {\n // Workaround for Firefox validation #12102.\n var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;\n if (element.val() !== value) {\n element.val(value);\n }\n };\n}\n\nfunction weekParser(isoWeek, existingDate) {\n if (isDate(isoWeek)) {\n return isoWeek;\n }\n\n if (isString(isoWeek)) {\n WEEK_REGEXP.lastIndex = 0;\n var parts = WEEK_REGEXP.exec(isoWeek);\n if (parts) {\n var year = +parts[1],\n week = +parts[2],\n hours = 0,\n minutes = 0,\n seconds = 0,\n milliseconds = 0,\n firstThurs = getFirstThursdayOfYear(year),\n addDays = (week - 1) * 7;\n\n if (existingDate) {\n hours = existingDate.getHours();\n minutes = existingDate.getMinutes();\n seconds = existingDate.getSeconds();\n milliseconds = existingDate.getMilliseconds();\n }\n\n return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);\n }\n }\n\n return NaN;\n}\n\nfunction createDateParser(regexp, mapping) {\n return function(iso, previousDate) {\n var parts, map;\n\n if (isDate(iso)) {\n return iso;\n }\n\n if (isString(iso)) {\n // When a date is JSON'ified to wraps itself inside of an extra\n // set of double quotes. This makes the date parsing code unable\n // to match the date string and parse it as a date.\n if (iso.charAt(0) === '\"' && iso.charAt(iso.length - 1) === '\"') {\n iso = iso.substring(1, iso.length - 1);\n }\n if (ISO_DATE_REGEXP.test(iso)) {\n return new Date(iso);\n }\n regexp.lastIndex = 0;\n parts = regexp.exec(iso);\n\n if (parts) {\n parts.shift();\n if (previousDate) {\n map = {\n yyyy: previousDate.getFullYear(),\n MM: previousDate.getMonth() + 1,\n dd: previousDate.getDate(),\n HH: previousDate.getHours(),\n mm: previousDate.getMinutes(),\n ss: previousDate.getSeconds(),\n sss: previousDate.getMilliseconds() / 1000\n };\n } else {\n map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };\n }\n\n forEach(parts, function(part, index) {\n if (index < mapping.length) {\n map[mapping[index]] = +part;\n }\n });\n\n var date = new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);\n if (map.yyyy < 100) {\n // In the constructor, 2-digit years map to 1900-1999.\n // Use `setFullYear()` to set the correct year.\n date.setFullYear(map.yyyy);\n }\n\n return date;\n }\n }\n\n return NaN;\n };\n}\n\nfunction createDateInputType(type, regexp, parseDate, format) {\n return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n badInputChecker(scope, element, attr, ctrl, type);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var isTimeType = type === 'time' || type === 'datetimelocal';\n var previousDate;\n var previousTimezone;\n\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n\n if (regexp.test(value)) {\n // Note: We cannot read ctrl.$modelValue, as there might be a different\n // parser/formatter in the processing chain so that the model\n // contains some different data format!\n return parseDateAndConvertTimeZoneToLocal(value, previousDate);\n }\n ctrl.$$parserName = type;\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (value && !isDate(value)) {\n throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);\n }\n if (isValidDate(value)) {\n previousDate = value;\n var timezone = ctrl.$options.getOption('timezone');\n\n if (timezone) {\n previousTimezone = timezone;\n previousDate = convertTimezoneToLocal(previousDate, timezone, true);\n }\n\n return formatter(value, timezone);\n } else {\n previousDate = null;\n previousTimezone = null;\n return '';\n }\n });\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal = attr.min || $parse(attr.ngMin)(scope);\n var parsedMinVal = parseObservedDateValue(minVal);\n\n ctrl.$validators.min = function(value) {\n return !isValidDate(value) || isUndefined(parsedMinVal) || parseDate(value) >= parsedMinVal;\n };\n attr.$observe('min', function(val) {\n if (val !== minVal) {\n parsedMinVal = parseObservedDateValue(val);\n minVal = val;\n ctrl.$validate();\n }\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal = attr.max || $parse(attr.ngMax)(scope);\n var parsedMaxVal = parseObservedDateValue(maxVal);\n\n ctrl.$validators.max = function(value) {\n return !isValidDate(value) || isUndefined(parsedMaxVal) || parseDate(value) <= parsedMaxVal;\n };\n attr.$observe('max', function(val) {\n if (val !== maxVal) {\n parsedMaxVal = parseObservedDateValue(val);\n maxVal = val;\n ctrl.$validate();\n }\n });\n }\n\n function isValidDate(value) {\n // Invalid Date: getTime() returns NaN\n return value && !(value.getTime && value.getTime() !== value.getTime());\n }\n\n function parseObservedDateValue(val) {\n return isDefined(val) && !isDate(val) ? parseDateAndConvertTimeZoneToLocal(val) || undefined : val;\n }\n\n function parseDateAndConvertTimeZoneToLocal(value, previousDate) {\n var timezone = ctrl.$options.getOption('timezone');\n\n if (previousTimezone && previousTimezone !== timezone) {\n // If the timezone has changed, adjust the previousDate to the default timezone\n // so that the new date is converted with the correct timezone offset\n previousDate = addDateMinutes(previousDate, timezoneToOffset(previousTimezone));\n }\n\n var parsedDate = parseDate(value, previousDate);\n\n if (!isNaN(parsedDate) && timezone) {\n parsedDate = convertTimezoneToLocal(parsedDate, timezone);\n }\n return parsedDate;\n }\n\n function formatter(value, timezone) {\n var targetFormat = format;\n\n if (isTimeType && isString(ctrl.$options.getOption('timeSecondsFormat'))) {\n targetFormat = format\n .replace('ss.sss', ctrl.$options.getOption('timeSecondsFormat'))\n .replace(/:$/, '');\n }\n\n var formatted = $filter('date')(value, targetFormat, timezone);\n\n if (isTimeType && ctrl.$options.getOption('timeStripZeroSeconds')) {\n formatted = formatted.replace(/(?::00)?(?:\\.000)?$/, '');\n }\n\n return formatted;\n }\n };\n}\n\nfunction badInputChecker(scope, element, attr, ctrl, parserName) {\n var node = element[0];\n var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);\n if (nativeValidation) {\n ctrl.$parsers.push(function(value) {\n var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};\n if (validity.badInput || validity.typeMismatch) {\n ctrl.$$parserName = parserName;\n return undefined;\n }\n\n return value;\n });\n }\n}\n\nfunction numberFormatterParser(ctrl) {\n ctrl.$parsers.push(function(value) {\n if (ctrl.$isEmpty(value)) return null;\n if (NUMBER_REGEXP.test(value)) return parseFloat(value);\n\n ctrl.$$parserName = 'number';\n return undefined;\n });\n\n ctrl.$formatters.push(function(value) {\n if (!ctrl.$isEmpty(value)) {\n if (!isNumber(value)) {\n throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);\n }\n value = value.toString();\n }\n return value;\n });\n}\n\nfunction parseNumberAttrVal(val) {\n if (isDefined(val) && !isNumber(val)) {\n val = parseFloat(val);\n }\n return !isNumberNaN(val) ? val : undefined;\n}\n\nfunction isNumberInteger(num) {\n // See http://stackoverflow.com/questions/14636536/how-to-check-if-a-variable-is-an-integer-in-javascript#14794066\n // (minus the assumption that `num` is a number)\n\n // eslint-disable-next-line no-bitwise\n return (num | 0) === num;\n}\n\nfunction countDecimals(num) {\n var numString = num.toString();\n var decimalSymbolIndex = numString.indexOf('.');\n\n if (decimalSymbolIndex === -1) {\n if (-1 < num && num < 1) {\n // It may be in the exponential notation format (`1e-X`)\n var match = /e-(\\d+)$/.exec(numString);\n\n if (match) {\n return Number(match[1]);\n }\n }\n\n return 0;\n }\n\n return numString.length - decimalSymbolIndex - 1;\n}\n\nfunction isValidForStep(viewValue, stepBase, step) {\n // At this point `stepBase` and `step` are expected to be non-NaN values\n // and `viewValue` is expected to be a valid stringified number.\n var value = Number(viewValue);\n\n var isNonIntegerValue = !isNumberInteger(value);\n var isNonIntegerStepBase = !isNumberInteger(stepBase);\n var isNonIntegerStep = !isNumberInteger(step);\n\n // Due to limitations in Floating Point Arithmetic (e.g. `0.3 - 0.2 !== 0.1` or\n // `0.5 % 0.1 !== 0`), we need to convert all numbers to integers.\n if (isNonIntegerValue || isNonIntegerStepBase || isNonIntegerStep) {\n var valueDecimals = isNonIntegerValue ? countDecimals(value) : 0;\n var stepBaseDecimals = isNonIntegerStepBase ? countDecimals(stepBase) : 0;\n var stepDecimals = isNonIntegerStep ? countDecimals(step) : 0;\n\n var decimalCount = Math.max(valueDecimals, stepBaseDecimals, stepDecimals);\n var multiplier = Math.pow(10, decimalCount);\n\n value = value * multiplier;\n stepBase = stepBase * multiplier;\n step = step * multiplier;\n\n if (isNonIntegerValue) value = Math.round(value);\n if (isNonIntegerStepBase) stepBase = Math.round(stepBase);\n if (isNonIntegerStep) step = Math.round(step);\n }\n\n return (value - stepBase) % step === 0;\n}\n\nfunction numberInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n badInputChecker(scope, element, attr, ctrl, 'number');\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var parsedMinVal;\n\n if (isDefined(attr.min) || attr.ngMin) {\n var minVal = attr.min || $parse(attr.ngMin)(scope);\n parsedMinVal = parseNumberAttrVal(minVal);\n\n ctrl.$validators.min = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedMinVal) || viewValue >= parsedMinVal;\n };\n\n attr.$observe('min', function(val) {\n if (val !== minVal) {\n parsedMinVal = parseNumberAttrVal(val);\n minVal = val;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n });\n }\n\n if (isDefined(attr.max) || attr.ngMax) {\n var maxVal = attr.max || $parse(attr.ngMax)(scope);\n var parsedMaxVal = parseNumberAttrVal(maxVal);\n\n ctrl.$validators.max = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedMaxVal) || viewValue <= parsedMaxVal;\n };\n\n attr.$observe('max', function(val) {\n if (val !== maxVal) {\n parsedMaxVal = parseNumberAttrVal(val);\n maxVal = val;\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n });\n }\n\n if (isDefined(attr.step) || attr.ngStep) {\n var stepVal = attr.step || $parse(attr.ngStep)(scope);\n var parsedStepVal = parseNumberAttrVal(stepVal);\n\n ctrl.$validators.step = function(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(parsedStepVal) ||\n isValidForStep(viewValue, parsedMinVal || 0, parsedStepVal);\n };\n\n attr.$observe('step', function(val) {\n // TODO(matsko): implement validateLater to reduce number of validations\n if (val !== stepVal) {\n parsedStepVal = parseNumberAttrVal(val);\n stepVal = val;\n ctrl.$validate();\n }\n\n });\n\n }\n}\n\nfunction rangeInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n badInputChecker(scope, element, attr, ctrl, 'range');\n numberFormatterParser(ctrl);\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n\n var supportsRange = ctrl.$$hasNativeValidators && element[0].type === 'range',\n minVal = supportsRange ? 0 : undefined,\n maxVal = supportsRange ? 100 : undefined,\n stepVal = supportsRange ? 1 : undefined,\n validity = element[0].validity,\n hasMinAttr = isDefined(attr.min),\n hasMaxAttr = isDefined(attr.max),\n hasStepAttr = isDefined(attr.step);\n\n var originalRender = ctrl.$render;\n\n ctrl.$render = supportsRange && isDefined(validity.rangeUnderflow) && isDefined(validity.rangeOverflow) ?\n //Browsers that implement range will set these values automatically, but reading the adjusted values after\n //$render would cause the min / max validators to be applied with the wrong value\n function rangeRender() {\n originalRender();\n ctrl.$setViewValue(element.val());\n } :\n originalRender;\n\n if (hasMinAttr) {\n minVal = parseNumberAttrVal(attr.min);\n\n ctrl.$validators.min = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMinValidator() { return true; } :\n // non-support browsers validate the min val\n function minValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(minVal) || viewValue >= minVal;\n };\n\n setInitialValueAndObserver('min', minChange);\n }\n\n if (hasMaxAttr) {\n maxVal = parseNumberAttrVal(attr.max);\n\n ctrl.$validators.max = supportsRange ?\n // Since all browsers set the input to a valid value, we don't need to check validity\n function noopMaxValidator() { return true; } :\n // non-support browsers validate the max val\n function maxValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(maxVal) || viewValue <= maxVal;\n };\n\n setInitialValueAndObserver('max', maxChange);\n }\n\n if (hasStepAttr) {\n stepVal = parseNumberAttrVal(attr.step);\n\n ctrl.$validators.step = supportsRange ?\n function nativeStepValidator() {\n // Currently, only FF implements the spec on step change correctly (i.e. adjusting the\n // input element value to a valid value). It's possible that other browsers set the stepMismatch\n // validity error instead, so we can at least report an error in that case.\n return !validity.stepMismatch;\n } :\n // ngStep doesn't set the setp attr, so the browser doesn't adjust the input value as setting step would\n function stepValidator(modelValue, viewValue) {\n return ctrl.$isEmpty(viewValue) || isUndefined(stepVal) ||\n isValidForStep(viewValue, minVal || 0, stepVal);\n };\n\n setInitialValueAndObserver('step', stepChange);\n }\n\n function setInitialValueAndObserver(htmlAttrName, changeFn) {\n // interpolated attributes set the attribute value only after a digest, but we need the\n // attribute value when the input is first rendered, so that the browser can adjust the\n // input value based on the min/max value\n element.attr(htmlAttrName, attr[htmlAttrName]);\n var oldVal = attr[htmlAttrName];\n attr.$observe(htmlAttrName, function wrappedObserver(val) {\n if (val !== oldVal) {\n oldVal = val;\n changeFn(val);\n }\n });\n }\n\n function minChange(val) {\n minVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the minVal is greater than the element value\n if (minVal > elVal) {\n elVal = minVal;\n element.val(elVal);\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n\n function maxChange(val) {\n maxVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n if (supportsRange) {\n var elVal = element.val();\n // IE11 doesn't set the el val correctly if the maxVal is less than the element value\n if (maxVal < elVal) {\n element.val(maxVal);\n // IE11 and Chrome don't set the value to the minVal when max < min\n elVal = maxVal < minVal ? minVal : maxVal;\n }\n ctrl.$setViewValue(elVal);\n } else {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n }\n }\n\n function stepChange(val) {\n stepVal = parseNumberAttrVal(val);\n // ignore changes before model is initialized\n if (isNumberNaN(ctrl.$modelValue)) {\n return;\n }\n\n // Some browsers don't adjust the input value correctly, but set the stepMismatch error\n if (!supportsRange) {\n // TODO(matsko): implement validateLater to reduce number of validations\n ctrl.$validate();\n } else if (ctrl.$viewValue !== element.val()) {\n ctrl.$setViewValue(element.val());\n }\n }\n}\n\nfunction urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$validators.url = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || URL_REGEXP.test(value);\n };\n}\n\nfunction emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {\n // Note: no badInputChecker here by purpose as `url` is only a validation\n // in browsers, i.e. we can always read out input.value even if it is not valid!\n baseInputType(scope, element, attr, ctrl, $sniffer, $browser);\n stringBasedInputType(ctrl);\n\n ctrl.$validators.email = function(modelValue, viewValue) {\n var value = modelValue || viewValue;\n return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);\n };\n}\n\nfunction radioInputType(scope, element, attr, ctrl) {\n var doTrim = !attr.ngTrim || trim(attr.ngTrim) !== 'false';\n // make the name unique, if not defined\n if (isUndefined(attr.name)) {\n element.attr('name', nextUid());\n }\n\n var listener = function(ev) {\n var value;\n if (element[0].checked) {\n value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n ctrl.$setViewValue(value, ev && ev.type);\n }\n };\n\n element.on('change', listener);\n\n ctrl.$render = function() {\n var value = attr.value;\n if (doTrim) {\n value = trim(value);\n }\n element[0].checked = (value === ctrl.$viewValue);\n };\n\n attr.$observe('value', ctrl.$render);\n}\n\nfunction parseConstantExpr($parse, context, name, expression, fallback) {\n var parseFn;\n if (isDefined(expression)) {\n parseFn = $parse(expression);\n if (!parseFn.constant) {\n throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +\n '`{1}`.', name, expression);\n }\n return parseFn(context);\n }\n return fallback;\n}\n\nfunction checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {\n var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);\n var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);\n\n var listener = function(ev) {\n ctrl.$setViewValue(element[0].checked, ev && ev.type);\n };\n\n element.on('change', listener);\n\n ctrl.$render = function() {\n element[0].checked = ctrl.$viewValue;\n };\n\n // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`\n // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert\n // it to a boolean.\n ctrl.$isEmpty = function(value) {\n return value === false;\n };\n\n ctrl.$formatters.push(function(value) {\n return equals(value, trueValue);\n });\n\n ctrl.$parsers.push(function(value) {\n return value ? trueValue : falseValue;\n });\n}\n\n\n/**\n * @ngdoc directive\n * @name textarea\n * @restrict E\n *\n * @description\n * HTML textarea element control with AngularJS data-binding. The data-binding and validation\n * properties of this element are exactly the same as those of the\n * {@link ng.directive:input input element}.\n *\n * @param {string} ngModel Assignable AngularJS expression to data-bind to.\n * @param {string=} name Property name of the form under which the control is published.\n * @param {string=} required Sets `required` validation error key if the value is not entered.\n * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to\n * the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of\n * `required` when you want to data-bind to the `required` attribute.\n * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than\n * minlength.\n * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than\n * maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any\n * length.\n * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel {@link ngModel.NgModelController#$viewValue $viewValue}\n * does not match a RegExp found by evaluating the AngularJS expression given in the attribute value.\n * If the expression evaluates to a RegExp object, then this is used directly.\n * If the expression evaluates to a string, then it will be converted to a RegExp\n * after wrapping it in `^` and `$` characters. For instance, `\"abc\"` will be converted to\n * `new RegExp('^abc$')`.
      \n * **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to\n * start at the index of the last search's match, thus not taking the whole input value into\n * account.\n * @param {string=} ngChange AngularJS expression to be executed when input changes due to user\n * interaction with the input element.\n * @param {boolean=} [ngTrim=true] If set to false AngularJS will not automatically trim the input.\n *\n * @knownIssue\n *\n * When specifying the `placeholder` attribute of `\n *
      {{ list | json }}
      \n * \n * \n * it(\"should split the text by newlines\", function() {\n * var listInput = element(by.model('list'));\n * var output = element(by.binding('list | json'));\n * listInput.sendKeys('abc\\ndef\\nghi');\n * expect(output.getText()).toContain('[\\n \"abc\",\\n \"def\",\\n \"ghi\"\\n]');\n * });\n * \n * \n *\n */\nvar ngListDirective = function() {\n return {\n restrict: 'A',\n priority: 100,\n require: 'ngModel',\n link: function(scope, element, attr, ctrl) {\n var ngList = attr.ngList || ', ';\n var trimValues = attr.ngTrim !== 'false';\n var separator = trimValues ? trim(ngList) : ngList;\n\n var parse = function(viewValue) {\n // If the viewValue is invalid (say required but empty) it will be `undefined`\n if (isUndefined(viewValue)) return;\n\n var list = [];\n\n if (viewValue) {\n forEach(viewValue.split(separator), function(value) {\n if (value) list.push(trimValues ? trim(value) : value);\n });\n }\n\n return list;\n };\n\n ctrl.$parsers.push(parse);\n ctrl.$formatters.push(function(value) {\n if (isArray(value)) {\n return value.join(ngList);\n }\n\n return undefined;\n });\n\n // Override the standard $isEmpty because an empty array means the input is empty.\n ctrl.$isEmpty = function(value) {\n return !value || !value.length;\n };\n }\n };\n};\n\n/* global VALID_CLASS: true,\n INVALID_CLASS: true,\n PRISTINE_CLASS: true,\n DIRTY_CLASS: true,\n UNTOUCHED_CLASS: true,\n TOUCHED_CLASS: true,\n PENDING_CLASS: true,\n addSetValidityMethod: true,\n setupValidity: true,\n defaultModelOptions: false\n*/\n\n\nvar VALID_CLASS = 'ng-valid',\n INVALID_CLASS = 'ng-invalid',\n PRISTINE_CLASS = 'ng-pristine',\n DIRTY_CLASS = 'ng-dirty',\n UNTOUCHED_CLASS = 'ng-untouched',\n TOUCHED_CLASS = 'ng-touched',\n EMPTY_CLASS = 'ng-empty',\n NOT_EMPTY_CLASS = 'ng-not-empty';\n\nvar ngModelMinErr = minErr('ngModel');\n\n/**\n * @ngdoc type\n * @name ngModel.NgModelController\n * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a\n * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue\n * is set.\n *\n * @property {*} $modelValue The value in the model that the control is bound to.\n *\n * @property {Array.} $parsers Array of functions to execute, as a pipeline, whenever\n * the control updates the ngModelController with a new {@link ngModel.NgModelController#$viewValue\n `$viewValue`} from the DOM, usually via user input.\n See {@link ngModel.NgModelController#$setViewValue `$setViewValue()`} for a detailed lifecycle explanation.\n Note that the `$parsers` are not called when the bound ngModel expression changes programmatically.\n\n The functions are called in array order, each passing\n its return value through to the next. The last return value is forwarded to the\n {@link ngModel.NgModelController#$validators `$validators`} collection.\n\n Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue\n `$viewValue`}.\n\n Returning `undefined` from a parser means a parse error occurred. In that case,\n no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`\n will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}\n is set to `true`. The parse error is stored in `ngModel.$error.parse`.\n\n This simple example shows a parser that would convert text input value to lowercase:\n * ```js\n * function parse(value) {\n * if (value) {\n * return value.toLowerCase();\n * }\n * }\n * ngModelController.$parsers.push(parse);\n * ```\n\n *\n * @property {Array.} $formatters Array of functions to execute, as a pipeline, whenever\n the bound ngModel expression changes programmatically. The `$formatters` are not called when the\n value of the control is changed by user interaction.\n\n Formatters are used to format / convert the {@link ngModel.NgModelController#$modelValue\n `$modelValue`} for display in the control.\n\n The functions are called in reverse array order, each passing the value through to the\n next. The last return value is used as the actual DOM value.\n\n This simple example shows a formatter that would convert the model value to uppercase:\n\n * ```js\n * function format(value) {\n * if (value) {\n * return value.toUpperCase();\n * }\n * }\n * ngModel.$formatters.push(format);\n * ```\n *\n * @property {Object.} $validators A collection of validators that are applied\n * whenever the model value changes. The key value within the object refers to the name of the\n * validator while the function refers to the validation operation. The validation operation is\n * provided with the model value as an argument and must return a true or false value depending\n * on the response of that validation.\n *\n * ```js\n * ngModel.$validators.validCharacters = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n * return /[0-9]+/.test(value) &&\n * /[a-z]+/.test(value) &&\n * /[A-Z]+/.test(value) &&\n * /\\W+/.test(value);\n * };\n * ```\n *\n * @property {Object.} $asyncValidators A collection of validations that are expected to\n * perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided\n * is expected to return a promise when it is run during the model validation process. Once the promise\n * is delivered then the validation status will be set to true when fulfilled and false when rejected.\n * When the asynchronous validators are triggered, each of the validators will run in parallel and the model\n * value will only be updated once all validators have been fulfilled. As long as an asynchronous validator\n * is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators\n * will only run once all synchronous validators have passed.\n *\n * Please note that if $http is used then it is important that the server returns a success HTTP response code\n * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.\n *\n * ```js\n * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {\n * var value = modelValue || viewValue;\n *\n * // Lookup user by username\n * return $http.get('/api/users/' + value).\n * then(function resolved() {\n * //username exists, this means validation fails\n * return $q.reject('exists');\n * }, function rejected() {\n * //username does not exist, therefore this validation passes\n * return true;\n * });\n * };\n * ```\n *\n * @property {Array.} $viewChangeListeners Array of functions to execute whenever\n * a change to {@link ngModel.NgModelController#$viewValue `$viewValue`} has caused a change\n * to {@link ngModel.NgModelController#$modelValue `$modelValue`}.\n * It is called with no arguments, and its return value is ignored.\n * This can be used in place of additional $watches against the model value.\n *\n * @property {Object} $error An object hash with all failing validator ids as keys.\n * @property {Object} $pending An object hash with all pending validator ids as keys.\n *\n * @property {boolean} $untouched True if control has not lost focus yet.\n * @property {boolean} $touched True if control has lost focus.\n * @property {boolean} $pristine True if user has not interacted with the control yet.\n * @property {boolean} $dirty True if user has already interacted with the control.\n * @property {boolean} $valid True if there is no error.\n * @property {boolean} $invalid True if at least one error on the control.\n * @property {string} $name The name attribute of the control.\n *\n * @description\n *\n * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.\n * The controller contains services for data-binding, validation, CSS updates, and value formatting\n * and parsing. It purposefully does not contain any logic which deals with DOM rendering or\n * listening to DOM events.\n * Such DOM related logic should be provided by other directives which make use of\n * `NgModelController` for data-binding to control elements.\n * AngularJS provides this DOM logic for most {@link input `input`} elements.\n * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example\n * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.\n *\n * @example\n * ### Custom Control Example\n * This example shows how to use `NgModelController` with a custom control to achieve\n * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)\n * collaborate together to achieve the desired result.\n *\n * `contenteditable` is an HTML5 attribute, which tells the browser to let the element\n * contents be edited in place by the user.\n *\n * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}\n * module to automatically remove \"bad\" content like inline event listener (e.g. ``).\n * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks\n * that content using the `$sce` service.\n *\n * \n \n [contenteditable] {\n border: 1px solid black;\n background-color: white;\n min-height: 20px;\n }\n\n .ng-invalid {\n border: 1px solid red;\n }\n\n \n \n angular.module('customControl', ['ngSanitize']).\n directive('contenteditable', ['$sce', function($sce) {\n return {\n restrict: 'A', // only activate on element attribute\n require: '?ngModel', // get a hold of NgModelController\n link: function(scope, element, attrs, ngModel) {\n if (!ngModel) return; // do nothing if no ng-model\n\n // Specify how UI should be updated\n ngModel.$render = function() {\n element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));\n };\n\n // Listen for change events to enable binding\n element.on('blur keyup change', function() {\n scope.$evalAsync(read);\n });\n read(); // initialize\n\n // Write data to the model\n function read() {\n var html = element.html();\n // When we clear the content editable the browser leaves a
      behind\n // If strip-br attribute is provided then we strip this out\n if (attrs.stripBr && html === '
      ') {\n html = '';\n }\n ngModel.$setViewValue(html);\n }\n }\n };\n }]);\n
      \n \n
      \n
      Change me!
      \n Required!\n
      \n \n
      \n
      \n \n it('should data-bind and become invalid', function() {\n if (browser.params.browser === 'safari' || browser.params.browser === 'firefox') {\n // SafariDriver can't handle contenteditable\n // and Firefox driver can't clear contenteditables very well\n return;\n }\n var contentEditable = element(by.css('[contenteditable]'));\n var content = 'Change me!';\n\n expect(contentEditable.getText()).toEqual(content);\n\n contentEditable.clear();\n contentEditable.sendKeys(protractor.Key.BACK_SPACE);\n expect(contentEditable.getText()).toEqual('');\n expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);\n });\n \n *
      \n *\n *\n */\nNgModelController.$inject = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$q', '$interpolate'];\nfunction NgModelController($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $q, $interpolate) {\n this.$viewValue = Number.NaN;\n this.$modelValue = Number.NaN;\n this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.\n this.$validators = {};\n this.$asyncValidators = {};\n this.$parsers = [];\n this.$formatters = [];\n this.$viewChangeListeners = [];\n this.$untouched = true;\n this.$touched = false;\n this.$pristine = true;\n this.$dirty = false;\n this.$valid = true;\n this.$invalid = false;\n this.$error = {}; // keep invalid keys here\n this.$$success = {}; // keep valid keys here\n this.$pending = undefined; // keep pending keys here\n this.$name = $interpolate($attr.name || '', false)($scope);\n this.$$parentForm = nullFormCtrl;\n this.$options = defaultModelOptions;\n this.$$updateEvents = '';\n // Attach the correct context to the event handler function for updateOn\n this.$$updateEventHandler = this.$$updateEventHandler.bind(this);\n\n this.$$parsedNgModel = $parse($attr.ngModel);\n this.$$parsedNgModelAssign = this.$$parsedNgModel.assign;\n this.$$ngModelGet = this.$$parsedNgModel;\n this.$$ngModelSet = this.$$parsedNgModelAssign;\n this.$$pendingDebounce = null;\n this.$$parserValid = undefined;\n this.$$parserName = 'parse';\n\n this.$$currentValidationRunId = 0;\n\n this.$$scope = $scope;\n this.$$rootScope = $scope.$root;\n this.$$attr = $attr;\n this.$$element = $element;\n this.$$animate = $animate;\n this.$$timeout = $timeout;\n this.$$parse = $parse;\n this.$$q = $q;\n this.$$exceptionHandler = $exceptionHandler;\n\n setupValidity(this);\n setupModelWatcher(this);\n}\n\nNgModelController.prototype = {\n $$initGetterSetters: function() {\n if (this.$options.getOption('getterSetter')) {\n var invokeModelGetter = this.$$parse(this.$$attr.ngModel + '()'),\n invokeModelSetter = this.$$parse(this.$$attr.ngModel + '($$$p)');\n\n this.$$ngModelGet = function($scope) {\n var modelValue = this.$$parsedNgModel($scope);\n if (isFunction(modelValue)) {\n modelValue = invokeModelGetter($scope);\n }\n return modelValue;\n };\n this.$$ngModelSet = function($scope, newValue) {\n if (isFunction(this.$$parsedNgModel($scope))) {\n invokeModelSetter($scope, {$$$p: newValue});\n } else {\n this.$$parsedNgModelAssign($scope, newValue);\n }\n };\n } else if (!this.$$parsedNgModel.assign) {\n throw ngModelMinErr('nonassign', 'Expression \\'{0}\\' is non-assignable. Element: {1}',\n this.$$attr.ngModel, startingTag(this.$$element));\n }\n },\n\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$render\n *\n * @description\n * Called when the view needs to be updated. It is expected that the user of the ng-model\n * directive will implement this method.\n *\n * The `$render()` method is invoked in the following situations:\n *\n * * `$rollbackViewValue()` is called. If we are rolling back the view value to the last\n * committed value then `$render()` is called to update the input control.\n * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and\n * the `$viewValue` are different from last time.\n *\n * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of\n * `$modelValue` and `$viewValue` are actually different from their previous values. If `$modelValue`\n * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be\n * invoked if you only change a property on the objects.\n */\n $render: noop,\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$isEmpty\n *\n * @description\n * This is called when we need to determine if the value of an input is empty.\n *\n * For instance, the required directive does this to work out if the input has data or not.\n *\n * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.\n *\n * You can override this for input directives whose concept of being empty is different from the\n * default. The `checkboxInputType` directive does this because in its case a value of `false`\n * implies empty.\n *\n * @param {*} value The value of the input to check for emptiness.\n * @returns {boolean} True if `value` is \"empty\".\n */\n $isEmpty: function(value) {\n // eslint-disable-next-line no-self-compare\n return isUndefined(value) || value === '' || value === null || value !== value;\n },\n\n $$updateEmptyClasses: function(value) {\n if (this.$isEmpty(value)) {\n this.$$animate.removeClass(this.$$element, NOT_EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, EMPTY_CLASS);\n } else {\n this.$$animate.removeClass(this.$$element, EMPTY_CLASS);\n this.$$animate.addClass(this.$$element, NOT_EMPTY_CLASS);\n }\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setPristine\n *\n * @description\n * Sets the control to its pristine state.\n *\n * This method can be called to remove the `ng-dirty` class and set the control to its pristine\n * state (`ng-pristine` class). A model is considered to be pristine when the control\n * has not been changed from when first compiled.\n */\n $setPristine: function() {\n this.$dirty = false;\n this.$pristine = true;\n this.$$animate.removeClass(this.$$element, DIRTY_CLASS);\n this.$$animate.addClass(this.$$element, PRISTINE_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setDirty\n *\n * @description\n * Sets the control to its dirty state.\n *\n * This method can be called to remove the `ng-pristine` class and set the control to its dirty\n * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed\n * from when first compiled.\n */\n $setDirty: function() {\n this.$dirty = true;\n this.$pristine = false;\n this.$$animate.removeClass(this.$$element, PRISTINE_CLASS);\n this.$$animate.addClass(this.$$element, DIRTY_CLASS);\n this.$$parentForm.$setDirty();\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setUntouched\n *\n * @description\n * Sets the control to its untouched state.\n *\n * This method can be called to remove the `ng-touched` class and set the control to its\n * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched\n * by default, however this function can be used to restore that state if the model has\n * already been touched by the user.\n */\n $setUntouched: function() {\n this.$touched = false;\n this.$untouched = true;\n this.$$animate.setClass(this.$$element, UNTOUCHED_CLASS, TOUCHED_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setTouched\n *\n * @description\n * Sets the control to its touched state.\n *\n * This method can be called to remove the `ng-untouched` class and set the control to its\n * touched state (`ng-touched` class). A model is considered to be touched when the user has\n * first focused the control element and then shifted focus away from the control (blur event).\n */\n $setTouched: function() {\n this.$touched = true;\n this.$untouched = false;\n this.$$animate.setClass(this.$$element, TOUCHED_CLASS, UNTOUCHED_CLASS);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$rollbackViewValue\n *\n * @description\n * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,\n * which may be caused by a pending debounced event or because the input is waiting for some\n * future event.\n *\n * If you have an input that uses `ng-model-options` to set up debounced updates or updates that\n * depend on special events such as `blur`, there can be a period when the `$viewValue` is out of\n * sync with the ngModel's `$modelValue`.\n *\n * In this case, you can use `$rollbackViewValue()` to manually cancel the debounced / future update\n * and reset the input to the last committed view value.\n *\n * It is also possible that you run into difficulties if you try to update the ngModel's `$modelValue`\n * programmatically before these debounced/future events have resolved/occurred, because AngularJS's\n * dirty checking mechanism is not able to tell whether the model has actually changed or not.\n *\n * The `$rollbackViewValue()` method should be called before programmatically changing the model of an\n * input which may have such events pending. This is important in order to make sure that the\n * input field will be updated with the new model value and any pending operations are cancelled.\n *\n * @example\n * \n * \n * angular.module('cancel-update-example', [])\n *\n * .controller('CancelUpdateController', ['$scope', function($scope) {\n * $scope.model = {value1: '', value2: ''};\n *\n * $scope.setEmpty = function(e, value, rollback) {\n * if (e.keyCode === 27) {\n * e.preventDefault();\n * if (rollback) {\n * $scope.myForm[value].$rollbackViewValue();\n * }\n * $scope.model[value] = '';\n * }\n * };\n * }]);\n * \n * \n *
      \n *

      Both of these inputs are only updated if they are blurred. Hitting escape should\n * empty them. Follow these steps and observe the difference:

      \n *
        \n *
      1. Type something in the input. You will see that the model is not yet updated
      2. \n *
      3. Press the Escape key.\n *
          \n *
        1. In the first example, nothing happens, because the model is already '', and no\n * update is detected. If you blur the input, the model will be set to the current view.\n *
        2. \n *
        3. In the second example, the pending update is cancelled, and the input is set back\n * to the last committed view value (''). Blurring the input does nothing.\n *
        4. \n *
        \n *
      4. \n *
      \n *\n *
      \n *
      \n *

      Without $rollbackViewValue():

      \n * \n * value1: \"{{ model.value1 }}\"\n *
      \n *\n *
      \n *

      With $rollbackViewValue():

      \n * \n * value2: \"{{ model.value2 }}\"\n *
      \n *
      \n *
      \n *
      \n \n div {\n display: table-cell;\n }\n div:nth-child(1) {\n padding-right: 30px;\n }\n\n \n *
      \n */\n $rollbackViewValue: function() {\n this.$$timeout.cancel(this.$$pendingDebounce);\n this.$viewValue = this.$$lastCommittedViewValue;\n this.$render();\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$validate\n *\n * @description\n * Runs each of the registered validators (first synchronous validators and then\n * asynchronous validators).\n * If the validity changes to invalid, the model will be set to `undefined`,\n * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.\n * If the validity changes to valid, it will set the model to the last available valid\n * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.\n */\n $validate: function() {\n\n // ignore $validate before model is initialized\n if (isNumberNaN(this.$modelValue)) {\n return;\n }\n\n var viewValue = this.$$lastCommittedViewValue;\n // Note: we use the $$rawModelValue as $modelValue might have been\n // set to undefined during a view -> model update that found validation\n // errors. We can't parse the view here, since that could change\n // the model although neither viewValue nor the model on the scope changed\n var modelValue = this.$$rawModelValue;\n\n var prevValid = this.$valid;\n var prevModelValue = this.$modelValue;\n\n var allowInvalid = this.$options.getOption('allowInvalid');\n\n var that = this;\n this.$$runValidators(modelValue, viewValue, function(allValid) {\n // If there was no change in validity, don't update the model\n // This prevents changing an invalid modelValue to undefined\n if (!allowInvalid && prevValid !== allValid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n });\n },\n\n $$runValidators: function(modelValue, viewValue, doneCallback) {\n this.$$currentValidationRunId++;\n var localValidationRunId = this.$$currentValidationRunId;\n var that = this;\n\n // check parser error\n if (!processParseErrors()) {\n validationDone(false);\n return;\n }\n if (!processSyncValidators()) {\n validationDone(false);\n return;\n }\n processAsyncValidators();\n\n function processParseErrors() {\n var errorKey = that.$$parserName;\n\n if (isUndefined(that.$$parserValid)) {\n setValidity(errorKey, null);\n } else {\n if (!that.$$parserValid) {\n forEach(that.$validators, function(v, name) {\n setValidity(name, null);\n });\n forEach(that.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n }\n\n // Set the parse error last, to prevent unsetting it, should a $validators key == parserName\n setValidity(errorKey, that.$$parserValid);\n return that.$$parserValid;\n }\n return true;\n }\n\n function processSyncValidators() {\n var syncValidatorsValid = true;\n forEach(that.$validators, function(validator, name) {\n var result = Boolean(validator(modelValue, viewValue));\n syncValidatorsValid = syncValidatorsValid && result;\n setValidity(name, result);\n });\n if (!syncValidatorsValid) {\n forEach(that.$asyncValidators, function(v, name) {\n setValidity(name, null);\n });\n return false;\n }\n return true;\n }\n\n function processAsyncValidators() {\n var validatorPromises = [];\n var allValid = true;\n forEach(that.$asyncValidators, function(validator, name) {\n var promise = validator(modelValue, viewValue);\n if (!isPromiseLike(promise)) {\n throw ngModelMinErr('nopromise',\n 'Expected asynchronous validator to return a promise but got \\'{0}\\' instead.', promise);\n }\n setValidity(name, undefined);\n validatorPromises.push(promise.then(function() {\n setValidity(name, true);\n }, function() {\n allValid = false;\n setValidity(name, false);\n }));\n });\n if (!validatorPromises.length) {\n validationDone(true);\n } else {\n that.$$q.all(validatorPromises).then(function() {\n validationDone(allValid);\n }, noop);\n }\n }\n\n function setValidity(name, isValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n that.$setValidity(name, isValid);\n }\n }\n\n function validationDone(allValid) {\n if (localValidationRunId === that.$$currentValidationRunId) {\n\n doneCallback(allValid);\n }\n }\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$commitViewValue\n *\n * @description\n * Commit a pending update to the `$modelValue`.\n *\n * Updates may be pending by a debounced event or because the input is waiting for a some future\n * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`\n * usually handles calling this in response to input events.\n */\n $commitViewValue: function() {\n var viewValue = this.$viewValue;\n\n this.$$timeout.cancel(this.$$pendingDebounce);\n\n // If the view value has not changed then we should just exit, except in the case where there is\n // a native validator on the element. In this case the validation state may have changed even though\n // the viewValue has stayed empty.\n if (this.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !this.$$hasNativeValidators)) {\n return;\n }\n this.$$updateEmptyClasses(viewValue);\n this.$$lastCommittedViewValue = viewValue;\n\n // change to dirty\n if (this.$pristine) {\n this.$setDirty();\n }\n this.$$parseAndValidate();\n },\n\n $$parseAndValidate: function() {\n var viewValue = this.$$lastCommittedViewValue;\n var modelValue = viewValue;\n var that = this;\n\n this.$$parserValid = isUndefined(modelValue) ? undefined : true;\n\n // Reset any previous parse error\n this.$setValidity(this.$$parserName, null);\n this.$$parserName = 'parse';\n\n if (this.$$parserValid) {\n for (var i = 0; i < this.$parsers.length; i++) {\n modelValue = this.$parsers[i](modelValue);\n if (isUndefined(modelValue)) {\n this.$$parserValid = false;\n break;\n }\n }\n }\n if (isNumberNaN(this.$modelValue)) {\n // this.$modelValue has not been touched yet...\n this.$modelValue = this.$$ngModelGet(this.$$scope);\n }\n var prevModelValue = this.$modelValue;\n var allowInvalid = this.$options.getOption('allowInvalid');\n this.$$rawModelValue = modelValue;\n\n if (allowInvalid) {\n this.$modelValue = modelValue;\n writeToModelIfNeeded();\n }\n\n // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.\n // This can happen if e.g. $setViewValue is called from inside a parser\n this.$$runValidators(modelValue, this.$$lastCommittedViewValue, function(allValid) {\n if (!allowInvalid) {\n // Note: Don't check this.$valid here, as we could have\n // external validators (e.g. calculated on the server),\n // that just call $setValidity and need the model value\n // to calculate their validity.\n that.$modelValue = allValid ? modelValue : undefined;\n writeToModelIfNeeded();\n }\n });\n\n function writeToModelIfNeeded() {\n if (that.$modelValue !== prevModelValue) {\n that.$$writeModelToScope();\n }\n }\n },\n\n $$writeModelToScope: function() {\n this.$$ngModelSet(this.$$scope, this.$modelValue);\n forEach(this.$viewChangeListeners, function(listener) {\n try {\n listener();\n } catch (e) {\n // eslint-disable-next-line no-invalid-this\n this.$$exceptionHandler(e);\n }\n }, this);\n },\n\n /**\n * @ngdoc method\n * @name ngModel.NgModelController#$setViewValue\n *\n * @description\n * Update the view value.\n *\n * This method should be called when a control wants to change the view value; typically,\n * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}\n * directive calls it when the value of the input changes and {@link ng.directive:select select}\n * calls it when an option is selected.\n *\n * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`\n * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged\n * value is sent directly for processing through the `$parsers` pipeline. After this, the `$validators` and\n * `$asyncValidators` are called and the value is applied to `$modelValue`.\n * Finally, the value is set to the **expression** specified in the `ng-model` attribute and\n * all the registered change listeners, in the `$viewChangeListeners` list are called.\n *\n * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`\n * and the `default` trigger is not listed, all those actions will remain pending until one of the\n * `updateOn` events is triggered on the DOM element.\n * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}\n * directive is used with a custom debounce for this particular event.\n * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`\n * is specified, once the timer runs out.\n *\n * When used with standard inputs, the view value will always be a string (which is in some cases\n * parsed into another type, such as a `Date` object for `input[date]`.)\n * However, custom controls might also pass objects to this method. In this case, we should make\n * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not\n * perform a deep watch of objects, it only looks for a change of identity. If you only change\n * the property of the object then ngModel will not realize that the object has changed and\n * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should\n * not change properties of the copy once it has been passed to `$setViewValue`.\n * Otherwise you may cause the model value on the scope to change incorrectly.\n *\n *
      \n * In any case, the value passed to the method should always reflect the current value\n * of the control. For example, if you are calling `$setViewValue` for an input element,\n * you should pass the input DOM value. Otherwise, the control and the scope model become\n * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change\n * the control's DOM value in any way. If we want to change the control's DOM value\n * programmatically, we should update the `ngModel` scope expression. Its new value will be\n * picked up by the model controller, which will run it through the `$formatters`, `$render` it\n * to update the DOM, and finally call `$validate` on it.\n *
      \n *\n * @param {*} value value from the view.\n * @param {string} trigger Event that triggered the update.\n */\n $setViewValue: function(value, trigger) {\n this.$viewValue = value;\n if (this.$options.getOption('updateOnDefault')) {\n this.$$debounceViewValueCommit(trigger);\n }\n },\n\n $$debounceViewValueCommit: function(trigger) {\n var debounceDelay = this.$options.getOption('debounce');\n\n if (isNumber(debounceDelay[trigger])) {\n debounceDelay = debounceDelay[trigger];\n } else if (isNumber(debounceDelay['default']) &&\n this.$options.getOption('updateOn').indexOf(trigger) === -1\n ) {\n debounceDelay = debounceDelay['default'];\n } else if (isNumber(debounceDelay['*'])) {\n debounceDelay = debounceDelay['*'];\n }\n\n this.$$timeout.cancel(this.$$pendingDebounce);\n var that = this;\n if (debounceDelay > 0) { // this fails if debounceDelay is an object\n this.$$pendingDebounce = this.$$timeout(function() {\n that.$commitViewValue();\n }, debounceDelay);\n } else if (this.$$rootScope.$$phase) {\n this.$commitViewValue();\n } else {\n this.$$scope.$apply(function() {\n that.$commitViewValue();\n });\n }\n },\n\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$overrideModelOptions\n *\n * @description\n *\n * Override the current model options settings programmatically.\n *\n * The previous `ModelOptions` value will not be modified. Instead, a\n * new `ModelOptions` object will inherit from the previous one overriding\n * or inheriting settings that are defined in the given parameter.\n *\n * See {@link ngModelOptions} for information about what options can be specified\n * and how model option inheritance works.\n *\n *
      \n * **Note:** this function only affects the options set on the `ngModelController`,\n * and not the options on the {@link ngModelOptions} directive from which they might have been\n * obtained initially.\n *
      \n *\n *
      \n * **Note:** it is not possible to override the `getterSetter` option.\n *
      \n *\n * @param {Object} options a hash of settings to override the previous options\n *\n */\n $overrideModelOptions: function(options) {\n this.$options = this.$options.createChild(options);\n this.$$setUpdateOnEvents();\n },\n\n /**\n * @ngdoc method\n *\n * @name ngModel.NgModelController#$processModelValue\n\n * @description\n *\n * Runs the model -> view pipeline on the current\n * {@link ngModel.NgModelController#$modelValue $modelValue}.\n *\n * The following actions are performed by this method:\n *\n * - the `$modelValue` is run through the {@link ngModel.NgModelController#$formatters $formatters}\n * and the result is set to the {@link ngModel.NgModelController#$viewValue $viewValue}\n * - the `ng-empty` or `ng-not-empty` class is set on the element\n * - if the `$viewValue` has changed:\n * - {@link ngModel.NgModelController#$render $render} is called on the control\n * - the {@link ngModel.NgModelController#$validators $validators} are run and\n * the validation status is set.\n *\n * This method is called by ngModel internally when the bound scope value changes.\n * Application developers usually do not have to call this function themselves.\n *\n * This function can be used when the `$viewValue` or the rendered DOM value are not correctly\n * formatted and the `$modelValue` must be run through the `$formatters` again.\n *\n * @example\n * Consider a text input with an autocomplete list (for fruit), where the items are\n * objects with a name and an id.\n * A user enters `ap` and then selects `Apricot` from the list.\n * Based on this, the autocomplete widget will call `$setViewValue({name: 'Apricot', id: 443})`,\n * but the rendered value will still be `ap`.\n * The widget can then call `ctrl.$processModelValue()` to run the model -> view\n * pipeline again, which formats the object to the string `Apricot`,\n * then updates the `$viewValue`, and finally renders it in the DOM.\n *\n * \n \n
      \n
      \n Search Fruit:\n \n
      \n
      \n Model:
      \n
      {{selectedFruit | json}}
      \n
      \n
      \n
      \n \n angular.module('inputExample', [])\n .controller('inputController', function($scope) {\n $scope.items = [\n {name: 'Apricot', id: 443},\n {name: 'Clementine', id: 972},\n {name: 'Durian', id: 169},\n {name: 'Jackfruit', id: 982},\n {name: 'Strawberry', id: 863}\n ];\n })\n .component('basicAutocomplete', {\n bindings: {\n items: '<',\n onSelect: '&'\n },\n templateUrl: 'autocomplete.html',\n controller: function($element, $scope) {\n var that = this;\n var ngModel;\n\n that.$postLink = function() {\n ngModel = $element.find('input').controller('ngModel');\n\n ngModel.$formatters.push(function(value) {\n return (value && value.name) || value;\n });\n\n ngModel.$parsers.push(function(value) {\n var match = value;\n for (var i = 0; i < that.items.length; i++) {\n if (that.items[i].name === value) {\n match = that.items[i];\n break;\n }\n }\n\n return match;\n });\n };\n\n that.selectItem = function(item) {\n ngModel.$setViewValue(item);\n ngModel.$processModelValue();\n that.onSelect({item: item});\n };\n }\n });\n \n \n
      \n \n
        \n
      • \n \n
      • \n
      \n
      \n
      \n *
      \n *\n */\n $processModelValue: function() {\n var viewValue = this.$$format();\n\n if (this.$viewValue !== viewValue) {\n this.$$updateEmptyClasses(viewValue);\n this.$viewValue = this.$$lastCommittedViewValue = viewValue;\n this.$render();\n // It is possible that model and view value have been updated during render\n this.$$runValidators(this.$modelValue, this.$viewValue, noop);\n }\n },\n\n /**\n * This method is called internally to run the $formatters on the $modelValue\n */\n $$format: function() {\n var formatters = this.$formatters,\n idx = formatters.length;\n\n var viewValue = this.$modelValue;\n while (idx--) {\n viewValue = formatters[idx](viewValue);\n }\n\n return viewValue;\n },\n\n /**\n * This method is called internally when the bound scope value changes.\n */\n $$setModelValue: function(modelValue) {\n this.$modelValue = this.$$rawModelValue = modelValue;\n this.$$parserValid = undefined;\n this.$processModelValue();\n },\n\n $$setUpdateOnEvents: function() {\n if (this.$$updateEvents) {\n this.$$element.off(this.$$updateEvents, this.$$updateEventHandler);\n }\n\n this.$$updateEvents = this.$options.getOption('updateOn');\n if (this.$$updateEvents) {\n this.$$element.on(this.$$updateEvents, this.$$updateEventHandler);\n }\n },\n\n $$updateEventHandler: function(ev) {\n this.$$debounceViewValueCommit(ev && ev.type);\n }\n};\n\nfunction setupModelWatcher(ctrl) {\n // model -> value\n // Note: we cannot use a normal scope.$watch as we want to detect the following:\n // 1. scope value is 'a'\n // 2. user enters 'b'\n // 3. ng-change kicks in and reverts scope value to 'a'\n // -> scope value did not change since the last digest as\n // ng-change executes in apply phase\n // 4. view should be changed back to 'a'\n ctrl.$$scope.$watch(function ngModelWatch(scope) {\n var modelValue = ctrl.$$ngModelGet(scope);\n\n // if scope model value and ngModel value are out of sync\n // This cannot be moved to the action function, because it would not catch the\n // case where the model is changed in the ngChange function or the model setter\n if (modelValue !== ctrl.$modelValue &&\n // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator\n // eslint-disable-next-line no-self-compare\n (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)\n ) {\n ctrl.$$setModelValue(modelValue);\n }\n\n return modelValue;\n });\n}\n\n/**\n * @ngdoc method\n * @name ngModel.NgModelController#$setValidity\n *\n * @description\n * Change the validity state, and notify the form.\n *\n * This method can be called within $parsers/$formatters or a custom validation implementation.\n * However, in most cases it should be sufficient to use the `ngModel.$validators` and\n * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.\n *\n * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned\n * to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`\n * (for unfulfilled `$asyncValidators`), so that it is available for data-binding.\n * The `validationErrorKey` should be in camelCase and will get converted into dash-case\n * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`\n * classes and can be bound to as `{{ someForm.someControl.$error.myError }}`.\n * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),\n * or skipped (null). Pending is used for unfulfilled `$asyncValidators`.\n * Skipped is used by AngularJS when validators do not run because of parse errors and\n * when `$asyncValidators` do not run because any of the `$validators` failed.\n */\naddSetValidityMethod({\n clazz: NgModelController,\n set: function(object, property) {\n object[property] = true;\n },\n unset: function(object, property) {\n delete object[property];\n }\n});\n\n\n/**\n * @ngdoc directive\n * @name ngModel\n * @restrict A\n * @priority 1\n * @param {expression} ngModel assignable {@link guide/expression Expression} to bind to.\n *\n * @description\n * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a\n * property on the scope using {@link ngModel.NgModelController NgModelController},\n * which is created and exposed by this directive.\n *\n * `ngModel` is responsible for:\n *\n * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`\n * require.\n * - Providing validation behavior (i.e. required, number, email, url).\n * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).\n * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`,\n * `ng-untouched`, `ng-empty`, `ng-not-empty`) including animations.\n * - Registering the control with its parent {@link ng.directive:form form}.\n *\n * Note: `ngModel` will try to bind to the property given by evaluating the expression on the\n * current scope. If the property doesn't already exist on this scope, it will be created\n * implicitly and added to the scope.\n *\n * For best practices on using `ngModel`, see:\n *\n * - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)\n *\n * For basic examples, how to use `ngModel`, see:\n *\n * - {@link ng.directive:input input}\n * - {@link input[text] text}\n * - {@link input[checkbox] checkbox}\n * - {@link input[radio] radio}\n * - {@link input[number] number}\n * - {@link input[email] email}\n * - {@link input[url] url}\n * - {@link input[date] date}\n * - {@link input[datetime-local] datetime-local}\n * - {@link input[time] time}\n * - {@link input[month] month}\n * - {@link input[week] week}\n * - {@link ng.directive:select select}\n * - {@link ng.directive:textarea textarea}\n *\n * ## Complex Models (objects or collections)\n *\n * By default, `ngModel` watches the model by reference, not value. This is important to know when\n * binding inputs to models that are objects (e.g. `Date`) or collections (e.g. arrays). If only properties of the\n * object or collection change, `ngModel` will not be notified and so the input will not be re-rendered.\n *\n * The model must be assigned an entirely new object or collection before a re-rendering will occur.\n *\n * Some directives have options that will cause them to use a custom `$watchCollection` on the model expression\n * - for example, `ngOptions` will do so when a `track by` clause is included in the comprehension expression or\n * if the select is given the `multiple` attribute.\n *\n * The `$watchCollection()` method only does a shallow comparison, meaning that changing properties deeper than the\n * first level of the object (or only changing the properties of an item in the collection if it's an array) will still\n * not trigger a re-rendering of the model.\n *\n * ## CSS classes\n * The following CSS classes are added and removed on the associated input/select/textarea element\n * depending on the validity of the model.\n *\n * - `ng-valid`: the model is valid\n * - `ng-invalid`: the model is invalid\n * - `ng-valid-[key]`: for each valid key added by `$setValidity`\n * - `ng-invalid-[key]`: for each invalid key added by `$setValidity`\n * - `ng-pristine`: the control hasn't been interacted with yet\n * - `ng-dirty`: the control has been interacted with\n * - `ng-touched`: the control has been blurred\n * - `ng-untouched`: the control hasn't been blurred\n * - `ng-pending`: any `$asyncValidators` are unfulfilled\n * - `ng-empty`: the view does not contain a value or the value is deemed \"empty\", as defined\n * by the {@link ngModel.NgModelController#$isEmpty} method\n * - `ng-not-empty`: the view contains a non-empty value\n *\n * Keep in mind that ngAnimate can detect each of these classes when added and removed.\n *\n * @animations\n * Animations within models are triggered when any of the associated CSS classes are added and removed\n * on the input element which is attached to the model. These classes include: `.ng-pristine`, `.ng-dirty`,\n * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.\n * The animations that are triggered within ngModel are similar to how they work in ngClass and\n * animations can be hooked into using CSS transitions, keyframes as well as JS animations.\n *\n * The following example shows a simple way to utilize CSS transitions to style an input element\n * that has been rendered as invalid after it has been validated:\n *\n *
      \n * //be sure to include ngAnimate as a module to hook into more\n * //advanced animations\n * .my-input {\n *   transition:0.5s linear all;\n *   background: white;\n * }\n * .my-input.ng-invalid {\n *   background: red;\n *   color:white;\n * }\n * 
      \n *\n * @example\n * ### Basic Usage\n * \n \n \n \n

      \n Update input to see transitions when valid/invalid.\n Integer is a valid value.\n

      \n
      \n \n
      \n
      \n *
      \n *\n * @example\n * ### Binding to a getter/setter\n *\n * Sometimes it's helpful to bind `ngModel` to a getter/setter function. A getter/setter is a\n * function that returns a representation of the model when called with zero arguments, and sets\n * the internal state of a model when called with an argument. It's sometimes useful to use this\n * for models that have an internal representation that's different from what the model exposes\n * to the view.\n *\n *
      \n * **Best Practice:** It's best to keep getters fast because AngularJS is likely to call them more\n * frequently than other parts of your code.\n *
      \n *\n * You use this behavior by adding `ng-model-options=\"{ getterSetter: true }\"` to an element that\n * has `ng-model` attached to it. You can also add `ng-model-options=\"{ getterSetter: true }\"` to\n * a `
      `, which will enable this behavior for all ``s within it. See\n * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.\n *\n * The following example shows how to use `ngModel` with a getter/setter:\n *\n * @example\n * \n \n
      \n \n \n \n
      user.name = 
      \n
      \n
      \n \n angular.module('getterSetterExample', [])\n .controller('ExampleController', ['$scope', function($scope) {\n var _name = 'Brian';\n $scope.user = {\n name: function(newName) {\n // Note that newName can be undefined for two reasons:\n // 1. Because it is called as a getter and thus called with no arguments\n // 2. Because the property should actually be set to undefined. This happens e.g. if the\n // input is invalid\n return arguments.length ? (_name = newName) : _name;\n }\n };\n }]);\n \n *
      \n */\nvar ngModelDirective = ['$rootScope', function($rootScope) {\n return {\n restrict: 'A',\n require: ['ngModel', '^?form', '^?ngModelOptions'],\n controller: NgModelController,\n // Prelink needs to run before any input directive\n // so that we can set the NgModelOptions in NgModelController\n // before anyone else uses it.\n priority: 1,\n compile: function ngModelCompile(element) {\n // Setup initial state of the control\n element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);\n\n return {\n pre: function ngModelPreLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0],\n formCtrl = ctrls[1] || modelCtrl.$$parentForm,\n optionsCtrl = ctrls[2];\n\n if (optionsCtrl) {\n modelCtrl.$options = optionsCtrl.$options;\n }\n\n modelCtrl.$$initGetterSetters();\n\n // notify others, especially parent forms\n formCtrl.$addControl(modelCtrl);\n\n attr.$observe('name', function(newValue) {\n if (modelCtrl.$name !== newValue) {\n modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);\n }\n });\n\n scope.$on('$destroy', function() {\n modelCtrl.$$parentForm.$removeControl(modelCtrl);\n });\n },\n post: function ngModelPostLink(scope, element, attr, ctrls) {\n var modelCtrl = ctrls[0];\n modelCtrl.$$setUpdateOnEvents();\n\n function setTouched() {\n modelCtrl.$setTouched();\n }\n\n element.on('blur', function() {\n if (modelCtrl.$touched) return;\n\n if ($rootScope.$$phase) {\n scope.$evalAsync(setTouched);\n } else {\n scope.$apply(setTouched);\n }\n });\n }\n };\n }\n };\n}];\n\n/* exported defaultModelOptions */\nvar defaultModelOptions;\nvar DEFAULT_REGEXP = /(\\s+|^)default(\\s+|$)/;\n\n/**\n * @ngdoc type\n * @name ModelOptions\n * @description\n * A container for the options set by the {@link ngModelOptions} directive\n */\nfunction ModelOptions(options) {\n this.$$options = options;\n}\n\nModelOptions.prototype = {\n\n /**\n * @ngdoc method\n * @name ModelOptions#getOption\n * @param {string} name the name of the option to retrieve\n * @returns {*} the value of the option\n * @description\n * Returns the value of the given option\n */\n getOption: function(name) {\n return this.$$options[name];\n },\n\n /**\n * @ngdoc method\n * @name ModelOptions#createChild\n * @param {Object} options a hash of options for the new child that will override the parent's options\n * @return {ModelOptions} a new `ModelOptions` object initialized with the given options.\n */\n createChild: function(options) {\n var inheritAll = false;\n\n // make a shallow copy\n options = extend({}, options);\n\n // Inherit options from the parent if specified by the value `\"$inherit\"`\n forEach(options, /** @this */ function(option, key) {\n if (option === '$inherit') {\n if (key === '*') {\n inheritAll = true;\n } else {\n options[key] = this.$$options[key];\n // `updateOn` is special so we must also inherit the `updateOnDefault` option\n if (key === 'updateOn') {\n options.updateOnDefault = this.$$options.updateOnDefault;\n }\n }\n } else {\n if (key === 'updateOn') {\n // If the `updateOn` property contains the `default` event then we have to remove\n // it from the event list and set the `updateOnDefault` flag.\n options.updateOnDefault = false;\n options[key] = trim(option.replace(DEFAULT_REGEXP, function() {\n options.updateOnDefault = true;\n return ' ';\n }));\n }\n }\n }, this);\n\n if (inheritAll) {\n // We have a property of the form: `\"*\": \"$inherit\"`\n delete options['*'];\n defaults(options, this.$$options);\n }\n\n // Finally add in any missing defaults\n defaults(options, defaultModelOptions.$$options);\n\n return new ModelOptions(options);\n }\n};\n\n\ndefaultModelOptions = new ModelOptions({\n updateOn: '',\n updateOnDefault: true,\n debounce: 0,\n getterSetter: false,\n allowInvalid: false,\n timezone: null\n});\n\n\n/**\n * @ngdoc directive\n * @name ngModelOptions\n * @restrict A\n * @priority 10\n *\n * @description\n * This directive allows you to modify the behaviour of {@link ngModel} directives within your\n * application. You can specify an `ngModelOptions` directive on any element. All {@link ngModel}\n * directives will use the options of their nearest `ngModelOptions` ancestor.\n *\n * The `ngModelOptions` settings are found by evaluating the value of the attribute directive as\n * an AngularJS expression. This expression should evaluate to an object, whose properties contain\n * the settings. For example: `
      \n *
      \n * \n *
      \n *
      \n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 0 }\n * ```\n *\n * Notice that the `debounce` setting was not inherited and used the default value instead.\n *\n * You can specify that all undefined settings are automatically inherited from an ancestor by\n * including a property with key of `\"*\"` and value of `\"$inherit\"`.\n *\n * For example given the following fragment of HTML\n *\n *\n * ```html\n *
      \n *
      \n * \n *
      \n *
      \n * ```\n *\n * the `input` element will have the following settings\n *\n * ```js\n * { allowInvalid: true, updateOn: 'default', debounce: 200 }\n * ```\n *\n * Notice that the `debounce` setting now inherits the value from the outer `
      ` element.\n *\n * If you are creating a reusable component then you should be careful when using `\"*\": \"$inherit\"`\n * since you may inadvertently inherit a setting in the future that changes the behavior of your component.\n *\n *\n * ## Triggering and debouncing model updates\n *\n * The `updateOn` and `debounce` properties allow you to specify a custom list of events that will\n * trigger a model update and/or a debouncing delay so that the actual update only takes place when\n * a timer expires; this timer will be reset after another change takes place.\n *\n * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might\n * be different from the value in the actual model. This means that if you update the model you\n * should also invoke {@link ngModel.NgModelController#$rollbackViewValue} on the relevant input field in\n * order to make sure it is synchronized with the model and that any debounced action is canceled.\n *\n * The easiest way to reference the control's {@link ngModel.NgModelController#$rollbackViewValue}\n * method is by making sure the input is placed inside a form that has a `name` attribute. This is\n * important because `form` controllers are published to the related scope under the name in their\n * `name` attribute.\n *\n * Any pending changes will take place immediately when an enclosing form is submitted via the\n * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`\n * to have access to the updated model.\n *\n * ### Overriding immediate updates\n *\n * The following example shows how to override immediate updates. Changes on the inputs within the\n * form will update the model only when the control loses focus (blur event). If `escape` key is\n * pressed while the input field is focused, the value is reset to the value in the current model.\n *\n * \n * \n *
      \n *
      \n *
      \n *
      \n *
      \n *
      user.name = 
      \n *
      \n *
      \n * \n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say', data: '' };\n *\n * $scope.cancel = function(e) {\n * if (e.keyCode === 27) {\n * $scope.userForm.userName.$rollbackViewValue();\n * }\n * };\n * }]);\n * \n * \n * var model = element(by.binding('user.name'));\n * var input = element(by.model('user.name'));\n * var other = element(by.model('user.data'));\n *\n * it('should allow custom events', function() {\n * input.sendKeys(' hello');\n * input.click();\n * expect(model.getText()).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say hello');\n * });\n *\n * it('should $rollbackViewValue when model changes', function() {\n * input.sendKeys(' hello');\n * expect(input.getAttribute('value')).toEqual('say hello');\n * input.sendKeys(protractor.Key.ESCAPE);\n * expect(input.getAttribute('value')).toEqual('say');\n * other.click();\n * expect(model.getText()).toEqual('say');\n * });\n * \n *
      \n *\n * ### Debouncing updates\n *\n * The next example shows how to debounce model changes. Model will be updated only 1 sec after last change.\n * If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.\n *\n * \n * \n *
      \n *
      \n * Name:\n * \n *
      \n *
      \n *
      user.name = 
      \n *
      \n *
      \n * \n * angular.module('optionsExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * $scope.user = { name: 'say' };\n * }]);\n * \n *
      \n *\n * ### Default events, extra triggers, and catch-all debounce values\n *\n * This example shows the relationship between \"default\" update events and\n * additional `updateOn` triggers.\n *\n * `default` events are those that are bound to the control, and when fired, update the `$viewValue`\n * via {@link ngModel.NgModelController#$setViewValue $setViewValue}. Every event that is not listed\n * in `updateOn` is considered a \"default\" event, since different control types have different\n * default events.\n *\n * The control in this example updates by \"default\", \"click\", and \"blur\", with different `debounce`\n * values. You can see that \"click\" doesn't have an individual `debounce` value -\n * therefore it uses the `*` debounce value.\n *\n * There is also a button that calls {@link ngModel.NgModelController#$setViewValue $setViewValue}\n * directly with a \"custom\" event. Since \"custom\" is not defined in the `updateOn` list,\n * it is considered a \"default\" event and will update the\n * control if \"default\" is defined in `updateOn`, and will receive the \"default\" debounce value.\n * Note that this is just to illustrate how custom controls would possibly call `$setViewValue`.\n *\n * You can change the `updateOn` and `debounce` configuration to test different scenarios. This\n * is done with {@link ngModel.NgModelController#$overrideModelOptions $overrideModelOptions}.\n *\n \n \n \n \n \n angular.module('optionsExample', [])\n .component('modelUpdateDemo', {\n templateUrl: 'template.html',\n controller: function() {\n this.name = 'Chinua';\n\n this.options = {\n updateOn: 'default blur click',\n debounce: {\n default: 2000,\n blur: 0,\n '*': 1000\n }\n };\n\n this.updateEvents = function() {\n var eventList = this.options.updateOn.split(' ');\n eventList.push('*');\n var events = {};\n\n for (var i = 0; i < eventList.length; i++) {\n events[eventList[i]] = this.options.debounce[eventList[i]];\n }\n\n this.events = events;\n };\n\n this.updateOptions = function() {\n var options = angular.extend(this.options, {\n updateOn: Object.keys(this.events).join(' ').replace('*', ''),\n debounce: this.events\n });\n\n this.form.input.$overrideModelOptions(options);\n };\n\n // Initialize the event form\n this.updateEvents();\n }\n });\n \n \n
      \n Input: \n
      \n Model: {{$ctrl.name}}\n
      \n \n\n
      \n
      \n updateOn
      \n \n\n \n \n \n \n \n \n \n \n \n
      OptionDebounce value
      {{key}}
      \n\n
      \n \n
      \n
      \n
      \n *\n *\n * ## Model updates and validation\n *\n * The default behaviour in `ngModel` is that the model value is set to `undefined` when the\n * validation determines that the value is invalid. By setting the `allowInvalid` property to true,\n * the model will still be updated even if the value is invalid.\n *\n *\n * ## Connecting to the scope\n *\n * By setting the `getterSetter` property to true you are telling ngModel that the `ngModel` expression\n * on the scope refers to a \"getter/setter\" function rather than the value itself.\n *\n * The following example shows how to bind to getter/setters:\n *\n * \n * \n *
      \n *
      \n * \n *
      \n *
      user.name = 
      \n *
      \n *
      \n * \n * angular.module('getterSetterExample', [])\n * .controller('ExampleController', ['$scope', function($scope) {\n * var _name = 'Brian';\n * $scope.user = {\n * name: function(newName) {\n * return angular.isDefined(newName) ? (_name = newName) : _name;\n * }\n * };\n * }]);\n * \n *
      \n *\n *\n * ## Programmatically changing options\n *\n * The `ngModelOptions` expression is only evaluated once when the directive is linked; it is not\n * watched for changes. However, it is possible to override the options on a single\n * {@link ngModel.NgModelController} instance with\n * {@link ngModel.NgModelController#$overrideModelOptions `NgModelController#$overrideModelOptions()`}.\n * See also the example for\n * {@link ngModelOptions#default-events-extra-triggers-and-catch-all-debounce-values\n * Default events, extra triggers, and catch-all debounce values}.\n *\n *\n * ## Specifying timezones\n *\n * You can specify the timezone that date/time input directives expect by providing its name in the\n * `timezone` property.\n *\n *\n * ## Formatting the value of `time` and `datetime-local`\n *\n * With the options `timeSecondsFormat` and `timeStripZeroSeconds` it is possible to adjust the value\n * that is displayed in the control. Note that browsers may apply their own formatting\n * in the user interface.\n *\n \n \n \n \n \n angular.module('timeExample', [])\n .component('timeExample', {\n templateUrl: 'timeExample.html',\n controller: function() {\n this.time = new Date(1970, 0, 1, 14, 57, 0);\n\n this.options = {\n timeSecondsFormat: 'ss',\n timeStripZeroSeconds: true\n };\n\n this.optionChange = function() {\n this.timeForm.timeFormatted.$overrideModelOptions(this.options);\n this.time = new Date(this.time);\n };\n }\n });\n \n \n
      \n Default:\n
      \n With options:\n \n
      \n\n Options:
      \n timeSecondsFormat:\n \n
      \n timeStripZeroSeconds:\n \n \n
      \n *
      \n *\n * @param {Object} ngModelOptions options to apply to {@link ngModel} directives on this element and\n * and its descendents.\n *\n * **General options**:\n *\n * - `updateOn`: string specifying which event should the input be bound to. You can set several\n * events using an space delimited list. There is a special event called `default` that\n * matches the default events belonging to the control. These are the events that are bound to\n * the control, and when fired, update the `$viewValue` via `$setViewValue`.\n *\n * `ngModelOptions` considers every event that is not listed in `updateOn` a \"default\" event,\n * since different control types use different default events.\n *\n * See also the section {@link ngModelOptions#triggering-and-debouncing-model-updates\n * Triggering and debouncing model updates}.\n *\n * - `debounce`: integer value which contains the debounce model update value in milliseconds. A\n * value of 0 triggers an immediate update. If an object is supplied instead, you can specify a\n * custom value for each event. For example:\n * ```\n * ng-model-options=\"{\n * updateOn: 'default blur',\n * debounce: { 'default': 500, 'blur': 0 }\n * }\"\n * ```\n * You can use the `*` key to specify a debounce value that applies to all events that are not\n * specifically listed. In the following example, `mouseup` would have a debounce delay of 1000:\n * ```\n * ng-model-options=\"{\n * updateOn: 'default blur mouseup',\n * debounce: { 'default': 500, 'blur': 0, '*': 1000 }\n * }\"\n * ```\n * - `allowInvalid`: boolean value which indicates that the model can be set with values that did\n * not validate correctly instead of the default behavior of setting the model to undefined.\n * - `getterSetter`: boolean value which determines whether or not to treat functions bound to\n * `ngModel` as getters/setters.\n *\n *\n * **Input-type specific options**:\n *\n * - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for\n * ``, ``, ... . It understands UTC/GMT and the\n * continental US time zone abbreviations, but for general use, use a time zone offset, for\n * example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)\n * If not specified, the timezone of the browser will be used.\n * Note that changing the timezone will have no effect on the current date, and is only applied after\n * the next input / model change.\n *\n * - `timeSecondsFormat`: Defines if the `time` and `datetime-local` types should show seconds and\n * milliseconds. The option follows the format string of {@link date date filter}.\n * By default, the options is `undefined` which is equal to `'ss.sss'` (seconds and milliseconds).\n * The other options are `'ss'` (strips milliseconds), and `''` (empty string), which strips both\n * seconds and milliseconds.\n * Note that browsers that support `time` and `datetime-local` require the hour and minutes\n * part of the time string, and may show the value differently in the user interface.\n * {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.\n *\n * - `timeStripZeroSeconds`: Defines if the `time` and `datetime-local` types should strip the\n * seconds and milliseconds from the formatted value if they are zero. This option is applied\n * after `timeSecondsFormat`.\n * This option can be used to make the formatting consistent over different browsers, as some\n * browsers with support for `time` will natively hide the milliseconds and\n * seconds if they are zero, but others won't, and browsers that don't implement these input\n * types will always show the full string.\n * {@link ngModelOptions#formatting-the-value-of-time-and-datetime-local- See the example}.\n *\n */\nvar ngModelOptionsDirective = function() {\n NgModelOptionsController.$inject = ['$attrs', '$scope'];\n function NgModelOptionsController($attrs, $scope) {\n this.$$attrs = $attrs;\n this.$$scope = $scope;\n }\n NgModelOptionsController.prototype = {\n $onInit: function() {\n var parentOptions = this.parentCtrl ? this.parentCtrl.$options : defaultModelOptions;\n var modelOptionsDefinition = this.$$scope.$eval(this.$$attrs.ngModelOptions);\n\n this.$options = parentOptions.createChild(modelOptionsDefinition);\n }\n };\n\n return {\n restrict: 'A',\n // ngModelOptions needs to run before ngModel and input directives\n priority: 10,\n require: {parentCtrl: '?^^ngModelOptions'},\n bindToController: true,\n controller: NgModelOptionsController\n };\n};\n\n\n// shallow copy over values from `src` that are not already specified on `dst`\nfunction defaults(dst, src) {\n forEach(src, function(value, key) {\n if (!isDefined(dst[key])) {\n dst[key] = value;\n }\n });\n}\n\n/**\n * @ngdoc directive\n * @name ngNonBindable\n * @restrict AC\n * @priority 1000\n * @element ANY\n *\n * @description\n * The `ngNonBindable` directive tells AngularJS not to compile or bind the contents of the current\n * DOM element, including directives on the element itself that have a lower priority than\n * `ngNonBindable`. This is useful if the element contains what appears to be AngularJS directives\n * and bindings but which should be ignored by AngularJS. This could be the case if you have a site\n * that displays snippets of code, for instance.\n *\n * @example\n * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,\n * but the one wrapped in `ngNonBindable` is left alone.\n *\n \n \n
      Normal: {{1 + 2}}
      \n
      Ignored: {{1 + 2}}
      \n
      \n \n it('should check ng-non-bindable', function() {\n expect(element(by.binding('1 + 2')).getText()).toContain('3');\n expect(element.all(by.css('div')).last().getText()).toMatch(/1 \\+ 2/);\n });\n \n
      \n */\nvar ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });\n\n/* exported ngOptionsDirective */\n\n/* global jqLiteRemove */\n\nvar ngOptionsMinErr = minErr('ngOptions');\n\n/**\n * @ngdoc directive\n * @name ngOptions\n * @restrict A\n *\n * @description\n *\n * The `ngOptions` attribute can be used to dynamically generate a list of ``\n * DOM element.\n * * `disable`: The result of this expression will be used to disable the rendered `