1 line
6.5 MiB
1 line
6.5 MiB
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["quick_punch","quick_punch-header-HeaderViewController"],{2237:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"Z\": () => (/* binding */ components_main_ui_router)\n});\n\n// EXTERNAL MODULE: ./node_modules/vue/dist/vue.esm-bundler.js + 6 modules\nvar vue_esm_bundler = __webpack_require__(5166);\n;// CONCATENATED MODULE: ./node_modules/vue-router/dist/vue-router.esm-bundler.js\n/*!\n * vue-router v4.0.12\n * (c) 2021 Eduardo San Martin Morote\n * @license MIT\n */\n\n\n\nconst hasSymbol = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\r\nconst PolySymbol = (name) => \r\n// vr = vue router\r\nhasSymbol\r\n ? Symbol(( false) ? 0 : name)\r\n : (( false) ? 0 : '_vr_') + name;\r\n// rvlm = Router View Location Matched\r\n/**\r\n * RouteRecord being rendered by the closest ancestor Router View. Used for\r\n * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View\r\n * Location Matched\r\n *\r\n * @internal\r\n */\r\nconst matchedRouteKey = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'rvlm');\r\n/**\r\n * Allows overriding the router view depth to control which component in\r\n * `matched` is rendered. rvd stands for Router View Depth\r\n *\r\n * @internal\r\n */\r\nconst viewDepthKey = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'rvd');\r\n/**\r\n * Allows overriding the router instance returned by `useRouter` in tests. r\r\n * stands for router\r\n *\r\n * @internal\r\n */\r\nconst routerKey = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'r');\r\n/**\r\n * Allows overriding the current route returned by `useRoute` in tests. rl\r\n * stands for route location\r\n *\r\n * @internal\r\n */\r\nconst routeLocationKey = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'rl');\r\n/**\r\n * Allows overriding the current route used by router-view. Internally this is\r\n * used when the `route` prop is passed.\r\n *\r\n * @internal\r\n */\r\nconst routerViewLocationKey = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'rvl');\n\nconst isBrowser = typeof window !== 'undefined';\n\nfunction isESModule(obj) {\r\n return obj.__esModule || (hasSymbol && obj[Symbol.toStringTag] === 'Module');\r\n}\r\nconst vue_router_esm_bundler_assign = Object.assign;\r\nfunction applyToParams(fn, params) {\r\n const newParams = {};\r\n for (const key in params) {\r\n const value = params[key];\r\n newParams[key] = Array.isArray(value) ? value.map(fn) : fn(value);\r\n }\r\n return newParams;\r\n}\r\nconst noop = () => { };\n\nfunction warn(msg) {\r\n // avoid using ...args as it breaks in older Edge builds\r\n const args = Array.from(arguments).slice(1);\r\n console.warn.apply(console, ['[Vue Router warn]: ' + msg].concat(args));\r\n}\n\nconst TRAILING_SLASH_RE = /\\/$/;\r\nconst removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, '');\r\n/**\r\n * Transforms an URI into a normalized history location\r\n *\r\n * @param parseQuery\r\n * @param location - URI to normalize\r\n * @param currentLocation - current absolute location. Allows resolving relative\r\n * paths. Must start with `/`. Defaults to `/`\r\n * @returns a normalized history location\r\n */\r\nfunction parseURL(parseQuery, location, currentLocation = '/') {\r\n let path, query = {}, searchString = '', hash = '';\r\n // Could use URL and URLSearchParams but IE 11 doesn't support it\r\n const searchPos = location.indexOf('?');\r\n const hashPos = location.indexOf('#', searchPos > -1 ? searchPos : 0);\r\n if (searchPos > -1) {\r\n path = location.slice(0, searchPos);\r\n searchString = location.slice(searchPos + 1, hashPos > -1 ? hashPos : location.length);\r\n query = parseQuery(searchString);\r\n }\r\n if (hashPos > -1) {\r\n path = path || location.slice(0, hashPos);\r\n // keep the # character\r\n hash = location.slice(hashPos, location.length);\r\n }\r\n // no search and no query\r\n path = resolveRelativePath(path != null ? path : location, currentLocation);\r\n // empty path means a relative query or hash `?foo=f`, `#thing`\r\n return {\r\n fullPath: path + (searchString && '?') + searchString + hash,\r\n path,\r\n query,\r\n hash,\r\n };\r\n}\r\n/**\r\n * Stringifies a URL object\r\n *\r\n * @param stringifyQuery\r\n * @param location\r\n */\r\nfunction stringifyURL(stringifyQuery, location) {\r\n const query = location.query ? stringifyQuery(location.query) : '';\r\n return location.path + (query && '?') + query + (location.hash || '');\r\n}\r\n/**\r\n * Strips off the base from the beginning of a location.pathname in a non\r\n * case-sensitive way.\r\n *\r\n * @param pathname - location.pathname\r\n * @param base - base to strip off\r\n */\r\nfunction stripBase(pathname, base) {\r\n // no base or base is not found at the beginning\r\n if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase()))\r\n return pathname;\r\n return pathname.slice(base.length) || '/';\r\n}\r\n/**\r\n * Checks if two RouteLocation are equal. This means that both locations are\r\n * pointing towards the same {@link RouteRecord} and that all `params`, `query`\r\n * parameters and `hash` are the same\r\n *\r\n * @param a - first {@link RouteLocation}\r\n * @param b - second {@link RouteLocation}\r\n */\r\nfunction isSameRouteLocation(stringifyQuery, a, b) {\r\n const aLastIndex = a.matched.length - 1;\r\n const bLastIndex = b.matched.length - 1;\r\n return (aLastIndex > -1 &&\r\n aLastIndex === bLastIndex &&\r\n isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) &&\r\n isSameRouteLocationParams(a.params, b.params) &&\r\n stringifyQuery(a.query) === stringifyQuery(b.query) &&\r\n a.hash === b.hash);\r\n}\r\n/**\r\n * Check if two `RouteRecords` are equal. Takes into account aliases: they are\r\n * considered equal to the `RouteRecord` they are aliasing.\r\n *\r\n * @param a - first {@link RouteRecord}\r\n * @param b - second {@link RouteRecord}\r\n */\r\nfunction isSameRouteRecord(a, b) {\r\n // since the original record has an undefined value for aliasOf\r\n // but all aliases point to the original record, this will always compare\r\n // the original record\r\n return (a.aliasOf || a) === (b.aliasOf || b);\r\n}\r\nfunction isSameRouteLocationParams(a, b) {\r\n if (Object.keys(a).length !== Object.keys(b).length)\r\n return false;\r\n for (const key in a) {\r\n if (!isSameRouteLocationParamsValue(a[key], b[key]))\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction isSameRouteLocationParamsValue(a, b) {\r\n return Array.isArray(a)\r\n ? isEquivalentArray(a, b)\r\n : Array.isArray(b)\r\n ? isEquivalentArray(b, a)\r\n : a === b;\r\n}\r\n/**\r\n * Check if two arrays are the same or if an array with one single entry is the\r\n * same as another primitive value. Used to check query and parameters\r\n *\r\n * @param a - array of values\r\n * @param b - array of values or a single value\r\n */\r\nfunction isEquivalentArray(a, b) {\r\n return Array.isArray(b)\r\n ? a.length === b.length && a.every((value, i) => value === b[i])\r\n : a.length === 1 && a[0] === b;\r\n}\r\n/**\r\n * Resolves a relative path that starts with `.`.\r\n *\r\n * @param to - path location we are resolving\r\n * @param from - currentLocation.path, should start with `/`\r\n */\r\nfunction resolveRelativePath(to, from) {\r\n if (to.startsWith('/'))\r\n return to;\r\n if (false) {}\r\n if (!to)\r\n return from;\r\n const fromSegments = from.split('/');\r\n const toSegments = to.split('/');\r\n let position = fromSegments.length - 1;\r\n let toPosition;\r\n let segment;\r\n for (toPosition = 0; toPosition < toSegments.length; toPosition++) {\r\n segment = toSegments[toPosition];\r\n // can't go below zero\r\n if (position === 1 || segment === '.')\r\n continue;\r\n if (segment === '..')\r\n position--;\r\n // found something that is not relative path\r\n else\r\n break;\r\n }\r\n return (fromSegments.slice(0, position).join('/') +\r\n '/' +\r\n toSegments\r\n .slice(toPosition - (toPosition === toSegments.length ? 1 : 0))\r\n .join('/'));\r\n}\n\nvar NavigationType;\r\n(function (NavigationType) {\r\n NavigationType[\"pop\"] = \"pop\";\r\n NavigationType[\"push\"] = \"push\";\r\n})(NavigationType || (NavigationType = {}));\r\nvar NavigationDirection;\r\n(function (NavigationDirection) {\r\n NavigationDirection[\"back\"] = \"back\";\r\n NavigationDirection[\"forward\"] = \"forward\";\r\n NavigationDirection[\"unknown\"] = \"\";\r\n})(NavigationDirection || (NavigationDirection = {}));\r\n/**\r\n * Starting location for Histories\r\n */\r\nconst START = '';\r\n// Generic utils\r\n/**\r\n * Normalizes a base by removing any trailing slash and reading the base tag if\r\n * present.\r\n *\r\n * @param base - base to normalize\r\n */\r\nfunction normalizeBase(base) {\r\n if (!base) {\r\n if (isBrowser) {\r\n // respect <base> tag\r\n const baseEl = document.querySelector('base');\r\n base = (baseEl && baseEl.getAttribute('href')) || '/';\r\n // strip full URL origin\r\n base = base.replace(/^\\w+:\\/\\/[^\\/]+/, '');\r\n }\r\n else {\r\n base = '/';\r\n }\r\n }\r\n // ensure leading slash when it was removed by the regex above avoid leading\r\n // slash with hash because the file could be read from the disk like file://\r\n // and the leading slash would cause problems\r\n if (base[0] !== '/' && base[0] !== '#')\r\n base = '/' + base;\r\n // remove the trailing slash so all other method can just do `base + fullPath`\r\n // to build an href\r\n return removeTrailingSlash(base);\r\n}\r\n// remove any character before the hash\r\nconst BEFORE_HASH_RE = /^[^#]+#/;\r\nfunction createHref(base, location) {\r\n return base.replace(BEFORE_HASH_RE, '#') + location;\r\n}\n\nfunction getElementPosition(el, offset) {\r\n const docRect = document.documentElement.getBoundingClientRect();\r\n const elRect = el.getBoundingClientRect();\r\n return {\r\n behavior: offset.behavior,\r\n left: elRect.left - docRect.left - (offset.left || 0),\r\n top: elRect.top - docRect.top - (offset.top || 0),\r\n };\r\n}\r\nconst computeScrollPosition = () => ({\r\n left: window.pageXOffset,\r\n top: window.pageYOffset,\r\n});\r\nfunction scrollToPosition(position) {\r\n let scrollToOptions;\r\n if ('el' in position) {\r\n const positionEl = position.el;\r\n const isIdSelector = typeof positionEl === 'string' && positionEl.startsWith('#');\r\n /**\r\n * `id`s can accept pretty much any characters, including CSS combinators\r\n * like `>` or `~`. It's still possible to retrieve elements using\r\n * `document.getElementById('~')` but it needs to be escaped when using\r\n * `document.querySelector('#\\\\~')` for it to be valid. The only\r\n * requirements for `id`s are them to be unique on the page and to not be\r\n * empty (`id=\"\"`). Because of that, when passing an id selector, it should\r\n * be properly escaped for it to work with `querySelector`. We could check\r\n * for the id selector to be simple (no CSS combinators `+ >~`) but that\r\n * would make things inconsistent since they are valid characters for an\r\n * `id` but would need to be escaped when using `querySelector`, breaking\r\n * their usage and ending up in no selector returned. Selectors need to be\r\n * escaped:\r\n *\r\n * - `#1-thing` becomes `#\\31 -thing`\r\n * - `#with~symbols` becomes `#with\\\\~symbols`\r\n *\r\n * - More information about the topic can be found at\r\n * https://mathiasbynens.be/notes/html5-id-class.\r\n * - Practical example: https://mathiasbynens.be/demo/html5-id\r\n */\r\n if (false) {}\r\n const el = typeof positionEl === 'string'\r\n ? isIdSelector\r\n ? document.getElementById(positionEl.slice(1))\r\n : document.querySelector(positionEl)\r\n : positionEl;\r\n if (!el) {\r\n ( false) &&\r\n 0;\r\n return;\r\n }\r\n scrollToOptions = getElementPosition(el, position);\r\n }\r\n else {\r\n scrollToOptions = position;\r\n }\r\n if ('scrollBehavior' in document.documentElement.style)\r\n window.scrollTo(scrollToOptions);\r\n else {\r\n window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.pageXOffset, scrollToOptions.top != null ? scrollToOptions.top : window.pageYOffset);\r\n }\r\n}\r\nfunction getScrollKey(path, delta) {\r\n const position = history.state ? history.state.position - delta : -1;\r\n return position + path;\r\n}\r\nconst scrollPositions = new Map();\r\nfunction saveScrollPosition(key, scrollPosition) {\r\n scrollPositions.set(key, scrollPosition);\r\n}\r\nfunction getSavedScrollPosition(key) {\r\n const scroll = scrollPositions.get(key);\r\n // consume it so it's not used again\r\n scrollPositions.delete(key);\r\n return scroll;\r\n}\r\n// TODO: RFC about how to save scroll position\r\n/**\r\n * ScrollBehavior instance used by the router to compute and restore the scroll\r\n * position when navigating.\r\n */\r\n// export interface ScrollHandler<ScrollPositionEntry extends HistoryStateValue, ScrollPosition extends ScrollPositionEntry> {\r\n// // returns a scroll position that can be saved in history\r\n// compute(): ScrollPositionEntry\r\n// // can take an extended ScrollPositionEntry\r\n// scroll(position: ScrollPosition): void\r\n// }\r\n// export const scrollHandler: ScrollHandler<ScrollPosition> = {\r\n// compute: computeScroll,\r\n// scroll: scrollToPosition,\r\n// }\n\nlet createBaseLocation = () => location.protocol + '//' + location.host;\r\n/**\r\n * Creates a normalized history location from a window.location object\r\n * @param location -\r\n */\r\nfunction createCurrentLocation(base, location) {\r\n const { pathname, search, hash } = location;\r\n // allows hash bases like #, /#, #/, #!, #!/, /#!/, or even /folder#end\r\n const hashPos = base.indexOf('#');\r\n if (hashPos > -1) {\r\n let slicePos = hash.includes(base.slice(hashPos))\r\n ? base.slice(hashPos).length\r\n : 1;\r\n let pathFromHash = hash.slice(slicePos);\r\n // prepend the starting slash to hash so the url starts with /#\r\n if (pathFromHash[0] !== '/')\r\n pathFromHash = '/' + pathFromHash;\r\n return stripBase(pathFromHash, '');\r\n }\r\n const path = stripBase(pathname, base);\r\n return path + search + hash;\r\n}\r\nfunction useHistoryListeners(base, historyState, currentLocation, replace) {\r\n let listeners = [];\r\n let teardowns = [];\r\n // TODO: should it be a stack? a Dict. Check if the popstate listener\r\n // can trigger twice\r\n let pauseState = null;\r\n const popStateHandler = ({ state, }) => {\r\n const to = createCurrentLocation(base, location);\r\n const from = currentLocation.value;\r\n const fromState = historyState.value;\r\n let delta = 0;\r\n if (state) {\r\n currentLocation.value = to;\r\n historyState.value = state;\r\n // ignore the popstate and reset the pauseState\r\n if (pauseState && pauseState === from) {\r\n pauseState = null;\r\n return;\r\n }\r\n delta = fromState ? state.position - fromState.position : 0;\r\n }\r\n else {\r\n replace(to);\r\n }\r\n // console.log({ deltaFromCurrent })\r\n // Here we could also revert the navigation by calling history.go(-delta)\r\n // this listener will have to be adapted to not trigger again and to wait for the url\r\n // to be updated before triggering the listeners. Some kind of validation function would also\r\n // need to be passed to the listeners so the navigation can be accepted\r\n // call all listeners\r\n listeners.forEach(listener => {\r\n listener(currentLocation.value, from, {\r\n delta,\r\n type: NavigationType.pop,\r\n direction: delta\r\n ? delta > 0\r\n ? NavigationDirection.forward\r\n : NavigationDirection.back\r\n : NavigationDirection.unknown,\r\n });\r\n });\r\n };\r\n function pauseListeners() {\r\n pauseState = currentLocation.value;\r\n }\r\n function listen(callback) {\r\n // setup the listener and prepare teardown callbacks\r\n listeners.push(callback);\r\n const teardown = () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n teardowns.push(teardown);\r\n return teardown;\r\n }\r\n function beforeUnloadListener() {\r\n const { history } = window;\r\n if (!history.state)\r\n return;\r\n history.replaceState(vue_router_esm_bundler_assign({}, history.state, { scroll: computeScrollPosition() }), '');\r\n }\r\n function destroy() {\r\n for (const teardown of teardowns)\r\n teardown();\r\n teardowns = [];\r\n window.removeEventListener('popstate', popStateHandler);\r\n window.removeEventListener('beforeunload', beforeUnloadListener);\r\n }\r\n // setup the listeners and prepare teardown callbacks\r\n window.addEventListener('popstate', popStateHandler);\r\n window.addEventListener('beforeunload', beforeUnloadListener);\r\n return {\r\n pauseListeners,\r\n listen,\r\n destroy,\r\n };\r\n}\r\n/**\r\n * Creates a state object\r\n */\r\nfunction buildState(back, current, forward, replaced = false, computeScroll = false) {\r\n return {\r\n back,\r\n current,\r\n forward,\r\n replaced,\r\n position: window.history.length,\r\n scroll: computeScroll ? computeScrollPosition() : null,\r\n };\r\n}\r\nfunction useHistoryStateNavigation(base) {\r\n const { history, location } = window;\r\n // private variables\r\n const currentLocation = {\r\n value: createCurrentLocation(base, location),\r\n };\r\n const historyState = { value: history.state };\r\n // build current history entry as this is a fresh navigation\r\n if (!historyState.value) {\r\n changeLocation(currentLocation.value, {\r\n back: null,\r\n current: currentLocation.value,\r\n forward: null,\r\n // the length is off by one, we need to decrease it\r\n position: history.length - 1,\r\n replaced: true,\r\n // don't add a scroll as the user may have an anchor and we want\r\n // scrollBehavior to be triggered without a saved position\r\n scroll: null,\r\n }, true);\r\n }\r\n function changeLocation(to, state, replace) {\r\n /**\r\n * if a base tag is provided and we are on a normal domain, we have to\r\n * respect the provided `base` attribute because pushState() will use it and\r\n * potentially erase anything before the `#` like at\r\n * https://github.com/vuejs/vue-router-next/issues/685 where a base of\r\n * `/folder/#` but a base of `/` would erase the `/folder/` section. If\r\n * there is no host, the `<base>` tag makes no sense and if there isn't a\r\n * base tag we can just use everything after the `#`.\r\n */\r\n const hashIndex = base.indexOf('#');\r\n const url = hashIndex > -1\r\n ? (location.host && document.querySelector('base')\r\n ? base\r\n : base.slice(hashIndex)) + to\r\n : createBaseLocation() + base + to;\r\n try {\r\n // BROWSER QUIRK\r\n // NOTE: Safari throws a SecurityError when calling this function 100 times in 30 seconds\r\n history[replace ? 'replaceState' : 'pushState'](state, '', url);\r\n historyState.value = state;\r\n }\r\n catch (err) {\r\n if ((false)) {}\r\n else {\r\n console.error(err);\r\n }\r\n // Force the navigation, this also resets the call count\r\n location[replace ? 'replace' : 'assign'](url);\r\n }\r\n }\r\n function replace(to, data) {\r\n const state = vue_router_esm_bundler_assign({}, history.state, buildState(historyState.value.back, \r\n // keep back and forward entries but override current position\r\n to, historyState.value.forward, true), data, { position: historyState.value.position });\r\n changeLocation(to, state, true);\r\n currentLocation.value = to;\r\n }\r\n function push(to, data) {\r\n // Add to current entry the information of where we are going\r\n // as well as saving the current position\r\n const currentState = vue_router_esm_bundler_assign({}, \r\n // use current history state to gracefully handle a wrong call to\r\n // history.replaceState\r\n // https://github.com/vuejs/vue-router-next/issues/366\r\n historyState.value, history.state, {\r\n forward: to,\r\n scroll: computeScrollPosition(),\r\n });\r\n if (false) {}\r\n changeLocation(currentState.current, currentState, true);\r\n const state = vue_router_esm_bundler_assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data);\r\n changeLocation(to, state, false);\r\n currentLocation.value = to;\r\n }\r\n return {\r\n location: currentLocation,\r\n state: historyState,\r\n push,\r\n replace,\r\n };\r\n}\r\n/**\r\n * Creates an HTML5 history. Most common history for single page applications.\r\n *\r\n * @param base -\r\n */\r\nfunction createWebHistory(base) {\r\n base = normalizeBase(base);\r\n const historyNavigation = useHistoryStateNavigation(base);\r\n const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);\r\n function go(delta, triggerListeners = true) {\r\n if (!triggerListeners)\r\n historyListeners.pauseListeners();\r\n history.go(delta);\r\n }\r\n const routerHistory = vue_router_esm_bundler_assign({\r\n // it's overridden right after\r\n location: '',\r\n base,\r\n go,\r\n createHref: createHref.bind(null, base),\r\n }, historyNavigation, historyListeners);\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => historyNavigation.location.value,\r\n });\r\n Object.defineProperty(routerHistory, 'state', {\r\n enumerable: true,\r\n get: () => historyNavigation.state.value,\r\n });\r\n return routerHistory;\r\n}\n\n/**\r\n * Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.\r\n * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.\r\n *\r\n * @param base - Base applied to all urls, defaults to '/'\r\n * @returns a history object that can be passed to the router constructor\r\n */\r\nfunction createMemoryHistory(base = '') {\r\n let listeners = [];\r\n let queue = [START];\r\n let position = 0;\r\n base = normalizeBase(base);\r\n function setLocation(location) {\r\n position++;\r\n if (position === queue.length) {\r\n // we are at the end, we can simply append a new entry\r\n queue.push(location);\r\n }\r\n else {\r\n // we are in the middle, we remove everything from here in the queue\r\n queue.splice(position);\r\n queue.push(location);\r\n }\r\n }\r\n function triggerListeners(to, from, { direction, delta }) {\r\n const info = {\r\n direction,\r\n delta,\r\n type: NavigationType.pop,\r\n };\r\n for (const callback of listeners) {\r\n callback(to, from, info);\r\n }\r\n }\r\n const routerHistory = {\r\n // rewritten by Object.defineProperty\r\n location: START,\r\n // TODO: should be kept in queue\r\n state: {},\r\n base,\r\n createHref: createHref.bind(null, base),\r\n replace(to) {\r\n // remove current entry and decrement position\r\n queue.splice(position--, 1);\r\n setLocation(to);\r\n },\r\n push(to, data) {\r\n setLocation(to);\r\n },\r\n listen(callback) {\r\n listeners.push(callback);\r\n return () => {\r\n const index = listeners.indexOf(callback);\r\n if (index > -1)\r\n listeners.splice(index, 1);\r\n };\r\n },\r\n destroy() {\r\n listeners = [];\r\n queue = [START];\r\n position = 0;\r\n },\r\n go(delta, shouldTrigger = true) {\r\n const from = this.location;\r\n const direction = \r\n // we are considering delta === 0 going forward, but in abstract mode\r\n // using 0 for the delta doesn't make sense like it does in html5 where\r\n // it reloads the page\r\n delta < 0 ? NavigationDirection.back : NavigationDirection.forward;\r\n position = Math.max(0, Math.min(position + delta, queue.length - 1));\r\n if (shouldTrigger) {\r\n triggerListeners(this.location, from, {\r\n direction,\r\n delta,\r\n });\r\n }\r\n },\r\n };\r\n Object.defineProperty(routerHistory, 'location', {\r\n enumerable: true,\r\n get: () => queue[position],\r\n });\r\n return routerHistory;\r\n}\n\n/**\r\n * Creates a hash history. Useful for web applications with no host (e.g.\r\n * `file://`) or when configuring a server to handle any URL is not possible.\r\n *\r\n * @param base - optional base to provide. Defaults to `location.pathname +\r\n * location.search` If there is a `<base>` tag in the `head`, its value will be\r\n * ignored in favor of this parameter **but note it affects all the\r\n * history.pushState() calls**, meaning that if you use a `<base>` tag, it's\r\n * `href` value **has to match this parameter** (ignoring anything after the\r\n * `#`).\r\n *\r\n * @example\r\n * ```js\r\n * // at https://example.com/folder\r\n * createWebHashHistory() // gives a url of `https://example.com/folder#`\r\n * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`\r\n * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`\r\n * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`\r\n * // you should avoid doing this because it changes the original url and breaks copying urls\r\n * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`\r\n *\r\n * // at file:///usr/etc/folder/index.html\r\n * // for locations with no `host`, the base is ignored\r\n * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`\r\n * ```\r\n */\r\nfunction createWebHashHistory(base) {\r\n // Make sure this implementation is fine in terms of encoding, specially for IE11\r\n // for `file://`, directly use the pathname and ignore the base\r\n // location.pathname contains an initial `/` even at the root: `https://example.com`\r\n base = location.host ? base || location.pathname + location.search : '';\r\n // allow the user to provide a `#` in the middle: `/base/#/app`\r\n if (!base.includes('#'))\r\n base += '#';\r\n if (false) {}\r\n return createWebHistory(base);\r\n}\n\nfunction isRouteLocation(route) {\r\n return typeof route === 'string' || (route && typeof route === 'object');\r\n}\r\nfunction isRouteName(name) {\r\n return typeof name === 'string' || typeof name === 'symbol';\r\n}\n\n/**\r\n * Initial route location where the router is. Can be used in navigation guards\r\n * to differentiate the initial navigation.\r\n *\r\n * @example\r\n * ```js\r\n * import { START_LOCATION } from 'vue-router'\r\n *\r\n * router.beforeEach((to, from) => {\r\n * if (from === START_LOCATION) {\r\n * // initial navigation\r\n * }\r\n * })\r\n * ```\r\n */\r\nconst START_LOCATION_NORMALIZED = {\r\n path: '/',\r\n name: undefined,\r\n params: {},\r\n query: {},\r\n hash: '',\r\n fullPath: '/',\r\n matched: [],\r\n meta: {},\r\n redirectedFrom: undefined,\r\n};\n\nconst NavigationFailureSymbol = /*#__PURE__*/ PolySymbol(( false) ? 0 : 'nf');\r\n/**\r\n * Enumeration with all possible types for navigation failures. Can be passed to\r\n * {@link isNavigationFailure} to check for specific failures.\r\n */\r\nvar NavigationFailureType;\r\n(function (NavigationFailureType) {\r\n /**\r\n * An aborted navigation is a navigation that failed because a navigation\r\n * guard returned `false` or called `next(false)`\r\n */\r\n NavigationFailureType[NavigationFailureType[\"aborted\"] = 4] = \"aborted\";\r\n /**\r\n * A cancelled navigation is a navigation that failed because a more recent\r\n * navigation finished started (not necessarily finished).\r\n */\r\n NavigationFailureType[NavigationFailureType[\"cancelled\"] = 8] = \"cancelled\";\r\n /**\r\n * A duplicated navigation is a navigation that failed because it was\r\n * initiated while already being at the exact same location.\r\n */\r\n NavigationFailureType[NavigationFailureType[\"duplicated\"] = 16] = \"duplicated\";\r\n})(NavigationFailureType || (NavigationFailureType = {}));\r\n// DEV only debug messages\r\nconst ErrorTypeMessages = {\r\n [1 /* MATCHER_NOT_FOUND */]({ location, currentLocation }) {\r\n return `No match for\\n ${JSON.stringify(location)}${currentLocation\r\n ? '\\nwhile being at\\n' + JSON.stringify(currentLocation)\r\n : ''}`;\r\n },\r\n [2 /* NAVIGATION_GUARD_REDIRECT */]({ from, to, }) {\r\n return `Redirected from \"${from.fullPath}\" to \"${stringifyRoute(to)}\" via a navigation guard.`;\r\n },\r\n [4 /* NAVIGATION_ABORTED */]({ from, to }) {\r\n return `Navigation aborted from \"${from.fullPath}\" to \"${to.fullPath}\" via a navigation guard.`;\r\n },\r\n [8 /* NAVIGATION_CANCELLED */]({ from, to }) {\r\n return `Navigation cancelled from \"${from.fullPath}\" to \"${to.fullPath}\" with a new navigation.`;\r\n },\r\n [16 /* NAVIGATION_DUPLICATED */]({ from, to }) {\r\n return `Avoided redundant navigation to current location: \"${from.fullPath}\".`;\r\n },\r\n};\r\nfunction createRouterError(type, params) {\r\n // keep full error messages in cjs versions\r\n if (false) {}\r\n else {\r\n return vue_router_esm_bundler_assign(new Error(), {\r\n type,\r\n [NavigationFailureSymbol]: true,\r\n }, params);\r\n }\r\n}\r\nfunction isNavigationFailure(error, type) {\r\n return (error instanceof Error &&\r\n NavigationFailureSymbol in error &&\r\n (type == null || !!(error.type & type)));\r\n}\r\nconst propertiesToLog = ['params', 'query', 'hash'];\r\nfunction stringifyRoute(to) {\r\n if (typeof to === 'string')\r\n return to;\r\n if ('path' in to)\r\n return to.path;\r\n const location = {};\r\n for (const key of propertiesToLog) {\r\n if (key in to)\r\n location[key] = to[key];\r\n }\r\n return JSON.stringify(location, null, 2);\r\n}\n\n// default pattern for a param: non greedy everything but /\r\nconst BASE_PARAM_PATTERN = '[^/]+?';\r\nconst BASE_PATH_PARSER_OPTIONS = {\r\n sensitive: false,\r\n strict: false,\r\n start: true,\r\n end: true,\r\n};\r\n// Special Regex characters that must be escaped in static tokens\r\nconst REGEX_CHARS_RE = /[.+*?^${}()[\\]/\\\\]/g;\r\n/**\r\n * Creates a path parser from an array of Segments (a segment is an array of Tokens)\r\n *\r\n * @param segments - array of segments returned by tokenizePath\r\n * @param extraOptions - optional options for the regexp\r\n * @returns a PathParser\r\n */\r\nfunction tokensToParser(segments, extraOptions) {\r\n const options = vue_router_esm_bundler_assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);\r\n // the amount of scores is the same as the length of segments except for the root segment \"/\"\r\n const score = [];\r\n // the regexp as a string\r\n let pattern = options.start ? '^' : '';\r\n // extracted keys\r\n const keys = [];\r\n for (const segment of segments) {\r\n // the root segment needs special treatment\r\n const segmentScores = segment.length ? [] : [90 /* Root */];\r\n // allow trailing slash\r\n if (options.strict && !segment.length)\r\n pattern += '/';\r\n for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {\r\n const token = segment[tokenIndex];\r\n // resets the score if we are inside a sub segment /:a-other-:b\r\n let subSegmentScore = 40 /* Segment */ +\r\n (options.sensitive ? 0.25 /* BonusCaseSensitive */ : 0);\r\n if (token.type === 0 /* Static */) {\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n pattern += '/';\r\n pattern += token.value.replace(REGEX_CHARS_RE, '\\\\$&');\r\n subSegmentScore += 40 /* Static */;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional, regexp } = token;\r\n keys.push({\r\n name: value,\r\n repeatable,\r\n optional,\r\n });\r\n const re = regexp ? regexp : BASE_PARAM_PATTERN;\r\n // the user provided a custom regexp /:id(\\\\d+)\r\n if (re !== BASE_PARAM_PATTERN) {\r\n subSegmentScore += 10 /* BonusCustomRegExp */;\r\n // make sure the regexp is valid before using it\r\n try {\r\n new RegExp(`(${re})`);\r\n }\r\n catch (err) {\r\n throw new Error(`Invalid custom RegExp for param \"${value}\" (${re}): ` +\r\n err.message);\r\n }\r\n }\r\n // when we repeat we must take care of the repeating leading slash\r\n let subPattern = repeatable ? `((?:${re})(?:/(?:${re}))*)` : `(${re})`;\r\n // prepend the slash if we are starting a new segment\r\n if (!tokenIndex)\r\n subPattern =\r\n // avoid an optional / if there are more segments e.g. /:p?-static\r\n // or /:p?-:p2\r\n optional && segment.length < 2\r\n ? `(?:/${subPattern})`\r\n : '/' + subPattern;\r\n if (optional)\r\n subPattern += '?';\r\n pattern += subPattern;\r\n subSegmentScore += 20 /* Dynamic */;\r\n if (optional)\r\n subSegmentScore += -8 /* BonusOptional */;\r\n if (repeatable)\r\n subSegmentScore += -20 /* BonusRepeatable */;\r\n if (re === '.*')\r\n subSegmentScore += -50 /* BonusWildcard */;\r\n }\r\n segmentScores.push(subSegmentScore);\r\n }\r\n // an empty array like /home/ -> [[{home}], []]\r\n // if (!segment.length) pattern += '/'\r\n score.push(segmentScores);\r\n }\r\n // only apply the strict bonus to the last score\r\n if (options.strict && options.end) {\r\n const i = score.length - 1;\r\n score[i][score[i].length - 1] += 0.7000000000000001 /* BonusStrict */;\r\n }\r\n // TODO: dev only warn double trailing slash\r\n if (!options.strict)\r\n pattern += '/?';\r\n if (options.end)\r\n pattern += '$';\r\n // allow paths like /dynamic to only match dynamic or dynamic/... but not dynamic_something_else\r\n else if (options.strict)\r\n pattern += '(?:/|$)';\r\n const re = new RegExp(pattern, options.sensitive ? '' : 'i');\r\n function parse(path) {\r\n const match = path.match(re);\r\n const params = {};\r\n if (!match)\r\n return null;\r\n for (let i = 1; i < match.length; i++) {\r\n const value = match[i] || '';\r\n const key = keys[i - 1];\r\n params[key.name] = value && key.repeatable ? value.split('/') : value;\r\n }\r\n return params;\r\n }\r\n function stringify(params) {\r\n let path = '';\r\n // for optional parameters to allow to be empty\r\n let avoidDuplicatedSlash = false;\r\n for (const segment of segments) {\r\n if (!avoidDuplicatedSlash || !path.endsWith('/'))\r\n path += '/';\r\n avoidDuplicatedSlash = false;\r\n for (const token of segment) {\r\n if (token.type === 0 /* Static */) {\r\n path += token.value;\r\n }\r\n else if (token.type === 1 /* Param */) {\r\n const { value, repeatable, optional } = token;\r\n const param = value in params ? params[value] : '';\r\n if (Array.isArray(param) && !repeatable)\r\n throw new Error(`Provided param \"${value}\" is an array but it is not repeatable (* or + modifiers)`);\r\n const text = Array.isArray(param) ? param.join('/') : param;\r\n if (!text) {\r\n if (optional) {\r\n // if we have more than one optional param like /:a?-static we\r\n // don't need to care about the optional param\r\n if (segment.length < 2) {\r\n // remove the last slash as we could be at the end\r\n if (path.endsWith('/'))\r\n path = path.slice(0, -1);\r\n // do not append a slash on the next iteration\r\n else\r\n avoidDuplicatedSlash = true;\r\n }\r\n }\r\n else\r\n throw new Error(`Missing required param \"${value}\"`);\r\n }\r\n path += text;\r\n }\r\n }\r\n }\r\n return path;\r\n }\r\n return {\r\n re,\r\n score,\r\n keys,\r\n parse,\r\n stringify,\r\n };\r\n}\r\n/**\r\n * Compares an array of numbers as used in PathParser.score and returns a\r\n * number. This function can be used to `sort` an array\r\n *\r\n * @param a - first array of numbers\r\n * @param b - second array of numbers\r\n * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b\r\n * should be sorted first\r\n */\r\nfunction compareScoreArray(a, b) {\r\n let i = 0;\r\n while (i < a.length && i < b.length) {\r\n const diff = b[i] - a[i];\r\n // only keep going if diff === 0\r\n if (diff)\r\n return diff;\r\n i++;\r\n }\r\n // if the last subsegment was Static, the shorter segments should be sorted first\r\n // otherwise sort the longest segment first\r\n if (a.length < b.length) {\r\n return a.length === 1 && a[0] === 40 /* Static */ + 40 /* Segment */\r\n ? -1\r\n : 1;\r\n }\r\n else if (a.length > b.length) {\r\n return b.length === 1 && b[0] === 40 /* Static */ + 40 /* Segment */\r\n ? 1\r\n : -1;\r\n }\r\n return 0;\r\n}\r\n/**\r\n * Compare function that can be used with `sort` to sort an array of PathParser\r\n *\r\n * @param a - first PathParser\r\n * @param b - second PathParser\r\n * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b\r\n */\r\nfunction comparePathParserScore(a, b) {\r\n let i = 0;\r\n const aScore = a.score;\r\n const bScore = b.score;\r\n while (i < aScore.length && i < bScore.length) {\r\n const comp = compareScoreArray(aScore[i], bScore[i]);\r\n // do not return if both are equal\r\n if (comp)\r\n return comp;\r\n i++;\r\n }\r\n // if a and b share the same score entries but b has more, sort b first\r\n return bScore.length - aScore.length;\r\n // this is the ternary version\r\n // return aScore.length < bScore.length\r\n // ? 1\r\n // : aScore.length > bScore.length\r\n // ? -1\r\n // : 0\r\n}\n\nconst ROOT_TOKEN = {\r\n type: 0 /* Static */,\r\n value: '',\r\n};\r\nconst VALID_PARAM_RE = /[a-zA-Z0-9_]/;\r\n// After some profiling, the cache seems to be unnecessary because tokenizePath\r\n// (the slowest part of adding a route) is very fast\r\n// const tokenCache = new Map<string, Token[][]>()\r\nfunction tokenizePath(path) {\r\n if (!path)\r\n return [[]];\r\n if (path === '/')\r\n return [[ROOT_TOKEN]];\r\n if (!path.startsWith('/')) {\r\n throw new Error(( false)\r\n ? 0\r\n : `Invalid path \"${path}\"`);\r\n }\r\n // if (tokenCache.has(path)) return tokenCache.get(path)!\r\n function crash(message) {\r\n throw new Error(`ERR (${state})/\"${buffer}\": ${message}`);\r\n }\r\n let state = 0 /* Static */;\r\n let previousState = state;\r\n const tokens = [];\r\n // the segment will always be valid because we get into the initial state\r\n // with the leading /\r\n let segment;\r\n function finalizeSegment() {\r\n if (segment)\r\n tokens.push(segment);\r\n segment = [];\r\n }\r\n // index on the path\r\n let i = 0;\r\n // char at index\r\n let char;\r\n // buffer of the value read\r\n let buffer = '';\r\n // custom regexp for a param\r\n let customRe = '';\r\n function consumeBuffer() {\r\n if (!buffer)\r\n return;\r\n if (state === 0 /* Static */) {\r\n segment.push({\r\n type: 0 /* Static */,\r\n value: buffer,\r\n });\r\n }\r\n else if (state === 1 /* Param */ ||\r\n state === 2 /* ParamRegExp */ ||\r\n state === 3 /* ParamRegExpEnd */) {\r\n if (segment.length > 1 && (char === '*' || char === '+'))\r\n crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);\r\n segment.push({\r\n type: 1 /* Param */,\r\n value: buffer,\r\n regexp: customRe,\r\n repeatable: char === '*' || char === '+',\r\n optional: char === '*' || char === '?',\r\n });\r\n }\r\n else {\r\n crash('Invalid state to consume buffer');\r\n }\r\n buffer = '';\r\n }\r\n function addCharToBuffer() {\r\n buffer += char;\r\n }\r\n while (i < path.length) {\r\n char = path[i++];\r\n if (char === '\\\\' && state !== 2 /* ParamRegExp */) {\r\n previousState = state;\r\n state = 4 /* EscapeNext */;\r\n continue;\r\n }\r\n switch (state) {\r\n case 0 /* Static */:\r\n if (char === '/') {\r\n if (buffer) {\r\n consumeBuffer();\r\n }\r\n finalizeSegment();\r\n }\r\n else if (char === ':') {\r\n consumeBuffer();\r\n state = 1 /* Param */;\r\n }\r\n else {\r\n addCharToBuffer();\r\n }\r\n break;\r\n case 4 /* EscapeNext */:\r\n addCharToBuffer();\r\n state = previousState;\r\n break;\r\n case 1 /* Param */:\r\n if (char === '(') {\r\n state = 2 /* ParamRegExp */;\r\n }\r\n else if (VALID_PARAM_RE.test(char)) {\r\n addCharToBuffer();\r\n }\r\n else {\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n }\r\n break;\r\n case 2 /* ParamRegExp */:\r\n // TODO: is it worth handling nested regexp? like :p(?:prefix_([^/]+)_suffix)\r\n // it already works by escaping the closing )\r\n // https://paths.esm.dev/?p=AAMeJbiAwQEcDKbAoAAkP60PG2R6QAvgNaA6AFACM2ABuQBB#\r\n // is this really something people need since you can also write\r\n // /prefix_:p()_suffix\r\n if (char === ')') {\r\n // handle the escaped )\r\n if (customRe[customRe.length - 1] == '\\\\')\r\n customRe = customRe.slice(0, -1) + char;\r\n else\r\n state = 3 /* ParamRegExpEnd */;\r\n }\r\n else {\r\n customRe += char;\r\n }\r\n break;\r\n case 3 /* ParamRegExpEnd */:\r\n // same as finalizing a param\r\n consumeBuffer();\r\n state = 0 /* Static */;\r\n // go back one character if we were not modifying\r\n if (char !== '*' && char !== '?' && char !== '+')\r\n i--;\r\n customRe = '';\r\n break;\r\n default:\r\n crash('Unknown state');\r\n break;\r\n }\r\n }\r\n if (state === 2 /* ParamRegExp */)\r\n crash(`Unfinished custom RegExp for param \"${buffer}\"`);\r\n consumeBuffer();\r\n finalizeSegment();\r\n // tokenCache.set(path, tokens)\r\n return tokens;\r\n}\n\nfunction createRouteRecordMatcher(record, parent, options) {\r\n const parser = tokensToParser(tokenizePath(record.path), options);\r\n // warn against params with the same name\r\n if ((false)) {}\r\n const matcher = vue_router_esm_bundler_assign(parser, {\r\n record,\r\n parent,\r\n // these needs to be populated by the parent\r\n children: [],\r\n alias: [],\r\n });\r\n if (parent) {\r\n // both are aliases or both are not aliases\r\n // we don't want to mix them because the order is used when\r\n // passing originalRecord in Matcher.addRoute\r\n if (!matcher.record.aliasOf === !parent.record.aliasOf)\r\n parent.children.push(matcher);\r\n }\r\n return matcher;\r\n}\n\n/**\r\n * Creates a Router Matcher.\r\n *\r\n * @internal\r\n * @param routes - array of initial routes\r\n * @param globalOptions - global route options\r\n */\r\nfunction createRouterMatcher(routes, globalOptions) {\r\n // normalized ordered array of matchers\r\n const matchers = [];\r\n const matcherMap = new Map();\r\n globalOptions = mergeOptions({ strict: false, end: true, sensitive: false }, globalOptions);\r\n function getRecordMatcher(name) {\r\n return matcherMap.get(name);\r\n }\r\n function addRoute(record, parent, originalRecord) {\r\n // used later on to remove by name\r\n const isRootAdd = !originalRecord;\r\n const mainNormalizedRecord = normalizeRouteRecord(record);\r\n // we might be the child of an alias\r\n mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;\r\n const options = mergeOptions(globalOptions, record);\r\n // generate an array of records to correctly handle aliases\r\n const normalizedRecords = [\r\n mainNormalizedRecord,\r\n ];\r\n if ('alias' in record) {\r\n const aliases = typeof record.alias === 'string' ? [record.alias] : record.alias;\r\n for (const alias of aliases) {\r\n normalizedRecords.push(vue_router_esm_bundler_assign({}, mainNormalizedRecord, {\r\n // this allows us to hold a copy of the `components` option\r\n // so that async components cache is hold on the original record\r\n components: originalRecord\r\n ? originalRecord.record.components\r\n : mainNormalizedRecord.components,\r\n path: alias,\r\n // we might be the child of an alias\r\n aliasOf: originalRecord\r\n ? originalRecord.record\r\n : mainNormalizedRecord,\r\n // the aliases are always of the same kind as the original since they\r\n // are defined on the same record\r\n }));\r\n }\r\n }\r\n let matcher;\r\n let originalMatcher;\r\n for (const normalizedRecord of normalizedRecords) {\r\n const { path } = normalizedRecord;\r\n // Build up the path for nested routes if the child isn't an absolute\r\n // route. Only add the / delimiter if the child path isn't empty and if the\r\n // parent path doesn't have a trailing slash\r\n if (parent && path[0] !== '/') {\r\n const parentPath = parent.record.path;\r\n const connectingSlash = parentPath[parentPath.length - 1] === '/' ? '' : '/';\r\n normalizedRecord.path =\r\n parent.record.path + (path && connectingSlash + path);\r\n }\r\n if (false) {}\r\n // create the object before hand so it can be passed to children\r\n matcher = createRouteRecordMatcher(normalizedRecord, parent, options);\r\n if (false)\r\n {}\r\n // if we are an alias we must tell the original record that we exist\r\n // so we can be removed\r\n if (originalRecord) {\r\n originalRecord.alias.push(matcher);\r\n if ((false)) {}\r\n }\r\n else {\r\n // otherwise, the first record is the original and others are aliases\r\n originalMatcher = originalMatcher || matcher;\r\n if (originalMatcher !== matcher)\r\n originalMatcher.alias.push(matcher);\r\n // remove the route if named and only for the top record (avoid in nested calls)\r\n // this works because the original record is the first one\r\n if (isRootAdd && record.name && !isAliasRecord(matcher))\r\n removeRoute(record.name);\r\n }\r\n if ('children' in mainNormalizedRecord) {\r\n const children = mainNormalizedRecord.children;\r\n for (let i = 0; i < children.length; i++) {\r\n addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);\r\n }\r\n }\r\n // if there was no original record, then the first one was not an alias and all\r\n // other alias (if any) need to reference this record when adding children\r\n originalRecord = originalRecord || matcher;\r\n // TODO: add normalized records for more flexibility\r\n // if (parent && isAliasRecord(originalRecord)) {\r\n // parent.children.push(originalRecord)\r\n // }\r\n insertMatcher(matcher);\r\n }\r\n return originalMatcher\r\n ? () => {\r\n // since other matchers are aliases, they should be removed by the original matcher\r\n removeRoute(originalMatcher);\r\n }\r\n : noop;\r\n }\r\n function removeRoute(matcherRef) {\r\n if (isRouteName(matcherRef)) {\r\n const matcher = matcherMap.get(matcherRef);\r\n if (matcher) {\r\n matcherMap.delete(matcherRef);\r\n matchers.splice(matchers.indexOf(matcher), 1);\r\n matcher.children.forEach(removeRoute);\r\n matcher.alias.forEach(removeRoute);\r\n }\r\n }\r\n else {\r\n const index = matchers.indexOf(matcherRef);\r\n if (index > -1) {\r\n matchers.splice(index, 1);\r\n if (matcherRef.record.name)\r\n matcherMap.delete(matcherRef.record.name);\r\n matcherRef.children.forEach(removeRoute);\r\n matcherRef.alias.forEach(removeRoute);\r\n }\r\n }\r\n }\r\n function getRoutes() {\r\n return matchers;\r\n }\r\n function insertMatcher(matcher) {\r\n let i = 0;\r\n // console.log('i is', { i })\r\n while (i < matchers.length &&\r\n comparePathParserScore(matcher, matchers[i]) >= 0)\r\n i++;\r\n // console.log('END i is', { i })\r\n // while (i < matchers.length && matcher.score <= matchers[i].score) i++\r\n matchers.splice(i, 0, matcher);\r\n // only add the original record to the name map\r\n if (matcher.record.name && !isAliasRecord(matcher))\r\n matcherMap.set(matcher.record.name, matcher);\r\n }\r\n function resolve(location, currentLocation) {\r\n let matcher;\r\n let params = {};\r\n let path;\r\n let name;\r\n if ('name' in location && location.name) {\r\n matcher = matcherMap.get(location.name);\r\n if (!matcher)\r\n throw createRouterError(1 /* MATCHER_NOT_FOUND */, {\r\n location,\r\n });\r\n name = matcher.record.name;\r\n params = vue_router_esm_bundler_assign(\r\n // paramsFromLocation is a new object\r\n paramsFromLocation(currentLocation.params, \r\n // only keep params that exist in the resolved location\r\n // TODO: only keep optional params coming from a parent record\r\n matcher.keys.filter(k => !k.optional).map(k => k.name)), location.params);\r\n // throws if cannot be stringified\r\n path = matcher.stringify(params);\r\n }\r\n else if ('path' in location) {\r\n // no need to resolve the path with the matcher as it was provided\r\n // this also allows the user to control the encoding\r\n path = location.path;\r\n if (false) {}\r\n matcher = matchers.find(m => m.re.test(path));\r\n // matcher should have a value after the loop\r\n if (matcher) {\r\n // TODO: dev warning of unused params if provided\r\n // we know the matcher works because we tested the regexp\r\n params = matcher.parse(path);\r\n name = matcher.record.name;\r\n }\r\n // location is a relative path\r\n }\r\n else {\r\n // match by name or path of current route\r\n matcher = currentLocation.name\r\n ? matcherMap.get(currentLocation.name)\r\n : matchers.find(m => m.re.test(currentLocation.path));\r\n if (!matcher)\r\n throw createRouterError(1 /* MATCHER_NOT_FOUND */, {\r\n location,\r\n currentLocation,\r\n });\r\n name = matcher.record.name;\r\n // since we are navigating to the same location, we don't need to pick the\r\n // params like when `name` is provided\r\n params = vue_router_esm_bundler_assign({}, currentLocation.params, location.params);\r\n path = matcher.stringify(params);\r\n }\r\n const matched = [];\r\n let parentMatcher = matcher;\r\n while (parentMatcher) {\r\n // reversed order so parents are at the beginning\r\n matched.unshift(parentMatcher.record);\r\n parentMatcher = parentMatcher.parent;\r\n }\r\n return {\r\n name,\r\n path,\r\n params,\r\n matched,\r\n meta: mergeMetaFields(matched),\r\n };\r\n }\r\n // add initial routes\r\n routes.forEach(route => addRoute(route));\r\n return { addRoute, resolve, removeRoute, getRoutes, getRecordMatcher };\r\n}\r\nfunction paramsFromLocation(params, keys) {\r\n const newParams = {};\r\n for (const key of keys) {\r\n if (key in params)\r\n newParams[key] = params[key];\r\n }\r\n return newParams;\r\n}\r\n/**\r\n * Normalizes a RouteRecordRaw. Creates a copy\r\n *\r\n * @param record\r\n * @returns the normalized version\r\n */\r\nfunction normalizeRouteRecord(record) {\r\n return {\r\n path: record.path,\r\n redirect: record.redirect,\r\n name: record.name,\r\n meta: record.meta || {},\r\n aliasOf: undefined,\r\n beforeEnter: record.beforeEnter,\r\n props: normalizeRecordProps(record),\r\n children: record.children || [],\r\n instances: {},\r\n leaveGuards: new Set(),\r\n updateGuards: new Set(),\r\n enterCallbacks: {},\r\n components: 'components' in record\r\n ? record.components || {}\r\n : { default: record.component },\r\n };\r\n}\r\n/**\r\n * Normalize the optional `props` in a record to always be an object similar to\r\n * components. Also accept a boolean for components.\r\n * @param record\r\n */\r\nfunction normalizeRecordProps(record) {\r\n const propsObject = {};\r\n // props does not exist on redirect records but we can set false directly\r\n const props = record.props || false;\r\n if ('component' in record) {\r\n propsObject.default = props;\r\n }\r\n else {\r\n // NOTE: we could also allow a function to be applied to every component.\r\n // Would need user feedback for use cases\r\n for (const name in record.components)\r\n propsObject[name] = typeof props === 'boolean' ? props : props[name];\r\n }\r\n return propsObject;\r\n}\r\n/**\r\n * Checks if a record or any of its parent is an alias\r\n * @param record\r\n */\r\nfunction isAliasRecord(record) {\r\n while (record) {\r\n if (record.record.aliasOf)\r\n return true;\r\n record = record.parent;\r\n }\r\n return false;\r\n}\r\n/**\r\n * Merge meta fields of an array of records\r\n *\r\n * @param matched - array of matched records\r\n */\r\nfunction mergeMetaFields(matched) {\r\n return matched.reduce((meta, record) => vue_router_esm_bundler_assign(meta, record.meta), {});\r\n}\r\nfunction mergeOptions(defaults, partialOptions) {\r\n const options = {};\r\n for (const key in defaults) {\r\n options[key] = key in partialOptions ? partialOptions[key] : defaults[key];\r\n }\r\n return options;\r\n}\r\nfunction isSameParam(a, b) {\r\n return (a.name === b.name &&\r\n a.optional === b.optional &&\r\n a.repeatable === b.repeatable);\r\n}\r\n/**\r\n * Check if a path and its alias have the same required params\r\n *\r\n * @param a - original record\r\n * @param b - alias record\r\n */\r\nfunction checkSameParams(a, b) {\r\n for (const key of a.keys) {\r\n if (!key.optional && !b.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n for (const key of b.keys) {\r\n if (!key.optional && !a.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Alias \"${b.record.path}\" and the original record: \"${a.record.path}\" should have the exact same param named \"${key.name}\"`);\r\n }\r\n}\r\nfunction checkMissingParamsInAbsolutePath(record, parent) {\r\n for (const key of parent.keys) {\r\n if (!record.keys.find(isSameParam.bind(null, key)))\r\n return warn(`Absolute path \"${record.record.path}\" should have the exact same param named \"${key.name}\" as its parent \"${parent.record.path}\".`);\r\n }\r\n}\n\n/**\r\n * Encoding Rules ␣ = Space Path: ␣ \" < > # ? { } Query: ␣ \" < > # & = Hash: ␣ \"\r\n * < > `\r\n *\r\n * On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)\r\n * defines some extra characters to be encoded. Most browsers do not encode them\r\n * in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to\r\n * also encode `!'()*`. Leaving unencoded only ASCII alphanumeric(`a-zA-Z0-9`)\r\n * plus `-._~`. This extra safety should be applied to query by patching the\r\n * string returned by encodeURIComponent encodeURI also encodes `[\\]^`. `\\`\r\n * should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\\`\r\n * into a `/` if directly typed in. The _backtick_ (`````) should also be\r\n * encoded everywhere because some browsers like FF encode it when directly\r\n * written while others don't. Safari and IE don't encode ``\"<>{}``` in hash.\r\n */\r\n// const EXTRA_RESERVED_RE = /[!'()*]/g\r\n// const encodeReservedReplacer = (c: string) => '%' + c.charCodeAt(0).toString(16)\r\nconst HASH_RE = /#/g; // %23\r\nconst AMPERSAND_RE = /&/g; // %26\r\nconst SLASH_RE = /\\//g; // %2F\r\nconst EQUAL_RE = /=/g; // %3D\r\nconst IM_RE = /\\?/g; // %3F\r\nconst PLUS_RE = /\\+/g; // %2B\r\n/**\r\n * NOTE: It's not clear to me if we should encode the + symbol in queries, it\r\n * seems to be less flexible than not doing so and I can't find out the legacy\r\n * systems requiring this for regular requests like text/html. In the standard,\r\n * the encoding of the plus character is only mentioned for\r\n * application/x-www-form-urlencoded\r\n * (https://url.spec.whatwg.org/#urlencoded-parsing) and most browsers seems lo\r\n * leave the plus character as is in queries. To be more flexible, we allow the\r\n * plus character on the query but it can also be manually encoded by the user.\r\n *\r\n * Resources:\r\n * - https://url.spec.whatwg.org/#urlencoded-parsing\r\n * - https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20\r\n */\r\nconst ENC_BRACKET_OPEN_RE = /%5B/g; // [\r\nconst ENC_BRACKET_CLOSE_RE = /%5D/g; // ]\r\nconst ENC_CARET_RE = /%5E/g; // ^\r\nconst ENC_BACKTICK_RE = /%60/g; // `\r\nconst ENC_CURLY_OPEN_RE = /%7B/g; // {\r\nconst ENC_PIPE_RE = /%7C/g; // |\r\nconst ENC_CURLY_CLOSE_RE = /%7D/g; // }\r\nconst ENC_SPACE_RE = /%20/g; // }\r\n/**\r\n * Encode characters that need to be encoded on the path, search and hash\r\n * sections of the URL.\r\n *\r\n * @internal\r\n * @param text - string to encode\r\n * @returns encoded string\r\n */\r\nfunction commonEncode(text) {\r\n return encodeURI('' + text)\r\n .replace(ENC_PIPE_RE, '|')\r\n .replace(ENC_BRACKET_OPEN_RE, '[')\r\n .replace(ENC_BRACKET_CLOSE_RE, ']');\r\n}\r\n/**\r\n * Encode characters that need to be encoded on the hash section of the URL.\r\n *\r\n * @param text - string to encode\r\n * @returns encoded string\r\n */\r\nfunction encodeHash(text) {\r\n return commonEncode(text)\r\n .replace(ENC_CURLY_OPEN_RE, '{')\r\n .replace(ENC_CURLY_CLOSE_RE, '}')\r\n .replace(ENC_CARET_RE, '^');\r\n}\r\n/**\r\n * Encode characters that need to be encoded query values on the query\r\n * section of the URL.\r\n *\r\n * @param text - string to encode\r\n * @returns encoded string\r\n */\r\nfunction encodeQueryValue(text) {\r\n return (commonEncode(text)\r\n // Encode the space as +, encode the + to differentiate it from the space\r\n .replace(PLUS_RE, '%2B')\r\n .replace(ENC_SPACE_RE, '+')\r\n .replace(HASH_RE, '%23')\r\n .replace(AMPERSAND_RE, '%26')\r\n .replace(ENC_BACKTICK_RE, '`')\r\n .replace(ENC_CURLY_OPEN_RE, '{')\r\n .replace(ENC_CURLY_CLOSE_RE, '}')\r\n .replace(ENC_CARET_RE, '^'));\r\n}\r\n/**\r\n * Like `encodeQueryValue` but also encodes the `=` character.\r\n *\r\n * @param text - string to encode\r\n */\r\nfunction encodeQueryKey(text) {\r\n return encodeQueryValue(text).replace(EQUAL_RE, '%3D');\r\n}\r\n/**\r\n * Encode characters that need to be encoded on the path section of the URL.\r\n *\r\n * @param text - string to encode\r\n * @returns encoded string\r\n */\r\nfunction encodePath(text) {\r\n return commonEncode(text).replace(HASH_RE, '%23').replace(IM_RE, '%3F');\r\n}\r\n/**\r\n * Encode characters that need to be encoded on the path section of the URL as a\r\n * param. This function encodes everything {@link encodePath} does plus the\r\n * slash (`/`) character. If `text` is `null` or `undefined`, returns an empty\r\n * string instead.\r\n *\r\n * @param text - string to encode\r\n * @returns encoded string\r\n */\r\nfunction encodeParam(text) {\r\n return text == null ? '' : encodePath(text).replace(SLASH_RE, '%2F');\r\n}\r\n/**\r\n * Decode text using `decodeURIComponent`. Returns the original text if it\r\n * fails.\r\n *\r\n * @param text - string to decode\r\n * @returns decoded string\r\n */\r\nfunction decode(text) {\r\n try {\r\n return decodeURIComponent('' + text);\r\n }\r\n catch (err) {\r\n ( false) && 0;\r\n }\r\n return '' + text;\r\n}\n\n/**\r\n * Transforms a queryString into a {@link LocationQuery} object. Accept both, a\r\n * version with the leading `?` and without Should work as URLSearchParams\r\n\n * @internal\r\n *\r\n * @param search - search string to parse\r\n * @returns a query object\r\n */\r\nfunction parseQuery(search) {\r\n const query = {};\r\n // avoid creating an object with an empty key and empty value\r\n // because of split('&')\r\n if (search === '' || search === '?')\r\n return query;\r\n const hasLeadingIM = search[0] === '?';\r\n const searchParams = (hasLeadingIM ? search.slice(1) : search).split('&');\r\n for (let i = 0; i < searchParams.length; ++i) {\r\n // pre decode the + into space\r\n const searchParam = searchParams[i].replace(PLUS_RE, ' ');\r\n // allow the = character\r\n const eqPos = searchParam.indexOf('=');\r\n const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));\r\n const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));\r\n if (key in query) {\r\n // an extra variable for ts types\r\n let currentValue = query[key];\r\n if (!Array.isArray(currentValue)) {\r\n currentValue = query[key] = [currentValue];\r\n }\r\n currentValue.push(value);\r\n }\r\n else {\r\n query[key] = value;\r\n }\r\n }\r\n return query;\r\n}\r\n/**\r\n * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it\r\n * doesn't prepend a `?`\r\n *\r\n * @internal\r\n *\r\n * @param query - query object to stringify\r\n * @returns string version of the query without the leading `?`\r\n */\r\nfunction stringifyQuery(query) {\r\n let search = '';\r\n for (let key in query) {\r\n const value = query[key];\r\n key = encodeQueryKey(key);\r\n if (value == null) {\r\n // only null adds the value\r\n if (value !== undefined) {\r\n search += (search.length ? '&' : '') + key;\r\n }\r\n continue;\r\n }\r\n // keep null values\r\n const values = Array.isArray(value)\r\n ? value.map(v => v && encodeQueryValue(v))\r\n : [value && encodeQueryValue(value)];\r\n values.forEach(value => {\r\n // skip undefined values in arrays as if they were not present\r\n // smaller code than using filter\r\n if (value !== undefined) {\r\n // only append & with non-empty search\r\n search += (search.length ? '&' : '') + key;\r\n if (value != null)\r\n search += '=' + value;\r\n }\r\n });\r\n }\r\n return search;\r\n}\r\n/**\r\n * Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting\r\n * numbers into strings, removing keys with an undefined value and replacing\r\n * undefined with null in arrays\r\n *\r\n * @param query - query object to normalize\r\n * @returns a normalized query object\r\n */\r\nfunction normalizeQuery(query) {\r\n const normalizedQuery = {};\r\n for (const key in query) {\r\n const value = query[key];\r\n if (value !== undefined) {\r\n normalizedQuery[key] = Array.isArray(value)\r\n ? value.map(v => (v == null ? null : '' + v))\r\n : value == null\r\n ? value\r\n : '' + value;\r\n }\r\n }\r\n return normalizedQuery;\r\n}\n\n/**\r\n * Create a list of callbacks that can be reset. Used to create before and after navigation guards list\r\n */\r\nfunction useCallbacks() {\r\n let handlers = [];\r\n function add(handler) {\r\n handlers.push(handler);\r\n return () => {\r\n const i = handlers.indexOf(handler);\r\n if (i > -1)\r\n handlers.splice(i, 1);\r\n };\r\n }\r\n function reset() {\r\n handlers = [];\r\n }\r\n return {\r\n add,\r\n list: () => handlers,\r\n reset,\r\n };\r\n}\n\nfunction registerGuard(record, name, guard) {\r\n const removeFromList = () => {\r\n record[name].delete(guard);\r\n };\r\n onUnmounted(removeFromList);\r\n onDeactivated(removeFromList);\r\n onActivated(() => {\r\n record[name].add(guard);\r\n });\r\n record[name].add(guard);\r\n}\r\n/**\r\n * Add a navigation guard that triggers whenever the component for the current\r\n * location is about to be left. Similar to {@link beforeRouteLeave} but can be\r\n * used in any component. The guard is removed when the component is unmounted.\r\n *\r\n * @param leaveGuard - {@link NavigationGuard}\r\n */\r\nfunction onBeforeRouteLeave(leaveGuard) {\r\n if (false) {}\r\n const activeRecord = inject(matchedRouteKey, \r\n // to avoid warning\r\n {}).value;\r\n if (!activeRecord) {\r\n ( false) &&\r\n 0;\r\n return;\r\n }\r\n registerGuard(activeRecord, 'leaveGuards', leaveGuard);\r\n}\r\n/**\r\n * Add a navigation guard that triggers whenever the current location is about\r\n * to be updated. Similar to {@link beforeRouteUpdate} but can be used in any\r\n * component. The guard is removed when the component is unmounted.\r\n *\r\n * @param updateGuard - {@link NavigationGuard}\r\n */\r\nfunction onBeforeRouteUpdate(updateGuard) {\r\n if (false) {}\r\n const activeRecord = inject(matchedRouteKey, \r\n // to avoid warning\r\n {}).value;\r\n if (!activeRecord) {\r\n ( false) &&\r\n 0;\r\n return;\r\n }\r\n registerGuard(activeRecord, 'updateGuards', updateGuard);\r\n}\r\nfunction guardToPromiseFn(guard, to, from, record, name) {\r\n // keep a reference to the enterCallbackArray to prevent pushing callbacks if a new navigation took place\r\n const enterCallbackArray = record &&\r\n // name is defined if record is because of the function overload\r\n (record.enterCallbacks[name] = record.enterCallbacks[name] || []);\r\n return () => new Promise((resolve, reject) => {\r\n const next = (valid) => {\r\n if (valid === false)\r\n reject(createRouterError(4 /* NAVIGATION_ABORTED */, {\r\n from,\r\n to,\r\n }));\r\n else if (valid instanceof Error) {\r\n reject(valid);\r\n }\r\n else if (isRouteLocation(valid)) {\r\n reject(createRouterError(2 /* NAVIGATION_GUARD_REDIRECT */, {\r\n from: to,\r\n to: valid,\r\n }));\r\n }\r\n else {\r\n if (enterCallbackArray &&\r\n // since enterCallbackArray is truthy, both record and name also are\r\n record.enterCallbacks[name] === enterCallbackArray &&\r\n typeof valid === 'function')\r\n enterCallbackArray.push(valid);\r\n resolve();\r\n }\r\n };\r\n // wrapping with Promise.resolve allows it to work with both async and sync guards\r\n const guardReturn = guard.call(record && record.instances[name], to, from, ( false) ? 0 : next);\r\n let guardCall = Promise.resolve(guardReturn);\r\n if (guard.length < 3)\r\n guardCall = guardCall.then(next);\r\n if (false) {}\r\n guardCall.catch(err => reject(err));\r\n });\r\n}\r\nfunction canOnlyBeCalledOnce(next, to, from) {\r\n let called = 0;\r\n return function () {\r\n if (called++ === 1)\r\n warn(`The \"next\" callback was called more than once in one navigation guard when going from \"${from.fullPath}\" to \"${to.fullPath}\". It should be called exactly one time in each navigation guard. This will fail in production.`);\r\n // @ts-expect-error: we put it in the original one because it's easier to check\r\n next._called = true;\r\n if (called === 1)\r\n next.apply(null, arguments);\r\n };\r\n}\r\nfunction extractComponentsGuards(matched, guardType, to, from) {\r\n const guards = [];\r\n for (const record of matched) {\r\n for (const name in record.components) {\r\n let rawComponent = record.components[name];\r\n if ((false)) {}\r\n // skip update and leave guards if the route component is not mounted\r\n if (guardType !== 'beforeRouteEnter' && !record.instances[name])\r\n continue;\r\n if (isRouteComponent(rawComponent)) {\r\n // __vccOpts is added by vue-class-component and contain the regular options\r\n const options = rawComponent.__vccOpts || rawComponent;\r\n const guard = options[guardType];\r\n guard && guards.push(guardToPromiseFn(guard, to, from, record, name));\r\n }\r\n else {\r\n // start requesting the chunk already\r\n let componentPromise = rawComponent();\r\n if (false) {}\r\n guards.push(() => componentPromise.then(resolved => {\r\n if (!resolved)\r\n return Promise.reject(new Error(`Couldn't resolve component \"${name}\" at \"${record.path}\"`));\r\n const resolvedComponent = isESModule(resolved)\r\n ? resolved.default\r\n : resolved;\r\n // replace the function with the resolved component\r\n record.components[name] = resolvedComponent;\r\n // __vccOpts is added by vue-class-component and contain the regular options\r\n const options = resolvedComponent.__vccOpts || resolvedComponent;\r\n const guard = options[guardType];\r\n return guard && guardToPromiseFn(guard, to, from, record, name)();\r\n }));\r\n }\r\n }\r\n }\r\n return guards;\r\n}\r\n/**\r\n * Allows differentiating lazy components from functional components and vue-class-component\r\n *\r\n * @param component\r\n */\r\nfunction isRouteComponent(component) {\r\n return (typeof component === 'object' ||\r\n 'displayName' in component ||\r\n 'props' in component ||\r\n '__vccOpts' in component);\r\n}\n\n// TODO: we could allow currentRoute as a prop to expose `isActive` and\r\n// `isExactActive` behavior should go through an RFC\r\nfunction useLink(props) {\r\n const router = (0,vue_esm_bundler/* inject */.f3)(routerKey);\r\n const currentRoute = (0,vue_esm_bundler/* inject */.f3)(routeLocationKey);\r\n const route = (0,vue_esm_bundler/* computed */.Fl)(() => router.resolve((0,vue_esm_bundler/* unref */.SU)(props.to)));\r\n const activeRecordIndex = (0,vue_esm_bundler/* computed */.Fl)(() => {\r\n const { matched } = route.value;\r\n const { length } = matched;\r\n const routeMatched = matched[length - 1];\r\n const currentMatched = currentRoute.matched;\r\n if (!routeMatched || !currentMatched.length)\r\n return -1;\r\n const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));\r\n if (index > -1)\r\n return index;\r\n // possible parent record\r\n const parentRecordPath = getOriginalPath(matched[length - 2]);\r\n return (\r\n // we are dealing with nested routes\r\n length > 1 &&\r\n // if the parent and matched route have the same path, this link is\r\n // referring to the empty child. Or we currently are on a different\r\n // child of the same parent\r\n getOriginalPath(routeMatched) === parentRecordPath &&\r\n // avoid comparing the child with its parent\r\n currentMatched[currentMatched.length - 1].path !== parentRecordPath\r\n ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2]))\r\n : index);\r\n });\r\n const isActive = (0,vue_esm_bundler/* computed */.Fl)(() => activeRecordIndex.value > -1 &&\r\n includesParams(currentRoute.params, route.value.params));\r\n const isExactActive = (0,vue_esm_bundler/* computed */.Fl)(() => activeRecordIndex.value > -1 &&\r\n activeRecordIndex.value === currentRoute.matched.length - 1 &&\r\n isSameRouteLocationParams(currentRoute.params, route.value.params));\r\n function navigate(e = {}) {\r\n if (guardEvent(e)) {\r\n return router[(0,vue_esm_bundler/* unref */.SU)(props.replace) ? 'replace' : 'push']((0,vue_esm_bundler/* unref */.SU)(props.to)\r\n // avoid uncaught errors are they are logged anyway\r\n ).catch(noop);\r\n }\r\n return Promise.resolve();\r\n }\r\n // devtools only\r\n if (false) {}\r\n return {\r\n route,\r\n href: (0,vue_esm_bundler/* computed */.Fl)(() => route.value.href),\r\n isActive,\r\n isExactActive,\r\n navigate,\r\n };\r\n}\r\nconst RouterLinkImpl = /*#__PURE__*/ (0,vue_esm_bundler/* defineComponent */.aZ)({\r\n name: 'RouterLink',\r\n props: {\r\n to: {\r\n type: [String, Object],\r\n required: true,\r\n },\r\n replace: Boolean,\r\n activeClass: String,\r\n // inactiveClass: String,\r\n exactActiveClass: String,\r\n custom: Boolean,\r\n ariaCurrentValue: {\r\n type: String,\r\n default: 'page',\r\n },\r\n },\r\n useLink,\r\n setup(props, { slots }) {\r\n const link = (0,vue_esm_bundler/* reactive */.qj)(useLink(props));\r\n const { options } = (0,vue_esm_bundler/* inject */.f3)(routerKey);\r\n const elClass = (0,vue_esm_bundler/* computed */.Fl)(() => ({\r\n [getLinkClass(props.activeClass, options.linkActiveClass, 'router-link-active')]: link.isActive,\r\n // [getLinkClass(\r\n // props.inactiveClass,\r\n // options.linkInactiveClass,\r\n // 'router-link-inactive'\r\n // )]: !link.isExactActive,\r\n [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, 'router-link-exact-active')]: link.isExactActive,\r\n }));\r\n return () => {\r\n const children = slots.default && slots.default(link);\r\n return props.custom\r\n ? children\r\n : (0,vue_esm_bundler.h)('a', {\r\n 'aria-current': link.isExactActive\r\n ? props.ariaCurrentValue\r\n : null,\r\n href: link.href,\r\n // this would override user added attrs but Vue will still add\r\n // the listener so we end up triggering both\r\n onClick: link.navigate,\r\n class: elClass.value,\r\n }, children);\r\n };\r\n },\r\n});\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\n/**\r\n * Component to render a link that triggers a navigation on click.\r\n */\r\nconst RouterLink = RouterLinkImpl;\r\nfunction guardEvent(e) {\r\n // don't redirect with control keys\r\n if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)\r\n return;\r\n // don't redirect when preventDefault called\r\n if (e.defaultPrevented)\r\n return;\r\n // don't redirect on right click\r\n if (e.button !== undefined && e.button !== 0)\r\n return;\r\n // don't redirect if `target=\"_blank\"`\r\n // @ts-expect-error getAttribute does exist\r\n if (e.currentTarget && e.currentTarget.getAttribute) {\r\n // @ts-expect-error getAttribute exists\r\n const target = e.currentTarget.getAttribute('target');\r\n if (/\\b_blank\\b/i.test(target))\r\n return;\r\n }\r\n // this may be a Weex event which doesn't have this method\r\n if (e.preventDefault)\r\n e.preventDefault();\r\n return true;\r\n}\r\nfunction includesParams(outer, inner) {\r\n for (const key in inner) {\r\n const innerValue = inner[key];\r\n const outerValue = outer[key];\r\n if (typeof innerValue === 'string') {\r\n if (innerValue !== outerValue)\r\n return false;\r\n }\r\n else {\r\n if (!Array.isArray(outerValue) ||\r\n outerValue.length !== innerValue.length ||\r\n innerValue.some((value, i) => value !== outerValue[i]))\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\n/**\r\n * Get the original path value of a record by following its aliasOf\r\n * @param record\r\n */\r\nfunction getOriginalPath(record) {\r\n return record ? (record.aliasOf ? record.aliasOf.path : record.path) : '';\r\n}\r\n/**\r\n * Utility class to get the active class based on defaults.\r\n * @param propClass\r\n * @param globalClass\r\n * @param defaultClass\r\n */\r\nconst getLinkClass = (propClass, globalClass, defaultClass) => propClass != null\r\n ? propClass\r\n : globalClass != null\r\n ? globalClass\r\n : defaultClass;\n\nconst RouterViewImpl = /*#__PURE__*/ (0,vue_esm_bundler/* defineComponent */.aZ)({\r\n name: 'RouterView',\r\n // #674 we manually inherit them\r\n inheritAttrs: false,\r\n props: {\r\n name: {\r\n type: String,\r\n default: 'default',\r\n },\r\n route: Object,\r\n },\r\n setup(props, { attrs, slots }) {\r\n ( false) && 0;\r\n const injectedRoute = (0,vue_esm_bundler/* inject */.f3)(routerViewLocationKey);\r\n const routeToDisplay = (0,vue_esm_bundler/* computed */.Fl)(() => props.route || injectedRoute.value);\r\n const depth = (0,vue_esm_bundler/* inject */.f3)(viewDepthKey, 0);\r\n const matchedRouteRef = (0,vue_esm_bundler/* computed */.Fl)(() => routeToDisplay.value.matched[depth]);\r\n (0,vue_esm_bundler/* provide */.JJ)(viewDepthKey, depth + 1);\r\n (0,vue_esm_bundler/* provide */.JJ)(matchedRouteKey, matchedRouteRef);\r\n (0,vue_esm_bundler/* provide */.JJ)(routerViewLocationKey, routeToDisplay);\r\n const viewRef = (0,vue_esm_bundler/* ref */.iH)();\r\n // watch at the same time the component instance, the route record we are\r\n // rendering, and the name\r\n (0,vue_esm_bundler/* watch */.YP)(() => [viewRef.value, matchedRouteRef.value, props.name], ([instance, to, name], [oldInstance, from, oldName]) => {\r\n // copy reused instances\r\n if (to) {\r\n // this will update the instance for new instances as well as reused\r\n // instances when navigating to a new route\r\n to.instances[name] = instance;\r\n // the component instance is reused for a different route or name so\r\n // we copy any saved update or leave guards. With async setup, the\r\n // mounting component will mount before the matchedRoute changes,\r\n // making instance === oldInstance, so we check if guards have been\r\n // added before. This works because we remove guards when\r\n // unmounting/deactivating components\r\n if (from && from !== to && instance && instance === oldInstance) {\r\n if (!to.leaveGuards.size) {\r\n to.leaveGuards = from.leaveGuards;\r\n }\r\n if (!to.updateGuards.size) {\r\n to.updateGuards = from.updateGuards;\r\n }\r\n }\r\n }\r\n // trigger beforeRouteEnter next callbacks\r\n if (instance &&\r\n to &&\r\n // if there is no instance but to and from are the same this might be\r\n // the first visit\r\n (!from || !isSameRouteRecord(to, from) || !oldInstance)) {\r\n (to.enterCallbacks[name] || []).forEach(callback => callback(instance));\r\n }\r\n }, { flush: 'post' });\r\n return () => {\r\n const route = routeToDisplay.value;\r\n const matchedRoute = matchedRouteRef.value;\r\n const ViewComponent = matchedRoute && matchedRoute.components[props.name];\r\n // we need the value at the time we render because when we unmount, we\r\n // navigated to a different location so the value is different\r\n const currentName = props.name;\r\n if (!ViewComponent) {\r\n return normalizeSlot(slots.default, { Component: ViewComponent, route });\r\n }\r\n // props from route configuration\r\n const routePropsOption = matchedRoute.props[props.name];\r\n const routeProps = routePropsOption\r\n ? routePropsOption === true\r\n ? route.params\r\n : typeof routePropsOption === 'function'\r\n ? routePropsOption(route)\r\n : routePropsOption\r\n : null;\r\n const onVnodeUnmounted = vnode => {\r\n // remove the instance reference to prevent leak\r\n if (vnode.component.isUnmounted) {\r\n matchedRoute.instances[currentName] = null;\r\n }\r\n };\r\n const component = (0,vue_esm_bundler.h)(ViewComponent, vue_router_esm_bundler_assign({}, routeProps, attrs, {\r\n onVnodeUnmounted,\r\n ref: viewRef,\r\n }));\r\n if (false) {}\r\n return (\r\n // pass the vnode to the slot as a prop.\r\n // h and <component :is=\"...\"> both accept vnodes\r\n normalizeSlot(slots.default, { Component: component, route }) ||\r\n component);\r\n };\r\n },\r\n});\r\nfunction normalizeSlot(slot, data) {\r\n if (!slot)\r\n return null;\r\n const slotContent = slot(data);\r\n return slotContent.length === 1 ? slotContent[0] : slotContent;\r\n}\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\n/**\r\n * Component to display the current route the user is at.\r\n */\r\nconst RouterView = RouterViewImpl;\r\n// warn against deprecated usage with <transition> & <keep-alive>\r\n// due to functional component being no longer eager in Vue 3\r\nfunction warnDeprecatedUsage() {\r\n const instance = getCurrentInstance();\r\n const parentName = instance.parent && instance.parent.type.name;\r\n if (parentName &&\r\n (parentName === 'KeepAlive' || parentName.includes('Transition'))) {\r\n const comp = parentName === 'KeepAlive' ? 'keep-alive' : 'transition';\r\n warn(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.\\n` +\r\n `Use slot props instead:\\n\\n` +\r\n `<router-view v-slot=\"{ Component }\">\\n` +\r\n ` <${comp}>\\n` +\r\n ` <component :is=\"Component\" />\\n` +\r\n ` </${comp}>\\n` +\r\n `</router-view>`);\r\n }\r\n}\n\nfunction formatRouteLocation(routeLocation, tooltip) {\r\n const copy = vue_router_esm_bundler_assign({}, routeLocation, {\r\n // remove variables that can contain vue instances\r\n matched: routeLocation.matched.map(matched => omit(matched, ['instances', 'children', 'aliasOf'])),\r\n });\r\n return {\r\n _custom: {\r\n type: null,\r\n readOnly: true,\r\n display: routeLocation.fullPath,\r\n tooltip,\r\n value: copy,\r\n },\r\n };\r\n}\r\nfunction formatDisplay(display) {\r\n return {\r\n _custom: {\r\n display,\r\n },\r\n };\r\n}\r\n// to support multiple router instances\r\nlet routerId = 0;\r\nfunction addDevtools(app, router, matcher) {\r\n // Take over router.beforeEach and afterEach\r\n // make sure we are not registering the devtool twice\r\n if (router.__hasDevtools)\r\n return;\r\n router.__hasDevtools = true;\r\n // increment to support multiple router instances\r\n const id = routerId++;\r\n setupDevtoolsPlugin({\r\n id: 'org.vuejs.router' + (id ? '.' + id : ''),\r\n label: 'Vue Router',\r\n packageName: 'vue-router',\r\n homepage: 'https://next.router.vuejs.org/',\r\n logo: 'https://vuejs.org/images/icons/favicon-96x96.png',\r\n componentStateTypes: ['Routing'],\r\n app,\r\n }, api => {\r\n // display state added by the router\r\n api.on.inspectComponent((payload, ctx) => {\r\n if (payload.instanceData) {\r\n payload.instanceData.state.push({\r\n type: 'Routing',\r\n key: '$route',\r\n editable: false,\r\n value: formatRouteLocation(router.currentRoute.value, 'Current Route'),\r\n });\r\n }\r\n });\r\n // mark router-link as active and display tags on router views\r\n api.on.visitComponentTree(({ treeNode: node, componentInstance }) => {\r\n if (componentInstance.__vrv_devtools) {\r\n const info = componentInstance.__vrv_devtools;\r\n node.tags.push({\r\n label: (info.name ? `${info.name.toString()}: ` : '') + info.path,\r\n textColor: 0,\r\n tooltip: 'This component is rendered by <router-view>',\r\n backgroundColor: PINK_500,\r\n });\r\n }\r\n // if multiple useLink are used\r\n if (Array.isArray(componentInstance.__vrl_devtools)) {\r\n componentInstance.__devtoolsApi = api;\r\n componentInstance.__vrl_devtools.forEach(devtoolsData => {\r\n let backgroundColor = ORANGE_400;\r\n let tooltip = '';\r\n if (devtoolsData.isExactActive) {\r\n backgroundColor = LIME_500;\r\n tooltip = 'This is exactly active';\r\n }\r\n else if (devtoolsData.isActive) {\r\n backgroundColor = BLUE_600;\r\n tooltip = 'This link is active';\r\n }\r\n node.tags.push({\r\n label: devtoolsData.route.path,\r\n textColor: 0,\r\n tooltip,\r\n backgroundColor,\r\n });\r\n });\r\n }\r\n });\r\n watch(router.currentRoute, () => {\r\n // refresh active state\r\n refreshRoutesView();\r\n api.notifyComponentUpdate();\r\n api.sendInspectorTree(routerInspectorId);\r\n api.sendInspectorState(routerInspectorId);\r\n });\r\n const navigationsLayerId = 'router:navigations:' + id;\r\n api.addTimelineLayer({\r\n id: navigationsLayerId,\r\n label: `Router${id ? ' ' + id : ''} Navigations`,\r\n color: 0x40a8c4,\r\n });\r\n // const errorsLayerId = 'router:errors'\r\n // api.addTimelineLayer({\r\n // id: errorsLayerId,\r\n // label: 'Router Errors',\r\n // color: 0xea5455,\r\n // })\r\n router.onError((error, to) => {\r\n api.addTimelineEvent({\r\n layerId: navigationsLayerId,\r\n event: {\r\n title: 'Error during Navigation',\r\n subtitle: to.fullPath,\r\n logType: 'error',\r\n time: Date.now(),\r\n data: { error },\r\n groupId: to.meta.__navigationId,\r\n },\r\n });\r\n });\r\n // attached to `meta` and used to group events\r\n let navigationId = 0;\r\n router.beforeEach((to, from) => {\r\n const data = {\r\n guard: formatDisplay('beforeEach'),\r\n from: formatRouteLocation(from, 'Current Location during this navigation'),\r\n to: formatRouteLocation(to, 'Target location'),\r\n };\r\n // Used to group navigations together, hide from devtools\r\n Object.defineProperty(to.meta, '__navigationId', {\r\n value: navigationId++,\r\n });\r\n api.addTimelineEvent({\r\n layerId: navigationsLayerId,\r\n event: {\r\n time: Date.now(),\r\n title: 'Start of navigation',\r\n subtitle: to.fullPath,\r\n data,\r\n groupId: to.meta.__navigationId,\r\n },\r\n });\r\n });\r\n router.afterEach((to, from, failure) => {\r\n const data = {\r\n guard: formatDisplay('afterEach'),\r\n };\r\n if (failure) {\r\n data.failure = {\r\n _custom: {\r\n type: Error,\r\n readOnly: true,\r\n display: failure ? failure.message : '',\r\n tooltip: 'Navigation Failure',\r\n value: failure,\r\n },\r\n };\r\n data.status = formatDisplay('❌');\r\n }\r\n else {\r\n data.status = formatDisplay('✅');\r\n }\r\n // we set here to have the right order\r\n data.from = formatRouteLocation(from, 'Current Location during this navigation');\r\n data.to = formatRouteLocation(to, 'Target location');\r\n api.addTimelineEvent({\r\n layerId: navigationsLayerId,\r\n event: {\r\n title: 'End of navigation',\r\n subtitle: to.fullPath,\r\n time: Date.now(),\r\n data,\r\n logType: failure ? 'warning' : 'default',\r\n groupId: to.meta.__navigationId,\r\n },\r\n });\r\n });\r\n /**\r\n * Inspector of Existing routes\r\n */\r\n const routerInspectorId = 'router-inspector:' + id;\r\n api.addInspector({\r\n id: routerInspectorId,\r\n label: 'Routes' + (id ? ' ' + id : ''),\r\n icon: 'book',\r\n treeFilterPlaceholder: 'Search routes',\r\n });\r\n function refreshRoutesView() {\r\n // the routes view isn't active\r\n if (!activeRoutesPayload)\r\n return;\r\n const payload = activeRoutesPayload;\r\n // children routes will appear as nested\r\n let routes = matcher.getRoutes().filter(route => !route.parent);\r\n // reset match state to false\r\n routes.forEach(resetMatchStateOnRouteRecord);\r\n // apply a match state if there is a payload\r\n if (payload.filter) {\r\n routes = routes.filter(route => \r\n // save matches state based on the payload\r\n isRouteMatching(route, payload.filter.toLowerCase()));\r\n }\r\n // mark active routes\r\n routes.forEach(route => markRouteRecordActive(route, router.currentRoute.value));\r\n payload.rootNodes = routes.map(formatRouteRecordForInspector);\r\n }\r\n let activeRoutesPayload;\r\n api.on.getInspectorTree(payload => {\r\n activeRoutesPayload = payload;\r\n if (payload.app === app && payload.inspectorId === routerInspectorId) {\r\n refreshRoutesView();\r\n }\r\n });\r\n /**\r\n * Display information about the currently selected route record\r\n */\r\n api.on.getInspectorState(payload => {\r\n if (payload.app === app && payload.inspectorId === routerInspectorId) {\r\n const routes = matcher.getRoutes();\r\n const route = routes.find(route => route.record.__vd_id === payload.nodeId);\r\n if (route) {\r\n payload.state = {\r\n options: formatRouteRecordMatcherForStateInspector(route),\r\n };\r\n }\r\n }\r\n });\r\n api.sendInspectorTree(routerInspectorId);\r\n api.sendInspectorState(routerInspectorId);\r\n });\r\n}\r\nfunction modifierForKey(key) {\r\n if (key.optional) {\r\n return key.repeatable ? '*' : '?';\r\n }\r\n else {\r\n return key.repeatable ? '+' : '';\r\n }\r\n}\r\nfunction formatRouteRecordMatcherForStateInspector(route) {\r\n const { record } = route;\r\n const fields = [\r\n { editable: false, key: 'path', value: record.path },\r\n ];\r\n if (record.name != null) {\r\n fields.push({\r\n editable: false,\r\n key: 'name',\r\n value: record.name,\r\n });\r\n }\r\n fields.push({ editable: false, key: 'regexp', value: route.re });\r\n if (route.keys.length) {\r\n fields.push({\r\n editable: false,\r\n key: 'keys',\r\n value: {\r\n _custom: {\r\n type: null,\r\n readOnly: true,\r\n display: route.keys\r\n .map(key => `${key.name}${modifierForKey(key)}`)\r\n .join(' '),\r\n tooltip: 'Param keys',\r\n value: route.keys,\r\n },\r\n },\r\n });\r\n }\r\n if (record.redirect != null) {\r\n fields.push({\r\n editable: false,\r\n key: 'redirect',\r\n value: record.redirect,\r\n });\r\n }\r\n if (route.alias.length) {\r\n fields.push({\r\n editable: false,\r\n key: 'aliases',\r\n value: route.alias.map(alias => alias.record.path),\r\n });\r\n }\r\n fields.push({\r\n key: 'score',\r\n editable: false,\r\n value: {\r\n _custom: {\r\n type: null,\r\n readOnly: true,\r\n display: route.score.map(score => score.join(', ')).join(' | '),\r\n tooltip: 'Score used to sort routes',\r\n value: route.score,\r\n },\r\n },\r\n });\r\n return fields;\r\n}\r\n/**\r\n * Extracted from tailwind palette\r\n */\r\nconst PINK_500 = 0xec4899;\r\nconst BLUE_600 = 0x2563eb;\r\nconst LIME_500 = 0x84cc16;\r\nconst CYAN_400 = 0x22d3ee;\r\nconst ORANGE_400 = 0xfb923c;\r\n// const GRAY_100 = 0xf4f4f5\r\nconst DARK = 0x666666;\r\nfunction formatRouteRecordForInspector(route) {\r\n const tags = [];\r\n const { record } = route;\r\n if (record.name != null) {\r\n tags.push({\r\n label: String(record.name),\r\n textColor: 0,\r\n backgroundColor: CYAN_400,\r\n });\r\n }\r\n if (record.aliasOf) {\r\n tags.push({\r\n label: 'alias',\r\n textColor: 0,\r\n backgroundColor: ORANGE_400,\r\n });\r\n }\r\n if (route.__vd_match) {\r\n tags.push({\r\n label: 'matches',\r\n textColor: 0,\r\n backgroundColor: PINK_500,\r\n });\r\n }\r\n if (route.__vd_exactActive) {\r\n tags.push({\r\n label: 'exact',\r\n textColor: 0,\r\n backgroundColor: LIME_500,\r\n });\r\n }\r\n if (route.__vd_active) {\r\n tags.push({\r\n label: 'active',\r\n textColor: 0,\r\n backgroundColor: BLUE_600,\r\n });\r\n }\r\n if (record.redirect) {\r\n tags.push({\r\n label: 'redirect: ' +\r\n (typeof record.redirect === 'string' ? record.redirect : 'Object'),\r\n textColor: 0xffffff,\r\n backgroundColor: DARK,\r\n });\r\n }\r\n // add an id to be able to select it. Using the `path` is not possible because\r\n // empty path children would collide with their parents\r\n let id = record.__vd_id;\r\n if (id == null) {\r\n id = String(routeRecordId++);\r\n record.__vd_id = id;\r\n }\r\n return {\r\n id,\r\n label: record.path,\r\n tags,\r\n children: route.children.map(formatRouteRecordForInspector),\r\n };\r\n}\r\n// incremental id for route records and inspector state\r\nlet routeRecordId = 0;\r\nconst EXTRACT_REGEXP_RE = /^\\/(.*)\\/([a-z]*)$/;\r\nfunction markRouteRecordActive(route, currentRoute) {\r\n // no route will be active if matched is empty\r\n // reset the matching state\r\n const isExactActive = currentRoute.matched.length &&\r\n isSameRouteRecord(currentRoute.matched[currentRoute.matched.length - 1], route.record);\r\n route.__vd_exactActive = route.__vd_active = isExactActive;\r\n if (!isExactActive) {\r\n route.__vd_active = currentRoute.matched.some(match => isSameRouteRecord(match, route.record));\r\n }\r\n route.children.forEach(childRoute => markRouteRecordActive(childRoute, currentRoute));\r\n}\r\nfunction resetMatchStateOnRouteRecord(route) {\r\n route.__vd_match = false;\r\n route.children.forEach(resetMatchStateOnRouteRecord);\r\n}\r\nfunction isRouteMatching(route, filter) {\r\n const found = String(route.re).match(EXTRACT_REGEXP_RE);\r\n route.__vd_match = false;\r\n if (!found || found.length < 3) {\r\n return false;\r\n }\r\n // use a regexp without $ at the end to match nested routes better\r\n const nonEndingRE = new RegExp(found[1].replace(/\\$$/, ''), found[2]);\r\n if (nonEndingRE.test(filter)) {\r\n // mark children as matches\r\n route.children.forEach(child => isRouteMatching(child, filter));\r\n // exception case: `/`\r\n if (route.record.path !== '/' || filter === '/') {\r\n route.__vd_match = route.re.test(filter);\r\n return true;\r\n }\r\n // hide the / route\r\n return false;\r\n }\r\n const path = route.record.path.toLowerCase();\r\n const decodedPath = decode(path);\r\n // also allow partial matching on the path\r\n if (!filter.startsWith('/') &&\r\n (decodedPath.includes(filter) || path.includes(filter)))\r\n return true;\r\n if (decodedPath.startsWith(filter) || path.startsWith(filter))\r\n return true;\r\n if (route.record.name && String(route.record.name).includes(filter))\r\n return true;\r\n return route.children.some(child => isRouteMatching(child, filter));\r\n}\r\nfunction omit(obj, keys) {\r\n const ret = {};\r\n for (const key in obj) {\r\n if (!keys.includes(key)) {\r\n // @ts-expect-error\r\n ret[key] = obj[key];\r\n }\r\n }\r\n return ret;\r\n}\n\n/**\r\n * Creates a Router instance that can be used by a Vue app.\r\n *\r\n * @param options - {@link RouterOptions}\r\n */\r\nfunction createRouter(options) {\r\n const matcher = createRouterMatcher(options.routes, options);\r\n const parseQuery$1 = options.parseQuery || parseQuery;\r\n const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;\r\n const routerHistory = options.history;\r\n if (false)\r\n {}\r\n const beforeGuards = useCallbacks();\r\n const beforeResolveGuards = useCallbacks();\r\n const afterGuards = useCallbacks();\r\n const currentRoute = (0,vue_esm_bundler/* shallowRef */.XI)(START_LOCATION_NORMALIZED);\r\n let pendingLocation = START_LOCATION_NORMALIZED;\r\n // leave the scrollRestoration if no scrollBehavior is provided\r\n if (isBrowser && options.scrollBehavior && 'scrollRestoration' in history) {\r\n history.scrollRestoration = 'manual';\r\n }\r\n const normalizeParams = applyToParams.bind(null, paramValue => '' + paramValue);\r\n const encodeParams = applyToParams.bind(null, encodeParam);\r\n const decodeParams = \r\n // @ts-expect-error: intentionally avoid the type check\r\n applyToParams.bind(null, decode);\r\n function addRoute(parentOrRoute, route) {\r\n let parent;\r\n let record;\r\n if (isRouteName(parentOrRoute)) {\r\n parent = matcher.getRecordMatcher(parentOrRoute);\r\n record = route;\r\n }\r\n else {\r\n record = parentOrRoute;\r\n }\r\n return matcher.addRoute(record, parent);\r\n }\r\n function removeRoute(name) {\r\n const recordMatcher = matcher.getRecordMatcher(name);\r\n if (recordMatcher) {\r\n matcher.removeRoute(recordMatcher);\r\n }\r\n else if ((false)) {}\r\n }\r\n function getRoutes() {\r\n return matcher.getRoutes().map(routeMatcher => routeMatcher.record);\r\n }\r\n function hasRoute(name) {\r\n return !!matcher.getRecordMatcher(name);\r\n }\r\n function resolve(rawLocation, currentLocation) {\r\n // const objectLocation = routerLocationAsObject(rawLocation)\r\n // we create a copy to modify it later\r\n currentLocation = vue_router_esm_bundler_assign({}, currentLocation || currentRoute.value);\r\n if (typeof rawLocation === 'string') {\r\n const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);\r\n const matchedRoute = matcher.resolve({ path: locationNormalized.path }, currentLocation);\r\n const href = routerHistory.createHref(locationNormalized.fullPath);\r\n if ((false)) {}\r\n // locationNormalized is always a new object\r\n return vue_router_esm_bundler_assign(locationNormalized, matchedRoute, {\r\n params: decodeParams(matchedRoute.params),\r\n hash: decode(locationNormalized.hash),\r\n redirectedFrom: undefined,\r\n href,\r\n });\r\n }\r\n let matcherLocation;\r\n // path could be relative in object as well\r\n if ('path' in rawLocation) {\r\n if (false) {}\r\n matcherLocation = vue_router_esm_bundler_assign({}, rawLocation, {\r\n path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path,\r\n });\r\n }\r\n else {\r\n // remove any nullish param\r\n const targetParams = vue_router_esm_bundler_assign({}, rawLocation.params);\r\n for (const key in targetParams) {\r\n if (targetParams[key] == null) {\r\n delete targetParams[key];\r\n }\r\n }\r\n // pass encoded values to the matcher so it can produce encoded path and fullPath\r\n matcherLocation = vue_router_esm_bundler_assign({}, rawLocation, {\r\n params: encodeParams(rawLocation.params),\r\n });\r\n // current location params are decoded, we need to encode them in case the\r\n // matcher merges the params\r\n currentLocation.params = encodeParams(currentLocation.params);\r\n }\r\n const matchedRoute = matcher.resolve(matcherLocation, currentLocation);\r\n const hash = rawLocation.hash || '';\r\n if (false) {}\r\n // decoding them) the matcher might have merged current location params so\r\n // we need to run the decoding again\r\n matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));\r\n const fullPath = stringifyURL(stringifyQuery$1, vue_router_esm_bundler_assign({}, rawLocation, {\r\n hash: encodeHash(hash),\r\n path: matchedRoute.path,\r\n }));\r\n const href = routerHistory.createHref(fullPath);\r\n if ((false)) {}\r\n return vue_router_esm_bundler_assign({\r\n fullPath,\r\n // keep the hash encoded so fullPath is effectively path + encodedQuery +\r\n // hash\r\n hash,\r\n query: \r\n // if the user is using a custom query lib like qs, we might have\r\n // nested objects, so we keep the query as is, meaning it can contain\r\n // numbers at `$route.query`, but at the point, the user will have to\r\n // use their own type anyway.\r\n // https://github.com/vuejs/vue-router-next/issues/328#issuecomment-649481567\r\n stringifyQuery$1 === stringifyQuery\r\n ? normalizeQuery(rawLocation.query)\r\n : (rawLocation.query || {}),\r\n }, matchedRoute, {\r\n redirectedFrom: undefined,\r\n href,\r\n });\r\n }\r\n function locationAsObject(to) {\r\n return typeof to === 'string'\r\n ? parseURL(parseQuery$1, to, currentRoute.value.path)\r\n : vue_router_esm_bundler_assign({}, to);\r\n }\r\n function checkCanceledNavigation(to, from) {\r\n if (pendingLocation !== to) {\r\n return createRouterError(8 /* NAVIGATION_CANCELLED */, {\r\n from,\r\n to,\r\n });\r\n }\r\n }\r\n function push(to) {\r\n return pushWithRedirect(to);\r\n }\r\n function replace(to) {\r\n return push(vue_router_esm_bundler_assign(locationAsObject(to), { replace: true }));\r\n }\r\n function handleRedirectRecord(to) {\r\n const lastMatched = to.matched[to.matched.length - 1];\r\n if (lastMatched && lastMatched.redirect) {\r\n const { redirect } = lastMatched;\r\n let newTargetLocation = typeof redirect === 'function' ? redirect(to) : redirect;\r\n if (typeof newTargetLocation === 'string') {\r\n newTargetLocation =\r\n newTargetLocation.includes('?') || newTargetLocation.includes('#')\r\n ? (newTargetLocation = locationAsObject(newTargetLocation))\r\n : // force empty params\r\n { path: newTargetLocation };\r\n // @ts-expect-error: force empty params when a string is passed to let\r\n // the router parse them again\r\n newTargetLocation.params = {};\r\n }\r\n if (false) {}\r\n return vue_router_esm_bundler_assign({\r\n query: to.query,\r\n hash: to.hash,\r\n params: to.params,\r\n }, newTargetLocation);\r\n }\r\n }\r\n function pushWithRedirect(to, redirectedFrom) {\r\n const targetLocation = (pendingLocation = resolve(to));\r\n const from = currentRoute.value;\r\n const data = to.state;\r\n const force = to.force;\r\n // to could be a string where `replace` is a function\r\n const replace = to.replace === true;\r\n const shouldRedirect = handleRedirectRecord(targetLocation);\r\n if (shouldRedirect)\r\n return pushWithRedirect(vue_router_esm_bundler_assign(locationAsObject(shouldRedirect), {\r\n state: data,\r\n force,\r\n replace,\r\n }), \r\n // keep original redirectedFrom if it exists\r\n redirectedFrom || targetLocation);\r\n // if it was a redirect we already called `pushWithRedirect` above\r\n const toLocation = targetLocation;\r\n toLocation.redirectedFrom = redirectedFrom;\r\n let failure;\r\n if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {\r\n failure = createRouterError(16 /* NAVIGATION_DUPLICATED */, { to: toLocation, from });\r\n // trigger scroll to allow scrolling to the same anchor\r\n handleScroll(from, from, \r\n // this is a push, the only way for it to be triggered from a\r\n // history.listen is with a redirect, which makes it become a push\r\n true, \r\n // This cannot be the first navigation because the initial location\r\n // cannot be manually navigated to\r\n false);\r\n }\r\n return (failure ? Promise.resolve(failure) : navigate(toLocation, from))\r\n .catch((error) => isNavigationFailure(error)\r\n ? error\r\n : // reject any unknown error\r\n triggerError(error, toLocation, from))\r\n .then((failure) => {\r\n if (failure) {\r\n if (isNavigationFailure(failure, 2 /* NAVIGATION_GUARD_REDIRECT */)) {\r\n if (false) {}\r\n return pushWithRedirect(\r\n // keep options\r\n vue_router_esm_bundler_assign(locationAsObject(failure.to), {\r\n state: data,\r\n force,\r\n replace,\r\n }), \r\n // preserve the original redirectedFrom if any\r\n redirectedFrom || toLocation);\r\n }\r\n }\r\n else {\r\n // if we fail we don't finalize the navigation\r\n failure = finalizeNavigation(toLocation, from, true, replace, data);\r\n }\r\n triggerAfterEach(toLocation, from, failure);\r\n return failure;\r\n });\r\n }\r\n /**\r\n * Helper to reject and skip all navigation guards if a new navigation happened\r\n * @param to\r\n * @param from\r\n */\r\n function checkCanceledNavigationAndReject(to, from) {\r\n const error = checkCanceledNavigation(to, from);\r\n return error ? Promise.reject(error) : Promise.resolve();\r\n }\r\n // TODO: refactor the whole before guards by internally using router.beforeEach\r\n function navigate(to, from) {\r\n let guards;\r\n const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);\r\n // all components here have been resolved once because we are leaving\r\n guards = extractComponentsGuards(leavingRecords.reverse(), 'beforeRouteLeave', to, from);\r\n // leavingRecords is already reversed\r\n for (const record of leavingRecords) {\r\n record.leaveGuards.forEach(guard => {\r\n guards.push(guardToPromiseFn(guard, to, from));\r\n });\r\n }\r\n const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);\r\n guards.push(canceledNavigationCheck);\r\n // run the queue of per route beforeRouteLeave guards\r\n return (runGuardQueue(guards)\r\n .then(() => {\r\n // check global guards beforeEach\r\n guards = [];\r\n for (const guard of beforeGuards.list()) {\r\n guards.push(guardToPromiseFn(guard, to, from));\r\n }\r\n guards.push(canceledNavigationCheck);\r\n return runGuardQueue(guards);\r\n })\r\n .then(() => {\r\n // check in components beforeRouteUpdate\r\n guards = extractComponentsGuards(updatingRecords, 'beforeRouteUpdate', to, from);\r\n for (const record of updatingRecords) {\r\n record.updateGuards.forEach(guard => {\r\n guards.push(guardToPromiseFn(guard, to, from));\r\n });\r\n }\r\n guards.push(canceledNavigationCheck);\r\n // run the queue of per route beforeEnter guards\r\n return runGuardQueue(guards);\r\n })\r\n .then(() => {\r\n // check the route beforeEnter\r\n guards = [];\r\n for (const record of to.matched) {\r\n // do not trigger beforeEnter on reused views\r\n if (record.beforeEnter && !from.matched.includes(record)) {\r\n if (Array.isArray(record.beforeEnter)) {\r\n for (const beforeEnter of record.beforeEnter)\r\n guards.push(guardToPromiseFn(beforeEnter, to, from));\r\n }\r\n else {\r\n guards.push(guardToPromiseFn(record.beforeEnter, to, from));\r\n }\r\n }\r\n }\r\n guards.push(canceledNavigationCheck);\r\n // run the queue of per route beforeEnter guards\r\n return runGuardQueue(guards);\r\n })\r\n .then(() => {\r\n // NOTE: at this point to.matched is normalized and does not contain any () => Promise<Component>\r\n // clear existing enterCallbacks, these are added by extractComponentsGuards\r\n to.matched.forEach(record => (record.enterCallbacks = {}));\r\n // check in-component beforeRouteEnter\r\n guards = extractComponentsGuards(enteringRecords, 'beforeRouteEnter', to, from);\r\n guards.push(canceledNavigationCheck);\r\n // run the queue of per route beforeEnter guards\r\n return runGuardQueue(guards);\r\n })\r\n .then(() => {\r\n // check global guards beforeResolve\r\n guards = [];\r\n for (const guard of beforeResolveGuards.list()) {\r\n guards.push(guardToPromiseFn(guard, to, from));\r\n }\r\n guards.push(canceledNavigationCheck);\r\n return runGuardQueue(guards);\r\n })\r\n // catch any navigation canceled\r\n .catch(err => isNavigationFailure(err, 8 /* NAVIGATION_CANCELLED */)\r\n ? err\r\n : Promise.reject(err)));\r\n }\r\n function triggerAfterEach(to, from, failure) {\r\n // navigation is confirmed, call afterGuards\r\n // TODO: wrap with error handlers\r\n for (const guard of afterGuards.list())\r\n guard(to, from, failure);\r\n }\r\n /**\r\n * - Cleans up any navigation guards\r\n * - Changes the url if necessary\r\n * - Calls the scrollBehavior\r\n */\r\n function finalizeNavigation(toLocation, from, isPush, replace, data) {\r\n // a more recent navigation took place\r\n const error = checkCanceledNavigation(toLocation, from);\r\n if (error)\r\n return error;\r\n // only consider as push if it's not the first navigation\r\n const isFirstNavigation = from === START_LOCATION_NORMALIZED;\r\n const state = !isBrowser ? {} : history.state;\r\n // change URL only if the user did a push/replace and if it's not the initial navigation because\r\n // it's just reflecting the url\r\n if (isPush) {\r\n // on the initial navigation, we want to reuse the scroll position from\r\n // history state if it exists\r\n if (replace || isFirstNavigation)\r\n routerHistory.replace(toLocation.fullPath, vue_router_esm_bundler_assign({\r\n scroll: isFirstNavigation && state && state.scroll,\r\n }, data));\r\n else\r\n routerHistory.push(toLocation.fullPath, data);\r\n }\r\n // accept current navigation\r\n currentRoute.value = toLocation;\r\n handleScroll(toLocation, from, isPush, isFirstNavigation);\r\n markAsReady();\r\n }\r\n let removeHistoryListener;\r\n // attach listener to history to trigger navigations\r\n function setupListeners() {\r\n removeHistoryListener = routerHistory.listen((to, _from, info) => {\r\n // cannot be a redirect route because it was in history\r\n const toLocation = resolve(to);\r\n // due to dynamic routing, and to hash history with manual navigation\r\n // (manually changing the url or calling history.hash = '#/somewhere'),\r\n // there could be a redirect record in history\r\n const shouldRedirect = handleRedirectRecord(toLocation);\r\n if (shouldRedirect) {\r\n pushWithRedirect(vue_router_esm_bundler_assign(shouldRedirect, { replace: true }), toLocation).catch(noop);\r\n return;\r\n }\r\n pendingLocation = toLocation;\r\n const from = currentRoute.value;\r\n // TODO: should be moved to web history?\r\n if (isBrowser) {\r\n saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());\r\n }\r\n navigate(toLocation, from)\r\n .catch((error) => {\r\n if (isNavigationFailure(error, 4 /* NAVIGATION_ABORTED */ | 8 /* NAVIGATION_CANCELLED */)) {\r\n return error;\r\n }\r\n if (isNavigationFailure(error, 2 /* NAVIGATION_GUARD_REDIRECT */)) {\r\n // Here we could call if (info.delta) routerHistory.go(-info.delta,\r\n // false) but this is bug prone as we have no way to wait the\r\n // navigation to be finished before calling pushWithRedirect. Using\r\n // a setTimeout of 16ms seems to work but there is not guarantee for\r\n // it to work on every browser. So Instead we do not restore the\r\n // history entry and trigger a new navigation as requested by the\r\n // navigation guard.\r\n // the error is already handled by router.push we just want to avoid\r\n // logging the error\r\n pushWithRedirect(error.to, toLocation\r\n // avoid an uncaught rejection, let push call triggerError\r\n )\r\n .then(failure => {\r\n // manual change in hash history #916 ending up in the URL not\r\n // changing but it was changed by the manual url change, so we\r\n // need to manually change it ourselves\r\n if (isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ |\r\n 16 /* NAVIGATION_DUPLICATED */) &&\r\n !info.delta &&\r\n info.type === NavigationType.pop) {\r\n routerHistory.go(-1, false);\r\n }\r\n })\r\n .catch(noop);\r\n // avoid the then branch\r\n return Promise.reject();\r\n }\r\n // do not restore history on unknown direction\r\n if (info.delta)\r\n routerHistory.go(-info.delta, false);\r\n // unrecognized error, transfer to the global handler\r\n return triggerError(error, toLocation, from);\r\n })\r\n .then((failure) => {\r\n failure =\r\n failure ||\r\n finalizeNavigation(\r\n // after navigation, all matched components are resolved\r\n toLocation, from, false);\r\n // revert the navigation\r\n if (failure) {\r\n if (info.delta) {\r\n routerHistory.go(-info.delta, false);\r\n }\r\n else if (info.type === NavigationType.pop &&\r\n isNavigationFailure(failure, 4 /* NAVIGATION_ABORTED */ | 16 /* NAVIGATION_DUPLICATED */)) {\r\n // manual change in hash history #916\r\n // it's like a push but lacks the information of the direction\r\n routerHistory.go(-1, false);\r\n }\r\n }\r\n triggerAfterEach(toLocation, from, failure);\r\n })\r\n .catch(noop);\r\n });\r\n }\r\n // Initialization and Errors\r\n let readyHandlers = useCallbacks();\r\n let errorHandlers = useCallbacks();\r\n let ready;\r\n /**\r\n * Trigger errorHandlers added via onError and throws the error as well\r\n *\r\n * @param error - error to throw\r\n * @param to - location we were navigating to when the error happened\r\n * @param from - location we were navigating from when the error happened\r\n * @returns the error as a rejected promise\r\n */\r\n function triggerError(error, to, from) {\r\n markAsReady(error);\r\n const list = errorHandlers.list();\r\n if (list.length) {\r\n list.forEach(handler => handler(error, to, from));\r\n }\r\n else {\r\n if ((false)) {}\r\n console.error(error);\r\n }\r\n return Promise.reject(error);\r\n }\r\n function isReady() {\r\n if (ready && currentRoute.value !== START_LOCATION_NORMALIZED)\r\n return Promise.resolve();\r\n return new Promise((resolve, reject) => {\r\n readyHandlers.add([resolve, reject]);\r\n });\r\n }\r\n /**\r\n * Mark the router as ready, resolving the promised returned by isReady(). Can\r\n * only be called once, otherwise does nothing.\r\n * @param err - optional error\r\n */\r\n function markAsReady(err) {\r\n if (ready)\r\n return;\r\n ready = true;\r\n setupListeners();\r\n readyHandlers\r\n .list()\r\n .forEach(([resolve, reject]) => (err ? reject(err) : resolve()));\r\n readyHandlers.reset();\r\n }\r\n // Scroll behavior\r\n function handleScroll(to, from, isPush, isFirstNavigation) {\r\n const { scrollBehavior } = options;\r\n if (!isBrowser || !scrollBehavior)\r\n return Promise.resolve();\r\n const scrollPosition = (!isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0))) ||\r\n ((isFirstNavigation || !isPush) &&\r\n history.state &&\r\n history.state.scroll) ||\r\n null;\r\n return (0,vue_esm_bundler/* nextTick */.Y3)()\r\n .then(() => scrollBehavior(to, from, scrollPosition))\r\n .then(position => position && scrollToPosition(position))\r\n .catch(err => triggerError(err, to, from));\r\n }\r\n const go = (delta) => routerHistory.go(delta);\r\n let started;\r\n const installedApps = new Set();\r\n const router = {\r\n currentRoute,\r\n addRoute,\r\n removeRoute,\r\n hasRoute,\r\n getRoutes,\r\n resolve,\r\n options,\r\n push,\r\n replace,\r\n go,\r\n back: () => go(-1),\r\n forward: () => go(1),\r\n beforeEach: beforeGuards.add,\r\n beforeResolve: beforeResolveGuards.add,\r\n afterEach: afterGuards.add,\r\n onError: errorHandlers.add,\r\n isReady,\r\n install(app) {\r\n const router = this;\r\n app.component('RouterLink', RouterLink);\r\n app.component('RouterView', RouterView);\r\n app.config.globalProperties.$router = router;\r\n Object.defineProperty(app.config.globalProperties, '$route', {\r\n enumerable: true,\r\n get: () => (0,vue_esm_bundler/* unref */.SU)(currentRoute),\r\n });\r\n // this initial navigation is only necessary on client, on server it doesn't\r\n // make sense because it will create an extra unnecessary navigation and could\r\n // lead to problems\r\n if (isBrowser &&\r\n // used for the initial navigation client side to avoid pushing\r\n // multiple times when the router is used in multiple apps\r\n !started &&\r\n currentRoute.value === START_LOCATION_NORMALIZED) {\r\n // see above\r\n started = true;\r\n push(routerHistory.location).catch(err => {\r\n if ((false))\r\n {}\r\n });\r\n }\r\n const reactiveRoute = {};\r\n for (const key in START_LOCATION_NORMALIZED) {\r\n // @ts-expect-error: the key matches\r\n reactiveRoute[key] = (0,vue_esm_bundler/* computed */.Fl)(() => currentRoute.value[key]);\r\n }\r\n app.provide(routerKey, router);\r\n app.provide(routeLocationKey, (0,vue_esm_bundler/* reactive */.qj)(reactiveRoute));\r\n app.provide(routerViewLocationKey, currentRoute);\r\n const unmountApp = app.unmount;\r\n installedApps.add(app);\r\n app.unmount = function () {\r\n installedApps.delete(app);\r\n // the router is not attached to an app anymore\r\n if (installedApps.size < 1) {\r\n // invalidate the current navigation\r\n pendingLocation = START_LOCATION_NORMALIZED;\r\n removeHistoryListener && removeHistoryListener();\r\n currentRoute.value = START_LOCATION_NORMALIZED;\r\n started = false;\r\n ready = false;\r\n }\r\n unmountApp();\r\n };\r\n if (false) {}\r\n },\r\n };\r\n return router;\r\n}\r\nfunction runGuardQueue(guards) {\r\n return guards.reduce((promise, guard) => promise.then(() => guard()), Promise.resolve());\r\n}\r\nfunction extractChangingRecords(to, from) {\r\n const leavingRecords = [];\r\n const updatingRecords = [];\r\n const enteringRecords = [];\r\n const len = Math.max(from.matched.length, to.matched.length);\r\n for (let i = 0; i < len; i++) {\r\n const recordFrom = from.matched[i];\r\n if (recordFrom) {\r\n if (to.matched.find(record => isSameRouteRecord(record, recordFrom)))\r\n updatingRecords.push(recordFrom);\r\n else\r\n leavingRecords.push(recordFrom);\r\n }\r\n const recordTo = to.matched[i];\r\n if (recordTo) {\r\n // the type doesn't matter because we are comparing per reference\r\n if (!from.matched.find(record => isSameRouteRecord(record, recordTo))) {\r\n enteringRecords.push(recordTo);\r\n }\r\n }\r\n }\r\n return [leavingRecords, updatingRecords, enteringRecords];\r\n}\n\n/**\r\n * Returns the router instance. Equivalent to using `$router` inside\r\n * templates.\r\n */\r\nfunction useRouter() {\r\n return inject(routerKey);\r\n}\r\n/**\r\n * Returns the current route location. Equivalent to using `$route` inside\r\n * templates.\r\n */\r\nfunction useRoute() {\r\n return inject(routeLocationKey);\r\n}\n\n\n\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[6].use[0]!./interface/html5/components/LegacyView.vue?vue&type=template&id=374ba4a8\n\n\nconst _hoisted_1 = {\n id: \"contentContainer\",\n class: \"content-container\"\n}\nconst _hoisted_2 = /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)(\"div\", { class: \"loading-view\" }, [\n /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)(\"div\", { class: \"progress-bar-div\" }, [\n /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)(\"progress\", {\n class: \"progress-bar\",\n max: \"100\",\n value: \"10\"\n }, [\n /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)(\"strong\", null, \"Progress: 100% Complete.\")\n ]),\n /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)(\"span\", { class: \"progress-label\" }, \"Initializing...\")\n ])\n], -1 /* HOISTED */)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return ((0,vue_esm_bundler/* openBlock */.wg)(), (0,vue_esm_bundler/* createElementBlock */.iD)(\"div\", _hoisted_1, _hoisted_3))\n}\n;// CONCATENATED MODULE: ./interface/html5/components/LegacyView.vue?vue&type=template&id=374ba4a8\n\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[6].use[0]!./interface/html5/components/LegacyView.vue?vue&type=script&lang=js\n\n\n/* harmony default export */ const LegacyViewvue_type_script_lang_js = ({\n name: \"LegacyView\",\n components: {}\n});\n\n;// CONCATENATED MODULE: ./interface/html5/components/LegacyView.vue?vue&type=script&lang=js\n \n// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js\nvar exportHelper = __webpack_require__(3744);\n;// CONCATENATED MODULE: ./interface/html5/components/LegacyView.vue\n\n\n\n\n;\nconst __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(LegacyViewvue_type_script_lang_js, [['render',render]])\n\n/* harmony default export */ const LegacyView = (__exports__);\n;// CONCATENATED MODULE: ./interface/html5/components/main_ui_router.js\n// import { createRouter, createWebHistory } from 'vue-router'\n\n\n\n// import ReportView from '@/components/ReportView';\n\nconst lazy_load_test = () => __webpack_require__.e(/* import() | dynamic-testview */ \"dynamic-testview\").then(__webpack_require__.bind(__webpack_require__, 1136)); // #VUETEST\n\n// Can also import this from another file.\nconst routes = [\n\t{ path: '/test', name: 'test', component: lazy_load_test, props:true }, // #VUETEST Lazy loaded, so not loaded normally. Only when used with `VueRouter.push('test')` or via dev tools.\n\t// { path: '/view/:viewId', name: 'view', component: LegacyView, props:true },\n\t// { path: '/report/:viewId', name: 'report', component: ReportView, props:true },\n\t// { path: '/report/:reportId', name: 'report', component: LegacyView },\n\t// { path: '/wizard/:wizardId', name: 'wizard', component: LegacyView },\n\t{ path: '/:pathMatch(.*)*', name: 'catch-all', component: LegacyView },\n\t// { path: '/#!m=Login', name: 'not-found', component: LegacyView },\n\t// { path: '/#!m=:viewId&*:restOf(.*)', name: 'not-found', component: LegacyView },\n\n];\n\nconst main_ui_router = createRouter({\n\t// history: createWebHistory(),\n\thistory: createMemoryHistory(),\n\troutes,\n});\n\n/* harmony default export */ const components_main_ui_router = (main_ui_router);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIzNy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ2lNO0FBQ3pJOztBQUV4RDtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWMsTUFBcUMsSUFBSSxDQUF1QjtBQUM5RSxRQUFRLE1BQXFDLElBQUksQ0FBZ0I7QUFDakU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGtEQUFrRCxNQUFxQyxJQUFJLENBQThCO0FBQ3pIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLCtDQUErQyxNQUFxQyxJQUFJLENBQW1CO0FBQzNHO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDRDQUE0QyxNQUFxQyxJQUFJLENBQVE7QUFDN0Y7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsbURBQW1ELE1BQXFDLElBQUksQ0FBZ0I7QUFDNUc7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0Esd0RBQXdELE1BQ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ICAgICAgICAgLy8gcmV0dXJuIHRvIGF2b2lkIG90aGVyIHdhcm5pbmdzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjYXRjaCAoZXJyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihgVGhlIHNlbGVjdG9yIFwiJHtwb3NpdGlvbi5lbH1cIiBpcyBpbnZhbGlkLiBJZiB5b3UgYXJlIHVzaW5nIGFuIGlkIHNlbGVjdG9yLCBtYWtlIHN1cmUgdG8gZXNjYXBlIGl0LiBZb3UgY2FuIGZpbmQgbW9yZSBpbmZvcm1hdGlvbiBhYm91dCBlc2NhcGluZyBjaGFyYWN0ZXJzIGluIHNlbGVjdG9ycyBhdCBodHRwczovL21hdGhpYXNieW5lbnMuYmUvbm90ZXMvY3NzLWVzY2FwZXMgb3IgdXNlIENTUy5lc2NhcGUgKGh0dHBzOi8vZGV2ZWxvcGVyLm1vemlsbGEub3JnL2VuLVVTL2RvY3MvV2ViL0FQSS9DU1MvZXNjYXBlKS5gKTtcclxuICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gdG8gYXZvaWQgb3RoZXIgd2FybmluZ3NcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3QgZWwgPSB0eXBlb2YgcG9zaXRpb25FbCA9PT0gJ3N0cmluZydcclxuICAgICAgICAgICAgPyBpc0lkU2VsZWN0b3JcclxuICAgICAgICAgICAgICAgID8gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQocG9zaXRpb25FbC5zbGljZSgxKSlcclxuICAgICAgICAgICAgICAgIDogZG9jdW1lbnQucXVlcnlTZWxlY3Rvcihwb3NpdGlvbkVsKVxyXG4gICAgICAgICAgICA6IHBvc2l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sc29cclxuICAgICAgICAvLyBuZWVkIHRvIGJlIHBhc3NlZCB0byB0aGUgbGlzdGVuZXJzIHNvIHRoZSBuYXZpZ2F0aW9uIGNhbiBiZSBhY2NlcHRlZFxyXG4gICAgICAgIC8vIGNhbGwgYWxsIGxpc3RlbmVyc1xyXG4gICAgICAgIGxpc3RlbmVycy5mb3JFYWNoKGxpc3RlbmVyID0+IHtcclxuICAgICAgICAgICAgbGlzdGVuZXIoY3VycmVudExvY2F0aW9uLnZhbHVlLCBmcm9tLCB7XHJcbiAgICAgICAgICAgICAgICBkZWx0YSxcclxuICAgICAgICAgICAgICAgIHR5cGU6IE5hdmlnYXRpb25UeXBlLnBvcCxcclxuICAgICAgICAgICAgICAgIGRpcmVjdGlvbjogZGVsdGFcclxuICAgICAgICAgICAgICAgICAgICA/IGRlbHRhID4gMFxyXG4gICAgICAgICAgICAgICAgICAgICAgICA/IE5hdmlnYXRpb25EaXJlY3Rpb24uZm9yd2FyZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IE5hdmlnYXRpb25EaXJlY3Rpb24uYmFja1xyXG4gICAgICAgICAgICAgICAgICAgIDogTmF2aWdhdGlvbkRpcmVjdGlvbi51bmtub3duLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9KTtcclxuICAgIH07XHJcbiAgICBmdW5jdGlvbiBwYXVzZUxpc3RlbmVycygpIHtcclxuICAgICAgICBwYXVzZVN0YXRlID0gY3VycmVudExvY2F0aW9uLnZhbHVlO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gbGlzdGVuKGNhbGxiYWNrKSB7XHJcbiAgICAgICAgLy8gc2V0dXAgdGhlIGxpc3RlbmVyIGFuZCBwcmVwYXJlIHRlYXJkb3duIGNhbGxiYWNrc1xyXG4gICAgICAgIGxpc3RlbmVycy5wdXNoKGNhbGxiYWNrKTtcclxuICAgICAgICBjb25zdCB0ZWFyZG93biA9ICgpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgaW5kZX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mluZVByb3BlcnR5XHJcbiAgICAgICAgbG9jYXRpb246IFNUQVJULFxyXG4gICAgICAgIC8vIFRPRE86IHNob3VsZCBiZSBrZXB0IGluIHF1ZXVlXHJcbiAgICAgICAgc3RhdGU6IHt9LFxyXG4gICAgICAgIGJhc2UsXHJcbiAgICAgICAgY3JlYXRlSHJlZjogY3JlYXRlSHJlZi5iaW5kKG51bGwsIGJhc2UpLFxyXG4gICAgICAgIHJlcGxhY2UodG8pIHtcclxuICAgICAgICAgICAgLy8gcmVtb3ZlIGN1cnJlbnQgZW50cnkgYW5kIGRlY3JlbWVudCBwb3NpdGlvblxyXG4gICAgICAgICAgICBxdWV1ZS5zcGxpY2UocG9zaXRpb24tLSwgMSk7XHJcbiAgICAgICAgICAgIHNldExvY2F0aW9uKHRvKTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHB1c2godG8sIGRhdGEpIHtcclxuICAgICAgICAgICAgc2V0TG9jYXRpb24odG8pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgbGlzdGVuKGNhbGxiYWNrKSB7XHJcbiAgICAgICAgICAgIGxpc3RlbmVycy5wdXNoKGNhbGxiYWNrKTtcclxuICAgICAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gbGlzdGVuZXJzLmluZGV4T2YoY2FsbGJhY2spO1xyXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpXHJcbiAgICAgICAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpbmRleCwgMSk7XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfSxcclxuICAgICAgICBkZXN0cm95KCkge1xyXG4gICAgICAgICAgICBsaXN0ZW5lcnMgPSBbXTtcclxuICAgICAgICAgICAgcXVldWUgPSBbU1RBUlRdO1xyXG4gICAgICAgICAgICBwb3NpdGlvbiA9IDA7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBnbyhkZWx0YSwgc2hvd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AgICAgICAgIGlmICghdG9rZW5JbmRleClcclxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuICs9ICcvJztcclxuICAgICAgICAgICAgICAgIHBhdHRlcm4gKz0gdG9rZW4udmFsdWUucmVwbGFjZShSRUdFWF9DSEFSU19SRSwgJ1xcXFwkJicpO1xyXG4gICAgICAgICAgICAgICAgc3ViU2VnbWVudFNjb3JlICs9IDQwIC8qIFN0YXRpYyAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICh0b2tlbi50eXBlID09PSAxIC8qIFBhcmFtICovKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IHZhbHVlLCByZXBlYXRhYmxlLCBvcHRpb25hbCwgcmVnZXhwIH0gPSB0b2tlbjtcclxuICAgICAgICAgICAgICAgIGtleXMucHVzaCh7XHJcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogdmFsdWUsXHJcbiAgICAgICAgICAgICAgICAgICAgcmVwZWF0YWJsZSxcclxuICAgICAgICAgICAgICAgICAgICBvcHRpb25hbCxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcmUgPSByZWdleHAgPyByZWdleHAgOiBCQVNFX1BBUkFNX1BBVFRFUk47XHJcbiAgICAgICAgICAgICAgICAvLyB0aGUgdXNlciBwcm92aWRlZCBhIGN1c3RvbSByZWdleHAgLzppZChcXFxcZCspXHJcbiAgICAgICAgICAgICAgICBpZiAocmUgIT09IEJBU0VfUEFSQU1fUEFUVEVSTikge1xyXG4gICAgICAgICAgICAgICAgICAgIHN1YlNlZ21lbnRTY29yZSArPSAxMCAvKiBCb251c0N1c3RvbVJlZ0V4cCAqLztcclxuICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgdGhlIHJlZ2V4cCBpcyB2YWxpZCBiZWZvcmUgdXNpbmcgaXRcclxuICAgICAgICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgUmVnRXhwKGAoJHtyZX0pYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlcnIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIGN1c3RvbSBSZWdFeHAgZm9yIHBhcmFtIFwiJHt2YWx1ZX1cIiAoJHtyZX0pOiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVyci5tZXNzYWdlKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyB3aGVuIHdlIHJlcGVhdCB3ZSBtdXN0IHRha2UgY2FyZSBvZiB0aGUgcmVwZWF0aW5nIGxlYWRpbmcgc2xhc2hcclxuICAgICAgICAgICAgICAgIGxldCBzdWJQYXR0ZXJuID0gcmVwZWF0YWJsZSA/IGAoKD86JHtyZX0pKD86Lyg/OiR7cmV9KSkqKWAgOiBgKCR7cmV9KWA7XHJcbiAgICAgICAgICAgICAgICAvLyBwcmVwZW5kIHRoZSBzbGFzaCBpZiB3ZSBhcmUgc3RhcnRpbmcgYSBuZXcgc2VnbWVudFxyXG4gICAgICAgICAgICAgICAgaWYgKCF0b2tlbkluZGV4KVxyXG4gICAgICAgICAgICAgICAgICAgIHN1YlBhdHRlcm4gPVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBhdm9pZCBhbiBvcHRpb25hbCAvIGlmIHRoZXJlIGFyZSBtb3JlIHNlZ21lbnRzIGUuZy4gLzpwPy1zdGF0aWNcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3IgLzpwPy06cDJcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uYWwgJiYgc2VnbWVudC5sZW5ndGggPCAyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGAoPzovJHtzdWJQYXR0ZXJufSlgXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICcvJyArIHN1YlBhdHRlcm47XHJcbiAgICAgICAgICAgICAgICBpZiAob3B0aW9uYWwpXHJcbiAgICAgICAgICAgICAgICAgICAgc3ViUGF0dGVybiArPSAnPyc7XHJcbiAgICAgICAgICAgICAgICBwYXR0ZXJuICs9IHN1YlBhdHRlcm47XHJcbiAgICAgICAgICAgICAgICBzdWJTZWdtZW50U2NvcmUgKz0gMjAgLyogRHluYW1pYyAqLztcclxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25hbClcclxuICAgICAgICAgICAgICAgICAgICBzdWJTZWdtZW50U2NvcmUgKz0gLTggLyogQm9udXNPcHRpb25hbCAqLztcclxuICAgICAgICAgICAgICAgIGlmIChyZXBlYXRhYmxlKVxyXG4gICAgICAgICAgICAgICAgICAgIHN1YlNlZ21lbnRTY29yZSArPSAtMjAgLyogQm9udXNSZXBlYXRhYmxlICovO1xyXG4gICAgICAgICAgICAgICAgaWYgKHJlID09PSAnLionKVxyXG4gICAgICAgICAgICAgICAgICAgIHN1YlNlZ21lbnRTY29yZSArPSAtNTAgLyogQm9udXNXaWxkY2FyZCAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBzZWdtZW50U2NvcmVzLnB1c2goc3ViU2VnbWVudFNjb3JlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gYW4gZW1wdHkgYXJyYXkgbGlrZSAvaG9tZS8gLT4gW1t7aG9tZX1dLCBbXV1cclxuICAgICAgICAvLyBpZiAoIXNlZ21lbnQubGVuZ3RoKSBwYXR0ZXJuICs9ICcvJ1xyXG4gICAgICAgIHNjb3JlLnB1c2goc2VnbWVudFNjb3Jlcyk7XHJcbiAgICB9XHJcbiAgICAvLyBvbmx5IGFwcGx5IHRoZSBzdHJpY3QgYm9udXMgdG8gdGhlIGxhc3Qgc2NvcmVcclxuICAgIGlmIChvcHRpb25zLnN0cmljdCAmJiBvcHRpb25zLmVuZCkge1xyXG4gICAgIC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5hbWVdID0gdmFsdWUgJiYga2V5LnJlcGVhdGFibGUgPyB2YWx1ZS5zcGxpdCgnLycpIDogdmFsdWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBwYXJhbXM7XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBzdHJpbmdpZnkocGFyYW1zKSB7XHJcbiAgICAgICAgbGV0IHBhdGggPSAnJztcclxuICAgICAgICAvLyBmb3Igb3B0aW9uYWwgcGFyYW1ldGVycyB0byBhbGxvdyB0byBiZSBlbXB0eVxyXG4gICAgICAgIGxldCBhdm9pZER1cGxpY2F0ZWRTbGFzaCA9IGZhbHNlO1xyXG4gICAgICAgIGZvciAoY29uc3Qgc2VnbWVudCBvZiBzZWdtZW50cykge1xyXG4gICAgICAgICAgICBpZiAoIWF2b2lkRHVwbGljYXRlZFNsYXNoIHx8ICFwYXRoLmVuZHNXaXRoKCcvJykpXHJcbiAgICAgICAgICAgICAgICBwYXRoICs9ICcvJztcclxuICAgICAgICAgICAgYXZvaWREdXBsaWNhdGVkU2xhc2ggPSBmYWxzZTtcclxuICAgICAgICAgICAgZm9yIChjb25zdCB0b2tlbiBvZiBzZWdtZW50KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMCAvKiBTdGF0aWMgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBwYXRoICs9IHRva2VuLnZhbHVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodG9rZW4udHlwZSA9PT0gMSAvKiBQYXJhbSAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHsgdmFsdWUsIHJlcGVhdGFibGUsIG9wdGlvbmFsIH0gPSB0b2tlbjtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBwYXJhbSA9IHZhbHVlIGluIHBhcmFtcyA/IHBhcmFtc1t2YWx1ZV0gOiAnJztcclxuICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShwYXJhbSkgJiYgIXJlcGVhdGFibGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgUHJvdmlkZWQgcGFyYW0gXCIke3ZhbHVlfVwiIGlzIGFuIGFycmF5IGJ1dCBpdCBpcyBub3QgcmVwZWF0YWJsZSAoKiBvciArIG1vZGlmaWVycylgKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gQXJyYXkuaXNBcnJheShwYXJhbSkgPyBwYXJhbS5qb2luKCcvJykgOiBwYXJhbTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXRleHQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wdGlvbmFsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB3ZSBoYXZlIG1vcmUgdGhhbiBvbmUgb3B0aW9uYWwgcGFyYW0gbGlrZSAvOmE/LXN0YXRpYyB3ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgbmVlZCB0byBjYXJlIGFib3V0IHRoZSBvcHRpb25hbCBwYXJhbVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoIDwgMikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSB0aGUgbGFzdCBzbGFzaCBhcyB3ZSBjb3VsZCBiZSBhdCB0aGUgZW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhdGguZW5kc1dpdGgoJy8nKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aCA9IHBhdGguc2xpY2UoMCwgLTEpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvIG5vdCBhcHBlbmQgYSBzbGFzaCBvbiB0aGUgbmV4dCBpdGVyYXRpb25cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2b2lkRHVwbGljYXRlZFNsYXNoID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYE1pc3NpbmcgcmVxdWlyZWQgcGFyYW0gXCIke3ZhbHVlfVwiYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHBhdGggKz0gdGV4dDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gcGF0aDtcclxuICAgIH1cclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgcmUsXHJcbiAgICAgICAgc2NvcmUsXHJcbiAgICAgICAga2V5cyxcclxuICAgICAgICBwYXJzZSxcclxuICAgICAgICBzdHJpbmdpZnksXHJcbiAgICB9O1xyXG59XHJcbi8qKlxyXG4gKiBDb21wYXJlcyBhbiBhcnJheSBvZiBudW1iZXJzIGFzIHVzZWQgaW4gUGF0aFBhcnNlci5zY29yZSBhbmQgcmV0dXJucyBhXHJcbiAqIG51bWJlci4gVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBgc29ydGAgYW4gYXJyYXlcclxuICpcclxuICogQHBhcmFtIGEgLSBmaXJzdCBhcnJheSBvZiBudW1iZXJzXHJcbiAqIEBwYXJhbSBiIC0gc2Vjb25kIGFycmF5IG9mIG51bWJlcnNcclxuICogQHJldHVybnMgMCBpZiBib3RoIGFyZSBlcXVhbCwgPCAwIGlmIGEgc2hvdWxkIGJlIHNvcnRlZCBmaXJzdCwgPiAwIGlmIGJcclxuICogc2hvdWxkIGJ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AgICAgICAgdHlwZTogMCAvKiBTdGF0aWMgKi8sXHJcbiAgICAgICAgICAgICAgICB2YWx1ZTogYnVmZmVyLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoc3RhdGUgPT09IDEgLyogUGFyYW0gKi8gfHxcclxuICAgICAgICAgICAgc3RhdGUgPT09IDIgLyogUGFyYW1SZWdFeHAgKi8gfHxcclxuICAgICAgICAgICAgc3RhdGUgPT09IDMgLyogUGFyYW1SZWdFeHBFbmQgKi8pIHtcclxuICAgICAgICAgICAgaWYgKHNlZ21lbnQubGVuZ3RoID4gMSAmJiAoY2hhciA9PT0gJyonIHx8IGNoYXIgPT09ICcrJykpXHJcbiAgICAgICAgICAgICAgICBjcmFzaChgQSByZXBlYXRhYmxlIHBhcmFtICgke2J1ZmZlcn0pIG11c3QgYmUgYWxvbmUgaW4gaXRzIHNlZ21lbnQuIGVnOiAnLzppZHMrLmApO1xyXG4gICAgICAgICAgICBzZWdtZW50LnB1c2goe1xyXG4gICAgICAgICAgICAgICAgdHlwZTogMSAvKiBQYXJhbSAqLyxcclxuICAgICAgICAgICAgICAgIHZhbHVlOiBidWZmZXIsXHJcbiAgICAgICAgICAgICAgICByZWdleHA6IGN1c3RvbVJlLFxyXG4gICAgICAgICAgICAgICAgcmVwZWF0YWJsZTogY2hhciA9PT0gJyonIHx8IGNoYXIgPT09ICcrJyxcclxuICAgICAgICAgICAgICAgIG9wdGlvbmFsOiBjaGFyID09PSAnKicgfHwgY2hhciA9PT0gJz8nLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGNyYXNoKCdJbnZhbGlkIHN0YXRlIHRvIGNvbnN1bWUgYnVmZmVyJyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGJ1ZmZlciA9ICcnO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gYWRkQ2hhclRvQnVmZmVyKCkge1xyXG4gICAgICAgIGJ1ZmZlciArPSBjaGFyO1xyXG4gICAgfVxyXG4gICAgd2hpbGUgKGkgPCBwYXRoLmxlbmd0aCkge1xyXG4gICAgICAgIGNoYXIgPSBwYXRoW2krK107XHJcbiAgICAgICAgaWYgKGNoYXIgPT09ICdcXFxcJyAmJiBzdGF0ZSAhPT0gMiAvKiBQYXJhbVJlZ0V4cCAqLykge1xyXG4gICAgICAgICAgICBwcmV2aW91c1N0YXRlID0gc3RhdGU7XHJcbiAgICAgICAgICAgIHN0YXRlID0gNCAvKiBFc2NhcGVOZXh0ICovO1xyXG4gICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgc3dpdGNoIChzdGF0ZSkge1xyXG4gICAgICAgICAgICBjYXNlIDAgLyogU3RhdGljICovOlxyXG4gICAgICAgICAgICAgICAgaWYgKGNoYXIgPT09ICcvJykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChidWZmZXIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3VtZUJ1ZmZlcigpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBmaW5hbGl6ZVNlZ21lbnQoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNoYXIgPT09ICc6Jykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN1bWVCdWZmZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IDEgLyogUGFyYW0gKi87XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBhZGRDaGFyVG9CdWZmZXIoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIDQgLyogRXNjYXBlTmV4dCAqLzpcclxuICAgICAgICAgICAgICAgIGFkZENoYXJUb0J1ZmZlcigpO1xyXG4gICAgICAgICAgICAgICAgc3RhdGUgPSBwcmV2aW91c1N0YXRlO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgMSAvKiBQYXJhbSAqLzpcclxuICAgICAgICAgICAgICAgIGlmIChjaGFyID09PSAnKCcpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IDIgLyogUGFyYW1SZWdFeHAgKi87XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChWQUxJRF9QQVJBTV9SRS50ZXN0KGNoYXIpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgYWRkQ2hhclRvQnVmZmVyKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdW1lQnVmZmVyKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSAwIC8qIFN0YXRpYyAqLztcclxuICAgICAgICAgICAgICAgICAgICAvLyBnbyBiYWNrIG9uZSBjaGFyYWN0ZXIgaWYgd2Ugd2VyZSBub3QgbW9kaWZ5aW5nXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoYXIgIT09ICcqJyAmJiBjaGFyICE9PSAnPycgJiYgY2hhciAhPT0gJysnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpLS07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAyIC8qIFBhcmFtUmVnRXhwICovOlxyXG4gICAgICAgICAgICAgICAgLy8gVE9ETzogaXMgaXQgd29ydGggaGFuZGxpbmcgbmVzdGVkIHJlZ2V4cD8gbGlrZSA6cCg/OnByZWZpeF8oW14vXSspX3N1ZmZpeClcclxuICAgICAgICAgICAgICAgIC8vIGl0IGFscmVhZHkgd29ya3MgYnkgZXNjYXBpbmcgdGhlIGNsb3NpbmcgKVxyXG4gICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9wYXRocy5lc20uZGV2Lz9wPUFBTWVKYmlBd1FFY0RLYkFvQUFrUDYwUEcyUjZRQXZnTmFBNkFGQUNNMkFCdVFCQiNcclxuICAgICAgICAgICAgICAgIC8vIGlzIHRoaXMgcmVhbGx5IHNvbWV0aGluZyBwZW9wbGUgbmVlZCBzaW5jZSB5b3UgY2FuIGFsc28gd3JpdGVcclxuICAgICAgICAgICAgICAgIC8vIC9wcmVmaXhfOnAoKV9zdWZmaXhcclxuICAgICAgICAgICAgICAgIGlmIChjaGFyID09PSAnKScpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBoYW5kbGUgdGhlIGVzY2FwZWQgKVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjdXN0b21SZVtjdXN0b21SZS5sZW5ndGggLSAxXSA9PSAnXFxcXCcpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGN1c3RvbVJlID0gY3VzdG9tUmUuc2xpY2UoMCwgLTEpICsgY2hhcjtcclxuICAgICAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gMyAvKiBQYXJhbVJlZ0V4cEVuZCAqLztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbVJlICs9IGNoYXI7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAzIC8qIFBhcmFtUmVnRXhwRW5kICovOlxyXG4gICAgICAgICAgICAgICAgLy8gc2FtZSBhcyBmaW5hbGl6aW5nIGEgcGFyYW1cclxuICAgICAgICAgICAgICAgIGNvbnN1bWVCdWZmZXIoKTtcclxuICAgICAgICAgICAgICAgIHN0YXRlID0gMCAvKiBTdGF0a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JcbiAgICAgICAgICAgICAgICAgICAgICAgID8gb3JpZ2luYWxSZWNvcmQucmVjb3JkLmNvbXBvbmVudHNcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiBtYWluTm9ybWFsaXplZFJlY29yZC5jb21wb25lbnRzLFxyXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IGFsaWFzLFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHdlIG1pZ2h0IGJlIHRoZSBjaGlsZCBvZiBhbiBhbGlhc1xyXG4gICAgICAgICAgICAgICAgICAgIGFsaWFzT2Y6IG9yaWdpbmFsUmVjb3JkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gb3JpZ2luYWxSZWNvcmQucmVjb3JkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbWFpbk5vcm1hbGl6ZWRSZWNvcmQsXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGFsaWFzZXMgYXJlIGFsd2F5cyBvZiB0aGUgc2FtZSBraW5kIGFzIHRoZSBvcmlnaW5hbCBzaW5jZSB0aGV5XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gYXJlIGRlZmluZWQgb24gdGhlIHNhbWUgcmVjb3JkXHJcbiAgICAgICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IG1hdGNoZXI7XHJcbiAgICAgICAgbGV0IG9yaWdpbmFsTWF0Y2hlcjtcclxuICAgICAgICBmb3IgKGNvbnN0IG5vcm1hbGl6ZWRSZWNvcmQgb2Ygbm9ybWFsaXplZFJlY29yZHMpIHtcclxuICAgICAgICAgICAgY29uc3QgeyBwYXRoIH0gPSBub3JtYWxpemVkUmVjb3JkO1xyXG4gICAgICAgICAgICAvLyBCdWlsZCB1cCB0aGUgcGF0aCBmb3IgbmVzdGVkIHJvdXRlcyBpZiB0aGUgY2hpbGQgaXNuJ3QgYW4gYWJzb2x1dGVcclxuICAgICAgICAgICAgLy8gcm91dGUuIE9ubHkgYWRkIHRoZSAvIGRlbGltaXRlciBpZiB0aGUgY2hpbGQgcGF0aCBpc24ndCBlbXB0eSBhbmQgaWYgdGhlXHJcbiAgICAgICAgICAgIC8vIHBhcmVudCBwYXRoIGRvZXNuJ3QgaGF2ZSBhIHRyYWlsaW5nIHNsYXNoXHJcbiAgICAgICAgICAgIGlmIChwYXJlbnQgJiYgcGF0aFswXSAhPT0gJy8nKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBwYXJlbnRQYXRoID0gcGFyZW50LnJlY29yZC5wYXRoO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY29ubmVjdGluZ1NsYXNoID0gcGFyZW50UGF0aFtwYXJlbnRQYXRoLmxlbmd0aCAtIDFdID09PSAnLycgPyAnJyA6ICcvJztcclxuICAgICAgICAgICAgICAgIG5vcm1hbGl6ZWRSZWNvcmQucGF0aCA9XHJcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50LnJlY29yZC5wYXRoICsgKHBhdGggJiYgY29ubmVjdGluZ1NsYXNoICsgcGF0aCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiBub3JtYWxpemVkUmVjb3JkLnBhdGggPT09ICcqJykge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdDYXRjaCBhbGwgcm91dGVzIChcIipcIikgbXVzdCBub3cgYmUgZGVmaW5lZCB1c2luZyBhIHBhcmFtIHdpdGggYSBjdXN0b20gcmVnZXhwLlxcbicgK1xyXG4gICAgICAgICAgICAgICAgICAgICdTZWUgbW9yZSBhdCBodHRwczovL25leHQucm91dGVyLnZ1ZWpzLm9yZy9ndWlkZS9taWdyYXRpb24vI3JlbW92ZWQtc3Rhci1vci1jYXRjaC1hbGwtcm91dGVzLicpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGNyZ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yTWFwLmdldChtYXRjaGVyUmVmKTtcclxuICAgICAgICAgICAgaWYgKG1hdGNoZXIpIHtcclxuICAgICAgICAgICAgICAgIG1hdGNoZXJNYXAuZGVsZXRlKG1hdGNoZXJSZWYpO1xyXG4gICAgICAgICAgICAgICAgbWF0Y2hlcnMuc3BsaWNlKG1hdGNoZXJzLmluZGV4T2YobWF0Y2hlciksIDEpO1xyXG4gICAgICAgICAgICAgICAgbWF0Y2hlci5jaGlsZHJlbi5mb3JFYWNoKHJlbW92ZVJvdXRlKTtcclxuICAgICAgICAgICAgICAgIG1hdGNoZXIuYWxpYXMuZm9yRWFjaChyZW1vdmVSb3V0ZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gbWF0Y2hlcnMuaW5kZXhPZihtYXRjaGVyUmVmKTtcclxuICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcclxuICAgICAgICAgICAgICAgIG1hdGNoZXJzLnNwbGljZShpbmRleCwgMSk7XHJcbiAgICAgICAgICAgICAgICBpZiAobWF0Y2hlclJlZi5yZWNvcmQubmFtZSlcclxuICAgICAgICAgICAgICAgICAgICBtYXRjaGVyTWFwLmRlbGV0ZShtYXRjaGVyUmVmLnJlY29yZC5uYW1lKTtcclxuICAgICAgICAgICAgICAgIG1hdGNoZXJSZWYuY2hpbGRyZW4uZm9yRWFjaChyZW1vdmVSb3V0ZSk7XHJcbiAgICAgICAgICAgICAgICBtYXRjaGVyUmVmLmFsaWFzLmZvckVhY2gocmVtb3ZlUm91dGUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gZ2V0Um91dGVzKCkge1xyXG4gICAgICAgIHJldHVybiBtYXRjaGVycztcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIGluc2VydE1hdGNoZXIobWF0Y2hlcikge1xyXG4gIC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cclxuICAgIC8vIGtlZXAgYSByZWZlcmVuY2UgdG8gdGhlIGVudGVyQ2FsbGJhY2tBcnJheSB0byBwcmV2ZW50IHB1c2hpbmcgY2FsbGJhY2tzIGlmIGEgbmV3IG5hdmlnYXRpb24gdG9vayBwbGFjZVxyXG4gICAgY29uc3QgZW50ZXJDYWxsYmFja0FycmF5ID0gcmVjb3JkICYmXHJcbiAgICAgICAgLy8gbmFtZSBpcyBkZWZpbmVkIGlmIHJlY29yZCBpcyBiZWNhdXNlIG9mIHRoZSBmdW5jdGlvbiBvdmVybG9hZFxyXG4gICAgICAgIChyZWNvcmQuZW50ZXJDYWxsYmFja3NbbmFtZV0gPSByZWNvcmQuZW50ZXJDYWxsYmFja3NbbmFtZV0gfHwgW10pO1xyXG4gICAgcmV0dXJuICgpID0+IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcclxuICAgICAgICBjb25zdCBuZXh0ID0gKHZhbGlkKSA9PiB7XHJcbiAgICAgICAgICAgIGlmICh2YWxpZCA9PT0gZmFsc2UpXHJcbiAgICAgICAgICAgICAgICByZWplY3QoY3JlYXRlUm91dGVyRXJyb3IoNCAvKiBOQVZJR0FUSU9OX0FCT1JURUQgKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICBmcm9tLFxyXG4gICAgICAgICAgICAgICAgICAgIHRvLFxyXG4gICAgICAgICAgICAgICAgfSkpO1xyXG4gICAgICAgICAgICBlbHNlIGlmICh2YWxpZCBpbnN0YW5jZW9mIEVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICByZWplY3QodmFsaWQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGlzUm91dGVMb2NhdGlvbih2YWxpZCkpIHtcclxuICAgICAgICAgICAgICAgIHJlamVjdChjcmVhdGVSb3V0ZXJFcnJvcigyIC8qIE5BVklHQVRJT05fR1VBUkRfUkVESVJFQ1QgKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICBmcm9tOiB0byxcclxuICAgICAgICAgICAgICAgICAgICB0bzogdmFsaWQsXHJcbiAgICAgICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZW50ZXJDYWxsYmFja0FycmF5ICYmXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc2luY2UgZW50ZXJDYWxsYmFja0FycmF5IGlzIHRydXRoeSwgYm90aCByZWNvcmQgYW5kIG5hbWUgYWxzbyBhcmVcclxuICAgICAgICAgICAgICAgICAgICByZWNvcmQuZW50ZXJDYWxsYmFja3NbbmFtZV0gPT09IGVudGVyQ2FsbGJhY2tBcnJheSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIHR5cGVvZiB2YWxpZCA9PT0gJ2Z1bmN0aW9uJylcclxuICAgICAgICAgICAgICAgICAgICBlbnRlckNhbGxiYWNrQXJyYXkucHVzaCh2YWxpZCk7XHJcbiAgICAgICAgICAgICAgICByZXNvbHZlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIC8vIHdyYXBwaW5nIHdpdGggUHJvbWlzZS5yZXNvbHZlIGFsbG93cyBpdCB0byB3b3JrIHdpdGggYm90aCBhc3luYyBhbmQgc3luYyBndWFyZHNcclxuICAgICAgICBjb25zdCBndWFyZFJldHVybiA9IGd1YXJkLmNhbGwocmVjb3JkICYmIHJlY29yZC5pbnN0YW5jZXNbbmFtZV0sIHRvLCBmcm9tLCAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgPyBjYW5Pbmx5QmVDYWxsZWRPbmNlKG5leHQsIHRvLCBmcm9tKSA6IG5leHQpO1xyXG4gICAgICAgIGxldCBndWFyZENhbGwgPSBQcm9taXNlLnJlc29sdmUoZ3VhcmRSZXR1cm4pO1xyXG4gICAgICAgIGlmIChndWFyZC5sZW5ndGggPCAzKVxyXG4gICAgICAgICAg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ICAgICAgICByZXR1cm4gcmVzb2x2ZWRWYWx1ZTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgLy8gVE9ETzogdGVzdCBtZSFcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChndWFyZFJldHVybiAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiBfY2FsbGVkIGlzIGFkZGVkIGF0IGNhbk9ubHlCZUNhbGxlZE9uY2VcclxuICAgICAgICAgICAgICAgIGlmICghbmV4dC5fY2FsbGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihtZXNzYWdlKTtcclxuICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKCdJbnZhbGlkIG5hdmlnYXRpb24gZ3VhcmQnKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGd1YXJkQ2FsbC5jYXRjaChlcnIgPT4gcmVqZWN0KGVycikpO1xyXG4gICAgfSk7XHJcbn1cclxuZnVuY3Rpb24gY2FuT25seUJlQ2FsbGVkT25jZShuZXh0LCB0bywgZnJvbSkge1xyXG4gICAgbGV0IGNhbGxlZCA9IDA7XHJcbiAgICByZXR1cm4gZnVuY3Rpb24gKCkge1xyXG4gICAgICAgIGlmIChjYWxsZWQrKyA9PT0gMSlcclxuICAgICAgICAgICAgd2FybihgVGhlIFwibmV4dFwiIGNhbGxiYWNrIHdhcyBjYWxsZWQgbW9yZSB0aGFuIG9uY2UgaW4gb25lIG5hdmlnYXRpb24gZ3VhcmQgd2hlbiBnb2luZyBmcm9tIFwiJHtmcm9tLmZ1bGxQYXRofVwiIHRvIFwiJHt0by5mdWxsUGF0aH1cIi4gSXQgc2hvdWxkIGJlIGNhbGxlZCBleGFjdGx5IG9u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5vdGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgIGEgdmFsaWQgY29tcG9uZW50LiBSZWNlaXZlZCBcIiR7U3RyaW5nKHJhd0NvbXBvbmVudCl9XCIuYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhyb3cgdG8gZW5zdXJlIHdlIHN0b3AgaGVyZSBidXQgd2FybiB0byBlbnN1cmUgdGhlIG1lc3NhZ2UgaXNuJ3RcclxuICAgICAgICAgICAgICAgICAgICAvLyBtaXNzZWQgYnkgdGhlIHVzZXJcclxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ludmFsaWQgcm91dGUgY29tcG9uZW50Jyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICgndGhlbicgaW4gcmF3Q29tcG9uZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gd2FybiBpZiB1c2VyIHdyb3RlIGltcG9ydCgnL2NvbXBvbmVudC52dWUnKSBpbnN0ZWFkIG9mICgpID0+XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaW1wb3J0KCcuL2NvbXBvbmVudC52dWUnKVxyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYENvbXBvbmVudCBcIiR7bmFtZX1cIiBpbiByZWNvcmQgd2l0aCBwYXRoIFwiJHtyZWNvcmQucGF0aH1cIiBpcyBhIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgUHJvbWlzZSBpbnN0ZWFkIG9mIGEgZnVuY3Rpb24gdGhhdCByZXR1cm5zIGEgUHJvbWlzZS4gRGlkIHlvdSBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHdyaXRlIFwiaW1wb3J0KCcuL015UGFnZS52dWUnKVwiIGluc3RlYWQgb2YgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBcIigpID0+IGltcG9ydCgnLi9NeVBhZ2UudnVlJylcIiA/IFRoaXMgd2lsbCBicmVhayBpbiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHByb2R1Y3Rpb24gaWYgbm90IGZpeGVkLmApO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSByYXdDb21wb25lbnQ7XHJcbiAgICAgICAgICAgICAgICAgICAgcmF3Q29tcG9uZW50ID0gKCkgPT4gcHJvbWlzZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJhd0NvbXBvbmVudC5fX2FzeW5jTG9hZGVyICYmXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gd2FybiBvbmx5IG9uY2UgcGVyIGNvbXBvbmVudFxyXG4gICAgICAgICAgICAgICAgICAgICFyYXdDb21wb25lbnQuX193YXJuZWREZWZpbmVBc3luYykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJhd0NvbXBvbmVudC5fX3dhcm5lZERlZmluZUFzeW5jID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICB3YXJuKGBDb21wb25lbnQgXCIke25hbWV9XCIgaW4gcmVjb3JkIHdpdGggcGF0aCBcIiR7cmVjb3JkLnBhdGh9XCIgaXMgZGVmaW5lZCBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHVzaW5nIFwiZGVmaW5lQXN5bmNDb21wb25lbnQoKVwiLiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYFdyaXRlIFwiKCkgPT4gaW1wb3J0KCcuL015UGFnZS52dWUnKVwiIGluc3RlYWQgb2YgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBcImRlZmluZUFzeW5jQ29tcG9uZW50KCgpID0+IGltcG9ydCgnLi9NeVBhZ2UudnVlJykpXCIuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gc2tpcCB1cGRhdGUgYW5kIGxlYXZlIGd1YXJkcyBpZiB0aGUgcm91dGUgY29tcG9uZW50IGlzIG5vdCBtb3VudGVkXHJcbiAgICAgICAgICAgIGlmIChndWFyZFR5cGUgIT09ICdiZWZvcmVSb3V0ZUVudGVyJyAmJiAhcmVjb3JkLmluc3RhbmNlc1tuYW1lXSlcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICBpZiAoaXNSb3V0ZUNvbXBvbmVudChyYXdDb21wb25lbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBfX3ZjY09wdHMgaXMgYWRkZWQgYnkgdnVlLWNsYXNzLWNvbXBvbmVudCBhbmQgY29udGFpbiB0aGUgcmVndWxhciBvcHRpb25zXHJcbiAgICAgICAgICAgICAgICBjb25zdCBvcHRpb25zID0gcmF3Q29tcG9uZW50Ll9fdmNjT3B0cyB8fCByYXdDb21wb25lbnQ7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBndWFyZCA9IG9wdGlvbnNbZ3VhcmRUeXBlXTtcclxuICAgICAgICAgICAgICAgIGd1YXJkICYmIGd1YXJkcy5wdXNoKGd1YXJkVG9Qcm9taXNlRm4oZ3VhcmQsIHRvLCBmcm9tLCByZWNvcmQsIG5hbWUpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHN0YXJ0IHJlcXVlc3RpbmcgdGhlIGNodW5rIGFscmVhZHlcclxuICAgICAgICAgICAgICAgIGxldCBjb21wb25lbnRQcm9taXNlID0gcmF3Q29tcG9uZW50KCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmICEoJ2NhdGNoJyBpbiBjb21wb25lbnRQcm9taXNlKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYENvbXBvbmVudCBcIiR7bmFtZX1cIiBpbiByZWNvcmQgd2l0aCBwYXRoIFwiJHtyZWNvcmQucGF0aH1cIiBpcyBhIGZ1bmN0aW9uIHRoYXQgZG9lcyBub3QgcmV0dXJuIGEgUHJvbWlzZS4gSWYgeW91IHdlcmUgcGFzc2luZyBhIGZ1bmN0aW9uYWwgY29tcG9uZW50LCBtYWtlIHN1cmUgdG8gYWRkIGEgXCJkaXNwbGF5TmFtZVwiIHRvIHRoZSBjb21wb25lbnQuIFRoaXMgd2lsbCBicmVhayBpbiBwcm9kdWN0aW9uIGlmIG5vdCBmaXhlZC5gKTtcclxuICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRQcm9taXNlID0gUHJvbWlzZS5yZXNvbHZlKGNvbXBvbmVudFByb21pc2UpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZ3VhcmRzLnB1c2goKCkgPT4gY29tcG9uZW50UHJvbWlzZS50aGVuKHJlc29sdmVkID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIXJlc29sdmVkKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZWplY3QobmV3IEVycm9yKGBDb3VsZG4ndCByZXNvbHZlIGNvbXBvbmVudCBcIiR7bmFtZX1cIiBhdCBcIiR7cmVjb3JkLnBhdGh9XCJgKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzb2x2ZWRDb21wb25lbnQgPSBpc0VTTW9kdWxlKHJlc29sdmVkKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHJlc29sdmVkLmRlZmF1bHRcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiByZXNvbHZlZDtcclxuICAgICAgICAgICAgICAgICAgICAvLyByZXBsYWNlIHRoZSBmdW5jdGlvbiB3aXRoIHRoZSByZXNvbHZlZCBjb21wb25lbnRcclxuICAgICAgICAgICAgICAgICAgICByZWNvcmQuY29tcG9uZW50c1tuYW1lXSA9IHJlc29sdmVkQ29tcG9uZW50O1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIF9fdmNjT3B0cyBpcyBhZG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XHJcbiAgICAgICAgICAgIC8vICldOiAhbGluay5pc0V4YWN0QWN0aXZlLFxyXG4gICAgICAgICAgICBbZ2V0TGlua0NsYXNzKHByb3BzLmV4YWN0QWN0aXZlQ2xhc3MsIG9wdGlvbnMubGlua0V4YWN0QWN0aXZlQ2xhc3MsICdyb3V0ZXItbGluay1leGFjdC1hY3RpdmUnKV06IGxpbmsuaXNFeGFjdEFjdGl2ZSxcclxuICAgICAgICB9KSk7XHJcbiAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgY2hpbGRyZW4gPSBzbG90cy5kZWZhdWx0ICYmIHNsb3RzLmRlZmF1bHQobGluayk7XHJcbiAgICAgICAgICAgIHJldHVybiBwcm9wcy5jdXN0b21cclxuICAgICAgICAgICAgICAgID8gY2hpbGRyZW5cclxuICAgICAgICAgICAgICAgIDogaCgnYScsIHtcclxuICAgICAgICAgICAgICAgICAgICAnYXJpYS1jdXJyZW50JzogbGluay5pc0V4YWN0QWN0aXZlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gcHJvcHMuYXJpYUN1cnJlbnRWYWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IG51bGwsXHJcbiAgICAgICAgICAgICAgICAgICAgaHJlZjogbGluay5ocmVmLFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgd291bGQgb3ZlcnJpZGUgdXNlciBhZGRlZCBhdHRycyBidXQgVnVlIHdpbGwgc3RpbGwgYWRkXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGxpc3RlbmVyIHNvIHdlIGVuZCB1cCB0cmlnZ2VyaW5nIGJvdGhcclxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrOiBsaW5rLm5hdmlnYXRlLFxyXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzOiBlbENsYXNzLnZhbHVlLFxyXG4gICAgICAgICAgICAgICAgfSwgY2hpbGRyZW4pO1xyXG4gICAgICAgIH07XHJcbi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cbiAgICAgICAgY29uc3QgdGFyZ2V0ID0gZS5jdXJyZW50VGFyZ2V0LmdldEF0dHJpYnV0ZSgndGFyZ2V0Jyk7XHJcbiAgICAgICAgaWYgKC9cXGJfYmxhbmtcXGIvaS50ZXN0KHRhcmdldCkpXHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIC8vIHRoaXMgbWF5IGJlIGEgV2VleCBldmVudCB3aGljaCBkb2Vzbid0IGhhdmUgdGhpcyBtZXRob2RcclxuICAgIGlmIChlLnByZXZlbnREZWZhdWx0KVxyXG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgIHJldHVybiB0cnVlO1xyXG59XHJcbmZ1bmN0aW9uIGluY2x1ZGVzUGFyYW1zKG91dGVyLCBpbm5lcikge1xyXG4gICAgZm9yIChjb25zdCBrZXkgaW4gaW5uZXIpIHtcclxuICAgICAgICBjb25zdCBpbm5lclZhbHVlID0gaW5uZXJba2V5XTtcclxuICAgICAgICBjb25zdCBvdXRlclZhbHVlID0gb3V0ZXJba2V5XTtcclxuICAgICAgICBpZiAodHlwZW9mIGlubmVyVmFsdWUgPT09ICdzdHJpbmcnKSB7XHJcbiAgICAgICAgICAgIGlmIChpbm5lclZhbHVlICE9PSBvdXRlclZhbHVlKVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgaWYgKCFBcnJheS5pc0FycmF5KG91dGVyVmFsdWUpIHx8XHJcbiAgICAgICAgICAgICAgICBvdXRlclZhbHVlLmxlbmd0aCAhPT0gaW5uZXJWYWx1ZS5sZW5ndGggfHxcclxuICAgICAgICAgICAgICAgIGlubmVyVmFsdWUuc29tZSgodmFsdWUsIGkpID0+IHZhbHVlICE9PSBvdXRlclZhbHVlW2ldKSlcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcb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dGl2YXRpbmcgY29tcG9uZW50c1xyXG4gICAgICAgICAgICAgICAgaWYgKGZyb20gJiYgZnJvbSAhPT0gdG8gJiYgaW5zdGFuY2UgJiYgaW5zdGFuY2UgPT09IG9sZEluc3RhbmNlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0by5sZWF2ZUd1YXJkcy5zaXplKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvLmxlYXZlR3VhcmRzID0gZnJvbS5sZWF2ZUd1YXJkcztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0by51cGRhdGVHdWFyZHMuc2l6ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0by51cGRhdGVHdWFyZHMgPSBmcm9tLnVwZGF0ZUd1YXJkcztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gdHJpZ2dlciBiZWZvcmVSb3V0ZUVudGVyIG5leHQgY2FsbGJhY2tzXHJcbiAgICAgICAgICAgIGlmIChpbnN0YW5jZSAmJlxyXG4gICAgICAgICAgICAgICAgdG8gJiZcclxuICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIGlzIG5vIGluc3RhbmNlIGJ1dCB0byBhbmQgZnJvbSBhcmUgdGhlIHNhbWUgdGhpcyBtaWdodCBiZVxyXG4gICAgICAgICAgICAgICAgLy8gdGhlIGZpcnN0IHZpc2l0XHJcbiAgICAgICAgICAgICAgICAoIWZyb20gfHwgIWlzU2FtZVJvdXRlUmVjb3JkKHRvLCBmcm9tKSB8fCAhb2xkSW5zdGFuY2UpKSB7XHJcbiAgICAgICAgICAgICAgICAodG8uZW50ZXJDYWxsYmFja3NbbmFtZV0gfHwgW10pLmZvckVhY2goY2FsbGJhY2sgPT4gY2FsbGJhY2soaW5zdGFuY2UpKTtcclxuICAgICAgICAgICAgfVxyXG4gIC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AgICAgICAgICAgICAgID8gcm91dGUucGFyYW1zXHJcbiAgICAgICAgICAgICAgICAgICAgOiB0eXBlb2Ygcm91dGVQcm9wc09wdGlvbiA9PT0gJ2Z1bmN0aW9uJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHJvdXRlUHJvcHNPcHRpb24ocm91dGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogcm91dGVQcm9wc09wdGlvblxyXG4gICAgICAgICAgICAgICAgOiBudWxsO1xyXG4gICAgICAgICAgICBjb25zdCBvblZub2RlVW5tb3VudGVkID0gdm5vZGUgPT4ge1xyXG4gICAgICAgICAgICAgICAgLy8gcmVtb3ZlIHRoZSBpbnN0YW5jZSByZWZlcmVuY2UgdG8gcHJldmVudCBsZWFrXHJcbiAgICAgICAgICAgICAgICBpZiAodm5vZGUuY29tcG9uZW50LmlzVW5tb3VudGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbWF0Y2hlZFJvdXRlLmluc3RhbmNlc1tjdXJyZW50TmFtZV0gPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBjb25zdCBjb21wb25lbnQgPSBoKFZpZXdDb21wb25lbnQsIGFzc2lnbih7fSwgcm91dGVQcm9wcywgYXR0cnMsIHtcclxuICAgICAgICAgICAgICAgIG9uVm5vZGVVbm1vdW50ZWQsXHJcbiAgICAgICAgICAgICAgICByZWY6IHZpZXdSZWYsXHJcbiAgICAgICAgICAgIH0pKTtcclxuICAgICAgICAgICAgaWYgKCgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSAmJlxyXG4gICAgICAgICAgICAgICAgaXNCcm93c2VyICYmXHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnQucmVmKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBjYW4gZGlzcGxheSBpZiBpdCdzIGFuIGFsaWFzLCBpdHMgcHJvcHNcclxuICAgICAgICAgICAgICAgIGNvbnN0IGluZm8gPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGVwdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogbWF0Y2hlZFJvdXRlLm5hbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogbWF0Y2hlZFJvdXRlLnBhdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgbWV0YTogbWF0Y2hlZFJvdXRlLm1ldGEsXHJcbiAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgY29uc3QgaW50ZXJuYWxJbnN0YW5jZXMgPSBBcnJheS5pc0FycmF5KGNvbXBvbmVudC5yZWYpXHJcbiAgICAgICAgICAgICAgICAgICAgPyBjb21wb25lbnQucmVmLm1hcChyID0+IHIuaSlcclxuICAgICAgICAgICAgICAgICAgICA6IFtjb21wb25lbnQucmVmLmldO1xyXG4gICAgICAgICAgICAgICAgaW50ZXJuYWxJbnN0YW5jZXMuZm9yRWFjaChpbnN0YW5jZSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvclxyXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLl9fdnJ2X2RldnRvb2xzID0gaW5mbztcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiAoXHJcbiAgICAgICAgICAgIC8vIHBhc3MgdGhlIHZub2RlIHRvIHRoZSBzbG90IGFzIGEgcHJvcC5cclxuICAgICAgICAgICAgLy8gaCBhbmQgPGNvbXBvbmVudCA6aXM9XCIuLi5cIj4gYm90aCBhY2NlcHQgdm5vZGVzXHJcbiAgICAgICAgICAgIG5vcm1hbGl6ZVNsb3Qoc2xvdHMuZGVmYXVsdCwgeyBDb21wb25lbnQ6IGNvbXBvbmVudCwgcm91dGUgfSkgfHxcclxuICAgICAgICAgIC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Um91dGVyJyxcclxuICAgICAgICBwYWNrYWdlTmFtZTogJ3Z1ZS1yb3V0ZXInLFxyXG4gICAgICAgIGhvbWVwYWdlOiAnaHR0cHM6Ly9uZXh0LnJvdXRlci52dWVqcy5vcmcvJyxcclxuICAgICAgICBsb2dvOiAnaHR0cHM6Ly92dWVqcy5vcmcvaW1hZ2VzL2ljb25zL2Zhdmljb24tOTZ4OTYucG5nJyxcclxuICAgICAgICBjb21wb25lbnRTdGF0ZVR5cGVzOiBbJ1JvdXRpbmcnXSxcclxuICAgICAgICBhcHAsXHJcbiAgICB9LCBhcGkgPT4ge1xyXG4gICAgICAgIC8vIGRpc3BsYXkgc3RhdGUgYWRkZWQgYnkgdGhlIHJvdXRlclxyXG4gICAgICAgIGFwaS5vbi5pbnNwZWN0Q29tcG9uZW50KChwYXlsb2FkLCBjdHgpID0+IHtcclxuICAgICAgICAgICAgaWYgKHBheWxvYWQuaW5zdGFuY2VEYXRhKSB7XHJcbiAgICAgICAgICAgICAgICBwYXlsb2FkLmluc3RhbmNlRGF0YS5zdGF0ZS5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICB0eXBlOiAnUm91dGluZycsXHJcbiAgICAgICAgICAgICAgICAgICAga2V5OiAnJHJvdXRlJyxcclxuICAgICAgICAgICAgICAgICAgICBlZGl0YWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGZvcm1hdFJvdXRlTG9jYXRpb24ocm91dGVyLmN1cnJlbnRSb3V0ZS52YWx1ZSwgJ0N1cnJlbnQgUm91dGUnKSxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgLy8gbWFyayByb3V0ZXItbGluayBhcyBhY3RpdmUgYW5kIGRpc3BsYXkgdGFncyBvbiByb3V0ZXIgdmlld3NcclxuICAgICAgICBhcGkub24udmlzaXRDb21wb25lbnRUcmVlKCh7IHRyZWVOb2RlOiBub2RlLCBjb21wb25lbnRJbnN0YW5jZSB9KSA9PiB7XHJcbiAgICAgICAgICAgIGlmIChjb21wb25lbnRJbnN0YW5jZS5fX3Zydl9kZXZ0b29scykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgaW5mbyA9IGNvbXBvbmVudEluc3RhbmNlLl9fdnJ2X2RldnRvb2xzO1xyXG4gICAgICAgICAgICAgICAgbm9kZS50YWdzLnB1c2goe1xyXG4gICAgICAgICAgICAgICAgICAgIGxhYmVsOiAoaW5mby5uYW1lID8gYCR7aW5mby5uYW1lLnRvU3RyaW5nKCl9OiBgIDogJycpICsgaW5mby5wYXRoLFxyXG4gICAgICAgICAgICAgICAgICAgIHRleHRDb2xvcjogMCxcclxuICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnVGhpcyBjb21wb25lbnQgaXMgcmVuZGVyZWQgYnkgJmx0O3JvdXRlci12aWV3Jmd0OycsXHJcbiAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBQSU5LXzUwMCxcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGlmIG11bHRpcGxlIHVzZUxpbmsgYXJlIHVzZWRcclxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoY29tcG9uZW50SW5zdGFuY2UuX192cmxfZGV2dG9vbHMpKSB7XHJcbiAgICAgICAgICAgICAgICBjb21wb25lbnRJbnN0YW5jZS5fX2RldnRvb2xzQXBpID0gYXBpO1xyXG4gICAgICAgICAgICAgICAgY29tcG9uZW50SW5zdGFuY2UuX192cmxfZGV2dG9vbHMuZm9yRWFjaChkZXZ0b29sc0RhdGEgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBiYWNrZ3JvdW5kQ29sb3IgPSBPUkFOR0VfNDAwO1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b29sdGlwID0gJyc7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRldnRvb2xzRGF0YS5pc0V4YWN0QWN0aXZlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvciA9IExJTUVfNTAwO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwID0gJ1RoaXMgaXMgZXhhY3RseSBhY3RpdmUnO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkZXZ0b29sc0RhdGEuaXNBY3RpdmUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yID0gQkxVRV82MDA7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAgPSAnVGhpcyBsaW5rIGlzIGFjdGl2ZSc7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIG5vZGUudGFncy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGRldnRvb2xzRGF0YS5yb3V0ZS5wYXRoLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0Q29sb3I6IDAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcixcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgd2F0Y2gocm91dGVyLmN1cnJlbnRSb3V0ZSwgKCkgPT4ge1xyXG4gICAgICAgICAgICAvLyByZWZyZXNoIGFjdGl2ZSBzdGF0ZVxyXG4gICAgICAgICAgICByZWZyZXNoUm91dGVzVmlldygpO1xyXG4gICAgICAgICAgICBhcGkubm90aWZ5Q29tcG9uZW50VXBkYXRlKCk7XHJcbiAgICAgICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yVHJlZShyb3V0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VHlwZTogJ2Vycm9yJyxcclxuICAgICAgICAgICAgICAgICAgICB0aW1lOiBEYXRlLm5vdygpLFxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IHsgZXJyb3IgfSxcclxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiB0by5tZXRhLl9fbmF2aWdhdGlvbklkLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgLy8gYXR0YWNoZWQgdG8gYG1ldGFgIGFuZCB1c2VkIHRvIGdyb3VwIGV2ZW50c1xyXG4gICAgICAgIGxldCBuYXZpZ2F0aW9uSWQgPSAwO1xyXG4gICAgICAgIHJvdXRlci5iZWZvcmVFYWNoKCh0bywgZnJvbSkgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBkYXRhID0ge1xyXG4gICAgICAgICAgICAgICAgZ3VhcmQ6IGZvcm1hdERpc3BsYXkoJ2JlZm9yZUVhY2gnKSxcclxuICAgICAgICAgICAgICAgIGZyb206IGZvcm1hdFJvdXRlTG9jYXRpb24oZnJvbSwgJ0N1cnJlbnQgTG9jYXRpb24gZHVyaW5nIHRoaXMgbmF2aWdhdGlvbicpLFxyXG4gICAgICAgICAgICAgICAgdG86IGZvcm1hdFJvdXRlTG9jYXRpb24odG8sICdUYXJnZXQgbG9jYXRpb24nKSxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgLy8gVXNlZCB0byBncm91cCBuYXZpZ2F0aW9ucyB0b2dldGhlciwgaGlkZSBmcm9tIGRldnRvb2xzXHJcbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0by5tZXRhLCAnX19uYXZpZ2F0aW9uSWQnLCB7XHJcbiAgICAgICAgICAgICAgICB2YWx1ZTogbmF2aWdhdGlvbklkKyssXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBhcGkuYWRkVGltZWxpbmVFdmVudCh7XHJcbiAgICAgICAgICAgICAgICBsYXllcklkOiBuYXZpZ2F0aW9uc0xheWVySWQsXHJcbiAgICAgICAgICAgICAgICBldmVudDoge1xyXG4gICAgICAgICAgICAgICAgICAgIHRpbWU6IERhdGUubm93KCksXHJcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICdTdGFydCBvZiBuYXZpZ2F0aW9uJyxcclxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogdG8uZnVsbFBhdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YSxcclxuICAgICAgICAgICAgICAgICAgICBncm91cElkOiB0by5tZXRhLl9fbmF2aWdhdGlvbklkLFxyXG4gICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICAgICAgcm91dGVyLmFmdGVyRWFjaCgodG8sIGZyb20sIGZhaWx1cmUpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgZGF0YSA9IHtcclxuICAgICAgICAgICAgICAgIGd1YXJkOiBmb3JtYXREaXNwbGF5KCdhZnRlckVhY2gnKSxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgaWYgKGZhaWx1cmUpIHtcclxuICAgICAgICAgICAgICAgIGRhdGEuZmFpbHVyZSA9IHtcclxuICAgICAgICAgICAgICAgICAgICBfY3VzdG9tOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IEVycm9yLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFkT25seTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogZmFpbHVyZSA/IGZhaWx1cmUubWVzc2FnZSA6ICcnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwOiAnTmF2aWdhdGlvbiBGYWlsdXJlJyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGZhaWx1cmUsXHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICBkYXRhLnN0YXR1cyA9IGZvcm1hdERpc3BsYXkoJ+KdjCcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgZGF0YS5zdGF0dXMgPSBmb3JtYXREaXNwbGF5KCfinIUnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyB3ZSBzZXQgaGVyZSB0byBoYXZlIHRoZSByaWdodCBvcmRlclxyXG4gICAgICAgICAgICBkYXRhLmZyb20gPSBmb3JtYXRSb3V0ZUxvY2F0aW9uKGZyb20sICdDdXJyZW50IExvY2F0aW9uIGR1cmluZyB0aGlzIG5hdmlnYXRpb24nKTtcclxuICAgICAgICAgICAgZGF0YS50byA9IGZvcm1hdFJvdXRlTG9jYXRpb24odG8sICdUYXJnZXQgbG9jYXRpb24nKTtcclxuICAgICAgICAgICAgYXBpLmFkZFRpbWVsaW5lRXZlbnQoe1xyXG4gICAgICAgICAgICAgICAgbGF5ZXJJZDogbmF2aWdhdGlvbnNMYXllcklkLFxyXG4gICAgICAgICAgICAgICAgZXZlbnQ6IHtcclxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ0VuZCBvZiBuYXZpZ2F0aW9uJyxcclxuICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogdG8uZnVsbFBhdGgsXHJcbiAgICAgICAgICAgICAgICAgICAgdGltZTogRGF0ZS5ub3coKSxcclxuICAgICAgICAgICAgICAgICAgICBkYXRhLFxyXG4gICAgICAgICAgICAgICAgICAgIGxvZ1R5cGU6IGZhaWx1cmUgPyAnd2FybmluZycgOiAnZGVmYXVsdCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZ3JvdXBJZDogdG8ubWV0YS5fX25hdmlnYXRpb25JZCxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIC8q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GVjdGVkIHJvdXRlIHJlY29yZFxyXG4gICAgICAgICAqL1xyXG4gICAgICAgIGFwaS5vbi5nZXRJbnNwZWN0b3JTdGF0ZShwYXlsb2FkID0+IHtcclxuICAgICAgICAgICAgaWYgKHBheWxvYWQuYXBwID09PSBhcHAgJiYgcGF5bG9hZC5pbnNwZWN0b3JJZCA9PT0gcm91dGVySW5zcGVjdG9ySWQpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJvdXRlcyA9IG1hdGNoZXIuZ2V0Um91dGVzKCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCByb3V0ZSA9IHJvdXRlcy5maW5kKHJvdXRlID0+IHJvdXRlLnJlY29yZC5fX3ZkX2lkID09PSBwYXlsb2FkLm5vZGVJZCk7XHJcbiAgICAgICAgICAgICAgICBpZiAocm91dGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkLnN0YXRlID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiBmb3JtYXRSb3V0ZVJlY29yZE1hdGNoZXJGb3JTdGF0ZUluc3BlY3Rvcihyb3V0ZSksXHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgICAgIGFwaS5zZW5kSW5zcGVjdG9yVHJlZShyb3V0ZXJJbnNwZWN0b3JJZCk7XHJcbiAgICAgICAgYXBpLnNlbmRJbnNwZWN0b3JTdGF0ZShyb3V0ZXJJbnNwZWN0b3JJZCk7XHJcbiAgICB9KTtcclxufVxyXG5mdW5jdGlvbiBtb2RpZmllckZvcktleShrZXkpIHtcclxuICAgIGlmIChrZXkub3B0aW9uYWwpIHtcclxuICAgICAgICByZXR1cm4ga2V5LnJlcGVhdGFibGUgPyAnKicgOiAnPyc7XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICByZXR1cm4ga2V5LnJlcGVhdGFibGUgPyAnKycgOiAnJztcclxuICAgIH1cclxufVxyXG5mdW5jdGlvbiBmb3JtYXRSb3V0ZVJlY29yZE1hdGNoZXJGb3JTdGF0ZUluc3BlY3Rvcihyb3V0ZSkge1xyXG4gICAgY29uc3QgeyByZWNvcmQgfSA9IHJvdXRlO1xyXG4gICAgY29uc3QgZmllbGRzID0gW1xyXG4gICAgICAgIHsgZWRpdGFibGU6IGZhbHNlLCBrZXk6ICdwYXRoJywgdmFsdWU6IHJlY29yZC5wYXRoIH0sXHJcbiAgICBdO1xyXG4gICAgaWYgKHJlY29yZC5uYW1lICE9IG51bGwpIHtcclxuICAgICAgICBmaWVsZHMucHVzaCh7XHJcbiAgICAgICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAga2V5OiAnbmFtZScsXHJcbiAgICAgICAgICAgIHZhbHVlOiByZWNvcmQubmFtZSxcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGZpZWxkcy5wdXNoKHsgZWRpdGFibGU6IGZhbHNlLCBrZXk6ICdyZWdleHAnLCB2YWx1ZTogcm91dGUucmUgfSk7XHJcbiAgICBpZiAocm91dGUua2V5cy5sZW5ndGgpIHtcclxuICAgICAgICBmaWVsZHMucHVzaCh7XHJcbiAgICAgICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAga2V5OiAna2V5cycsXHJcbiAgICAgICAgICAgIHZhbHVlOiB7XHJcbiAgICAgICAgICAgICAgICBfY3VzdG9tOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogbnVsbCxcclxuICAgICAgICAgICAgICAgICAgICByZWFkT25seTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICBkaXNwbGF5OiByb3V0ZS5rZXlzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoa2V5ID0+IGAke2tleS5uYW1lfSR7bW9kaWZpZXJGb3JLZXkoa2V5KX1gKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuam9pbignICcpLFxyXG4gICAgICAgICAgICAgICAgICAgIHRvb2x0aXA6ICdQYXJhbSBrZXlzJyxcclxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcm91dGUua2V5cyxcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBpZiAocmVjb3JkLnJlZGlyZWN0ICE9IG51bGwpIHtcclxuICAgICAgICBmaWVsZHMucHVzaCh7XHJcbiAgICAgICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICAgICAga2V5OiAncmVkaXJlY3QnLFxyXG4gICAgICAgICAgICB2YWx1ZTogcmVjb3JkLnJlZGlyZWN0LFxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaWYgKHJvdXRlLmFsaWFzLmxlbmd0aCkge1xyXG4gICAgICAgIGZpZWxkcy5wdXNoKHtcclxuICAgICAgICAgICAgZWRpdGFibGU6IGZhbHNlLFxyXG4gICAgICAgICAgICBrZXk6ICdhbGlhc2VzJyxcclxuICAgICAgICAgICAgdmFsdWU6IHJvdXRlLmFsaWFzLm1hcChhbGlhcyA9PiBhbGlhcy5yZWNvcmQucGF0aCksXHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBmaWVsZHMucHVzaCh7XHJcbiAgICAgICAga2V5OiAnc2NvcmUnLFxyXG4gICAgICAgIGVkaXRhYmxlOiBmYWxzZSxcclxuICAgICAgICB2YWx1ZToge1xyXG4gICAgICAgICAgICBfY3VzdG9tOiB7XHJcbiAgICAgICAgICAgICAgICB0eXBlOiBudWxsLFxyXG4gICAgICAgICAgICAgICAgcmVhZE9ubHk6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBkaXNwbGF5OiByb3V0ZS5zY29yZS5tYXAoc2NvcmUgPT4gc2NvcmUuam9pbignLCAnKSkuam9pbignIHwgJyksXHJcbiAgICAgICAgICAgICAgICB0b29sdGlwOiAnU2NvcmUgdXNlZCB0byBzb3J0IHJvdXRlcycsXHJcbiAgICAgICAgICAgICAgICB2YWx1ZTogcm91dGUuc2NvcmUsXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgfSxcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIGZpZWxkcztcclxufVxyXG4vKipcclxuICogRXh0cmFjdGVkIGZyb20gdGFpbHdpbmQgcGFsZXR0ZVxyXG4gKi9cclxuY29uc3QgUElOS181MDAgPSAweGVjNDg5OTtcclxuY29uc3QgQkxVRV82MDAgPSAweDI1NjNlYjtcclxuY29uc3QgTElNRV81MDAgPSAweDg0Y2MxNjtcclxuY29uc3QgQ1lBTl80MDAgPSAweDIyZDNlZTtcclxuY29uc3QgT1JBTkdFXzQwMCA9IDB4ZmI5MjNjO1xyXG4vLyBjb25zdCBHUkFZXzEwMCA9IDB4ZjRmNGY1XHJcbmNvbnN0IERBUksgPSAweDY2NjY2NjtcclxuZnVuY3Rpb24gZm9ybWF0Um91dGVSZWNvcmRGb3JJbnNwZWN0b3Iocm91dGUpIHtcclxuICAgIGNvbnN0IHRhZ3MgPSBbXTtcclxuICAgIGNvbnN0IHsgcmVjb3JkIH0gPSByb3V0ZTtcclxuICAgIGlmIChyZWNvcmQubmFtZSAhPSBudWxsKSB7XHJcbiAgICAgICAgdGFncy5wdXNoKHtcclxuICAgICAgICAgICAgbGFiZWw6IFN0cmluZyhyZWNvcmQubmFtZSksXHJcbiAgICAgICAgICAgIHRleHRDb2xvcjogMCxcclxuICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBDWUFOXzQwMCxcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGlmIChyZWNvcmQuYWxpYXNPZikge1xyXG4gICAgICAgIHRhZ3MucHVzaCh7XHJcbiAgICAgICAgICAgIGxhYmVsOiAnYWxpYXMnLFxyXG4gICAgICAgICAgICB0ZXh0Q29sb3I6IDAsXHJcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogT1JBTkdFXzQwMCxcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGlmIChyb3V0ZS5fX3ZkX21hdGNoKSB7XHJcbiAgICAgICAgdGFncy5wdXNoKHtcclxuICAgICAgICAgICAgbGFiZWw6ICdtYXRjaGVzJyxcclxuICAgICAgICAgICAgdGV4dENvbG9yOiAwLFxyXG4gICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IFBJTktfNTAwLFxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaWYgKHJvdXRlLl9fdmRfZXhhY3RBY3RpdmUpIHtcclxuICAgICAgICB0YWdzLnB1c2goe1xyXG4gICAgICAgICAgICBsYWJlbDogJ2V4YWN0JyxcclxuICAgICAgICAgICAgdGV4dENvbG9yOiAwLFxyXG4gICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IExJTUVfNTAwLFxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaWYgKHJvdXRlLl9fdmRfYWN0aXZlKSB7XHJcbiAgICAgICAgdGFncy5wdXNoKHtcclxuICAgICAgICAgICAgbGFiZWw6ICdhY3RpdmUnLFxyXG4gICAgICAgICAgICB0ZXh0Q29sb3I6IDAsXHJcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogQkxVRV82MDAsXHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICBpZiAocmVjb3JkLnJlZGlyZWN0KSB7XHJcbiAgICAgICAgdGFncy5wdXNoKHtcclxuICAgICAgICAgICAgbGFiZWw6ICdyZWRpcmVjdDogJyArXHJcbiAgICAgICAgICAgICAgICAodHlwZW9mIHJlY29yZC5yZWRpcmVjdCA9PT0gJ3N0cmluZycgPyByZWNvcmQucmVkaXJlY3QgOiAnT2JqZWN0JyksXHJcbiAgICAgICAgICAgIHRleHRDb2xvcjogMHhmZmZmZmYsXHJcbiAgICAgICAgICAgIGJhY2tncm91bmRDb2xvcjogREFSSyxcclxuICAgICAgICB9KTtcclx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9uTm9ybWFsaXplZC5oYXNoKSxcclxuICAgICAgICAgICAgICAgIHJlZGlyZWN0ZWRGcm9tOiB1bmRlZmluZWQsXHJcbiAgICAgICAgICAgICAgICBocmVmLFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IG1hdGNoZXJMb2NhdGlvbjtcclxuICAgICAgICAvLyBwYXRoIGNvdWxkIGJlIHJlbGF0aXZlIGluIG9iamVjdCBhcyB3ZWxsXHJcbiAgICAgICAgaWYgKCdwYXRoJyBpbiByYXdMb2NhdGlvbikge1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAncGFyYW1zJyBpbiByYXdMb2NhdGlvbiAmJlxyXG4gICAgICAgICAgICAgICAgISgnbmFtZScgaW4gcmF3TG9jYXRpb24pICYmXHJcbiAgICAgICAgICAgICAgICAvLyBAdHMtZXhwZWN0LWVycm9yOiB0aGUgdHlwZSBpcyBuZXZlclxyXG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMocmF3TG9jYXRpb24ucGFyYW1zKS5sZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgIHdhcm4oYFBhdGggXCIke1xyXG4gICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogdGhlIHR5cGUgaXMgbmV2ZXJcclxuICAgICAgICAgICAgICAgIHJhd0xvY2F0aW9uLnBhdGh9XCIgd2FzIHBhc3NlZCB3aXRoIHBhcmFtcyBidXQgdGhleSB3aWxsIGJlIGlnbm9yZWQuIFVzZSBhIG5hbWVkIHJvdXRlIGFsb25nc2lkZSBwYXJhbXMgaW5zdGVhZC5gKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBtYXRjaGVyTG9jYXRpb24gPSBhc3NpZ24oe30sIHJhd0xvY2F0aW9uLCB7XHJcbiAgICAgICAgICAgICAgICBwYXRoO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ycm9yKCdJbnZhbGlkIHJlZGlyZWN0Jyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGFzc2lnbih7XHJcbiAgICAgICAgICAgICAgICBxdWVyeTogdG8ucXVlcnksXHJcbiAgICAgICAgICAgICAgICBoYXNoOiB0by5oYXNoLFxyXG4gICAgICAgICAgICAgICAgcGFyYW1zOiB0by5wYXJhbXMsXHJcbiAgICAgICAgICAgIH0sIG5ld1RhcmdldExvY2F0aW9uKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBwdXNoV2l0aFJlZGlyZWN0KHRvLCByZWRpcmVjdGVkRnJvbSkge1xyXG4gICAgICAgIGNvbnN0IHRhcmdldExvY2F0aW9uID0gKHBlbmRpbmdMb2NhdGlvbiA9IHJlc29sdmUodG8pKTtcclxuICAgICAgICBjb25zdCBmcm9tID0gY3VycmVudFJvdXRlLnZhbHVlO1xyXG4gICAgICAgIGNvbnN0IGRhdGEgPSB0by5zdGF0ZTtcclxuICAgICAgICBjb25zdCBmb3JjZSA9IHRvLmZvcmNlO1xyXG4gICAgICAgIC8vIHRvIGNvdWxkIGJlIGEgc3RyaW5nIHdoZXJlIGByZXBsYWNlYCBpcyBhIGZ1bmN0aW9uXHJcbiAgICAgICAgY29uc3QgcmVwbGFjZSA9IHRvLnJlcGxhY2UgPT09IHRydWU7XHJcbiAgICAgICAgY29uc3Qgc2hvdWxkUmVkaXJlY3QgPSBoYW5kbGVSZWRpcmVjdFJlY29yZCh0YXJnZXRMb2NhdGlvbik7XHJcbiAgICAgICAgaWYgKHNob3VsZFJlZGlyZWN0KVxyXG4gICAgICAgICAgICByZXR1cm4gcHVzaFdpdGhSZWRpcmVjdChhc3NpZ24obG9jYXRpb25Bc09iamVjdChzaG91bGRSZWRpcmVjdCksIHtcclxuICAgICAgICAgICAgICAgIHN0YXRlOiBkYXRhLFxyXG4gICAgICAgICAgICAgICAgZm9yY2UsXHJcbiAgICAgICAgIC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AgICAgIHRydWUsIFxyXG4gICAgICAgICAgICAvLyBUaGlzIGNhbm5vdCBiZSB0aGUgZmlyc3QgbmF2aWdhdGlvbiBiZWNhdXNlIHRoZSBpbml0aWFsIGxvY2F0aW9uXHJcbiAgICAgICAgICAgIC8vIGNhbm5vdCBiZSBtYW51YWxseSBuYXZpZ2F0ZWQgdG9cclxuICAgICAgICAgICAgZmFsc2UpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gKGZhaWx1cmUgPyBQcm9taXNlLnJlc29sdmUoZmFpbHVyZSkgOiBuYXZpZ2F0ZSh0b0xvY2F0aW9uLCBmcm9tKSlcclxuICAgICAgICAgICAgLmNhdGNoKChlcnJvcikgPT4gaXNOYXZpZ2F0aW9uRmFpbHVyZShlcnJvcilcclxuICAgICAgICAgICAgPyBlcnJvclxyXG4gICAgICAgICAgICA6IC8vIHJlamVjdCBhbnkgdW5rbm93biBlcnJvclxyXG4gICAgICAgICAgICAgICAgdHJpZ2dlckVycm9yKGVycm9yLCB0b0xvY2F0aW9uLCBmcm9tKSlcclxuICAgICAgICAgICAgLnRoZW4oKGZhaWx1cmUpID0+IHtcclxuICAgICAgICAgICAgaWYgKGZhaWx1cmUpIHtcclxuICAgICAgICAgICAgICAgIGlmIChpc05hdmlnYXRpb25GYWlsdXJlKGZhaWx1cmUsIDIgLyogTkFWSUdBVElPTl9HVUFSRF9SRURJUkVDVCAqLykpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIGFyZSByZWRpcmVjdGluZyB0byB0aGUgc2FtZSBsb2NhdGlvbiB3ZSB3ZXJlIGFscmVhZHkgYXRcclxuICAgICAgICAgICAgICAgICAgICAgICAgaXNTYW1lUm91dGVMb2NhdGlvbihzdHJpbmdpZnlRdWVyeSQxLCByZXNvbHZlKGZhaWx1cmUudG8pLCB0b0xvY2F0aW9uKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBhbmQgd2UgaGF2ZSBkb25lIGl0IGEgY291cGxlIG9mIHRpbWVzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0ZWRGcm9tICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEB0cy1leHBlY3QtZXJyb3I6IGFkZGVkIG9ubHkgaW4gZGV2XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIChyZWRpcmVjdGVkRnJvbS5fY291bnQgPSByZWRpcmVjdGVkRnJvbS5fY291bnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gLy8gQHRzLWV4cGVjdC1lcnJvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0ZWRGcm9tLl9jb3VudCArIDFcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogMSkgPiAxMCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3YXJuKGBEZXRlY3RlZCBhbiBpbmZpbml0ZSByZWRpcmVjdGlvbiBpbiBhIG5hdmlnYXRpb24gZ3VhcmQgd2hlbiBnb2luZyBmcm9tIFwiJHtmcm9tLmZ1bGxQYXRofVwiIHRvIFwiJHt0b0xvY2F0aW9uLmZ1bGxQYXRofVwiLiBBYm9ydGluZyB0byBhdm9pZCBhIFN0YWNrIE92ZXJmbG93LiBUaGlzIHdpbGwgYnJlYWsgaW4gcHJvZHVjdGlvbiBpZiBub3QgZml4ZWQuYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgRXJyb3IoJ0luZmluaXRlIHJlZGlyZWN0IGluIG5hdmlnYXRpb24gZ3VhcmQnKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXNoV2l0aFJlZGlyZWN0KFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGtlZXAgb3B0aW9uc1xyXG4gICAgICAgICAgICAgICAgICAgIGFzc2lnbihsb2NhdGlvbkFzT2JqZWN0KGZhaWx1cmUudG8pLCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiBkYXRhLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JjZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZSxcclxuICAgICAgICAgICAgICAgICAgICB9KSwgXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gcHJlc2VydmUgdGhlIG9yaWdpbmFsIHJlZGlyZWN0ZWRGcm9tIGlmIGFueVxyXG4gICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0ZWRGcm9tIHx8IHRvTG9jYXRpb24pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gaWYgd2UgZmFpbCB3ZSBkb24ndCBmaW5hbGl6ZSB0aGUgbmF2aWdhdGlvblxyXG4gICAgICAgICAgICAgICAgZmFpbHVyZSA9IGZpbmFsaXplTmF2aWdhdGlvbih0b0xvY2F0aW9uLCBmcm9tLCB0cnVlLCByZXBsYWNlLCBkYXRhKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0cmlnZ2VyQWZ0ZXJFYWNoKHRvTG9jYXRpb24sIGZyb20sIGZhaWx1cmUpO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFpbHVyZTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogSGVscGVyIHRvIHJlamVjdCBhbmQgc2tpcCBhbGwgbmF2aWdhdGlvbiBndWFyZHMgaWYgYSBuZXcgbmF2aWdhdGlvbiBoYXBwZW5lZFxyXG4gICAgICogQHBhcmFtIHRvXHJcbiAgICAgKiBAcGFyYW0gZnJvbVxyXG4gICAgICovXHJcbiAgICBmdW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yb20pO1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IHJlY29yZCBvZiB1cGRhdGluZ1JlY29yZHMpIHtcclxuICAgICAgICAgICAgICAgIHJlY29yZC51cGRhdGVHdWFyZHMuZm9yRWFjaChndWFyZCA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgZ3VhcmRzLnB1c2goZ3VhcmRUb1Byb21pc2VGbihndWFyZCwgdG8sIGZyb20pKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGd1YXJkcy5wdXNoKGNhbmNlbGVkTmF2aWdhdGlvbkNoZWNrKTtcclxuICAgICAgICAgICAgLy8gcnVuIHRoZSBxdWV1ZSBvZiBwZXIgcm91dGUgYmVmb3JlRW50ZXIgZ3VhcmRzXHJcbiAgICAgICAgICAgIHJldHVybiBydW5HdWFyZFF1ZXVlKGd1YXJkcyk7XHJcbiAgICAgICAgfSlcclxuICAgICAgICAgICAgLnRoZW4oKCkgPT4ge1xyXG4gICAgICAgICAgICAvLyBjaGVjayB0aGUgcm91dGUgYmVmb3JlRW50ZXJcclxuICAgICAgICAgICAgZ3VhcmRzID0gW107XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgcmVjb3JkIG9mIHRvLm1hdGNoZWQpIHtcclxuICAgICAgICAgICAgICAgIC8vIGRvIG5vdCB0cmlnZ2VyIGJlZm9yZUVudGVyIG9uIHJldXNlZCB2aWV3c1xyXG4gICAgICAgICAgICAgICAgaWYgKHJlY29yZC5iZWZvcmVFbnRlciAmJiAhZnJvbS5tYXRjaGVkLmluY2x1ZGVzKHJlY29yZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShyZWNvcmQuYmVmb3JlRW50ZXIpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY29uc3QgYmVmb3JlRW50ZXIgb2YgcmVjb3JkLmJlZm9yZUVudGVyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3VhcmRzLnB1c2goZ3VhcmRUb1Byb21pc2VGbihiZWZvcmVFbnRlciwgdG8sIGZyb20pKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGd1YXJkcy5wdXNoKGd1YXJkVG9Qcm9taXNlRm4ocmVjb3JkLmJlZm9yZUVudGVyLCB0bywgZnJvbSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBndWFyZHMucHVzaChjYW5jZWxlZE5hdmlnYXRpb25DaGVjayk7XHJcbiAgICAgICAgICAgIC8vIHJ1biB0aGUgcXVldWUgb2YgcGVyIHJvdXRlIGJlZm9yZUVudGVyIGd1YXJkc1xyXG4gICAgICAgICAgICByZXR1cm4gcnVuR3VhcmRRdWV1ZShndWFyZHMpO1xyXG4gICAgICAgIH0pXHJcbiAgICAgICAgICAgIC50aGVuKCgpID0+IHtcclxuICAgICAgICAgICAgLy8gTk9URTogYXQgdGhpcyBwb2ludCB0by5tYXRjaGVkIGlzIG5vcm1hbGl6ZWQgYW5kIGRvZXMgbm90IGNvbnRhaW4gYW55ICgpID0+IFByb21pc2U8Q29tcG9uZW50PlxyXG4gICAgICAgICAgICAvLyBjbGVhciBleGlzdGluZyBlbnRlckNhbGxiYWNrcywgdGhlc2UgYXJlIGFkZGVkIGJ5IGV4dHJhY3RDb21wb25lbnRzR3VhcmRzXHJcbiAgICAgICAgICAgIHRvLm1hdGNoZWQuZm9yRWFjaChyZWNvcmQgPT4gKHJlY29yZC5lbnRlckNhbGxiYWNrcyA9IHt9KSk7XHJcbiAgICAgICAgICAgIC8vIGNoZWNrIGluLWNvbXBvbmVudCBiZWZvcmVSb3V0ZUVudGVyXHJcbiAgICAgICAgICAgIGd1YXJkcyA9IGV4dHJhY3RDb21wb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5hdmlnYXRpb24gdG8gYmUgZmluaXNoZWQgYmVmb3JlIGNhbGxpbmcgcHVzaFdpdGhSZWRpcmVjdC4gVXNpbmdcclxuICAgICAgICAgICAgICAgICAgICAvLyBhIHNldFRpbWVvdXQgb2YgMTZtcyBzZWVtcyB0byB3b3JrIGJ1dCB0aGVyZSBpcyBub3QgZ3VhcmFudGVlIGZvclxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGl0IHRvIHdvcmsgb24gZXZlcnkgYnJvd3Nlci4gU28gSW5zdGVhZCB3ZSBkbyBub3QgcmVzdG9yZSB0aGVcclxuICAgICAgICAgICAgICAgICAgICAvLyBoaXN0b3J5IGVudHJ5IGFuZCB0cmlnZ2VyIGEgbmV3IG5hdmlnYXRpb24gYXMgcmVxdWVzdGVkIGJ5IHRoZVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG5hdmlnYXRpb24gZ3VhcmQuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGVycm9yIGlzIGFscmVhZHkgaGFuZGxlZCBieSByb3V0ZXIucHVzaCB3ZSBqdXN0IHdhbnQgdG8gYXZvaWRcclxuICAgICAgICAgICAgICAgICAgICAvLyBsb2dnaW5nIHRoZSBlcnJvclxyXG4gICAgICAgICAgICAgICAgICAgIHB1c2hXaXRoUmVkaXJlY3QoZXJyb3IudG8sIHRvTG9jYXRpb25cclxuICAgICAgICAgICAgICAgICAgICAvLyBhdm9pZCBhbiB1bmNhdWdodCByZWplY3Rpb24sIGxldCBwdXNoIGNhbGwgdHJpZ2dlckVycm9yXHJcbiAgICAgICAgICAgICAgICAgICAgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmYWlsdXJlID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFudWFsIGNoYW5nZSBpbiBoYXNoIGhpc3RvcnkgIzkxNiBlbmRpbmcgdXAgaW4gdGhlIFVSTCBub3RcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2hhbmdpbmcgYnV0IGl0IHdhcyBjaGFuZ2VkIGJ5IHRoZSBtYW51YWwgdXJsIGNoYW5nZSwgc28gd2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbmVlZCB0byBtYW51YWxseSBjaGFuZ2UgaXQgb3Vyc2VsdmVzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05hdmlnYXRpb25GYWlsdXJlKGZhaWx1cmUsIDQgLyogTkFWSUdBVElPTl9BQk9SVEVEICovIHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2IC8qIE5BVklHQVRJT05fRFVQTElDQVRFRCAqLykgJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpbmZvLmRlbHRhICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLnR5cGUgPT09IE5hdmlnYXRpb25UeXBlLnBvcCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91dGVySGlzdG9yeS5nbygtMSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKG5vb3ApO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGF2b2lkIHRoZSB0aGVuIGJyYW5jaFxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gZG8gbm90IHJlc3RvcmUgaGlzdG9yeSBvbiB1bmtub3duIGRpcmVjdGlvblxyXG4gICAgICAgICAgICAgICAgaWYgKGluZm8uZGVsdGEpXHJcbiAgICAgICAgICAgICAgICAgICAgcm91dGVySGlzdG9yeS5nbygtaW5mby5kZWx0YSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgLy8gdW5yZWNvZ25pemVkIGVycm9yLCB0cmFuc2ZlciB0byB0aGUgZ2xvYmFsIGhhbmRsZXJcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cmlnZ2VyRXJyb3IoZXJyb3IsIHRvTG9jYXRpb24sIGZyb20pO1xyXG4gICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgLnRoZW4oKGZhaWx1cmUpID0+IHtcclxuICAgICAgICAgICAgICAgIGZhaWx1cmUgPVxyXG4gICAgICAgICAgICAgICAgICAgIGZhaWx1cmUgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZmluYWxpemVOYXZpZ2F0aW9uKFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBhZnRlciBuYXZpZ2F0aW9uLCBhbGwgbWF0Y2hlZCBjb21wb25lbnRzIGFyZSByZXNvbHZlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0b0xvY2F0aW9uLCBmcm9tLCBmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAvLyByZXZlcnQgdGhlIG5hdmlnYXRpb25cclxuICAgICAgICAgICAgICAgIGlmIChmYWlsdXJlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZm8uZGVsdGEpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcm91dGVySGlzdG9yeS5nbygtaW5mby5kZWx0YSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpbmZvLnR5cGUgPT09IE5hdmlnYXRpb25UeXBlLnBvcCAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpc05hdmlnYXRpb25GYWlsdXJlKGZhaWx1cmUsIDQgLyogTkFWSUdBVElPTl9BQk9SVEVEICovIHwgMTYgLyogTkFWSUdBVElPTl9EVVBMSUNBVEVEICovKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBtYW51YWwgY2hhbmdlIGluIGhhc2ggaGlzdG9yeSAjOTE2XHJcbiAgICAgICAgICAgICAgICAgICAgICAg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dcclxuICAgICAgICAgICAgICAgIC8vIG11bHRpcGxlIHRpbWVzIHdoZW4gdGhlIHJvdXRlciBpcyB1c2VkIGluIG11bHRpcGxlIGFwcHNcclxuICAgICAgICAgICAgICAgICFzdGFydGVkICYmXHJcbiAgICAgICAgICAgICAgICBjdXJyZW50Um91dGUudmFsdWUgPT09IFNUQVJUX0xPQ0FUSU9OX05PUk1BTElaRUQpIHtcclxuICAgICAgICAgICAgICAgIC8vIHNlZSBhYm92ZVxyXG4gICAgICAgICAgICAgICAgc3RhcnRlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBwdXNoKHJvdXRlckhpc3RvcnkubG9jYXRpb24pLmNhdGNoKGVyciA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2FybignVW5leHBlY3RlZCBlcnJvciB3aGVuIHN0YXJ0aW5nIHRoZSByb3V0ZXI6JywgZXJyKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IHJlYWN0aXZlUm91dGUgPSB7fTtcclxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gU1RBUlRfTE9DQVRJT05fTk9STUFMSVpFRCkge1xyXG4gICAgICAgICAgICAgICAgLy8gQHRzLWV4cGVjdC1lcnJvcjogdGhlIGtleSBtYXRjaGVzXHJcbiAgICAgICAgICAgICAgICByZWFjdGl2ZVJvdXRlW2tleV0gPSBjb21wdXRlZCgoKSA9PiBjdXJyZW50Um91dGUudmFsdWVba2V5XSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYXBwLnByb3ZpZGUocm91dGVyS2V5LCByb3V0ZXIpO1xyXG4gICAgICAgICAgICBhcHAucHJvdmlkZShyb3V0ZUxvY2F0aW9uS2V5LCByZWFjdGl2ZShyZWFjdGl2ZVJvdXRlKSk7XHJcbiAgICAgICAgICAgIGFwcC5wcm92aWRlKHJvdXRlclZpZXdMb2NhdGlvbktleSwgY3VycmVudFJvdXRlKTtcclxuICAgICAgICAgICAgY29uc3QgdW5tb3VudEFwcCA9IGFwcC51bm1vdW50O1xyXG4gICAgICAgICAgICBpbnN0YWxsZWRBcHBzLmFkZChhcHApO1xyXG4gICAgICAgICAgICBhcHAudW5tb3VudCA9IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIGluc3RhbGxlZEFwcHMuZGVsZXRlKGFwcCk7XHJcbiAgICAgICAgICAgICAgICAvLyB0aGUgcm91dGVyIGlzIG5vdCBhdHRhY2hlZCB0byBhbiBhcHAgYW55bW9yZVxyXG4gICAgICAgICAgICAgICAgaWYgKGluc3RhbGxlZEFwcHMuc2l6ZSA8IDEpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBpbnZhbGlkYXRlIHRoZSBjdXJyZW50IG5hdmlnYXRpb25cclxuICAgICAgICAgICAgICAgICAgICBwZW5kaW5nTG9jYXRpb24gPSBTVEFSVF9MT0NBVElPTl9OT1JNQUxJWkVEO1xyXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZUhpc3RvcnlMaXN0ZW5lciAmJiByZW1vdmVIaXN0b3J5TGlzdGVuZXIoKTtcclxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50Um91dGUudmFsdWUgPSBTVEFSVF9MT0NBVElPTl9OT1JNQUxJWkVEO1xyXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0ZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICByZWFkeSA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdW5tb3VudEFwcCgpO1xyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBpZiAoKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB8fCBfX1Z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dWlfcm91dGVyO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///2237\n")},6378:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n/*!\n * jQuery i18n plugin\n * @requires jQuery v1.1 or later\n *\n * See https://github.com/recurser/jquery-i18n\n *\n * Licensed under the MIT license.\n *\n * Version: <%= pkg.version %> (<%= meta.date %>)\n */\n(function($) {\n\t/**\n\t * i18n provides a mechanism for translating strings using a jscript dictionary.\n\t *\n\t */\n\n\tvar __slice = Array.prototype.slice;\n\n\t/*\n\t * i18n property list\n\t */\n\tvar i18n = {\n\n\t\tdict: null,\n\t\tmissingPattern: null,\n\n\t\t/**\n\t\t * load()\n\t\t *\n\t\t * Load translations.\n\t\t *\n\t\t * @param property_list i18nDict : The dictionary to use for translation.\n\t\t */\n\t\tload: function(i18nDict, missingPattern) {\n\t\t\tif (this.dict !== null) {\n\t\t\t\t$.extend(this.dict, i18nDict);\n\t\t\t} else {\n\t\t\t\tthis.dict = i18nDict;\n\t\t\t}\n\n\t\t\tif (missingPattern) {\n\t\t\t\tthis.missingPattern = missingPattern;\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * unload()\n\t\t *\n\t\t * Unloads translations and clears the dictionary.\n\t\t */\n\t\tunload: function() {\n\t\t\tthis.dict = null;\n\t\t\tthis.missingPattern = null;\n\t\t},\n\n\t\t/**\n\t\t * _()\n\t\t *\n\t\t * Looks the given string up in the dictionary and returns the translation if\n\t\t * one exists. If a translation is not found, returns the original word.\n\t\t *\n\t\t * @param string str : The string to translate.\n\t\t * @param property_list params.. : params for using printf() on the string.\n\t\t *\n\t\t * @return string : Translated word.\n\t\t */\n\t\t_: function (str) {\n\t\t\tdict = this.dict;\n\t\t\tif (dict && dict.hasOwnProperty(str)) {\n\t\t\t\tstr = dict[str];\n\t\t\t} else if (this.missingPattern !== null) {\n\t\t\t\treturn this.printf(this.missingPattern, str);\n\t\t\t}\n\t\t\tvar args = __slice.call(arguments);\n\t\t\targs[0] = str;\n\t\t\t// Substitute any params.\n\t\t\treturn this.printf.apply(this, args);\n\t\t},\n\n\t\t/*\n\t\t * printf()\n\t\t *\n\t\t * Substitutes %s with parameters given in list. %%s is used to escape %s.\n\t\t *\n\t\t * @param string str : String to perform printf on.\n\t\t * @param string args : Array of arguments for printf.\n\t\t *\n\t\t * @return string result : Substituted string\n\t\t */\n\t\tprintf: function(str, args) {\n\t\t\tif (arguments.length < 2) return str;\n\t\t\tvar args = $.isArray(args) ? args : __slice.call(arguments, 1);\n\t\t\treturn str.replace(/([^%]|^)%(?:(\\d+)\\$)?s/g, function(p0, p, position) {\n\t\t\t\tif (position) {\n\t\t\t\t\treturn p + args[parseInt(position)-1];\n\t\t\t\t}\n\t\t\t\treturn p + args.shift();\n\t\t\t}).replace(/%%s/g, '%s');\n\t\t}\n\n\t};\n\n\t/*\n\t * _t()\n\t *\n\t * Allows you to translate a jQuery selector.\n\t *\n\t * eg $('h1')._t('some text')\n\t *\n\t * @param string str : The string to translate .\n\t * @param property_list params : Params for using printf() on the string.\n\t *\n\t * @return element : Chained and translated element(s).\n\t*/\n\t$.fn._t = function(str, params) {\n\t\treturn $(this).html(i18n._.apply(i18n, arguments));\n\t};\n\n\t$.i18n = i18n;\n})(jQuery);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjM3OC5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF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0ICogQWxsb3dzIHlvdSB0byB0cmFuc2xhdGUgYSBqUXVlcnkgc2VsZWN0b3IuXG5cdCAqXG5cdCAqIGVnICQoJ2gxJykuX3QoJ3NvbWUgdGV4dCcpXG5cdCAqXG5cdCAqIEBwYXJhbSAgc3RyaW5nIHN0ciAgICAgICAgICAgOiBUaGUgc3RyaW5nIHRvIHRyYW5zbGF0ZSAuXG5cdCAqIEBwYXJhbSAgcHJvcGVydHlfbGlzdCBwYXJhbXMgOiBQYXJhbXMgZm9yIHVzaW5nIHByaW50ZigpIG9uIHRoZSBzdHJpbmcuXG5cdCAqXG5cdCAqIEByZXR1cm4gZWxlbWVudCAgICAgICAgICAgICAgOiBDaGFpbmVkIGFuZCB0cmFuc2xhdGVkIGVsZW1lbnQocykuXG5cdCovXG5cdCQuZm4uX3QgPSBmdW5jdGlvbihzdHIsIHBhcmFtcykge1xuXHRcdHJldHVybiAkKHRoaXMpLmh0bWwoaTE4bi5fLmFwcGx5KGkxOG4sIGFyZ3VtZW50cykpO1xuXHR9O1xuXG5cdCQuaTE4biA9IGkxOG47XG59KShqUXVlcnkpOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6378\n")},9490:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"x\": () => (/* binding */ Global)\n/* harmony export */ });\n/* harmony import */ var _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4936);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7526);\n/* harmony import */ var _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2548);\n/* harmony import */ var _global_RateLimit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7046);\n/* harmony import */ var _global_widgets_view_min_tab_ViewMinTabBar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8287);\n/* harmony import */ var _global_widgets_view_min_tab_ViewMinTabBar__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_global_widgets_view_min_tab_ViewMinTabBar__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12);\n/* harmony import */ var _services_TTEventBus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7967);\n/* harmony import */ var _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4578);\n/* harmony import */ var _services_TTVueUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4966);\n/* harmony import */ var _components_login_TTMultiFactorAuthentication__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7024);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var jQuery = __webpack_require__(9755);\n// import { LocalCacheData } from 'exports-loader?exports=LocalCacheData!@/global/LocalCacheData';\n\n\n // TODO: duplicated in merged js files.\n\n\n\n\n\n\n\n// import { createApp } from 'vue'; // Currently only used by Global.initEditTest\n// import TTEditView from '@/components/TTEditView'; // Used by Global.initEditTest which is currently commented out as its for testing only.\n\n//Global variables and functions will be used everywhere\nvar Global = function() {\n};\nGlobal.event_bus = new _services_TTEventBus__WEBPACK_IMPORTED_MODULE_6__/* [\"default\"] */ .Z({ view_id: 'global' });\nGlobal.sortOrderRegex = /^-([0-9]{3,9})-/;\nGlobal.current_ping = -1;\n\nGlobal.UNIT_TEST_MODE = false;\n\nGlobal.app_min_width = 990;\n\nGlobal.theme = 'default';\n\n/**\n * UIReadyStatus:\n * 0 - Global.setUINotready() - the UI is not ready\n * 1 - Global.setUIReady() - the overlay is out of the way but ui is not done rendering\n * 2 - Global.setUIInitComplete() the overlay is done rendering\n */\nGlobal.UIReadyStatus = 0;\n\nGlobal.signal_timer = null;\n\nGlobal.isScrolledIntoView = function( elem ) {\n\tvar $elem = elem;\n\tvar $window = $( window );\n\tvar docViewTop = $window.scrollTop();\n\tvar docViewBottom = docViewTop + $window.height();\n\tif ( !$elem.offset() ) {\n\t\treturn true;\n\t}\n\tvar elemTop = $elem.offset().top;\n\t//var elemBottom = elemTop + $elem.height();\n\t//((elemBottom <= (docViewBottom + 200)) && (elemTop >= docViewTop));\n\treturn elemTop < docViewBottom;\n};\n\n//Check if the DOM (not jQuery) element requires a vertical scrollbar.\nGlobal.isVerticalScrollBarRequired = function( element ) {\n\treturn element && element.scrollHeight > element.clientHeight;\n};\n\n//Check if the DOM (not jQuery) element requires a horizontal scrollbar.\nGlobal.isHorizontalScrollBarRequired = function( element ) {\n\treturn element && element.scrollWidth > element.clientWidth;\n};\n\n//Gets the width of the browsers scrollbar. This value depends on the users OS/browser.\nGlobal.getScrollbarWidth = function() {\n\tif ( LocalCacheData.getScrollbarWidth() > 0 ) {\n return LocalCacheData.getScrollbarWidth();\n }\n\n\tlet scroll_div = document.createElement(\"div\");\n\tscroll_div.style.visibility = 'hidden';\n\tscroll_div.style.overflow = 'scroll';\n\tdocument.body.appendChild(scroll_div);\n\tlet scroll_bar_width = scroll_div.offsetWidth - scroll_div.clientWidth;\n\tdocument.body.removeChild(scroll_div);\n\n\t//If for some reason we cannot get the width, default the width to 17 which is most common value. (Windows\n\tif ( !scroll_bar_width ) {\n scroll_bar_width = 17;\n }\n\n\tLocalCacheData.setScrollBarWidth( scroll_bar_width );\n\n\treturn scroll_bar_width;\n}\n\n//Gets the height of the browsers scrollbar. This value depends on the users OS/browser.\nGlobal.getScrollbarHeight = function() {\n\tif ( LocalCacheData.getScrollbarHeight() > 0 ) {\n\t\treturn LocalCacheData.getScrollbarHeight();\n\t}\n\n\tlet scroll_div = document.createElement(\"div\");\n\tscroll_div.style.visibility = 'hidden';\n\tscroll_div.style.overflow = 'scroll';\n\tdocument.body.appendChild(scroll_div);\n\tlet scroll_bar_height = scroll_div.offsetHeight - scroll_div.clientHeight;\n\tdocument.body.removeChild(scroll_div);\n\n\t//If for some reason we cannot get the height, default the height to 17 which is most common value. (Windows\n\tif ( !scroll_bar_height ) {\n\t\tscroll_bar_height = 17;\n }\n\n\tLocalCacheData.setScrollBarHeight( scroll_bar_height );\n\n\treturn scroll_bar_height;\n}\n\nGlobal.KEYCODES = {\n\t'48': '0',\n\t'49': '1',\n\t'50': '2',\n\t'51': '3',\n\t'52': '4',\n\t'53': '5',\n\t'54': '6',\n\t'55': '7',\n\t'56': '8',\n\t'59': '9',\n\t'65': 'a',\n\t'66': 'b',\n\t'67': 'c',\n\t'68': 'd',\n\t'69': 'e',\n\t'70': 'f',\n\t'71': 'g',\n\t'72': 'h',\n\t'73': 'i',\n\t'74': 'j',\n\t'75': 'k',\n\t'76': 'l',\n\t'77': 'm',\n\t'78': 'n',\n\t'79': 'o',\n\t'80': 'p',\n\t'81': 'q',\n\t'82': 'r',\n\t'83': 's',\n\t'84': 't',\n\t'85': 'u',\n\t'86': 'v',\n\t'87': 'w',\n\t'88': 'x',\n\t'89': 'y',\n\t'90': 'z'\n};\n\nGlobal.needReloadBrowser = false; // Need reload browser after set new cookie. To make router work for new session.\n\n// this attribute use to block UI in speical case that we allow users to click part of them and block other parts.\n// For example, when open edit view to block context menu.\nGlobal.block_ui = false;\n\nGlobal.sendErrorReport = function() {\n\tvar error_string = arguments[0];\n\tvar from_file = arguments[1];\n\tvar line = arguments[2];\n\tvar col = arguments[3];\n\tvar error_obj = arguments[4]; //Error object.\n\n\t_global_RateLimit__WEBPACK_IMPORTED_MODULE_3__/* .RateLimit.setID */ .b.setID( 'sendErrorReport' );\n\t_global_RateLimit__WEBPACK_IMPORTED_MODULE_3__/* .RateLimit.setAllowedCalls */ .b.setAllowedCalls( 6 );\n\t_global_RateLimit__WEBPACK_IMPORTED_MODULE_3__/* .RateLimit.setTimeFrame */ .b.setTimeFrame( 7200 ); //2hrs\n\n\tif ( _global_RateLimit__WEBPACK_IMPORTED_MODULE_3__/* .RateLimit.check */ .b.check() ) {\n\t\tvar captureScreenShot = function( error_msg, error_obj ) {\n\t\t\tif ( Global.isCanvasSupported() && typeof Promise !== 'undefined' ) { //HTML2Canvas requires promises, which IE11 does not have.\n\t\t\t\thtml2canvas( document.body ).then( function( canvas ) {\n\t\t\t\t\tvar image_string = canvas.toDataURL().split( ',' )[1];\n\t\t\t\t\tsourceMapStackTrace( error_msg, error_obj, image_string );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tsourceMapStackTrace( error_msg, error_obj, null );\n\t\t\t}\n\t\t};\n\n\t\tvar sourceMapStackTrace = function( error_msg, error_obj, image_string ) {\n\t\t\tif ( error_obj ) {\n\t\t\t\tvar stacktrace_callback = function( stackframes, error_msg, error_obj, image_string ) {\n\t\t\t\t\tvar stringified_stack = stackframes.map( function( sf ) {\n\t\t\t\t\t\treturn ' ' + sf.toString(); //Indent stack trace.\n\t\t\t\t\t} ).join( '\\n' );\n\n\t\t\t\t\terror_msg = error_msg + '\\n\\n\\n' + 'Stack Trace (Mapped): \\n' + error_obj.name + ': ' + error_obj.message + '\\n' + stringified_stack;\n\t\t\t\t\terror_msg = error_msg + '\\n\\n\\n' + 'Stack Trace (Raw): \\n' + error_obj.stack;\n\n\t\t\t\t\tsendErrorReport( error_msg, error_obj, image_string );\n\t\t\t\t};\n\n\t\t\t\tvar stacktrace_errback = function( error_msg, error_obj, image_string ) {\n\t\t\t\t\tconsole.error( 'ERROR: Unable to source map stack trace!' );\n\t\t\t\t\tsendErrorReport( error_msg, error_obj, image_string );\n\t\t\t\t};\n\n\t\t\t\tStackTrace.fromError( error_obj ).then( stackframes => stacktrace_callback( stackframes, error_msg, error_obj, image_string ) ).catch( error => stacktrace_errback( error_msg, error_obj, image_string ) );\n\t\t\t} else {\n\t\t\t\tsendErrorReport( error_msg, error_obj, image_string );\n\t\t\t}\n\t\t};\n\n\t\tvar sendErrorReport = function( error_msg, error_obj, image_string ) {\n\t\t\tDebug.Text( 'ERROR: ' + error_msg, 'Global.js', '', 'sendErrorReport', 1 );\n\n\t\t\tvar api_authentication = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\t\t\tapi_authentication.sendErrorReport( error_msg, image_string, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tif ( !Global.dont_check_browser_cache && APIGlobal.pre_login_data.production === true && result.getResult() !== APIGlobal.pre_login_data.application_build ) {\n\t\t\t\t\t\tresult = result.getResult();\n\t\t\t\t\t\tvar message = $.i18n._( 'Your web browser is caching incorrect data, please press the refresh button on your web browser or log out, clear your web browsers cache and try logging in again.' ) + '<br><br>' + $.i18n._( 'Local Version' ) + ': ' + result + '<br>' + $.i18n._( 'Remote Version' ) + ': ' + APIGlobal.pre_login_data.application_build;\n\t\t\t\t\t\tGlobal.dont_check_browser_cache = true;\n\t\t\t\t\t\tGlobal.sendErrorReport( 'Your web browser is caching incorrect data. Local Version' + ': ' + result + ' Remote Version' + ': ' + APIGlobal.pre_login_data.application_build, _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url, '', '', '' );\n\n\t\t\t\t\t\tvar timeout_handler = window.setTimeout( function() {\n\t\t\t\t\t\t\twindow.location.reload( true );\n\t\t\t\t\t\t}, 120000 );\n\n\t\t\t\t\t\tTAlertManager.showAlert( message, '', function() {\n\t\t\t\t\t\t\tLocalCacheData.loadedScriptNames = {};\n\t\t\t\t\t\t\tDebug.Text( 'Incorrect cache... Forcing reload after JS exception...', 'Global.js', 'Global', 'cachingIncorrectData', 10 );\n\t\t\t\t\t\t\twindow.clearTimeout( timeout_handler );\n\t\t\t\t\t\t\twindow.location.reload( true );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} else if ( Global.dont_check_browser_cache ) {\n\t\t\t\t\t\tGlobal.dont_check_browser_cache = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\tvar login_user = LocalCacheData.getLoginUser();\n\n\t\t/*\n\t\t * JavaScript exception ignore list\n\t\t */\n\t\tif ( from_file && typeof from_file == 'string' && from_file.indexOf( 'extension://' ) >= 0 ) { //Error happened in some Chrome Extension, ignore.\n\t\t\tconsole.error( 'Ignoring javascript exception from browser extension outside of our control...' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( error_string.indexOf( 'Script error' ) >= 0 || //Script error. in: line: 0 -- Likely browser extensions or errors from injected or outside javascript.\n\t\t\terror_string.indexOf( 'Unspecified error' ) >= 0 || //From IE: Unspecified error. in N/A line 1\n\t\t\terror_string.indexOf( 'TypeError: \\'null\\' is not an object' ) >= 0 ||\n\t\t\terror_string.indexOf( '_avast_submit' ) >= 0 || //Errors from anti-virus extension\n\t\t\terror_string.indexOf( 'ResizeObserver loop limit exceeded' ) >= 0 ||\n\t\t\terror_string.indexOf( 'googletag' ) >= 0 || //Errors from google tag extension -- Uncaught TypeError: Cannot redefine property: googletag\n\t\t\terror_string.indexOf( 'NS_ERROR_' ) >= 0 ||\n\t\t\terror_string.indexOf( 'NS_ERROR_OUT_OF_MEMORY' ) >= 0 ||\n\t\t\terror_string.indexOf( 'NPObject' ) >= 0 ) { //Error calling method on NPObject - likely caused by an extension or plugin in the browser\n\t\t\tconsole.error( 'Ignoring javascript exception outside of our control...' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( Global.idle_time > 15 ) {\n\t\t\tDebug.Text( 'User inactive more than 15 mins, not sending error report.', 'Global.js', '', 'sendErrorReport', 1 );\n\t\t\tif ( typeof ( gtag ) !== 'undefined' && APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\t\t\tgtag( 'event', 'exception', {\n\t\t\t\t\t'exDescription': 'Session Idle: ' + error_string + ' File: ' + ( ( from_file ) ? from_file.replace( Global.getBaseURL(), '' ) : 'N/A' ) + ' Line: ' + line,\n\t\t\t\t\t'exFatal': false\n\t\t\t\t} )\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvar error;\n\n\t\t//BUG#2066 - allow this function to be called earlier.\n\t\tvar script_name = '~unknown~';\n\t\tif ( Global.isSet( LocalCacheData ) && Global.isSet( LocalCacheData.current_open_primary_controller ) && Global.isSet( LocalCacheData.current_open_primary_controller.script_name ) ) {\n\t\t\tscript_name = LocalCacheData.current_open_primary_controller.script_name;\n\t\t}\n\n\t\tvar pre_login_data;\n\t\tif ( APIGlobal.pre_login_data ) {\n\t\t\tpre_login_data = APIGlobal.pre_login_data;\n\t\t} else {\n\t\t\tpre_login_data = null;\n\t\t}\n\n\t\tvar current_company_obj;\n\t\tif ( Global.isSet( LocalCacheData ) && LocalCacheData['current_company'] ) { //getCurrentCompany() which in turn calls getRequiredLocalCache(), which can call sendErroReport causing a loop. So try to prevent that by checking LocalCacheData['current_company'] first.\n\t\t\tcurrent_company_obj = LocalCacheData.getCurrentCompany();\n\t\t} else {\n\t\t\tcurrent_company_obj = null;\n\t\t}\n\n\t\tif ( login_user && Debug.varDump ) {\n\t\t\terror = 'Client Version: ' + APIGlobal.pre_login_data.application_build + '\\n\\nUncaught Error From: ' + script_name + '\\n\\nError: ' + error_string + ' in: ' + from_file + ' line: ' + line + ':' + col + '\\n\\nUser: ' + login_user.user_name + '\\n\\nURL: ' + window.location.href + '\\n\\nUser-Agent: ' + navigator.userAgent + ' ' + '\\n\\nIE: ' + window.ie + '\\n\\nCurrent Ping: ' + Global.current_ping + '\\n\\nIdle Time: ' + Global.idle_time + '\\n\\nSession ID Key: ' + LocalCacheData.getSessionID() + '\\n\\nCurrent User Object: \\n' + Debug.varDump( login_user ) + '\\n\\nCurrent Company Object: \\n' + Debug.varDump( current_company_obj ) + '\\n\\nPreLogin: \\n' + Debug.varDump( pre_login_data ) + ' ';\n\t\t} else {\n\t\t\terror = 'Client Version: ' + APIGlobal.pre_login_data.application_build + '\\n\\nUncaught Error From: ' + script_name + '\\n\\nError: ' + error_string + ' in: ' + from_file + ' line: ' + line + ':' + col + '\\n\\nUser: N/A' + '\\n\\nURL: ' + window.location.href + ' ' + '\\n\\nUser-Agent: ' + navigator.userAgent + ' ' + '\\n\\nIE: ' + window.ie;\n\t\t}\n\n\t\tconsole.error( 'JAVASCRIPT EXCEPTION:\\n---------------------------------------------\\n' + error + '\\n---------------------------------------------' );\n\t\tdebugger;\n\n\t\t//When not in production mode, popup alert box anytime an exception appears so it can't be missed.\n\t\tif ( APIGlobal.pre_login_data.production !== true && APIGlobal.pre_login_data.demo_mode !== true && APIGlobal.pre_login_data.sandbox !== true ) {\n\t\t\talert( 'JAVASCRIPT EXCEPTION:\\n---------------------------------------------\\n' + error + '\\n---------------------------------------------' );\n\t\t}\n\n\t\tif ( typeof ( gtag ) !== 'undefined' && APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\t\t// Send an exception hit to Google Analytics. Must be 8192 bytes or smaller.\n\t\t\t// Strip the domain part off the URL on 'from_file' to better account for similar errors.\n\t\t\tgtag( 'event', 'exception', {\n\t\t\t\t'exDescription': error_string + ' File: ' + ( ( from_file ) ? from_file.replace( Global.getBaseURL(), '' ) : 'N/A' ) + ' Line: ' + line + ':' + col,\n\t\t\t\t'exFatal': false\n\t\t\t} )\n\t\t}\n\n\t\t//Don't send error report if exception not happens in our codes.\n\t\t//from_file should always contains the root url\n\t\t//If URL is not sent by IE, assume its our own code and report the error still.\n\t\t// Modern browsers won't send error reports from other domains due to security issues now, so I think this can be removed.\n\t\t// if ( from_file && from_file.indexOf( ServiceCaller.root_url ) < 0 ) {\n\t\t// \tDebug.Text( 'Exception caught from unauthorized source, not sending report. Source: \"' + ServiceCaller.root_url + '\" Script: ' + from_file, 'Global.js', '', 'sendErrorReport', 1 );\n\t\t// \treturn;\n\t\t// }\n\n\t\tif ( current_company_obj ) { //getCurrentCompany() which in turn calls getRequiredLocalCache(), which can call sendErroReport causing a loop. So try to prevent that by checking LocalCacheData['current_company'] first.\n\t\t\terror = error + '\\n\\n' + 'Product Edition: ' + current_company_obj.product_edition_id;\n\t\t}\n\n\t\terror = error + '\\n\\n\\n' + 'Clicked target stacks: ' + JSON.stringify( LocalCacheData.ui_click_stack, undefined, 2 );\n\t\terror = error + '\\n\\n\\n' + 'API stacks: ' + JSON.stringify( LocalCacheData.api_stack, undefined, 2 );\n\n\t\tcaptureScreenShot( error, error_obj );\n\t}\n};\n\nGlobal.initStaticStrings = function() {\n\tGlobal.network_lost_msg = $.i18n._( 'The network connection was lost. Please check your network connection then try again.' );\n\n\tGlobal.any_item = '-- ' + $.i18n._( 'Any' ) + ' --';\n\n\tGlobal.all_item = '-- ' + $.i18n._( 'All' ) + ' --';\n\n\tGlobal.root_item = $.i18n._( 'Root' );\n\n\tGlobal.loading_label = '...';\n\n\tGlobal.customize_item = '-- ' + $.i18n._( 'Customize' ) + ' --';\n\n\tGlobal.default_item = '-- ' + $.i18n._( 'Default' ) + ' --';\n\n\tGlobal.selected_item = '-- ' + $.i18n._( 'Selected' ) + ' --';\n\n\tGlobal.open_item = '-- ' + $.i18n._( 'Open' ) + ' --';\n\n\tGlobal.empty_item = '-- ' + $.i18n._( 'None' ) + ' --';\n\n\tGlobal.view_mode_message = $.i18n._( 'You are currently in \\'View\\' mode' );\n\n\tGlobal.view_mode_edit_message = $.i18n._( 'instead click the \\'Edit\\' icon to modify fields' ); //Does not start with a capital as it is appended text.\n\n\tGlobal.no_result_message = $.i18n._( 'No Results Found' );\n\n\tGlobal.save_and_continue_message = $.i18n._( 'Please save this record before modifying any related data' );\n\n\tGlobal.no_hierarchy_message = $.i18n._( 'No Hierarchies Defined' );\n\n\tGlobal.modify_alert_message = $.i18n._( 'You have modified data without saving, are you sure you want to continue and lose your changes' );\n\n\tGlobal.confirm_on_exit_message = $.i18n._( 'Are you sure you want to continue without saving?' );\n\n\tGlobal.delete_confirm_message = $.i18n._( 'You are about to delete data, once data is deleted it can not be recovered.<br>Are you sure you wish to continue?' );\n\n\tGlobal.delete_dashlet_confirm_message = $.i18n._( 'You are about to delete this dashlet, once a dashlet is deleted it can not be recovered.<br>Are you sure you wish to continue?' );\n\n\tGlobal.copy_multiple_confirm_message = $.i18n._( 'You are about to copy multiple records.<br>Are you sure you wish to continue?' );\n\n\tGlobal.auto_arrange_dashlet_confirm_message = $.i18n._( 'You are about to restore all dashlets to their default size/layout.<br>Are you sure you wish to continue?' );\n\n\tGlobal.rese_all_dashlet_confirm_message = $.i18n._( 'You are about to remove all your customized dashlets and restore them back to the defaults.<br>Are you sure you wish to continue?' );\n};\n\nGlobal.getUpgradeMessage = function() {\n\tvar message = $.i18n._( 'This functionality is only available in' ) +\n\t\t' ' + LocalCacheData.getLoginData().application_name + ' ';\n\n\tif ( Global.getProductEdition() < 15 ) {\n\t\t//Do not mention professional if user is on professional edition.\n\t\tmessage += $.i18n._( 'Professional, Corporate, or Enterprise Editions.' );\n\t} else if ( Global.getProductEdition() < 20 ) {\n\t\t//Do not mention corporate if user is on corporate edition.\n\t\tmessage += $.i18n._( 'Corporate or Enterprise Editions.' );\n\t} else {\n\t\tmessage += $.i18n._( 'Enterprise Editions.' );\n\t}\n\n\tmessage += ' ' + $.i18n._( 'For more information please visit' ) + ' <a href=\"https://www.timetrex.com/r?id=810\" target=\"_blank\">www.timetrex.com</a>';\n\n\tGlobal.trackView( 'CommunityUpgrade' );\n\treturn message;\n};\n\nGlobal.doPingIfNecessary = function() {\n\tif ( Global.idle_time < Math.min( 15, APIGlobal.pre_login_data.session_idle_timeout / 60 ) ) { //idle_time is minutes, session_idle_timeout is seconds.\n\t\tGlobal.idle_time = 0;\n\t\treturn;\n\t}\n\n\tDebug.Text( 'User is active again after idle for: ' + Global.idle_time + '... Resetting idle to 0', 'Global.js', '', 'doPingIfNecessary', 1 );\n\tGlobal.idle_time = 0;\n\n\tif ( LocalCacheData.current_open_primary_controller.viewId === 'LoginView' ) {\n\t\treturn;\n\t}\n\n\tvar api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\tapi.isLoggedIn( false, {\n\t\tonResult: function( result ) {\n\t\t\tvar res_data = result.getResult();\n\n\t\t\tif ( res_data !== true ) {\n\t\t\t\t//Don't do Logout here, as we need to display a \"Session Expired\" message to the user, which is triggered from the ServiceCaller.\n\t\t\t\t// In order to trigger that though, we need to make an *Authenticated* API call to APIMisc.Ping(), rather than UnAuthenticated call to APIAuthentication.Ping()\n\t\t\t\tvar api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIMisc */ .y.APIMisc;\n\t\t\t\tapi.ping( {\n\t\t\t\t\tonResult: function() {\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t} );\n};\n\nGlobal.setupPing = function() {\n\tGlobal.idle_time = 0;\n\t$( 'body' ).mousemove( Global.debounce( function setupPingMouseMoveEvent( e ) {\n\t\tGlobal.doPingIfNecessary();\n\t}, 1000 ) );\n\t$( 'body' ).keypress( Global.debounce( function setupPingKeyPressEvent( e ) {\n\t\tGlobal.doPingIfNecessary();\n\t}, 1000 ) );\n\n\tsetInterval( timerIncrement, 60000 ); // 1 minute\n\tfunction timerIncrement() {\n\t\tGlobal.idle_time = Global.idle_time + 1;\n\t\tif ( Global.idle_time >= Math.min( 15, APIGlobal.pre_login_data.session_idle_timeout / 60 ) ) {\n\t\t\tDebug.Text( 'User is idle: ' + Global.idle_time, 'Global.js', '', 'setupPing', 1 );\n\t\t}\n\t}\n};\n\nGlobal.clearCache = function( function_name ) {\n\tfor ( var key in LocalCacheData.result_cache ) {\n\t\tif ( key.indexOf( function_name ) >= 0 ) {\n\t\t\tdelete LocalCacheData.result_cache[key];\n\t\t}\n\t}\n};\n\nGlobal.getHost = function( host ) {\n\tif ( !host ) {\n\t\thost = window.location.hostname;\n\t}\n\n\t//Make sure its not an IPv4 address, and if its a domain has more than 1 dot in it before parsing off the sub-domain part.\n\t// So both IPv4 addresses and domains like: localhost (no dot at all), mycompany.com should not be modified at all. Only: sub.mycompany.com, sub.sub2.mycompany.com\n\tvar is_sub_domain = host.match( /\\./g );\n\tif ( /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test( host ) == false && is_sub_domain && is_sub_domain.length > 1 ) {\n\t\thost = host.substring( ( host.indexOf( '.' ) + 1 ) );\n\t}\n\n\treturn host;\n};\n\nGlobal.setWidgetEnabled = function( widget, val ) {\n\tif ( widget ) {\n\t\tif ( !val ) {\n\t\t\twidget.attr( 'disabled', 'true' );\n\t\t\twidget.addClass( 'disable-filter' );\n\t\t} else {\n\t\t\twidget.removeAttr( 'disabled' );\n\t\t\twidget.removeClass( 'disable-filter' );\n\t\t}\n\t}\n};\n\nGlobal.createViewTabs = function() {\n\t//JS load Optimize\n\tif ( typeof _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic == 'undefined' ) {\n\t\treturn;\n\t}\n\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\tif ( !LocalCacheData.view_min_tab_bar ) {\n\t\t\tvar view_min_tab_bar = Global.loadWidgetByName( _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.VIEW_MIN_TAB_BAR );\n\t\t\tview_min_tab_bar = $( view_min_tab_bar ).ViewMinTabBar();\n\t\t\t$( '.layout-menu-container' ).append( view_min_tab_bar );\n\n\t\t\tLocalCacheData.view_min_tab_bar = view_min_tab_bar;\n\t\t}\n\n\t\tLocalCacheData.view_min_tab_bar.buildTabs( LocalCacheData.view_min_map );\n\t}\n};\n\nGlobal.addViewTab = function( view_id, view_name, url ) {\n\n\tLocalCacheData.view_min_map[view_id] = view_name;\n\n\tLocalCacheData.view_min_map[view_id + '_url'] = url;\n\n\tGlobal.createViewTabs();\n};\n\nGlobal.removeViewTab = function( view_id ) {\n\n\tdelete LocalCacheData.view_min_map[view_id];\n\t$( '#min_tab_' + view_id ).remove();\n};\n\nGlobal.cleanViewTab = function() {\n\n\tLocalCacheData.view_min_map = {};\n\tGlobal.createViewTabs();\n};\n\nGlobal.upCaseFirstLetter = function( str ) {\n\tif ( typeof str == 'string' ) { //in case null or false is passed, we should check the type.\n\t\tstr = str.charAt( 0 ).toUpperCase() + str.slice( 1 );\n\t}\n\treturn str;\n};\n\nGlobal.calculateTextWidth = function( text, options ) {\n\tif ( typeof options === \"undefined\" ) {\n\t\toptions = {};\n\t}\n\n\tif ( !options.fontSize ) {\n\t\toptions.fontSize = '12px';\n\t}\n\n\tvar element = document.createElement( 'div' );\n\tvar textNode = document.createTextNode( text );\n\n\telement.appendChild( textNode );\n\n\tif ( options.font ) {\n\t\telement.style.fontFamily = options.font;\n\t}\n\n\tif ( options.fontWeight ) {\n\t\telement.style.fontWeight = options.fontWeight;\n\t}\n\n\tif ( options.wordBreak ) {\n\t\telement.style.wordBreak = options.wordBreak;\n\t}\n\n\telement.style.fontSize = options.fontSize;\n\telement.style.position = 'absolute';\n\telement.style.visibility = 'hidden';\n\telement.style.left = '-999px';\n\telement.style.top = '-999px';\n\telement.style.height = 'auto';\n\n\tdocument.body.appendChild( element );\n\tvar content_width = element.offsetWidth;\n\telement.parentNode.removeChild( element );\n\n\tif ( options.min_width && options.min_width > 0 && content_width < options.min_width ) {\n\t\tcontent_width = options.min_width;\n\t}\n\tif ( options.padding && options.padding > 0 ) {\n\t\tcontent_width = content_width + options.padding;\n\t}\n\tif ( options.max_width > 0 && content_width > options.max_width ) {\n\t\tcontent_width = options.max_width;\n\t}\n\n\treturn content_width;\n};\n\nGlobal.strToDate = function( date_string, format ) {\n\n\t//better to use Date.parse, let's see\n\tif ( !Global.isSet( format ) && LocalCacheData.getLoginUserPreference() ) {\n\t\tformat = LocalCacheData.getLoginUserPreference().date_format;\n\t}\n\n\tif ( !format ) {\n\t\tformat = 'DD-MMM-YY';\n\t}\n\n\tvar date = moment( date_string, format );\n\tdate = date.toDate();\n\n\t//The moment will pass everything as a date. Judge if the year less 1000 than 1900 or beyond 1000 of 1900,\n\t//we think it's a invalid year\n\tif ( date.getYear() < -1000 || date.getYear() > 1000 ) {\n\t\treturn null;\n\t}\n\n\treturn date;\n};\n\nGlobal.strToDateTime = function( date_string ) {\n\t//Error: TypeError: Global.strToDateTime(...) is null in /interface/html5/framework/jquery.min.js?v=8.0.0-20141117-153515 line 4862\n\tif ( !date_string || !LocalCacheData.getLoginUserPreference() ) {\n\t\treturn null;\n\t}\n\n\tvar date_format = LocalCacheData.getLoginUserPreference().date_format;\n\tvar time_format = LocalCacheData.getLoginUserPreference().js_time_format[LocalCacheData.getLoginUserPreference().time_format];\n\tvar date = moment( date_string, date_format + ' ' + time_format ).toDate();\n\n\treturn date;\n\t//return Date.parse( date_string );\n};\n\n//Convert all kinds of date time to mm/dd/yyyy so Date.parse can parse it correct\nGlobal.getStandardDateTimeStr = function( date_str, time_str ) {\n\t//var result = Global.strToDate( date_str ).format( 'MM/DD/YYYY' ) + ' ' + time_str;\n\n\treturn date_str;\n};\n\nGlobal.convertTojQueryFormat = function( date_format ) {\n\t//For moment date parser\n\tvar jquery_date_format = {\n\t\t'd-M-y': 'dd-M-y',\n\t\t'd-M-Y': 'dd-M-yy',\n\t\t'dMY': 'ddMyy',\n\t\t'd/m/Y': 'dd/mm/yy',\n\t\t'd/m/y': 'dd/mm/y',\n\t\t'd-m-y': 'dd-mm-y',\n\t\t'd-m-Y': 'dd-mm-yy',\n\t\t'm/d/y': 'mm/dd/y',\n\t\t'm/d/Y': 'mm/dd/yy',\n\t\t'm-d-y': 'mm-dd-y',\n\t\t'm-d-Y': 'mm-dd-yy',\n\t\t'Y-m-d': 'yy-mm-dd',\n\t\t'M-d-y': 'M-dd-y',\n\t\t'M-d-Y': 'M-dd-yy',\n\t\t'l, F d Y': 'DD, MM dd yy',\n\t\t'D, F d Y': 'D, MM dd yy',\n\t\t'D, M d Y': 'D, M dd yy',\n\t\t'D, d-M-Y': 'D, dd-M-yy',\n\t\t'D, dMY': 'D, ddMyy',\n\n\t\t'g:i A': 'h:mm TT',\n\t\t'g:i a': 'h:mm tt',\n\t\t'G:i': 'H:mm',\n\t\t'g:i A T': 'h:mm TT',\n\t\t'G:i T': 'H:mm',\n\n\t\t'g:i:s A': 'h:mm:ss TT',\n\t\t'g:i:s a': 'h:mm:ss tt',\n\t\t'G:i:s': 'H:mm:ss',\n\t\t'g:i:s A T': 'h:mm:ss TT',\n\t\t'G:i:s T': 'H:mm:ss'\n\t};\n\n\treturn jquery_date_format[date_format];\n};\n\nGlobal.updateUserPreference = function( callBack, message ) {\n\tvar user_preference_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIUserPreference */ .y.APIUserPreference;\n\tvar current_user_aou = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\n\tif ( message ) {\n\t\tProgressBar.changeProgressBarMessage( message );\n\t}\n\n\tcurrent_user_aou.getCurrentUserPreference( {\n\t\tonResult: function( result ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tLocalCacheData.loginUserPreference = result_data;\n\n\t\t\tuser_preference_api.getOptions( 'moment_date_format', {\n\t\t\t\tonResult: function( jsDateFormatRes ) {\n\t\t\t\t\tvar jsDateFormatResultData = jsDateFormatRes.getResult();\n\n\t\t\t\t\t//For moment date parser\n\t\t\t\t\tLocalCacheData.loginUserPreference.js_date_format = jsDateFormatResultData;\n\n\t\t\t\t\tvar date_format = LocalCacheData.loginUserPreference.date_format;\n\t\t\t\t\tif ( !date_format ) {\n\t\t\t\t\t\tdate_format = 'DD-MMM-YY';\n\t\t\t\t\t}\n\n\t\t\t\t\tLocalCacheData.loginUserPreference.date_format = LocalCacheData.loginUserPreference.js_date_format[date_format];\n\n\t\t\t\t\tLocalCacheData.loginUserPreference.date_format_1 = Global.convertTojQueryFormat( date_format ); //TDatePicker, TRangePicker\n\t\t\t\t\tLocalCacheData.loginUserPreference.time_format_1 = Global.convertTojQueryFormat( LocalCacheData.loginUserPreference.time_format ); //TTimePicker\n\n\t\t\t\t\tuser_preference_api.getOptions( 'moment_time_format', {\n\t\t\t\t\t\tonResult: function( jsTimeFormatRes ) {\n\t\t\t\t\t\t\tvar jsTimeFormatResultData = jsTimeFormatRes.getResult();\n\n\t\t\t\t\t\t\tLocalCacheData.loginUserPreference.js_time_format = jsTimeFormatResultData;\n\n\t\t\t\t\t\t\tLocalCacheData.setLoginUserPreference( LocalCacheData.loginUserPreference );\n\n\t\t\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\t\t\tcallBack();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n};\n\n/* jshint ignore:start */\nGlobal.roundTime = function( epoch, round_value, round_type ) {\n\tvar round_type = round_type || 20;\n\n\tswitch ( round_type ) {\n\t\tcase 10: //Down\n\t\t\tepoch = ( epoch - ( epoch % round_value ) );\n\t\t\tbreak;\n\t\tcase 20: //Average\n\t\tcase 25: //Average (round split seconds up)\n\t\tcase 27: //Average (round split seconds down)\n\t\t\tvar tmp_round_value;\n\t\t\tif ( round_type == 20 || round_value <= 60 ) {\n\t\t\t\ttmp_round_value = ( round_value / 2 );\n\t\t\t} else if ( round_type == 25 ) { //Average (Partial Min. Down)\n\t\t\t\ttmp_round_value = Global.roundTime( ( round_value / 2 ), 60, 10 ); //This is opposite rounding\n\t\t\t} else if ( round_type == 27 ) { //Average (Partial Min. Up)\n\t\t\t\ttmp_round_value = Global.roundTime( ( round_value / 2 ), 60, 30 );\n\t\t\t}\n\n\t\t\tif ( epoch > 0 ) {\n\t\t\t\t//When doing a 15min average rounding, US law states 7mins and 59 seconds can be rounded down in favor of the employer, and 8mins and 0 seconds must be rounded up.\n\t\t\t\t//So if the round interval is not an even number, round it up to the nearest minute before doing the calculations to avoid issues with seconds.\n\t\t\t\tepoch = ( Math.floor( ( epoch + tmp_round_value ) / round_value ) * round_value );\n\t\t\t} else {\n\t\t\t\tepoch = ( Math.ceil( ( epoch - tmp_round_value ) / round_value ) * round_value );\n\t\t\t}\n\n\t\t\tbreak;\n\t\tcase 30: //Up\n\t\t\tepoch = ( ( ( epoch + ( round_value - 1 ) ) / round_value ) * round_value );\n\t\t\tbreak;\n\t}\n\n\treturn epoch;\n},\n\n\tGlobal.parseTimeUnit = function( time_unit, format ) {\n\t\tvar format, time_unit, time_units, seconds, negative_number;\n\n\t\tvar time_unit = time_unit.toString(); //Needs to be a string so we can use .charAt and .replace below.\n\n\t\tif ( !format ) {\n\t\t\tformat = LocalCacheData.getLoginUserPreference().time_unit_format;\n\t\t}\n\t\tformat = parseInt( format );\n\n\t\tvar enable_rounding = true;\n\t\tif ( time_unit.charAt( 0 ) == '\"' ) {\n\t\t\tenable_rounding = false;\n\t\t}\n\n\t\tvar thousands_separator = ',';\n\t\tvar decimal_separator = '.';\n\n\t\ttime_unit = time_unit.replace( new RegExp( thousands_separator, 'g' ), '' ).replace( new RegExp( ' ', 'g' ), '' ).replace( new RegExp( '\"', 'g' ), '' ); //Need to use regex to replace all instances.\n\n\t\tswitch ( format ) {\n\t\t\tcase 10: //hh:mm\n\t\t\tcase 12: //hh:mm:ss\n\t\t\t\tif ( time_unit.indexOf( decimal_separator ) !== -1 && time_unit.indexOf( ':' ) === -1 ) { //Hybrid mode, they passed a decimal format HH:MM, try to handle properly.\n\t\t\t\t\ttime_unit = Global.getTimeUnit( Global.parseTimeUnit( time_unit, 20 ), format );\n\t\t\t\t}\n\n\t\t\t\ttime_units = time_unit.split( ':' );\n\n\t\t\t\tif ( !time_units[0] ) {\n\t\t\t\t\ttime_units[0] = 0;\n\t\t\t\t}\n\n\t\t\t\tif ( !time_units[1] ) {\n\t\t\t\t\ttime_units[1] = 0;\n\t\t\t\t}\n\n\t\t\t\tif ( !time_units[2] ) {\n\t\t\t\t\ttime_units[2] = 0;\n\t\t\t\t} else {\n\t\t\t\t\tif ( time_units[2] != 0 ) {\n\t\t\t\t\t\tenable_rounding = false; //Since seconds were specified, don't round to nearest minute.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnegative_number = false;\n\t\t\t\tif ( time_units[0].toString().charAt( 0 ) == '-' || time_units[0] < 0 || time_units[1] < 0 || time_units[2] < 0 ) {\n\t\t\t\t\tnegative_number = true;\n\t\t\t\t}\n\n\t\t\t\tseconds = ( ( Math.abs( Math.floor( time_units[0] ) ) * 3600 ) + ( Math.abs( Math.floor( time_units[1] ) ) * 60 ) + Math.abs( Math.floor( time_units[2] ) ) );\n\n\t\t\t\tif ( negative_number == true ) {\n\t\t\t\t\tseconds = ( seconds * -1 );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 20: //hours\n\t\t\tcase 22: //hours [Precise]\n\t\t\tcase 23: //hours [Super Precise]\n\t\t\t\tif ( time_unit.indexOf( ':' ) !== -1 ) { //Hybrid mode, they passed a decimal format HH:MM, try to handle properly.\n\t\t\t\t\ttime_unit = Global.getTimeUnit( Global.parseTimeUnit( time_unit, 10 ), format );\n\t\t\t\t}\n\n\t\t\t\tseconds = ( time_unit * 3600 );\n\t\t\t\tbreak;\n\t\t\tcase 30: //minutes\n\t\t\t\tseconds = ( time_unit * 60 );\n\t\t\t\tbreak;\n\t\t\tcase 40: //seconds\n\t\t\t\tseconds = time_unit;\n\t\t\t\tif ( enable_rounding == true ) {\n\t\t\t\t\tseconds = round( seconds ); //Round to nearest whole number by default.\n\t\t\t\t}\n\t\t\t\tenable_rounding = false; //Since seconds were specified, don't round to nearest minute. Also for accruals might need to allow decimal seconds.\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( enable_rounding == true ) {\n\t\t\tseconds = Global.roundTime( seconds, 60 );\n\t\t}\n\n\t\t//Debug.Text( 'Time Unit: '+ time_unit +' Retval: '+ seconds, 'Global.js', '', 'parseTimeUnit', 10 );\n\t\treturn seconds;\n\t},\n\n\tGlobal.convertSecondsToHMS = function( seconds, include_seconds, exclude_hours ) {\n\t\tvar negative_number = false;\n\n\t\tif ( seconds < 0 ) {\n\t\t\tnegative_number = true;\n\t\t}\n\n\t\tseconds = Math.round( Math.abs( seconds ) );\n\n\t\tvar tmp_hours = Math.floor( seconds / 3600 );\n\t\tvar tmp_minutes = Math.floor( ( seconds / 60 ) % 60 );\n\t\tvar tmp_seconds = Math.floor( seconds % 60 );\n\n\t\tif ( exclude_hours == true ) { //Convert hours to minutes before we pad it.\n\t\t\ttmp_minutes = ( ( tmp_hours * 60 ) + tmp_minutes );\n\t\t\ttmp_hours = 0;\n\t\t}\n\n\t\tif ( tmp_hours < 10 ) {\n\t\t\ttmp_hours = '0' + tmp_hours;\n\t\t}\n\n\t\tif ( tmp_minutes < 10 ) {\n\t\t\ttmp_minutes = '0' + tmp_minutes;\n\t\t}\n\n\t\tif ( tmp_seconds < 10 ) {\n\t\t\ttmp_seconds = '0' + tmp_seconds;\n\t\t}\n\n\t\tvar retval;\n\t\tif ( exclude_hours == true ) {\n\t\t\tretval = [tmp_minutes, tmp_seconds].join( ':' );\n\t\t} else {\n\t\t\tif ( include_seconds == true ) {\n\t\t\t\tretval = [tmp_hours, tmp_minutes, tmp_seconds].join( ':' );\n\t\t\t} else {\n\t\t\t\tretval = [tmp_hours, tmp_minutes].join( ':' );\n\t\t\t}\n\t\t}\n\n\t\tif ( negative_number == true ) {\n\t\t\tretval = '-' + retval;\n\t\t}\n\n\t\treturn retval;\n\t},\n\n//Was: Global.secondToHHMMSS\n\tGlobal.getTimeUnit = function( seconds, format ) {\n\t\tvar retval;\n\n\t\t//always return hh:ss. if we can't parse to float, then work with 0 tmp_seconds\n\t\tvar seconds = parseFloat( seconds );\n\t\tif ( isNaN( seconds ) ) {\n\t\t\tseconds = 0;\n\t\t}\n\n\t\t//FIXES BUG#2071 - don't check the local cache data for default value, or it will fail and cause errors when unauthenticated. For example in the installer.\n\t\tvar format;\n\t\tif ( !format ) {\n\t\t\tif ( LocalCacheData.getLoginUserPreference() ) {\n\t\t\t\tformat = LocalCacheData.getLoginUserPreference().time_unit_format;\n\t\t\t} else {\n\t\t\t\tformat = 10;\n\t\t\t}\n\t\t}\n\t\tformat = parseInt( format );\n\n\t\tswitch ( format ) {\n\t\t\tcase 10:\n\t\t\t\tretval = Global.convertSecondsToHMS( seconds );\n\t\t\t\tbreak;\n\t\t\tcase 12:\n\t\t\t\tretval = Global.convertSecondsToHMS( seconds, true );\n\t\t\t\tbreak;\n\t\t\tcase 99: //For local use only, in progress bar always show tmp_minutes and tmp_seconds\n\t\t\t\tretval = Global.convertSecondsToHMS( seconds, true, true );\n\t\t\t\tbreak;\n\t\t\tcase 20:\n\t\t\t\tretval = ( seconds / 3600 ).toFixed( 2 );\n\t\t\t\tbreak;\n\t\t\tcase 22:\n\t\t\t\tretval = ( seconds / 3600 ).toFixed( 3 );\n\t\t\t\tbreak;\n\t\t\tcase 23:\n\t\t\t\tretval = ( seconds / 3600 ).toFixed( 4 );\n\t\t\t\tbreak;\n\t\t\tcase 30:\n\t\t\t\tretval = ( seconds / 60 ).toFixed( 0 );\n\t\t\t\tbreak;\n\t\t\tcase 40:\n\t\t\t\tretval = seconds;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//Debug.Text( 'Seconds: '+ seconds +' Retval: '+ retval, 'Global.js', '', 'getTimeUnit', 10 );\n\t\treturn retval;\n\t};\n\nGlobal.removeTrailingZeros = function( value, minimum_decimals ) {\n\tif ( !minimum_decimals ) {\n\t\tminimum_decimals = 2;\n\t}\n\tif ( value ) {\n\t\tvalue = parseFloat( value ); // first to remove the zero after the point.\n\n\t\tvar trimmed_value = value.toString();\n\n\t\tif ( trimmed_value.indexOf( '.' ) > 0 ) {\n\t\t\t// If after removed has the point, then reverse it.\n\t\t\tvar tmp_minimum_decimals = parseInt( trimmed_value.split( '' ).reverse().join( '' ) ).toString().length;\n\t\t\tif ( tmp_minimum_decimals >= minimum_decimals && tmp_minimum_decimals <= 4 ) {\n\t\t\t\tminimum_decimals = tmp_minimum_decimals;\n\t\t\t}\n\n\t\t}\n\n\t\treturn value.toFixed( minimum_decimals );\n\t}\n\n\treturn value;\n};\n\n/* jshint ignore:end */\n\nGlobal.isCanvasSupported = function() {\n\tvar elem = document.createElement( 'canvas' );\n\treturn !!( elem.getContext && elem.getContext( '2d' ) );\n};\n\nGlobal.getRandomNum = function() {\n\n\tvar number = Math.floor( Math.random() * 999 );//0-23\n\n\treturn number;\n\n};\n\n/* jshint ignore:start */\n\nGlobal.getScriptNameByAPI = function( api_class ) {\n\n\tif ( !api_class || !api_class.className ) {\n\t\treturn null;\n\t}\n\n\tvar script_name = '';\n\tswitch ( api_class.className ) {\n\t\tcase 'APIUser':\n\t\t\tscript_name = 'EmployeeView';\n\t\t\tbreak;\n\t\tcase 'APIBranch':\n\t\t\tscript_name = 'BranchView';\n\t\t\tbreak;\n\t\tcase 'APIDepartment':\n\t\t\tscript_name = 'DepartmentView';\n\t\t\tbreak;\n\t\tcase 'APIUserWage':\n\t\t\tscript_name = 'WageView';\n\t\t\tbreak;\n\t\tcase 'APIUserContact':\n\t\t\tscript_name = 'UserContactView';\n\t\t\tbreak;\n\t\tcase 'APIUserTitle':\n\t\t\tscript_name = 'UserTitleView';\n\t\t\tbreak;\n\t\tcase 'APIWageGroup':\n\t\t\tscript_name = 'WageGroupView';\n\t\t\tbreak;\n\t\tcase 'APILog':\n\t\t\tscript_name = 'LogView';\n\t\t\tbreak;\n\t\tcase 'APIUserGroup':\n\t\t\tscript_name = 'UserGroupView';\n\t\t\tbreak;\n\t\tcase 'APIPayStubEntryAccount':\n\t\t\tscript_name = 'PayStubEntryAccountView';\n\t\t\tbreak;\n\t\tcase 'APIPayStubEntryAccountLink':\n\t\t\tscript_name = 'PayStubEntryAccountLinkView';\n\t\t\tbreak;\n\t\tcase 'APIPayPeriod':\n\t\tcase 'APIPayPeriodSchedule':\n\t\t\tscript_name = 'PayPeriodsView';\n\t\t\tbreak;\n\t\tcase 'APIAccrual':\n\t\t\tscript_name = 'APIAccrual';\n\t\t\tbreak;\n\t\tcase 'APIAccrualBalance':\n\t\t\tscript_name = 'AccrualBalanceView';\n\t\t\tbreak;\n\t\tcase 'APIException':\n\t\t\tscript_name = 'ExceptionView';\n\t\t\tbreak;\n\t\tcase 'APIJobGroup':\n\t\t\tscript_name = 'JobGroupView';\n\t\t\tbreak;\n\t\tcase 'APIJob':\n\t\t\tscript_name = 'JobView';\n\t\t\tbreak;\n\t\tcase 'APIJobItemGroup':\n\t\t\tscript_name = 'JobItemGroupView';\n\t\t\tbreak;\n\t\tcase 'APIJobItem':\n\t\t\tscript_name = 'JobItemView';\n\t\t\tbreak;\n\t\tcase 'APIJobItemAmendment':\n\t\t\tscript_name = 'JobItemAmendment';\n\t\t\tbreak;\n\t\tcase 'APIPunch':\n\t\t\tscript_name = 'PunchesView';\n\t\t\tbreak;\n\t\tcase 'APIPunchTag':\n\t\t\tscript_name = 'PunchTagView';\n\t\t\tbreak;\n\t\tcase 'APIPunchTagGroup':\n\t\t\tscript_name = 'PunchTagGroupView';\n\t\t\tbreak;\n\t\tcase 'APIRecurringScheduleControl':\n\t\t\tscript_name = 'RecurringScheduleControlView';\n\t\t\tbreak;\n\n\t\tcase 'APIRecurringScheduleTemplateControl':\n\t\t\tscript_name = 'RecurringScheduleTemplateControlView';\n\t\t\tbreak;\n\t\tcase 'APISchedule':\n\t\t\tscript_name = 'ScheduleShiftView';\n\t\t\tbreak;\n\t\tcase 'APIBankAccount':\n\t\t\tscript_name = 'BankAccountView';\n\t\t\tbreak;\n\t\tcase 'APICompany':\n\t\t\tscript_name = 'CompanyView';\n\t\t\tbreak;\n\t\tcase 'APICurrency':\n\t\t\tscript_name = 'CurrencyView';\n\t\t\tbreak;\n\t\tcase 'APICurrencyRate':\n\t\t\tscript_name = 'CurrencyRate';\n\t\t\tbreak;\n\t\tcase 'APIHierarchyControl':\n\t\t\tscript_name = 'HierarchyControlView';\n\t\t\tbreak;\n\t\tcase 'APIEthnicGroup':\n\t\t\tscript_name = 'EthnicGroupView';\n\t\t\tbreak;\n\t\tcase 'APICustomField':\n\t\t\tscript_name = 'CustomFieldView';\n\t\t\tbreak;\n\t\tcase 'APIPermissionControl':\n\t\t\tscript_name = 'PermissionControlView';\n\t\t\tbreak;\n\t\tcase 'APIStation':\n\t\t\tscript_name = 'StationView';\n\t\t\tbreak;\n\t\tcase 'APIDocumentRevision':\n\t\t\tscript_name = 'DocumentRevisionView';\n\t\t\tbreak;\n\t\tcase 'APIDocumentGroup':\n\t\t\tscript_name = 'DocumentGroupView';\n\t\t\tbreak;\n\t\tcase 'APIDocument':\n\t\t\tscript_name = 'DocumentView';\n\t\t\tbreak;\n\t\tcase 'APIROE':\n\t\t\tscript_name = 'ROEView';\n\t\t\tbreak;\n\t\tcase 'APIUserDefault':\n\t\t\tscript_name = 'UserDefaultView';\n\t\t\tbreak;\n\t\tcase 'APIUserPreference':\n\t\t\tscript_name = 'UserPreferenceView';\n\t\t\tbreak;\n\t\tcase 'APIKPI':\n\t\t\tscript_name = 'KPIView';\n\t\t\tbreak;\n\t\tcase 'APIUserReviewControl':\n\t\t\tscript_name = 'UserReviewControlView';\n\t\t\tbreak;\n\t\tcase 'APIQualification':\n\t\t\tscript_name = 'QualificationView';\n\t\t\tbreak;\n\t\tcase 'APIUserEducation':\n\t\t\tscript_name = 'UserTitleView';\n\t\t\tbreak;\n\t\tcase 'APIUserLanguage':\n\t\t\tscript_name = 'UserTitleView';\n\t\t\tbreak;\n\t\tcase 'APIUserLicense':\n\t\t\tscript_name = 'UserLicenseView';\n\t\t\tbreak;\n\t\tcase 'APIUserMembership':\n\t\t\tscript_name = 'UserMembershipView';\n\t\t\tbreak;\n\t\tcase 'APIUserSkill':\n\t\t\tscript_name = 'UserSkillView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantEducation':\n\t\t\tscript_name = 'JobApplicantEducationView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantEmployment':\n\t\t\tscript_name = 'JobApplicantEducationView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantLanguage':\n\t\t\tscript_name = 'JobApplicantLanguageView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantLicense':\n\t\t\tscript_name = 'JobApplicantLicenseView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantLocation':\n\t\t\tscript_name = 'JobApplicantLicenseView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantMembership':\n\t\t\tscript_name = 'JobApplicantMembershipView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantReference':\n\t\t\tscript_name = 'JobApplicantReferenceView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicantSkill':\n\t\t\tscript_name = 'JobApplicantSkillView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplicant':\n\t\t\tscript_name = 'JobApplicantSkillView';\n\t\t\tbreak;\n\t\tcase 'APIJobApplication':\n\t\t\tscript_name = 'JobApplicationView';\n\t\t\tbreak;\n\t\tcase 'APIJobVacancy':\n\t\t\tscript_name = 'JobVacancyView';\n\t\t\tbreak;\n\t\tcase 'APIAreaPolicy':\n\t\t\tscript_name = 'JobVacancyView';\n\t\t\tbreak;\n\t\tcase 'APIClient':\n\t\t\tscript_name = 'ClientView';\n\t\t\tbreak;\n\t\tcase 'APIClientContact':\n\t\t\tscript_name = 'ClientContactView';\n\t\t\tbreak;\n\t\tcase 'APIClientGroup':\n\t\t\tscript_name = 'ClientGroupView';\n\t\t\tbreak;\n\t\tcase 'APIClientPayment':\n\t\t\tscript_name = 'ClientPaymentView';\n\t\t\tbreak;\n\t\tcase 'APIInvoiceDistrict':\n\t\t\tscript_name = 'InvoiceDistrictView';\n\t\t\tbreak;\n\t\tcase 'APIInvoice':\n\t\t\tscript_name = 'InvoiceView';\n\t\t\tbreak;\n\t\tcase 'APITransaction':\n\t\t\tscript_name = 'InvoiceTransactionView';\n\t\t\tbreak;\n\t\tcase 'APIPaymentGateway':\n\t\t\tscript_name = 'PaymentGatewayView';\n\t\t\tbreak;\n\t\tcase 'APIProductGroup':\n\t\t\tscript_name = 'ProductGroupView';\n\t\t\tbreak;\n\t\tcase 'APIProduct':\n\t\t\tscript_name = 'ProductView';\n\t\t\tbreak;\n\t\tcase 'APIInvoiceConfig':\n\t\t\tscript_name = 'InvoiceConfigView';\n\t\t\tbreak;\n\t\tcase 'APIShippingPolicy':\n\t\t\tscript_name = 'ShippingPolicyView';\n\t\t\tbreak;\n\t\tcase 'APITaxPolicy':\n\t\t\tscript_name = 'TaxPolicyView';\n\t\t\tbreak;\n\t\tcase 'APICompanyDeduction':\n\t\t\tscript_name = 'CompanyTaxDeductionView';\n\t\t\tbreak;\n\t\tcase 'APIPayStub':\n\t\t\tscript_name = 'PayStubView';\n\t\t\tbreak;\n\t\tcase 'APIPayStubTransaction':\n\t\t\tscript_name = 'PayStubTransactionView';\n\t\t\tbreak;\n\t\tcase 'APIPayStubEntry':\n\t\t\tscript_name = 'PayStubEntryView';\n\t\t\tbreak;\n\t\tcase 'APIPayStubAmendment':\n\t\t\tscript_name = 'PayStubAmendmentView';\n\t\t\tbreak;\n\t\tcase 'APIRecurringPayStubAmendment':\n\t\t\tscript_name = 'RecurringPayStubAmendmentView';\n\t\t\tbreak;\n\t\tcase 'APIUserExpense':\n\t\t\tscript_name = 'UserExpenseView';\n\t\t\tbreak;\n\t\tcase 'APILegalEntity':\n\t\t\tscript_name = 'LegalEntityView';\n\t\t\tbreak;\n\t\tcase 'APIPayrollRemittanceAgency':\n\t\t\tscript_name = 'PayrollRemittanceAgencyView';\n\t\t\tbreak;\n\t\tcase 'APIPayrollRemittanceAgencyEvent':\n\t\t\tscript_name = 'PayrollRemittanceAgencyViewEvent';\n\t\t\tbreak;\n\t\tcase 'APIAbsencePolicy':\n\t\t\tscript_name = 'AbsencePolicyView';\n\t\t\tbreak;\n\t\tcase 'APIAccrualPolicyAccount':\n\t\t\tscript_name = 'AccrualPolicyAccountView';\n\t\t\tbreak;\n\t\tcase 'APIAccrualPolicy':\n\t\t\tscript_name = 'AccrualPolicyView';\n\t\t\tbreak;\n\t\tcase 'APIAccrualPolicyUserModifier':\n\t\t\tscript_name = 'AccrualPolicyUserModifierView';\n\t\t\tbreak;\n\t\tcase 'APIBreakPolicy':\n\t\t\tscript_name = 'BreakPolicyView';\n\t\t\tbreak;\n\t\tcase 'APIExceptionPolicyControl':\n\t\t\tscript_name = 'ExceptionPolicyControlView';\n\t\t\tbreak;\n\t\tcase 'APIExpensePolicy':\n\t\t\tscript_name = 'ExpensePolicyView';\n\t\t\tbreak;\n\t\tcase 'APIHoliday':\n\t\t\tscript_name = 'HolidayView';\n\t\t\tbreak;\n\t\tcase 'APIHolidayPolicy':\n\t\t\tscript_name = 'HolidayPolicyView';\n\t\t\tbreak;\n\t\tcase 'APIMealPolicy':\n\t\t\tscript_name = 'MealPolicyView';\n\t\t\tbreak;\n\t\tcase 'APIOvertimePolicy':\n\t\t\tscript_name = 'OvertimePolicyView';\n\t\t\tbreak;\n\t\tcase 'APIPolicyGroup':\n\t\t\tscript_name = 'PolicyGroupView';\n\t\t\tbreak;\n\t\tcase 'APIPremiumPolicy':\n\t\t\tscript_name = 'PremiumPolicyView';\n\t\t\tbreak;\n\t\tcase 'APIRecurringHoliday':\n\t\t\tscript_name = 'RecurringHolidayView';\n\t\t\tbreak;\n\t\tcase 'APIRoundIntervalPolicy':\n\t\t\tscript_name = 'RoundIntervalPolicyView';\n\t\t\tbreak;\n\t\tcase 'APISchedulePolicy':\n\t\t\tscript_name = 'SchedulePolicyView';\n\t\t\tbreak;\n\t\tcase 'APIUserReportData':\n\t\t\tscript_name = 'UserReportDataView';\n\t\t\tbreak;\n\t\tcase 'APIInstall':\n\t\t\tscript_name = 'InstallView';\n\t\t\tbreak;\n\t}\n\n\treturn script_name;\n};\n\n/* jshint ignore:end */\n\nGlobal.isObject = function( obj ) {\n\tif ( obj !== null && typeof obj === 'object' ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nGlobal.isArray = function( obj ) {\n\n\tif ( Object.prototype.toString.call( obj ) !== '[object Array]' ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\nGlobal.isString = function( obj ) {\n\n\tif ( Object.prototype.toString.call( obj ) !== '[object String]' ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n\nGlobal.isValidDate = function( obj ) {\n\tif ( obj instanceof Date && !isNaN( obj ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nGlobal.decodeCellValue = function( val ) {\n\tif ( !val || _.isObject( val ) ) {\n\t\treturn val;\n\t}\n\tval = val.toString();\n\tval = val.replace( /\\n|\\r|(\\r\\n)|(\\u0085)|(\\u2028)|(\\u2029)/g, '<br>' );\n\tval = val.replace( /\\n|\\r|(\\r\\n)|(\\u0085)|(\\u2028)|(\\u2029)/g, '<br>' );\n\tval = Global.htmlEncode( val );\n\tval = val.replace( /<br>/g, '<br>' );\n\n\treturn val;\n};\n\nGlobal.buildTreeRecord = function( array, parentId ) {\n\tvar finalArray = [];\n\n\t$.each( array, function( key, item ) {\n\t\titem.expanded = true;\n\t\titem.loaded = true;\n\n\t\tif ( Global.isSet( parentId ) ) {\n\t\t\titem.parent = parentId;\n\t\t}\n\n\t\tfinalArray.push( item );\n\n\t\tif ( Global.isSet( item.children ) ) {\n\t\t\tvar childrenArray = Global.buildTreeRecord( item.children, item.id );\n\t\t\tfinalArray = finalArray.concat( childrenArray );\n\t\t} else {\n\t\t\titem.isLeaf = true;\n\t\t}\n\n\t} );\n\n\treturn finalArray;\n};\n\nGlobal.getParentIdByTreeRecord = function( array, selectId ) {\n\n\tvar retval = [];\n\tfor ( var i = 0; i < array.length; i++ ) {\n\t\tvar item = array[i];\n\t\tif ( item.id.toString() === selectId.toString() ) {\n\t\t\tvar new_row = {};\n\t\t\tif ( typeof item.parent != 'undefined' ) {\n\t\t\t\tnew_row = { parent_id: item.parent.toString(), name: item.name };\n\t\t\t} else {\n\t\t\t\tnew_row = { name: item.name };\n\t\t\t}\n\n\t\t\t//Without created and updated info, audit tab shows N/A for both\n\t\t\tif ( typeof item.created_by != 'undefined' ) {\n\t\t\t\tnew_row.created_by = item.created_by;\n\t\t\t\tnew_row.created_date = item.created_date;\n\t\t\t\tnew_row.updated_by = item.updated_by;\n\t\t\t\tnew_row.updated_date = item.updated_date;\n\t\t\t}\n\n\t\t\tretval.push( new_row );\n\t\t\tbreak;\n\t\t}\n\t}\n\n\treturn retval;\n\n};\n\nGlobal.addFirstItemToArray = function( array, firstItemType, customLabel ) {\n\t//Error: Unable to get property 'unshift' of undefined or null reference in /interface/html5/global/Global.js?v=8.0.0-20141230-153942 line 903\n\tvar label;\n\tif ( array ) {\n\t\tif ( firstItemType === 'any' ) {\n\t\t\tif ( customLabel ) {\n\t\t\t\tlabel = customLabel;\n\t\t\t} else {\n\t\t\t\tlabel = Global.any_item;\n\t\t\t}\n\t\t\t//#2301 - don't duplicate the --Any-- case when the array is recycled.\n\t\t\tif ( !array[0] || array[0].value != _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.not_exist_id */ .d.not_exist_id ) {\n\t\t\t\tarray.unshift( {\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.not_exist_id */ .d.not_exist_id,\n\t\t\t\t\tfullValue: _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.not_exist_id */ .d.not_exist_id,\n\t\t\t\t\torderValue: ''\n\t\t\t\t} );\n\t\t\t}\n\t\t} else if ( firstItemType === 'empty' ) {\n\t\t\tif ( customLabel ) {\n\t\t\t\tlabel = customLabel;\n\t\t\t} else {\n\t\t\t\tlabel = Global.empty_item;\n\t\t\t}\n\t\t\t//#2301 - don't duplicate the --None-- case when the array is recycled.\n\t\t\tif ( !array[0] || array[0].value != _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.zero_id */ .d.zero_id ) {\n\t\t\t\tarray.unshift( {\n\t\t\t\t\tlabel: label,\n\t\t\t\t\tvalue: _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.zero_id */ .d.zero_id,\n\t\t\t\t\tfullValue: _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.zero_id */ .d.zero_id,\n\t\t\t\t\torderValue: ''\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array;\n};\n\n//Add item on to the end of the array, but make sure its not already there and therefore never duplicated.\nGlobal.addLastItemToArray = function( array, key, label ) {\n\tvar label;\n\tif ( array ) {\n\t\tvar last_array_element = array[( array.length - 1 )];\n\t\tif ( last_array_element.value != key ) {\n\t\t\tarray.push( {\n\t\t\t\tfullValue: key,\n\t\t\t\tvalue: key,\n\t\t\t\tlabel: label,\n\t\t\t\tid: 2000\n\t\t\t} );\n\t\t}\n\t}\n\n\treturn array;\n};\n\nGlobal.convertRecordArrayToOptions = function( array ) {\n\tvar len = array.length;\n\tvar options = {};\n\n\tfor ( var i = 0; i < len; i++ ) {\n\t\tvar item = array[i];\n\n\t\toptions[item.value] = item.label;\n\t}\n\n\treturn options;\n};\n\nGlobal.buildColumnArray = function( array ) {\n\tvar columns = [];\n\tvar id = 1000;\n\n\tfor ( var key in array ) {\n\t\tvar order_value = Global.getSortValue( key, true );\n\t\tvar column = {\n\t\t\tlabel: array[key],\n\t\t\tvalue: Global.removeSortPrefix( key ),\n\t\t\torderValue: order_value,\n\t\t\tid: id\n\t\t};\n\t\tcolumns.push( column );\n\t\tid = id + 1;\n\t}\n\treturn columns;\n};\n\nGlobal.removeSortPrefixFromArray = function( array ) {\n\tvar finalArray = {};\n\n\tif ( Global.isSet( array ) ) {\n\n\t\t$.each( array, function( key, item ) {\n\t\t\tfinalArray[Global.removeSortPrefix( key )] = item;\n\t\t} );\n\n\t\treturn finalArray;\n\t}\n\n\treturn array;\n};\n\nGlobal.removeSortPrefix = function( key ) {\n\tif ( typeof key == 'string' && key.match( Global.sortOrderRegex ) ) {\n\t\tkey = key.replace( Global.sortOrderRegex, '' );\n\t}\n\treturn key;\n};\n\nGlobal.getSortValue = function( key, return_key_on_null ) {\n\tvar order_value = 999;\n\tif ( typeof key == 'string' ) {\n\t\tvar regex_result = key.match( Global.sortOrderRegex );\n\t\tif ( regex_result == null ) {\n\t\t\tif ( return_key_on_null === true ) {\n\t\t\t\torder_value = key;\n\t\t\t}\n\t\t} else if ( regex_result[1] ) {\n\t\t\torder_value = regex_result[1];\n\t\t} else {\n\t\t\tDebug.Error( 'Error: Unable to parse order_value', 'Global', 'Global', 'buildColumnArray', 10 );\n\t\t}\n\t}\n\treturn order_value;\n};\n\nGlobal.convertToNumberIfPossible = function( val ) {\n\t//if value is number convert to number type\n\tvar reg = new RegExp( '^[0-9]*$' );\n\n\tif ( reg.test( val ) && val !== '00' ) {\n\t\tval = parseFloat( val );\n\t}\n\n\tif ( val === '-1' || val === -1 ) {\n\t\tval = -1;\n\t}\n\n\treturn val;\n};\n\nGlobal.buildRecordArray = function( array, first_item, orderType ) {\n\tvar finalArray = [];\n\n\tif ( first_item ) {\n\t\tfinalArray.push( first_item );\n\t}\n\n\tvar id = 1000;\n\n\tif ( Global.isSet( array ) ) {\n\n\t\tfor ( var key in array ) {\n\t\t\tvar item = array[key];\n\t\t\tvar value = Global.removeSortPrefix( key );\n\t\t\tvar order_value = Global.getSortValue( key );\n\n\t\t\t// 6/4 changed id to same as value to make flex show correct data when show search result saved in html5, flex use id if it existed.\n\t\t\tvar record = { label: item, value: value, fullValue: key, orderValue: order_value, id: value };\n\n\t\t\tid = id + 1;\n\n\t\t\tfinalArray.push( record );\n\n\t\t}\n\n\t}\n\n\treturn finalArray;\n\n};\n\nGlobal.topContainer = function() {\n\treturn $( '#topContainer' );\n};\n\nGlobal.overlay = function() {\n\treturn $( '#overlay' );\n};\n\nGlobal.bottomContainer = function() {\n\treturn $( '#bottomContainer' );\n};\n\nGlobal.bottomFeedbackLinkContainer = function() {\n\treturn $( '#feedbackLinkContainer' );\n};\n\nGlobal.showPoweredBy = function() {\n\tvar powered_by_img = $( '#powered_by' );\n\tpowered_by_img.show();\n\tpowered_by_img.attr( 'src', _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.getURLByObjectType */ .n.getURLByObjectType( 'copyright' ) );\n\tpowered_by_img.attr( 'alt', LocalCacheData.loginData.application_name + ' Workforce Management Software' );\n\tvar powered_by_link = $( '<a target=\"_blank\" href=\"https://' + LocalCacheData.getLoginData().organization_url + '\"></a>' );\n\tpowered_by_link.addClass( 'powered-by-img-seo' );\n\tpowered_by_img.wrap( powered_by_link );\n};\n\nGlobal.setSignalStrength = function() {\n\tif ( Global.signal_timer ) {\n\t\treturn;\n\t}\n\t$( '.signal-strength' ).css( 'display', 'block' );\n\tvar status = '......';\n\tvar average_time = 0;\n\tvar checking_array = [];\n\tvar single_strength = null;\n\tvar single_strength_tooltip = null;\n\n\tsetTooltip();\n\n\tsetTimeout( function() {\n\t\tdoPing();\n\t}, 10000 );\n\tGlobal.signal_timer = setInterval( function() {\n\t\tdoPing();\n\t}, 60000 );\n\n\tfunction doPing() {\n\t\tif ( ( LocalCacheData.current_open_primary_controller && LocalCacheData.current_open_primary_controller.viewId === 'LoginView' ) || Global.idle_time >= Math.min( 15, APIGlobal.pre_login_data.session_idle_timeout / 60 ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tping( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.base_url */ .n.base_url + 'interface/ping.html?t=' + new Date().getTime(), function( time ) {\n\t\t\t$( '.signal-strength-empty' ).removeClass( 'signal-strength-empty' );\n\n\t\t\tif ( checking_array.length >= 3 ) {\n\t\t\t\tchecking_array.shift();\n\t\t\t}\n\t\t\tchecking_array.push( time );\n\t\t\tvar total_time = 0;\n\t\t\tfor ( var i = 0; i < checking_array.length; i++ ) {\n\t\t\t\ttotal_time = checking_array[i] + total_time;\n\t\t\t}\n\t\t\taverage_time = total_time / checking_array.length;\n\t\t\tDebug.Text( 'Current Ping: ' + time + 'ms Average: ' + average_time + 'ms Date: ' + ( new Date ).toISOString().replace( /z|t/gi, ' ' ), 'Global.js', '', 'doPing', 6 );\n\t\t\tGlobal.current_ping = average_time;\n\t\t\tstatus = $.i18n._( 'Good' );\n\t\t\t//do not allow signal strength variation in unit test mode\n\t\t\tif ( Global.UNIT_TEST_MODE == false ) {\n\t\t\t\tif ( average_time > 400 ) {\n\t\t\t\t\t$( '.signal-strength-pretty-strong' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\t$( '.signal-strength-strong' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\t$( '.signal-strength-weak' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\tstatus = $.i18n._( 'Poor' );\n\t\t\t\t} else if ( average_time > 250 ) {\n\t\t\t\t\t$( '.signal-strength-pretty-strong' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\t$( '.signal-strength-strong' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\tstatus = $.i18n._( 'Below Average' );\n\t\t\t\t} else if ( average_time > 150 ) {\n\t\t\t\t\t$( '.signal-strength-pretty-strong' ).addClass( 'signal-strength-empty' );\n\t\t\t\t\tstatus = $.i18n._( 'Average' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsetTooltip();\n\n\t\t} );\n\t}\n\n\tfunction setTooltip() {\n\t\tvar html = '<div>' + $.i18n._( 'Your Network Connection is' ) + ' ' + status + ' (' + $.i18n._( 'Latency' ) + ': ' + ( average_time > 0 ? average_time.toFixed( 0 ) + 'ms' : $.i18n._( 'Calculating...' ) ) + ')' + '</div>';\n\t\t$( '.signal-strength' ).qtip( {\n\t\t\tid: 'single_strength',\n\t\t\tcontent: {\n\t\t\t\ttext: html\n\t\t\t},\n\t\t\tposition: {\n\t\t\t\tmy: 'bottom left',\n\t\t\t\tat: 'top right'\n\t\t\t}\n\t\t} );\n\t}\n\n\tfunction ping( url, callback ) {\n\t\tvar inUse, start, img, timer;\n\t\tif ( !inUse ) {\n\t\t\tinUse = true;\n\t\t\timg = new Image();\n\t\t\timg.onload = function() {\n\t\t\t\tvar endTime = new Date().getTime();\n\t\t\t\tinUse = false;\n\t\t\t\tcallback( ( endTime - start ) );\n\n\t\t\t};\n\t\t\timg.onerror = function( e ) {\n\t\t\t\tif ( inUse ) {\n\t\t\t\t\tinUse = false;\n\t\t\t\t\tvar endTime = new Date().getTime();\n\t\t\t\t\tcallback( ( endTime - start ) );\n\t\t\t\t}\n\n\t\t\t};\n\t\t\tstart = new Date().getTime();\n\t\t\timg.src = url;\n\t\t\ttimer = setTimeout( function() {\n\t\t\t\tif ( inUse ) {\n\t\t\t\t\tvar endTime = new Date().getTime();\n\t\t\t\t\tinUse = false;\n\t\t\t\t\tcallback( ( endTime - start ) );\n\t\t\t\t}\n\t\t\t}, 5000 );\n\t\t}\n\t}\n};\n\nGlobal.contentContainer = function() {\n\treturn $( '#contentContainer' );\n};\n\nGlobal.bodyWidth = function() {\n\treturn $( window ).width();\n};\n\nGlobal.bodyHeight = function() {\n\treturn $( window ).height();\n};\n\nGlobal.hasRequireLoaded = function( script_path ) {\n\tvar split_script_path = script_path.split( '/' );\n\n\tvar id = split_script_path[split_script_path.length - 1];\n\tid = id.replace( '.js', '' );\n\n\t//Check alternative script names (ie: with/without the .js) when a full path is specified to see if it was loaded in different ways with requireJS and make sure its not loaded twice.\n\tif ( script_path.indexOf( '.js' ) == -1 ) {\n\t\tvar alternative_script_path = script_path + '.js';\n\t} else {\n\t\tvar alternative_script_path = script_path.replace( '.js', '' );\n\t}\n\n\t//Make sure the function is both specified and defined. This helps cases where the user is on a Slow 3G network and double clicks Attendance -> In/Out.\n\t// In this case the same InOutViewController.js file is in the process of being loaded, then is cancelled,\n\t// and another one tries to load and the success callback where the class is instantiated is called before it can be instantiated, causing a JS exception (ReferenceError: InOutViewController is not defined).\n\t// Better double-click prevention would also help.\n\t// if ( typeof require === 'function' && typeof require.specified === 'function' && ( require.specified( id ) || require.specified( script_path ) || require.specified( alternative_script_path ) ) ) {\n\t// if ( typeof require === 'function' && typeof require.defined === 'function' && ( require.defined( id ) || require.defined( script_path ) || require.defined( alternative_script_path ) ) ) {\n\t// \treturn true;\n\t// //}\n\n\treturn false;\n};\n\nGlobal.loadScript = function( scriptPath, onResult ) {\n\tif ( typeof scriptPath !== 'string' ) {\n\t\t// Not ideal fix but this is to handle the scriptPath.split is not a function error in #2696. if the path is not a string, split does not exist as a function.\n\t\t// Hard to find root-cause/reproduce, so this fix is to reduce the occurances of the JS exceptions related to it.\n\t\treturn false;\n\t}\n\n\tvar async = true;\n\tif ( typeof ( onResult ) === 'undefined' ) {\n\t\tasync = false;\n\t}\n\n\tif ( Global.hasRequireLoaded( scriptPath ) ) {\n\t\tif ( async ) {\n\t\t\tonResult();\n\t\t}\n\t\treturn true;\n\t}\n\n\t//Ensures that the js cached scripts are not loaded twice\n\tif ( async ) {\n\t\tif ( LocalCacheData.loadedScriptNames[scriptPath] ) {\n\t\t\tonResult();\n\t\t\treturn;\n\t\t}\n\t} else {\n\t\tif ( LocalCacheData.loadedScriptNames[scriptPath] ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tvar successflag = false;\n\n\tvar realPath = scriptPath;\n\n\t// Mainly used in the async code, but put here to also catch duplicate declared classes in both async and synchronous calls.\n\tvar split_script_path = realPath.split( '/' );\n\tvar import_file_name = split_script_path[split_script_path.length - 1].replace( '.js', '' );\n\t//var import_path = realPath.replace('views/', '');\n\n\tvar class_exists = eval(\"typeof \"+ import_file_name +\" === 'function'\");\n\tif ( class_exists ) {\n\t\t// This means class already exists on the window object, so it must have been already loaded.\n\t\t// DEV NOTE: This should NOT happen. If it happens, it means script is being loaded twice. Check manual loading calls like requirejs or Webpack MergeIntoSingleFilePlugin plugin\n\t\t// In all likelyhood, it is listed in the concatenation array for MergeIntoSingleFilePlugin. Best to try to remove it from there, as long as its correctly loaded on demand in all relevant places. See what else uses the class to be sure.\n\t\tGlobal.sendAnalyticsEvent( 'error:scriptload:duplicate_class', 'load', 'error:scriptload:duplicate:'+ scriptPath );\n\t\tDebug.Error( 'Duplicate class declaration: '+ import_file_name, 'Global.js', 'Global', 'loadScript', 1 );\n\t\treturn true;\n\t}\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.getBaseURL( Global.url_offset + realPath );\n\t}\n\n\tif ( async ) {\n\t\tDebug.Text( 'ASYNC-LOADING: ' + scriptPath, 'Global.js', 'Global', 'loadScript', 10 );\n\n\t\tvar import_path;\n\t\tif ( scriptPath.indexOf('views') !== -1 ){\n\t\t\timport_path = scriptPath.replace('views/', ''); // This is to ensure the variable in the dynamic webpack import() is a single variable rather than a full path.\n\t\t\t__webpack_require__(1430)(`./${import_path}`).then((module) => {\n\t\t\t\tif ( module && module[import_file_name] ) {\n\t\t\t\t\twindow[import_file_name] = module[import_file_name]; // After html2js this may not be needed anymore. But leave for now as this allows the legacy html files to trigger the 'new MyViewController()' code in their html files.\n\n\t\t\t\t\tLocalCacheData.loadedScriptNames[scriptPath] = true;\n\t\t\t\t\tonResult();\n\t\t\t\t} else {\n\t\t\t\t\tif( import_file_name === 'debugPanelController') {\n\t\t\t\t\t\t// debugPanel is coded different, with no classes/constructor, so this is not a fail.\n\t\t\t\t\t\tLocalCacheData.loadedScriptNames[scriptPath] = true;\n\t\t\t\t\t\tonResult();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Loading class failed.\n\t\t\t\t\t\t// If there is not an attribute matching the class on the module result, then this suggests a missing export on the class. There will also be a default attribute with an empty object to show no default classes exported.\n\t\t\t\t\t\tDebug.Error( 'Loading view class failed. Potential missing export for: ' + import_file_name, 'Global.js', 'Global', 'loadScript', 1 );\n\n\t\t\t\t\t\tonResult(); // To allow callbacks to work for non-module scripts like debugPanelController.\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ).catch( Global.importErrorHandler );\n\t\t} else if ( scriptPath.indexOf('global/widgets') !== -1 ) {\n\t\t\timport_path = scriptPath.replace('global/widgets/', ''); // This is to ensure the variable in the dynamic webpack import() is a single variable rather than a full path.\n\t\t\t__webpack_require__(9769)(`./${import_path}`).then((module) => {\n\t\t\t\tif( module && module[import_file_name] ) {\n\t\t\t\t\twindow[import_file_name] = module[import_file_name];\n\t\t\t\t\tLocalCacheData.loadedScriptNames[scriptPath] = true;\n\t\t\t\t\tonResult();\n\t\t\t\t} else {\n\t\t\t\t\t// Loading class failed.\n\t\t\t\t\t// If there is not an attribute matching the class on the module result, then this suggests a missing export on the class. There will also be a default attribute with an empty object to show no default classes exported.\n\t\t\t\t\t// This could also be a widget that is historically meant to load synchronously with the jQuery.ajax code further down. If this is the case, refactor the callback to load the widget syncronously instead.\n\t\t\t\t\tDebug.Error( 'Loading widget class failed. Potential missing export for: '+ import_file_name, 'Global.js', 'Global', 'loadScript', 1 );\n\t\t\t\t}\n\n\t\t\t} ).catch( Global.importErrorHandler );\n\t\t} else {\n\t\t\tDebug.Error( 'Loading class failed. Unhandled file type path request: '+ scriptPath, 'Global.js', 'Global', 'loadScript', 1 );\n\t\t}\n\n\t} else {\n\t\tvar calling_script = '';\n\t\tif ( LocalCacheData.current_open_primary_controller && LocalCacheData.current_open_primary_controller.viewId ) {\n\t\t\tcalling_script = ' from ' + LocalCacheData.current_open_primary_controller.viewId + 'ViewController';\n\t\t}\n\t\tDebug.Text( 'SYNC-LOADING: ' + scriptPath + calling_script );\n\n\t\tvar id = scriptPath.split( '/' );\n\t\tvar id = id[id.length - 1];\n\t\tid = id.replace( '.js', '' );\n\t\tif ( !window.badScripts ) {\n\t\t\twindow.badScripts = [];\n\t\t}\n\t\twindow.badScripts.push( id ); //When the page is done loading punch \"badScripts into the console to see a nice array of all the scripts that were not loaded async.\n\n\t\t/**\n\t\t * this seems to work, but causes the script erro at line 0 problem.\n\t\t * try to refactor to not use jquery.ajax\n\t\t */\n\t\tjQuery.ajax( {\n\t\t\tasync: false,\n\t\t\ttype: 'GET',\n\t\t\turl: realPath + '?v=' + APIGlobal.pre_login_data.application_build,\n\t\t\tcrossOrigin: false,\n\t\t\tdata: null,\n\t\t\tcache: true,\n\t\t\tsuccess: function() {\n\t\t\t\tsuccessflag = true;\n\t\t\t\tif ( async ) {\n\t\t\t\t\tLocalCacheData.loadedScriptNames[scriptPath] = true;\n\t\t\t\t\tonResult();\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t\t},\n\t\t\tdataType: 'script'\n\t\t} );\n\t}\n\n\tif ( !async ) {\n\t\tLocalCacheData.loadedScriptNames[scriptPath] = true;\n\t\treturn ( successflag );\n\t}\n\n};\n\nGlobal.importErrorHandler = function( error ) {\n\tif ( error.name == 'ChunkLoadError' ) {\n\t\tif ( window.script_error_shown === undefined ) {\n\t\t\twindow.script_error_shown = 1;\n\t\t\t//There is no pretty errorbox at this time. You may only have basic javascript.\n\t\t\tif ( confirm( 'Unable to download required data. Your internet connection may have failed press Ok to reload.' ) ) {\n\t\t\t\t//For testing, so that there's time to turn internet back on after confirm is clicked.\n\t\t\t\t//window.setTimeout(function() {window.location.reload()},5000);\n\n\t\t\t\t//This can also happen if the user manually modifies the URL to be a bogus ViewId (ie: #!m=homeABC)\n\t\t\t\t//So try to redirect back to the home page first, otherwise try to do a browser reload.\n\t\t\t\tif ( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url && APIGlobal.pre_login_data.base_url ) {\n\t\t\t\t\tGlobal.setURLToBrowser( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url + APIGlobal.pre_login_data.base_url );\n\t\t\t\t} else {\n\t\t\t\t\twindow.location.reload();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\tconsole.debug( error.message );\n\t\t//Stop error from bubbling up.\n\t\t// delete e; // commented out from old code as webpack complains about deleting local variable in strict mode.\n\n\t} else {\n\t\tDebug.Error( 'Error loading script during import(): ' + error, 'Global.js', 'Global', 'importErrorHandler', 1 );\n\t\t// Throw general error?\n\t}\n};\n\nGlobal.getRealImagePath = function( path ) {\n\n\tvar realPath = 'theme/' + Global.theme + '/' + path;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\treturn realPath;\n};\n\nGlobal.getRibbonIconRealPath = function( icon ) {\n\tvar realPath = 'theme/' + Global.theme + '/css/global/widgets/ribbon/icons/' + icon;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\treturn realPath;\n};\n\nGlobal.loadLanguage = function( name ) {\n\tvar successflag = false;\n\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.generateUUID */ .d.generateUUID();\n\tProgressBar.showProgressBar( message_id );\n\tvar res_data = {};\n\n\tif ( LocalCacheData.getI18nDic() ) {\n\t\tProgressBar.removeProgressBar( message_id );\n\t\treturn LocalCacheData.getI18nDic();\n\t}\n\tvar realPath = '../locale/' + name + '/LC_MESSAGES/messages.json' + '?v=' + APIGlobal.pre_login_data.application_build;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\tjQuery.ajax( {\n\t\tasync: false,\n\t\ttype: 'GET',\n\t\turl: realPath,\n\t\tdata: null,\n\t\tcache: true,\n\t\tconverters: {\n\t\t\t//Because this is a dataType: script, and jquery will blindy try to eval() any result returned by the server, including a HTML 404 error message.\n\t\t\t// resulting in\" Uncaught SyntaxError: Unexpected token < in line 1\" being triggered.\n\t\t\t// Instead just return the raw result and eval() it in the success function ourselves instead.\n\t\t\t'text script': function( text ) {\n\t\t\t\treturn text;\n\t\t\t}\n\t\t},\n\t\tsuccess: function( result ) {\n\t\t\tsuccessflag = true;\n\t\t\tjQuery.globalEval( result );\n\t\t},\n\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t//Unable to load or parse i18n dictionary. Could be due to a 404 error?\n\t\t\tDebug.Text( 'Unable to load Locale: ' + errorThrown, 'Global.js', '', 'loadLanguage', 10 );\n\t\t\tsuccessflag = false;\n\t\t},\n\t\tdataType: 'script'\n\t} );\n\n\tProgressBar.removeProgressBar( message_id );\n\n\tif ( successflag ) {\n\t\tLocalCacheData.setI18nDic( i18n_dictionary );\n\t} else {\n\t\tLocalCacheData.setI18nDic( {} );\n\t}\n\n\treturn successflag;\n};\n\nGlobal.getProductEdition = function() {\n\tvar current_company_data = LocalCacheData.getCurrentCompany();\n\n\tif ( current_company_data && current_company_data.product_edition_id ) {\n\t\treturn current_company_data.product_edition_id;\n\t}\n\n\treturn 10; //Community\n};\n\nGlobal.setURLToBrowser = function( new_url ) {\n\tif ( new_url != window.location.href ) {\n\t\tDebug.Text( 'Changing URL to: ' + new_url, 'Global.js', 'Global', 'setURLToBrowser', 9 );\n\t\twindow.location = new_url;\n\t}\n};\n\nGlobal.clone = function( obj ) {\n\treturn jQuery.extend( true, {}, obj ); // true means deep clone, omit for shallow, false is not an option\n};\n\nGlobal.getFirstKeyFromObject = function( obj ) {\n\tfor ( var key in obj ) {\n\n\t\tif ( obj.hasOwnProperty( key ) ) {\n\t\t\treturn key;\n\t\t}\n\n\t}\n};\n\nGlobal.getFuncName = function( _callee ) {\n\tvar _text = _callee.toString();\n\tvar _scriptArr = document.scripts;\n\tfor ( var i = 0; i < _scriptArr.length; i++ ) {\n\t\tvar _start = _scriptArr[i].text.indexOf( _text );\n\t\tif ( _start !== -1 ) {\n\t\t\tif ( /^function\\s*\\(.*\\).*\\r\\n/.test( _text ) ) {\n\t\t\t\tvar _tempArr = _scriptArr[i].text.substr( 0, _start ).split( '\\r\\n' );\n\t\t\t\treturn _tempArr[( _tempArr.length - 1 )].replace( /(var)|(\\s*)/g, '' ).replace( /=/g, '' );\n\t\t\t} else {\n\t\t\t\treturn _text.match( /^function\\s*([^\\(]+).*\\r\\n/ )[1];\n\t\t\t}\n\t\t}\n\t}\n};\n\nGlobal.concatArraysUniqueWithSort = function( thisArray, otherArray ) {\n\tvar newArray = thisArray.concat( otherArray ).sort( function( a, b ) {\n\t\treturn a > b ? 1 : a < b ? -1 : 0;\n\t} );\n\n\treturn newArray.filter( function( item, index ) {\n\t\treturn newArray.indexOf( item ) === index;\n\t} );\n};\n\nGlobal.addCss = function( path, callback ) {\n\tif ( LocalCacheData.loadedScriptNames[path] ) {\n\t\tif ( callback ) {\n\t\t\tcallback();\n\t\t}\n\t\treturn true;\n\t}\n\tLocalCacheData.loadedScriptNames[path] = true;\n\tvar realPath = 'theme/' + Global.theme + '/css/' + path;\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\trealPath = realPath + '?v=' + APIGlobal.pre_login_data.application_build;\n\tGlobal.loadStyleSheet( realPath, callback );\n};\n\n//JS think 0 is false, so use this to get 0 correctly.\nGlobal.isFalseOrNull = function( object ) {\n\n\tif ( object === false || object === null || object === 0 || object === '0' || object == _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.zero_id */ .d.zero_id ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n};\n\nGlobal.isSet = function( object ) {\n\n\tif ( _.isUndefined( object ) || _.isNull( object ) ) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n\n};\n\nGlobal.getIconPathByContextName = function( id ) {\n\n\tswitch ( id ) {\n\t\tcase 'add':\n\t\t\treturn Global.getRealImagePath( 'css/global/widgets/ribbon/icons/copy-35x35.png' );\n\t}\n};\n\nGlobal.isEmpty = function( obj ) {\n\n\t// null and undefined are \"empty\"\n\tif ( obj === null ) {\n\t\treturn true;\n\t}\n\n\t// Assume if it has a length property with a non-zero value\n\t// that that property is correct.\n\tif ( obj.length > 0 ) {\n\t\treturn false;\n\t}\n\tif ( obj.length === 0 ) {\n\t\treturn true;\n\t}\n\n\t// Otherwise, does it have any properties of its own?\n\t// Note that this doesn't handle\n\t// toString and valueOf enumeration bugs in IE < 9\n\tfor ( var key in obj ) {\n\t\tif ( hasOwnProperty.call( obj, key ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n\n};\n\nGlobal.convertColumnsTojGridFormat = function( columns, layout_name, setWidthCallBack ) {\n\tvar column_info_array = [];\n\tvar len = columns.length;\n\n\tvar total_width = 0;\n\tfor ( var i = 0; i < len; i++ ) {\n\t\tvar view_column_data = columns[i];\n\t\tvar column_info;\n\n\t\tvar text_width = Global.calculateTextWidth( view_column_data.label );\n\n\t\ttotal_width = total_width + text_width;\n\n\t\tif ( view_column_data.label === '' ) {\n\t\t\tcolumn_info = {\n\t\t\t\tname: view_column_data.value,\n\t\t\t\tindex: view_column_data.value,\n\t\t\t\tlabel: view_column_data.label,\n\t\t\t\tkey: true,\n\t\t\t\twidth: 100,\n\t\t\t\tsortable: false,\n\t\t\t\thidden: true,\n\t\t\t\ttitle: false\n\t\t\t};\n\t\t} else if ( layout_name === 'global_sort_columns' ) {\n\n\t\t\tif ( view_column_data.value === 'sort' ) {\n\t\t\t\tcolumn_info = {\n\t\t\t\t\tname: view_column_data.value,\n\t\t\t\t\tindex: view_column_data.value,\n\t\t\t\t\tlabel: view_column_data.label,\n\t\t\t\t\twidth: 100,\n\t\t\t\t\tsortable: false,\n\t\t\t\t\tformatter: 'select',\n\t\t\t\t\teditable: true,\n\t\t\t\t\ttitle: false,\n\t\t\t\t\tedittype: 'select',\n\t\t\t\t\teditoptions: { value: 'asc:ASC;desc:DESC' }\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tcolumn_info = {\n\t\t\t\t\tname: view_column_data.value,\n\t\t\t\t\tindex: view_column_data.value,\n\t\t\t\t\tlabel: view_column_data.label,\n\t\t\t\t\twidth: 100,\n\t\t\t\t\tsortable: false,\n\t\t\t\t\ttitle: false\n\t\t\t\t};\n\t\t\t}\n\n\t\t} else {\n\t\t\tcolumn_info = {\n\t\t\t\tname: view_column_data.value,\n\t\t\t\tindex: view_column_data.value,\n\t\t\t\tlabel: view_column_data.label,\n\t\t\t\twidth: 100,\n\t\t\t\tsortable: false,\n\t\t\t\ttitle: false\n\t\t\t};\n\t\t}\n\n\t\tcolumn_info_array.push( column_info );\n\t}\n\n\tif ( setWidthCallBack ) {\n\t\tsetWidthCallBack( total_width );\n\t}\n\n\treturn column_info_array;\n};\n/* jshint ignore:start */\nGlobal.loadWidgetByName = function( widgetName, raw_text ) {\n\tvar input = false;\n\tvar widget_path = false;\n\tvar widget_constructor = false;\n\tvar raw_text = false;\n\tswitch ( widgetName ) {\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.COLOR_PICKER:\n\t\t\tinput = $.fn.TColorPicker.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.FORMULA_BUILDER:\n\t\t\tinput = $.fn.FormulaBuilder.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.AWESOME_BOX:\n\t\t\tinput = $.fn.AComboBox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.AWESOME_DROPDOWN:\n\t\t\tinput = $.fn.ADropDown.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TEXT_INPUT:\n\t\t\tinput = $.fn.TTextInput.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.PASSWORD_INPUT:\n\t\t\tinput = $.fn.TPasswordInput.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TEXT:\n\t\t\tinput = $.fn.TText.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.CHECKBOX:\n\t\t\tinput = $.fn.TCheckbox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.COMBO_BOX:\n\t\t\tinput = $.fn.TComboBox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.LIST: //Does not seem to be used anywhere.\n\t\t\tinput = $.fn.TList.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TAG_INPUT:\n\t\t\tinput = $.fn.TTagInput.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.DATE_PICKER:\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.RANGE_PICKER:\n\t\t\tinput = $.fn.TDatePicker.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TIME_PICKER:\n\t\t\tinput = $.fn.TTimePicker.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TEXT_AREA:\n\t\t\tinput = $.fn.TTextArea.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.TINYMCE_TEXT_AREA:\n\t\t\tinput = $.fn.TTextArea.tinymce_html_template;\n\t\t\traw_text = true;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.SEPARATED_BOX:\n\t\t\tinput = $.fn.SeparatedBox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.IMAGE_BROWSER:\n\t\t\tinput = $.fn.TImageBrowser.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.FILE_BROWSER: //There is no file browser JS file for this widget.\n\t\t\tinput = `<div class=\"file-browser\">\n\t\t\t\t\t\t<form enctype=\"multipart/form-data\" class=\"browser-form\">\n\t\t\t\t\t\t\t<input name=\"filedata\" class=\"browser\" type=\"file\"/>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>`;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.IMAGE_AVD_BROWSER:\n\t\t\tinput = $.fn.TImageAdvBrowser.html_template;\n\t\t\twidget_constructor = 'TImageAdvBrowser';\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.CAMERA_BROWSER:\n\t\t\tinput = $.fn.CameraBrowser.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.IMAGE_CUT:\n\t\t\tinput = $.fn.TImageCutArea.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.IMAGE:\n\t\t\tinput = '<img class=\\'t-image\\'>';\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.INSIDE_EDITOR:\n\t\t\tinput = $.fn.InsideEditor.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.PAGING:\n\t\t\t// widget_path = 'global/widgets/paging/Paging.html'; // TODO: #3023: Delete this line once all widget html converted and no longer need this quick reference for the old format.\n\t\t\tinput = $.fn.Paging2.html.paging;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.PAGING_2:\n\t\t\t// widget_path = 'global/widgets/paging/Paging2.html'; // TODO: #3023: Delete this line once all widget html converted and no longer need this quick reference for the old format.\n\t\t\tinput = $.fn.Paging2.html.paging2;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.ERROR_TOOLTIP:\n\t\t\tinput = $.fn.ErrorTipBox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.FormItemType.FEEDBACK_BOX:\n\t\t\tinput = $.fn.TFeedback.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.EDIT_VIEW_FORM_ITEM: //There is no file browser JS file for this widget.\n\t\t\tinput = `\n\t\t\t<div class=\"edit-view-form-item-div\">\n\t\t\t\t<div class=\"edit-view-form-item-label-div\"><span class=\"edit-view-form-item-label\"></span></div>\n\t\t\t\t<div class=\"edit-view-form-item-input-div\"></div>\n\t\t\t</div>`;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.EDIT_VIEW_SUB_FORM_ITEM: //There is no file browser JS file for this widget.\n\t\t\tinput = `\n\t\t\t<div class=\"edit-view-form-item-div\">\n\t\t\t\t<div class=\"edit-view-form-item-sub-label-div\"><span class=\"edit-view-form-item-label\"></span></div>\n\t\t\t\t<div class=\"edit-view-form-item-input-div\"></div>\n\t\t\t</div>`;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.NO_RESULT_BOX:\n\t\t\tinput = $.fn.NoResultBox.html_template;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.VIEW_MIN_TAB:\n\t\t\tinput = $.fn.ViewMinTabBar.html.tab;\n\t\t\tbreak;\n\t\tcase _global_widgets_search_panel_FormItemType__WEBPACK_IMPORTED_MODULE_2__.WidgetNamesDic.VIEW_MIN_TAB_BAR:\n\t\t\tinput = $.fn.ViewMinTabBar.html.tab_bar;\n\t\t\tbreak;\n\t}\n\n\tif ( widget_path != false ) {\n\t\tinput = Global.loadWidget( widget_path );\n\t}\n\n\tif ( input && raw_text == true ) {\n\t\treturn input;\n\t} else {\n\t\t//#2571 - Error: Unable to get property 'indexOf' of undefined or null reference\n\t\tif ( input && input.indexOf( '<' ) != -1 ) {\n\t\t\tif ( !raw_text ) {\n\t\t\t\tinput = $( input );\n\n\t\t\t\tif ( widget_constructor && !input[widget_constructor] ) {\n\t\t\t\t\tvar error_string = $.i18n._( 'Class could not be found for' ) + ': ' + widgetName + '. ' + $.i18n._( 'Check that class is properly required.' );\n\t\t\t\t\tthrow( new Error( error_string ) );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//See comment in Global.loadWidget() regarding return null return values.\n\t\t\tvar error_string = $.i18n._( 'Network error, failed to load' ) + ': ' + widgetName + ' ' + $.i18n._( 'Result' ) + ': \"' + input + '\"';\n\t\t\tTAlertManager.showNetworkErrorAlert( { status: 999 }, error_string, null ); //Show the user an error popoup.\n\t\t\tthrow( new Error( error_string ) ); //Halt execution and ensure that the email has a good error message because of failure of web server to provide the requested file.\n\t\t}\n\n\t\treturn input;\n\t}\n};\n\n/* jshint ignore:end */\n\nGlobal.loadWidget = function( url ) {\n\tif ( LocalCacheData.loadedWidgetCache[url] ) {\n\t\treturn ( LocalCacheData.loadedWidgetCache[url] );\n\t}\n\n\tvar realPath = url + '?v=' + APIGlobal.pre_login_data.application_build;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.generateUUID */ .d.generateUUID();\n\tProgressBar.showProgressBar( message_id );\n\tvar successflag = false;\n\tvar responseData = $.ajax( {\n\t\tasync: false,\n\t\ttype: 'GET',\n\t\turl: realPath,\n\t\tdata: null,\n\t\tcache: true,\n\t\tsuccess: function() {\n\t\t\tsuccessflag = true;\n\t\t},\n\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t}\n\t} );\n\n\tProgressBar.removeProgressBar( message_id );\n\t//Error: Uncaught ReferenceError: responseText is not defined in interface/html5/global/Global.js?v=9.0.2-20151106-092147 line 1747\n\t// Upon further investigation (IRC discussions on #jQuery) it was suggested to stop using 'async: false' as that could be whats causing a null return value when we are expecting a jqXHR object.\n\t// Since the ultimate goal is to refactor things so .html is embedded in the .js files anyways, may as well just wait for that.\n\tif ( !responseData ) {\n\t\treturn null;\n\t} else {\n\t\tLocalCacheData.loadedWidgetCache[url] = responseData.responseText;\n\t\treturn ( responseData.responseText );\n\t}\n\n};\n\nGlobal.removeCss = function( path ) {\n\tvar realPath = 'theme/' + Global.theme + '/css/' + path;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\t$( 'link[href=\\'\\' + realPath + \\'?v=\\' + APIGlobal.pre_login_data.application_build + \\'\\']' ).remove();\n};\n\n/* jshint ignore:start */\n\nGlobal.getViewPathByViewId = function( viewId ) {\n\tvar path;\n\tswitch ( viewId ) {\n\t\t//Recruitment Portal\n\t\tcase 'GridTest':\n\t\tcase 'WidgetTest':\n\t\tcase 'AwesomeboxTest':\n\t\t\tpath = 'views/developer_tools/';\n\t\t\tbreak;\n\t\tcase 'MyProfile':\n\t\t\tpath = 'views/portal/hr/my_profile/';\n\t\t\tbreak;\n\t\tcase 'MyJobApplication':\n\t\t\tpath = 'views/portal/hr/my_jobapplication/';\n\t\t\tbreak;\n\t\tcase 'MyProfileEmployment':\n\t\t\tpath = 'views/portal/hr/my_profile/';\n\t\t\tbreak;\n\n\t\tcase 'Map':\n\t\t\tpath = 'views/attendance/map/';\n\t\t\tbreak;\n\t\tcase 'ManualTimeSheet':\n\t\t\tpath = 'views/attendance/manual_timesheet/';\n\t\t\tbreak;\n\t\tcase 'Home':\n\t\t\tpath = 'views/home/dashboard/';\n\t\t\tbreak;\n\t\tcase 'PortalJobVacancyDetail':\n\t\tcase 'PortalJobVacancy':\n\t\t\tpath = 'views/portal/hr/recruitment/';\n\t\t\tbreak;\n\t\tcase 'PortalLogin':\n\t\t\tpath = 'views/portal/login/';\n\t\t\tbreak;\n\t\tcase 'QuickPunchLogin':\n\t\t\tpath = 'views/quick_punch/login/';\n\t\t\tbreak;\n\t\tcase 'QuickPunch':\n\t\t\tpath = 'views/quick_punch/punch/';\n\t\t\tbreak;\n\t\tcase 'UserDateTotalParent':\n\t\tcase 'UserDateTotal':\n\t\t\tpath = 'views/attendance/timesheet/';\n\t\t\tbreak;\n\t\tcase 'Product':\n\t\t\tpath = 'views/invoice/products/';\n\t\t\tbreak;\n\t\tcase 'InvoiceDistrict':\n\t\t\tpath = 'views/invoice/district/';\n\t\t\tbreak;\n\t\tcase 'PaymentGateway':\n\t\t\tpath = 'views/invoice/payment_gateway/';\n\t\t\tbreak;\n\t\tcase 'InvoiceConfig':\n\t\t\tpath = 'views/invoice/settings/';\n\t\t\tbreak;\n\t\tcase 'ShippingPolicy':\n\t\t\tpath = 'views/invoice/shipping_policy/';\n\t\t\tbreak;\n\t\tcase 'AreaPolicy':\n\t\t\tpath = 'views/invoice/area_policy/';\n\t\t\tbreak;\n\t\tcase 'TaxPolicy':\n\t\t\tpath = 'views/invoice/tax_policy/';\n\t\t\tbreak;\n\t\tcase 'ClientGroup':\n\t\t\tpath = 'views/invoice/client_group/';\n\t\t\tbreak;\n\t\tcase 'ProductGroup':\n\t\t\tpath = 'views/invoice/product_group/';\n\t\t\tbreak;\n\t\tcase 'Exception':\n\t\t\tpath = 'views/attendance/exceptions/';\n\t\t\tbreak;\n\t\tcase 'Employee':\n\t\t\tpath = 'views/employees/employee/';\n\t\t\tbreak;\n\t\tcase 'RemittanceDestinationAccount':\n\t\t\tpath = 'views/employees/remittance_destination_account/';\n\t\t\tbreak;\n\t\tcase 'Wage':\n\t\t\tpath = 'views/company/wage/';\n\t\t\tbreak;\n\t\tcase 'Login':\n\t\t\tpath = 'views/login/';\n\t\t\tbreak;\n\t\tcase 'TimeSheet':\n\t\t\tpath = 'views/attendance/timesheet/';\n\t\t\tbreak;\n\t\tcase 'InOut':\n\t\t\tpath = 'views/attendance/in_out/';\n\t\t\tbreak;\n\t\tcase 'RecurringScheduleControl':\n\t\t\tpath = 'views/attendance/recurring_schedule_control/';\n\t\t\tbreak;\n\t\tcase 'RecurringScheduleTemplateControl':\n\t\t\tpath = 'views/attendance/recurring_schedule_template_control/';\n\t\t\tbreak;\n\t\tcase 'ScheduleShift':\n\t\tcase 'Schedule':\n\t\t\tpath = 'views/attendance/schedule/';\n\t\t\tbreak;\n\t\tcase 'Accrual':\n\t\t\tpath = 'views/attendance/accrual/';\n\t\t\tbreak;\n\t\tcase 'AccrualBalance':\n\t\t\tpath = 'views/attendance/accrual_balance/';\n\t\t\tbreak;\n\t\tcase 'Punches':\n\t\t\tpath = 'views/attendance/punches/';\n\t\t\tbreak;\n\t\tcase 'PunchTagGroup':\n\t\tcase 'PunchTag':\n\t\t\tpath = 'views/attendance/punch_tag/';\n\t\t\tbreak;\n\t\tcase 'JobGroup':\n\t\tcase 'Job':\n\t\t\tpath = 'views/attendance/job/';\n\t\t\tbreak;\n\t\tcase 'JobItemGroup':\n\t\tcase 'JobItem':\n\t\t\tpath = 'views/attendance/job_item/';\n\t\t\tbreak;\n\t\tcase 'JobItemAmendment':\n\t\t\tpath = 'views/attendance/job_item_amendment/';\n\t\t\tbreak;\n\t\tcase 'UserTitle':\n\t\t\tpath = 'views/employees/user_title/';\n\t\t\tbreak;\n\t\tcase 'UserContact':\n\t\t\tpath = 'views/employees/user_contact/';\n\t\t\tbreak;\n\t\tcase 'UserPreference':\n\t\t\tpath = 'views/employees/user_preference/';\n\t\t\tbreak;\n\t\tcase 'UserGroup':\n\t\t\tpath = 'views/employees/user_group/';\n\t\t\tbreak;\n\t\tcase 'Log':\n\t\t\tpath = 'views/core/log/';\n\t\t\tbreak;\n\t\tcase 'UserDefault':\n\t\t\tpath = 'views/employees/user_default/';\n\t\t\tbreak;\n\t\tcase 'ROE':\n\t\t\tpath = 'views/employees/roe/';\n\t\t\tbreak;\n\t\tcase 'Company':\n\t\t\tpath = 'views/company/company/';\n\t\t\tbreak;\n\t\tcase 'Companies':\n\t\t\tpath = 'views/company/companies/';\n\t\t\tbreak;\n\t\tcase 'PayPeriodSchedule':\n\t\t\tpath = 'views/payperiod/';\n\t\t\tbreak;\n\t\tcase 'PayPeriods':\n\t\t\tpath = 'views/payroll/pay_periods/';\n\t\t\tbreak;\n\t\tcase 'LegalEntity':\n\t\t\tpath = 'views/company/legal_entity/';\n\t\t\tbreak;\n\t\tcase 'PayrollRemittanceAgencyEvent':\n\t\tcase 'PayrollRemittanceAgency':\n\t\t\tpath = 'views/company/payroll_remittance_agency/';\n\t\t\tbreak;\n\t\tcase 'RemittanceSourceAccount':\n\t\t\tpath = 'views/company/remittance_source_account/';\n\t\t\tbreak;\n\t\tcase 'Branch':\n\t\t\tpath = 'views/company/branch/';\n\t\t\tbreak;\n\t\tcase 'GEOFence':\n\t\t\tpath = 'views/company/geo_fence/';\n\t\t\tbreak;\n\t\tcase 'Department':\n\t\t\tpath = 'views/company/department/';\n\t\t\tbreak;\n\t\tcase 'HierarchyControl':\n\t\t\tpath = 'views/company/hierarchy_control/';\n\t\t\tbreak;\n\t\tcase 'WageGroup':\n\t\t\tpath = 'views/company/wage_group/';\n\t\t\tbreak;\n\t\tcase 'EthnicGroup':\n\t\t\tpath = 'views/company/ethnic_group/';\n\t\t\tbreak;\n\t\tcase 'Currency':\n\t\tcase 'CurrencyRate':\n\t\t\tpath = 'views/company/currency/';\n\t\t\tbreak;\n\t\tcase 'PermissionControl':\n\t\t\tpath = 'views/company/permission_control/';\n\t\t\tbreak;\n\t\tcase 'CustomField':\n\t\t\tpath = 'views/company/custom_field/';\n\t\t\tbreak;\n\t\tcase 'Station':\n\t\t\tpath = 'views/company/station/';\n\t\t\tbreak;\n\t\tcase 'PayStub':\n\t\t\tpath = 'views/payroll/pay_stub/';\n\t\t\tbreak;\n\t\tcase 'PayStubTransaction':\n\t\t\tpath = 'views/payroll/pay_stub_transaction/';\n\t\t\tbreak;\n\t\tcase 'GovernmentDocument':\n\t\t\tpath = 'views/payroll/government_document/';\n\t\t\tbreak;\n\t\tcase 'Request':\n\t\t\tpath = 'views/my_account/request/';\n\t\t\tbreak;\n\t\tcase 'ChangePassword':\n\t\t\tpath = 'views/my_account/password/';\n\t\t\tbreak;\n\t\tcase 'RequestAuthorization':\n\t\t\tpath = 'views/my_account/request_authorization/';\n\t\t\tbreak;\n\t\tcase 'TimeSheetAuthorization':\n\t\t\tpath = 'views/my_account/timesheet_authorization/';\n\t\t\tbreak;\n\t\tcase 'MessageControl':\n\t\t\tpath = 'views/my_account/message_control/';\n\t\t\tbreak;\n\t\tcase 'Notification':\n\t\t\tpath = 'views/my_account/notification/';\n\t\t\tbreak;\n\t\tcase 'LoginUserContact':\n\t\t\tpath = 'views/my_account/user_contact/';\n\t\t\tbreak;\n\t\tcase 'LoginUserPreference':\n\t\t\tpath = 'views/my_account/user_preference/';\n\t\t\tbreak;\n\t\tcase 'LoginUserExpense':\n\t\tcase 'ExpenseAuthorization':\n\t\t\tpath = 'views/my_account/expense/';\n\t\t\tbreak;\n\t\tcase 'PayStubAmendment':\n\t\t\tpath = 'views/payroll/pay_stub_amendment/';\n\t\t\tbreak;\n\t\tcase 'RecurringPayStubAmendment':\n\t\t\tpath = 'views/payroll/recurring_pay_stub_amendment/';\n\t\t\tbreak;\n\t\tcase 'PayStubEntryAccount':\n\t\t\tpath = 'views/payroll/pay_stub_entry_account/';\n\t\t\tbreak;\n\t\tcase 'CompanyTaxDeduction':\n\t\t\tpath = 'views/payroll/company_tax_deduction/';\n\t\t\tbreak;\n\t\tcase 'UserExpense':\n\t\t\tpath = 'views/payroll/user_expense/';\n\t\t\tbreak;\n\t\tcase 'PolicyGroup':\n\t\t\tpath = 'views/policy/policy_group/';\n\t\t\tbreak;\n\t\tcase 'PayCode':\n\t\t\tpath = 'views/policy/pay_code/';\n\t\t\tbreak;\n\t\tcase 'PayFormulaPolicy':\n\t\t\tpath = 'views/policy/pay_formula_policy/';\n\t\t\tbreak;\n\t\tcase 'ContributingPayCodePolicy':\n\t\t\tpath = 'views/policy/contributing_pay_code_policy/';\n\t\t\tbreak;\n\t\tcase 'ContributingShiftPolicy':\n\t\t\tpath = 'views/policy/contributing_shift_policy/';\n\t\t\tbreak;\n\t\tcase 'RoundIntervalPolicy':\n\t\t\tpath = 'views/policy/round_interval_policy/';\n\t\t\tbreak;\n\t\tcase 'MealPolicy':\n\t\t\tpath = 'views/policy/meal_policy/';\n\t\t\tbreak;\n\t\tcase 'BreakPolicy':\n\t\t\tpath = 'views/policy/break_policy/';\n\t\t\tbreak;\n\t\tcase 'RegularTimePolicy':\n\t\t\tpath = 'views/policy/regular_time_policy/';\n\t\t\tbreak;\n\t\tcase 'ExpensePolicy':\n\t\t\tpath = 'views/policy/expense_policy/';\n\t\t\tbreak;\n\t\tcase 'OvertimePolicy':\n\t\t\tpath = 'views/policy/overtime_policy/';\n\t\t\tbreak;\n\t\tcase 'AbsencePolicy':\n\t\t\tpath = 'views/policy/absence_policy/';\n\t\t\tbreak;\n\t\tcase 'PremiumPolicy':\n\t\t\tpath = 'views/policy/premium_policy/';\n\t\t\tbreak;\n\t\tcase 'ExceptionPolicyControl':\n\t\t\tpath = 'views/policy/exception_policy/';\n\t\t\tbreak;\n\n\t\tcase 'RecurringHoliday':\n\t\t\tpath = 'views/policy/recurring_holiday/';\n\t\t\tbreak;\n\t\tcase 'HolidayPolicy':\n\t\t\tpath = 'views/policy/holiday_policy/';\n\t\t\tbreak;\n\t\tcase 'Holiday':\n\t\t\tpath = 'views/policy/holiday/';\n\t\t\tbreak;\n\t\tcase 'SchedulePolicy':\n\t\t\tpath = 'views/policy/schedule_policy/';\n\t\t\tbreak;\n\t\tcase 'AccrualPolicy':\n\t\tcase 'AccrualPolicyAccount':\n\t\tcase 'AccrualPolicyUserModifier':\n\t\t\tpath = 'views/policy/accrual_policy/';\n\t\t\tbreak;\n\t\tcase 'DocumentRevision':\n\t\tcase 'Document':\n\t\tcase 'DocumentGroup':\n\t\t\tpath = 'views/document/';\n\t\t\tbreak;\n\t\tcase 'About':\n\t\t\tpath = 'views/help/';\n\t\t\tbreak;\n\t\tcase 'ActiveShiftReport':\n\t\t\tpath = 'views/reports/whos_in_summary/';\n\t\t\tbreak;\n\t\tcase 'UserSummaryReport':\n\t\t\tpath = 'views/reports/employee_information/';\n\t\t\tbreak;\n\t\tcase 'SavedReport':\n\t\t\tpath = 'views/reports/saved_report/';\n\t\t\tbreak;\n\t\tcase 'ReportSchedule':\n\t\t\tpath = 'views/reports/report_schedule/';\n\t\t\tbreak;\n\t\tcase 'ScheduleSummaryReport':\n\t\t\tpath = 'views/reports/schedule_summary/';\n\t\t\tbreak;\n\t\tcase 'TimesheetSummaryReport':\n\t\t\tpath = 'views/reports/timesheet_summary/';\n\t\t\tbreak;\n\t\tcase 'TimesheetDetailReport':\n\t\t\tpath = 'views/reports/timesheet_detail/';\n\t\t\tbreak;\n\t\tcase 'PunchSummaryReport':\n\t\t\tpath = 'views/reports/punch_summary/';\n\t\t\tbreak;\n\t\tcase 'ExceptionSummaryReport':\n\t\t\tpath = 'views/reports/exception_summary/';\n\t\t\tbreak;\n\t\tcase 'PayStubTransactionSummaryReport':\n\t\t\tpath = 'views/reports/pay_stub_transaction_summary/';\n\t\t\tbreak;\n\t\tcase 'PayStubSummaryReport':\n\t\t\tpath = 'views/reports/pay_stub_summary/';\n\t\t\tbreak;\n\t\tcase 'KPI':\n\t\tcase 'KPIGroup':\n\t\tcase 'UserReviewControl':\n\t\t\tpath = 'views/hr/kpi/';\n\t\t\tbreak;\n\t\tcase 'QualificationGroup':\n\t\tcase 'Qualification':\n\t\tcase 'UserSkill':\n\t\tcase 'UserEducation':\n\t\tcase 'UserMembership':\n\t\tcase 'UserLicense':\n\t\tcase 'UserLanguage':\n\t\t\tpath = 'views/hr/qualification/';\n\t\t\tbreak;\n\t\tcase 'JobApplication':\n\t\tcase 'JobVacancy':\n\t\tcase 'JobApplicant':\n\t\tcase 'JobApplicantEmployment':\n\t\tcase 'JobApplicantReference':\n\t\tcase 'JobApplicantLocation':\n\t\tcase 'JobApplicantSkill':\n\t\tcase 'JobApplicantEducation':\n\t\tcase 'JobApplicantMembership':\n\t\tcase 'JobApplicantLicense':\n\t\tcase 'JobApplicantLanguage':\n\t\tcase 'RecruitmentPortalConfig':\n\t\t\tpath = 'views/hr/recruitment/';\n\t\t\tbreak;\n\t\tcase 'PayrollExportReport':\n\t\t\tpath = 'views/reports/payroll_export/';\n\t\t\tbreak;\n\t\tcase 'GeneralLedgerSummaryReport':\n\t\t\tpath = 'views/reports/general_ledger_summary/';\n\t\t\tbreak;\n\t\tcase 'ExpenseSummaryReport':\n\t\t\tpath = 'views/reports/expense_summary/';\n\t\t\tbreak;\n\t\tcase 'AccrualBalanceSummaryReport':\n\t\t\tpath = 'views/reports/accrual_balance_summary/';\n\t\t\tbreak;\n\t\tcase 'JobSummaryReport':\n\t\t\tpath = 'views/reports/job_summary/';\n\t\t\tbreak;\n\t\tcase 'JobAnalysisReport':\n\t\t\tpath = 'views/reports/job_analysis/';\n\t\t\tbreak;\n\t\tcase 'JobInformationReport':\n\t\t\tpath = 'views/reports/job_info/';\n\t\t\tbreak;\n\t\tcase 'JobItemInformationReport':\n\t\t\tpath = 'views/reports/job_item_info/';\n\t\t\tbreak;\n\t\tcase 'InvoiceTransactionSummaryReport':\n\t\t\tpath = 'views/reports/invoice_transaction_summary/';\n\t\t\tbreak;\n\t\tcase 'RemittanceSummaryReport':\n\t\t\tpath = 'views/reports/remittance_summary/';\n\t\t\tbreak;\n\t\tcase 'T4SummaryReport':\n\t\t\tpath = 'views/reports/t4_summary/';\n\t\t\tbreak;\n\t\tcase 'T4ASummaryReport':\n\t\t\tpath = 'views/reports/t4a_summary/';\n\t\t\tbreak;\n\t\tcase 'TaxSummaryReport':\n\t\t\tpath = 'views/reports/tax_summary/';\n\t\t\tbreak;\n\t\tcase 'Form940Report':\n\t\t\tpath = 'views/reports/form940/';\n\t\t\tbreak;\n\t\tcase 'Form941Report':\n\t\t\tpath = 'views/reports/form941/';\n\t\t\tbreak;\n\t\tcase 'Form1099NecReport':\n\t\t\tpath = 'views/reports/form1099/';\n\t\t\tbreak;\n\t\tcase 'FormW2Report':\n\t\t\tpath = 'views/reports/formw2/';\n\t\t\tbreak;\n\t\tcase 'USStateUnemploymentReport':\n\t\t\tpath = 'views/reports/us_state_unemployment/';\n\t\t\tbreak;\n\t\tcase 'AffordableCareReport':\n\t\t\tpath = 'views/reports/affordable_care/';\n\t\t\tbreak;\n\t\tcase 'UserQualificationReport':\n\t\t\tpath = 'views/reports/qualification_summary/';\n\t\t\tbreak;\n\t\tcase 'KPIReport':\n\t\t\tpath = 'views/reports/review_summary/';\n\t\t\tbreak;\n\t\tcase 'UserRecruitmentSummaryReport':\n\t\t\tpath = 'views/reports/recruitment_summary/';\n\t\t\tbreak;\n\t\tcase 'UserRecruitmentDetailReport':\n\t\t\tpath = 'views/reports/recruitment_detail/';\n\t\t\tbreak;\n\t\tcase 'Client':\n\t\t\tpath = 'views/invoice/client/';\n\t\t\tbreak;\n\t\tcase 'ClientContact':\n\t\t\tpath = 'views/invoice/client_contact/';\n\t\t\tbreak;\n\t\tcase 'ClientPayment':\n\t\t\tpath = 'views/invoice/client_payment/';\n\t\t\tbreak;\n\t\tcase 'InvoiceTransaction':\n\t\t\tpath = 'views/invoice/invoice_transaction/';\n\t\t\tbreak;\n\t\tcase 'Invoice':\n\t\t\tpath = 'views/invoice/invoice/';\n\t\t\tbreak;\n\t\tcase 'CustomColumn':\n\t\t\tpath = 'views/reports/custom_column/';\n\t\t\tbreak;\n\t\tcase 'AuditTrailReport':\n\t\t\tpath = 'views/reports/audittrail/';\n\t\t\tbreak;\n\t\tcase 'ReCalculateTimeSheetWizard':\n\t\t\tpath = 'views/wizard/re_calculate_timesheet/';\n\t\t\tbreak;\n\t\tcase 'GeneratePayStubWizard':\n\t\t\tpath = 'views/wizard/generate_pay_stub/';\n\t\t\tbreak;\n\t\tcase 'UserGenericStatus':\n\t\t\tpath = 'views/wizard/user_generic_data_status/';\n\t\t\tbreak;\n\t\tcase 'ProcessPayrollWizard':\n\t\t\tpath = 'views/wizard/process_payroll/';\n\t\t\tbreak;\n\t\tcase 'PayrollRemittanceAgencyEventWizardController':\n\t\t\tpath = 'views/payroll/remittance_wizard/';\n\t\t\tbreak;\n\t\tcase 'ProcessTransactionsWizardController':\n\t\t\tpath = 'views/payroll/process_transactions_wizard/';\n\t\t\tbreak;\n\t\tcase 'ImportCSVWizard':\n\t\t\tpath = 'views/wizard/import_csv/';\n\t\t\tbreak;\n\t\tcase 'JobInvoiceWizard':\n\t\t\tpath = 'views/wizard/job_invoice/';\n\t\t\tbreak;\n\t\tcase 'LoginUserWizard':\n\t\tcase 'LoginUser':\n\t\t\tpath = 'views/wizard/login_user/';\n\t\t\tbreak;\n\t\tcase 'QuickStartWizard':\n\t\t\tpath = 'views/wizard/quick_start/';\n\t\t\tbreak;\n\t\tcase 'UserPhotoWizard':\n\t\t\tpath = 'views/wizard/user_photo/';\n\t\t\tbreak;\n\t\tcase 'FindAvailableWizard':\n\t\tcase 'FindAvailable':\n\t\t\tpath = 'views/wizard/find_available/';\n\t\t\tbreak;\n\t\tcase 'PermissionWizard':\n\t\t\tpath = 'views/wizard/permission_wizard/';\n\t\t\tbreak;\n\t\tcase 'FormulaBuilderWizard':\n\t\t\tpath = 'views/wizard/formula_builder_wizard/';\n\t\t\tbreak;\n\t\tcase 'ReCalculateAccrualWizard':\n\t\t\tpath = 'views/wizard/re_calculate_accrual/';\n\t\t\tbreak;\n\t\tcase 'ResetPasswordWizard':\n\t\t\tpath = 'views/wizard/reset_password/';\n\t\t\tbreak;\n\t\tcase 'ShareReportWizard':\n\t\t\tpath = 'views/wizard/share_report/';\n\t\t\tbreak;\n\t\tcase 'PayCodeWizard':\n\t\t\tpath = 'views/wizard/pay_code/';\n\t\t\tbreak;\n\t\tcase 'InstallWizard':\n\t\t\tpath = 'views/wizard/install/';\n\t\t\tbreak;\n\t\tcase 'PayStubAccountWizard':\n\t\t\tpath = 'views/wizard/pay_stub_account/';\n\t\t\tbreak;\n\t\tcase 'DashletWizard':\n\t\t\tpath = 'views/wizard/dashlet/';\n\t\t\tbreak;\n\t\tcase 'ReportViewWizard':\n\t\t\tpath = 'views/wizard/report_view/';\n\t\t\tbreak;\n\t\tcase 'PortalApplyJobWizard':\n\t\t\tpath = 'views/wizard/portal_apply_job/';\n\t\t\tbreak;\n\t\tcase 'ForgotPasswordWizard':\n\t\t\tpath = 'views/wizard/forgot_password/';\n\t\t\tbreak;\n\t\tcase 'ResetForgotPasswordWizard':\n\t\t\tpath = 'views/wizard/reset_forgot_password/';\n\t\t\tbreak;\n\t\tcase 'DeveloperTools':\n\t\t\tpath = 'views/developer_tools/';\n\t\t\tbreak;\n\t\tcase 'UIKitSample':\n\t\tcase 'UIKitChildSample':\n\t\t\tpath = 'views/ui_kit_sample/';\n\t\t\tbreak;\n\t}\n\treturn path;\n};\n/* jshint ignore:end */\n\n//returns exact filepaths for class dependencies\nGlobal.getViewPreloadPathByViewId = function( viewId ) {\n\t// DEPRECATED: Moved the loading of these preloads to post-login-main_ui-dependancies.js\n\n\tvar preloads = [];\n\t// switch ( viewId ) {\n\t// \tcase 'Request':\n\t// \tcase 'RequestAuthorization':\n\t// \t\tpreloads = ['views/common/AuthorizationHistoryCommon.js', 'views/common/RequestViewCommonController.js', 'views/common/EmbeddedMessageCommon.js'];\n\t// \t\tbreak;\n\t// \tcase 'ExpenseAuthorization':\n\t// \tcase 'UserExpense':\n\t// \tcase 'LoginUserExpense':\n\t// \tcase 'TimeSheetAuthorization':\n\t// \t\tpreloads = ['views/common/AuthorizationHistoryCommon.js'];\n\t// \t\tbreak;\n\t// }\n\treturn preloads;\n};\n\nGlobal.removeViewCss = function( viewId, fileName ) {\n\tGlobal.removeCss( Global.getViewPathByViewId( viewId ) + fileName );\n};\n\nGlobal.sanitizeViewId = function( viewId ) {\n\tif ( typeof viewId === 'string' || viewId instanceof String ) {\n\t\treturn viewId.replace( '/', '' ).replace( '\\\\', '' );\n\t}\n\n\treturn viewId;\n};\n\nGlobal.loadViewSource = function( viewId, fileName, onResult, sync ) {\n\tvar viewId = Global.sanitizeViewId( viewId );\n\tvar path = Global.getViewPathByViewId( viewId );\n\n\tif ( fileName.indexOf( '.js' ) > 0 ) {\n\t\tvar preloads = Global.getViewPreloadPathByViewId( viewId );\n\t\tif ( preloads.length > 0 ) {\n\t\t\tfor ( var p in preloads ) {\n\t\t\t\tGlobal.loadScript( preloads[p] );\n\t\t\t}\n\t\t}\n\n\t\tif ( path ) {\n\t\t\tif ( sync ) {\n\t\t\t\treturn Global.loadScript( path + fileName );\n\t\t\t} else {\n\t\t\t\tGlobal.loadScript( path + fileName, onResult );\n\t\t\t}\n\t\t} else {\n\t\t\t//Invalid viewId, redirect to home page?\n\t\t\tconsole.debug( 'View does not exist! ViewId: ' + viewId + ' File Name: ' + fileName );\n\t\t\tif ( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url && APIGlobal.pre_login_data.base_url ) {\n\t\t\t\tGlobal.setURLToBrowser( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url + APIGlobal.pre_login_data.base_url );\n\t\t\t}\n\t\t}\n\n\t} else if ( fileName.indexOf( '.css' ) > 0 ) {\n\t\tGlobal.addCss( path + fileName );\n\t} else {\n\t\tif ( path ) {\n\t\t\t// HTML2JS\n\t\t\tvar template_type = _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .HtmlTemplatesGlobal.getTemplateTypeFromFilename */ .H.getTemplateTypeFromFilename( fileName );\n\t\t\tvar template_options = _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .HtmlTemplatesGlobal.getTemplateOptionsFromViewId */ .H.getTemplateOptionsFromViewId( viewId );\n\n\t\t\tif( template_type === _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .TemplateType.INLINE_HTML */ .W.INLINE_HTML ) {\n\t\t\t\ttemplate_options.filename = fileName; // Needed by HtmlTemplates.checkViewClassForInlineHtmlbyFilename() which uses filename, not view id.\n\t\t\t}\n\t\t\tif ( sync ) {\n\t\t\t\t// Note: for #HTML2JS This path is taken for things such as: CompanyInformation, CompanyEditView.html, and general edit views.\n\n\t\t\t\t// Check if we should use the new templating logic, or legacy html load.\n\t\t\t\tif( template_type !== _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .TemplateType.LEGACY_HTML */ .W.LEGACY_HTML ) {\n\t\t\t\t\t// Use new HTML2JS template class\n\t\t\t\t\treturn _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .HtmlTemplatesGlobal.getTemplate */ .H.getTemplate( template_type, template_options, null ); // no onResult, as its syncronous.\n\t\t\t\t} else {\n\t\t\t\t\t// Legacy html file load for syncronous files.\n\t\t\t\t\treturn Global.loadPageSync( path + fileName );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Check if we should use the new templating logic, or legacy html load.\n\t\t\t\tif( template_type !== _services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .TemplateType.LEGACY_HTML */ .W.LEGACY_HTML ) {\n\t\t\t\t\t// Use new HTML2JS template class\n\t\t\t\t\t_services_HtmlTemplates__WEBPACK_IMPORTED_MODULE_7__/* .HtmlTemplatesGlobal.getTemplate */ .H.getTemplate( template_type, template_options, onResult );\n\t\t\t\t} else {\n\t\t\t\t\t// Legacy html file load\n\t\t\t\t\tGlobal.loadPage( path + fileName, onResult );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t//Invalid viewId, redirect to home page?\n\t\t\tconsole.debug( 'View does not exist! ViewId: ' + viewId + ' File Name: ' + fileName );\n\t\t\tif ( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url && APIGlobal.pre_login_data.base_url ) {\n\t\t\t\tGlobal.setURLToBrowser( _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url + APIGlobal.pre_login_data.base_url );\n\t\t\t}\n\t\t}\n\t}\n};\n\nGlobal.loadPageSync = function( url ) {\n\n\tvar realPath = url + '?v=' + APIGlobal.pre_login_data.application_build;\n\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.generateUUID */ .d.generateUUID();\n\tProgressBar.showProgressBar( message_id );\n\tvar successflag = false;\n\tvar responseData = $.ajax( {\n\t\tasync: false,\n\t\ttype: 'GET',\n\t\turl: realPath,\n\t\tdata: null,\n\t\tcache: true,\n\t\tsuccess: function() {\n\t\t\tsuccessflag = true;\n\t\t},\n\n\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t}\n\t} );\n\n\tProgressBar.removeProgressBar( message_id );\n\n\treturn ( responseData.responseText );\n\n};\n\nGlobal.loadPage = function( url, onResult ) {\n\n\tvar realPath = url + '?v=' + APIGlobal.pre_login_data.application_build;\n\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.generateUUID */ .d.generateUUID();\n\tif ( Global.url_offset ) {\n\t\trealPath = Global.url_offset + realPath;\n\t}\n\n\tProgressBar.showProgressBar( message_id );\n\t$.ajax( {\n\t\tasync: true,\n\t\ttype: 'GET',\n\t\turl: realPath,\n\t\tdata: null,\n\t\tcache: true,\n\t\tsuccess: function( result ) {\n\t\t\tProgressBar.removeProgressBar( message_id );\n\t\t\tonResult( result );\n\t\t},\n\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t}\n\t} );\n\n};\n\nGlobal.getRootURL = function( url ) {\n\tif ( !url ) {\n\t\turl = location.href;\n\t}\n\n\t//Rather than parse the URL ourselves, lets use the URL API and build it back up from its components.\n\tvar url_obj = new URL( url );\n\tvar retval = url_obj.protocol + '//' + url_obj.host;\n\n\treturn retval;\n};\n\nGlobal.getBaseURL = function( url_relative_path, include_search = true ) {\n\t//Rather than parse the URL ourselves, lets use the URL API and build it back up from its components.\n\tvar url_obj = new URL( location.href );\n\tvar retval = url_obj.protocol + '//' + url_obj.host + url_obj.pathname;\n\n\t//Resolve any specified relative path here, so we can append the search component of the URL after.\n\t// This is needed for the recruitment portal to work if Facebook or some other 3rd party appends search components on the URL, ie: ?test=1#!m=PortalJobVacancyDetail&id=05a45d0b-b982-2a1f-2003-21ea65522bf3&company_id=ABC\n\tif ( url_relative_path ) {\n\t\tretval = new URL( url_relative_path, retval ).href;\n\t}\n\n\tif ( include_search == true ) {\n\t\tretval += url_obj.search; //Can't put the search component back on when getting BaseURL.\n\t}\n\n\treturn retval;\n};\n\nGlobal.isArrayAndHasItems = function( object ) {\n\n\tif ( $.type( object ) === 'array' && object.length > 0 ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n\n};\n\nGlobal.isValidInputCodes = function( keyCode ) {\n\tvar result = true;\n\tswitch ( keyCode ) {\n\t\tcase 9:\n\t\tcase 16:\n\t\tcase 17:\n\t\tcase 18:\n\t\tcase 19:\n\t\tcase 20:\n\t\tcase 33:\n\t\tcase 34:\n\t\t// case 37:\n\t\t// case 38:\n\t\t// case 39:\n\t\t// case 40:\n\t\tcase 45:\n\t\tcase 91:\n\t\tcase 92:\n\t\tcase 93:\n\t\t\tresult = false;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( keyCode >= 112 && keyCode <= 123 ) {\n\t\t\t\tresult = false;\n\t\t\t}\n\t}\n\treturn result;\n};\n\n/* jshint ignore:start */\nGlobal.convertLayoutFilterToAPIFilter = function( layout ) {\n\tvar convert_filter_data = {};\n\n\tif ( !layout ) {\n\t\treturn null;\n\t}\n\n\tvar filter_data = layout.data.filter_data;\n\n\tif ( !filter_data ) {\n\t\treturn null;\n\t}\n\n\t$.each( filter_data, function( key, content ) {\n\t\t// Cannot read property 'value' of undefined\n\t\tif ( !content ) {\n\t\t\treturn;//continue;\n\t\t}\n\t\tif ( ( content.value instanceof Array && content.value.length > 0 ) || ( content.value instanceof Object ) ) {\n\t\t\tvar values = [];\n\t\t\tvar obj = content.value;\n\t\t\tif ( content.value instanceof Array ) {\n\n\t\t\t\tvar len = content.value.length;\n\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\n\t\t\t\t\tif ( Global.isSet( content.value[i].value ) ) {\n\t\t\t\t\t\tvalues.push( content.value[i].value ); //Options,\n\t\t\t\t\t} else if ( content.value[i].id || content.value[i].id === 0 || content.value[i].id === '0' ) {\n\t\t\t\t\t\tvalues.push( content.value[i].id ); //Awesomebox\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalues.push( content.value[i] ); // default_filter_data_for_next_view\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconvert_filter_data[key] = values;\n\t\t\t\t//only add search filter which not equal to false, see if this cause any bugs\n\t\t\t} else if ( content.value instanceof Object ) {\n\t\t\t\tvar final_value = '';\n\t\t\t\tif ( Global.isSet( content.value.value ) ) {\n\t\t\t\t\tfinal_value = content.value.value; //Options,\n\t\t\t\t} else if ( content.value.id || content.value.id === 0 || content.value.id === '0' ) {\n\t\t\t\t\tfinal_value = content.value.id; //Awesomebox\n\t\t\t\t} else {\n\t\t\t\t\tfinal_value = content.value; // default_filter_data_for_next_view\n\t\t\t\t}\n\n\t\t\t\tconvert_filter_data[key] = final_value;\n\n\t\t\t} else if ( obj.value === false ) {\n\t\t\t\treturn;//continue;\n\t\t\t} else {\n\t\t\t\tif ( Global.isSet( obj.value ) ) {\n\n\t\t\t\t\tconvert_filter_data[key] = obj.value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if ( filter_data[key].value === false ) {\n\t\t\treturn; //continue;\n\t\t} else if ( Global.isSet( filter_data[key].value ) ) {\n\t\t\tconvert_filter_data[key] = filter_data[key].value;\n\t\t} else {\n\t\t\tconvert_filter_data[key] = filter_data[key];\n\t\t}\n\t} );\n\n\tif ( LocalCacheData.extra_filter_for_next_open_view ) { //MUST removed this when close the view which used this attribute.\n\n\t\tfor ( var key in LocalCacheData.extra_filter_for_next_open_view.filter_data ) {\n\t\t\tconvert_filter_data[key] = LocalCacheData.extra_filter_for_next_open_view.filter_data[key];\n\t\t}\n\n\t}\n\n\treturn convert_filter_data;\n\n};\n/* jshint ignore:end */\n\n//ASC\nGlobal.compare = function( a, b, orderKey, order_type ) {\n\n\tif ( !Global.isSet( order_type ) ) {\n\t\torder_type = 'asc';\n\t}\n\n\tif ( order_type === 'asc' ) {\n\t\tif ( a[orderKey] < b[orderKey] ) {\n\t\t\treturn -1;\n\t\t}\n\t\tif ( a[orderKey] > b[orderKey] ) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t} else {\n\t\tif ( a[orderKey] < b[orderKey] ) {\n\t\t\treturn 1;\n\t\t}\n\t\tif ( a[orderKey] > b[orderKey] ) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}\n\n};\n\nGlobal.buildFilter = function() {\n\tvar filterCondition = arguments[0];\n\tvar filter = [];\n\n\tif ( filterCondition ) {\n\n\t\tfor ( var key in filterCondition ) {\n\t\t\tfilter[key] = filterCondition[key];\n\t\t}\n\n\t}\n\n\treturn filter;\n\n};\n\nGlobal.getLoginUserDateFormat = function() {\n\tvar format = 'DD-MMM-YY';\n\n\tif ( LocalCacheData.getLoginUserPreference() ) {\n\t\tformat = LocalCacheData.getLoginUserPreference().date_format;\n\t}\n\n\treturn format;\n};\n/* jshint ignore:start */\nGlobal.formatGridData = function( grid_data, key_name ) {\n\n\tif ( $.type( grid_data ) !== 'array' ) {\n\t\treturn grid_data;\n\t}\n\n\tfor ( var i = 0; i < grid_data.length; i++ ) {\n\t\tfor ( var key in grid_data[i] ) {\n\n\t\t\tif ( !grid_data[i].hasOwnProperty( key ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Need to convert custom fields time_unit to string\n\t\t\tif ( key.indexOf( 'custom_field' ) === 0 && Array.isArray( LocalCacheData.current_open_primary_controller.custom_fields ) ) {\n\t\t\t\tlet custom_field = LocalCacheData.current_open_primary_controller.custom_fields.find( ( field ) => {\n\t\t\t\t\treturn field.id === key.replace( 'custom_field-', '' );\n\t\t\t\t} );\n\n\t\t\t\tif ( custom_field && custom_field.type_id == 1300 ) {\n\t\t\t\t\tif ( Global.isNumeric( grid_data[i][key] ) ) {\n\t\t\t\t\t\tgrid_data[i][key] = Global.getTimeUnit( grid_data[i][key] );\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// The same format for all views.\n\t\t\tswitch ( key ) {\n\t\t\t\tcase 'maximum_shift_time':\n\t\t\t\tcase 'new_day_trigger_time':\n\t\t\t\tcase 'trigger_time':\n\t\t\t\tcase 'minimum_punch_time':\n\t\t\t\tcase 'maximum_punch_time':\n\t\t\t\tcase 'window_length':\n\t\t\t\tcase 'start_window':\n\t\t\t\tcase 'round_interval':\n\t\t\t\tcase 'grace':\n\t\t\t\tcase 'estimate_time':\n\t\t\t\tcase 'minimum_time':\n\t\t\t\tcase 'maximum_time':\n\t\t\t\tcase 'total_time':\n\t\t\t\tcase 'start_stop_window':\n\t\t\t\t\tif ( Global.isNumeric( grid_data[i][key] ) ) {\n\t\t\t\t\t\tgrid_data[i][key] = Global.getTimeUnit( grid_data[i][key] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgrid_data[i][key] = null; //Prevent string \"false\" from being returned when the column isn't defined on the server side.\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'include_break_punch_time':\n\t\t\t\tcase 'include_multiple_breaks':\n\t\t\t\tcase 'include_lunch_punch_time':\n\t\t\t\tcase 'is_default':\n\t\t\t\tcase 'is_base':\n\t\t\t\tcase 'auto_update':\n\t\t\t\tcase 'currently_employed':\n\t\t\t\tcase 'criminal_record':\n\t\t\t\tcase 'immediate_drug_test':\n\t\t\t\tcase 'is_current_employer':\n\t\t\t\tcase 'is_contact_available':\n\t\t\t\tcase 'enable_pay_stub_balance_display':\n\t\t\t\tcase 'enable_login':\n\t\t\t\tcase 'ytd_adjustment':\n\t\t\t\tcase 'authorized':\n\t\t\t\tcase 'is_reimbursable':\n\t\t\t\tcase 'reimbursable':\n\t\t\t\tcase 'tainted':\n\t\t\t\tcase 'auto_fill':\n\t\t\t\tcase 'private':\n\t\t\t\t\tif ( grid_data[i][key] === true ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'Yes' );\n\t\t\t\t\t} else if ( grid_data[i][key] === false ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'No' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'override':\n\t\t\t\t\tif ( grid_data[i][key] === true ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'Yes' );\n\t\t\t\t\t\tgrid_data[i]['is_override'] = true;\n\t\t\t\t\t} else if ( grid_data[i][key] === false ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'No' );\n\t\t\t\t\t\tgrid_data[i]['is_override'] = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'is_scheduled':\n\t\t\t\t\tif ( grid_data[i][key] === '1' ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'Yes' );\n\t\t\t\t\t} else if ( grid_data[i][key] === '0' ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'No' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'in_use':\n\t\t\t\t\tif ( grid_data[i][key] === '1' ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'Yes' );\n\t\t\t\t\t\tgrid_data[i]['is_in_use'] = true;\n\t\t\t\t\t} else if ( grid_data[i][key] === '0' ) {\n\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'No' );\n\t\t\t\t\t\tgrid_data[i]['is_in_use'] = false;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif ( grid_data[i][key] === false ) {\n\t\t\t\t\t\tgrid_data[i][key] = '';\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Handle the specially format columns which are not different with others.\n\t\t\tswitch ( key_name ) {\n\t\t\t\tcase 'AccrualPolicyUserModifier':\n\t\t\t\t\tswitch ( key ) {\n\t\t\t\t\t\tcase 'annual_maximum_time_modifier':\n\t\t\t\t\t\t\tif ( grid_data[i]['type_id'] === 20 ) {\n\t\t\t\t\t\t\t\tgrid_data[i][key] = $.i18n._( 'N/A' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'BreakPolicy':\n\t\t\t\tcase 'MealPolicy':\n\t\t\t\tcase 'Accrual':\n\t\t\t\t\tswitch ( key ) {\n\t\t\t\t\t\tcase 'amount':\n\t\t\t\t\t\t\tif ( Global.isNumeric( grid_data[i][key] ) ) {\n\t\t\t\t\t\t\t\tgrid_data[i][key] = Global.getTimeUnit( grid_data[i][key] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accrual_balance_summary':\n\t\t\t\tcase 'AccrualBalance':\n\t\t\t\t\tswitch ( key ) {\n\t\t\t\t\t\tcase 'balance':\n\t\t\t\t\t\t\tif ( Global.isNumeric( grid_data[i][key] ) ) {\n\t\t\t\t\t\t\t\tgrid_data[i][key] = Global.getTimeUnit( grid_data[i][key] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'RecurringScheduleControl':\n\t\t\t\t\tswitch ( key ) {\n\t\t\t\t\t\tcase 'end_date':\n\t\t\t\t\t\t\tif ( grid_data[i][key] === '' ) {\n\t\t\t\t\t\t\t\tgrid_data[i][key] = 'Never';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn grid_data;\n\n};\n/* jshint ignore:end */\n\n// Commented out as we have now fully refactored the old _super and __super references in the new ES6 code.\n// //make backone support a simple super funciton\n// Backbone.Model.prototype._super = function( funcName ) {\n// \treturn this.constructor.__super__[funcName].apply( this, _.rest( arguments ) );\n// };\n//\n// //make backone support a simple super function\n// Backbone.View.prototype._super = function( funcName ) {\n// \t// Note: If 'Maximum call stack size exceeded' error encountered, and view is extending twice (BaseView->ReportBaseView->SomeRandomView), then make sure you define `this.real_this` at the 2nd level extend. See reportBaseViewController init for example.\n// \tif ( this.real_this && this.real_this.constructor.__super__[funcName] ) {\n// \t\treturn this.real_this.constructor.__super__[funcName].apply( this, _.rest( arguments ) );\n// \t} else {\n// \t\treturn this.constructor.__super__[funcName].apply( this, _.rest( arguments ) );\n// \t}\n//\n// };\n//\n// //make backone support a simple super funciton for second level class\n// Backbone.View.prototype.__super = function( funcName ) {\n// \tif ( !this.real_this ) {\n// \t\tthis.real_this = this.constructor.__super__;\n// \t}\n//\n// \treturn this.constructor.__super__[funcName].apply( this, _.rest( arguments ) );\n//\n// };\n\n/*\n * Date Format 1.2.3\n * (c) 2007-2009 Steven Levithan <stevenlevithan.com>\n * MIT license\n *\n * Includes enhancements by Scott Trenda <scott.trenda.net>\n * and Kris Kowal <cixar.com/~kris.kowal>\n *\n * Accepts a date, a mask, or a date and a mask.\n * Returns a formatted version of the given date.\n * The date defaults to the current date/time.\n * The mask defaults to dateFormat.masks.default.\n */\n\nvar dateFormat = function() {\n\tvar token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\\1?|[LloSZ]|'[^']*\"|'[^']*'/g,\n\t\ttimezone = /\\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\\d{4})?)\\b/g,\n\t\ttimezoneClip = /[^-+\\dA-Z]/g,\n\t\tpad = function( val, len ) {\n\t\t\tval = String( val );\n\t\t\tlen = len || 2;\n\t\t\twhile ( val.length < len ) {\n\t\t\t\tval = '0' + val;\n\t\t\t}\n\t\t\treturn val;\n\t\t};\n\n\t// Regexes and supporting functions are cached through closure\n\n\t/* jshint ignore:start */\n\treturn function( date, mask, utc ) {\n\t\tvar dF = dateFormat;\n\n\t\t// You can't provide utc if you skip other args (use the 'UTC:' mask prefix)\n\t\tif ( arguments.length === 1 && Object.prototype.toString.call( date ) === '[object String]' && !/\\d/.test( date ) ) {\n\t\t\tmask = date;\n\t\t\tdate = undefined;\n\t\t}\n\n\t\t// Passing date through Date applies Date.parse, if necessary\n\t\tdate = date ? new Date( date ) : new Date();\n\t\tif ( isNaN( date ) ) {\n\t\t\tthrow SyntaxError( 'invalid date' );\n\t\t}\n\n\t\tmask = String( dF.masks[mask] || mask || dF.masks['default'] );\n\n\t\t// Allow setting the utc argument via the mask\n\t\tif ( mask.slice( 0, 4 ) === 'UTC:' ) {\n\t\t\tmask = mask.slice( 4 );\n\t\t\tutc = true;\n\t\t}\n\n\t\tvar _ = utc ? 'getUTC' : 'get',\n\t\t\td = date[_ + 'Date'](),\n\t\t\tD = date[_ + 'Day'](),\n\t\t\tm = date[_ + 'Month'](),\n\t\t\ty = date[_ + 'FullYear'](),\n\t\t\tH = date[_ + 'Hours'](),\n\t\t\tM = date[_ + 'Minutes'](),\n\t\t\ts = date[_ + 'Seconds'](),\n\t\t\tL = date[_ + 'Milliseconds'](),\n\t\t\to = utc ? 0 : date.getTimezoneOffset(),\n\t\t\tflags = {\n\t\t\t\td: d,\n\t\t\t\tdd: pad( d ),\n\t\t\t\tddd: dF.i18n.dayNames[D],\n\t\t\t\tdddd: dF.i18n.dayNames[D + 7],\n\t\t\t\tm: m + 1,\n\t\t\t\tmm: pad( m + 1 ),\n\t\t\t\tmmm: dF.i18n.monthNames[m],\n\t\t\t\tmmmm: dF.i18n.monthNames[m + 12],\n\t\t\t\tyy: String( y ).slice( 2 ),\n\t\t\t\tyyyy: y,\n\t\t\t\th: H % 12 || 12,\n\t\t\t\thh: pad( H % 12 || 12 ),\n\t\t\t\tH: H,\n\t\t\t\tHH: pad( H ),\n\t\t\t\tM: M,\n\t\t\t\tMM: pad( M ),\n\t\t\t\ts: s,\n\t\t\t\tss: pad( s ),\n\t\t\t\tl: pad( L, 3 ),\n\t\t\t\tL: pad( L > 99 ? Math.round( L / 10 ) : L ),\n\t\t\t\tt: H < 12 ? 'a' : 'p',\n\t\t\t\ttt: H < 12 ? 'am' : 'pm',\n\t\t\t\tT: H < 12 ? 'A' : 'P',\n\t\t\t\tTT: H < 12 ? 'AM' : 'PM',\n\t\t\t\tZ: utc ? 'UTC' : ( String( date ).match( timezone ) || [''] ).pop().replace( timezoneClip, '' ),\n\t\t\t\to: ( o > 0 ? '-' : '+' ) + pad( Math.floor( Math.abs( o ) / 60 ) * 100 + Math.abs( o ) % 60, 4 ),\n\t\t\t\tS: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : ( d % 100 - d % 10 !== 10 ) * d % 10]\n\t\t\t};\n\n\t\treturn mask.replace( token, function( $0 ) {\n\t\t\treturn $0 in flags ? flags[$0] : $0.slice( 1, $0.length - 1 );\n\t\t} );\n\t};\n\t/* jshint ignore:end */\n}();\n\n// Some common format strings\ndateFormat.masks = {\n\t'default': 'ddd mmm dd yyyy HH:MM:ss',\n\tshortDate: 'm/d/yy',\n\tmediumDate: 'mmm d, yyyy',\n\tlongDate: 'mmmm d, yyyy',\n\tfullDate: 'dddd, mmmm d, yyyy',\n\tshortTime: 'h:MM TT',\n\tmediumTime: 'h:MM:ss TT',\n\tlongTime: 'h:MM:ss TT Z',\n\tisoDate: 'yyyy-mm-dd',\n\tisoTime: 'HH:MM:ss',\n\tisoDateTime: 'yyyy-mm-dd\\'T\\'HH:MM:ss',\n\tisoUtcDateTime: 'UTC:yyyy-mm-dd\\'T\\'HH:MM:ss\\'Z\\''\n};\n\n// Internationalization strings\ndateFormat.i18n = {\n\tdayNames: [\n\t\t'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',\n\t\t'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'\n\t],\n\tmonthNames: [\n\t\t'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',\n\t\t'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'\n\t]\n};\n\n// For convenience...\nDate.prototype.format = function( mask, utc ) {\n\t//JS Exception: Uncaught TypeError: Cannot read properties of undefined (reading 'date_format')\n\tif ( !Global.isSet( mask ) && LocalCacheData.getLoginUserPreference() ) {\n\t\tmask = LocalCacheData.getLoginUserPreference().date_format;\n\t}\n\n\tif ( !mask ) {\n\t\tmask = 'DD-MMM-YY';\n\t}\n\n\tvar format_str = moment( this ).format( mask );\n\n\treturn format_str;\n};\n\nwindow.RightClickMenuType = function() {\n\n};\n\nRightClickMenuType.LISTVIEW = '1';\nRightClickMenuType.EDITVIEW = '2';\nRightClickMenuType.NORESULTBOX = '3';\nRightClickMenuType.ABSENCE_GRID = '4';\nRightClickMenuType.VIEW_ICON = '5';\n\n/**\n * Decoding encoded html enitities (ie: \">\")\n * to avoid XSS vulnerabilities do not eval anything that has gone through this function\n *\n * @param str\n * @returns {*|jQuery}\n */\nGlobal.htmlDecode = function( str ) {\n\treturn $( '<textarea></textarea>' ).html( str ).text();\n};\n\nGlobal.htmlEncode = function( str ) {\n\tvar encodedStr = str;\n\n\tif ( encodedStr ) {\n\t\t// This replaces 'S' in 'MST' with the encoded value, which is invalid.\n\t\t// encodedStr = str.replace( /[\\u00A0-\\u9999<>\\'\"\\&]/gim, function( i ) {\n\t\t// \treturn '&#' + i.charCodeAt( 0 ) + ';';\n\t\t// } );\n\t\t// encodedStr = encodedStr.replace( /<br>/g, '<br>' );\n\t\t// return encodedStr;\n\n\t\tvar tmp = document.createElement( 'div' );\n\t\ttmp.textContent = encodedStr;\n\n\t\treturn tmp.innerHTML;\n\t} else {\n\t\treturn encodedStr;\n\t}\n};\n\n//Sort by module\n\nGlobal.m_sort_by = ( function() {\n\t// utility functions\n\n\tvar default_cmp = function( a, b ) {\n\n\t\t\tif ( a === b ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t//Speical handle OPEN option to make it always stay together\n\t\t\tif ( a === false || a === 'OPEN' ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tif ( b === false || b === 'OPEN' ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\treturn a < b ? -1 : 1;\n\t\t},\n\t\tgetCmpFunc = function( primer, reverse ) {\n\t\t\tvar cmp = default_cmp;\n\t\t\tif ( primer ) {\n\t\t\t\tcmp = function( a, b ) {\n\t\t\t\t\treturn default_cmp( primer( a ), primer( b ) );\n\t\t\t\t};\n\t\t\t}\n\t\t\tif ( reverse ) {\n\t\t\t\treturn function( a, b ) {\n\t\t\t\t\treturn -1 * cmp( a, b );\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn cmp;\n\t\t};\n\n\t// actual implementation\n\tvar sort_by = function( sort_by_array ) {\n\t\tvar fields = [],\n\t\t\tn_fields = sort_by_array.length,\n\t\t\tfield, name, reverse, cmp;\n\n\t\t// preprocess sorting options\n\t\tfor ( var i = 0; i < n_fields; i++ ) {\n\t\t\tfield = sort_by_array[i];\n\t\t\tif ( typeof field === 'string' ) {\n\t\t\t\tname = field;\n\t\t\t\tcmp = default_cmp;\n\t\t\t} else {\n\t\t\t\tname = field.name;\n\t\t\t\tcmp = getCmpFunc( field.primer, field.reverse );\n\t\t\t}\n\t\t\tfields.push( {\n\t\t\t\tname: name,\n\t\t\t\tcmp: cmp\n\t\t\t} );\n\t\t}\n\n\t\treturn function( A, B ) {\n\t\t\tvar a, b, name, cmp, result;\n\t\t\tfor ( var i = 0, l = n_fields; i < l; i++ ) {\n\t\t\t\tresult = 0;\n\t\t\t\tfield = fields[i];\n\t\t\t\tname = field.name;\n\t\t\t\tcmp = field.cmp;\n\n\t\t\t\tresult = cmp( A[name], B[name] );\n\t\t\t\tif ( result !== 0 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\t};\n\n\treturn sort_by;\n\n}() );\n\n$.fn.invisible = function() {\n\treturn this.each( function() {\n\t\t$( this ).css( 'opacity', '0' );\n\t} );\n};\n$.fn.visible = function() {\n\treturn this.each( function() {\n\t\t$( this ).css( 'opacity', '1' );\n\t} );\n};\n\nGlobal.trackView = function( name, action ) {\n\tif ( APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\tvar track_address;\n\n\t\t//Hostname is already sent separately, so this should just be the view/action in format:\n\t\t// '#!m=' + name + '&a=' + action\n\t\tif ( name ) {\n\t\t\ttrack_address = '#!m=' + name;\n\n\t\t\tif ( action ) {\n\t\t\t\ttrack_address += '&a=' + action;\n\t\t\t}\n\t\t} else {\n\t\t\t//Default to only data after (and including) the #.\n\t\t\ttrack_address = window.location.hash.substring( 1 );\n\t\t}\n\n\t\t//Track address is sent in sendAnalytics as the 3rd parameter.\n\t\tGlobal.sendAnalyticsPageview( track_address );\n\t}\n};\n\nGlobal.setAnalyticDimensions = function( user_name, company_name ) {\n\tif ( APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\tif ( typeof ( gtag ) !== 'undefined' ) {\n\t\t\ttry {\n\t\t\t\t//All names must be mapped in main.js 'custom_map'\n\t\t\t\tvar user_properties = {\n\t\t\t\t\t'application_version': APIGlobal.pre_login_data.application_version,\n\t\t\t\t\t'http_host': APIGlobal.pre_login_data.http_host,\n\t\t\t\t\t'product_edition_name': APIGlobal.pre_login_data.product_edition_name,\n\t\t\t\t\t'registration_key': APIGlobal.pre_login_data.registration_key,\n\t\t\t\t\t'primary_company_name': APIGlobal.pre_login_data.primary_company_name,\n\t\t\t\t};\n\n\t\t\t\tif ( user_name !== 'undefined' && user_name !== null ) {\n\t\t\t\t\tif ( APIGlobal.pre_login_data.production !== true ) {\n\t\t\t\t\t\tDebug.Text( 'Analytics User: ' + user_name, 'Global.js', '', 'doPing', 1 );\n\t\t\t\t\t}\n\t\t\t\t\tuser_properties.user_name = user_name;\n\t\t\t\t}\n\n\t\t\t\tif ( company_name !== 'undefined' && company_name !== null ) {\n\t\t\t\t\tif ( APIGlobal.pre_login_data.production !== true ) {\n\t\t\t\t\t\tDebug.Text( 'Analytics Company: ' + company_name, 'Global.js', '', 'setAnalyticDimensions', 1 );\n\t\t\t\t\t}\n\t\t\t\t\tuser_properties.company_name = company_name;\n\t\t\t\t}\n\n\t\t\t\tgtag( 'set', 'user_properties', user_properties );\n\t\t\t} catch ( e ) {\n\t\t\t\tthrow e; //Attempt to catch any errors thrown by Google Analytics.\n\t\t\t}\n\t\t}\n\t}\n};\n\nGlobal.sendAnalyticsPageview = function( track_address ) {\n\tif ( APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\t// Call this delay so view load goes first\n\t\tif ( typeof ( gtag ) !== 'undefined' ) {\n\t\t\tsetTimeout( function() {\n\t\t\t\ttry {\n\t\t\t\t\tgtag( 'event', 'page_view', { page_path: track_address } )\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\t\t\t}, 500 );\n\t\t}\n\n\t}\n};\n\n/**\n * This function is used to actually submit the analytics request to google.\n * @param {string} event_category - Category relating to the event tracked, e.g. feedback or context_menu\n * @param {string} event_action - What triggered the event. E.g. click, cancel.\n * @param {string} event_label - This is often a combo of the actual value string combined with some of the above fields, for clarity. e.g. submit:feedback:sad\n */\nGlobal.sendAnalyticsEvent = function( event_category, event_action, event_label ) {\n\tif ( typeof ( gtag ) !== 'undefined' && APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\t//Debug.Arr( fieldsObject, 'Sending analytics event payload. Event: ' + event_category + ', Action: ' + event_action + ', Label: ' + event_label, 'Global.js', 'Global', 'sendAnalyticsEvent', 11 );\n\t\ttry {\n\t\t\tgtag( 'event', event_category, { action: event_action, label: event_label } )\n\t\t} catch ( e ) {\n\t\t\tthrow e;\n\t\t}\n\t}\n};\n\n/**\n *\n * @param context_btn - the jQuery element that triggered the click event on the context menu\n * @param {string} menu_name - the name of the icon if the click event was triggered by the right click context menu\n */\nGlobal.triggerAnalyticsContextMenuClick = function( context_btn, menu_name ) {\n\t// If more detail is needed above and beyond contextmenu name, then use 'LocalCacheData.current_open_view_id' in addition, but not instead of, as they are different.\n\tvar dom_context_menu = LocalCacheData.currentShownContextMenuName || 'error-with-context-menu'; // '||' is for graceful fail. identify correct context menu (vs DOM search, where there could be multiple inactive context menus)\n\tvar dom_context_menu_group;\n\tvar button_id;\n\tvar event_category;\n\tvar event_action;\n\tvar event_label;\n\n\tif ( context_btn ) {\n\t\tif ( context_btn.group && context_btn.group.label ) {\n\t\t\tdom_context_menu_group = context_btn.group.label;\n\t\t} else {\n\t\t\tdom_context_menu_group = context_btn.action_group;\n\t\t}\n\t\tevent_category = 'navigation:context_menu';\n\t\tbutton_id = context_btn.id || 'error-with-icon';\n\t} else {\n\t\t// If context_btn is null, then this is likely a right click context menu call.\n\t\tevent_category = 'navigation:right_click_menu';\n\t\tdom_context_menu_group = 'right_click';\n\t\tbutton_id = menu_name || 'error-with-rightclick-icon';\n\t}\n\n\t// Beautify output\n\tdom_context_menu = dom_context_menu.replace( 'ContextMenu', '' );\n\tbutton_id = button_id.replace( 'Icon', '' ); //Remove \"icon\" from button_id.\n\n\tevent_action = 'click';\n\tevent_label = dom_context_menu + ':' + dom_context_menu_group + '|' + button_id;\n\n\t// Debug.Text( 'Context Menu: Category: navigation_context_menu Action: ' + event_action + ' Label: ' + event_label, 'Global.js', 'Global', 'triggerAnalyticsContextMenuClick', 10 );\n\tGlobal.sendAnalyticsEvent( event_category, event_action, event_label );\n};\n\n/**\n *\n * @param {string} context - Explains what element triggered the event\n * @param {string} view_id - Name of the current view in which element was triggered\n */\nGlobal.triggerAnalyticsEditViewNavigation = function( context, view_id ) {\n\t// context in this case can be 'left-arrow', 'right-arrow', or 'awesomebox'\n\tvar event_action = 'click';\n\tvar event_label = view_id + ':' + context;\n\n\t// Debug.Text( 'Context Menu: Category: navigation_edit_view_navigation Action: ' + event_action + ' Label: ' + event_label, 'Global.js', 'Global', 'triggerAnalyticsContextMenuClick', 10 );\n\tGlobal.sendAnalyticsEvent( 'navigation:edit_view_navigation', event_action, event_label );\n};\n\n/**\n *\n * @param event - the event object from the jQuery UI tabs. Currently expecting it to be triggered by the activate event\n * @param ui - the ui object from jQuery UI tabs, contains prev and target tab info\n */\nGlobal.triggerAnalyticsTabs = function( event, ui ) {\n\t// activate event triggered, ensure all required values are set\n\tif ( event && event.type && ui && ui.newTab ) {\n\t\tvar tab_target = ui.newTab.find( '.ui-tabs-anchor' ).attr( 'ref' ) || 'tab-target-error'; // '||' is for gracful fail\n\t\tvar viewId = LocalCacheData.current_open_view_id || 'error-viewid'; // '||' is for graceful fail\n\n\t\t// Beautify output\n\t\ttab_target = tab_target.replace( 'tab_', '' );\n\n\t\tvar event_action = 'click';\n\t\tvar event_label = viewId + ':tabs:' + tab_target;\n\n\t\t// Debug.Text( 'Context Menu: Category: navigation_tabs Action: ' + event_action + ' Label: ' + event_label, 'Global.js', 'Global', 'triggerAnalyticsContextMenuClick', 10 );\n\t\tGlobal.sendAnalyticsEvent( 'navigation:tabs', event_action, event_label );\n\t} else {\n\t\tGlobal.sendAnalyticsEvent( 'error:navigation:tabs', 'error-tabs', 'error' ); // Should never be triggered. If this appears in analytics results, investigate.\n\t}\n};\n\n/**\n *\n * @param {string} context - the label of the object involved in the event. E.g. close button for click event\n * @param {string} action - the action type of the event. E.g. click.\n * @param {string} view_id - the viewId in which the event occurred. E.g. TimeSheet.\n */\nGlobal.triggerAnalyticsNavigationOther = function( context, action, view_id ) {\n\tvar event_action = action;\n\tvar event_label = view_id + ':' + context;\n\n\t// Debug.Text( 'Context Menu: Category: navigation_other Action: ' + event_action + ' Label: ' + event_label, 'Global.js', 'Global', 'triggerAnalyticsContextMenuClick', 10 );\n\tGlobal.sendAnalyticsEvent( 'navigation:other', event_action, event_label );\n};\n\nGlobal.getSessionIDKey = function() {\n\tif ( LocalCacheData.getAllURLArgs() ) {\n\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'company_id' ) ) {\n\t\t\treturn 'SessionID-JA';\n\t\t}\n\t}\n\treturn 'SessionID';\n};\n\nGlobal.loadStyleSheet = function( path, fn, scope ) {\n\tvar head = document.getElementsByTagName( 'head' )[0], // reference to document.head for appending/ removing link nodes\n\t\tlink = document.createElement( 'link' ); // create the link node\n\tlink.setAttribute( 'href', path );\n\tlink.setAttribute( 'rel', 'stylesheet' );\n\tlink.setAttribute( 'type', 'text/css' );\n\tvar sheet, cssRules;\n\t// get the correct properties to check for depending on the browser\n\tif ( 'sheet' in link ) {\n\t\tsheet = 'sheet';\n\t\tcssRules = 'cssRules';\n\t} else {\n\t\tsheet = 'styleSheet';\n\t\tcssRules = 'rules';\n\t}\n\tvar interval_id = setInterval( function() { // start checking whether the style sheet has successfully loaded\n\t\t\ttry {\n\t\t\t\tif ( link[sheet] && link[sheet][cssRules].length ) { // SUCCESS! our style sheet has loaded\n\t\t\t\t\tclearInterval( interval_id ); // clear the counters\n\t\t\t\t\tclearTimeout( timeout_id );\n\t\t\t\t\tif ( typeof fn == 'function' ) {\n\t\t\t\t\t\tfn.call( scope || window, true, link ); // fire the callback with success == true\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch ( e ) {\n\t\t\t} finally {\n\t\t\t}\n\t\t}, 10 ), // how often to check if the stylesheet is loaded\n\t\ttimeout_id = setTimeout( function() { // start counting down till fail\n\t\t\tclearInterval( timeout_id ); // clear the counters\n\t\t\tclearTimeout( timeout_id );\n\t\t\thead.removeChild( link ); // since the style sheet didn't load, remove the link node from the DOM\n\t\t\tif ( typeof fn == 'function' ) {\n\t\t\t\tfn.call( scope || window, false, link ); // fire the callback with success == false\n\t\t\t}\n\t\t}, 15000 ); // how long to wait before failing\n\thead.appendChild( link ); // insert the link node into the DOM and start loading the style sheet\n\treturn link; // return the link node;\n};\n\nGlobal.getSessionIDKey = function() {\n\tif ( LocalCacheData.getAllURLArgs() ) {\n\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'company_id' ) ) {\n\t\t\treturn 'SessionID-JA';\n\t\t}\n\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'punch_user_id' ) ) {\n\t\t\treturn 'SessionID-QP';\n\t\t}\n\t}\n\treturn 'SessionID';\n};\n\n//don't let the user leave without clicking OK.\n//uses localcachedata so that it will work in the ribbon\nGlobal.checkBeforeExit = function( functionToExecute ) {\n\tvar alert_message = Global.modify_alert_message;\n\tif ( LocalCacheData.current_open_edit_only_controller && LocalCacheData.current_open_edit_only_controller.confirm_on_exit && LocalCacheData.current_open_edit_only_controller.is_changed === false ) {\n\t\talert_message = Global.confirm_on_exit_message;\n\t}\n\n\tTAlertManager.showConfirmAlert( alert_message, null, function( clicked_yes ) {\n\t\tif ( clicked_yes === true ) {\n\t\t\tfunctionToExecute( clicked_yes );\n\t\t}\n\t} );\n};\n\nGlobal.detectMobileBrowser = function() {\n\treturn /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test( navigator.userAgent );\n};\n\nGlobal.getBrowserVendor = function() {\n\treturn APIGlobal.pre_login_data.user_agent_data.browser;\n};\n/**\n * Allowing deep linking\n * @type {boolean}\n */\nGlobal.deeplink = false;\n\nGlobal.getDeepLink = function() {\n\treturn Global.deeplink;\n};\n\n/**\n * Retrieves the deeplink from the current url.\n */\nGlobal.setDeepLink = function() {\n\tvar newDeepLink = window.location.href.split( '#!m=' )[1];\n\n\t//Because we add step to browser during login now so that the browser back button works, we need to check for that or login can fail leaving the user stuck.\n\tif ( newDeepLink == 'Login' || ( newDeepLink && newDeepLink.startsWith( 'Login&' ) == true ) ) { //We are not just checking startsWith because potential other views start with \"Login\" in the future\n\t\tvar alternate_session_data = getCookie( 'AlternateSessionData' );\n\t\tif ( alternate_session_data ) {\n\t\t\ttry { //Prevent JS exception if we can't parse alternate_session_data for some reason.\n\t\t\t\talternate_session_data = JSON.parse( alternate_session_data );\n\t\t\t\tif ( alternate_session_data && alternate_session_data.previous_session_view ) {\n\t\t\t\t\tGlobal.deeplink = alternate_session_data.previous_session_view;\n\t\t\t\t}\n\t\t\t} catch ( e ) {\n\t\t\t\tDebug.Text( e.message, 'Global.js', 'Global', 'setDeepLink', 10 );\n\t\t\t}\n\t\t}\n\t} else if ( newDeepLink != undefined ) {\n\t\tGlobal.deeplink = newDeepLink;\n\t}\n};\n\n/**\n sorts items for the ribbon menu\n **/\nGlobal.compareMenuItems = function( a, b ) {\n\tif ( a.attributes.sort_order == undefined ) {\n\t\ta.attributes.sort_order = 1000;\n\t}\n\tif ( b.attributes.sort_order == undefined ) {\n\t\tb.attributes.sort_order = 1000;\n\t}\n\n\tif ( a.attributes.sort_order < b.attributes.sort_order ) {\n\t\treturn -1;\n\t}\n\n\tif ( a.attributes.sort_order > b.attributes.sort_order ) {\n\t\treturn 1;\n\t}\n\n\tif ( a.attributes.sort_order == b.attributes.sort_order ) {\n\t\tif ( a.attributes.add_order < b.attributes.add_order ) {\n\t\t\treturn -1;\n\t\t}\n\t\tif ( a.attributes.add_order > b.attributes.add_order ) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\n\treturn 0;\n};\n\nGlobal.getDaysInSpan = function( start_date, end_date, sun, mon, tue, wed, thu, fri, sat ) {\n\tvar start_date_obj = Global.strToDate( start_date );\n\tvar end_date_obj = Global.strToDate( end_date );\n\n\tif ( start_date_obj == null ) {\n\t\treturn 0;\n\t}\n\n\tif ( end_date_obj == null ) {\n\t\treturn 0;\n\t}\n\n\tvar days = Math.round( Math.abs( ( start_date_obj.getTime() - end_date_obj.getTime() ) / ( 86400 * 1000 ) ) ) + 1;\n\n\t//Need to loop over the whole range to ensure proper counting of effective days on ranges that span multiple weeks.\n\twhile ( start_date_obj <= end_date_obj ) {\n\t\tswitch ( start_date_obj.getDay() ) {\n\t\t\tcase 0:\n\t\t\t\tif ( !sun ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tif ( !mon ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif ( !tue ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif ( !wed ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tif ( !thu ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tif ( !fri ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tif ( !sat ) {\n\t\t\t\t\tdays -= 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tstart_date_obj.setDate( start_date_obj.getDate() + 1 ); //Increment to next day and continue the loop.\n\t}\n\n\treturn days;\n};\n\n/**\n * Sets the language cookie to root cookie url\n * @param lang\n */\nGlobal.setLanguageCookie = function( lang ) {\n\tsetCookie( 'language', lang, 10000, APIGlobal.pre_login_data.cookie_base_url );\n};\n\n/**\n * Removes cookies from all paths. Put in specifically to move the language cookies to root.\n * @param name\n */\nGlobal.eraseCookieFromAllPaths = function( name ) {\n\tvar value = getCookie( name );\n\n\t// This function will attempt to remove a cookie from all paths\n\tvar path_bits = location.pathname.split( '/' );\n\tvar path_current = ' path=';\n\n\t// Do a simple pathless delete first\n\tdocument.cookie = name + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT;';\n\tfor ( var i = 0; i < path_bits.length; i++ ) {\n\t\tpath_current += ( ( path_current.substr( -1 ) != '/' ) ? '/' : '' ) + path_bits[i];\n\t\tDebug.Text( '---' + i + '. Deleting cookie: ' + name + ' with value: ' + value + ' and path: ' + path_current, 'Global.js', 'Global', 'eraseCookieFromAllPaths', 10 );\n\t\tdocument.cookie = name + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ' + path_current + '/;';\n\t\tdocument.cookie = name + '=; expires=Thu, 01-Jan-1970 00:00:01 GMT; ' + path_current + ';';\n\t}\n\n\tDebug.Text( 'Deleting cookie: ' + name + ' with value:' + value + ' and path:' + path_current, 'Global.js', 'Global', 'eraseCookieFromAllPaths', 10 );\n\treturn value;\n};\n\n/**\n * Moves specific app cookies from all over to the root cookie path so that they will be accessible from everywhere\n */\nGlobal.moveCookiesToNewPath = function() {\n\tDebug.Arr( document.cookie, 'COOKIE BEFORE CONTENT: ', 'Global.js', 'Global', 'moveCookiesToNewPath', 10 );\n\tvar cookies = ['language', 'StationID', 'SessionID'];\n\tvar year = new Date().getFullYear();\n\tfor ( var i = 0; i < cookies.length; i++ ) {\n\t\tvar val = Global.eraseCookieFromAllPaths( cookies[i] );\n\t\tif ( val && val.length > 0 ) {\n\t\t\tDebug.Text( 'Setting cookie:' + cookies[i] + ' with value:' + val + ' and path:' + APIGlobal.pre_login_data.cookie_base_url, 'Global.js', 'Global', 'moveCookiesToNewPath', 10 );\n\t\t\tdocument.cookie = cookies[i] + '=' + val + '; expires=Thu, 01-Jan-' + ( year + 10 ) + ' 00:00:01 GMT; path=' + APIGlobal.pre_login_data.cookie_base_url + ';';\n\t\t} else {\n\t\t\tDebug.Text( 'NOT Setting cookie:' + cookies[i] + ' with value:' + val + ' and path:' + APIGlobal.pre_login_data.cookie_base_url, 'Global.js', 'Global', 'moveCookiesToNewPath', 10 );\n\t\t}\n\t}\n\tDebug.Arr( document.cookie, 'COOKIE AFTER CONTENT: ', 'Global.js', 'Global', 'moveCookiesToNewPath', 10 );\n};\n\nGlobal.clearSessionCookie = function() {\n\tGlobal.moveCookiesToNewPath();\n\tdeleteCookie( Global.getSessionIDKey() );\n};\nGlobal.array_unique = function( arr ) {\n\tif ( Global.isArray( arr ) == false ) {\n\t\treturn arr;\n\t}\n\tvar clean_arr = [];\n\tfor ( var n in arr ) {\n\t\tif ( clean_arr.indexOf( arr[n] ) == -1 ) {\n\t\t\tclean_arr.push( arr[n] );\n\t\t}\n\t}\n\treturn clean_arr;\n};\n\n//Returns property keys that have different values or that don't exist. Similar to PHP's array_diff_assoc() function.\nGlobal.ArrayDiffAssoc = function( arr1 ) {\n\tconst retarr = {};\n\tconst argl = arguments.length;\n\tlet k1 = '';\n\tlet i = 1;\n\tlet k = '';\n\tlet arr = {};\n\n\tarr1_keys: for ( k1 in arr1 ) {\n\t\tfor ( i = 1; i < argl; i++ ) {\n\t\t\tarr = arguments[i];\n\n\t\t\tfor ( k in arr ) {\n\t\t\t\tif ( arr[k] === arr1[k1] && k === k1 ) {\n\t\t\t\t\t// If it reaches here, it was found in at least one array, so try next value\n\t\t\t\t\tcontinue arr1_keys;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tretarr[k1] = arr1[k1];\n\t\t}\n\t}\n\n\treturn retarr;\n};\n\n//Special rounding function that handles values like 1.005 or 1.0049999999999999 properly, see: http://stackoverflow.com/questions/11832914/round-to-at-most-2-decimal-places\nGlobal.MoneyRound = function( number, decimals ) {\n\tif ( isNaN( number ) ) {\n\t\tnumber = 0;\n\t}\n\n\tif ( !decimals ) {\n\t\tdecimals = 2;\n\t}\n\n\t//#2294 - We must round the absolute value or negative numbers will round toward zero.\n\tvar negative = false;\n\tif ( number < 0 ) {\n\t\tnegative = true;\n\t}\n\tnumber = Math.abs( number );\n\n\tvar retval = +( Math.round( number + 'e+' + decimals ) + 'e-' + decimals );\n\n\tif ( negative ) {\n\t\tretval = retval * -1;\n\t}\n\n\treturn retval.toFixed( decimals );\n};\n\nGlobal.getUIReadyStatus = function() {\n\treturn Global.UIReadyStatus;\n};\nGlobal.setUINotready = function() {\n\tGlobal.UIReadyStatus = 0;\n\tDebug.Text( 'Global ready status changed: 0', 'Global.js', 'Global', 'setUIReadyStatus', 10 );\n};\nGlobal.setUIReady = function() {\n\t//need to check the document isn't already complete and ready for a screenshot.'\n\tif ( Global.UIReadyStatus == 0 ) {\n\t\tGlobal.UIReadyStatus = 1;\n\t\tDebug.Text( 'Global ready status changed: 1', 'Global.js', 'Global', 'setUIReady', 10 );\n\t}\n};\nGlobal.setUIInitComplete = function() {\n\tGlobal.UIReadyStatus = 2;\n\tDebug.Text( 'Global ready status changed: 2', 'Global.js', 'Global', 'setUIReadyStatus', 10 );\n};\n\nGlobal.setUnitTestMode = function() {\n\tGlobal.UNIT_TEST_MODE = true;\n\t$( 'body' ).addClass( 'UNIT_TEST_MODE' );\n\tDebug.setEnable( true );\n\tDebug.setVerbosity( 11 );\n};\n\nGlobal.convertValidationErrorToString = function( object ) {\n\t//Debug.Arr(object,'Converting Error to String: ','Global.js', 'Global', 'convertValidationErrorToString', 10);\n\tvar retval = '';\n\n\t// #2288 - If you are deleting several records and records 2 and 4 contain errors, those are the object keys that will need to be referenced here.\n\t// To fix this we need to grab the first element independent of the index number.\n\tif ( Object.keys( object ).length > 0 ) {\n\t\tfor ( var first in object ) {\n\t\t\tobject = object[first];\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar error_strings = [];\n\tif ( typeof object == 'string' ) {\n\t\t//#2290 - error objects are not always uniform and can sometimes cause malformed error tips (see screenshot) if we do not check each level for string type\n\t\terror_strings.push( object );\n\t} else {\n\t\tfor ( var index in object ) {\n\t\t\tif ( typeof object[index] == 'string' ) {\n\t\t\t\terror_strings.push( object[index] );\n\t\t\t} else {\n\t\t\t\tfor ( var key in object[index] ) {\n\t\t\t\t\tif ( typeof ( object[index][key] ) == 'string' ) {\n\t\t\t\t\t\terror_strings.push( object[index][key] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor ( var i in object[index][key] ) {\n\t\t\t\t\t\t\terror_strings.push( object[index][key][i] );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( error_strings.length > 1 ) {\n\t\tvar error_count = 1;\n\t\tfor ( var index in error_strings ) {\n\t\t\tretval += error_count + '. ' + error_strings[index] + '.<br>';\n\t\t\terror_count++;\n\t\t}\n\t} else if ( typeof error_strings[0] == 'string' ) {\n\t\tretval = error_strings[0] + '.';\n\t}\n\n\treturn retval;\n};\n\nGlobal.APIFileDownload = function( class_name, method, post_data, url ) {\n\tif ( url == undefined ) {\n\t\turl = _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.getAPIURL */ .n.getAPIURL( 'Class=' + class_name + '&Method=' + method );\n\t}\n\n\tvar message_id = _global_TTUUID__WEBPACK_IMPORTED_MODULE_0__/* .TTUUID.generateUUID */ .d.generateUUID();\n\turl = url + '&MessageID=' + message_id;\n\n\tvar tempForm = $( '<form></form>' );\n\ttempForm.attr( 'id', 'temp_form' );\n\ttempForm.attr( 'method', 'POST' );\n\ttempForm.attr( 'action', url );\n\n\ttempForm.attr( 'target', is_browser_iOS ? '_blank' : 'hideReportIFrame' ); //hideReportIFrame\n\n\ttempForm.append( $( '<input type=\\'hidden\\' name=\\'X-Client-ID\\' value=\\'Browser-TimeTrex\\'>' ) );\n\ttempForm.append( $( '<input type=\\'hidden\\' name=\\'X-CSRF-Token\\' value=\\'' + getCookie( 'CSRF-Token' ) + '\\'>' ) );\n\n\ttempForm.css( 'display', 'none' );\n\tif ( post_data ) {\n\t\tvar hideInput = $( '<input type=\\'hidden\\' name=\\'json\\'>' );\n\t\thideInput.val( JSON.stringify( post_data ) );\n\t\ttempForm.append( hideInput );\n\t}\n\ttempForm.appendTo( 'body' );\n\ttempForm.css( 'display', 'none' );\n\ttempForm.submit();\n\ttempForm.remove();\n\n\tif ( !is_browser_iOS ) {\n\t\tProgressBar.showProgressBar( message_id, true );\n\t}\n};\n\nGlobal.JSFileDownload = function( file_name, content, mime_type ) {\n\tvar a = document.createElement( 'a' );\n\tmime_type = mime_type || 'application/octet-stream';\n\n\tif ( URL && 'download' in a ) { //html5 A[download]\n\t\ta.href = URL.createObjectURL( new Blob( [content], {\n\t\t\ttype: mime_type\n\t\t} ) );\n\t\ta.setAttribute( 'download', file_name );\n\t\tdocument.body.appendChild( a );\n\t\ta.click();\n\t\tdocument.body.removeChild( a );\n\t} else {\n\t\tlocation.href = 'data:application/octet-stream,' + encodeURIComponent( content ); // only this mime type is supported\n\t}\n};\n\n//Get a refreshed CSRF token cookie in case it expires prior to the user clicking the login button. This helps avoid showing an error message and triggering a full browser refresh.\nGlobal.refreshCSRFToken = function( callback ) {\n\tif ( getCookie( 'CSRF-Token' ) == '' ) {\n\t\tDebug.Text( 'CSRF Token cookie does not exist, refreshing...', 'Global.js', '', 'refreshCSRFToken', 10 );\n\t\tthis.authentication_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\t\tthis.authentication_api.sendCSRFTokenCookie( {\n\t\t\t\tonResult: function( e ) {\n\t\t\t\t\tDebug.Text( 'CSRF Refresh success!...', null, null, 'refreshCSRFToken', 10 );\n\t\t\t\t\tcallback();\n\t\t\t\t},\n\t\t\t\tonError: function( e ) {\n\t\t\t\t\tDebug.Text( 'CSRF Refresh Error...', null, null, 'refreshCSRFToken', 10 );\n\t\t\t\t\tcallback();\n\t\t\t\t},\n\t\t\t});\n\t} else {\n\t\tcallback();\n\t}\n\n\treturn true;\n};\n\nGlobal.refreshPermissions = function() {\n\tthis.authentication_api = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIPermission */ .y.APIPermission;\n\tthis.authentication_api.getPermissions( {\n\t\tonResult: function( response ) {\n\t\t\tlet result = response.getResult();\n\t\t\tif ( result !== false ) {\n\t\t\t\tLocalCacheData.setPermissionData( result );\n\t\t\t\tDebug.Text( 'Permissions Refreshed!', 'Global.js', null, 'refreshPermissions', 10 );\n\t\t\t}\n\t\t},\n\t});\n};\n\nGlobal.setStationID = function( val ) {\n\tsetCookie( 'StationID', val, 10000 );\n};\n\nGlobal.getStationID = function() {\n\tvar retval = getCookie( 'StationID' );\n\n\t//Check to see if there is a \"sticky\" user agent based Station ID defined.\n\tif ( navigator.userAgent.indexOf( 'StationID:' ) != -1 ) {\n\t\tvar regex = /StationID:\\s?([a-zA-Z0-9]{30,64})/i;\n\t\tvar matches = regex.exec( navigator.userAgent );\n\t\tif ( matches[1] ) {\n\t\t\tDebug.Text( 'Found StationID in user agent, forcing to that instead!', 'Global.js', '', 'getStationID', 11 );\n\t\t\tretval = matches[1];\n\t\t}\n\t}\n\n\treturn retval;\n};\n\n//#2342 - Close all open edit views from one place.\nGlobal.closeEditViews = function( callback ) {\n\t//Don't check the .is_changed flag, as that will prevent edit views from being closed if no data has been changed.\n\t// For example if you go to MyAccount -> Request Authorization, View any request, click the \"TimeSheet\" icon, then click the Request timesheet cell (just below the punches) to navigate back to the requests.\n\tif ( LocalCacheData.current_open_report_controller ) { //&& LocalCacheData.current_open_report_controller.is_changed == true ) {\n\t\tLocalCacheData.current_open_report_controller.onCancelClick( null, null, function() {\n\t\t\tGlobal.closeEditViews( callback );\n\t\t} );\n\t} else if ( LocalCacheData.current_open_edit_only_controller ) { //&& LocalCacheData.current_open_edit_only_controller.is_changed == true ) {\n\t\tLocalCacheData.current_open_edit_only_controller.onCancelClick( null, null, function() {\n\t\t\tGlobal.closeEditViews( callback );\n\t\t} );\n\t} else if ( LocalCacheData.current_open_sub_controller && LocalCacheData.current_open_sub_controller.edit_view ) { //&& LocalCacheData.current_open_sub_controller.is_changed == true ) {\n\t\tLocalCacheData.current_open_sub_controller.onCancelClick( null, null, function() {\n\t\t\tGlobal.closeEditViews( callback );\n\t\t} );\n\t} else if ( LocalCacheData.current_open_primary_controller && LocalCacheData.current_open_primary_controller.edit_view ) { //&& LocalCacheData.current_open_primary_controller.is_changed == true ) {\n\t\tLocalCacheData.current_open_primary_controller.onCancelClick( null, null, function() {\n\t\t\tGlobal.closeEditViews( callback );\n\t\t} );\n\t} else if ( LocalCacheData.current_open_primary_controller &&\n\t\tLocalCacheData.current_open_primary_controller.viewId === 'TimeSheet' &&\n\t\tLocalCacheData.current_open_primary_controller.getPunchMode() === 'manual' ) {\n\t\tLocalCacheData.current_open_primary_controller.doNextIfNoValueChangeInManualGrid( function() {\n\t\t\t//#2567 Must conclude here. Recursion would be infinite\n\t\t\tif ( callback ) {\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} );\n\t} else {\n\t\tif ( callback ) {\n\t\t\tcallback();\n\t\t}\n\t}\n};\n\n//#2351 - red border for sandbox mode\nGlobal.styleSandbox = function() {\n\tif ( APIGlobal.pre_login_data['sandbox'] && APIGlobal.pre_login_data['sandbox'] == true ) {\n\t\t$( 'body' ).addClass( 'sandbox_container' );\n\t}\n};\n\n//#2351 - Used for logging in as employee/client or switching to sandbox mode.\nGlobal.NewSession = function( user_id, client_id ) {\n\tvar api_auth = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\tapi_auth.newSession( user_id, client_id, {\n\t\tonResult: function( result ) {\n\t\t\tif ( !result.isValid() ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data && result_data.url ) {\n\t\t\t\tvar url = result_data.url;\n\t\t\t\tif ( url.indexOf( 'http' ) === -1 ) {\n\t\t\t\t\turl = window.location.protocol + '//' + url;\n\t\t\t\t}\n\n\t\t\t\tvar alternate_session_data = {\n\t\t\t\t\tnew_session_id: result_data.session_id,\n\t\t\t\t\tprevious_session_id: getCookie( Global.getSessionIDKey() ),\n\t\t\t\t\tprevious_session_url: Global.getBaseURL(),\n\t\t\t\t\tprevious_session_view: window.location.href.split( '#!m=' )[1],\n\t\t\t\t\tprevious_cookie_path: LocalCacheData.cookie_path\n\t\t\t\t};\n\n\t\t\t\tsetCookie( 'AlternateSessionData', JSON.stringify( alternate_session_data ), 1, result_data.cookie_base_url, Global.getHost() );\n\n\t\t\t\tGlobal.setURLToBrowser( url + 'html5/#!m=Login' );\n\t\t\t\tGlobal.needReloadBrowser = true;\n\t\t\t} else {\n\t\t\t\tTAlertManager.showAlert( $.i18n._( 'ERROR: Unable to perform action, please contact your %s administrator immediately.', LocalCacheData.getApplicationName() ), $.i18n._( 'ERROR' ) );\n\t\t\t}\n\t\t}\n\t} );\n\n};\n\nGlobal.isNumeric = function( value ) {\n\tvar retval = false;\n\n\tvalue = parseFloat( value );\n\tif ( typeof value == 'number' && !isNaN( value ) ) {\n\t\tretval = true;\n\t}\n\n\treturn retval;\n};\n\n//Calculates a \"smart\" debounce time based on the network ping time.\n//Debounce on at least 1.5x the round-trip ping time. ( 333 * 1.5 = 500ms. )\n//Because a user on a really slow connection could click Save 1s apart and the packets could arrive close to each other and cause duplicate request errors still.\nGlobal.calcDebounceWaitTimeBasedOnNetwork = function( min_time = null, max_time = null ) {\n\tvar ping = Global.current_ping;\n\n\tif ( !min_time ) {\n\t\tvar min_time = 500; //Turns into 500ms after 1.5x\n\t}\n\n\tif ( !max_time ) {\n\t\tvar max_time = 10000; //Turns into 10s after 1.5x\n\t}\n\n\tvar retval = ( ping * 1.5 );\n\n\tif ( retval < min_time ) {\n\t\tretval = min_time;\n\t}\n\n\tif ( retval > max_time ) {\n\t\tretval = max_time;\n\t}\n\n\treturn retval;\n}\n\n// Returns a function, that, as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds.\n// If `immediate` is passed, trigger the function on the leading edge, instead of the trailing.\nGlobal.debounce = function( callback, wait, immediate ) {\n\tvar timeout;\n\n\treturn function() {\n\t\tvar context = this;\n\t\tvar args = arguments;\n\n\t\tvar callback_name = ( callback.name ) ? callback.name : 'N/A';\n\n\t\tvar later = function() {\n\t\t\ttimeout = null;\n\t\t\tif ( !immediate ) {\n\t\t\t\tDebug.Text( 'Calling after debounce wait: ' + callback_name + ' Wait Time: ' + wait, 'Global.js', 'Global', 'debounce', 10 );\n\t\t\t\tcallback.apply( context, args );\n\t\t\t} else {\n\t\t\t\tDebug.Text( 'Skipping due to debounce: ' + callback_name + ' Wait Time: ' + wait, 'Global.js', 'Global', 'debounce', 11 );\n\t\t\t}\n\t\t};\n\n\t\tvar call_now = immediate && !timeout;\n\n\t\tclearTimeout( timeout );\n\n\t\ttimeout = setTimeout( later, wait );\n\n\t\tif ( call_now ) {\n\t\t\tDebug.Text( 'Calling immediate debounce: ' + callback_name + ' Wait Time: ' + wait, 'Global.js', 'Global', 'debounce', 10 );\n\t\t\tcallback.apply( context, args );\n\t\t} else {\n\t\t\tDebug.Text( 'Skipping due to debounce: ' + callback_name + ' Wait Time: ' + wait, 'Global.js', 'Global', 'debounce', 11 );\n\t\t}\n\t};\n};\n\n/**\n * Filter output to prevent the user from seeing strings such as undefined, false or null.\n * @param {string} entry the string that needs to be sanitized.\n * @param {Array} [filters] optional array of filters. If none is supplied, defaults will be used.\n * @returns {string} returns the sanitized string result\n */\nGlobal.filterOutput = function( entry, filters ) {\n\t// default filters can be overridden by passing in a second param\n\n\tif ( !filters ) {\n\t\tfilters = [false, undefined, null, 'false', 'undefined', 'null'];\n\t}\n\n\t// if filter matches, replace contents with empty string\n\tif ( ( filters.indexOf( entry ) !== -1 ) ) {\n\t\treturn '';\n\t} else {\n\t\treturn entry;\n\t}\n};\n\n/**\n * groupArrayDataByKey - This function is used to group data by object key - used (so far) for the geofence filters\n * @param {Object[]} data - the array dataset\n * @param {boolean} [makeUnique] - true will only output one occurance per key. false or ommiting will return all occurances\n * @returns {*}\n */\nGlobal.groupArrayDataByKey = function( data, makeUnique ) {\n\n\treturn data.reduce( function( accumulator, currentValue ) {\n\t\t// get a list of all object keys for data object, then iterate through each\n\t\tObject.entries( currentValue ).forEach( function( key ) {\n\t\t\taccumulator[key[0]] = accumulator[key[0]] || [];\n\n\t\t\t// check if value exists or add anyway if makeUnique is false\n\t\t\tif ( accumulator[key[0]].indexOf( key[1] ) === -1 || !makeUnique ) {\n\t\t\t\taccumulator[key[0]].push( key[1] );\n\t\t\t}\n\t\t} );\n\t\treturn accumulator;\n\t}, {} );\n};\n\n/**\n * Used to modify the viewport meta tag in the index.php head section. This controls the 'virtual' device viewport on mobile devices.\n * More info: https://developers.google.com/web/updates/2015/01/What-the-Viewport\n * @param {string} setting - name of pre-defined viewport setting\n * @returns {string} returns the new content value for the viewport meta tag\n * @example A use case is Setting mobile view on login, then back to desktop (990px virtual) after login, to allow pan & zoom, as not whole app is mobile optimized.\n */\nGlobal.setVirtualDeviceViewport = function( setting ) {\n\tvar width;\n\tvar scale;\n\tvar meta_tag_viewport = $( 'meta[name=viewport]' );\n\n\tif ( !setting || !meta_tag_viewport || meta_tag_viewport.length !== 1 ) {\n\t\tDebug.Text( 'Error: Missing params in function call', 'Global.js', 'Global', 'setVirtualDeviceViewport', 1 );\n\t\treturn undefined;\n\t}\n\tif ( setting === 'mobile' ) {\n\t\twidth = 'device-width';\n\t\tscale = 1;\n\t} else if ( setting === 'desktop' ) {\n\t\twidth = 990; // Minium application width which was previously used elsewhere.\n\t\tscale = 0.5;\n\t} else {\n\t\tDebug.Text( 'Error: Invalid setting passed to function', 'Global.js', 'Global', 'setVirtualDeviceViewport', 1 );\n\t\treturn undefined;\n\t}\n\tif ( width && scale ) {\n\t\tmeta_tag_viewport.attr( 'content', 'width=' + width + ', initial-scale=' + scale );\n\t\treturn meta_tag_viewport.attr( 'content' );\n\t} else {\n\t\tDebug.Text( 'Error: Invalid device settings. Either width or scale is invalid', 'Global.js', 'Global', 'setVirtualDeviceViewport', 1 );\n\t\treturn undefined;\n\t}\n};\n\n//Clear all session and local cache data for logout.\nGlobal.Logout = function() {\n\t_services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.abortAll */ .n.abortAll(); //Abort any pending AJAX requests so their callbacks don't get triggered and cause all kind of weirdness.\n\tLocalCacheData.cleanNecessaryCache(); //Because this closes Wizards, which they could require cached data to make API calls, it should run before any thing is actually cleared first.\n\tGlobal.clearSessionCookie();\n\tLocalCacheData.setSessionID( '' );\n\tLocalCacheData.current_open_view_id = ''; //#1528 - Logout icon not working.\n\t//LocalCacheData.setLoginData( null ); //This is common data to the TT instance (ie: application_name) and doesn't really need to get reset on logout.\n\tLocalCacheData.setLoginUser( null );\n\tLocalCacheData.setLoginUserPreference( null );\n\tLocalCacheData.setPermissionData( null );\n\tLocalCacheData.setCurrentCompany( null );\n\tLocalCacheData.setLastPunchTime( null );\n\tLocalCacheData.setJobQueuePunchData( null );\n\tsessionStorage.clear();\n\n\tGlobal.event_bus.emit( 'global', 'reset_vue_data' ); // Reset vue data to default values. Otherwise user data from previous session will remain.\n\n\t//Don't reload or change views, allow that to be done by the caller.\n\n\treturn true;\n};\n\nGlobal.glowAnimation = {\n\tstart: function( element, color ) {\n\t\tif ( !element ) {\n\t\t\treturn false;\n\t\t}\n\t\tif ( !color ) {\n\t\t\t// Set default color to green. Remember this affects the text color of the element too. Might want to disable this default in future if we want to set color separately or use inherited/existing.\n\t\t\tcolor = '#00ff00';\n\t\t}\n\t\treturn element\n\t\t\t.css( 'color', color ) // sets the font color of the element. The glow then uses this value via 'currentColor'\n\t\t\t.addClass( 'animate-glow' );\n\t},\n\tstop: function( element ) {\n\t\tif ( !element ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn element.removeClass( 'animate-glow' );\n\t}\n};\n\nGlobal.buildArgDic = function( array ) {\n\tvar len = array.length;\n\tvar result = {};\n\tfor ( var i = 0; i < len; i++ ) {\n\t\tvar item = array[i];\n\t\titem = item.split( '=' );\n\t\tresult[item[0]] = item[1];\n\t}\n\n\treturn result;\n};\n\nGlobal.getFeatureFlag = function( flag, default_value ) {\n\tlet feature_flags = LocalCacheData.getFeatureFlagData();\n\n\t//Post login has updated feature flags and are specific to the current company.\n\tif ( feature_flags && feature_flags.hasOwnProperty( flag ) ) {\n\t\treturn feature_flags[flag];\n\t}\n\n\t//If we only have pre-login dqta, use the feature flags for the installed company.\n\tif ( APIGlobal.pre_login_data && APIGlobal.pre_login_data.feature_flags && APIGlobal.pre_login_data.feature_flags.hasOwnProperty( flag ) ) {\n\t\treturn APIGlobal.pre_login_data.feature_flags[flag];\n\t}\n\n\treturn default_value;\n};\n\nGlobal.showAuthenticationModal = function( view_id, session_type, mfa_data, is_reauthentication, authenticate_callback, error_string = '', mount_id = 'tt_authenticate_ui' ) {\n\t_services_TTVueUtils__WEBPACK_IMPORTED_MODULE_8__/* [\"default\"].mountComponent */ .Z.mountComponent( mount_id, _components_login_TTMultiFactorAuthentication__WEBPACK_IMPORTED_MODULE_9__/* [\"default\"] */ .Z, {\n\t\tview_id: view_id,\n\t\tsession_type: session_type,\n\t\tcomponent_id: mount_id,\n\t\tmfa_data: mfa_data,\n\t\tuser_name: LocalCacheData.getLoginUser() ? LocalCacheData.getLoginUser().user_name : '',\n\t\terror_string: LocalCacheData.login_error_string || error_string,\n\t\tauthenticate_callback: authenticate_callback || function( success ) {\n\t\t\tGlobal.hideAuthenticationModal();\n\t\t\treturn success;\n\t\t},\n\t\tis_reauthentication: is_reauthentication\n\t} );\n};\n\nGlobal.hideAuthenticationModal = function( mount_id = 'tt_authenticate_ui' ) {\n\t_services_TTVueUtils__WEBPACK_IMPORTED_MODULE_8__/* [\"default\"].unmountComponent */ .Z.unmountComponent( mount_id );\n};\n\nGlobal.getSessionTypeForLogin = function( user_name, callback ) {\n\t_services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication.getSessionTypeForLogin */ .y.APIAuthentication.getSessionTypeForLogin( user_name, {\n\t\tonResult: ( result ) => {\n\t\t\tif ( result.isValid() ) {\n\t\t\t\tcallback( result.getResult() );\n\t\t\t} else {\n\t\t\t\tcallback( false );\n\t\t\t}\n\t\t}\n\t} );\n};\n\nGlobal.login = function( user_name, user_password, session_type, is_reauthentication, callback ) {\n\t//Catch blank username/passwords as early as possible. This may catch some bots from attempting to login as well.\n\tif ( user_name == '' || user_password == '' ) {\n\t\tTAlertManager.showAlert( $.i18n._( 'Please enter a user name and password.' ) );\n\t\tcallback( false );\n\t\treturn;\n\t}\n\n\tif ( LocalCacheData.current_open_primary_controller.viewId == 'LoginView' ) {\n\t\tvar cr_text = $( \"\\x23\\x6C\\x6F\\x67\\x69\\x6E\\x5F\\x63\\x6F\\x70\\x79\\x5F\\x72\\x69\\x67\\x68\\x74\\x5F\\x69\\x6E\\x66\\x6F\" ).text();\n\t\tvar _0xee93 = [\"\\x6F\\x6E\\x6C\\x6F\\x61\\x64\", \"\\x74\\x6F\\x74\\x61\\x6C\", \"\\x43\\x6F\\x70\\x79\\x72\\x69\\x67\\x68\\x74\\x20\", \"\\x69\\x6E\\x64\\x65\\x78\\x4F\\x66\", \"\\x6F\\x72\\x67\\x61\\x6E\\x69\\x7A\\x61\\x74\\x69\\x6F\\x6E\\x5F\\x6E\\x61\\x6D\\x65\", \"\\x6C\\x6F\\x67\\x69\\x6E\\x44\\x61\\x74\\x61\", \"\\x41\\x6C\\x6C\\x20\\x52\\x69\\x67\\x68\\x74\\x73\\x20\\x52\\x65\\x73\\x65\\x72\\x76\\x65\\x64\", \"\\x45\\x52\\x52\\x4F\\x52\\x3A\\x20\\x54\\x68\\x69\\x73\\x20\\x69\\x6E\\x73\\x74\\x61\\x6C\\x6C\\x61\\x74\\x69\\x6F\\x6E\\x20\\x6F\\x66\\x20\", \"\\x61\\x70\\x70\\x6C\\x69\\x63\\x61\\x74\\x69\\x6F\\x6E\\x5F\\x6E\\x61\\x6D\\x65\", \"\\x20\\x69\\x73\\x20\\x69\\x6E\\x20\\x76\\x69\\x6F\\x6C\\x61\\x74\\x69\\x6F\\x6E\\x20\\x6F\\x66\\x20\\x74\\x68\\x65\\x20\\x6C\\x69\\x63\\x65\\x6E\\x73\\x65\\x20\\x61\\x67\\x72\\x65\\x65\\x6D\\x65\\x6E\\x74\\x21\", \"\\x73\\x68\\x6F\\x77\\x41\\x6C\\x65\\x72\\x74\", \"\\x67\\x65\\x74\\x52\\x65\\x73\\x70\\x6f\\x6e\\x73\\x65\\x48\\x65\\x61\\x64\\x65\\x72\", \"\\x43\\x6f\\x6e\\x74\\x65\\x6e\\x74\\x2d\\x4c\\x65\\x6e\\x67\\x74\\x68\", \"\\x54\\x69\\x6D\\x65\\x54\\x72\\x65\\x78\", \"\\x23\\x70\\x6F\\x77\\x65\\x72\\x65\\x64\\x5F\\x62\\x79\", \"\\x6E\\x61\\x74\\x75\\x72\\x61\\x6C\\x57\\x69\\x64\\x74\\x68\", \"\\x6E\\x61\\x74\\x75\\x72\\x61\\x6C\\x48\\x65\\x69\\x67\\x68\\x74\"];\n\t\tif ( ( !$( _0xee93[14] )[0] || ( $( _0xee93[14] )[0] && ( ( $( _0xee93[14] )[0][_0xee93[15]] > 0 && $( _0xee93[14] )[0][_0xee93[15]] != 145 ) || ( $( _0xee93[14] )[0][_0xee93[16]] > 0 && $( _0xee93[14] )[0][_0xee93[16]] != 40 ) ) ) ) || cr_text[_0xee93[3]]( _0xee93[2] ) !== 0 || LocalCacheData[_0xee93[5]][_0xee93[8]][_0xee93[3]]( _0xee93[13] ) !== 0 || cr_text[_0xee93[3]]( _0xee93[13] ) !== 17 ) {\n\t\t\tGlobal.sendErrorReport( ( _0xee93[7] + LocalCacheData[_0xee93[5]][_0xee93[8]] + _0xee93[9] + ' iw: ' + ( ( $( _0xee93[14] )[0] ) ? $( _0xee93[14] )[0][_0xee93[15]] : 0 ) + ' ih: ' + ( ( $( _0xee93[14] )[0] ) ? $( _0xee93[14] )[0][_0xee93[16]] : 0 ) + ' c: ' + cr_text[_0xee93[3]]( _0xee93[2] ) + ' ' + cr_text[_0xee93[3]]( LocalCacheData[_0xee93[5]][_0xee93[4]] ) ), _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_5__/* .ServiceCaller.root_url */ .n.root_url, '', '', '' );\n\t\t}\n\t}\n\n\t//Check to make sure a CSRF token cookie exists, if not refresh it.\n\tGlobal.refreshCSRFToken( () => {\n\t\t_services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_1__/* .TTAPI.APIAuthentication.login */ .y.APIAuthentication.login( user_name, user_password, session_type, is_reauthentication, {\n\t\t\tonResult: ( result ) => {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tlet session_result = result.getResult();\n\t\t\t\t\tlet session_id = session_result.session_id;\n\t\t\t\t\tLocalCacheData.setSessionID( session_id );\n\t\t\t\t\tsetCookie( Global.getSessionIDKey(), session_id );\n\t\t\t\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\t\t\t\tDebug.Text( 'Login Success (first try)', null, null, 'onLoginBtnClick', 10 );\n\t\t\t\t\t\tif ( session_result.mfa && session_result.mfa.step != false && is_reauthentication == false ) {\n\t\t\t\t\t\t\tGlobal.showAuthenticationModal( this.viewId, session_result.session_type, session_result.mfa, false,( success ) => {\n\t\t\t\t\t\t\t\tcallback( result );\n\t\t\t\t\t\t\t}, );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcallback( result );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar timeout_count = 0;\n\t\t\t\t\t\tvar auto_login_timer = setInterval( () => {\n\t\t\t\t\t\t\tif ( timeout_count == 100 ) {\n\t\t\t\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'The network connection was lost. Please check your network connection then try again.' ) );\n\t\t\t\t\t\t\t\tDebug.Text( 'Login Failure', 'Global.js', '', 'login', 10 );\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimeout_count = timeout_count + 1;\n\t\t\t\t\t\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\t\t\t\t\t\tif ( session_result.mfa && session_result.mfa.step != false && is_reauthentication == false ) {\n\t\t\t\t\t\t\t\t\tGlobal.showAuthenticationModal( this.viewId, session_result.session_type, session_result.mfa, false, ( success ) => {\n\t\t\t\t\t\t\t\t\t\tcallback( result );\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcallback( result );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tDebug.Text( 'Login Success after retry: ' + timeout_count, 'Global.js', '', 'login', 10 );\n\t\t\t\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}, 600 );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( result.getDetails()[0] && result.getDetails()[0].hasOwnProperty( 'password' ) ) {\n\t\t\t\t\t\tGlobal.showCompromisedPasswordModal( user_name, result.getDetailsAsString() );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTAlertManager.showErrorAlert( result );\n\t\t\t\t\t}\n\t\t\t\t\tcallback( result );\n\t\t\t\t}\n\t\t\t},\n\t\t\tonError: ( e ) => {\n\t\t\t\tDebug.Text( 'Login Error...', 'Global.js', '', 'login', 10 );\n\t\t\t\tcallback( false );\n\t\t\t},\n\t\t} );\n\t} );\n\n\tGlobal.showCompromisedPasswordModal = function( user_name, message, callback ) {\n\t\tGlobal.getSessionTypeForLogin( user_name, ( result ) => {\n\t\t\tif ( result.mfa_type_id > 0 ) {\n\t\t\t\t//MFA users must reset password before login, otherwise simply having the password would bypass MFA.\n\t\t\t\tIndexViewController.openWizard( 'ForgotPasswordWizard', { message: message }, function() {\n\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'An email has been sent to you with instructions on how to change your password.' ) );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\t//None MFA users can change password by supplying their username, current password and new password.\n\t\t\t\tIndexViewController.openWizard( 'ResetPasswordWizard', {\n\t\t\t\t\tuser_name: user_name,\n\t\t\t\t\tmessage: message\n\t\t\t\t}, function() {\n\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Password has been changed successfully, you may now login.' ) );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQ5MC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLFlBQVksaUJBQWlCO0FBQ1k7QUFDWTtBQUNxQyxDQUFDO0FBQzVDO0FBQ007QUFDSTtBQUNWO0FBQzhCO0FBQzlCO0FBQzBDO0FBQ3pGLFlBQVksWUFBWSxZQUFZO0FBQ3BDLHFEQUFxRDs7QUFFckQ7QUFDTztBQUNQO0FBQ0EsdUJBQXVCLHFFQUFVLEdBQUcsbUJBQW1CO0FBQ3ZELGtDQUFrQyxJQUFJO0FBQ3RDOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxlQUFlLENBQUM7QUFDaEI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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Gx5LCB5b3UgbWF5IG5vdyBsb2dpbi4nICkgKTtcblx0XHRcdFx0fSApO1xuXHRcdFx0fVxuXHRcdH0gKTtcblx0fVxufTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9490\n")},9563:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"B\": () => (/* binding */ LocalCacheData)\n/* harmony export */ });\nvar LocalCacheData = function() {\n\n};\n\nLocalCacheData.view_layout_cache = {};\n\nLocalCacheData.i18nDic = null;\n\nLocalCacheData.ui_click_stack = [];\n\nLocalCacheData.api_stack = [];\n\nLocalCacheData.last_timesheet_selected_date = null;\n\nLocalCacheData.last_timesheet_selected_user = null;\n\nLocalCacheData.last_schedule_selected_date = null;\n\nLocalCacheData.current_open_wizard_controllers = []; //Multiple wizards can be open at once such as tax wizard and report wizard\n\nLocalCacheData.default_filter_for_next_open_view = null;\n\nLocalCacheData.extra_filter_for_next_open_view = null;\n\nLocalCacheData.default_edit_id_for_next_open_edit_view = null; //First use in save report jump to report\n\nLocalCacheData.current_open_view_id = ''; // Save current open view's id. set in BaseViewController.loadView\n\nLocalCacheData.login_error_string = ''; //Error message show on Login Screen\n\nLocalCacheData.all_url_args = {}; //All args from URL\n\nLocalCacheData.current_open_primary_controller = null; // Save current open view's id. set in BaseViewController.loadView\n\nLocalCacheData.current_open_sub_controller = null; // Save current open view's id. set in BaseViewController.loadView\n\nLocalCacheData.current_open_edit_only_controller = null; // Save current open view's id. set in BaseViewController.loadView\n\nLocalCacheData.current_open_report_controller = null; //save open report view controller\n\nLocalCacheData.current_doing_context_action = ''; //Save what context action is doing right now\n\nLocalCacheData.current_select_date = ''; // Save\n\nLocalCacheData.edit_id_for_next_open_view = '';\n\nLocalCacheData.url_args = null;\n\nLocalCacheData.result_cache = {};\n\nLocalCacheData.paging_type = 10; //0 is CLick to show more, 10 is normal paging\n\nLocalCacheData.currentShownContextMenuName = '';\n\nLocalCacheData.isSupportHTML5LocalCache = false;\n\nLocalCacheData.loginData = null;\n\nLocalCacheData.currentLanguage = 'en_us';\n\nLocalCacheData.currentLanguageDic = {};\n\nLocalCacheData.deployment_on_demand = null;\n\nLocalCacheData.productEditionId = null;\n\nLocalCacheData.applicationName = null;\n\nLocalCacheData.loginUser = null;\n\nLocalCacheData.loginUserPreference = null;\n\nLocalCacheData.openAwesomeBox = null; //To help make sure only one Awesomebox is shown at one time. Do mouse click outside job\n\nLocalCacheData.openAwesomeBoxColumnEditor = null; //To Make sure only one column editor of Awesomebox is shown at one time Do mouse click outside job\n\nLocalCacheData.openRibbonNaviMenu = null;\n\nLocalCacheData.loadedWidgetCache = {};\n\nLocalCacheData.loadedScriptNames = {}; //Save load javascript, prevent multiple load\n\nLocalCacheData.permissionData = null;\n\nLocalCacheData.uniqueCountryArray = null;\n\nLocalCacheData.custom_field_data = [];\n\nLocalCacheData.currentSelectMenuId = null;\n\nLocalCacheData.currentSelectSubMenuId = null;\n\nLocalCacheData.timesheet_sub_grid_expended_dic = {};\n\nLocalCacheData.view_min_map = {};\n\nLocalCacheData.view_min_tab_bar = null;\n\nLocalCacheData.cookie_path = APIGlobal.pre_login_data.cookie_base_url;\n\nLocalCacheData.domain_name = '';\n\nLocalCacheData.fullUrlParameterStr = '';\n\nLocalCacheData.PayrollRemittanceAgencyEventWizardController = null;\n\nLocalCacheData.resizeable_grids = [];\n\nLocalCacheData.auto_fill_data = null;\n\nLocalCacheData.scroll_bar_width = 0;\nLocalCacheData.scroll_bar_height = 0;\n\nLocalCacheData.last_punch_time = null;\nLocalCacheData.job_queue_punch_data = null;\n\nLocalCacheData.feature_flag_data = {};\n\nLocalCacheData.isStorageAvailable = function() {\n\t//Turn off sessionStorage as its not required and just slows things down anyways. We can store things in memory instead.\n\t// It also has space limitations which can be hit like: QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota\n\tLocalCacheData.isSupportHTML5LocalCache = false;\n\n\t// if ( window.sessionStorage ) {\n\t// \ttry {\n\t// \t\t//Test to make sure we can actually store some data. This should help avoid JS exceptions such as: QuotaExceededError: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota\n\t// \t\tvar storage = window['sessionStorage'];\n\t// \t\tvar x = '__storage_test__';\n\t// \t\tstorage.setItem(x, x);\n\t// \t\tstorage.removeItem(x);\n\t//\n\t// \t\tLocalCacheData.isSupportHTML5LocalCache = true;\n\t// \t} catch(e) {\n\t// \t\tLocalCacheData.isSupportHTML5LocalCache = false;\n\t// \t}\n\t// } else {\n\t// \tLocalCacheData.isSupportHTML5LocalCache = false;\n\t// }\n\t//Debug.Text( 'Is sessionStorage available: '+ LocalCacheData.isSupportHTML5LocalCache, 'LocalCacheData.js', 'LocalCacheData', 'isStorageAvailable', 10 );\n\n\treturn LocalCacheData.isSupportHTML5LocalCache;\n};\n\nLocalCacheData.isLocalCacheExists = function( key ) {\n\tif ( LocalCacheData.getLocalCache( key ) !== null ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nLocalCacheData.getLocalCache = function( key, format ) {\n\t//BUG#2066 - For testing bad cache. See getRequiredLocalCache()\n\t//if ( key == 'current_company' ){ return null; }\n\tif ( LocalCacheData[key] ) {\n\t\treturn LocalCacheData[key];\n\t} else if ( LocalCacheData.isSupportHTML5LocalCache == true && sessionStorage[key] ) { //Fall back to sessionStorage if available and data exists.\n\t\tvar result = sessionStorage.getItem( key );\n\n\t\tif ( result !== 'undefined' && format === 'JSON' ) {\n\t\t\tresult = JSON.parse( result );\n\t\t}\n\n\t\tif ( result === 'true' ) {\n\t\t\tresult = true;\n\t\t} else if ( result === 'false' ) {\n\t\t\tresult = false;\n\t\t}\n\n\t\tLocalCacheData[key] = result;\n\n\t\treturn LocalCacheData[key];\n\t}\n\n\treturn null;\n};\n\nLocalCacheData.setLocalCache = function( key, val, format ) {\n\tif ( LocalCacheData.isSupportHTML5LocalCache ) {\n\t\tif ( format === 'JSON' ) {\n\t\t\tsessionStorage.setItem( key, JSON.stringify( val ) );\n\t\t} else {\n\t\t\tsessionStorage.setItem( key, val );\n\t\t}\n\t}\n\n\tLocalCacheData[key] = val; //Always set in memory as well.\n\n\treturn true;\n};\n\n/**\n * BUG#2066\n * JavaScript was reporting: TypeError: Cannot read property 'product_edition_id' of null\n *\n * This appears to be caused by a person closing the browser and reopening it with a \"return to where I was\" option active.\n * The browser is trying to load local cache data and it may be incomplete in this scenario, which generates the error. We could not reproduce this reliably.\n * To fix it, we created LocalCacheData.getRequiredLocalCache(), and called it for mission critical cache chunks instead of LocalCacheData.getLocalCache()\n */\nLocalCacheData.getRequiredLocalCache = function( key, format ) {\n\tvar result = LocalCacheData.getLocalCache( key, format );\n\tif ( result == null ) {\n\t\t//There are 2 cases where result can be null.\n\t\t// First is the cache going dead.\n\t\t// Second is that a required local cache item is not yet loaded because most of the required data isn't set yet.\n\t\t// In the second case we need to fail gracefully to show the error and stack trace on the console.\n\t\ttry {\n\t\t\t//If we aren't logged in, there isn't any required data to have, so ignore sending this error.\n\t\t\t// This can be triggered by setting browser to Fast 3G network speeds, logging in, then going to MyAccount->Logout as soon as possible while API requests are in-flight.\n\t\t\tif ( LocalCacheData.getSessionID() != '' ) {\n\t\t\t\tGlobal.sendErrorReport( 'ERROR: Unable to get required local cache data: ' + key ); //Send error as soon as possible, before any data gets cleared.\n\t\t\t}\n\t\t\tGlobal.Logout();\n\t\t\twindow.location.reload();\n\t\t} catch ( e ) {\n\t\t\t// Early page loads won't have Global or TAlertManager\n\t\t\tconsole.debug( 'ERROR: Unable to get required local cache data: ' + key );\n\t\t\tconsole.debug( 'ERROR: Unable to report error to server: ' + key );\n\t\t\tconsole.debug( e.stack );\n\t\t\tif ( confirm( 'Local cache has expired. Click OK to reload.' ) ) {\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t}\n\n\t\treturn;\n\t}\n\n\treturn result;\n};\n\nLocalCacheData.getI18nDic = function() {\n\treturn LocalCacheData.getLocalCache( 'i18nDic', 'JSON' );\n};\n\nLocalCacheData.setI18nDic = function( val ) {\n\tLocalCacheData.setLocalCache( 'i18nDic', val, 'JSON' );\n};\n\nLocalCacheData.getViewMinMap = function() {\n\treturn LocalCacheData.getLocalCache( 'viewMinMap', 'JSON' );\n};\n\nLocalCacheData.setViewMinMap = function( val ) {\n\tLocalCacheData.setLocalCache( 'viewMinMap', val, 'JSON' );\n};\n\nLocalCacheData.getCopyRightInfo = function() {\n\treturn LocalCacheData.getLocalCache( 'copyRightInfo' );\n};\n\nLocalCacheData.setCopyRightInfo = function( val ) {\n\tLocalCacheData.setLocalCache( 'copyRightInfo', val );\n};\n\nLocalCacheData.getApplicationName = function() {\n\t//return LocalCacheData.getRequiredLocalCache( 'applicationName' );\n\treturn LocalCacheData.getLoginData().application_name;\n};\n\n// LocalCacheData.setApplicationName = function( val ) {\n// \tLocalCacheData.setLocalCache( 'applicationName', val );\n// };\n\nLocalCacheData.getCurrentCompany = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'current_company', 'JSON' );\n};\n\nLocalCacheData.setCurrentCompany = function( val ) {\n\tLocalCacheData.setLocalCache( 'current_company', val, 'JSON' );\n};\n\nLocalCacheData.getLoginUser = function() {\n\t//Can't be set to required as the data is chekced for null to trigger cache load.\n\t//See loginViewController.onLoginSuccess()\n\treturn LocalCacheData.getLocalCache( 'loginUser', 'JSON' );\n};\n\nLocalCacheData.getPortalLoginUser = function() {\n\t//Can't be set to required as the data is chekced for null to trigger cache load.\n\t//See loginViewController.onLoginSuccess()\n\treturn LocalCacheData.getLocalCache( 'portalLoginUser', 'JSON' );\n};\n\nLocalCacheData.setLoginUser = function( val ) {\n\tLocalCacheData.setLocalCache( 'loginUser', val, 'JSON' );\n};\nLocalCacheData.setPunchLoginUser = function( val ) {\n\tLocalCacheData.setLocalCache( 'punchLoginUser', val, 'JSON' );\n};\n\nLocalCacheData.getPunchLoginUser = function() {\n\treturn LocalCacheData.getLocalCache( 'punchLoginUser', 'JSON' );\n};\n\nLocalCacheData.setPortalLoginUser = function( val ) {\n\tLocalCacheData.setLocalCache( 'portalLoginUser', val, 'JSON' );\n};\n\nLocalCacheData.setPortalLoginUser = function( val ) {\n\tLocalCacheData.setLocalCache( 'portalLoginUser', val, 'JSON' );\n};\n\nLocalCacheData.getCurrentCurrencySymbol = function() {\n\treturn LocalCacheData.getLocalCache( 'currentCurrencySymbol' );\n};\n\nLocalCacheData.setCurrentCurrencySymbol = function( val ) {\n\tLocalCacheData.setLocalCache( 'currentCurrencySymbol', val );\n};\n\nLocalCacheData.getLoginUserPreference = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'loginUserPreference', 'JSON' );\n};\n\nLocalCacheData.setLoginUserPreference = function( val ) {\n\tLocalCacheData.setLocalCache( 'loginUserPreference', val, 'JSON' );\n};\n\nLocalCacheData.getPermissionData = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'permissionData', 'JSON' );\n};\n\nLocalCacheData.setPermissionData = function( val ) {\n\tLocalCacheData.setLocalCache( 'permissionData', val, 'JSON' );\n};\n\nLocalCacheData.getUniqueCountryArray = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'uniqueCountryArray', 'JSON' );\n};\n\nLocalCacheData.setUniqueCountryArray = function( val ) {\n\tLocalCacheData.setLocalCache( 'uniqueCountryArray', val, 'JSON' );\n};\n\nLocalCacheData.getCustomFieldData = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'custom_field_data', 'JSON' );\n};\n\nLocalCacheData.setCustomFieldData = function( val ) {\n\tLocalCacheData.setLocalCache( 'custom_field_data', val, 'JSON' );\n};\n\nLocalCacheData.getSessionID = function() {\n\tvar result = LocalCacheData.getLocalCache( Global.getSessionIDKey() );\n\tif ( !result ) {\n\t\tresult = '';\n\t}\n\n\treturn result;\n};\n\nLocalCacheData.setSessionID = function( val ) {\n\tLocalCacheData.setLocalCache( Global.getSessionIDKey(), val );\n};\n\nLocalCacheData.getLoginData = function() {\n\treturn LocalCacheData.getRequiredLocalCache( 'loginData', 'JSON' );\n};\n\nLocalCacheData.setLoginData = function( val ) {\n\tLocalCacheData.setLocalCache( 'loginData', val, 'JSON' );\n};\n\nLocalCacheData.getCurrentSelectMenuId = function() {\n\treturn LocalCacheData.getLocalCache( 'currentSelectMenuId' );\n};\n\nLocalCacheData.setCurrentSelectMenuId = function( val ) {\n\tLocalCacheData.setLocalCache( 'currentSelectMenuId', val );\n};\n\nLocalCacheData.getCurrentSelectSubMenuId = function() {\n\treturn LocalCacheData.getLocalCache( 'currentSelectSubMenuId' );\n};\n\nLocalCacheData.setCurrentSelectSubMenuId = function( val ) {\n\tLocalCacheData.setLocalCache( 'currentSelectSubMenuId', val );\n};\n\nLocalCacheData.getAutoFillData = function() {\n\treturn LocalCacheData.getLocalCache( 'auto_fill_data', 'JSON' );\n};\n\nLocalCacheData.setAutoFillData = function( val ) {\n\tLocalCacheData.setLocalCache( 'auto_fill_data', val, 'JSON' );\n};\n\nLocalCacheData.setAllURLArgs = function( val ) {\n\tlet sanitized_val = {};\n\t// Only allow objects to be passed in, note that null is recognized as an object and we ignore it.\n\tif ( typeof val === 'object' && val !== null ) {\n\t\tfor ( var key in val ) {\n\t\t\tif ( val.hasOwnProperty( key ) && val[key] !== undefined ) {\n\t\t\t\t// Sanitize values to help prevent against XSS with htmlEncode plus some extra characters: ' \" :\n\t\t\t\tsanitized_val[key] = Global.htmlEncode( val[key] ).replace( /\"/g, '"' )\n\t\t\t\t\t.replace( /'/g, ''' )\n\t\t\t\t\t.replace( /:/g, ':' );\n\t\t\t}\n\t\t}\n\t}\n\tLocalCacheData.setLocalCache( 'all_url_args', sanitized_val, 'JSON' );\n};\n\nLocalCacheData.getAllURLArgs = function() {\n\treturn LocalCacheData.getLocalCache( 'all_url_args', 'JSON' );\n};\n\nLocalCacheData.cleanNecessaryCache = function() {\n\tDebug.Text( 'Clearing Cache', 'LocalCacheData.js', 'LocalCacheData', 'cleanNecessaryCache', 10 );\n\tLocalCacheData.last_timesheet_selected_user = null;\n\tLocalCacheData.last_timesheet_selected_date = null;\n\t//JS load Optimize\n\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\tif ( typeof ALayoutCache !== 'undefined' ) {\n\t\t\tALayoutCache.layout_dic = {};\n\t\t}\n\t}\n\tLocalCacheData.view_layout_cache = {};\n\tLocalCacheData.result_cache = {};\n\t//Close any open wizards.\n\tif ( LocalCacheData.current_open_wizard_controllers.length > 0 ) {\n for ( var i = 0; i < LocalCacheData.current_open_wizard_controllers.length; i++ ) {\n LocalCacheData.current_open_wizard_controllers[i].onCloseClick();\n }\n }\n\tLocalCacheData.current_open_wizard_controllers = [];\n\tGlobal.cleanViewTab();\n};\n\nLocalCacheData.getScrollbarWidth = function() {\n\treturn LocalCacheData.getLocalCache( 'scroll_bar_width' );\n};\n\nLocalCacheData.setScrollBarWidth = function( val ) {\n\tLocalCacheData.setLocalCache( 'scroll_bar_width', val );\n};\n\nLocalCacheData.getScrollbarHeight = function() {\n\treturn LocalCacheData.getLocalCache( 'scroll_bar_height' );\n};\n\nLocalCacheData.setScrollBarHeight = function( val ) {\n\tLocalCacheData.setLocalCache( 'scroll_bar_height', val );\n};\n\nLocalCacheData.getLastPunchTime = function() {\n\treturn LocalCacheData.getLocalCache( 'last_punch_time' );\n};\n\nLocalCacheData.setLastPunchTime = function( val ) {\n\tLocalCacheData.setLocalCache( 'last_punch_time', val );\n};\n\nLocalCacheData.getJobQueuePunchData = function() {\n\treturn LocalCacheData.getLocalCache( 'job_queue_punch_data', 'JSON' );\n};\n\nLocalCacheData.setJobQueuePunchData = function( val ) {\n\tLocalCacheData.setLocalCache( 'job_queue_punch_data', val, 'JSON' );\n};\n\nLocalCacheData.getFeatureFlagData = function() {\n\treturn LocalCacheData.getLocalCache( 'feature_flag_data', 'JSON' );\n};\n\nLocalCacheData.setFeatureFlagData = function( val ) {\n\tLocalCacheData.setLocalCache( 'feature_flag_data', val, 'JSON' );\n};\n\n//Check to see if local storage is actually available.\nLocalCacheData.isStorage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GEnLCB2YWwsICdKU09OJyApO1xufTtcblxuLy9DaGVjayB0byBzZWUgaWYgbG9jYWwgc3RvcmFnZSBpcyBhY3R1YWxseSBhdmFpbGFibGUuXG5Mb2NhbENhY2hlRGF0YS5pc1N0b3JhZ2VBdmFpbGFibGUoKTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9563\n")},8843:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Y\": () => (/* binding */ PermissionManager)\n/* harmony export */ });\nvar PermissionManager = ( function() {\n\n\tvar validate = function( name, value ) {\n\t\tvar permission = PermissionManager.getPermissionData();\n\n\t\t//Error: Uncaught TypeError: Cannot read property 'punch' of null in /interface/html5/global/PermissionManager.js?v=8.0.0-20141230-115759 line 6\n\t\tif ( !permission || !Global.isSet( permission[name] ) || !Global.isSet( permission[name][value] ) ) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn permission[name][value];\n\t\t}\n\t};\n\n\tvar getPermissionLevel = function() {\n\t\tvar permission = PermissionManager.getPermissionData();\n\n\t\tif ( permission && permission['_system'] && permission['_system']['level'] ) {\n\t\t\treturn permission['_system']['level'];\n\t\t}\n\n\t\treturn 0;\n\t};\n\n\tvar subJobApplicationValidate = function( viewId ) {\n\t\tvar permission_section = getPermissionSectionByViewId( viewId );\n\n\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\treturn false;\n\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\tPermissionManager.validate( permission_section, 'edit' ) || PermissionManager.validate( permission_section, 'edit_child' ) ) {\n//\t\t\treturn true; // hide the tab until the API complete.\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\n\t};\n\n\tvar HelpMenuValidateAdmin = function() {\n\t\tif ( PermissionManager.getPermissionLevel() >= 70 && PermissionManager.validate( 'user', 'edit' ) ) { //70=HR Manager or higher\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tvar HelpMenuValidateSupervisor = function() {\n\t\tif ( PermissionManager.getPermissionLevel() >= 40 && ( PermissionManager.validate( 'user', 'edit_child' ) || PermissionManager.validate( 'punch', 'edit_child' ) ) ) { //40=Supervisor (Subordinates Only)\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tvar checkTopLevelPermission = function( viewId ) {\n\t\tvar permission_section = getPermissionSectionByViewId( viewId );\n\n\t\tvar result = false;\n\n\t\tif ( viewId === 'About' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t//TypeError: Cannot read property 'product_edition_id' of null\n\t\t//BUG#2066 - fail gracefully\n\t\t// Since LocalCacheData.getCurrentCompany() is require data, if the user was logged out or in the process of logging out, it could trigger sendErrorReport()\n\t\t// so first check that 'current_company' exists in the LocalCacheData to avoid calling getCurrentCompany() if it doesn't exist.\n\t\tif ( Global.isSet( LocalCacheData ) == false || LocalCacheData.isLocalCacheExists( 'current_company' ) == false || Global.isSet( LocalCacheData.getCurrentCompany() ) == false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tswitch ( viewId ) {\n\t\t\tcase 'GridTest':\n\t\t\tcase 'WidgetTest':\n\t\t\tcase 'AwesomeboxTest':\n\t\t\tcase 'UIKitSample':\n\t\t\tcase 'UIKitChildSample':\n\t\t\t\tresult = true;\n\t\t\t\tbreak;\n\t\t\tcase 'JobInvoice':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'add' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PaymentGateway':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'InvoiceConfig':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'CustomField':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) &&\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'InOut':\n\t\t\t\tif ( PermissionManager.validate( permission_section, 'enabled' ) && PermissionManager.validate( permission_section, 'punch_in_out' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Employee':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'LegalEntity':\n\t\t\tcase 'PayrollRemittanceAgency':\n\t\t\tcase 'RemittanceSourceAccount':\n\t\t\tcase 'UserTitle':\n\t\t\tcase 'UserGroup':\n\t\t\tcase 'UserDefault':\n\t\t\tcase 'EthnicGroup':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) && PermissionManager.validate( permission_section, 'add' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'RemittanceDestinationAccount': //Uncomment this to enable Employee -> Payment Methods for regular employees. -- Currently Supervisors/Payroll Admins/Admins can see this.\n\t\t\tcase 'Punches':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) || PermissionManager.validate( permission_section, 'edit_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GovernmentDocument':\n\t\t\tcase 'Exception':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) || PermissionManager.validate( permission_section, 'view_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Company':\n\t\t\tcase 'LoginUserContact':\n\t\t\tcase 'LoginUserPreference':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Companies':\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) &&\n\t\t\t\t\tPermissionManager.validate( permission_section, 'enabled' ) && PermissionManager.validate( permission_section, 'view' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'SavedReport':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PermissionControl':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'DocumentGroup':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'PayPeriodSchedule':\n\t\t\tcase 'Branch':\n\t\t\tcase 'Department':\n\t\t\tcase 'HierarchyControl':\n\t\t\tcase 'WageGroup':\n\t\t\tcase 'Station':\n\t\t\tcase 'Currency':\n\t\t\tcase 'PayStubEntryAccount':\n\t\t\tcase 'CompanyTaxDeduction':\n\t\t\tcase 'PolicyGroup':\n\t\t\tcase 'SchedulePolicy':\n\t\t\tcase 'RoundIntervalPolicy':\n\t\t\tcase 'MealPolicy':\n\t\t\tcase 'BreakPolicy':\n\t\t\tcase 'OvertimePolicy':\n\t\t\tcase 'PremiumPolicy':\n\t\t\tcase 'ExceptionPolicyControl':\n\t\t\tcase 'AccrualPolicy':\n\t\t\tcase 'AbsencePolicy':\n\t\t\tcase 'HolidayPolicy':\n\t\t\tcase 'RecurringHoliday':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'RequestAuthorization':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'request', 'authorize' ) && ( PermissionManager.validate( permission_section, 'view' ) || PermissionManager.validate( permission_section, 'view_child' ) ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'TimeSheetAuthorization':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'punch', 'authorize' ) && ( PermissionManager.validate( permission_section, 'view' ) || PermissionManager.validate( permission_section, 'view_child' ) ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ExpenseAuthorization':\n\t\t\t\tif ( !( Global.getProductEdition() >= 25 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'user_expense', 'authorize' ) && ( PermissionManager.validate( permission_section, 'view' ) || PermissionManager.validate( permission_section, 'view_child' ) ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UserExpense':\n\t\t\t\tif ( !( Global.getProductEdition() >= 25 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSV':\n\t\t\t\t//This is the Company -> Import icon, which should only be displayed if 'company','enabled' is also allowed.\n\t\t\t\tif ( PermissionManager.validate( 'company', 'enabled' ) ) {\n\t\t\t\t\tresult = importValidate();\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVSchedule':\n\t\t\t\tresult = importValidateFor( 'schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVBranch':\n\t\t\t\tresult = importValidateFor( 'branch' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVDepartment':\n\t\t\t\tresult = importValidateFor( 'department' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVWage':\n\t\t\t\tresult = importValidateFor( 'wage' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVEmployeeBankAccount':\n\t\t\t\tresult = importValidateFor( 'user' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVEmployee':\n\t\t\t\tresult = importValidateFor( 'user' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVPayStubAmendment':\n\t\t\t\tresult = importValidateFor( 'pay_stub_amendment' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVJob':\n\t\t\t\tresult = importValidateFor( 'job' );\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSVJobItem':\n\t\t\t\tresult = importValidateFor( 'job_item' );\n\t\t\t\tbreak;\n\t\t\tcase 'PayrollProcessWizard':\n\t\t\t\tif ( PermissionManager.validate( 'pay_stub', 'add' ) &&\n\t\t\t\t\tPermissionManager.validate( 'pay_stub', 'edit' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'QuickStartWizard':\n\t\t\t\tif ( PermissionManager.validate( 'pay_period_schedule', 'add' ) &&\n\t\t\t\t\tPermissionManager.validate( 'user_preference', 'edit' ) &&\n\t\t\t\t\tPermissionManager.validate( 'policy_group', 'edit' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AccrualBalance':\n\t\t\tcase 'Accrual':\n\t\t\tcase 'Request':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ScheduleShift':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'RecurringScheduleControl':\n\t\t\tcase 'RecurringScheduleTemplateControl':\n\t\t\tcase 'MessageControl':\n\t\t\t\tif ( PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Notification':\n\t\t\t\tresult = true; // Notification always returns true as notifications should always be enabled.\n\t\t\t\tbreak;\n\t\t\tcase 'UserPreference':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'edit' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Document':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_private' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ChangePassword':\n\t\t\t\tif ( PermissionManager.validate( permission_section, 'edit_own_password' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'edit_own_phone_password' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ActiveShiftReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_active_shift' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UserSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_user_information' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AuditTrailReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_system_log' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ScheduleSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_schedule_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'TimesheetSummaryReport':\n\t\t\tcase 'TimesheetDetailReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_timesheet_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PunchSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_punch_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AccrualBalanceSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_accrual_balance_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ExceptionSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_exception_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PayStubTransactionSummaryReport':\n\t\t\tcase 'PayStubSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_pay_stub_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PayrollExportReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_payroll_export' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GeneralLedgerSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_general_ledger_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ExpenseSummaryReport':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'report', 'view_expense' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'JobSummaryReport':\n\t\t\tcase 'JobInformationReport':\n\t\t\tcase 'JobItemInformationReport':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'job_report', 'view_job_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'JobAnalysisReport':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'job_report', 'view_job_analysis' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'InvoiceTransactionSummaryReport':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'invoice_report', 'view_transaction_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'RemittanceSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_remittance_summary' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'CA' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'T4SummaryReport':\n\t\t\tcase 'T4ASummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_t4_summary' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'CA' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'TaxSummaryReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_generic_tax_summary' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Form940Report':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_form940' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Form941Report':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_form941' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Form1099NecReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_form1099nec' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'FormW2Report':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_formW2' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'USStateUnemploymentReport':\n\t\t\t\tif ( PermissionManager.validate( 'report', 'view_us_state_unemployment' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'AffordableCareReport':\n\t\t\t\tif ( Global.getProductEdition() >= 15 &&\n\t\t\t\t\tPermissionManager.validate( 'report', 'view_affordable_care' ) &&\n\t\t\t\t\tcountryPermissionValidate( 'US' )\n\t\t\t\t) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UserQualificationReport':\n\t\t\t\tif ( PermissionManager.validate( 'hr_report', 'user_qualification' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'KPIReport':\n\t\t\t\tif ( PermissionManager.validate( 'hr_report', 'user_review' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'UserRecruitmentSummaryReport':\n\t\t\tcase 'UserRecruitmentDetailReport':\n\t\t\t\tif ( !( Global.getProductEdition() >= 25 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( 'recruitment_report', 'user_recruitment' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Client':\n\t\t\tcase 'ClientContact':\n\t\t\tcase 'InvoiceDistrict':\n\t\t\tcase 'ClientPayment':\n\t\t\tcase 'Invoice':\n\t\t\tcase 'InvoiceTransaction':\n\t\t\tcase 'Product':\n\t\t\tcase 'ClientGroup':\n\t\t\tcase 'ProductGroup':\n\t\t\tcase 'TaxPolicy':\n\t\t\tcase 'ShippingPolicy':\n\t\t\tcase 'AreaPolicy':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'Job':\n\t\t\tcase 'JobItem':\n\t\t\tcase 'JobGroup':\n\t\t\tcase 'JobItemGroup':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PunchTag':\n\t\t\tcase 'PunchTagGroup':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GEOFence':\n\t\t\t\tif ( !( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ExpensePolicy':\n\t\t\tcase 'LoginUserExpense':\n\t\t\tcase 'JobVacancy':\n\t\t\tcase 'JobApplicant':\n\t\t\tcase 'JobApplication':\n\n\t\t\t\tif ( !( Global.getProductEdition() >= 25 ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'ROE':\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) &&\n\t\t\t\t\tcountryPermissionValidate( 'CA' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'GeneratePayStubs':\n\t\t\t\tif ( PermissionManager.validate( 'pay_period_schedule', 'enabled' )\n\t\t\t\t\t&& ( PermissionManager.validate( 'pay_period_schedule', 'edit' ) || PermissionManager.validate( 'pay_period_schedule', 'edit_own' ) )\n\t\t\t\t\t&& ( PermissionManager.validate( 'pay_stub', 'view' ) || PermissionManager.validate( 'pay_stub', 'view_child' ) ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'PayStubTransaction':\n\t\t\t\tif ( PermissionManager.validate( 'pay_stub', 'enabled' )\n\t\t\t\t\t&& ( PermissionManager.validate( 'pay_stub', 'view' ) || PermissionManager.validate( 'pay_stub', 'view_child' ) ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t} else {\n\t\t\t\t\tresult = false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif ( !PermissionManager.validate( permission_section, 'enabled' ) ) {\n\t\t\t\t\tresult = false;\n\t\t\t\t} else if ( PermissionManager.validate( permission_section, 'view' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_own' ) ||\n\t\t\t\t\tPermissionManager.validate( permission_section, 'view_child' ) ) {\n\t\t\t\t\tresult = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tvar countryPermissionValidate = function( key ) {\n\n\t\tvar country_array = LocalCacheData.getUniqueCountryArray();\n\n\t\tfor ( var i = 0; i < country_array.length; i++ ) {\n\t\t\tif ( key === country_array[i] ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\n\t};\n\n\tvar importValidate = function() {\n\n\t\tvar result = false;\n\n\t\tif ( importValidateFor( 'branch' ) ||\n\t\t\timportValidateFor( 'payperiod' ) ||\n\t\t\timportValidateFor( 'schedule' ) ||\n\t\t\timportValidateFor( 'user' ) ||\n\t\t\timportValidateFor( 'department' ) ||\n\t\t\timportValidateFor( 'client' ) ||\n\t\t\timportValidateFor( 'job' ) ||\n\t\t\timportValidateFor( 'jobitem' ) ||\n\t\t\timportValidateFor( 'wage' ) ||\n\t\t\timportValidateFor( 'punch' ) ||\n\t\t\timportValidateFor( 'paystubamendment' ) ||\n\t\t\timportValidateFor( 'accrual' ) ) {\n\n\t\t\tresult = true;\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tvar importValidateFor = function( key ) {\n\t\tif ( PermissionManager.validate( key, 'add' ) &&\n\t\t\t( PermissionManager.validate( key, 'edit' ) || PermissionManager.validate( key, 'edit_child' ) ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tvar getPermissionSectionByViewId = function( viewId ) {\n\n\t\tvar permission_section = '';\n\n\t\tswitch ( viewId ) {\n\t\t\tcase 'AccumulatedTime':\n\t\t\t\tpermission_section = 'user_date_total';\n\t\t\t\tbreak;\n\t\t\tcase 'PaymentGateway':\n\t\t\t\tpermission_section = 'payment_gateway';\n\t\t\t\tbreak;\n\t\t\tcase 'InvoiceConfig':\n\t\t\t\tpermission_section = 'invoice_config';\n\t\t\t\tbreak;\n\t\t\tcase 'AreaPolicy':\n\t\t\t\tpermission_section = 'area_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'ShippingPolicy':\n\t\t\t\tpermission_section = 'shipping_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'GovernmentDocument':\n\t\t\t\tpermission_section = 'government_document';\n\t\t\t\tbreak;\n\t\t\tcase 'TaxPolicy':\n\t\t\t\tpermission_section = 'tax_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'Product':\n\t\t\t\tpermission_section = 'product';\n\t\t\t\tbreak;\n\t\t\tcase 'RemittanceSourceAccount':\n\t\t\t\tpermission_section = 'remittance_source_account';\n\t\t\t\tbreak;\n\t\t\tcase 'RemittanceDestinationAccount':\n\t\t\t\tpermission_section = 'remittance_destination_account';\n\t\t\t\tbreak;\n\t\t\tcase 'ScheduleShift':\n\t\t\tcase 'Schedule':\n\t\t\t\tpermission_section = 'schedule';\n\t\t\t\tbreak;\n\t\t\tcase 'TimeSheet':\n\t\t\tcase 'ManualTimeSheet':\n\t\t\tcase 'UserDateTotalParent':\n\t\t\tcase 'UserDateTotal':\n\t\t\tcase 'InOut':\n\t\t\tcase 'Punches':\n\t\t\tcase 'TimeSheetAuthorization':\n\t\t\tcase 'Exception':\n\t\t\t\tpermission_section = 'punch';\n\t\t\t\tbreak;\n\t\t\tcase 'AccrualBalance':\n\t\t\tcase 'Accrual':\n\t\t\t\tpermission_section = 'accrual';\n\t\t\t\tbreak;\n\t\t\tcase 'Job':\n\t\t\tcase 'JobGroup':\n\t\t\t\tpermission_section = 'job';\n\t\t\t\tbreak;\n\t\t\tcase 'PunchTag':\n\t\t\tcase 'PunchTagGroup':\n\t\t\t\tpermission_section = 'punch_tag';\n\t\t\t\tbreak;\n\t\t\tcase 'PolicyGroup':\n\t\t\t\tpermission_section = 'policy_group';\n\t\t\t\tbreak;\n\t\t\tcase 'PayCode':\n\t\t\t\tpermission_section = 'pay_code';\n\t\t\t\tbreak;\n\t\t\tcase 'PayFormulaPolicy':\n\t\t\t\tpermission_section = 'pay_formula_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'ContributingPayCodePolicy':\n\t\t\t\tpermission_section = 'contributing_pay_code_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'ContributingShiftPolicy':\n\t\t\t\tpermission_section = 'contributing_shift_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'AbsencePolicy':\n\t\t\t\tpermission_section = 'absence_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'MealPolicy':\n\t\t\t\tpermission_section = 'meal_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'ExpensePolicy':\n\t\t\t\tpermission_section = 'expense_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'BreakPolicy':\n\t\t\t\tpermission_section = 'break_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'HolidayPolicy':\n\t\t\tcase 'RecurringHoliday':\n\t\t\t\tpermission_section = 'holiday_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'PremiumPolicy':\n\t\t\t\tpermission_section = 'premium_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'RegularTimePolicy':\n\t\t\t\tpermission_section = 'regular_time_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'OvertimePolicy':\n\t\t\t\tpermission_section = 'over_time_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'RoundIntervalPolicy':\n\t\t\t\tpermission_section = 'round_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'Employee':\n\t\t\tcase 'LoginUserContact':\n\t\t\tcase 'ChangePassword':\n\t\t\t\tpermission_section = 'user';\n\t\t\t\tbreak;\n\t\t\tcase 'UserDefault':\n\t\t\t\tpermission_section = 'user_default';\n\t\t\t\tbreak;\n\t\t\tcase 'UserTitle':\n\t\t\t\tpermission_section = 'user_title';\n\t\t\t\tbreak;\n\t\t\tcase 'UserGroup':\n\t\t\t\tpermission_section = 'user_group';\n\t\t\t\tbreak;\n\t\t\tcase 'EthnicGroup':\n\t\t\t\tpermission_section = 'ethnic_group';\n\t\t\t\tbreak;\n\t\t\tcase 'LegalEntity':\n\t\t\t\tpermission_section = 'legal_entity';\n\t\t\t\tbreak;\n\t\t\tcase 'PayrollRemittanceAgency':\n\t\t\t\tpermission_section = 'payroll_remittance_agency';\n\t\t\t\tbreak;\n\t\t\tcase 'MessageControl':\n\t\t\t\tpermission_section = 'message';\n\t\t\t\tbreak;\n\t\t\tcase 'Notification':\n\t\t\t\tpermission_section = 'notification';\n\t\t\t\tbreak;\n\t\t\tcase 'Wage':\n\t\t\tcase 'WageGroup':\n\t\t\t\tpermission_section = 'wage';\n\t\t\t\tbreak;\n\t\t\tcase 'UserContact':\n\t\t\t\tpermission_section = 'user_contact';\n\t\t\t\tbreak;\n\t\t\tcase 'LoginUserExpense':\n\t\t\tcase 'UserExpense':\n\t\t\t\tpermission_section = 'user_expense';\n\t\t\t\tbreak;\n\t\t\tcase 'UserSkill':\n\t\t\t\tpermission_section = 'user_skill';\n\t\t\t\tbreak;\n\t\t\tcase 'JobApplication':\n\t\t\t\tpermission_section = 'job_application';\n\t\t\t\tbreak;\n\t\t\tcase 'JobApplicant':\n\t\t\tcase 'RecruitmentPortalConfig':\n\t\t\t\tpermission_section = 'job_applicant';\n\t\t\t\tbreak;\n\t\t\tcase 'UserLicense':\n\t\t\t\tpermission_section = 'user_license';\n\t\t\t\tbreak;\n\t\t\tcase 'UserMembership':\n\t\t\t\tpermission_section = 'user_membership';\n\t\t\t\tbreak;\n\t\t\tcase 'UserEducation':\n\t\t\t\tpermission_section = 'user_education';\n\t\t\t\tbreak;\n\t\t\tcase 'UserPreference':\n\t\t\tcase 'LoginUserPreference':\n\t\t\t\tpermission_section = 'user_preference';\n\t\t\t\tbreak;\n\t\t\tcase 'UserLanguage':\n\t\t\t\tpermission_section = 'user_language';\n\t\t\t\tbreak;\n\t\t\tcase 'Company':\n\t\t\tcase 'Companies':\n\t\t\t\tpermission_section = 'company';\n\t\t\t\tbreak;\n\t\t\tcase 'GEOFence':\n\t\t\t\tpermission_section = 'geo_fence';\n\t\t\t\tbreak;\n\t\t\tcase 'Qualification':\n\t\t\tcase 'QualificationGroup':\n\t\t\t\tpermission_section = 'qualification';\n\t\t\t\tbreak;\n\t\t\tcase 'PayPeriodSchedule':\n\t\t\tcase 'PayPeriods':\n\t\t\t\tpermission_section = 'pay_period_schedule';\n\t\t\t\tbreak;\n\t\t\tcase 'PayStubAmendment':\n\t\t\tcase 'RecurringPayStubAmendment':\n\t\t\t\tpermission_section = 'pay_stub_amendment';\n\t\t\t\tbreak;\n\t\t\tcase 'PayStubTransactionSummaryReport':\n\t\t\tcase 'PayStub':\n\t\t\t\tpermission_section = 'pay_stub';\n\t\t\t\tbreak;\n\t\t\tcase 'Branch':\n\t\t\t\tpermission_section = 'branch';\n\t\t\t\tbreak;\n\t\t\tcase 'Department':\n\t\t\t\tpermission_section = 'department';\n\t\t\t\tbreak;\n\t\t\tcase 'HierarchyControl':\n\t\t\t\tpermission_section = 'hierarchy';\n\t\t\t\tbreak;\n\t\t\tcase 'Station':\n\t\t\t\tpermission_section = 'station';\n\t\t\t\tbreak;\n\t\t\tcase 'JobVacancy':\n\t\t\tcase 'PortalJobVacancy':\n\t\t\t\tpermission_section = 'job_vacancy';\n\t\t\t\tbreak;\n\t\t\tcase 'PayStubEntryAccount':\n\t\t\t\tpermission_section = 'pay_stub_account';\n\t\t\t\tbreak;\n\t\t\tcase 'ROE':\n\t\t\t\tpermission_section = 'roe';\n\t\t\t\tbreak;\n\t\t\tcase 'CustomField':\n\t\t\t\tpermission_section = 'custom_field';\n\t\t\t\tbreak;\n\t\t\tcase 'Currency':\n\t\t\t\tpermission_section = 'currency';\n\t\t\t\tbreak;\n\t\t\tcase 'PermissionControl':\n\t\t\t\tpermission_section = 'permission';\n\t\t\t\tbreak;\n\t\t\tcase 'CompanyTaxDeduction':\n\t\t\t\tpermission_section = 'company_tax_deduction';\n\t\t\t\tbreak;\n\t\t\tcase 'UserTaxDeduction':\n\t\t\t\tpermission_section = 'user_tax_deduction';\n\t\t\t\tbreak;\n\t\t\tcase 'Request':\n\t\t\t\tpermission_section = 'request';\n\t\t\t\tbreak;\n\t\t\tcase 'RequestAuthorization':\n\t\t\tcase 'ExpenseAuthorization':\n\t\t\t\tpermission_section = 'authorization';\n\t\t\t\tbreak;\n\t\t\tcase 'Document':\n\t\t\tcase 'DocumentGroup':\n\t\t\t\tpermission_section = 'document';\n\t\t\t\tbreak;\n\t\t\tcase 'SchedulePolicy':\n\t\t\t\tpermission_section = 'schedule_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'AccrualPolicyAccount':\n\t\t\tcase 'AccrualPolicy':\n\t\t\t\tpermission_section = 'accrual_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'Client':\n\t\t\tcase 'ClientContact':\n\t\t\tcase 'InvoiceDistrict':\n\t\t\tcase 'ClientPayment':\n\t\t\t\tpermission_section = 'client';\n\t\t\t\tbreak;\n\t\t\tcase 'InvoiceTransaction':\n\t\t\t\tpermission_section = 'transaction';\n\t\t\t\tbreak;\n\t\t\tcase 'JobItemGroup':\n\t\t\tcase 'JobItem':\n\t\t\t\tpermission_section = 'job_item';\n\t\t\t\tbreak;\n\t\t\tcase 'SavedReport':\n\t\t\t\tpermission_section = 'report';\n\t\t\t\tbreak;\n\t\t\tcase 'RecurringScheduleControl':\n\t\t\t\tpermission_section = 'recurring_schedule';\n\t\t\t\tbreak;\n\t\t\tcase 'RecurringScheduleTemplateControl':\n\t\t\t\tpermission_section = 'recurring_schedule_template';\n\t\t\t\tbreak;\n\t\t\tcase 'KPI':\n\t\t\tcase 'KPIGroup':\n\t\t\t\tpermission_section = 'kpi';\n\t\t\t\tbreak;\n\t\t\tcase 'UserReviewControl':\n\t\t\t\tpermission_section = 'user_review';\n\t\t\t\tbreak;\n\t\t\tcase 'ExceptionPolicyControl':\n\t\t\t\tpermission_section = 'exception_policy';\n\t\t\t\tbreak;\n\t\t\tcase 'ImportCSV':\n\t\t\t\tpermission_section = 'import_csv';\n\t\t\t\tbreak;\n\t\t\tcase 'Invoice':\n\t\t\tcase 'JobInvoice':\n\t\t\t\tpermission_section = 'invoice';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn permission_section;\n\t};\n\n\tvar getPermissionData = function() {\n\t\treturn LocalCacheData.getPermissionData();\n\t};\n\n\treturn {\n\t\tcheckTopLevelPermission: checkTopLevelPermission,\n\t\tvalidate: validate,\n\t\tgetPermissionLevel: getPermissionLevel,\n\t\tgetPermissionData: getPermissionData,\n\t\tHelpMenuValidateAdmin: HelpMenuValidateAdmin,\n\t\tHelpMenuValidateSupervisor: HelpMenuValidateSupervisor,\n\t\timportValidate: importValidate,\n\t\tsubJobApplicationValidate: subJobApplicationValidate\n\t};\n\n} )();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODg0My5qcyIsIm1hcHBpbmdzIjoiOzs7QUFBTzs7QUFFUDtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQSxrQkFBa0I7QUFDbEI7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQTtB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JldHVybiBwZXJtaXNzaW9uX3NlY3Rpb247XG5cdH07XG5cblx0dmFyIGdldFBlcm1pc3Npb25EYXRhID0gZnVuY3Rpb24oKSB7XG5cdFx0cmV0dXJuIExvY2FsQ2FjaGVEYXRhLmdldFBlcm1pc3Npb25EYXRhKCk7XG5cdH07XG5cblx0cmV0dXJuIHtcblx0XHRjaGVja1RvcExldmVsUGVybWlzc2lvbjogY2hlY2tUb3BMZXZlbFBlcm1pc3Npb24sXG5cdFx0dmFsaWRhdGU6IHZhbGlkYXRlLFxuXHRcdGdldFBlcm1pc3Npb25MZXZlbDogZ2V0UGVybWlzc2lvbkxldmVsLFxuXHRcdGdldFBlcm1pc3Npb25EYXRhOiBnZXRQZXJtaXNzaW9uRGF0YSxcblx0XHRIZWxwTWVudVZhbGlkYXRlQWRtaW46IEhlbHBNZW51VmFsaWRhdGVBZG1pbixcblx0XHRIZWxwTWVudVZhbGlkYXRlU3VwZXJ2aXNvcjogSGVscE1lbnVWYWxpZGF0ZVN1cGVydmlzb3IsXG5cdFx0aW1wb3J0VmFsaWRhdGU6IGltcG9ydFZhbGlkYXRlLFxuXHRcdHN1YkpvYkFwcGxpY2F0aW9uVmFsaWRhdGU6IHN1YkpvYkFwcGxpY2F0aW9uVmFsaWRhdGVcblx0fTtcblxufSApKCk7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///8843\n")},587:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"k\": () => (/* binding */ ProgressBar)\n/* harmony export */ });\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7526);\n/* harmony import */ var nanobar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4893);\n/* harmony import */ var nanobar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(nanobar__WEBPACK_IMPORTED_MODULE_1__);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n // need to rely on the default export via CommonJS syntax, hence no named import.\n\nvar ProgressBar = ( function() {\n\n\tvar loading_box = null;\n\t\n\tvar layout_content = null;\n\n\tvar left_offset = 0;\n\n\tvar process_number = false;\n\n\tvar can_close = false;\n\n\tvar timer = null;\n\n\tvar close_time = null;\n\n\tvar circle = null;\n\n\tvar doing_close = false;\n\n\tvar message_id_dic = {};\n\n\tvar updating_message_id = false;\n\n\tvar current_process_id = false;\n\n\tvar _progress_bar_api = false;\n\n\tvar get_progress_timer = null;\n\n\tvar first_start_get_progress_timer = false;\n\n\tvar start_progress_timer = false;\n\n\tvar auto_clear_message_id_dic = {}; //for which api calls don't have return; for example all report view calls\n\n\tvar last_iteration = null;\n\n\tvar temp_message_until_close = '';\n\n\tvar second_timer;\n\n\tvar time_offset;\n\n\tvar nanoBar;\n\n\tvar loading_bar_time;\n\n\tvar no_progress_for_next_call = false;\n\n\tvar showOverlay = function() {\n\t\tGlobal.overlay().addClass( 'overlay' );\n\t\tGlobal.setUINotready();\n\t\tTTPromise.add( 'ProgressBar', 'overlay_visible' );\n\t};\n\n\tvar closeOverlay = function() {\n\t\t//this variable is set in BaseViewController::onContextMenuClick\n\t\tif ( window.clickProcessing == true ) {\n\t\t\twindow.clickProcessing = false;\n\t\t\twindow.clearTimeout( window.clickProcessingHandle );\n\t\t}\n\t\tGlobal.overlay().removeClass( 'overlay' );\n\t\tGlobal.setUIReady();\n\t\tTTPromise.resolve( 'ProgressBar', 'overlay_visible' );\n\t};\n\n\tvar cancelProgressBar = function() {\n\t\tif ( get_progress_timer ) {\n\t\t\tclearInterval( get_progress_timer );\n\t\t\tget_progress_timer = false;\n\t\t}\n\t\tremoveProgressBar( current_process_id );\n\t\tget_progress_timer = false;\n\t\tcurrent_process_id = false;\n\t\tlast_iteration = null;\n\t\tfirst_start_get_progress_timer = false;\n\t};\n\n\tvar showProgressBar = function( message_id, auto_clear, instant ) {\n\n\t\tTTPromise.add( 'ProgressBar', 'MASTER' );\n\t\tif ( no_progress_for_next_call ) {\n\t\t\tno_progress_for_next_call = false;\n\t\t\treturn;\n\t\t}\n\t\tif ( instant ) {\n\t\t\tif ( process_number > 0 && loading_box ) {\n\t\t\t\tloading_box.css( 'display', 'block' );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( !timer ) {\n//\t\t\tclearTimeout( timer );\n\t\t\t\t//Display progress bar after 1 sec\n\t\t\t\ttimer = setTimeout( function() {\n\t\t\t\t\tif ( process_number > 0 && loading_box ) {\n\t\t\t\t\t\tloading_box.css( 'display', 'block' );\n\t\t\t\t\t}\n\n\t\t\t\t}, 1000 );\n\t\t\t}\n\t\t}\n\n\t\tif ( message_id ) {\n\t\t\tmessage_id_dic[message_id] = true;\n\n\t\t\tif ( auto_clear ) {\n\t\t\t\tauto_clear_message_id_dic[message_id] = true;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( message_id && start_progress_timer === false ) {\n\t\t\tstart_progress_timer = setInterval( function() {\n\t\t\t\tgetProgressBarProcess();\n\t\t\t}, 3000 );\n\t\t\tfirst_start_get_progress_timer = true;\n\t\t}\n\n\t\tif ( process_number > 0 ) { //has multi call or the last call is not removed yet\n\t\t\tprocess_number = process_number + 1;\n\t\t\treturn;\n\t\t}\n\n\t\tprocess_number = 1;\n\n\t\tGlobal.addCss( 'global/widgets/loading_bar/LoadingBox.css' );\n\n\t\tclearTimeout( close_time );\n\t\tvar message_label;\n\n\t\tif ( !loading_box ) {\n\t\t\tvar loadingBoxWidget = `\n\t\t\t\t<div class=\"popup-loading\">\n\t\t\t\t\t<div class=\"processing\"></div>\n\t\t\t\t\t<span class=\"close-icon\">x</span>\n\t\t\t\t\t<progress class=\"progress-bar\" max=\"100\" value=\"10\">\n\t\t\t\t\t</progress>\n\t\t\t\t\t<div class=\"complete-info\">100 / 5000 - 15% Complete</div>\n\t\t\t\t\t<div class=\"time-remaining\">11:11</div>\n\t\t\t\t</div>\n\t\t\t`;\n\n\t\t\tvar loadngBox = $( loadingBoxWidget ).attr( 'id', 'progressBar' );\n\n\t\t\tvar close_icon = loadngBox.find( '.close-icon' );\n\n\t\t\tclose_icon.unbind( 'click' ).click( function() {\n\t\t\t\tcancelProgressBar();\n\n\t\t\t} );\n\t\t\t// css only spinner - and yes, it does unfortunately need all those divs. They are for each of the spokes of the circle.\n\t\t\tcircle = $( '<div class=\"lds-spinner\"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>' );\n\n\t\t\t$( 'body' ).append( loadngBox );\n\t\t\tloading_box = $( '#progressBar' );\n\t\t\tmessage_label = loading_box.find( '.processing' );\n\n\t\t\tif ( circle ) {\n\t\t\t\tmessage_label.after( circle );\n\t\t\t}\n\n\t\t\tloading_box.css( 'display', 'none' );\n\t\t\tlayout_content = document.querySelector( '.layout-content' );\n\n\t\t} else {\n\t\t\tmessage_label = loading_box.find( '.processing' );\n\n\t\t\t//If the user is logged in offset the progress bar to be centered inside the content portion of page taking into account the main left menu.\n\t\t\t//However if a wizard is displayed, the progress bar should be centered within the wizard overlay (entire page).\n\t\t\tif ( LocalCacheData.getLoginUser() && left_offset !== layout_content.offsetLeft && !document.querySelector( '.wizard-overlay' ) ) {\n\t\t\t\tleft_offset = ( layout_content.offsetLeft / 2 );\n\t\t\t\tloading_box.css( 'left', 'calc( 50% + ' + left_offset + 'px )' );\n\t\t\t} else {\n\t\t\t\tloading_box.css( 'left', '50%' );\n\t\t\t}\n\n\t\t\tif ( circle ) {\n\t\t\t\tmessage_label.after( circle );\n\t\t\t}\n\n\t\t}\n\n\t\tresetToDefault();\n\t};\n\n\tvar resetToDefault = function() {\n\n\t\tif ( temp_message_until_close ) {\n\t\t\t//Default process message, change this when update progress bar.\n\t\t\tloading_box.find( '.processing' ).text( temp_message_until_close );\n\t\t} else {\n\t\t\t//Default process message, change this when update progress bar.\n\t\t\t// Error: Unable to get property '_' of undefined or null reference in interface/html5/global/ProgressBarManager.js?v=9.0.6-20151231-155042 line 169\n\t\t\tloading_box.find( '.processing' ).text( $.i18n ? $.i18n._( 'Processing...' ) : 'Processing...' );\n\t\t}\n\n\t\tvar complete_info = loading_box.find( '.complete-info' );\n\t\tvar progress_bar = loading_box.find( '.progress-bar' );\n\t\tvar time_remaining = loading_box.find( '.time-remaining' );\n\n\t\tcomplete_info.css( 'display', 'none' );\n\t\tprogress_bar.css( 'display', 'none' );\n\t\ttime_remaining.css( 'display', 'none' );\n\n\t\tcomplete_info.text( 0 + ' / ' + 0 + ' ' + 0 + '%' );\n\t\tprogress_bar.val( 0 );\n\n\t\tlast_iteration = null;\n\n\t};\n\n\tvar changeProgressBarMessage = function( val ) {\n\t\ttemp_message_until_close = val;\n\t\tif ( loading_box ) {\n\t\t\tloading_box.find( '.processing' ).text( val );\n\t\t}\n\n\t};\n\n\tvar updateProgressbar = function( data ) {\n\n\t\tif ( !loading_box ) {\n\t\t\treturn;\n\t\t}\n\n\t\tloading_box.find( '.processing' ).text( data.message );\n\n\t\tvar percentage = data.current_iteration / data.total_iterations;\n\n\t\tvar complete_info = loading_box.find( '.complete-info' );\n\t\tvar progress_bar = loading_box.find( '.progress-bar' );\n\t\tvar time_remaining = loading_box.find( '.time-remaining' );\n\n\t\tcomplete_info.css( 'display', 'block' );\n\t\tprogress_bar.css( 'display', 'block' );\n\t\ttime_remaining.css( 'display', 'block' );\n\n\t\tcomplete_info.text( data.current_iteration + ' / ' + data.total_iterations + ' ' + ( percentage * 100 ).toFixed( 0 ) + '%' );\n\t\tprogress_bar.prop( 'value', ( percentage * 100 ) );\n\n\t\tif ( !last_iteration ) {\n\t\t\ttime_remaining.text( 'Calculating remaining time...' );\n\t\t} else {\n\n\t\t\tif ( last_iteration !== data.current_iteration || !second_timer ) {\n\n\t\t\t\ttime_offset = ( data.last_update_time - data.start_time ) * ( data.total_iterations / data.current_iteration );\n\t\t\t\ttime_offset = time_offset - ( data.last_update_time - data.start_time );\n\n\t\t\t\tif ( isNaN( time_offset ) || time_offset <= 0 ) {\n\t\t\t\t\ttime_offset = 0;\n\t\t\t\t}\n\n\t\t\t\t//Error: 'console' is undefined in /interface/html5/global/ProgressBarManager.js?v=8.0.0-20141117-153515 line 224\n\t\t\t\ttime_remaining.text( Global.getTimeUnit( time_offset, '99' ) );\n\t\t\t}\n\t\t\tsecondDown();\n\n\t\t}\n\n\t\tlast_iteration = data.current_iteration;\n\n\t};\n\n\tvar noProgressForNextCall = function() {\n\t\tno_progress_for_next_call = true;\n\t};\n\n\tvar secondDown = function() {\n\n\t\t//calculate down time every one second\n\t\tif ( !second_timer ) {\n\t\t\tvar time_remaining = loading_box.find( '.time-remaining' );\n\t\t\tsecond_timer = setInterval( function() {\n\n\t\t\t\tif ( isNaN( time_offset ) || time_offset <= 0 ) {\n\t\t\t\t\ttime_offset = 0;\n\t\t\t\t}\n\n\t\t\t\tif ( time_offset > 0 ) {\n\t\t\t\t\ttime_offset = ( time_offset - 1 );\n\t\t\t\t}\n\n\t\t\t\tif ( time_offset <= 0 ) {\n\t\t\t\t\ttime_offset = 0;\n\t\t\t\t}\n\n\t\t\t\ttime_remaining.text( Global.getTimeUnit( time_offset, '99' ) );\n\t\t\t}, 1000 );\n\t\t}\n\n\t};\n\n\tvar getProgressBarProcess = function() {\n\t\tif ( !LocalCacheData.getLoginData() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !current_process_id ) {\n\t\t\tfor ( var key in message_id_dic ) {\n\t\t\t\tcurrent_process_id = key;\n\n\t\t\t\tdelete message_id_dic[key];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( current_process_id && $.type( 'current_process_id' ) === 'string' ) {\n\t\t\t_services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_0__/* .TTAPI.APIProgressBar.getProgressBar */ .y.APIProgressBar.getProgressBar( current_process_id, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar res_data = result.getResult();\n\n\t\t\t\t\t//Means error in progress bar\n\t\t\t\t\tif ( res_data.hasOwnProperty( 'status_id' ) && res_data.status_id === 9999 ) {\n\t\t\t\t\t\tstopProgress();\n\t\t\t\t\t\tTAlertManager.showAlert( res_data.message );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( res_data === true ||\n\t\t\t\t\t\t\t( $.type( res_data ) === 'array' && res_data.length === 0 ) || !res_data.total_iterations ||\n\t\t\t\t\t\t\t$.type( res_data.total_iterations ) !== 'number' ) {\n\t\t\t\t\t\t\tstopProgress();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tupdateProgressbar( res_data );\n\t\t\t\t\t\t\tif ( first_start_get_progress_timer ) {\n\t\t\t\t\t\t\t\tfirst_start_get_progress_timer = false;\n\n\t\t\t\t\t\t\t\t//prevent over-writing active handle. see bug #2196\n\t\t\t\t\t\t\t\tif ( start_progress_timer != false && get_progress_timer == false ) {\n\t\t\t\t\t\t\t\t\t//start interval needs to be reset to FALSE to trigger start code in showProgressBar\n\t\t\t\t\t\t\t\t\tclearInterval( start_progress_timer );\n\t\t\t\t\t\t\t\t\tstart_progress_timer = false;\n\n\t\t\t\t\t\t\t\t\tget_progress_timer = setInterval( function() {\n\t\t\t\t\t\t\t\t\t\tgetProgressBarProcess();\n\t\t\t\t\t\t\t\t\t}, 2000 );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tfunction stopProgress() {\n\t\t\tif ( start_progress_timer ) {\n\t\t\t\tclearInterval( start_progress_timer );\n\t\t\t\tstart_progress_timer = false;\n\t\t\t}\n\t\t\tif ( get_progress_timer ) {\n\t\t\t\tclearInterval( get_progress_timer );\n\t\t\t\tget_progress_timer = false;\n\t\t\t}\n\n\t\t\tif ( auto_clear_message_id_dic[current_process_id] ) {\n\t\t\t\tremoveProgressBar( current_process_id );\n\t\t\t}\n\n\t\t\tget_progress_timer = false;\n\t\t\tcurrent_process_id = false;\n\t\t\tlast_iteration = null;\n\t\t\tfirst_start_get_progress_timer = false;\n\t\t}\n\n\t};\n\n\tvar removeProgressBar = function( message_id ) {\n\t\tif ( message_id ) {\n\t\t\tdelete message_id_dic[message_id];\n\t\t\tdelete auto_clear_message_id_dic[message_id];\n\n\t\t\tif ( current_process_id === message_id ) {\n\t\t\t\tcurrent_process_id = false;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( process_number > 0 ) {\n\t\t\tprocess_number = process_number - 1;\n\n\t\t\tif ( process_number === 0 ) {\n\t\t\t\tremoveProgressBar();\n\t\t\t}\n\n\t\t} else {\n\t\t\tif ( loading_box ) {\n\t\t\t\tdoing_close = true;\n\t\t\t\tclearTimeout( close_time );\n\n\t\t\t\t//shorten timeout in unit test mode.\n\t\t\t\tvar close_time_timeout = Global.UNIT_TEST_MODE ? 10 : 500;\n\t\t\t\tclose_time = setTimeout( function() {\n\t\t\t\t\tcloseOverlay();\n\n\t\t\t\t\tif ( second_timer ) {\n\t\t\t\t\t\tclearInterval( second_timer );\n\t\t\t\t\t\tsecond_timer = null;\n\t\t\t\t\t}\n\n\t\t\t\t\ttimer = null;\n\t\t\t\t\ttemp_message_until_close = '';\n\t\t\t\t\tif ( loading_box ) {\n\t\t\t\t\t\tloading_box.css( 'display', 'none' );\n\n\t\t\t\t\t\tif ( get_progress_timer ) {\n\t\t\t\t\t\t\tclearInterval( get_progress_timer );\n\t\t\t\t\t\t\tget_progress_timer = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( start_progress_timer ) {\n\t\t\t\t\t\t\tclearInterval( start_progress_timer );\n\t\t\t\t\t\t\tstart_progress_timer = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tTTPromise.resolve( 'ProgressBar', 'MASTER' );\n\t\t\t\t}, close_time_timeout );\n\t\t\t}\n\t\t}\n\n\t};\n\n\tvar showNanobar = function() {\n\t\tif ( !nanoBar ) {\n\t\t\tvar options = {\n\t\t\t\tbg: 'red',\n\t\t\t\tid: 'nano-bar'\n\t\t\t};\n\t\t\tnanoBar = new (nanobar__WEBPACK_IMPORTED_MODULE_1___default())( options );\n\t\t}\n\t\tvar percentage = 0;\n\t\tloading_bar_time && clearInterval( loading_bar_time );\n\t\tloading_bar_time = setInterval( function() {\n\t\t\tif ( percentage < 80 ) {\n\t\t\t\tpercentage = percentage + 20;\n\t\t\t\tnanoBar.go( percentage );\n\t\t\t} else if ( percentage === 80 ) {\n\t\t\t\tpercentage = percentage + 10;\n\t\t\t\tnanoBar.go( percentage );\n\t\t\t}\n\n\t\t}, 1000 );\n\t};\n\n\tvar removeNanobar = function() {\n\t\tloading_bar_time && clearInterval( loading_bar_time );\n\t\tnanoBar && nanoBar.go( 100 );\n\t\tcloseOverlay();\n\t};\n\n\treturn {\n\t\tshowProgressBar: showProgressBar,\n\t\tremoveProgressBar: removeProgressBar,\n\t\tshowOverlay: showOverlay,\n\t\tcloseOverlay: closeOverlay,\n\t\tmessage_id_dic: message_id_dic,\n\t\tchangeProgressBarMessage: changeProgressBarMessage,\n\t\tcancelProgressBar: cancelProgressBar,\n\t\tshowNanobar: showNanobar,\n\t\tremoveNanobar: removeNanobar,\n\t\tnoProgressForNextCall: noProgressForNextCall\n\t};\n\n} )();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTg3LmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBcUQ7QUFDdkIsQ0FBQzs7QUFFeEI7O0FBRVA7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBLHFDQUFxQyx5Q0FBeUM7O0FBRTlFOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0F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yLFxuXHRcdHJlbW92ZU5hbm9iYXI6IHJlbW92ZU5hbm9iYXIsXG5cdFx0bm9Qcm9ncmVzc0Zvck5leHRDYWxsOiBub1Byb2dyZXNzRm9yTmV4dENhbGxcblx0fTtcblxufSApKCk7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///587\n")},7046:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"b\": () => (/* binding */ RateLimit)\n/* harmony export */ });\n/**\n * RateLimit class\n * Based on classes/modules/core/RateLimit.class.php\n *\n * id: string to group similar calls\n * allowed_calls: integer that represents the number of calls in the time_frame\n * time_frame: integer number of seconds in which defined number of allowed_calls of specified id may be made\n *\n * Basic use case:\n *\n * RateLimit.setID( 101 ); //unique identifier for this group of calls\n * RateLimit.setAllowedCalls( 10 ); //max number of calls in time frame\n * RateLimit.setTimeFrame( 900 ); //15 minutes in seconds\n * if ( RateLimit.check() ) {\n * //do rate limited activity\n * } else {\n * //do not do rate limited activity\n * }\n *\n */\nvar RateLimit = function() {\n};\n\n//attributes\nRateLimit.memory = {};\nRateLimit.id = '';\nRateLimit.allowed_calls = 10;\nRateLimit.time_frame = 3600; //1 hr\n\nRateLimit.getID = function() {\n\treturn this.id;\n};\nRateLimit.setID = function( value ) {\n\tif ( value != '' ) {\n\t\tthis.id = value;\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nRateLimit.getAllowedCalls = function() {\n\treturn this.allowed_calls;\n};\nRateLimit.setAllowedCalls = function( value ) {\n\tif ( value != '' ) {\n\t\tthis.allowed_calls = value;\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nRateLimit.getTimeFrame = function() {\n\treturn this.time_frame;\n};\nRateLimit.setTimeFrame = function( value ) {\n\tif ( value != '' ) {\n\t\tthis.time_frame = value;\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nRateLimit.getRateData = function() {\n\tif ( typeof ( this.memory[this.id] ) == 'undefined' ) {\n\t\treturn null;\n\t}\n\treturn this.memory[this.id];\n};\nRateLimit.setRateData = function( value ) {\n\tif ( typeof ( this.memory[this.id] ) == 'undefined' ) {\n\t\tthis.memory[this.id] = {};\n\t}\n\tif ( value != '' ) {\n\t\tthis.memory[this.id] = value;\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nRateLimit.getAttempts = function() {\n\tvar rate_data = this.getRateData();\n\tif ( Global.isSet( rate_data['attempts'] ) ) {\n\t\treturn rate_data['attempts'];\n\t}\n\n\treturn false;\n};\n\n/**\n * @returns {boolean}\n */\nRateLimit.check = function() {\n\tif ( this.getID() != '' ) {\n\t\tvar rate_data = this.getRateData();\n\t\tvar new_time = ( new Date() ).getTime();\n\n\t\tif ( Global.isSet( rate_data ) == false ) {\n\t\t\trate_data = {\n\t\t\t\tfirst_date: new_time,\n\t\t\t\tattempts: 0\n\t\t\t};\n\t\t} else if ( Global.isSet( rate_data ) ) {\n\n\t\t\tvar time_frame_milliseconds = this.getTimeFrame() * 1000;\n\t\t\tif ( rate_data.attempts > this.getAllowedCalls() && rate_data.first_date >= ( new_time - time_frame_milliseconds ) ) {\n\t\t\t\tDebug.Text( 'RateLimit limiting [' + rate_data.attempts + '/' + this.getAllowedCalls() + '] in ' + ( Math.floor( ( new_time - rate_data.first_date ) / 1000 ) ) + '/' + this.getTimeFrame() + 'sec', 'RateLimit.js', 'RateLimit', 'check', 10 );\n\t\t\t\treturn false;\n\t\t\t} else if ( rate_data.first_date < new_time - time_frame_milliseconds ) {\n\t\t\t\trate_data = {\n\t\t\t\t\tfirst_date: new_time,\n\t\t\t\t\tattempts: 0\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\trate_data.attempts++;\n\t\tthis.setRateData( rate_data );\n\t}\n\treturn true;\n};\n\nRateLimit.delete = function( id ) {\n\tif ( id != null ) {\n\t\tthis.id = id;\n\t}\n\tdelete this.memory[this.id];\n};\n//# sourceURL=[module]\n//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XRSYXRlRGF0YSggcmF0ZV9kYXRhICk7XG5cdH1cblx0cmV0dXJuIHRydWU7XG59O1xuXG5SYXRlTGltaXQuZGVsZXRlID0gZnVuY3Rpb24oIGlkICkge1xuXHRpZiAoIGlkICE9IG51bGwgKSB7XG5cdFx0dGhpcy5pZCA9IGlkO1xuXHR9XG5cdGRlbGV0ZSB0aGlzLm1lbW9yeVt0aGlzLmlkXTtcbn07XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7046\n")},9239:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"K\": () => (/* binding */ TAlertManager)\n/* harmony export */ });\n/* provided dependency */ var $ = __webpack_require__(9755);\nvar TAlertManager = ( function() {\n\n\tvar view = null;\n\n\tvar isShownNetworkAlert = false;\n\n\tvar closeBrowserBanner = function() {\n\t\t$( '.browser-banner' ).remove();\n\t};\n\n\tvar showBrowserTopBanner = function() {\n\t\t// if ( ie && ie <= 11 ) {\n\t\t// \tvar div = $( '<div class=\"browser-banner\"><a href=\"https://www.timetrex.com/supported-web-browsers\" target=\"_blank\"><span id=\"browser-top-banner\" class=\"label\"><strong>WARNING</strong>: ' + LocalCacheData.getLoginData().application_name + ' will no longer support <strong>Internet Explorer 11</strong> effective <strong>January 14th, 2020</strong>.<br><strong>Please upgrade to Microsoft Edge, Chrome or FireFox immediately to continue using TimeTrex.</strong></span></a></div>' );\n\t\t// \t$( 'body' ).append( div );\n\t\t// }\n\t};\n\n\tvar showNetworkErrorAlert = function( jqXHR, textStatus, errorThrown ) {\n\t\t//#2514 - status 0 is caused by browser cancelling the request. There is no status because there was no request.\n\t\tif ( jqXHR.status == 0 ) {\n\t\t\tif ( APIGlobal.pre_login_data.production !== true ) {\n\t\t\t\tconsole.error( 'Browser cancelled request... jqXHR: Status=0' );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif ( textStatus == 'parsererror' ) {\n\t\t\tGlobal.sendErrorReport( textStatus + ' (' + jqXHR.status + '): \"' + errorThrown + '\" FROM TAlertManager::showNetworkErrorAlert():\\n\\n' + ( jqXHR.responseText ? jqXHR.responseText : 'N/A' ), false, false, jqXHR );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !isShownNetworkAlert ) {\n\t\t\tTAlertManager.showAlert( Global.network_lost_msg + '<br><br>' + 'Error: ' + textStatus + ' (' + jqXHR.status + '): <br>\"' + errorThrown + '\"' + '<br><hr>' + ( jqXHR.responseText ? jqXHR.responseText : 'N/A' ) + ' (' + jqXHR.status + ')', 'Error', function() {\n\t\t\t\tisShownNetworkAlert = false;\n\t\t\t} );\n\t\t\tisShownNetworkAlert = true;\n\t\t\tGlobal.sendAnalyticsEvent( 'alert-manager', 'error:network', 'network-error: jqXHR-status: ' + jqXHR.status + ' Error: ' + textStatus );\n\t\t}\n\t};\n\n\tvar showPreSessionAlert = function() {\n\t\tvar result = $( '<div class=\"session-alert\"> ' +\n\t\t\t'<span class=\"close-icon\">X</span>' +\n\t\t\t'<span class=\"content\"></span>' +\n\t\t\t'</div>' );\n\t\tsetTimeout( function() {\n\t\t\t$( 'body' ).append( result );\n\t\t\tresult.find( '.content' ).html( $.i18n._( 'Previous Session' ) );\n\t\t\tvar button = result.find( '.close-icon' );\n\t\t\tbutton.bind( 'click', function() {\n\t\t\t\tremovePreSession();\n\t\t\t} );\n\t\t\tresult.bind( 'click', function() {\n\t\t\t\tbackToPreSession();\n\t\t\t} );\n\t\t}, 100 );\n\n\t\tfunction removePreSession() {\n\t\t\tresult.remove();\n\t\t\tresult = null;\n\n\t\t\tdeleteCookie( 'AlternateSessionData', LocalCacheData.cookie_path, Global.getHost() );\n\t\t}\n\n\t\tfunction backToPreSession() {\n\t\t\tvar host = Global.getHost();\n\t\t\ttry { //Prevent JS exception if we can't parse alternate_session_data for some reason.\n\t\t\t\tvar alternate_session_data = JSON.parse( getCookie( 'AlternateSessionData' ) );\n\t\t\t\tif ( !alternate_session_data ) {\n\t\t\t\t\tDebug.Text( 'No alternate_session_data exists.', 'TAlertManager.js', 'TAlertManager', 'backToPreSession', 10 );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch ( e ) {\n\t\t\t\tDebug.Text( e.message, 'TAlertManager.js', 'showPreSessionAlert', 'backToPreSession', 10 );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar url = alternate_session_data.previous_session_url;\n\t\t\tvar previous_cookie_path = alternate_session_data.previous_cookie_path;\n\n\t\t\talternate_session_data = {\n\t\t\t\tnew_session_id: alternate_session_data.previous_session_id,\n\t\t\t\tprevious_session_view: alternate_session_data.previous_session_view\n\t\t\t};\n\n\t\t\tsetCookie( 'AlternateSessionData', JSON.stringify( alternate_session_data ), 1, previous_cookie_path, host );\n\n\t\t\tGlobal.setURLToBrowser( url + '#!m=Login' );\n\t\t\tGlobal.needReloadBrowser = true;\n\n\t\t\tresult.remove();\n\t\t\tresult = null;\n\t\t}\n\t};\n\n\tvar showErrorAlert = function( result ) {\n\t\tvar details = result.getDetails();\n\n\t\tif ( details.hasOwnProperty( 'error' ) ) {\n\n\t\t}\n\t\tif ( !details ) {\n\t\t\tdetails = result.getDescription(); // If the details is empty, try to get description to show.\n\t\t}\n\t\tvar error_string = '';\n\n\t\tif ( Global.isArray( details ) || typeof details === 'object' ) {\n\t\t\terror_string = Global.convertValidationErrorToString( details );\n\t\t} else {\n\n\t\t\terror_string = details;\n\t\t}\n\n\t\tshowAlert( error_string, 'Error' );\n\n\t};\n\n\tvar showWarningAlert = function( result, callBack ) {\n\t\tvar details = result.getDetails();\n\t\tvar ul_container = $( '<ol>' );\n\t\tif ( Global.isArray( details ) || typeof details === 'object' ) {\n\t\t\t$.each( details, function( index, val ) {\n\t\t\t\tif ( val.hasOwnProperty( 'warning' ) ) {\n\t\t\t\t\tval = val.warning;\n\t\t\t\t}\n\t\t\t\tfor ( var key in val ) {\n\t\t\t\t\tvar li = $( '<li>' );\n\t\t\t\t\tvar child_val = val[key];\n\t\t\t\t\tvar has_child = false;\n\t\t\t\t\tfor ( var child_key in child_val ) {\n\t\t\t\t\t\tif ( child_val.hasOwnProperty( child_key ) ) {\n\t\t\t\t\t\t\thas_child = true;\n\t\t\t\t\t\t\tli = $( '<li>' );\n\t\t\t\t\t\t\tli.append( child_val[child_key] );\n\t\t\t\t\t\t\tul_container.append( li );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( !has_child ) {\n\t\t\t\t\t\tli.append( val[key] );\n\t\t\t\t\t\tul_container.append( li );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t\tvar div = $( '<div>' );\n\t\tvar p = $( '<p>' );\n\t\tp.append( $.i18n._( 'Are you sure you wish to save this record without correcting the above warnings?' ) );\n\t\tdiv.append( ul_container );\n\t\tdiv.append( p );\n\t\tshowConfirmAlert( div[0], 'Warning', callBack, 'Save', 'Cancel' );\n\t};\n\n\tvar showAlert = function( content, title, callBack ) {\n\t\tif ( !title ) {\n\t\t\ttitle = $.i18n._( 'Message' );\n\t\t}\n\n\t\tvar result = $( '<div class=\"t-alert\">' +\n\t\t\t'<div class=\"content-div\"><span class=\"content\"></span></div>' +\n\t\t\t'<span class=\"title\"></span>' +\n\t\t\t'<div class=\"bottom-bar\">' +\n\t\t\t'<button class=\"t-button\" id=\"t-alert-close\">Close</button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' );\n\t\tsetTimeout( function() {\n\t\t\tif ( view !== null ) {\n\n\t\t\t\tvar cContent = view.find( '.content' ).text();\n\n\t\t\t\tif ( cContent === content ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tremove();\n\n\t\t\t}\n\t\t\tview = result;\n\t\t\t$( 'body' ).append( result );\n\t\t\tresult.find( '.title' ).text( title );\n\t\t\tresult.find( '.content' ).html( content );\n\t\t\tvar button = result.find( '.t-button' );\n\t\t\tbutton.bind( 'click', function() {\n\t\t\t\tremove();\n\t\t\t\tif ( callBack ) {\n\t\t\t\t\tcallBack();\n\t\t\t\t}\n\t\t\t} );\n\t\t\tbutton.focus();\n\t\t\tbutton.bind( 'keydown', function( e ) {\n\t\t\t\te.stopPropagation();\n\t\t\t\tif ( e.keyCode === 13 ) {\n\t\t\t\t\tremove();\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tGlobal.setUIInitComplete();\n\t\t}, 100 );\n\n\t};\n\n\tvar showConfirmAlert = function( content, title, callBackFunction, yesLabel, noLabel ) {\n\n\t\tif ( !Global.isSet( title ) ) {\n\t\t\ttitle = $.i18n._( 'Message' );\n\t\t}\n\n\t\tif ( !Global.isSet( yesLabel ) ) {\n\t\t\tyesLabel = $.i18n._( 'Yes' );\n\t\t}\n\n\t\tif ( !Global.isSet( noLabel ) ) {\n\t\t\tnoLabel = $.i18n._( 'No' );\n\t\t}\n\n\t\tif ( view !== null ) {\n\n\t\t\tvar cContent = view.find( '.content' ).text();\n\n\t\t\tif ( cContent === content ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tremove();\n\t\t}\n\t\tvar result = $( '<div class=\"confirm-alert\"> ' +\n\t\t\t'<div class=\"content-div\"><span class=\"content\"></span></div>' +\n\t\t\t'<span class=\"title\"></span>' +\n\t\t\t'<div class=\"bottom-bar\">' +\n\t\t\t'<button id=\"yesBtn\" class=\"t-button bottom-bar-yes-btn\"></button>' +\n\t\t\t'<button id=\"noBtn\" class=\"t-button\"></button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' );\n\t\tview = result;\n\t\t$( 'body' ).append( result );\n\n\t\tresult.find( '#yesBtn' ).text( yesLabel );\n\t\tresult.find( '#noBtn' ).text( noLabel );\n\t\tresult.find( '.title' ).text( title );\n\n\t\tresult.find( '.content' ).html( content );\n\n\t\tresult.find( '#yesBtn' ).bind( 'click', function() {\n\t\t\tremove();\n\t\t\tcallBackFunction( true );\n\n\t\t} );\n\n\t\tresult.find( '#noBtn' ).bind( 'click', function() {\n\t\t\tremove();\n\t\t\tcallBackFunction( false );\n\n\t\t} );\n\n\t\tGlobal.setUIInitComplete();\n\t};\n\n\tvar showFlexAlert = function( title, content, form_type, form_data, callBackFunction, width, continue_label, cancel_label ) {\n\t\tGlobal.setUINotready();\n\n\t\tvar show_continue_button = true;\n\t\tvar show_cancel_button = true;\n\n\t\tif ( !continue_label ) {\n\t\t\tcontinue_label = $.i18n._( 'Continue' );\n\t\t}\n\n\t\tif ( !cancel_label ) {\n\t\t\tcancel_label = $.i18n._( 'Cancel' );\n\t\t}\n\n\t\tvar result = $( '<div class=\"confirm-alert\"> ' +\n\t\t\t'<div><span class=\"content\"></span></div>' +\n\t\t\t'<span class=\"title\"></span>' +\n\t\t\t'<div style=\"margin-top: 2rem; margin-bottom: 2rem\" id=\"form-holder\"></div>' +\n\t\t\t'<div style=\"margin-bottom: 1rem\" class=\"bottom-bar\">' +\n\t\t\t'<button id=\"yesBtn\" class=\"t-button bottom-bar-yes-btn\"></button>' +\n\t\t\t'<button id=\"noBtn\" class=\"t-button\"></button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' )\n\n\t\tif ( width ) {\n\t\t\tresult.css( 'width', width );\n\t\t}\n\n\t\tview = result;\n\t\t$( 'body' ).append( result );\n\n\t\tif ( form_type === 'dropdown' ) {\n\t\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\t\tform_item_input.TComboBox();\n\t\t\tform_item_input.setSourceData( form_data );\n\n\t\t\tresult.find( '#yesBtn' ).bind( 'click', function() {\n\t\t\t\tremove();\n\t\t\t\tcallBackFunction( result.find( 'select' ).val() );\n\t\t\t} );\n\t\t} else if ( form_type === 'password' ) {\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.PASSWORD_INPUT );\n\t\t\tform_item_input.TPasswordInput();\n\n\t\t\tresult.find( '#yesBtn' ).bind( 'click', function() {\n\t\t\t\tremove();\n\t\t\t\tcallBackFunction( result.find( '[type=password]' ).val() );\n\t\t\t} );\n\t\t} else if ( form_type === 'text' ) {\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tform_item_input.TTextInput();\n\t\t\tform_item_input.setValue( form_data );\n\n\t\t\tif ( width ) {\n\t\t\t\tform_item_input.width( ( width - 20 ) );\n\t\t\t}\n\n\t\t\tshow_cancel_button = false;\n\n\t\t\tresult.find( '#yesBtn' ).bind( 'click', function() {\n\t\t\t\tremove();\n\t\t\t} );\n\t\t} else if ( form_type === 'word_match' ) {\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\tform_item_input.TTextInput();\n\n\t\t\tresult.find( '#yesBtn' ).bind( 'click', function() {\n\t\t\t\tif ( result.find( '[type=text]' ).val() === form_data ) {\n\t\t\t\t\tremove();\n\t\t\t\t\tcallBackFunction( true );\n\t\t\t\t} else {\n\t\t\t\t\tcallBackFunction( false );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tresult.find( '#form-holder' ).append( form_item_input );\n\n\t\tresult.find( '#noBtn' ).bind( 'click', function() {\n\t\t\tremove();\n\t\t\tcallBackFunction( false );\n\t\t} );\n\n\t\tresult.find( '#yesBtn' ).text( continue_label );\n\t\tresult.find( '#noBtn' ).text( cancel_label );\n\n\t\tresult.find( '.title' ).text( title );\n\t\tresult.find( '.content' ).html( content );\n\n\t\tif ( show_continue_button == false ) {\n\t\t\tresult.find( '#yesBtn' ).hide();\n\t\t}\n\n\t\tif ( show_cancel_button == false ) {\n\t\t\tresult.find( '#noBtn' ).hide();\n\t\t}\n\n\t\tGlobal.setUIInitComplete();\n\t};\n\n\n\tvar showModalAlert = function( category, step, callBackFunction, img_src ) {\n\t\tlet top_image = '';\n\t\tlet title = '';\n\t\tlet content = '';\n\t\tlet additional_body_style = '';\n\t\tlet button_label = $.i18n._( 'Yes' );\n\t\tlet button_color = '#228b22';\n\n\t\tif ( category === 'push_notification' ) {\n\t\t\ttop_image = '<img class =\"modal-alert-image\" src =\"' + Global.getRealImagePath( 'images/bell_permissions.svg' ) + '\">';\n\t\t\ttitle = $.i18n._( 'Turn on Notifications' );\n\n\t\t\tswitch ( step ) {\n\t\t\t\tcase 'ask':\n\t\t\t\t\tbutton_label = $.i18n._( 'Yes, turn on notifications!' );\n\t\t\t\t\tcontent = LocalCacheData.getCurrentCompany().name + ' ' + $.i18n._( 'wants permission to notify you of important messages or alerts related to your employment. You can change your notification settings at anytime.' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'wait_for_permission':\n\t\t\t\t\tbutton_label = $.i18n._( 'I don\\'t see it?' );\n\t\t\t\t\tbutton_color = '#AE0000';\n\t\t\t\t\t// Some browsers by default block push notification permission we need to detect them to show user a different prompt.\n\t\t\t\t\tif ( NotificationConsumer.detectBrowserNeedsExtraPermission() === true || Notification.permission === 'denied' ) {\n\t\t\t\t\t\t// User needs to enable push notifications on the browser.\n\t\t\t\t\t\tcontent = $.i18n._( 'A popup should appear on your screen, click \"ALLOW\" to enable notifications. If you don\\'t see it, you may need to enable notifications in your browser settings.' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontent = $.i18n._( 'A popup should appear on your screen, click \"ALLOW\" to enable notifications.' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'help_text':\n\t\t\t\t\tbutton_label = $.i18n._( 'Ok, done!' );\n\t\t\t\t\tif ( Global.getBrowserVendor() === 'Edge' ) {\n\t\t\t\t\t\tcontent = $.i18n._( '1. Click the icon to the left of the address (URL) bar to view settings.<br>' +\n\t\t\t\t\t\t\t'2. Click \"Permissions for this Site\"<br>' +\n\t\t\t\t\t\t\t'3. To the right of \"Notifications\" set the option to \"ALLOW\".' );\n\t\t\t\t\t} else if ( Global.getBrowserVendor() === 'Firefox' ) {\n\t\t\t\t\t\tcontent = $.i18n._( '1. Click the icon to the left of the address (URL) bar to view settings.<br>' +\n\t\t\t\t\t\t\t'2. Click the \"X\" next Notifications to remove blocked permissions and then refresh the browser.<br>' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontent = $.i18n._( '1. Click the icon to the left of the address (URL) bar to view settings.<br>' +\n\t\t\t\t\t\t\t'2. Click \"Site settings\"<br>' +\n\t\t\t\t\t\t\t'3. To the right of \"Notifications\" set the option to \"ALLOW\".' );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else if ( category === 'multifactor_authentication' ) {\n\t\t\ttitle = $.i18n._( 'Multifactor Authentication Instructions' );\n\n\t\t\tswitch ( step ) {\n\t\t\t\tcase 'download_instructions':\n\t\t\t\t\tbutton_label = $.i18n._( 'Ok' );\n\t\t\t\t\tbutton_color = '#426d9d';\n\t\t\t\t\tadditional_body_style = 'style=\"display: block; padding-left: 2rem; padding-right: 2rem; font-size: 1.1rem;\"';\n\n\t\t\t\t\tcontent = '<br>';\n\t\t\t\t\tcontent += '1.' + $.i18n._( 'Please download the TimeTrex app from the App Store on your device.' ) + '<br><br>';\n\t\t\t\t\tcontent += '2.' + $.i18n._( ' Once installed, on the first step of the \"Setup Wizard\", tap the \"QR Code\" icon at the bottom right to scan the below QR Code.' ) + '<br>';\n\t\t\t\t\tcontent += '<img class =\"modal-alert-image\" style=\"margin-top: 10px;\" src =\"' + img_src + '\">';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tGlobal.setUINotready();\n\n\t\tvar result = $( '<div class=\"modal-alert\"> ' +\n\t\t\t'<div class=\"modal-alert-content\">' +\n\t\t\t'<span class=\"modal-alert-close\">×</span>' +\n\t\t\ttop_image +\n\t\t\t'<h2 class=\"modal-alert-title\"></h2>' +\n\t\t\t'<div class=\"modal-alert-body\" ' + additional_body_style + '></div>' +\n\t\t\t'<button type=\"submit\" class=\"permission-button-yes\" style=\"background: ' + button_color + '\"></button>' +\n\t\t\t'</div>' +\n\t\t\t'</div>' );\n\t\tview = result;\n\t\t$( 'body' ).append( result );\n\n\t\tresult.find( '.permission-button-yes' ).text( button_label );\n\t\tresult.find( '.modal-alert-title' ).text( title );\n\n\t\tresult.find( '.modal-alert-body' ).html( content );\n\n\t\tresult.find( '.permission-button-yes' ).bind( 'click', function() {\n\t\t\tremove();\n\t\t\tif ( callBackFunction ) {\n\t\t\t\tcallBackFunction( true );\n\t\t\t}\n\t\t\tGlobal.setUIReady();\n\t\t} );\n\n\t\tresult.find( '.modal-alert-close' ).bind( 'click', function() {\n\t\t\tremove();\n\t\t\tif ( callBackFunction ) {\n\t\t\t\tcallBackFunction( false );\n\t\t\t}\n\t\t\tGlobal.setUIReady();\n\t\t} );\n\n\t\tGlobal.setUIInitComplete();\n\t};\n\n\tvar remove = function() {\n\n\t\tif ( view ) {\n\t\t\tview.remove();\n\t\t\tview = null;\n\t\t}\n\n\t};\n\n\treturn {\n\t\tshowBrowserTopBanner: showBrowserTopBanner,\n\t\tcloseBrowserBanner: closeBrowserBanner,\n\t\tshowConfirmAlert: showConfirmAlert,\n\t\tshowModalAlert: showModalAlert,\n\t\tshowAlert: showAlert,\n\t\tshowErrorAlert: showErrorAlert,\n\t\tshowPreSessionAlert: showPreSessionAlert,\n\t\tshowFlexAlert: showFlexAlert,\n\t\tshowWarningAlert: showWarningAlert,\n\t\tshowNetworkErrorAlert: showNetworkErrorAlert\n\t};\n\n} )();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIzOS5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQU87O0FBRVA7O0FBRUE7O0FBRUE7QUFDQSxFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxLQU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R2aWV3LnJlbW92ZSgpO1xuXHRcdFx0dmlldyA9IG51bGw7XG5cdFx0fVxuXG5cdH07XG5cblx0cmV0dXJuIHtcblx0XHRzaG93QnJvd3NlclRvcEJhbm5lcjogc2hvd0Jyb3dzZXJUb3BCYW5uZXIsXG5cdFx0Y2xvc2VCcm93c2VyQmFubmVyOiBjbG9zZUJyb3dzZXJCYW5uZXIsXG5cdFx0c2hvd0NvbmZpcm1BbGVydDogc2hvd0NvbmZpcm1BbGVydCxcblx0XHRzaG93TW9kYWxBbGVydDogc2hvd01vZGFsQWxlcnQsXG5cdFx0c2hvd0FsZXJ0OiBzaG93QWxlcnQsXG5cdFx0c2hvd0Vycm9yQWxlcnQ6IHNob3dFcnJvckFsZXJ0LFxuXHRcdHNob3dQcmVTZXNzaW9uQWxlcnQ6IHNob3dQcmVTZXNzaW9uQWxlcnQsXG5cdFx0c2hvd0ZsZXhBbGVydDogc2hvd0ZsZXhBbGVydCxcblx0XHRzaG93V2FybmluZ0FsZXJ0OiBzaG93V2FybmluZ0FsZXJ0LFxuXHRcdHNob3dOZXR3b3JrRXJyb3JBbGVydDogc2hvd05ldHdvcmtFcnJvckFsZXJ0XG5cdH07XG5cbn0gKSgpO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9239\n")},9504:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"j\": () => (/* binding */ TTPromise)\n/* harmony export */ });\n/* provided dependency */ var $ = __webpack_require__(9755);\nvar TTPromise = {\n\tpromises: {},\n\n\tadd: function( category, key ) {\n\t\tif ( !this.promises[category] || !this.promises[category][key] || ( this.promises[category][key].state() != 'pending' ) ) {\n\t\t\tDebug.Text( 'Promise: add: ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'add', 11 );\n\t\t\tif ( typeof this.promises[category] == 'undefined' ) {\n\t\t\t\tthis.promises[category] = {};\n\t\t\t}\n\n\t\t\tthis.promises[category][key] = $.Deferred();\n\t\t\tthis.promises[category][key].extra_data = { category: category, key: key };\n\t\t} else {\n\t\t\tDebug.Text( 'Promise: already exists: ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'add', 11 );\n\t\t}\n\t},\n\n\tresolve: function( category, key ) {\n\t\tif ( this.promises && this.promises[category] && this.promises[category][key] ) {\n\t\t\tDebug.Text( 'Promise: resolved: ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'resolve', 11 );\n\t\t\tthis.promises[category][key].resolve( this.promises[category][key].extra_data );\n\t\t}\n\t},\n\n\treject: function( category, key ) {\n\t\tif ( this.promises && this.promises[category] && this.promises[category][key] ) {\n\t\t\tDebug.Text( 'Promise: rejected: ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'reject', 11 );\n\t\t\tthis.promises[category][key].reject( this.promises[category][key].extra_data );\n\t\t}\n\t},\n\n\t/**\n\t * Wait for all or specific category/key\n\t *\n\t * In the case of waiting on all promises, error_callback is triggered for each individual error (rejection), and success callback is called when all promises are resolved (either success or failure)\n\t * so when waiting for all promises, most times you don't want a failure callback because both \"success\" and \"failure\" can happen on the same wait.\n\t *\n\t * The function call should look like:\n\t * TTPromise.wait(null,null,function(){\n\t * \t//do stuff on success\n\t * });\n\t *\n\t * @param category\n\t * @param key\n\t * @param success_callback\n\t * @param error_callback\n\t */\n\twait: function( category, key, success_callback, error_callback ) {\n\t\tDebug.Arr( arguments, 'Promise: wait(' + category + '|' + key + ').', 'TTPromise.js', 'TTPromise.js', 'wait', 11 );\n\t\tif ( typeof success_callback != 'function' ) {\n\t\t\tsuccess_callback = function() {\n\t\t\t\tGlobal.setUIInitComplete();\n\t\t\t\tDebug.Text( 'Promise: resolved with default callback.', 'TTPromise.js', 'TTPromise.js', 'wait', 11 );\n\t\t\t};\n\t\t}\n\n\t\tif ( typeof error_callback != 'function' ) {\n\t\t\terror_callback = function() {\n\t\t\t\tGlobal.setUIInitComplete();\n\t\t\t\tDebug.Text( 'Promise failed with default callback.', 'TTPromise.js', 'TTPromise.js', 'wait', 1 );\n\t\t\t};\n\t\t}\n\n\t\tif ( Object.keys( TTPromise.promises ).length > 0 ) {\n\t\t\tvar onComplete = function() {\n\t\t\t\tfor ( var i = 0; i < arguments.length; i++ ) {\n\t\t\t\t\t//numerically indexed arguments come back from Promise resolution arguments.\n\t\t\t\t\tvar obj = arguments[i];\n\n\t\t\t\t\tvar category = obj.category;\n\t\t\t\t\tvar key = obj.key;\n\t\t\t\t\tvar wait_category = obj.wait_arguments.category;\n\t\t\t\t\tvar wait_key = obj.wait_arguments.key;\n\n\t\t\t\t\tTTPromise.clearCompletedPromise( category, key );\n\t\t\t\t}\n\n\t\t\t\tif ( !wait_category || TTPromise.filterPromiseArray( wait_category, wait_key ).length == 0 ) {\n\t\t\t\t\tDebug.Text( 'Promise: success callback', 'TTPromise.js', 'TTPromise.js', 'wait', 11 );\n\t\t\t\t\tsuccess_callback( true );\n\t\t\t\t} else {\n\t\t\t\t\tDebug.Text( 'Promise: waiting again ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'wait', 11 );\n\t\t\t\t\tTTPromise.wait( category, key, success_callback, error_callback );\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tvar onError = function() {\n\t\t\t\t//When one promise fails in a category, we need to call the error_callback if waiting on that category, and *never* call the success callback.\n\t\t\t\tDebug.Text( 'Promise: ERROR callback', 'TTPromise.js', 'TTPromise.js', 'wait', 11 );\n\t\t\t\tfor ( var i = 0; i < arguments.length; i++ ) {\n\t\t\t\t\t//numerically indexed arguments come back from Promise resolution arguments.\n\t\t\t\t\tvar obj = arguments[i];\n\n\t\t\t\t\tvar category = obj.category;\n\t\t\t\t\tvar key = obj.key;\n\t\t\t\t\tvar wait_category = obj.wait_arguments.category;\n\t\t\t\t\tvar wait_key = obj.wait_arguments.key;\n\n\t\t\t\t\tTTPromise.clearCompletedPromise( category, key );\n\t\t\t\t}\n\n\t\t\t\t//Different than success because we always want to call the error_callback immediately, as the category can never be success after a single error.\n\t\t\t\tif ( typeof error_callback != 'undefined' ) {\n\t\t\t\t\terror_callback( false );\n\t\t\t\t}\n\n\t\t\t\t//Don't wait again, as that will cause success/error callbacks to be triggered multiple times and could cause an infinite loop too.\n\t\t\t\t//TTPromise.wait( wait_category, wait_key, success_callback, error_callback );\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\tvar pending_promises = this.filterPromiseArray( category, key );\n\t\t\t$.when.apply( $, pending_promises ).pipe( onComplete, onError );\n\n\t\t} else {\n\t\t\tsuccess_callback( true );\n\t\t}\n\t},\n\n\tfilterPromiseArray: function( category, key ) {\n\t\tvar retval = [];\n\t\tfor ( var c in this.promises ) {\n\t\t\tif ( !category || c == category ) {\n\n\t\t\t\t//Debug.Text('Promise: processing category: '+ c, 'TTPromise.js', 'TTPromise.js', 'pending_to_waiting', 11);\n\t\t\t\tfor ( var k in this.promises[c] ) {\n\t\t\t\t\tif ( !key || k == key ) {\n\t\t\t\t\t\t//Debug.Text('Promise: processing key: '+ c+'|'+k, 'TTPromise.js', 'TTPromise.js', 'pending_to_waiting', 11);\n\t\t\t\t\t\tthis.promises[c][k].extra_data.wait_arguments = { category: category, key: key };\n\t\t\t\t\t\tretval.push( this.promises[c][k] );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Debug.Text('Promise: ignoring key: '+ k, 'TTPromise.js', 'TTPromise.js', 'pending_to_waiting', 11);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Debug.Text('Promise: ignoring category: '+ c, 'TTPromise.js', 'TTPromise.js', 'pending_to_waiting', 11);\n\t\t\t}\n\t\t}\n\t\treturn retval;\n\t},\n\n\tclearCompletedPromise: function( category, key ) {\n\t\tif ( this.promises && category && key ) {\n\t\t\tif ( this.promises[category] && this.promises[category][key] ) {\n\t\t\t\tthis.promises[category][key] = false;\n\t\t\t\tdelete this.promises[category][key];\n\t\t\t\tDebug.Text( 'Promise: clear category: ' + category + '|' + key, 'TTPromise.js', 'TTPromise.js', 'init', 11 );\n\t\t\t}\n\n\t\t\tif ( this.promises[category] && Object.keys( this.promises[category] ).length == 0 ) {\n\t\t\t\tthis.promises[category] = false;\n\t\t\t\tDebug.Text( 'Promise: clear category: ' + category, 'TTPromise.js', 'TTPromise.js', 'init', 11 );\n\t\t\t\tdelete this.promises[category];\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t//clear existing promises (mostly for testing and first add)\n\tclearAllPromises: function() {\n\t\tDebug.Text( 'Promise: clear all promises.', 'TTPromise.js', 'TTPromise.js', 'init', 11 );\n\t\tthis.promises = {};\n\t},\n\n\tisPendingPromises: function( category, key ) {\n\t\tvar p = TTPromise.filterPromiseArray( category, key );\n\n\t\tvar pending_count = 0;\n\t\tfor ( var n in p ) {\n\t\t\tif ( p[n] && p[n].state() == 'pending' ) {\n\t\t\t\tconsole.debug( 'Category: ' + p[n].extra_data.category + ' Key: ' + p[n].extra_data.key + ' State: ' + p[n].state() );\n\t\t\t\tpending_count++;\n\t\t\t}\n\t\t}\n\n\t\tif ( pending_count > 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\tdebugPromises: function( category, key ) {\n\t\tvar p = TTPromise.filterPromiseArray( category, key );\n\n\t\tfor ( var n in p ) {\n\t\t\tconsole.debug( 'Category: ' + p[n].extra_data.category + ' Key: ' + p[n].extra_data.key + ' State: ' + p[n].state() );\n\t\t}\n\n\t\treturn true;\n\t}\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTUwNC5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQU87QUFDUCxhQUFhOztBQUViO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxrQ0FBa0MsQ0FBQztBQUNuQywrQ0FBK0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WcoICdDYXRlZ29yeTogJyArIHBbbl0uZXh0cmFfZGF0YS5jYXRlZ29yeSArICcgS2V5OiAnICsgcFtuXS5leHRyYV9kYXRhLmtleSArICcgU3RhdGU6ICcgKyBwW25dLnN0YXRlKCkgKTtcblx0XHR9XG5cblx0XHRyZXR1cm4gdHJ1ZTtcblx0fVxufTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9504\n")},4936:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"d\": () => (/* binding */ TTUUID)\n/* harmony export */ });\nvar TTUUID = function() {\n};\n\nTTUUID.zero_id = '00000000-0000-0000-0000-000000000000';\nTTUUID.not_exist_id = 'ffffffff-ffff-ffff-ffff-ffffffffffff';\n\nTTUUID.counter = 0;\n\nTTUUID.generateUUID = function( seed ) {\n\tif ( !seed && LocalCacheData && LocalCacheData.loginUser && LocalCacheData.loginUser.id ) {\n\t\tvar user_id = LocalCacheData.loginUser.id.split( '-' );\n\t\tseed = user_id[1] + user_id[2] + user_id[3];\n\t}\n\n\tif ( seed == null || seed.length != 12 ) {\n\t\tseed = ( TTUUID.randomUI08() | 1 ) * 0x10000000000 + TTUUID.randomUI40();\n\t}\n\n\tvar sequence = TTUUID.randomUI14();\n\tvar node = seed;\n\tvar tick = TTUUID.randomUI04();\n\tvar timestamp = new Date().getTime();\n\n\t//Helps ensure no duplicate UUIDs in a tight loop.\n\ttimestamp += TTUUID.counter;\n\tTTUUID.counter += 1;\n\n\tvar tf = TTUUID.getTimeFieldValues( timestamp );\n\tvar tl = tf.low + tick;\n\tvar thav = ( tf.hi & 0xFFF ) | 0x1000;\n\n\tsequence &= 0x3FFF;\n\tvar cshar = ( sequence >>> 8 ) | 0x80;\n\tvar csl = sequence & 0xFF;\n\n\treturn TTUUID.fromParts( tl, tf.mid, thav, cshar, csl, node );\n};\n\nTTUUID.castUUID = function( uuid ) {\n\t//allow nulls for cases where the column allows it.\n\tif ( uuid === null || TTUUID.isUUID( uuid ) == true ) {\n\t\treturn uuid;\n\t}\n\n\treturn TTUUID.zero_id;\n};\n\nTTUUID.isUUID = function( uuid ) {\n\tvar regex = new RegExp( '[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}' );\n\tif ( uuid != '' && regex.test( uuid ) ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nTTUUID.fromParts = function( timeLow, timeMid, timeHiAndVersion, clockSeqHiAndReserved, clockSeqLow, node ) {\n\tvar hex =\n\t\tTTUUID.paddedString( timeHiAndVersion.toString( 16 ), 4 ) + TTUUID.paddedString( timeMid.toString( 16 ), 4 )\n\t\t+ '-' + TTUUID.paddedString( timeLow.toString( 16 ).substring( 0, 4 ), 4 )\n\t\t+ '-' + TTUUID.paddedString( timeLow.toString( 16 ).substring( 5, 8 ), 4 )\n\t\t+ '-' + TTUUID.paddedString( clockSeqHiAndReserved.toString( 16 ), 2 ) + TTUUID.paddedString( clockSeqLow.toString( 16 ), 2 )\n\t\t+ '-' + node.toString().substring( 0, 12 );\n\n\treturn hex;\n};\n\nTTUUID.maxFromBits = function( bits ) {\n\treturn Math.pow( 2, bits );\n};\n\nTTUUID.limitUI04 = TTUUID.maxFromBits( 4 );\nTTUUID.limitUI08 = TTUUID.maxFromBits( 8 );\nTTUUID.limitUI14 = TTUUID.maxFromBits( 14 );\nTTUUID.limitUI16 = TTUUID.maxFromBits( 16 );\nTTUUID.limitUI40 = TTUUID.maxFromBits( 40 );\n\nTTUUID.randomUI04 = function() {\n\treturn TTUUID.getRandomInt( 0, ( TTUUID.limitUI04 - 1 ) );\n};\n\nTTUUID.randomUI08 = function() {\n\treturn TTUUID.getRandomInt( 0, ( TTUUID.limitUI08 - 1 ) );\n};\n\nTTUUID.randomUI14 = function() {\n\treturn TTUUID.getRandomInt( 0, ( TTUUID.limitUI14 - 1 ) );\n};\n\nTTUUID.randomUI40 = function() {\n\treturn ( 0 | Math.random() * ( 1 << 30 ) ) + ( 0 | Math.random() * ( 1 << 40 - 30 ) ) * ( 1 << 30 );\n};\n\nTTUUID.getTimeFieldValues = function( time ) {\n\tvar ts = time - Date.UTC( 1582, 9, 15 );\n\tvar hm = ( ( ts / 0x100000000 ) * 10000 ) & 0xFFFFFFF;\n\treturn { low: ( ( ts & 0xFFFFFFF ) * 10000 ) % 0x100000000, mid: hm & 0xFFFF, hi: hm >>> 16, timestamp: ts };\n};\n\nTTUUID.paddedString = function( string, length, z ) {\n\tstring = String( string );\n\tz = ( !z ) ? '0' : z;\n\tvar i = length - string.length;\n\tfor ( ; i > 0; i >>>= 1, z += z ) {\n\t\tif ( i & 1 ) {\n\t\t\tstring = z + string;\n\t\t}\n\t}\n\treturn string;\n};\n\nTTUUID.getRandomInt = function( min, max ) {\n\tvar random_num;\n\n\tvar crypto_obj = window.crypto || window.msCrypto; // for IE 11\n\tif ( crypto_obj ) {\n\t\tvar byte_array = new Uint8Array( 1 );\n\t\tcrypto_obj.getRandomValues( byte_array );\n\n\t\trandom_num = '0.' + byte_array[0].toString();\n\t} else {\n\t\trandom_num = Math.random();\n\t}\n\n\trandom_num = Math.floor( random_num * ( max - min + 1 ) ) + min;\n\n\treturn random_num;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkzNi5qcyIsIm1hcHBpbmdzIjoiOzs7QUFBTztBQUNQOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQ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251bTtcblxuXHR2YXIgY3J5cHRvX29iaiA9IHdpbmRvdy5jcnlwdG8gfHwgd2luZG93Lm1zQ3J5cHRvOyAvLyBmb3IgSUUgMTFcblx0aWYgKCBjcnlwdG9fb2JqICkge1xuXHRcdHZhciBieXRlX2FycmF5ID0gbmV3IFVpbnQ4QXJyYXkoIDEgKTtcblx0XHRjcnlwdG9fb2JqLmdldFJhbmRvbVZhbHVlcyggYnl0ZV9hcnJheSApO1xuXG5cdFx0cmFuZG9tX251bSA9ICcwLicgKyBieXRlX2FycmF5WzBdLnRvU3RyaW5nKCk7XG5cdH0gZWxzZSB7XG5cdFx0cmFuZG9tX251bSA9IE1hdGgucmFuZG9tKCk7XG5cdH1cblxuXHRyYW5kb21fbnVtID0gTWF0aC5mbG9vciggcmFuZG9tX251bSAqICggbWF4IC0gbWluICsgMSApICkgKyBtaW47XG5cblx0cmV0dXJuIHJhbmRvbV9udW07XG59OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4936\n")},2548:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FormItemType\": () => (/* binding */ FormItemType),\n/* harmony export */ \"WidgetNamesDic\": () => (/* binding */ WidgetNamesDic)\n/* harmony export */ });\nvar FormItemType = function() {\n\n};\n\nFormItemType.TEXT = 'text';\nFormItemType.AWESOME_BOX = 'awesomeBox';\nFormItemType.AWESOME_DROPDOWN = 'awesomeDropdown';\nFormItemType.FORMULA_BUILDER = 'formulaBuilder';\nFormItemType.COMBO_BOX = 'comboBox';\nFormItemType.LIST = 'list';\nFormItemType.TEXT_INPUT = 'textInput';\nFormItemType.TIME_PICKER = 'timePicker';\nFormItemType.FEEDBACK_BOX = 'feedbackBox';\nFormItemType.PASSWORD_INPUT = 'passwordInput';\nFormItemType.TEXT_AREA = 'textArea';\nFormItemType.TINYMCE_TEXT_AREA = 'tinymceTextArea';\nFormItemType.TAG_INPUT = 'tagInput';\nFormItemType.DATE_PICKER = 'datePicker';\nFormItemType.RANGE_PICKER = 'range_date_picker';\nFormItemType.CHECKBOX = 'checkbox';\nFormItemType.SEPARATED_BOX = 'separatedBox';\nFormItemType.FILE_BROWSER = 'fileBrowser';\nFormItemType.IMAGE_BROWSER = 'imageBrowser';\nFormItemType.IMAGE_AVD_BROWSER = 'imageADVBrowser';\nFormItemType.CAMERA_BROWSER = 'cameraBrowser';\nFormItemType.IMAGE_CUT = 'imageCutArea';\nFormItemType.INSIDE_EDITOR = 'insideEditor';\nFormItemType.IMAGE = 'image';\nFormItemType.COLOR_PICKER = 'colorPicker';\n\nvar WidgetNamesDic = function() {\n\n};\n\nWidgetNamesDic.ERROR_TOOLTIP = 'errorToolTip';\n\nWidgetNamesDic.EDIT_VIEW_FORM_ITEM = 'editViewFormItem';\nWidgetNamesDic.EDIT_VIEW_SUB_FORM_ITEM = 'editViewSubFormItem';\nWidgetNamesDic.PAGING = 'paging';\nWidgetNamesDic.PAGING_2 = 'paging_2';\nWidgetNamesDic.NO_RESULT_BOX = 'no_result_box';\nWidgetNamesDic.VIEW_MIN_TAB_BAR = 'view_min_tab_bar';\nWidgetNamesDic.VIEW_MIN_TAB = 'view_min_tab';//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU0OC5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUFPOztBQUVQOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVPOztBQUVQOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E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Qk9YID0gJ25vX3Jlc3VsdF9ib3gnO1xuV2lkZ2V0TmFtZXNEaWMuVklFV19NSU5fVEFCX0JBUiA9ICd2aWV3X21pbl90YWJfYmFyJztcbldpZGdldE5hbWVzRGljLlZJRVdfTUlOX1RBQiA9ICd2aWV3X21pbl90YWInOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///2548\n")},8287:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ViewMinTabBar = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ViewMinTabBar.defaults, options );\n\n\t\tvar $this = this;\n\n\t\tGlobal.addCss( 'global/widgets/view_min_tab/ViewMinTab.css' );\n\n\t\tvar createTab = function( view_id, view_label, url ) {\n\t\t\tvar tab = $( Global.loadWidgetByName( WidgetNamesDic.VIEW_MIN_TAB ) );\n\t\t\tvar view_name = tab.find( '.view-name' );\n\t\t\tview_name.text( view_label );\n\t\t\ttab.attr( 'id', 'min_tab_' + view_id );\n\n\t\t\ttab.attr( 'view_url', url );\n\n\t\t\tsetTimeout( function() {\n\t\t\t\ttab.addClass( 'show' );\n\t\t\t}, 100 );\n\n\t\t\tvar close_btn = tab.find( '.close-btn' );\n\n\t\t\ttab.unbind( 'click' ).click( function() {\n\t\t\t\tGlobal.setUINotready();\n\t\t\t\tvar view_id = $( this ).attr( 'id' ).replace( 'min_tab_', '' );\n\t\t\t\tvar url = $( this ).attr( 'view_url' );\n\t\t\t\tGlobal.removeViewTab( view_id );\n\n\t\t\t\tswitch ( view_id ) {\n\t\t\t\t\tcase 'ProcessPayrollWizard':\n\t\t\t\t\t\tIndexViewController.openWizard( view_id );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'PayrollRemittanceAgencyEventWizardController':\n\t\t\t\t\t\tIndexViewController.openWizardController( 'PayrollRemittanceAgencyEventWizardController' );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n//\t\t\t\t\t\tIndexViewController.goToView( view_id );\n\t\t\t\t\t\tGlobal.setURLToBrowser( url );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tclose_btn.unbind( 'click' ).click( function() {\n\t\t\t\tvar view_id = $( this ).parent().attr( 'id' ).replace( 'min_tab_', '' );\n\t\t\t\tGlobal.removeViewTab( view_id );\n\t\t\t} );\n\n\t\t\t$this.append( tab );\n\t\t};\n\n\t\tthis.buildTabs = function( tab_map ) {\n\n\t\t\t//$this.empty();\n\t\t\tvar i = 0;\n\t\t\tfor ( var key in tab_map ) {\n\t\t\t\tif ( tab_map.hasOwnProperty( key ) && key.indexOf( '_url' ) === -1 ) {\n\t\t\t\t\tvar view_id = key;\n\t\t\t\t\tvar view_label = tab_map[key];\n\t\t\t\t\tvar view_url = tab_map[key + '_url'];\n\t\t\t\t\tif ( $( '#min_tab_' + view_id ).length === 0 ) {\n\t\t\t\t\t\tcreateTab( view_id, view_label, view_url );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\ti = i + 1;\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.ViewMinTabBar.defaults = {};\n\t$.fn.ViewMinTabBar.html = {\n\t\ttab: `\n\t\t<div class=\"p-button p-component view-min-tab animated\">\n\t\t\t<span class=\"view-name\"></span>\n\t\t\t<span class=\"tticon tticon-cancel_black_24dp close-btn\"></span>\n\t\t</div>`,\n\t\ttab_bar: `<div class=\"view-min-tab-bar\"></div>`\n\t};\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODI4Ny5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7O0FBRX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ld191cmwgPSB0YWJfbWFwW2tleSArICdfdXJsJ107XG5cdFx0XHRcdFx0aWYgKCAkKCAnI21pbl90YWJfJyArIHZpZXdfaWQgKS5sZW5ndGggPT09IDAgKSB7XG5cdFx0XHRcdFx0XHRjcmVhdGVUYWIoIHZpZXdfaWQsIHZpZXdfbGFiZWwsIHZpZXdfdXJsICk7XG5cdFx0XHRcdFx0fVxuXG5cdFx0XHRcdH1cblx0XHRcdFx0aSA9IGkgKyAxO1xuXG5cdFx0XHR9XG5cblx0XHR9O1xuXG5cdFx0dGhpcy5lYWNoKCBmdW5jdGlvbigpIHtcblxuXHRcdFx0dmFyIG8gPSAkLm1ldGEgPyAkLmV4dGVuZCgge30sIG9wdHMsICQoIHRoaXMgKS5kYXRhKCkgKSA6IG9wdHM7XG5cblx0XHR9ICk7XG5cblx0XHRyZXR1cm4gdGhpcztcblxuXHR9O1xuXG5cdCQuZm4uVmlld01pblRhYkJhci5kZWZhdWx0cyA9IHt9O1xuXHQkLmZuLlZpZXdNaW5UYWJCYXIuaHRtbCA9IHtcblx0XHR0YWI6IGBcblx0XHQ8ZGl2IGNsYXNzPVwicC1idXR0b24gcC1jb21wb25lbnQgdmlldy1taW4tdGFiIGFuaW1hdGVkXCI+XG5cdFx0XHQ8c3BhbiBjbGFzcz1cInZpZXctbmFtZVwiPjwvc3Bhbj5cblx0XHRcdDxzcGFuIGNsYXNzPVwidHRpY29uIHR0aWNvbi1jYW5jZWxfYmxhY2tfMjRkcCBjbG9zZS1idG5cIj48L3NwYW4+XG5cdFx0PC9kaXY+YCxcblx0XHR0YWJfYmFyOiBgPGRpdiBjbGFzcz1cInZpZXctbWluLXRhYi1iYXJcIj48L2Rpdj5gXG5cdH07XG5cbn0gKSggalF1ZXJ5ICk7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8287\n")},9769:(g,t,I)=>{var n={"./awesomebox/AComboBox":[2897,7,"awesomebox-AComboBox"],"./awesomebox/AComboBox.js":[2897,7,"awesomebox-AComboBox"],"./awesomebox/ADropDown":[3234,7,"awesomebox-ADropDown"],"./awesomebox/ADropDown.js":[3234,7,"awesomebox-ADropDown"],"./awesomebox/ALayoutCache":[4243,9,"awesomebox-ALayoutCache"],"./awesomebox/ALayoutCache.js":[4243,9,"awesomebox-ALayoutCache"],"./awesomebox/ASearchInput":[7040,7,"awesomebox-ASearchInput"],"./awesomebox/ASearchInput.js":[7040,7,"awesomebox-ASearchInput"],"./checkbox/TCheckbox":[5529,7,"checkbox-TCheckbox"],"./checkbox/TCheckbox.js":[5529,7,"checkbox-TCheckbox"],"./color-picker/TColorPicker":[3161,9,"color-picker-TColorPicker"],"./color-picker/TColorPicker.js":[3161,9,"color-picker-TColorPicker"],"./column_editor/ColumnEditor":[9613,7,"column_editor-ColumnEditor"],"./column_editor/ColumnEditor.js":[9613,7,"column_editor-ColumnEditor"],"./combobox/TComboBox":[5519,7,"combobox-TComboBox"],"./combobox/TComboBox.js":[5519,7,"combobox-TComboBox"],"./datepicker/TDatePicker":[84,7,"datepicker-TDatePicker"],"./datepicker/TDatePicker.js":[84,7,"datepicker-TDatePicker"],"./datepicker/TRangePicker":[9300,7,"datepicker-TRangePicker"],"./datepicker/TRangePicker.js":[9300,7,"datepicker-TRangePicker"],"./error_tip/ErrorTipBox":[9876,7,"error_tip-ErrorTipBox"],"./error_tip/ErrorTipBox.js":[9876,7,"error_tip-ErrorTipBox"],"./feedback/TFeedback":[8218,7,"feedback-TFeedback"],"./feedback/TFeedback.js":[8218,7,"feedback-TFeedback"],"./filebrowser/CameraBrowser":[8128,7,"filebrowser-CameraBrowser"],"./filebrowser/CameraBrowser.js":[8128,7,"filebrowser-CameraBrowser"],"./filebrowser/TImage":[1469,7,"filebrowser-TImage"],"./filebrowser/TImage.js":[1469,7,"filebrowser-TImage"],"./filebrowser/TImageAdvBrowser":[8243,7,"filebrowser-TImageAdvBrowser"],"./filebrowser/TImageAdvBrowser.js":[8243,7,"filebrowser-TImageAdvBrowser"],"./filebrowser/TImageBrowser":[8326,7,"filebrowser-TImageBrowser"],"./filebrowser/TImageBrowser.js":[8326,7,"filebrowser-TImageBrowser"],"./filebrowser/TImageCutArea":[8453,7,"filebrowser-TImageCutArea"],"./filebrowser/TImageCutArea.js":[8453,7,"filebrowser-TImageCutArea"],"./formula_builder/FormulaBuilder":[9326,7,"formula_builder-FormulaBuilder"],"./formula_builder/FormulaBuilder.js":[9326,7,"formula_builder-FormulaBuilder"],"./inside_editor/InsideEditor":[1745,7,"inside_editor-InsideEditor"],"./inside_editor/InsideEditor.js":[1745,7,"inside_editor-InsideEditor"],"./jqgrid/TGridHeader":[754,7,"jqgrid-TGridHeader"],"./jqgrid/TGridHeader.js":[754,7,"jqgrid-TGridHeader"],"./list/TList":[802,7,"list-TList"],"./list/TList.js":[802,7,"list-TList"],"./live-chat/live-chat":[155,9,"live-chat"],"./live-chat/live-chat.js":[155,9,"live-chat"],"./message_box/NoHierarchyBox":[9110,7,"message_box-NoHierarchyBox"],"./message_box/NoHierarchyBox.js":[9110,7,"message_box-NoHierarchyBox"],"./message_box/NoResultBox":[4938,7,"message_box-NoResultBox"],"./message_box/NoResultBox.js":[4938,7,"message_box-NoResultBox"],"./message_box/SaveAndContinueBox":[350,7,"message_box-SaveAndContinueBox"],"./message_box/SaveAndContinueBox.js":[350,7,"message_box-SaveAndContinueBox"],"./paging/Paging2":[5583,7,"paging-Paging2"],"./paging/Paging2.js":[5583,7,"paging-Paging2"],"./search_panel/FormItemType":[2548,9],"./search_panel/FormItemType.js":[2548,9],"./search_panel/SearchPanel":[4057,7,"search_panel-SearchPanel"],"./search_panel/SearchPanel.js":[4057,7,"search_panel-SearchPanel"],"./separated_box/SeparatedBox":[7316,7,"separated_box-SeparatedBox"],"./separated_box/SeparatedBox.js":[7316,7,"separated_box-SeparatedBox"],"./switch_button/SwitchButton":[6618,9,"switch_button-SwitchButton"],"./switch_button/SwitchButton.js":[6618,9,"switch_button-SwitchButton"],"./tag_input/TTagInput":[4466,7,"tag_input-TTagInput"],"./tag_input/TTagInput.js":[4466,7,"tag_input-TTagInput"],"./text/TText":[7011,7,"text-TText"],"./text/TText.js":[7011,7,"text-TText"],"./text_input/TPasswordInput":[3133,7,"text_input-TPasswordInput"],"./text_input/TPasswordInput.js":[3133,7,"text_input-TPasswordInput"],"./text_input/TTextInput":[9264,7,"text_input-TTextInput"],"./text_input/TTextInput.js":[9264,7,"text_input-TTextInput"],"./textarea/TTextArea":[8917,7,"textarea-TTextArea"],"./textarea/TTextArea.js":[8917,7,"textarea-TTextArea"],"./timepicker/TTimePicker":[9680,7,"timepicker-TTimePicker"],"./timepicker/TTimePicker.js":[9680,7,"timepicker-TTimePicker"],"./toggle_button/TToggleButton":[5110,7,"toggle_button-TToggleButton"],"./toggle_button/TToggleButton.js":[5110,7,"toggle_button-TToggleButton"],"./ttgrid/TTGrid":[2185,7,"ttgrid-TTGrid"],"./ttgrid/TTGrid.js":[2185,7,"ttgrid-TTGrid"],"./view_min_tab/ViewMinTabBar":[8287,7],"./view_min_tab/ViewMinTabBar.js":[8287,7],"./wizard/Wizard":[3207,9,"wizard-Wizard"],"./wizard/Wizard.js":[3207,9,"wizard-Wizard"],"./wizard/WizardStep":[8880,9,"wizard-WizardStep"],"./wizard/WizardStep.js":[8880,9,"wizard-WizardStep"]};function c(g){if(!I.o(n,g))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+g+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[g],c=t[0];return Promise.all(t.slice(2).map(I.e)).then((()=>I.t(c,16|t[1])))}c.keys=()=>Object.keys(n),c.id=9769,g.exports=c},3751:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "X": () => (/* binding */ Base)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\nclass Base extends Backbone.Model {\n\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t} );\n\n\t\tsuper( options );\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc1MS5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQU87O0FBRVAsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNILElBQUk7O0FBRUo7QUFDQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vaW50ZXJmYWNlL2h0bWw1L21vZGVsL0Jhc2UuanM/NDQzMSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY2xhc3MgQmFzZSBleHRlbmRzIEJhY2tib25lLk1vZGVsIHtcblxuXHRjb25zdHJ1Y3Rvciggb3B0aW9ucyA9IHt9ICkge1xuXHRcdF8uZGVmYXVsdHMoIG9wdGlvbnMsIHtcblx0XHR9ICk7XG5cblx0XHRzdXBlciggb3B0aW9ucyApO1xuXHR9XG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3751\n')},7194:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"g\": () => (/* binding */ IndexViewController)\n/* harmony export */ });\n/* unused harmony export ApplicationRouter */\n/* harmony import */ var _views_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5196);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass ApplicationRouter extends Backbone.Router {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcontroller: null,\n\t\t\theaderView: null,\n\t\t\troutes: {\n\t\t\t\t'': 'onViewChange',\n\t\t\t\t'!:viewName': 'onViewChange',\n\t\t\t\t'*notFound': 'notFound'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tloadView( view_id ) {\n\t\tGlobal.loadViewSource( view_id, view_id + 'View.html', function( result ) {\n\t\t\tvar template = _.template( result );\n\t\t\tGlobal.contentContainer().html( template );\n\n\t\t\tLocalCacheData.current_open_view_id = view_id;\n\n\t\t\tGlobal.trackView( view_id );\n\t\t} );\n\t}\n\n\treloadView( view_id ) {\n\t\t//error: Uncaught ReferenceError: XXXXViewController is not defined ininterface/html5/#!m=TimeSheet line 3\n\t\t// Happens when quickly click on context menu and network is slow.\n\t\tif ( eval( 'typeof '+ view_id + 'ViewController' ) === 'function' ) { //Was ES5: window[view_id + 'ViewController'] &&\n\t\t\tthis.loadView( view_id );\n\t\t}\n\t}\n\n\tnotFound( url ) {\n\t\tvar new_url = Global.getBaseURL();\n\n\t\tGlobal.setURLToBrowser( new_url + '#!m=QuickPunchLogin' );\n\t}\n\n\t/* jshint ignore:start */\n\tonViewChange( viewName ) {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\tvar view_id;\n\n\t\tif ( Global.needReloadBrowser ) {\n\t\t\tGlobal.needReloadBrowser = false;\n\t\t\twindow.location.reload();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( viewName ) {\n\t\t\targs = Global.buildArgDic( viewName.split( '&' ) );\n\t\t}\n\t\tif ( viewName && viewName.indexOf( 'm=' ) >= 0 && viewName.indexOf( 'QuickPunch' ) >= 0 ) {\n\t\t\tview_id = Global.sanitizeViewId( args.m );\n\t\t} else {\n\t\t\tview_id = 'QuickPunchLogin';\n\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=QuickPunchLogin' );\n\t\t}\n\n\t\tLocalCacheData.fullUrlParameterStr = viewName;\n\n\t\tLocalCacheData.setAllURLArgs( args );\n\t\tvar reg = new RegExp( '^[0-9]*$' );\n\t\tvar timeout_count;\n\t\ttimeout_count = 0;\n\t\t// $('link[title=\"application css\"]').prop('disabled', true);\n\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\tshowRibbonMenuAndLoadView();\n\t\t} else {\n\t\t\tvar auto_login_timer = setInterval( function() {\n\t\t\t\tif ( timeout_count == 100 ) {\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t\ttimeout_count = timeout_count + 1;\n\t\t\t\tif ( LocalCacheData.loadViewRequiredJSReady ) {\n\t\t\t\t\tshowRibbonMenuAndLoadView();\n\t\t\t\t\tclearInterval( auto_login_timer );\n\t\t\t\t}\n\t\t\t}, 600 );\n\t\t}\n\n\t\tfunction showRibbonMenuAndLoadView() {\n\t\t\t$( 'body' ).removeClass( 'login-bg' );\n\t\t\t// Global.loadStyleSheet( '../theme/default/css/quickPunch.css' + '?v=' + APIGlobal.pre_login_data.application_build ); // #2844 quickpunch css will now be loaded at start.\n\t\t\tif ( !$this.headerView ) {\n\t\t\t\t$this.headerView = new _views_quick_punch_header_HeaderViewController__WEBPACK_IMPORTED_MODULE_0__.HeaderViewController();\n\t\t\t\t$( '#topContainer' ).html( $this.headerView.el );\n\t\t\t}\n\t\t\tloadViewController();\n\t\t}\n\n\t\tfunction loadViewController() {\n\t\t\tGlobal.loadViewSource( view_id, view_id + 'ViewController.js', function() {\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tvar view_controller = eval( 'new ' + view_id + 'ViewController(); ' );\n\t\t\t\tGlobal.trackView( view_id );\n\t\t\t\t/* jshint ignore:end */\n\n\t\t\t\t// Only show the top and bottom containers until after the view html is loaded, otherwise the download app links flash up at the top of the page, where the login header should be.\n\t\t\t\t// TODO: Improve this with Vue to be smoother and more structured, rather than trial and error.\n\t\t\t\tGlobal.topContainer().css( 'display', 'block' );\n\t\t\t\tGlobal.bottomContainer().css( 'display', 'block' );\n\t\t\t} );\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\n\tcleanAnySubViewUI() {\n\t\tvar children = Global.contentContainer().children();\n\n\t\tif ( children.length > 1 ) {\n\t\t\tfor ( var i = 1; i < children.length; i++ ) {\n\t\t\t\t// Object doesn't support property or method 'remove', Not sure why, add try catch to ingore this error since this should no harm\n\t\t\t\ttry {\n\n\t\t\t\t\tif ( $( children[i] ).attr( 'id' ) === LocalCacheData.current_open_primary_controller.ui_id ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchildren[i].remove();\n\t\t\t\t\t}\n\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\t//Do nothing\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}\n\n\tsetContentDivHeight() {\n\t\tGlobal.contentContainer().removeClass( 'content-container' );\n\t\tGlobal.contentContainer().addClass( 'content-container-after-login' );\n\t\tGlobal.topContainer().addClass( 'top-container-after-login' );\n\n\t}\n\n\taddTopMenu() {\n\t\tGlobal.loadScript( 'global/widgets/top_menu/TopMenuController.js' );\n\t\tif ( TopMenuController ) {\n\t\t\tTopMenuController.loadView();\n\t\t}\n\n\t}\n\n\tremoveCurrentView( callBack ) {\n\t\tif ( LocalCacheData.current_open_edit_only_controller ) {\n\t\t\tclean( LocalCacheData.current_open_edit_only_controller );\n\t\t\tLocalCacheData.current_open_edit_only_controller = null;\n\t\t}\n\n\t\tif ( LocalCacheData.current_open_primary_controller ) {\n\t\t\tif ( LocalCacheData.current_open_primary_controller.edit_view ) {\n\t\t\t\tclean( LocalCacheData.current_open_primary_controller );\n\t\t\t}\n\t\t\tGlobal.contentContainer().empty();\n\t\t\tLocalCacheData.current_open_primary_controller.cleanWhenUnloadView( callBack );\n\t\t} else {\n\n\t\t\tif ( Global.isSet( callBack ) ) {\n\t\t\t\tcallBack();\n\t\t\t}\n\t\t}\n\n\t\tfunction clean( viewController ) {\n\t\t\tviewController.clearErrorTips();\n\t\t\t// Cannot read property 'remove' of null in interface/html5/IndexController.js?v=9.0.0-20151016-153057 line 439\n\t\t\tif ( viewController.edit_view ) {\n\t\t\t\tviewController.edit_view.remove();\n\t\t\t}\n\t\t\tviewController.sub_log_view_controller = null;\n\t\t\tviewController.edit_view_ui_dic = {};\n\t\t\tviewController.edit_view_ui_validation_field_dic = {};\n\t\t\tviewController.edit_view_form_item_dic = {};\n\t\t\tviewController.edit_view_error_ui_dic = {};\n\t\t\tLocalCacheData.current_doing_context_action = '';\n\t\t}\n\t}\n}\n\nclass IndexViewController extends Backbone.View {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: 'body', //So we can add event listener for all elements\n\t\t\trouter: null,\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tIndexViewController.instance = this;\n\t\tthis.router = new ApplicationRouter();\n\t\t//Set title in index.php instead.\n\t\t//$( 'title' ).html( '' );\n\t\tthis.router.controller = this;\n\t\t//Error: Backbone.history has already been started in interface/html5/framework/backbone/backbone-min.js?v=9.0.1-20151022-162110 line 28\n\t\tif ( !Backbone.History.started ) {\n\t\t\tBackbone.history.start();\n\t\t}\n\t}\n}\n\nIndexViewController.instance = null;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzE5NC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQXVGOztBQUVoRjtBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0Esa0JBQWtCLENBQUM7QUFDbkI7O0FBRUE7O0FBRUE7QUFDQSxJQUFJO0FBQ0o7O0FBRUE7QUFDQTtBQUNBO0FBQ0Esd0VBQXdFO0FBQ3hFO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7Q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0gKTtcblxuXHRcdHN1cGVyKCBvcHRpb25zICk7XG5cdH1cblxuXHRpbml0aWFsaXplKCBvcHRpb25zICkge1xuXHRcdEluZGV4Vmlld0NvbnRyb2xsZXIuaW5zdGFuY2UgPSB0aGlzO1xuXHRcdHRoaXMucm91dGVyID0gbmV3IEFwcGxpY2F0aW9uUm91dGVyKCk7XG5cdFx0Ly9TZXQgdGl0bGUgaW4gaW5kZXgucGhwIGluc3RlYWQuXG5cdFx0Ly8kKCAndGl0bGUnICkuaHRtbCggJycgKTtcblx0XHR0aGlzLnJvdXRlci5jb250cm9sbGVyID0gdGhpcztcblx0XHQvL0Vycm9yOiBCYWNrYm9uZS5oaXN0b3J5IGhhcyBhbHJlYWR5IGJlZW4gc3RhcnRlZCBpbiBpbnRlcmZhY2UvaHRtbDUvZnJhbWV3b3JrL2JhY2tib25lL2JhY2tib25lLW1pbi5qcz92PTkuMC4xLTIwMTUxMDIyLTE2MjExMCBsaW5lIDI4XG5cdFx0aWYgKCAhQmFja2JvbmUuSGlzdG9yeS5zdGFydGVkICkge1xuXHRcdFx0QmFja2JvbmUuaGlzdG9yeS5zdGFydCgpO1xuXHRcdH1cblx0fVxufVxuXG5JbmRleFZpZXdDb250cm9sbGVyLmluc3RhbmNlID0gbnVsbDsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7194\n")},3173:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony import */ var stacktrace_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(401);\n/* harmony import */ var stacktrace_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stacktrace_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2316);\n/* harmony import */ var backbone__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(backbone__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var jquery_ui__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6891);\n/* harmony import */ var jquery_ui__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jquery_ui__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3734);\n/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _framework_jquery_i18n_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6378);\n/* harmony import */ var _framework_jquery_i18n_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_framework_jquery_i18n_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var html2canvas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1120);\n/* harmony import */ var html2canvas__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(html2canvas__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _global_Global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9490);\n/* harmony import */ var _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9563);\n/* harmony import */ var _global_TTPromise__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9504);\n/* harmony import */ var _global_ProgressBarManager__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(587);\n/* harmony import */ var _global_PermissionManager__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8843);\n/* harmony import */ var _global_TAlertManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9239);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(12);\n/* harmony import */ var _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7526);\n/* harmony import */ var _IndexController__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(7194);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/* Tell js linting to ignore the webpack globals */\n/*global __webpack_public_path__ */\n\n// Modify the webpack config output.publicPath to take into account the extra directory level of quick_punch.\n__webpack_require__.p = '../' + __webpack_require__.p;\n\n// from main app\n\n// import 'expose-loader?exposes=$,jQuery!jquery'; // Now done in webpack config -- Old: Needs be done with expose otherwise other imports error \"jQuery/$ is not defined.\" e.g. plugins like i18n.\n// import _ from 'underscore';\n // does not seem to need expose loader.\n\n// end from main app\n\n// global vendor imports\n\n\n\n\n\n\n\n\n// global imports\n\n\n // Potentially the same issue as ProgressBar (multiple instances, no single state), so lets just make it global to be safe.\n // Must only be imported in one place, otherwise multiple instances could be loaded and clash by leaving open Progressbars. e.g. Seen in TimeSheet\n\n\n\n// imports for this file only\n\n\n // Make sure this is quick_punch/IndexController! Not from main UI.\n\nwindow.$ = window.jQuery = $; // #3028 This is needed because although webpack will handle any references to $/jQuery in our code, its done internally and not on the window. So 3rd party libraries will not find jQuery on the window.\nwindow.html2canvas = (html2canvas__WEBPACK_IMPORTED_MODULE_5___default());\nwindow.StackTrace = stacktrace_js__WEBPACK_IMPORTED_MODULE_0__;\nwindow.Global = _global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global */ .x;\nwindow.LocalCacheData = _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData */ .B;\nwindow.TTPromise = _global_TTPromise__WEBPACK_IMPORTED_MODULE_8__/* .TTPromise */ .j;\nwindow.ProgressBar = _global_ProgressBarManager__WEBPACK_IMPORTED_MODULE_9__/* .ProgressBar */ .k;\nwindow.PermissionManager = _global_PermissionManager__WEBPACK_IMPORTED_MODULE_10__/* .PermissionManager */ .Y;\nwindow.TAlertManager = _global_TAlertManager__WEBPACK_IMPORTED_MODULE_11__/* .TAlertManager */ .K;\n\nwindow.is_browser_iOS = ( navigator.userAgent.match( /(iPad|iPhone|iPod)/g ) ? true : false );\n\nvar api_authentication = _services_TimeTrexClientAPI__WEBPACK_IMPORTED_MODULE_13__/* .TTAPI.APIAuthentication */ .y.APIAuthentication;\n\nif ( Error ) {\n\tError.stackTraceLimit = 50; //Increase JS exception stack trace limit.\n}\n\nwindow.onerror = function( error_msg, file, line, col, error_obj ) {\n\tif ( !arguments || arguments.length < 1 ) {\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.sendErrorReport */ .x.sendErrorReport( 'No error parameters when window.onerror', _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller.root_url */ .n.root_url, '', '', '' );\n\t} else {\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.sendErrorReport */ .x.sendErrorReport( error_msg, file, line, col, error_obj );\n\t}\n};\n\n_services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller.base_url */ .n.base_url = _global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.getBaseURL */ .x.getBaseURL( '../../../', false );\n_services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller.base_api_url */ .n.base_api_url = 'api/json/quick_punch/api.php';\n_services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller.root_url */ .n.root_url = _global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.getRootURL */ .x.getRootURL();\n\nvar loginData = {};\n//Set in APIGlobal.php\nif ( !need_load_pre_login_data ) {\n\tloginData = APIGlobal.pre_login_data;\n} else {\n\tneed_load_pre_login_data = false;\n}\nif ( !loginData.hasOwnProperty( 'api_base_url' ) ) {\n\tapi_authentication.getPreLoginData( null, {\n\t\tonResult: function( e ) {\n\n\t\t\tvar result = e.getResult();\n\n\t\t\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.setLoginData */ .B.setLoginData( result );\n\t\t\tAPIGlobal.pre_login_data = result;\n\n\t\t\tloginData = _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getLoginData */ .B.getLoginData();\n\t\t\tinitApps();\n\n\t\t}\n\t} );\n} else {\n\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.setLoginData */ .B.setLoginData( loginData ); //set here because the loginData is set from php\n\tinitApps();\n}\ninitAnalytics();\n\nfunction initAnalytics() {\n\t/* jshint ignore:start */\n\tif ( APIGlobal.pre_login_data.analytics_enabled === true && _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller */ .n && _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_12__/* .ServiceCaller.root_url */ .n.root_url && loginData && loginData.base_url ) {\n\t\ttry {\n\t\t\tvar gtag_script = document.createElement('script');\n\t\t\tgtag_script.setAttribute('src','https://www.googletagmanager.com/gtag/js?id='+ APIGlobal.pre_login_data.analytics_tracking_code );\n\t\t\tdocument.head.appendChild(gtag_script);\n\n\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\twindow.gtag = function gtag(){window.dataLayer.push(arguments);}\n\t\t\tgtag( 'js', new Date() );\n\t\t\tgtag( 'config', APIGlobal.pre_login_data.analytics_tracking_code, { 'debug_mode': !APIGlobal.pre_login_data.production, 'send_page_view': false, 'custom_map': { 'dimension1': 'application_version', 'dimension2': 'http_host', 'dimension3': 'product_edition_name', 'dimension4': 'registration_key', 'dimension5': 'primary_company_name', 'dimension6': 'user_name', 'dimension7': 'company_name', } } );\n\n\t\t\t//Do not check existance of LocalCacheData with if(LocalCacheData) or JS will execute the unnamed function it uses as a constructor\n\t\t\t//Do not user LocalCacheData.getCurrentCompany for this comparison, or JS will throw a \"cache is expired\" error.\n\t\t\tif ( _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getPunchLoginUser */ .B.getPunchLoginUser() && _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getLocalCache */ .B.getLocalCache( 'current_company', 'JSON' ) ) {\n\t\t\t\tvar current_company = _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getCurrentCompany */ .B.getCurrentCompany();\n\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.setAnalyticDimensions */ .x.setAnalyticDimensions( _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getPunchLoginUser */ .B.getPunchLoginUser().first_name + ' (' + _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getPunchLoginUser */ .B.getPunchLoginUser().id + ')', current_company.name );\n\t\t\t} else {\n\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.setAnalyticDimensions */ .x.setAnalyticDimensions();\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tthrow e; //Attempt to catch any errors thrown by Google Analytics.\n\t\t}\n\t}\n\t/* jshint ignore:end */\n}\n\nfunction initApps() {\n\tloadViewRequiredJS();\n\n\t//Optimization: Only change locale if its *not* en_US or enable_default_language_translation = TRUE\n\tif ( loginData.locale !== 'en_US' || loginData.enable_default_language_translation == true ) {\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.loadLanguage */ .x.loadLanguage( loginData.locale );\n\t\tDebug.Text( 'Using Locale: ' + loginData.locale, 'quick_punch/main.js', '', 'initApps', 10 );\n\t} else {\n\t\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.setI18nDic */ .B.setI18nDic( {} );\n\t}\n\t$.i18n.load( _global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.getI18nDic */ .B.getI18nDic() );\n\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.initStaticStrings */ .x.initStaticStrings();\n\n\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.deployment_on_demand */ .B.deployment_on_demand = loginData.deployment_on_demand;\n\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.productEditionId */ .B.productEditionId = loginData.product_edition;\n\n\tvar controller = new _IndexController__WEBPACK_IMPORTED_MODULE_14__/* .IndexViewController */ .g(); //Even though controller variable is not used, this must be called.\n}\n\nfunction loadViewRequiredJS() {\n\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.url_offset */ .x.url_offset = '../'; //Must be defined before any other JS/CSS is loaded, otherwise can cause 404 when changing languages.\n\n\t_global_Global__WEBPACK_IMPORTED_MODULE_6__/* .Global.addCss */ .x.addCss( 'global/widgets/talert/TAlert.css' );\n\t_global_LocalCacheData__WEBPACK_IMPORTED_MODULE_7__/* .LocalCacheData.loadViewRequiredJSReady */ .B.loadViewRequiredJSReady = true;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE3My5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7QUFDQTs7QUFFQTtBQUNBLHFCQUF1QixXQUFXLHFCQUF1Qjs7QUFFekQ7QUFDMkM7QUFDM0MsbURBQW1EO0FBQ25EO0FBQ2tCLENBQUM7QUFDQTtBQUNuQjs7QUFFQTtBQUNtQjtBQUNBO0FBQzJCO0FBQ087QUFDSDtBQUNkO0FBQ0U7O0FBRXRDO0FBQ3lDO0FBQ2dCO0FBQ1YsQ0FBQztBQUNVLENBQUM7QUFDSTtBQUNSOztBQUV2RDtBQUN5RDtBQUNKO0FBQ0csQ0FBQzs7QUFFekQsMkJBQTJCLENBQUMsRUFBRTtBQUM5QixxQkFBcUIsb0RBQVc7QUFDaEMsb0JBQW9CLDBDQUFVO0FBQzlCLGdCQUFnQiwyREFBTTtBQUN0Qix3QkFBd0IsMkVBQWM7QUFDdEMsbUJBQW1CLGlFQUFTO0FBQzVCLHFCQUFxQiw0RUFBVztBQUNoQywyQkFBMkIsa0Z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RTdGF0aWNTdHJpbmdzKCk7XG5cblx0TG9jYWxDYWNoZURhdGEuZGVwbG95bWVudF9vbl9kZW1hbmQgPSBsb2dpbkRhdGEuZGVwbG95bWVudF9vbl9kZW1hbmQ7XG5cdExvY2FsQ2FjaGVEYXRhLnByb2R1Y3RFZGl0aW9uSWQgPSBsb2dpbkRhdGEucHJvZHVjdF9lZGl0aW9uO1xuXG5cdHZhciBjb250cm9sbGVyID0gbmV3IEluZGV4Vmlld0NvbnRyb2xsZXIoKTsgLy9FdmVuIHRob3VnaCBjb250cm9sbGVyIHZhcmlhYmxlIGlzIG5vdCB1c2VkLCB0aGlzIG11c3QgYmUgY2FsbGVkLlxufVxuXG5mdW5jdGlvbiBsb2FkVmlld1JlcXVpcmVkSlMoKSB7XG5cdEdsb2JhbC51cmxfb2Zmc2V0ID0gJy4uLyc7IC8vTXVzdCBiZSBkZWZpbmVkIGJlZm9yZSBhbnkgb3RoZXIgSlMvQ1NTIGlzIGxvYWRlZCwgb3RoZXJ3aXNlIGNhbiBjYXVzZSA0MDQgd2hlbiBjaGFuZ2luZyBsYW5ndWFnZXMuXG5cblx0R2xvYmFsLmFkZENzcyggJ2dsb2JhbC93aWRnZXRzL3RhbGVydC9UQWxlcnQuY3NzJyApO1xuXHRMb2NhbENhY2hlRGF0YS5sb2FkVmlld1JlcXVpcmVkSlNSZWFkeSA9IHRydWU7XG59Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///3173\n")},4578:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "H": () => (/* binding */ HtmlTemplatesGlobal),\n/* harmony export */ "W": () => (/* binding */ TemplateType)\n/* harmony export */ });\nclass HtmlTemplates {\n\n\tconstructor() {\n\t}\n\n\t/**\n\t * Conditionally insert variable or html. Can be used in two ways.\n\t * Either 1) pass html, and if so it will use the html if the field is true.\n\t * Or, 2) if the field is a value (and truthy), and html is undefined/not provided, then return the field value.\n\t * Instead of 2), you can also reference a variable directly, but risk outputting \'undefined\' into the output html.\n\t * @param field Either a data value evaluating as truthy, or a Boolean.\n\t * @param html Optional html field to use if field is Boolean.\n\t * @returns {string|*}\n\t */\n\toutputif( field, html ) { // function to be called outputif, or printif\n\t\tif ( field ) {\n\t\t\treturn html ? html : field;\n\t\t} else {\n\t\t\treturn \'\';\n\t\t}\n\t}\n\n\t/***\n\t * Conditionally output options passed to the view controller constructor. Wrapper for outputif to handle multiple options.\n\t * @param options\n\t * @returns {string}\n\t */\n\toutputOptions( options ) {\n\t\tlet output = [];\n\t\tfor ( var i = 0; i < options.length; i++ ) {\n\t\t\tlet result = this.outputif( options[i].option, options[i].html );\n\t\t\tif ( result ) {\n\t\t\t\toutput.push( result );\n\t\t\t}\n\t\t}\n\t\treturn output.length > 0 ? \'{ \' + output.join( \', \' ) + \' }\' : \'\';\n\t}\n\n\t/**\n\t * PascalCase to snake_case\n\t */\n\tconvertPascalCase2SnakeCase( string ) {\n\t\t// all lowercase separated by _\n\t\treturn string.split( /(?=[A-Z][a-z])/ ).join( \'_\' ).toLowerCase(); // Fix: [A-Z][a-z] is needed to not split on all caps like ROEView. But this wont handle single caps at the end though.\n\t}\n\n\t/**\n\t * PascalCase to kebab-case\n\t */\n\tconvertPascalCase2KebabCase( string ) {\n\t\t// all lowercase separated by -\n\t\treturn string.split( /(?=[A-Z][a-z])/ ).join( \'-\' ).toLowerCase(); // Fix: [A-Z][a-z] is needed to not split on all caps like ROEView. But this wont handle single caps at the end though.\n\t}\n\n\tgetTemplateTypeFromFilename( filename ) {\n\t\tvar type;\n\n\t\tswitch ( true ) { // known as \'overloaded switch\'\n\t\t\t// The following views will use the new templating logic. Order of these statements is important, first rule to match is used.\n\t\t\tcase this.checkViewClassForInlineHtmlbyFilename( filename ) !== false: // If success, it will return a String with the html.\n\t\t\t\t// If a view class contains a static html_template value, then use this as an override instead of any specific type template matched by filename.\n\t\t\t\ttype = TemplateType.INLINE_HTML;\n\t\t\t\tbreak;\n\t\t\tcase filename.indexOf( \'Sub\' ) === 0: // Checks \'Sub\' at start of filename. Must come before ReportView, otherwise it will conflict for SubSavedReportView.html\n\t\t\t\ttype = TemplateType.SUB_VIEW;\n\t\t\t\tbreak;\n\t\t\tcase filename.indexOf( \'EditView.html\' ) !== -1: // Must come before List Views, otherwise it will match for those due to both ending in View.html\n\t\t\t\ttype = TemplateType.EDIT_VIEW;\n\t\t\t\tbreak;\n\t\t\tcase filename.indexOf( \'ReportView.html\' ) !== -1 && filename.includes( \'Saved\' ) === false: // Must come before List Views, and after \'Sub\' otherwise reports will be loaded as list views. However make sure SavedReport is loaded as a list view.\n\t\t\t\ttype = TemplateType.REPORT_VIEW;\n\t\t\t\tbreak;\n\t\t\tcase filename.indexOf( \'View.html\' ) !== -1: // Must come more or less last, otherwise it will conflict with other files containing View.html, like EditView.html and ReportView.html\n\t\t\t\ttype = TemplateType.LIST_VIEW;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// If no template types are matched, treat as legacy html.\n\t\t\t\ttype = TemplateType.LEGACY_HTML; // This results in the relevant html file being loaded via the network. The new tab parsing logic may still run!\n\t\t}\n\n\t\treturn type;\n\t}\n\n\t//Certain views do not fall under the rules of \'getTemplateTypeFromFilename()\' and require special handling.\n\t//This can be removed once we switch how views are loaded and can apply these rules directly on the view itself.\n\tgetTemplateOptionsFromViewId( view_id ) {\n\t\tlet options = {\n\t\t\tview_id: view_id,\n\t\t\t// Remember, sub_view_mode is not included here as not yet available here; view controller has not yet been loaded. Sub View Mode will be determined by template_type using the file name data. Will be applied as an option in HtmlTemplates.getGenericListViewHtml\n\t\t};\n\n\t\t//The following tax reports require an additional tab.\n\t\tlet reports_require_form_setup = [\'RemittanceSummaryReport\', \'T4SummaryReport\', \'T4ASummaryReport\', \'Form941Report\', \'Form940Report\', \'Form1099NecReport\', \'FormW2Report\', \'AffordableCareReport\', \'USStateUnemploymentReport\'];\n\t\tif ( reports_require_form_setup.includes( view_id ) ) {\n\t\t\toptions.report_form_setup = true;\n\t\t}\n\n\t\tlet sub_view_require_warning_message = [`UserDateTotal`];\n\t\tif ( sub_view_require_warning_message.includes( view_id ) ) {\n\t\t\toptions.sub_view_warning_message = true;\n\t\t}\n\n\t\t//Issue #3158 - If these controllers are cached then side effects can occur.\n\t\t//Such as permission denied alerts after opening login view on Invoice -> Client view.\n\t\tlet view_do_not_cache_controller = [`LoginUserWizard`, \'LoginUser\', \'FindAvailableWizard\', \'FindAvailable\'];\n\t\tif ( view_do_not_cache_controller.includes( view_id ) ) {\n\t\t\toptions.do_not_cache_controller = true;\n\t\t}\n\n\t\t//Audit log is both a TemplateType.INLINE_HTML and a TemplateType.SUB_VIEW under the current HTML2JS system.\n\t\t//Once we switch to loading ViewControllers before HTML this special case can be removed.\n\t\tif( view_id === \'Log\' ) {\n\t\t\toptions.is_sub_view = true;\n\t\t}\n\n\t\t//Views extending BaseTreeViewController have slightly different requirments such as not show total number div.\n\t\t//Once we switch to loading ViewControllers before the HTML this can be conditional by checking if the controller has tree_mode set to true.\n\t\tlet base_tree_views = [\'JobGroup\', \'JobItemGroup\', \'PunchTagGroup\', \'UserGroup\', \'DocumentGroup\', \'KPIGroup\', \'ClientGroup\', \'ProductGroup\'];\n\t\tif ( base_tree_views.includes( view_id ) ) {\n\t\t\toptions.base_tree_view = true;\n\t\t}\n\n\t\treturn options;\n\t}\n\n\tcheckViewClassForInlineHtmlbyFilename( filename ) {\n\t\t// Lets see if this view class contains a html_template override, which should precede any type definitions.\n\t\tlet check_class = window[ filename.replace(/\\.html$/,\'\') + \'Controller\' ];\n\t\tif( check_class !== undefined && typeof check_class.html_template === \'string\' ) {\n\t\t\treturn check_class.html_template;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t *\n\t * @param {TemplateType} type\n\t * @param {Object} options\n\t * @param {Function} [onResult]\n\t */\n\tgetTemplate( type, options = {}, onResult ) {\n\n\t\tvar html_template;\n\n\t\tswitch ( type ) {\n\t\t\tcase TemplateType.LIST_VIEW:\n\t\t\t\thtml_template = this.getGenericListViewHtml( options );\n\t\t\t\tbreak;\n\t\t\tcase TemplateType.SUB_VIEW:\n\t\t\t\toptions.is_sub_view = true; // Force this to be true, as it\'s a sub_view after all. (This switch data is based off html filename request)\n\t\t\t\thtml_template = this.getGenericListViewHtml( options );\n\t\t\t\tbreak;\n\t\t\tcase TemplateType.EDIT_VIEW:\n\t\t\t\t// code block\n\t\t\t\thtml_template = HtmlTemplatesGlobal.genericEditView( options );\n\t\t\t\tbreak;\n\t\t\tcase TemplateType.REPORT_VIEW:\n\t\t\t\t// code block\n\t\t\t\thtml_template = HtmlTemplatesGlobal.genericReportEditView( options );\n\t\t\t\tbreak;\n\t\t\tcase TemplateType.INLINE_HTML:\n\t\t\t\thtml_template = this.getViewScriptTagHtml( options ) + this.checkViewClassForInlineHtmlbyFilename( options.filename );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tDebug.Error( \'HTML2JS: Error occured getting template. No matches for \' + options.view_id, \'HtmlTemplates.js\', \'HtmlTemplates.js\', \'getTemplate\', 1 );\n\t\t\t\treturn -1;\n\t\t}\n\n\t\t// If callback onResult exists, call the function, else return html.\n\t\tif ( onResult ) {\n\t\t\tonResult( html_template ); // should we put this outside the switch? Depends how similar the other switch statements are.\n\t\t} else {\n\t\t\treturn html_template;\n\t\t}\n\t}\n\n\t/**\n\t * This also handles subview script tags, if options.is_sub_view is true.\n\t * @param options\n\t * @returns {string}\n\t */\n\tgetGenericListViewHtml( options = {} ) {\n\t\tDebug.Text( \'HTML2JS: Template retrieved for \' + options.view_id, \'HtmlTemplates.js\', \'HtmlTemplates.js\', \'getGenericListViewHtml\', 10 );\n\t\t// Prepend the <script> tag to the html template, so it can be executed when inserted into the DOM later on in the onResult.\n\t\treturn this.getViewScriptTagHtml( options ) + HtmlTemplatesGlobal.genericListView( options );\n\t}\n\n\tgetViewScriptTagHtml( options = {} ) {\n\n\t\t/*\n\t\t* Note: In the legacy html load, the view controller would get instantiated via the <script> tag at the top of the html file, when this got loaded into the DOM.\n\t\t* This would have happened in the onResult() function, one of such is BaseViewController.loadView -> doNext().\n\t\t* Rather than insert a check there to trigger the view controller, or prepend the script tag, we can also try to just do that AFTER the onResult.\n\t\t* We should not do it before, as there is still cleanup code run by IndexController.removeCurrentView\n\t\t*\n\t\t* However, for now currently the best option is to pre-append the script tag info, because the onResult function won\'t always be from BaseViewController.loadView\n\t\t* */\n\n\t\tlet class_name = options.view_id + \'ViewController\';\n\t\tlet html_view_script_tag = `\x3c!-- JS2HTML ${this.outputif( options.is_sub_view, \'SUB_VIEW \' )}--\x3e<script type="text/javascript">\n\t\t\t\t\t\t\t\t\t\t\t\tvar ${this.outputif( options.is_sub_view, \'sub_\' )}${this.convertPascalCase2SnakeCase( options.view_id )}_view_controller = new ${class_name}(${this.outputOptions( [\n\t\t\t{ option: options.is_sub_view, html: \'sub_view_mode: true\' },\n\t\t\t{ option: options.do_not_cache_controller, html: \'can_cache_controller: false\' },\n\t\t] )});\n\t\t\t\t\t\t\t\t\t\t\t<\/script>`;\n\n\t\t// Prepend the <script> tag to the html template, so it can be executed when inserted into the DOM later on in the onResult.\n\t\t// html_template = html_view_script_tag + html_template;\n\t\t//\n\t\t// debugger; // A good debug point when you get errors around view controller instances not defined. But could also mean parent controller needs manual html insertion into the tab_model, as the subview doesnt have the right columns in the generic template, thus the container (to which the html initializing the controller) is attached, does not exist.\n\t\treturn html_view_script_tag;\n\t}\n\n\tgenericListView( options = {} ) {\n\n\t\t// Prepare the required data for the html template\n\t\tlet container_id = this.convertPascalCase2SnakeCase( options.view_id ) + \'_view_container\'; // E.g. branch_view_container. all lowercase separated by _ (Later in code, an id is added at the end of the string, like \'_318\') - Fix: [A-Z][a-z] is needed to not split on all caps like ROEView. But this wont handle single caps at the end though. // Also in most view.el\n\t\tlet container_class = this.convertPascalCase2KebabCase( options.view_id ) + \'-view\'; // E.g. branch-view. all lowercase separated by -\n\t\tlet view_template = `\n\t\t\t<div class="view js-generic-list-view ${this.outputif( container_class )}${this.outputif( options.is_sub_view, \' sub-view\' )}" id="${this.outputif( container_id )}">\n\t\t\t\t${this.outputif( options.sub_view_warning_message, \'<span class="warning-message"></span>\' )}\n\t\t\t\t<div class="clear-both-div"></div>\n\t\t\t\t${this.genericListGrid( options )}\n\t\t\t</div>\n\t\t`;\n\n\t\treturn view_template;\n\t}\n\n\tgenericListGrid( options = {} ) {\n\t\t// let sub_view = options.is_sub_view;\n\t\tlet grid_template = `\n\t\t<div class="grid-div js-generic-grid">\n\t\t\t${this.outputif( !options.is_sub_view && !options.base_tree_view, \'<div class="total-number-div"><span class="total-number-span"></span></div>\' )}\n\t\t\t<div class="grid-top-border"></div>\n\n\t\t\t${this.outputif( options.is_sub_view, \'<div class="sub-grid-view-div">\' )}\n\t\t\t\t<table id="grid"></table>\n\t\t\t${this.outputif( options.is_sub_view, \'</div>\' )}\n\n\t\t\t<div class="bottom-div">\n\t\t\t\t<div class="grid-bottom-border"></div>\n\t\t\t</div>\n\t\t</div>\n\t`;\n\n\t\treturn grid_template;\n\t}\n\n\tgenericEditView( options = {} ) {\n\t\t// Currently just for User Title Edit.\n\t\t// viewId: UserTitle\n\t\t// fileName: UserTitleEditView.html\n\t\t// Prepare the required data for the html template\n\t\tlet tab_bar_id = this.convertPascalCase2SnakeCase( options.view_id ) + \'_edit_view_tab_bar\'; // e.g. user_title_edit_view_tab_bar - all lowercase separated by _ - Fix: [A-Z][a-z] is needed to not split on all caps like ROEView. But this wont handle single caps at the end though.\n\t\tlet edit_view_class = options.view_id + \'EditView\'; // e.g. UserTitleEditView\n\t\tlet edit_view_template = `\n\t\t\t<div class="js-generic-edit-view edit-view ${this.outputif( edit_view_class )}">\n\t\t\t\t<div class="edit-view-tab-bar" id="${this.outputif( tab_bar_id )}">\n\t\t\t\t\t<div class="navigation-div" style="display: none">\n\t\t\t\t\t\t<span class="navigation-label"></span>\n\t\t\t\t\t\t<img class="left-click arrow"/>\n\t\t\t\t\t\t<div class="navigation-widget-div"></div>\n\t\t\t\t\t\t<img class="right-click arrow"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class="close-icon">x</span>\n\t\t\t\t\t<ul class="edit-view-tab-bar-label"></ul>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\t\treturn edit_view_template;\n\t}\n\n\tgenericTab( options = {} ) {\n\t\tlet is_multi_column = options.is_multi_column;\n\t\tlet show_permission_div = options.show_permission_div;\n\t\tlet is_sub = options.is_sub_view || false;\n\t\tlet tab_id = options.tab_id;\n\n\t\tlet save_continue_sub_view = `\n\t\t\t<div class="save-and-continue-div">\n\t\t\t\t<span class="message"></span>\n\t\t\t\t<div class="save-and-continue-button-div">\n\t\t\t\t\t<button class="tt-button p-button p-component" type="button">\n\t\t\t\t\t\t<span class="icon"></span>\n\t\t\t\t\t\t<span class="p-button-label"></span>\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\t\tlet permission_div = `\n\t\t\t\t<div class="save-and-continue-div permission-defined-div">\n\t\t\t\t\t<span class="message permission-message"></span>\n\t\t\t\t</div>`;\n\t\tlet template = `\n\t\t\t<div id="${tab_id}" class="html2js_flag edit-view-tab-outside${this.outputif( is_sub, \'-sub-view\' )}">\n\t\t\t\t<div class="edit-view-tab" id="${tab_id}_content_div">\n\t\t\t\t\t<div class="first-column${this.outputif( is_sub, \'-sub-view\' )}${this.outputif( !is_multi_column, \' full-width-column\' )}"></div>\n\t\t\t\t\t${this.outputif( is_multi_column, \'<div class="second-column"></div>\' )}\n\n\t\t\t\t\t${this.outputif( is_sub, save_continue_sub_view )}\n\t\t\t\t\t${this.outputif( show_permission_div, permission_div )}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\t\treturn template;\n\t}\n\n\tauditTab( options = {} ) {\n\t\tlet template = `\n\t\t\t<div id="tab_audit" class="html2js_flag_audit edit-view-tab-outside-sub-view">\n\t\t\t\t<div class="edit-view-tab" id="tab_audit_content_div">\n\t\t\t\t\t<div class="first-column-sub-view"></div>\n\t\t\t\t\t<div class="save-and-continue-div">\n\t\t\t\t\t\t<span class="message"></span>\n\t\t\t\t\t\t<div class="save-and-continue-button-div">\n\t\t\t\t\t\t\t<button class="tt-button p-button p-component" type="button">\n\t\t\t\t\t\t\t\t<span class="icon"></span>\n\t\t\t\t\t\t\t\t<span class="p-button-label"></span>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\t\treturn template;\n\t}\n\n\tgenericReportEditView( options = {} ) {\n\t\t// Some examples of the differences. Interestingly, all checked templates so far all had the main div class set to active-shift-report-view.\n\t\t// ActiveShiftReportView.html : view_id=ActiveShiftReport : id=active_shift_report_view_tab_bar\n\t\t// UserSummaryReportView.html : id=user_summary_report_view_tab_bar\n\t\t// PayStubTransactionSummaryReportView.html : id=pay_stub_summary_report_view_tab_bar\n\n\t\tlet tab_bar_id = this.convertPascalCase2SnakeCase( options.view_id ) + \'_view_tab_bar\';\n\t\tlet edit_view_template = `\n\t\t\t<div class="js-generic-report-edit-view edit-view active-shift-report-view">\n\t\t\t\t<div class="edit-view-tab-bar" id="${this.outputif( tab_bar_id )}">\n\t\t\t\t\t<div class="navigation-div" style="display: none">\n\t\t\t\t\t\t<span class="navigation-label"></span>\n\t\t\t\t\t\t<img class="left-click arrow"/>\n\t\t\t\t\t\t<div class="navigation-widget-div"></div>\n\t\t\t\t\t\t<img class="right-click arrow"/>\n\t\t\t\t\t</div>\n\t\t\t\t\t<span class="close-icon">x</span>\n\t\t\t\t\t<ul class="edit-view-tab-bar-label">\n\t\t\t\t\t\t<li><a ref="tab_report" href="#tab_report"></a></li>\n\t\t\t\t\t\t<li><a ref="tab_setup" href="#tab_setup"></a></li>\n\t\t\t\t\t\t<li><a ref="tab_chart" href="#tab_chart"></a></li>\n\t\t\t\t\t\t${this.outputif( options.report_form_setup || ( options.view_id && options.view_id === \'PayrollExportReport\' ), \'<li><a ref="tab_form_setup" href="#tab_form_setup"></a></li>\' )}\n\t\t\t\t\t\t<li><a ref="tab_custom_columns" href="#tab_custom_columns"></a></li>\n\t\t\t\t\t\t<li><a ref="tab_saved_reports" href="#tab_saved_reports"></a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<div id="tab_report" class="edit-view-tab-outside">\n\t\t\t\t\t\t<div class="edit-view-tab" id="tab_report_content_div">\n\t\t\t\t\t\t\t<div class="first-column full-width-column"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="tab_setup" class="edit-view-tab-outside">\n\t\t\t\t\t\t<div class="edit-view-tab" id="tab_setup_content_div">\n\t\t\t\t\t\t\t<div class="first-column full-width-column"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="tab_chart" class="edit-view-tab-outside">\n\t\t\t\t\t\t<div class="edit-view-tab" id="tab_chart_content_div">\n\t\t\t\t\t\t\t<div class="first-column full-width-column"></div>\n\t\t\t\t\t\t\t<div class="save-and-continue-div permission-defined-div">\n\t\t\t\t\t\t\t\t<span class="message permission-message"></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t${this.outputif( options.report_form_setup, `\n\t\t\t\t\t\t<div id="tab_form_setup" class="edit-view-tab-outside">\n\t\t\t\t\t\t\t<div class="edit-view-tab" id="tab_form_setup_content_div">\n\t\t\t\t\t\t\t\t<div class="first-column full-width-column"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>`\n\t\t\t\t\t)}\n\t\t\t\t\t${this.outputif( options.view_id && options.view_id === \'PayrollExportReport\', `\n\t\t\t\t\t\t<div id="tab_form_setup" class="edit-view-tab-outside">\n\t\t\t\t\t\t\t<div class="edit-view-tab" id="tab_form_setup_content_div">\n\t\t\t\t\t\t\t\t<div class="first-row first-column full-width-column">\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class="inside-editor-div full-width-column">\n\t\t\t\t\t\t\t\t\t<div class="grid-div">\n\t\t\t\t\t\t\t\t\t\t<table id="export_grid"></table>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>`\n\t\t\t\t\t)}\n\t\t\t\t\t<div id="tab_custom_columns" class="edit-view-tab-outside-sub-view">\n\t\t\t\t\t\t<div class="edit-view-tab" id="tab_custom_columns_content_div">\n\t\t\t\t\t\t\t<div class="first-column-sub-view"></div>\n\t\t\t\t\t\t\t<div class="save-and-continue-div">\n\t\t\t\t\t\t\t\t<span class="message"></span>\n\t\t\t\t\t\t\t\t<div class="save-and-continue-button-div">\n\t\t\t\t\t\t\t\t\t<button class="tt-button p-button p-component" type="button">\n\t\t\t\t\t\t\t\t\t\t<span class="icon"></span>\n\t\t\t\t\t\t\t\t\t\t<span class="p-button-label"></span>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="save-and-continue-div permission-defined-div">\n\t\t\t\t\t\t\t\t<span class="message permission-message"></span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="tab_saved_reports" class="edit-view-tab-outside-sub-view">\n\t\t\t\t\t\t<div class="edit-view-tab" id="tab_saved_reports_content_div">\n\t\t\t\t\t\t\t<div class="first-column-sub-view"></div>\n\t\t\t\t\t\t\t<div class="save-and-continue-div">\n\t\t\t\t\t\t\t\t<span class="message"></span>\n\t\t\t\t\t\t\t\t<div class="save-and-continue-button-div">\n\t\t\t\t\t\t\t\t\t<button class="tt-button p-button p-component" type="button">\n\t\t\t\t\t\t\t\t\t\t<span class="icon"></span>\n\t\t\t\t\t\t\t\t\t\t<span class="p-button-label"></span>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`;\n\n\t\treturn edit_view_template;\n\t}\n\n\n\n\n\t// This might still work, but put on hold as we chose to focus on the list, edit and sub views and tabs\n\t// getEditViewFormItem( options = {} ) {\n\t// \tlet sub_view = options.is_sub_view || false;\n\t// \tlet template = `\n\t// \t<div class="edit-view-form-item-div">\n\t// \t\t<div class="edit-view-form-item-${ sub_view ? \'sub-\' : \'\'}label-div"><span class="edit-view-form-item-label"></span></div>\n\t// \t\t<div class="edit-view-form-item-input-div"></div>\n\t// \t</div>\n\t// `;\n\t//\n\t// \treturn template;\n\t// }\n}\n\n/**\n *\n * @type {Readonly<{string, symbol}>}\n */\nconst TemplateType = Object.freeze( {\n\tLIST_VIEW: Symbol( \'LIST_VIEW\'),\n\tSUB_VIEW: Symbol( \'SUB_VIEW\'),\n\tEDIT_VIEW: Symbol( \'EDIT_VIEW\'),\n\tREPORT_VIEW: Symbol( \'REPORT_VIEW\'),\n\tINLINE_HTML: Symbol( \'INLINE_HTML\'),\n\tLEGACY_HTML: Symbol( \'LEGACY_HTML\'),\n} );\n\nconst HtmlTemplatesGlobal = new HtmlTemplates();\nwindow.TT_HTML_G = HtmlTemplatesGlobal; // TODO: Temp for dev, remove after all done.\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU3OC5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLGNBQWM7QUFDZDtBQUNBLDJCQUEyQjtBQUMzQjtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7QUFDQTs7QUFFQTtBQUN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G5cbi8qKlxuICpcbiAqIEB0eXBlIHtSZWFkb25seTx7c3RyaW5nLCBzeW1ib2x9Pn1cbiAqL1xuY29uc3QgVGVtcGxhdGVUeXBlID0gT2JqZWN0LmZyZWV6ZSgge1xuXHRMSVNUX1ZJRVc6IFN5bWJvbCggJ0xJU1RfVklFVycpLFxuXHRTVUJfVklFVzogU3ltYm9sKCAnU1VCX1ZJRVcnKSxcblx0RURJVF9WSUVXOiBTeW1ib2woICdFRElUX1ZJRVcnKSxcblx0UkVQT1JUX1ZJRVc6IFN5bWJvbCggJ1JFUE9SVF9WSUVXJyksXG5cdElOTElORV9IVE1MOiBTeW1ib2woICdJTkxJTkVfSFRNTCcpLFxuXHRMRUdBQ1lfSFRNTDogU3ltYm9sKCAnTEVHQUNZX0hUTUwnKSxcbn0gKTtcblxuY29uc3QgSHRtbFRlbXBsYXRlc0dsb2JhbCA9IG5ldyBIdG1sVGVtcGxhdGVzKCk7XG53aW5kb3cuVFRfSFRNTF9HID0gSHRtbFRlbXBsYXRlc0dsb2JhbDsgLy8gVE9ETzogVGVtcCBmb3IgZGV2LCByZW1vdmUgYWZ0ZXIgYWxsIGRvbmUuXG5leHBvcnQge1xuXHRIdG1sVGVtcGxhdGVzR2xvYmFsLFxuXHQvLyBIdG1sVGVtcGxhdGVzIGFzIEh0bWxUZW1wbGF0ZXNDbGFzcywgLy8gTm90IHlldCB1c2VkIGFzIHdlIGFyZSBzaGFyaW5nIHRoZSBvbmUgZ2xvYmFsIGluc3RhbmNlIGFjcm9zcyBzY3JpcHRzIGF0IHRoZSBtb21lbnQuXG5cdFRlbXBsYXRlVHlwZSxcbn07Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4578\n')},12:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"n\": () => (/* binding */ ServiceCaller)\n});\n\n// EXTERNAL MODULE: ./interface/html5/model/Base.js\nvar Base = __webpack_require__(3751);\n;// CONCATENATED MODULE: ./interface/html5/model/ResponseObject.js\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\nclass ResponseObject extends Base/* Base */.X {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tonResult: null,\n\t\t\tonError: null,\n\t\t\tdelegate: null,\n\t\t\tasync: null\n\t\t} );\n\t\tsuper( options );\n\t}\n}\n\n// EXTERNAL MODULE: ./interface/html5/global/TTUUID.js\nvar TTUUID = __webpack_require__(4936);\n;// CONCATENATED MODULE: ./interface/html5/model/APIReturnHandler.js\n/* provided dependency */ var APIReturnHandler_ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/*\n\n To be the common data model for data return from api\n\n */\n\n\nclass APIReturnHandler extends Base/* Base */.X {\n\n\tconstructor( options = {} ) {\n\t\tAPIReturnHandler_.defaults( options, {\n\t\t\tresult_data: null,\n\t\t\tdelegate: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tisValid() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_retval ) && this.get( 'result_data' ).api_retval === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tgetDetails() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.details ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.details;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tgetPagerData() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.pager ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.pager;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetResult() {\n\n\t\tvar result;\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_retval ) ) {\n\t\t\tresult = this.get( 'result_data' ).api_retval;\n\t\t} else {\n\t\t\tresult = this.get( 'result_data' );\n\t\t}\n\n\t\tif ( typeof result === 'undefined' ) {\n\t\t\tresult = null;\n\t\t} else if ( $.type( result ) === 'array' && result.length === 0 ) {\n\t\t\tresult = {};\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n\tgetCode() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.code ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.code;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetDescription() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.description ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.description;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetRecordDetails() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.record_details ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.record_details;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetTotalRecords() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.record_details ) &&\n\t\t\tGlobal.isSet( this.get( 'result_data' ).api_details.record_details.total_records ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.record_details.total_records;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetValidRecords() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.record_details ) &&\n\t\t\tGlobal.isSet( this.get( 'result_data' ).api_details.record_details.valid_records ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.record_details.valid_records;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetInValidRecords() {\n\t\tif ( Global.isSet( this.get( 'result_data' ).api_details ) && Global.isSet( this.get( 'result_data' ).api_details.record_details ) &&\n\t\t\tGlobal.isSet( this.get( 'result_data' ).api_details.record_details.invalid_records ) ) {\n\t\t\treturn this.get( 'result_data' ).api_details.record_details.invalid_records;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetAttributeInAPIDetails( attrName ) {\n\t\tlet result_data = this.get( 'result_data' );\n\n\t\tif ( result_data && result_data.api_details ) {\n\t\t\treturn result_data.api_details[attrName];\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetDetailsAsString() {\n\t\tvar errorInfo = '';\n\n\t\t$.each( this.getDetails(), function( index, errorItem ) {\n\n\t\t\tfor ( var i in errorItem ) {\n\t\t\t\terrorInfo += errorItem[i][0] + '\\r';\n\t\t\t}\n\t\t} );\n\n\t\treturn errorInfo;\n\t}\n\n}\n\n;// CONCATENATED MODULE: ./interface/html5/services/ServiceCaller.js\n/* provided dependency */ var ServiceCaller_$ = __webpack_require__(9755);\n\n\n\n\nclass ServiceCaller extends Backbone.Model {\n\tconstructor() {\n\t\tServiceCaller_$.xhrPool = [];\n\t\tsuper();\n\t}\n\n\tgetMessageId() {\n\t\tif ( this.message_id ) {\n\t\t\treturn this.message_id\n\t\t} else {\n\t\t\tthis.setMessageId( TTUUID/* TTUUID.generateUUID */.d.generateUUID() );\n\t\t\treturn this.message_id;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tsetMessageId( value ) {\n\t\tthis.message_id = value;\n\n\t\treturn true;\n\t}\n\n\tgetIsIdempotent() {\n\t\tif ( this.is_idempotent ) {\n\t\t\treturn this.is_idempotent\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tsetIsIdempotent( value ) {\n\t\tthis.is_idempotent = value;\n\n\t\treturn true;\n\t}\n\n\targumentsHandler() {\n\t\tvar className = arguments[0];\n\t\tvar function_name = arguments[1];\n\t\tvar apiArgsAndResponseObject = arguments[2];\n\t\tvar lastApiArgsAndResponseObject = arguments[2][( apiArgsAndResponseObject.length - 1 )];\n\t\tvar apiArgs = {};\n\t\tvar responseObject;\n\t\tvar len;\n\n\t\tif ( Global.isSet( lastApiArgsAndResponseObject.onResult ) || Global.isSet( lastApiArgsAndResponseObject.async ) ) {\n\t\t\tlen = ( apiArgsAndResponseObject.length - 1 );\n\n\t\t\tresponseObject = new ResponseObject( lastApiArgsAndResponseObject );\n\n\t\t} else {\n\t\t\tlen = apiArgsAndResponseObject.length;\n\t\t\tresponseObject = null;\n\t\t}\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tapiArgs[i] = apiArgsAndResponseObject[i];\n\n\t\t\tif ( i === 0 && len === 1 &&\n\t\t\t\tGlobal.isSet( apiArgs[i] ) &&\n\t\t\t\tGlobal.isSet( apiArgs[i].second_parameter ) ) {\n\t\t\t\tapiArgs[1] = apiArgs[i].second_parameter;\n\t\t\t}\n\n\t\t}\n\n\t\treturn this.call( className, function_name, responseObject, apiArgs );\n\t}\n\n\tgetOptionsCacheKey( api_args, key ) {\n\n\t\tServiceCaller_$.each( api_args, function( index, value ) {\n\n\t\t\tif ( ServiceCaller_$.type( value ) === 'object' ) {\n\t\t\t\tkey = key + '_' + JSON.stringify( value );\n\t\t\t} else {\n\t\t\t\tkey = key + '_' + value;\n\t\t\t}\n\n\t\t} );\n\n\t\treturn key;\n\n\t}\n\n\trepeatAPICall( className, function_name, apiArgs, responseObject ) {\n\t\tlet params = Object.values( JSON.parse( apiArgs.json ) );\n\t\tTTAPI[className][function_name]( ...params, responseObject.attributes );\n\t}\n\n\tuploadFile( form_data, paramaters, responseObj ) {\n\t\tvar message_id = this.getMessageId();\n\t\tProgressBar.showProgressBar( message_id );\n\n\t\t//On IE 9\n\t\tif ( typeof FormData == 'undefined' ) {\n\t\t\tform_data.attr( 'method', 'POST' );\n\t\t\tform_data.attr( 'action', ServiceCaller.getURLByObjectType( 'upload' ) + '?' + paramaters + '&' + Global.getSessionIDKey() + '=' + LocalCacheData.getSessionID() );\n\t\t\tform_data.attr( 'enctype', 'multipart/form-data' );\n\n\t\t\tProgressBar.changeProgressBarMessage( 'File Uploading' );\n\t\t\tform_data.ajaxForm().ajaxSubmit( {\n\t\t\t\tsuccess: function( result ) {\n\t\t\t\t\tif ( result && result.toString().toLocaleLowerCase() !== 'true' ) {\n\t\t\t\t\t\tTAlertManager.showAlert( result );\n\t\t\t\t\t}\n\t\t\t\t\tProgressBar.removeProgressBar();\n\t\t\t\t\tif ( responseObj.onResult ) {\n\t\t\t\t\t\tresponseObj.onResult( result );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\tProgressBar.changeProgressBarMessage( 'File Uploading' );\n\t\tServiceCaller_$.ajax( {\n\t\t\turl: ServiceCaller.getURLByObjectType( 'upload' ) + '?' + paramaters + '&' + Global.getSessionIDKey() + '=' + LocalCacheData.getSessionID(), //Server script to process data\n\t\t\theaders: {\n\t\t\t\t//Handle CSRF tokens and related headers here.\n\t\t\t\t'X-Client-ID': 'Browser-TimeTrex',\n\t\t\t\t'X-CSRF-Token': getCookie( 'CSRF-Token' ),\n\t\t\t},\n\t\t\ttype: 'POST',\n\n//\t\t\txhr: function() { // Custom XMLHttpRequest\n//\t\t\t\tvar myXhr = $.ajaxSettings.xhr();\n//\t\t\t\tif ( myXhr.upload ) { // Check if upload property exists\n//\t\t\t\t\tmyXhr.upload.addEventListener( 'progress', progressHandlingFunction, false ); // For handling the progress of the upload\n//\t\t\t\t}\n//\n//\t\t\t\tfunction progressHandlingFunction() {\n//\t\t\t\t}\n//\n//\t\t\t\treturn myXhr;\n//\n//\t\t\t},\n\n\t\t\tsuccess: function( result ) {\n\t\t\t\tif ( result && result.toString().toLocaleLowerCase() !== 'true' ) {\n\t\t\t\t\tTAlertManager.showAlert( result );\n\t\t\t\t}\n\n\t\t\t\tif ( responseObj.onResult ) {\n\t\t\t\t\tresponseObj.onResult( result );\n\t\t\t\t}\n\n\t\t\t\tProgressBar.removeProgressBar();\n\t\t\t},\n\t\t\t// Form data\n\t\t\tdata: form_data,\n\t\t\tcache: false,\n\t\t\tcontentType: false,\n\t\t\tprocessData: false\n\t\t} );\n\n\t}\n\n\tprettyPrintAPIArguments( apiArgs ) {\n\t\tif ( apiArgs && apiArgs.json ) {\n\t\t\tvar retval = [];\n\t\t\tvar args = JSON.parse( apiArgs.json );\n\t\t\tfor ( var property_name in args ) {\n\t\t\t\tvar arg = args[property_name];\n\t\t\t\tretval.push( JSON.stringify( arg, null, 2 ) ); //Pretty print JSON\n\t\t\t}\n\n\t\t\treturn retval.join( ', ' );\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tgetCache( cache_key, responseObject, function_name, apiArgs ) {\n\t\tlet result = LocalCacheData.result_cache[cache_key];\n\t\t//Debug.Arr(result, 'Response from cached result. Key: '+cache_key, 'ServiceCaller.js', 'ServiceCaller', 'call', 10);\n\n\t\tlet apiReturnHandler = new APIReturnHandler();\n\n\t\tapiReturnHandler.set( 'result_data', result );\n\t\tapiReturnHandler.set( 'delegate', responseObject.get( 'delegate' ) );\n\t\tapiReturnHandler.set( 'function_name', function_name );\n\t\tapiReturnHandler.set( 'args', apiArgs );\n\n\t\tif ( responseObject.get( 'onResult' ) ) {\n\t\t\tresponseObject.get( 'onResult' )( apiReturnHandler );\n\t\t}\n\n\t\treturn apiReturnHandler;\n\t};\n\n\tisCachableFunction( function_name ) {\n\t\tlet is_cachable = false;\n\n\t\tswitch ( function_name ) {\n\t\t\tcase 'getOptions':\n\t\t\tcase 'isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled':\n\t\t\tcase 'getUserGroup':\n\t\t\tcase 'getJobGroup':\n\t\t\tcase 'getJobItemGroup':\n\t\t\tcase 'getProductGroup':\n\t\t\tcase 'getDocumentGroup':\n\t\t\tcase 'getQualificationGroup':\n\t\t\tcase 'getKPIGroup':\n\t\t\tcase 'getHierarchyControlOptions':\n\t\t\t\tis_cachable = true;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn is_cachable;\n\t}\n\n\tcall( className, function_name, responseObject, apiArgs ) {\n\t\tvar $this = this;\n\t\tvar message_id;\n\t\tvar base_url = ServiceCaller.getAPIURL( 'Class=' + className + '&Method=' + function_name + '&v=2' );\n\t\tvar url = base_url;\n\t\tif ( LocalCacheData.getAllURLArgs() ) {\n\t\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'user_id' ) ) {\n\t\t\t\turl = url + '&user_id=' + LocalCacheData.getAllURLArgs().user_id;\n\t\t\t}\n\t\t\tif ( LocalCacheData.getAllURLArgs().hasOwnProperty( 'company_id' ) ) {\n\t\t\t\turl = url + '&company_id=' + LocalCacheData.getAllURLArgs().company_id;\n\t\t\t}\n\t\t}\n\t\tif ( Global.getStationID() ) {\n\t\t\turl = url + '&StationID=' + Global.getStationID();\n\t\t}\n\n\t\tvar apiReturnHandler;\n\t\tvar async;\n\n\t\tif ( responseObject && responseObject.get( 'async' ) === false ) {\n\t\t\tasync = responseObject.get( 'async' );\n\t\t} else {\n\t\t\tasync = true;\n\t\t}\n\t\tvar cache_key;\n\t\tswitch ( function_name ) {\n\t\t\tcase 'getOptions':\n\t\t\tcase 'isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled':\n\t\t\tcase 'getHierarchyControlOptions':\n\t\t\tcase 'getUserGroup':\n\t\t\tcase 'getJobGroup':\n\t\t\tcase 'getJobItemGroup':\n\t\t\tcase 'getProductGroup':\n\t\t\tcase 'getDocumentGroup':\n\t\t\tcase 'getQualificationGroup':\n\t\t\tcase 'getKPIGroup':\n\n\t\t\t\tif ( function_name === 'getUserGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'userGroup';\n\t\t\t\t} else if ( function_name === 'getJobGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'jobGroup';\n\t\t\t\t} else if ( function_name === 'getJobItemGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'jobItemGroup';\n\t\t\t\t} else if ( function_name === 'getProductGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'productGroup';\n\t\t\t\t} else if ( function_name === 'getDocumentGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'documentGroup';\n\t\t\t\t} else if ( function_name === 'getQualificationGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'qualificationGroup';\n\t\t\t\t} else if ( function_name === 'getKPIGroup' ) {\n\t\t\t\t\tcache_key = className + '.' + 'kPIGroup';\n\t\t\t\t} else if ( function_name === 'getHierarchyControlOptions' ) {\n\t\t\t\t\tcache_key = 'getHierarchyControlOptions';\n\t\t\t\t} else {\n\t\t\t\t\tcache_key = this.getOptionsCacheKey( apiArgs, className + '.' + function_name );\n\t\t\t\t}\n\t\t\t\tif ( responseObject.get( 'noCache' ) === true ) {\n\t\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\t}\n\n\t\t\t\tif ( cache_key && LocalCacheData.result_cache[cache_key] ) {\n\t\t\t\t\t//Use a promise to help prevent identical calls from being made before the first one returns and sets the cache.\n\t\t\t\t\tif ( LocalCacheData.result_cache[cache_key].pending ) {\n\t\t\t\t\t\tTTPromise.add( 'ServiceCaller', cache_key );\n\t\t\t\t\t\tTTPromise.wait( 'ServiceCaller', cache_key, function() {\n\t\t\t\t\t\t\tthis.getCache( cache_key, responseObject, function_name, apiArgs );\n\t\t\t\t\t\t}.bind( this ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn this.getCache( cache_key, responseObject, function_name, apiArgs );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn apiReturnHandler;\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'setUserGroup':\n\t\t\tcase 'deleteUserGroup':\n\t\t\t\tcache_key = className + '.' + 'userGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setJobGroup':\n\t\t\tcase 'deleteJobGroup':\n\t\t\t\tcache_key = className + '.' + 'jobGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setJobItemGroup':\n\t\t\tcase 'deleteJobItemGroup':\n\t\t\t\tcache_key = className + '.' + 'jobItemGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setProductGroup':\n\t\t\tcase 'deleteProductGroup':\n\t\t\t\tcache_key = className + '.' + 'productGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setDocumentGroup':\n\t\t\tcase 'deleteDocumentGroup':\n\t\t\t\tcache_key = className + '.' + 'documentGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setQualificationGroup':\n\t\t\tcase 'deleteQualificationGroup':\n\t\t\t\tcache_key = className + '.' + 'qualificationGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t\tcase 'setKPIGroup':\n\t\t\tcase 'deleteKPIGroup':\n\t\t\t\tcache_key = className + '.' + 'kPIGroup';\n\t\t\t\tLocalCacheData.result_cache[cache_key] = false;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tmessage_id = this.getMessageId();\n\n\t\tTTPromise.add( 'ServiceCaller', message_id );\n\n\t\tif ( className !== 'APIProgressBar' && function_name !== 'Logout' ) {\n\t\t\turl = url + '&MessageID=' + message_id;\n\t\t}\n\n\t\tif ( this.getIsIdempotent() == true ) {\n\t\t\turl = url + '&idempotent=1';\n\t\t}\n\n\t\tif ( ServiceCaller.extra_url ) {\n\t\t\turl = url + ServiceCaller.extra_url;\n\t\t}\n\n\t\tif ( !apiArgs ) {\n\t\t\tapiArgs = {};\n\n\t\t}\n\n\t\tapiArgs = { json: JSON.stringify( apiArgs ) };\n\n\t\t//Try to get a stack trace for each function call so if an error occurs we know exactly what triggered the call.\n\t\tvar stack_trace_str = null;\n\t\tif ( typeof Error !== 'undefined' ) {\n\t\t\tvar stack_trace = ( new Error() );\n\t\t\tif ( typeof stack_trace === 'object' && stack_trace.stack && typeof stack_trace.stack === 'string' ) {\n\t\t\t\tstack_trace_str = stack_trace.stack.split( '\\n' ); //This is eventually JSONified so convert it to an array for better formatting.\n\t\t\t} else {\n\t\t\t\tstack_trace_str = null;\n\t\t\t}\n\t\t\tstack_trace = null; // Previously null was 'delete' but not valid in JS strict mode.\n\t\t}\n\n\t\tvar api_called_date = new Date();\n\t\tvar api_stack = {\n\t\t\tapi: className + '.' + function_name,\n\t\t\targs: apiArgs.json,\n\t\t\tmessage_id: this.getMessageId(),\n\t\t\tapi_called_date: api_called_date.toISOString(),\n\t\t\tstack_trace: stack_trace_str\n\t\t};\n\t\tstack_trace_str = null; // Previously null was 'delete' but not valid in JS strict mode.\n\n\t\tif ( LocalCacheData.api_stack.length === 16 ) {\n\t\t\tLocalCacheData.api_stack.pop();\n\t\t}\n\n\t\tif ( function_name !== 'sendErrorReport' ) {\n\t\t\tLocalCacheData.api_stack.unshift( api_stack );\n\t\t}\n\n\t\tif ( className !== 'APIProgressBar' && function_name !== 'Login' && function_name !== 'getPreLoginData' && function_name !== 'listenForMultiFactorAuthentication' ) {\n\t\t\tProgressBar.showProgressBar( message_id );\n\t\t}\n\n\t\tif ( this.isCachableFunction( function_name ) === true ) {\n\t\t\tLocalCacheData.result_cache[cache_key] = { pending: true };\n\t\t}\n\n\t\tServiceCaller_$.ajax(\n\t\t\t{\n\t\t\t\tdataType: 'JSON',\n\t\t\t\tdata: apiArgs,\n\t\t\t\theaders: {\n\t\t\t\t\t//#1568 - Add \"fragment\" to POST variables in API calls so the server can get it...\n\t\t\t\t\t//Encoding is a must, otherwise HTTP requests will be corrupted on some web browsers (ie: Mobile Safari)\n\t\t\t\t\t//This caused the corrupted requests for things like: \"POST_/api/json/api_php?Class\"\n\t\t\t\t\t//Also it must use dashes instead of underscores for separators.\n\t\t\t\t\t'Request-Uri-Fragment': encodeURIComponent( LocalCacheData.fullUrlParameterStr ),\n\n\t\t\t\t\t//Handle CSRF tokens and related headers here.\n\t\t\t\t\t'X-Client-ID': 'Browser-TimeTrex',\n\t\t\t\t\t'X-CSRF-Token': getCookie( 'CSRF-Token' ),\n\t\t\t\t},\n\t\t\t\ttype: 'POST',\n\t\t\t\tasync: async,\n\t\t\t\turl: url,\n\t\t\t\tbeforeSend: function( jqXHR ) {\n\t\t\t\t\tServiceCaller_$.ajax.request_start_time = Date.now();\n\t\t\t\t\tthis.jqXHR = jqXHR;\n\t\t\t\t\tServiceCaller_$.xhrPool.push( this ); //Track all pending AJAX requests so we can cancel them if needed.\n\t\t\t\t},\n\t\t\t\tcomplete: function( jqXHR ) {\n\t\t\t\t\tvar index = ServiceCaller_$.xhrPool.indexOf( this );\n\t\t\t\t\tif ( index > -1 ) {\n\t\t\t\t\t\tServiceCaller_$.xhrPool.splice( index, 1 ); //Remove completed AJAX request from pool.\n\t\t\t\t\t}\n\n\t\t\t\t\tvar request_total_time = ( Date.now() - ServiceCaller_$.ajax.request_start_time ); //milliseconds\n\t\t\t\t\tif ( request_total_time > 1000 ) { //Only log API calls that are slow.\n\t\t\t\t\t\tif ( typeof ( gtag ) !== 'undefined' && APIGlobal.pre_login_data.analytics_enabled === true ) {\n\t\t\t\t\t\t\tgtag( 'event', 'api_call', {\n\t\t\t\t\t\t\t\tclass: className,\n\t\t\t\t\t\t\t\tmethod: function_name,\n\t\t\t\t\t\t\t\tresponse_time: request_total_time\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tDebug.Text( 'AJAX Response: Class: ' + className + ' Method: ' + function_name + ' Time: ' + request_total_time + 'ms', 'ServiceCaller.js', 'ServiceCaller', 'complete', 11 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsuccess: function( result ) {\n\t\t\t\t\t//Debug.Arr(result, 'Response from API. message_id: '+ message_id, 'ServiceCaller.js', 'ServiceCaller', null, 10);\n\n\t\t\t\t\t//Resets message_id so it changes on the next API call. Only do this on success, so idempotent requests that error out don't get a new key on the next call.\n\t\t\t\t\t// FIXME: async API calls on the same api object can conflict with one another though.\n\t\t\t\t\t// Take for instance onFormItemChange() triggering async api.Validate*(), when api.set*() is called, the idempotent=1 can be enabled for the validation with the same key.\n\t\t\t\t\t// Then the set*() might incorrectly return the result from the validate()\n\t\t\t\t\t// This is partially fixed by ignoring idempotency on all validate*() calls in the API, which it probably should anyways. However we need a proper fix for this in JS.\n\t\t\t\t\t$this.setMessageId( null );\n\n\t\t\t\t\tif ( Global.enable_api_tracing == true ) {\n\t\t\t\t\t\tvar api_trace_label = '%cAPI Request:%c ' + className + '->' + function_name + '(...) [Expand for Details]';\n\t\t\t\t\t\tconsole.groupCollapsed( api_trace_label, 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.log( '%c' + className + '->' + function_name + '%c(' + $this.prettyPrintAPIArguments( apiArgs ) + ')', 'font-weight: bold', 'font-weight: normal' );\n\n\t\t\t\t\t\tvar api_trace_raw_request_label = '%cRaw Request:%c [Expand for Details]';\n\t\t\t\t\t\tconsole.groupCollapsed( api_trace_raw_request_label, 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.log( '%cURL:%c ' + url, 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.log( '%cRaw POST Body (non-URLEncoded):%c json=' + apiArgs.json + '', 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.log( '%ccURL Command:%c curl -k --location --request POST --cookie \"' + Global.getSessionIDKey() + '=<SessionID>\" --form \\'json=' + apiArgs.json + '\\' \"' + base_url + '\"', 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.groupEnd( api_trace_raw_request_label );\n\n\t\t\t\t\t\tvar api_trace_response_label = '%cResponse:%c [Expand for Details]';\n\t\t\t\t\t\tconsole.groupCollapsed( api_trace_response_label, 'font-weight: bold', 'font-weight: normal' );\n\t\t\t\t\t\tconsole.log( JSON.stringify( result, null, 2 ) );\n\t\t\t\t\t\tconsole.groupEnd( api_trace_response_label );\n\n\t\t\t\t\t\tconsole.groupEnd( api_trace_label );\n\t\t\t\t\t\tapi_trace_raw_request_label = null; // Previously null was 'delete' but not valid in JS strict mode.\n\t\t\t\t\t\tapi_trace_response_label = null; // Previously null was 'delete' but not valid in JS strict mode.\n\t\t\t\t\t\tapi_trace_label = null; // Previously null was 'delete' but not valid in JS strict mode.\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !Global.isSet( result ) ) {\n\t\t\t\t\t\tresult = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ( className !== 'APIProgressBar' && function_name !== 'Login' && function_name !== 'getPreLoginData' && function_name !== 'listenForMultiFactorAuthentication' ) {\n\t\t\t\t\t\tProgressBar.removeProgressBar( message_id );\n\t\t\t\t\t}\n\n\t\t\t\t\tapiReturnHandler = new APIReturnHandler();\n\t\t\t\t\tapiReturnHandler.set( 'result_data', result );\n\t\t\t\t\tapiReturnHandler.set( 'delegate', responseObject.get( 'delegate' ) );\n\t\t\t\t\tapiReturnHandler.set( 'function_name', function_name );\n\t\t\t\t\tapiReturnHandler.set( 'args', apiArgs );\n\n\t\t\t\t\tif ( !apiReturnHandler.isValid() && ( apiReturnHandler.getCode() === 'EXCEPTION' || apiReturnHandler.getCode() === 'EXCEPTION_CSRF' ) ) {\n\t\t\t\t\t\tDebug.Text( 'api-exception: Code: ' + apiReturnHandler.getCode() + ' Error: ' + apiReturnHandler.getDescription() +' Message ID: '+ message_id, 'ServiceCaller.js', 'ServiceCaller', null, 10);\n\t\t\t\t\t\tif ( apiReturnHandler.getCode() === 'EXCEPTION_CSRF' ) { //Don't bother recording CSRF exceptions.\n\t\t\t\t\t\t\tGlobal.sendAnalyticsEvent( 'service-caller', 'error:api-exception', 'api-exception: Code: ' + apiReturnHandler.getCode() + ' Error: ' + apiReturnHandler.getDescription() );\n\t\t\t\t\t\t\tTAlertManager.showAlert( apiReturnHandler.getDescription(), 'Error', function() {\n\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tGlobal.sendErrorReport( 'api-exception: Code: ' + apiReturnHandler.getCode() + ' Error: ' + apiReturnHandler.getDescription(), 'ServiceCaller.js' );\n\t\t\t\t\t\t\tTAlertManager.showAlert( ServiceCaller_$.i18n._( 'API Exception' ) + ': ' + apiReturnHandler.getDescription(), 'Error' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Error: Uncaught ReferenceError: promise_key is not defined\n\t\t\t\t\t\tif ( typeof promise_key != 'undefined' ) {\n\t\t\t\t\t\t\tTTPromise.reject( 'ServiceCaller', message_id );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tDebug.Text( 'ERROR: Unable to release promise because key is NULL.', 'ServiceCaller.js', 'ServiceCaller', null, 10 );\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if ( !apiReturnHandler.isValid() && apiReturnHandler.getCode() === 'SESSION' ) {\n\t\t\t\t\t\t//Debug.Text('API returned session expired: '+ message_id, 'ServiceCaller.js', 'ServiceCaller', null, 10);\n\t\t\t\t\t\tGlobal.Logout(); //clearSessionCookie() in Logout() helps skip other API calls or prevent the UI from thinking we are still logged in.\n\t\t\t\t\t\tServiceCaller.cancel_all_error = true;\n\t\t\t\t\t\tLocalCacheData.login_error_string = ServiceCaller_$.i18n._( 'Session expired, please login again.' );\n\t\t\t\t\t\tif ( window.location.href == Global.getBaseURL() + '#!m=' + 'Login' ) {\n\t\t\t\t\t\t\t// Prevent a partially loaded login screen when SessionID cookie is set but not valid on server.\n\t\t\t\t\t\t\t// However if the session is expired on the server, and the user tries to navigate to some other page,\n\t\t\t\t\t\t\t// there could be multiple API calls queued up, which causes this reload() to be triggered many times,\n\t\t\t\t\t\t\t// and network requests to be aborted, which triggers error messages. Disable the reload for now as in theory it shouldn't be needed.\n\t\t\t\t\t\t\t// This reload also gets rid of the \"Session expired, please login again\" error message, which is not ideal.\n\t\t\t\t\t\t\t//window.location.reload();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar paths = Global.getBaseURL().replace( ServiceCaller.root_url, '' ).split( '/' );\n\t\t\t\t\t\t\tif ( paths.indexOf( 'quick_punch' ) > 0 ) {\n\t\t\t\t\t\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=' + 'QuickPunchLogin' );\n\t\t\t\t\t\t\t} else if ( paths.indexOf( 'portal' ) > 0 ) {\n\t\t\t\t\t\t\t\tif ( LocalCacheData.getAllURLArgs().company_id ) {\n\t\t\t\t\t\t\t\t\tLocalCacheData.setPortalLoginUser( null );\n\t\t\t\t\t\t\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=PortalJobVacancy&company_id=' + LocalCacheData.getAllURLArgs().company_id );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( !LocalCacheData.getAllURLArgs().company_id ) {\n\t\t\t\t\t\t\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=' + 'Login' );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tTTPromise.resolve( 'ServiceCaller', message_id );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if ( !apiReturnHandler.isValid() && apiReturnHandler.getCode() === 'DOWN_FOR_MAINTENANCE' ) {\n\t\t\t\t\t\tGlobal.sendAnalyticsEvent( 'service-caller', 'error:down-for-maintenance', 'error:down-for-maintenance: Code: ' + apiReturnHandler.getCode() + ' Error: ' + apiReturnHandler.getDescription() );\n\n\t\t\t\t\t\t//Before the location.replace because after that point we can't be sure of execution.\n\t\t\t\t\t\tTTPromise.resolve( 'ServiceCaller', message_id );\n\t\t\t\t\t\t//replace instead of assignment to ensure that the DOWN_FOR_MAINTENANCE page does not end up in the back button history.\n\t\t\t\t\t\twindow.location.replace( ServiceCaller.root_url + LocalCacheData.loginData.base_url + 'html5/DownForMaintenance.php?exception=DOWN_FOR_MAINTENANCE' );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if ( apiReturnHandler.getCode() === 'REAUTHENTICATE' ) {\n\t\t\t\t\t\tlet session_data = apiReturnHandler.getResult();\n\t\t\t\t\t\tGlobal.showAuthenticationModal( LocalCacheData.current_open_primary_controller.viewId, session_data.session_type, session_data.mfa, true, ( result ) => {\n\t\t\t\t\t\t\tDebug.Text( 'User Reauthenticated: ' + result, 'ServiceCaller.js', 'ServiceCaller', 'call', 10 );\n\t\t\t\t\t\t\tGlobal.hideAuthenticationModal();\n\n\t\t\t\t\t\t\t//After authentication is complete, reattempt the API call automatically so that the user does not need to click \"Save\" or repeat the action.\n\t\t\t\t\t\t\t$this.repeatAPICall( className, function_name, apiArgs, responseObject )\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tTTPromise.resolve( 'ServiceCaller', message_id );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Debug.Text('API returned result: '+ message_id, 'ServiceCaller.js', 'ServiceCaller', null, 10);\n\n\t\t\t\t\t\t//only cache data when api return is successful and can be trusted (ie not logged out or session expired.)\n\t\t\t\t\t\tif ( $this.isCachableFunction( function_name ) === true ) {\n\t\t\t\t\t\t\tLocalCacheData.result_cache[cache_key] = result;\n\t\t\t\t\t\t\tTTPromise.resolve( 'ServiceCaller', cache_key );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//Error: Function expected in /interface/html5/services/ServiceCaller.js?v=9.0.0-20150822-090205 line 269\n\t\t\t\t\t\tif ( responseObject.get( 'onResult' ) && typeof ( responseObject.get( 'onResult' ) ) == 'function' ) {\n\t\t\t\t\t\t\tresponseObject.get( 'onResult' )( apiReturnHandler );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tTTPromise.resolve( 'ServiceCaller', message_id );\n\t\t\t\t},\n\n\t\t\t\terror: function( jqXHR, textStatus, errorThrown ) {\n\t\t\t\t\tTTPromise.reject( 'ServiceCaller', message_id );\n\t\t\t\t\tif ( className !== 'APIProgressBar' && function_name !== 'Login' && function_name !== 'getPreLoginData' && function_name !== 'listenForMultiFactorAuthentication' ) {\n\t\t\t\t\t\tProgressBar.removeProgressBar( message_id );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this.isCachableFunction( function_name ) === true && LocalCacheData.result_cache[cache_key] && LocalCacheData.result_cache[cache_key].pending ) {\n\t\t\t\t\t\t//Issue #3185 - getOptions() calls were not rejecting promises when an error occurred.\n\t\t\t\t\t\t//Such as when the factory did not have unique_columns in _getFactoryOptions.\n\t\t\t\t\t\tdelete LocalCacheData.result_cache[cache_key];\n\t\t\t\t\t\tTTPromise.reject( 'ServiceCaller', cache_key );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ServiceCaller.cancel_all_error ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tDebug.Text( 'AJAX Request Error: ' + errorThrown + ' Message: ' + textStatus + ' HTTP Code: ' + jqXHR.status, 'ServiceCaller.js', 'ServiceCaller', 'call', 10 );\n\t\t\t\t\tif ( jqXHR.responseText && jqXHR.responseText.indexOf( 'User not authenticated' ) >= 0 ) {\n\t\t\t\t\t\tServiceCaller.cancel_all_error = true;\n\n\t\t\t\t\t\tLocalCacheData.login_error_string = ServiceCaller_$.i18n._( 'Session timed out, please login again.' );\n\n\t\t\t\t\t\tGlobal.clearSessionCookie();\n\t\t\t\t\t\t//$.cookie( 'SessionID', null, {expires: 30, path: LocalCacheData.cookie_path} );\n\t\t\t\t\t\tGlobal.setURLToBrowser( Global.getBaseURL() + '#!m=' + 'Login' );\n\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( jqXHR.responseText && ServiceCaller_$.type( jqXHR.responseText ) === 'string' ) {\n\t\t\t\t\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( jqXHR.status === 200 && !jqXHR.responseText ) {\n\t\t\t\t\t\tapiReturnHandler = new APIReturnHandler();\n\t\t\t\t\t\tapiReturnHandler.set( 'result_data', true );\n\t\t\t\t\t\tapiReturnHandler.set( 'delegate', responseObject.get( 'delegate' ) );\n\t\t\t\t\t\tapiReturnHandler.set( 'function_name', function_name );\n\t\t\t\t\t\tapiReturnHandler.set( 'args', apiArgs );\n\n\t\t\t\t\t\tif ( responseObject.get( 'onResult' ) ) {\n\t\t\t\t\t\t\tresponseObject.get( 'onResult' )( apiReturnHandler );\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn apiReturnHandler;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( jqXHR.status === 0 || ( jqXHR.status >= 400 && jqXHR.status <= 599 ) ) {\n\t\t\t\t\t\t\t//Status=0 (No response from server at all), 4xx/5xx is critical server failure.\n\t\t\t\t\t\t\t//Server can't respond properly due to 4xx/5xx error code, so display a message to the user. Can't redirect to down_for_maintenance page as that could be a 404 as well.\n\t\t\t\t\t\t\tTAlertManager.showNetworkErrorAlert( jqXHR, textStatus, errorThrown );\n\t\t\t\t\t\t\tProgressBar.cancelProgressBar();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( responseObject.get( 'onError' ) && typeof ( responseObject.get( 'onError' ) ) == 'function' ) {\n\t\t\t\t\t\t\tresponseObject.get( 'onError' )( apiReturnHandler );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\treturn apiReturnHandler;\n\t}\n}\n\nServiceCaller.getAPIURL = function( rest_url ) {\n\treturn ServiceCaller.base_url + ServiceCaller.base_api_url + '?' + rest_url;\n};\n\nServiceCaller.getURLByObjectType = function( object_type ) {\n\tvar append_csrf = false;\n\tvar append_cache_buster = false;\n\n\tvar retval = null;\n\n\tvar base_url = ServiceCaller.base_url + 'interface/send_file.php?api=1';\n\n\tswitch ( object_type.toLowerCase() ) {\n\t\tcase 'upload':\n\t\t\tretval = ServiceCaller.base_url + 'interface/upload_file.php'\n\t\t\tappend_csrf = false;\n\t\t\tbreak;\n\t\tcase 'import_csv_example':\n\t\t\tretval = ServiceCaller.base_url + 'interface/html5/views/wizard/import_csv/'\n\t\t\tappend_csrf = false;\n\t\t\tbreak;\n\t\tcase 'file_download':\n\t\t\tretval = base_url; //Must allow for appending '&object_type=...' on the end.\n\t\t\tappend_csrf = true;\n\t\t\tbreak;\n\t\tcase 'company_logo':\n\t\t\tretval = base_url + '&object_type=company_logo';\n\t\t\tappend_csrf = true;\n\t\t\tappend_cache_buster = true;\n\t\t\tbreak;\n\t\tcase 'invoice_config':\n\t\t\tretval = base_url + '&object_type=invoice_config';\n\t\t\tappend_csrf = true;\n\t\t\tbreak;\n\t\tcase 'user_photo':\n\t\t\tretval = base_url + '&object_type=user_photo';\n\t\t\tappend_csrf = true;\n\t\t\tbreak;\n\n\t\tcase 'primary_company_logo':\n\t\t\tretval = base_url + '&object_type=primary_company_logo';\n\t\t\tbreak;\n\t\tcase 'smcopyright':\n\t\t\tretval = base_url + '&object_type=smcopyright';\n\t\t\tbreak;\n\t\tcase 'copyright':\n\t\t\tretval = base_url + '&object_type=copyright';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t//Append CSRF-Token.\n\tif ( append_csrf == true ) {\n\t\tretval += '&X-CSRF-Token=' + getCookie( 'CSRF-Token' );\n\t}\n\n\tif ( append_cache_buster == true ) {\n\t\tretval += '&t=' + new Date().getTime();\n\t}\n\n\treturn retval;\n};\n\n//Abort in-flight AJAX calls on logout.\nServiceCaller.abortAll = function() {\n\tServiceCaller_$.each( ServiceCaller_$.xhrPool, function( index, ajax_obj ) {\n\t\tif ( typeof ajax_obj == 'object' && ajax_obj.jqXHR && typeof ajax_obj.jqXHR == 'object' && typeof ajax_obj.jqXHR.abort === 'function' ) {\n\t\t\tif ( ajax_obj.url && ajax_obj.url.indexOf( 'Method=Logout' ) == -1 ) { //Don't abort the Logout call.\n\t\t\t\tDebug.Text( ' Aborting API call: ' + ajax_obj.url, 'ServiceCaller.js', 'ServiceCaller', 'abortAll', 10 );\n\t\t\t\tajax_obj.jqXHR.abort();\n\t\t\t} else {\n\t\t\t\tDebug.Text( 'Not aborting Logout API call...', 'ServiceCaller.js', 'ServiceCaller', 'abortAll', 10 );\n\t\t\t}\n\t\t}\n\t} );\n};\n\nServiceCaller.base_url = null;\nServiceCaller.base_api_url = null;\nServiceCaller.root_url = null;\nServiceCaller.cancel_all_error = false;\nServiceCaller.extra_url = false;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUE4Qjs7QUFFdkIsNkJBQTZCLGdCQUFJO0FBQ3hDLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBO0FBQ0E7Ozs7Ozs7QUNaQTs7QUFFQTs7QUFFQTtBQUM4Qjs7QUFFdkIsK0JBQStCLGdCQUFJOztBQUUxQywyQkFBMkI7QUFDM0IsRUFBRSxpQkFBQztBQUNIO0FBQ0E7QUFDQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLElBQUksVUFBVSxDQUFDO0FBQ2Y7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O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JyAmJiB0eXBlb2YgYWpheF9vYmouanFYSFIuYWJvcnQgPT09ICdmdW5jdGlvbicgKSB7XG5cdFx0XHRpZiAoIGFqYXhfb2JqLnVybCAmJiBhamF4X29iai51cmwuaW5kZXhPZiggJ01ldGhvZD1Mb2dvdXQnICkgPT0gLTEgKSB7IC8vRG9uJ3QgYWJvcnQgdGhlIExvZ291dCBjYWxsLlxuXHRcdFx0XHREZWJ1Zy5UZXh0KCAnIEFib3J0aW5nIEFQSSBjYWxsOiAnICsgYWpheF9vYmoudXJsLCAnU2VydmljZUNhbGxlci5qcycsICdTZXJ2aWNlQ2FsbGVyJywgJ2Fib3J0QWxsJywgMTAgKTtcblx0XHRcdFx0YWpheF9vYmouanFYSFIuYWJvcnQoKTtcblx0XHRcdH0gZWxzZSB7XG5cdFx0XHRcdERlYnVnLlRleHQoICdOb3QgYWJvcnRpbmcgTG9nb3V0IEFQSSBjYWxsLi4uJywgJ1NlcnZpY2VDYWxsZXIuanMnLCAnU2VydmljZUNhbGxlcicsICdhYm9ydEFsbCcsIDEwICk7XG5cdFx0XHR9XG5cdFx0fVxuXHR9ICk7XG59O1xuXG5TZXJ2aWNlQ2FsbGVyLmJhc2VfdXJsID0gbnVsbDtcblNlcnZpY2VDYWxsZXIuYmFzZV9hcGlfdXJsID0gbnVsbDtcblNlcnZpY2VDYWxsZXIucm9vdF91cmwgPSBudWxsO1xuU2VydmljZUNhbGxlci5jYW5jZWxfYWxsX2Vycm9yID0gZmFsc2U7XG5TZXJ2aWNlQ2FsbGVyLmV4dHJhX3VybCA9IGZhbHNlO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///12\n")},7967:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"Z\": () => (/* binding */ services_TTEventBus)\n});\n\n;// CONCATENATED MODULE: ./node_modules/mitt/dist/mitt.mjs\n/* harmony default export */ function mitt(n){return{all:n=n||new Map,on:function(t,e){var i=n.get(t);i?i.push(e):n.set(t,[e])},off:function(t,e){var i=n.get(t);i&&(e?i.splice(i.indexOf(e)>>>0,1):n.set(t,[]))},emit:function(t,e){var i=n.get(t);i&&i.slice().map(function(n){n(e)}),(i=n.get(\"*\"))&&i.slice().map(function(n){n(t,e)})}}}\n//# sourceMappingURL=mitt.mjs.map\n\n;// CONCATENATED MODULE: ./interface/html5/services/TTEventBus.js\n\nconst EventBus = mitt();\n\n//Issue #3049 - Moved class static fields outside of main TTEventBus class as Safari v14.1 and older do not support class field declarations.\nwindow.TTEventBusStatics = { AUTO_CLEAR_ON_EXIT: true, mitt: EventBus, _events_by_listener_scope: {} }; //Constants and external libraries\n//_events_by_listener_scope - Internal data element, only to be accessed/changed via functions in this class. Static as its shared across scope_id's.\n\n/**\n * How to understand the ID's used in this class.\n * this.scope_id:\tis tied to the owner of the instance of TTEventBus.\n * \t\t\t\t\tso that they can be removed when the owner of that scope is unloaded/unmounted.\n * mitt_event_id:\tis passed to the mitt event library. It uses the event scope id rather than stored instance scope_id,\n * \t\t\t\t\tbecause listeners within a view/component might listen to different scope_id's depending on event.\n * unique_listener_id: is only needed for debugging currently, to be able to differentiate between two different listeners\n * \t\t\t\t\tlistening to the same event on the same scope, but using different event handler functions.\n *\n *\n */\nclass TTEventBus {\n\t// Standard mitt calls we want to expose for backwards compatibility to our old code.\n\t// static on = TTEventBusStatics.mitt.on;\n\t// static off = TTEventBusStatics.mitt.off;\n\n\tconstructor( options = {} ) {\n\t\t// TTEventBus will happily works for both Views and Vue Components using a single id variable, but tracking them both might be more useful in the future.\n\t\tthis._options = options; // Unlikely to use directly, but will store here for debugging and future options.\n\t\tthis.scope_id = null; //scope_id of the listening view or component. Not neccessarily the scope of an event. When this scope unloads, we want to clear listener events related to that scope.\n\t\tthis._setInstanceScopeId( this.generateScopeIdFromOptions( options ) );\n\t\tDebug.Text( 'constructor called ('+ this.scope_id +').', 'TTEventBus.js', 'TTEventBus', 'constructor', 11 );\n\t}\n\n\t/**\n\t * Scope is created depending on availability of view id and component id. In most cases, the standard is to either use the view_id or component_id, to use both would overcomplicate storage of the components id's in the views..\n\t * @param options\n\t * @returns {string|boolean}\n\t */\n\tgenerateScopeIdFromOptions( options ) {\n\t\t// E.g. Schedule.vue-schedule-control-bar\n\t\t// var scope_string = '';\n\t\t// if( options?.view_id ) {\n\t\t// \tscope_string += options.view_id;\n\t\t// }\n\t\t// if( options?.component_id ) {\n\t\t// \tif( scope_string !== '' ) { scope_string += '.' }\n\t\t// \tscope_string += options.component_id;\n\t\t// }\n\t\t//\n\t\t// return scope_string;\n\t\tif ( options && options.view_id && options.component_id ) {\n\t\t\tDebug.Warn( 'Are you sure you want to set both view and component id? This complicates things.', 'TTEventBus.js', 'TTEventBus', 'generateScopeIdFromOptions', 2 );\n\t\t\treturn options.view_id + '.' + options.component_id;\n\t\t} else if ( options && options.view_id ) {\n\t\t\treturn options.view_id;\n\t\t} else if ( options && options.component_id ) {\n\t\t\treturn options.component_id;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Don't call this directly, as we need to generate the scope_id via generateScopeFromOptions first.\n\t * @param scope_id\n\t * @private\n\t */\n\t_setInstanceScopeId( scope_id ) {\n\t\treturn this.scope_id = scope_id;\n\t}\n\n\tgetInstanceScopeId() {\n\t\treturn this.scope_id;\n\t}\n\n\tgenerateMittId( scope_id, event_id ) {\n\t\t// E.g. Schedule.vue-schedule-control-bar.scheduleModeOnChange\n\t\treturn scope_id + '.' + event_id;\n\t}\n\n\t/**\n\t * Event that should only last for that view/vue component and be removed when scope is destroyed/unloaded.\n\t * @param event_scope The scope_id related to the event.\n\t * @param event_id id of the event, should be unique within the provided scope.\n\t * @param event_handler Function to call when event is triggered.\n\t * @param auto_clear_on_exit Specifies if this event should not be auto cleared when the vue/component is unloaded. Set using TTEventBusStatics.AUTO_CLEAR_ON_EXIT\n\t */\n\ton( event_scope, event_id, event_handler, auto_clear_on_exit ) {\n\t\tTTEventBusStatics._events_by_listener_scope[ this.scope_id ] = TTEventBusStatics._events_by_listener_scope[ this.scope_id ] || [];\n\n\t\t// If we want unique ID's then use TTUUID.generateUUID(), but we want unique to a scope, so that duplicates can be prevented.\n\t\tvar mitt_event_id = this.generateMittId( event_scope, event_id);\n\t\tvar unique_listener_id = this.scope_id + ':' + mitt_event_id + ':' + TTUUID.generateUUID();\n\n\t\tTTEventBusStatics._events_by_listener_scope[ this.scope_id ].push( {\n\t\t\tunique_listener_id: unique_listener_id,\n\t\t\tmitt_event_id: mitt_event_id,\n\t\t\tevent_scope: event_scope,\n\t\t\tevent_id: event_id,\n\t\t\tevent_handler: event_handler,\n\t\t\tauto_clear_on_exit: auto_clear_on_exit\n\t\t} );\n\t\tTTEventBusStatics.mitt.on( mitt_event_id, event_handler );\n\t\tDebug.Text( this.scope_id + ': Listener created for ('+ unique_listener_id +').', 'TTEventBus.js', 'TTEventBus', 'on', 11 );\n\n\t\treturn unique_listener_id;\n\t}\n\n\t/**\n\t * Trigger EventBus event, but converts the scope_id and event_id into the mitt event id that the event is registered with.\n\t * @param event_scope The scope_id related to the event.\n\t * @param event_id id of the event, should be unique within the provided scope.\n\t * @param event_data Object containing event data as parameters.\n\t */\n\temit( event_scope, event_id, event_data ) {\n\t\tvar mitt_event_id = this.generateMittId( event_scope, event_id);\n\t\tDebug.Text( this.scope_id + ': Event emitted for ('+ mitt_event_id +').', 'TTEventBus.js', 'TTEventBus', 'emit', 11 );\n\n\t\treturn TTEventBusStatics.mitt.emit( mitt_event_id, event_data );\n\t}\n\n\t/**\n\t * TODO: UNFINISHED.\n\t * TODO: Improve this by adding ability to remove by scope and name, or scope, name and callback, or by unique ID.\n\t * Warning: This will remove all events that match the scope_id and event_id, even if there are multiple.\n\t * @param scope_id the scope of the event that needs to be switched off.\n\t * @param event_id the event_id of the event tyhat needs to be switched off.\n\t * @returns {void|number}\n\t */\n\toff( scope_id, event_id ) {\n\t\tvar scope_array = TTEventBusStatics._events_by_listener_scope[ scope_id ];\n\t\tif( scope_array === undefined ) {\n\t\t\t// scope_id not found.\n\t\t\tDebug.Error( 'Error: invalid params passed. scope_id not found.', 'TTEventBus.js', 'EventBus', 'off', 1 );\n\t\t\treturn -1;\n\t\t}\n\t\tvar removeIndex = scope_array.map( item => item.event_id ).indexOf( event_id ); // TODO: Will only match the FIRST found, problem for multiple listeners like in Schedule.scheduleModeOnChange\n\t\tif( removeIndex >= 0 ) {\n\t\t\tvar stored_event = scope_array[ removeIndex ];\n\t\t\tscope_array.splice(removeIndex, 1);\n\t\t\tDebug.Text( this.scope_id + ': Listener removed for ('+ stored_event.mitt_event_id +').', 'TTEventBus.js', 'EventBus', 'off', 11 );\n\n\t\t\treturn TTEventBusStatics.mitt.off( stored_event.mitt_event_id, stored_event.event_handler );\n\t\t} else {\n\t\t\t// event_id not found in array.\n\t\t\tDebug.Error( 'Error: invalid params passed. event_id not found.', 'TTEventBus.js', 'EventBus', 'off', 1 );\n\t\t\treturn -1;\n\t\t}\n\t}\n\n\t/**\n\t * Used to trigger allOff() when unloading a view/component, using stored scope_id.\n\t * @returns {number|boolean}\n\t */\n\tautoClear() {\n\t\tDebug.Text( 'Auto off triggered for ('+ this.scope_id +').', 'TTEventBus.js', 'EventBus', 'autoClear', 11 );\n\t\treturn this.allOff( this.scope_id );\n\t}\n\t/**\n\t * This removes all events registered on the given scope. This will only apply to events that have the AUTO_CLEAR_ON_EXIT flag.\n\t * @param scope_id\n\t */\n\tallOff( scope_id ) {\n\t\tvar scope_array = TTEventBusStatics._events_by_listener_scope[ scope_id ];\n\t\tif( scope_array === undefined ) {\n\t\t\t// scope_id not found.\n\t\t\tDebug.Text( 'Scope not found. But could be normal if this is a global function triggered on a scope with no events.', 'TTEventBus.js', 'EventBus', 'allOff', 2 );\n\n\t\t\treturn -1;\n\t\t}\n\n\t\t//Loop in reverse to easily remove array values.\n\t\tfor ( let i = scope_array.length - 1; i >= 0; i-- ) {\n\t\t\tif ( scope_array[i].auto_clear_on_exit ) {\n\t\t\t\t// Remove event\n\t\t\t\tTTEventBusStatics.mitt.off( scope_array[i].mitt_event_id, scope_array[i].event_handler );\n\t\t\t\tDebug.Text( 'Auto removed ' + scope_array[i].mitt_event_id + ' event on scope close.', 'TTEventBus.js', 'EventBus', 'allOff', 2 );\n\t\t\t\tscope_array.splice( i, 1 );\n\t\t\t} else {\n\t\t\t\tDebug.Text( 'Event does not have AUTO_CLEAR_ON_EXIT. Skipping ' + scope_array[i].mitt_event_id, 'TTEventBus.js', 'EventBus', 'allOff', 2 );\n\t\t\t}\n\t\t}\n\n\t\tif ( !TTEventBusStatics._events_by_listener_scope[ scope_id ] || TTEventBusStatics._events_by_listener_scope[ scope_id ].length === 0 ) {\n\t\t\t//Remove empty scope array.\n\t\t\tdelete TTEventBusStatics._events_by_listener_scope[ scope_id ];\n\t\t}\n\n\t\treturn true;\n\t}\n}\n\n/* harmony default export */ const services_TTEventBus = (TTEventBus);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzk2Ny5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUEsNkJBQWUsY0FBUyxHQUFHLE9BQU8sa0NBQWtDLGVBQWUseUJBQXlCLG1CQUFtQixlQUFlLGdEQUFnRCxvQkFBb0IsZUFBZSw2QkFBNkIsS0FBSyw0Q0FBNEMsT0FBTztBQUN0VDs7O0FDRHdCO0FBQ3hCLGlCQUFpQixJQUFJOztBQUVyQjtBQUNBLDZCQUE2QiwyRUFBMkU7QUFDeEc7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLDJCQUEyQjtBQUMzQjtBQUNBLDJCQUEyQjtBQUMzQix3QkFBd0I7QUFDeEI7QUFDQTtBQUNBOztBQUVBO0FBQ0E7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RpZiAoICFUVEV2ZW50QnVzU3RhdGljcy5fZXZlbnRzX2J5X2xpc3RlbmVyX3Njb3BlWyBzY29wZV9pZCBdIHx8IFRURXZlbnRCdXNTdGF0aWNzLl9ldmVudHNfYnlfbGlzdGVuZXJfc2NvcGVbIHNjb3BlX2lkIF0ubGVuZ3RoID09PSAwICkge1xuXHRcdFx0Ly9SZW1vdmUgZW1wdHkgc2NvcGUgYXJyYXkuXG5cdFx0XHRkZWxldGUgVFRFdmVudEJ1c1N0YXRpY3MuX2V2ZW50c19ieV9saXN0ZW5lcl9zY29wZVsgc2NvcGVfaWQgXTtcblx0XHR9XG5cblx0XHRyZXR1cm4gdHJ1ZTtcblx0fVxufVxuXG5leHBvcnQgZGVmYXVsdCBUVEV2ZW50QnVzO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///7967\n")},4966:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5166);\n/* harmony import */ var _components_main_ui_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2237);\n/* harmony import */ var primevue_config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5475);\n/*\n * This file houses any common utils that will be used by Vue.\n * Similar to Global.js but class based, and Vue specific.\n */\n\n\n\n\n\n\nclass TTVueUtils {\n\tconstructor() {\n\t\tthis._dynamic_vue_components = {};\n\t}\n\n\tmountComponent( mount_id, mount_component, root_props ) {\n\t\tif( mount_id === undefined ) {\n\t\t\tDebug.Error( 'Error: Invalid parameters passed to function.', 'TTVueUtils.js', 'TTVueUtils', 'mountComponent', 1 );\n\t\t\treturn false;\n\t\t}\n\n\t\tif( document.getElementById( mount_id ) === null ) {\n\t\t\tDebug.Error( 'Error: mount_id \"'+ mount_id + '\" does not exist in the DOM.', 'TTVueUtils.js', 'TTVueUtils', 'mountComponent', 1 );\n\t\t\treturn false;\n\t\t}\n\n\t\tif( this._dynamic_vue_components[ mount_id ] !== undefined ) {\n\t\t\tDebug.Error( 'Error: component ('+ mount_id +') already exists and mounted.', 'TTVueUtils.js', 'TTVueUtils', 'mountComponent', 1 );\n\t\t\treturn false;\n\t\t}\n\n\t\troot_props = root_props || {};\n\t\troot_props.component_id = root_props.component_id || mount_id;\n\t\tlet mount_reference = '#' + mount_id;\n\t\tlet vue_app_instance = (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createApp */ .ri)( mount_component, root_props ); // rootProps is useful to pass in data without the need for EventBus.\n\n\t\tvue_app_instance.use( primevue_config__WEBPACK_IMPORTED_MODULE_2__/* [\"default\"] */ .Z, { ripple: true, inputStyle: 'filled' }); // From: AppConfig.vue this.$primevue.config.inputStyle value is filled/outlined as we dont use AppConfig in TT.\n\t\tvue_app_instance.use( _components_main_ui_router__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"] */ .Z ); // #VueContextMenu# FIXES: Failed to resolve component: router-link when TTOverlayMenuButton is opened. Because each component is a separate Vue instance, and they did not globally 'use' the Router, only in main ui.\n\t\tlet vue_component_instance = vue_app_instance.mount( mount_reference ); // e.g. '#tt-edit-view-test'\n\n\t\tthis._dynamic_vue_components[ mount_id ] = {\n\t\t\tmount_id: mount_id,\n\t\t\t_vue_app_instance: vue_app_instance, // Be very careful using these from outside Vue. Could make for messy code!\n\t\t\t_vue_component_instance: vue_component_instance // Be very careful using these from outside Vue. Could make for messy code!\n\t\t};\n\n\t\treturn this._dynamic_vue_components[ mount_id ];\n\t}\n\tunmountComponent ( mount_id ) {\n\t\tif( this._dynamic_vue_components[ mount_id ] && this._dynamic_vue_components[ mount_id ]._vue_component_instance ) {\n\t\t\tthis._dynamic_vue_components[ mount_id ]._vue_app_instance.unmount();\n\t\t\tdelete this._dynamic_vue_components[ mount_id ];\n\t\t\tDebug.Text( 'Component successfully unmounted ('+ mount_id +').', 'TTVueUtils.js', 'TTVueUtils', 'unmountComponent', 2 );\n\t\t\treturn true;\n\t\t} else {\n\t\t\tDebug.Text( 'Unable to unmount component. Component not found ('+ mount_id +'). Maybe already removed?', 'TTVueUtils.js', 'TTVueUtils', 'unmountComponent', 2 );\n\t\t\treturn false;\n\t\t}\n\t}\n\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (new TTVueUtils()); // Export this way to share one instance of the class across the app.//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk2Ni5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTs7O0FBR2dDO0FBQ3lCO0FBQ2xCOztBQUV2QztBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLHlCQUF5Qix3REFBUyxpQ0FBaUM7O0FBRW5FLHdCQUF3QixnRUFBUSxJQUFJLG9DQUFvQyxHQUFHO0FBQzNFLHdCQUF3QiwyRUFBYyxJQUFJO0FBQzFDLDBFQUEwRTs7QUFFMUU7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBLGlFQUFlLGdCQUFnQiIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL2ludGVyZmFjZS9odG1sNS9zZXJ2aWNlcy9UVFZ1ZVV0aWxzLmpzPzgyNGQiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIFRoaXMgZmlsZSBob3VzZXMgYW55IGN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Z1ZV9jb21wb25lbnRfaW5zdGFuY2UgKSB7XG5cdFx0XHR0aGlzLl9keW5hbWljX3Z1ZV9jb21wb25lbnRzWyBtb3VudF9pZCBdLl92dWVfYXBwX2luc3RhbmNlLnVubW91bnQoKTtcblx0XHRcdGRlbGV0ZSB0aGlzLl9keW5hbWljX3Z1ZV9jb21wb25lbnRzWyBtb3VudF9pZCBdO1xuXHRcdFx0RGVidWcuVGV4dCggJ0NvbXBvbmVudCBzdWNjZXNzZnVsbHkgdW5tb3VudGVkICgnKyBtb3VudF9pZCArJykuJywgJ1RUVnVlVXRpbHMuanMnLCAnVFRWdWVVdGlscycsICd1bm1vdW50Q29tcG9uZW50JywgMiApO1xuXHRcdFx0cmV0dXJuIHRydWU7XG5cdFx0fSBlbHNlIHtcblx0XHRcdERlYnVnLlRleHQoICdVbmFibGUgdG8gdW5tb3VudCBjb21wb25lbnQuIENvbXBvbmVudCBub3QgZm91bmQgKCcrIG1vdW50X2lkICsnKS4gTWF5YmUgYWxyZWFkeSByZW1vdmVkPycsICdUVFZ1ZVV0aWxzLmpzJywgJ1RUVnVlVXRpbHMnLCAndW5tb3VudENvbXBvbmVudCcsIDIgKTtcblx0XHRcdHJldHVybiBmYWxzZTtcblx0XHR9XG5cdH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBuZXcgVFRWdWVVdGlscygpIC8vIEV4cG9ydCB0aGlzIHdheSB0byBzaGFyZSBvbmUgaW5zdGFuY2Ugb2YgdGhlIGNsYXNzIGFjcm9zcyB0aGUgYXBwLiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4966\n")},7526:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"y\": () => (/* binding */ TTAPI)\n/* harmony export */ });\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12);\n\n\nclass TimeTrexClientAPI extends _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_0__/* .ServiceCaller */ .n {\n\tconstructor( class_name, key_name ) {\n\t\tsuper();\n\n\t\tthis.className = class_name;\n\n\t\tif ( !key_name ) {\n\t\t\tkey_name = class_name.replace( 'API', '' );\n\t\t}\n\t\tthis.key_name = key_name;\n\n\t\treturn this.enableNoSuchMethod( this );\n\t}\n\n\tenableNoSuchMethod( obj ) {\n\t\treturn new Proxy( obj, {\n\t\t\tget( target, property_key ) {\n\t\t\t\tif ( property_key in target ) {\n\t\t\t\t\treturn target[property_key];\n\t\t\t\t} else if ( typeof target.__noSuchMethod__ == 'function' ) {\n\t\t\t\t\treturn function( ...args ) {\n\t\t\t\t\t\treturn target.__noSuchMethod__.call( target, property_key, args );\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n}\n\nTimeTrexClientAPI.prototype.__noSuchMethod__ = function( method_name, args ) {\n\t//Debug.Text('Magic Method: '+ method_name + ' Class: '+ this.service_caller.className +' Args: '+ args, 'TimeTrexClientAPI.js', 'TimeTrexClientAPI', '__noSuchMethod__', 11);\n\treturn this.argumentsHandler( this.className, method_name, args );\n};\n\nconst tt_api_target = {};\nconst tt_api_class_handler = {\n\tget( target, class_name ) {\n\t\t//Debug.Text('Proxy Handler: Class: ' + class_name, 'TimeTrexClientAPI.js', 'TimeTrexClientAPI', 'get', 11);\n\t\treturn new TimeTrexClientAPI( class_name );\n\t},\n};\n\nconst TTAPI = new Proxy( tt_api_target, tt_api_class_handler );\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUyNi5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQXlEOztBQUV6RCxnQ0FBZ0MsMkVBQWE7QUFDN0M7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7Q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Fzc19uYW1lICk7XG5cdH0sXG59O1xuXG5leHBvcnQgY29uc3QgVFRBUEkgPSBuZXcgUHJveHkoIHR0X2FwaV90YXJnZXQsIHR0X2FwaV9jbGFzc19oYW5kbGVyICk7XG5cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7526\n")},6739:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TTBackboneView\": () => (/* binding */ TTBackboneView)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/**\n * TTBackboneView is the interface between the TimeTrex BaseViewController and any other classes that need\n * to extend from Backbone.View. It allows common logic such as the hierarchical options and required_files\n * to work as expected.\n *\n * When adding functions to this class, make sure they will be compatible with all files that extend from this.\n * Do a search to see these, they include the main UI views, as well as the portal etc.\n *\n * Usage note: When extending this view in a child view instead of from Backbone.View, make sure that your initialize function in the child view\n * has the super.initialize( options ); line at the start (before the required_files or any other non-backbone values from the options are used).\n */\n\nclass TTBackboneView extends Backbone.View {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\t//Convert options object to this object properties as early as possible.\n\t\tif ( options && typeof options == 'object' ) {\n\t\t\tfor ( const property in options ) {\n\t\t\t\tif ( options.hasOwnProperty( property ) ) { // #2808 See Safari bug https://bugs.webkit.org/show_bug.cgi?id=212449 This hasOwnProperty check is essential to prevent problems due to a bug in Safari with an inherited 'render' on the options Object interfering with the Views render() function.\n\t\t\t\t\tthis[property] = options[property];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjczOS5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUFBO0FBQ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aXRlZCAncmVuZGVyJyBvbiB0aGUgb3B0aW9ucyBPYmplY3QgaW50ZXJmZXJpbmcgd2l0aCB0aGUgVmlld3MgcmVuZGVyKCkgZnVuY3Rpb24uXG5cdFx0XHRcdFx0dGhpc1twcm9wZXJ0eV0gPSBvcHRpb25zW3Byb3BlcnR5XTtcblx0XHRcdFx0fVxuXHRcdFx0fVxuXHRcdH1cblx0fVxufSJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6739\n")},5196:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HeaderViewController\": () => (/* binding */ HeaderViewController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* harmony import */ var _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);\n/* provided dependency */ var _ = __webpack_require__(9050);\n\n\n\nclass HeaderViewController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tvar tpl = Global.loadWidget( 'views/quick_punch/header/HeaderView.html' );\n\t\tif ( tpl ) { //JS Exception: Uncaught TypeError: Cannot read property 'replace' of undefined\n\t\t\tthis.tpl = _.template( tpl );\n\t\t}\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tvar url = _services_ServiceCaller__WEBPACK_IMPORTED_MODULE_1__/* .ServiceCaller.getURLByObjectType */ .n.getURLByObjectType( 'primary_company_logo' );\n\t\tif ( this.tpl ) {\n\t\t\tthis.setElement( this.tpl( { company_logo: url } ) );\n\t\t}\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset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XHRcdGlmICggdHBsICkgeyAvL0pTIEV4Y2VwdGlvbjogVW5jYXVnaHQgVHlwZUVycm9yOiBDYW5ub3QgcmVhZCBwcm9wZXJ0eSAncmVwbGFjZScgb2YgdW5kZWZpbmVkXG5cdFx0XHR0aGlzLnRwbCA9IF8udGVtcGxhdGUoIHRwbCApO1xuXHRcdH1cblx0XHR0aGlzLnJlbmRlcigpO1xuXHR9XG5cblx0cmVuZGVyKCkge1xuXHRcdHZhciB1cmwgPSBTZXJ2aWNlQ2FsbGVyLmdldFVSTEJ5T2JqZWN0VHlwZSggJ3ByaW1hcnlfY29tcGFueV9sb2dvJyApO1xuXHRcdGlmICggdGhpcy50cGwgKSB7XG5cdFx0XHR0aGlzLnNldEVsZW1lbnQoIHRoaXMudHBsKCB7IGNvbXBhbnlfbG9nbzogdXJsIH0gKSApO1xuXHRcdH1cblx0fVxuXG59XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5196\n")},1430:(g,t,I)=>{var n={"./BaseViewController":[121,9,"BaseViewController"],"./BaseViewController.js":[121,9,"BaseViewController"],"./BaseWindowController":[1807,9,"BaseWindowController"],"./BaseWindowController.js":[1807,9,"BaseWindowController"],"./TTBackboneView":[6739,9],"./TTBackboneView.js":[6739,9],"./attendance/accrual/AccrualViewController":[1629,9,"attendance-accrual-AccrualViewController"],"./attendance/accrual/AccrualViewController.js":[1629,9,"attendance-accrual-AccrualViewController"],"./attendance/accrual_balance/AccrualBalanceViewController":[8726,9,"attendance-accrual_balance-AccrualBalanceViewController"],"./attendance/accrual_balance/AccrualBalanceViewController.js":[8726,9,"attendance-accrual_balance-AccrualBalanceViewController"],"./attendance/exceptions/ExceptionViewController":[961,9,"attendance-exceptions-ExceptionViewController"],"./attendance/exceptions/ExceptionViewController.js":[961,9,"attendance-exceptions-ExceptionViewController"],"./attendance/in_out/InOutViewController":[1690,9,"attendance-in_out-InOutViewController"],"./attendance/in_out/InOutViewController.js":[1690,9,"attendance-in_out-InOutViewController"],"./attendance/job/JobGroupViewController":[6470,9,"attendance-job-JobGroupViewController"],"./attendance/job/JobGroupViewController.js":[6470,9,"attendance-job-JobGroupViewController"],"./attendance/job/JobViewController":[1088,9,"attendance-job-JobViewController"],"./attendance/job/JobViewController.js":[1088,9,"attendance-job-JobViewController"],"./attendance/job_item/JobItemGroupViewController":[5677,9,"attendance-job_item-JobItemGroupViewController"],"./attendance/job_item/JobItemGroupViewController.js":[5677,9,"attendance-job_item-JobItemGroupViewController"],"./attendance/job_item/JobItemViewController":[878,9,"attendance-job_item-JobItemViewController"],"./attendance/job_item/JobItemViewController.js":[878,9,"attendance-job_item-JobItemViewController"],"./attendance/job_item_amendment/JobItemAmendmentViewController":[1960,9,"attendance-job_item_amendment-JobItemAmendmentViewController"],"./attendance/job_item_amendment/JobItemAmendmentViewController.js":[1960,9,"attendance-job_item_amendment-JobItemAmendmentViewController"],"./attendance/map/MapViewController":[6638,9,"vendors-node_modules_leaflet_dist_images_marker-icon-2x_png-node_modules_leaflet_dist_images_-78d511","interface_html5_framework_leaflet_leaflet-timetrex_js","attendance-map-MapViewController"],"./attendance/map/MapViewController.js":[6638,9,"vendors-node_modules_leaflet_dist_images_marker-icon-2x_png-node_modules_leaflet_dist_images_-78d511","interface_html5_framework_leaflet_leaflet-timetrex_js","attendance-map-MapViewController"],"./attendance/punch_tag/PunchTagGroupViewController":[828,9,"attendance-punch_tag-PunchTagGroupViewController"],"./attendance/punch_tag/PunchTagGroupViewController.js":[828,9,"attendance-punch_tag-PunchTagGroupViewController"],"./attendance/punch_tag/PunchTagViewController":[6808,9,"attendance-punch_tag-PunchTagViewController"],"./attendance/punch_tag/PunchTagViewController.js":[6808,9,"attendance-punch_tag-PunchTagViewController"],"./attendance/punches/PunchesViewController":[1274,9,"attendance-punches-PunchesViewController"],"./attendance/punches/PunchesViewController.js":[1274,9,"attendance-punches-PunchesViewController"],"./attendance/recurring_schedule_control/RecurringScheduleControlViewController":[869,9,"attendance-recurring_schedule_control-RecurringScheduleControlViewController"],"./attendance/recurring_schedule_control/RecurringScheduleControlViewController.js":[869,9,"attendance-recurring_schedule_control-RecurringScheduleControlViewController"],"./attendance/recurring_schedule_template_control/RecurringScheduleTemplateControlViewController":[7067,9,"attendance-recurring_schedule_template_control-RecurringScheduleTemplateControlViewController"],"./attendance/recurring_schedule_template_control/RecurringScheduleTemplateControlViewController.js":[7067,9,"attendance-recurring_schedule_template_control-RecurringScheduleTemplateControlViewController"],"./attendance/schedule/ScheduleShiftViewController":[2509,9,"attendance-schedule-ScheduleShiftViewController"],"./attendance/schedule/ScheduleShiftViewController.js":[2509,9,"attendance-schedule-ScheduleShiftViewController"],"./attendance/schedule/ScheduleViewController":[6478,9,"vendors-node_modules_primevue_button_button_esm_js-node_modules_primevue_menu_menu_esm_js-nod-e86f5b","interface_html5_components_context_menu_TTContextButton_vue","attendance-schedule-ScheduleViewController"],"./attendance/schedule/ScheduleViewController.js":[6478,9,"vendors-node_modules_primevue_button_button_esm_js-node_modules_primevue_menu_menu_esm_js-nod-e86f5b","interface_html5_components_context_menu_TTContextButton_vue","attendance-schedule-ScheduleViewController"],"./attendance/timesheet/TimeSheetViewController":[2693,9,"vendors-node_modules_primevue_button_button_esm_js-node_modules_primevue_menu_menu_esm_js-nod-e86f5b","interface_html5_components_context_menu_TTContextButton_vue","attendance-timesheet-TimeSheetViewController"],"./attendance/timesheet/TimeSheetViewController.js":[2693,9,"vendors-node_modules_primevue_button_button_esm_js-node_modules_primevue_menu_menu_esm_js-nod-e86f5b","interface_html5_components_context_menu_TTContextButton_vue","attendance-timesheet-TimeSheetViewController"],"./attendance/timesheet/UserDateTotalParentViewController":[1285,9,"attendance-timesheet-UserDateTotalParentViewController"],"./attendance/timesheet/UserDateTotalParentViewController.js":[1285,9,"attendance-timesheet-UserDateTotalParentViewController"],"./attendance/timesheet/UserDateTotalViewController":[827,9,"attendance-timesheet-UserDateTotalViewController"],"./attendance/timesheet/UserDateTotalViewController.js":[827,9,"attendance-timesheet-UserDateTotalViewController"],"./common/AuthorizationHistoryCommon":[5533,9,"common-AuthorizationHistoryCommon"],"./common/AuthorizationHistoryCommon.js":[5533,9,"common-AuthorizationHistoryCommon"],"./common/BaseTreeViewController":[1838,9,"common-BaseTreeViewController"],"./common/BaseTreeViewController.js":[1838,9,"common-BaseTreeViewController"],"./common/EmbeddedMessageCommon":[7664,9,"vendors-node_modules_linkifyjs_string_js","common-EmbeddedMessageCommon"],"./common/EmbeddedMessageCommon.js":[7664,9,"vendors-node_modules_linkifyjs_string_js","common-EmbeddedMessageCommon"],"./common/RequestViewCommonController":[2343,9,"common-RequestViewCommonController"],"./common/RequestViewCommonController.js":[2343,9,"common-RequestViewCommonController"],"./company/branch/BranchViewController":[2424,9,"company-branch-BranchViewController"],"./company/branch/BranchViewController.js":[2424,9,"company-branch-BranchViewController"],"./company/companies/CompaniesViewController":[8653,9,"company-companies-CompaniesViewController"],"./company/companies/CompaniesViewController.js":[8653,9,"company-companies-CompaniesViewController"],"./company/company/CompanyViewController":[4164,9,"company-company-CompanyViewController"],"./company/company/CompanyViewController.js":[4164,9,"company-company-CompanyViewController"],"./company/currency/CurrencyRateViewController":[4607,9,"company-currency-CurrencyRateViewController"],"./company/currency/CurrencyRateViewController.js":[4607,9,"company-currency-CurrencyRateViewController"],"./company/currency/CurrencyViewController":[1297,9,"company-currency-CurrencyViewController"],"./company/currency/CurrencyViewController.js":[1297,9,"company-currency-CurrencyViewController"],"./company/custom_field/CustomFieldViewController":[7945,9,"company-custom_field-CustomFieldViewController"],"./company/custom_field/CustomFieldViewController.js":[7945,9,"company-custom_field-CustomFieldViewController"],"./company/department/DepartmentViewController":[6993,9,"company-department-DepartmentViewController"],"./company/department/DepartmentViewController.js":[6993,9,"company-department-DepartmentViewController"],"./company/ethnic_group/EthnicGroupViewController":[2332,9,"company-ethnic_group-EthnicGroupViewController"],"./company/ethnic_group/EthnicGroupViewController.js":[2332,9,"company-ethnic_group-EthnicGroupViewController"],"./company/geo_fence/GEOFenceViewController":[7191,9,"vendors-node_modules_leaflet_dist_images_marker-icon-2x_png-node_modules_leaflet_dist_images_-78d511","color-picker-TColorPicker","interface_html5_framework_leaflet_leaflet-timetrex_js","company-geo_fence-GEOFenceViewController"],"./company/geo_fence/GEOFenceViewController.js":[7191,9,"vendors-node_modules_leaflet_dist_images_marker-icon-2x_png-node_modules_leaflet_dist_images_-78d511","color-picker-TColorPicker","interface_html5_framework_leaflet_leaflet-timetrex_js","company-geo_fence-GEOFenceViewController"],"./company/hierarchy_control/HierarchyControlViewController":[3433,9,"company-hierarchy_control-HierarchyControlViewController"],"./company/hierarchy_control/HierarchyControlViewController.js":[3433,9,"company-hierarchy_control-HierarchyControlViewController"],"./company/legal_entity/LegalEntityViewController":[9514,9,"company-legal_entity-LegalEntityViewController"],"./company/legal_entity/LegalEntityViewController.js":[9514,9,"company-legal_entity-LegalEntityViewController"],"./company/other_field/OtherFieldViewController":[498,9,"company-other_field-OtherFieldViewController"],"./company/other_field/OtherFieldViewController.js":[498,9,"company-other_field-OtherFieldViewController"],"./company/payroll_remittance_agency/PayrollRemittanceAgencyEventViewController":[542,9,"company-payroll_remittance_agency-PayrollRemittanceAgencyEventViewController"],"./company/payroll_remittance_agency/PayrollRemittanceAgencyEventViewController.js":[542,9,"company-payroll_remittance_agency-PayrollRemittanceAgencyEventViewController"],"./company/payroll_remittance_agency/PayrollRemittanceAgencyViewController":[3665,9,"company-payroll_remittance_agency-PayrollRemittanceAgencyViewController"],"./company/payroll_remittance_agency/PayrollRemittanceAgencyViewController.js":[3665,9,"company-payroll_remittance_agency-PayrollRemittanceAgencyViewController"],"./company/permission_control/PermissionControlViewController":[5448,9,"company-permission_control-PermissionControlViewController"],"./company/permission_control/PermissionControlViewController.js":[5448,9,"company-permission_control-PermissionControlViewController"],"./company/remittance_source_account/RemittanceSourceAccountViewController":[3401,9,"company-remittance_source_account-RemittanceSourceAccountViewController"],"./company/remittance_source_account/RemittanceSourceAccountViewController.js":[3401,9,"company-remittance_source_account-RemittanceSourceAccountViewController"],"./company/station/StationViewController":[132,9,"company-station-StationViewController"],"./company/station/StationViewController.js":[132,9,"company-station-StationViewController"],"./company/wage/WageViewController":[2085,9,"company-wage-WageViewController"],"./company/wage/WageViewController.js":[2085,9,"company-wage-WageViewController"],"./company/wage_group/WageGroupViewController":[3928,9,"company-wage_group-WageGroupViewController"],"./company/wage_group/WageGroupViewController.js":[3928,9,"company-wage_group-WageGroupViewController"],"./core/log/LogViewController":[7590,9,"core-log-LogViewController"],"./core/log/LogViewController.js":[7590,9,"core-log-LogViewController"],"./developer_tools/AwesomeboxTestViewController":[6142,9,"developer_tools-AwesomeboxTestViewController"],"./developer_tools/AwesomeboxTestViewController.js":[6142,9,"developer_tools-AwesomeboxTestViewController"],"./developer_tools/GridTestViewController":[5477,9,"developer_tools-GridTestViewController"],"./developer_tools/GridTestViewController.js":[5477,9,"developer_tools-GridTestViewController"],"./developer_tools/WidgetTestViewController":[2911,9,"color-picker-TColorPicker","developer_tools-WidgetTestViewController"],"./developer_tools/WidgetTestViewController.js":[2911,9,"color-picker-TColorPicker","developer_tools-WidgetTestViewController"],"./developer_tools/debugPanelController":[8038,7,"developer_tools-debugPanelController"],"./developer_tools/debugPanelController.js":[8038,7,"developer_tools-debugPanelController"],"./document/DocumentGroupViewController":[1359,9,"document-DocumentGroupViewController"],"./document/DocumentGroupViewController.js":[1359,9,"document-DocumentGroupViewController"],"./document/DocumentRevisionViewController":[4120,9,"document-DocumentRevisionViewController"],"./document/DocumentRevisionViewController.js":[4120,9,"document-DocumentRevisionViewController"],"./document/DocumentViewController":[1214,9,"document-DocumentViewController"],"./document/DocumentViewController.js":[1214,9,"document-DocumentViewController"],"./employees/employee/EmployeeViewController":[1961,9,"employees-employee-EmployeeViewController"],"./employees/employee/EmployeeViewController.js":[1961,9,"employees-employee-EmployeeViewController"],"./employees/remittance_destination_account/RemittanceDestinationAccountViewController":[4333,9,"employees-remittance_destination_account-RemittanceDestinationAccountViewController"],"./employees/remittance_destination_account/RemittanceDestinationAccountViewController.js":[4333,9,"employees-remittance_destination_account-RemittanceDestinationAccountViewController"],"./employees/roe/ROEViewController":[8967,9,"employees-roe-ROEViewController"],"./employees/roe/ROEViewController.js":[8967,9,"employees-roe-ROEViewController"],"./employees/user_contact/UserContactViewController":[6738,9,"employees-user_contact-UserContactViewController"],"./employees/user_contact/UserContactViewController.js":[6738,9,"employees-user_contact-UserContactViewController"],"./employees/user_default/UserDefaultViewController":[4777,9,"employees-user_default-UserDefaultViewController"],"./employees/user_default/UserDefaultViewController.js":[4777,9,"employees-user_default-UserDefaultViewController"],"./employees/user_group/UserGroupViewController":[293,9,"employees-user_group-UserGroupViewController"],"./employees/user_group/UserGroupViewController.js":[293,9,"employees-user_group-UserGroupViewController"],"./employees/user_preference/UserPreferenceViewController":[8427,9,"employees-user_preference-UserPreferenceViewController"],"./employees/user_preference/UserPreferenceViewController.js":[8427,9,"employees-user_preference-UserPreferenceViewController"],"./employees/user_title/UserTitleViewController":[2321,9,"employees-user_title-UserTitleViewController"],"./employees/user_title/UserTitleViewController.js":[2321,9,"employees-user_title-UserTitleViewController"],"./help/AboutViewController":[78,9,"help-AboutViewController"],"./help/AboutViewController.js":[78,9,"help-AboutViewController"],"./home/dashboard/HomeViewController":[7657,9,"vendors-node_modules_jquery-bridget_jquery-bridget_js-node_modules_masonry-layout_masonry_js","home-dashboard-HomeViewController"],"./home/dashboard/HomeViewController.js":[7657,9,"vendors-node_modules_jquery-bridget_jquery-bridget_js-node_modules_masonry-layout_masonry_js","home-dashboard-HomeViewController"],"./home/dashlet/DashletController":[190,9,"home-dashlet-DashletController"],"./home/dashlet/DashletController.js":[190,9,"home-dashlet-DashletController"],"./hr/kpi/KPIGroupViewController":[1134,9,"hr-kpi-KPIGroupViewController"],"./hr/kpi/KPIGroupViewController.js":[1134,9,"hr-kpi-KPIGroupViewController"],"./hr/kpi/KPIViewController":[5160,9,"hr-kpi-KPIViewController"],"./hr/kpi/KPIViewController.js":[5160,9,"hr-kpi-KPIViewController"],"./hr/kpi/UserReviewControlViewController":[7454,9,"hr-kpi-UserReviewControlViewController"],"./hr/kpi/UserReviewControlViewController.js":[7454,9,"hr-kpi-UserReviewControlViewController"],"./hr/qualification/QualificationGroupViewController":[307,9,"hr-qualification-QualificationGroupViewController"],"./hr/qualification/QualificationGroupViewController.js":[307,9,"hr-qualification-QualificationGroupViewController"],"./hr/qualification/QualificationViewController":[4807,9,"hr-qualification-QualificationViewController"],"./hr/qualification/QualificationViewController.js":[4807,9,"hr-qualification-QualificationViewController"],"./hr/qualification/UserEducationViewController":[2305,9,"hr-qualification-UserEducationViewController"],"./hr/qualification/UserEducationViewController.js":[2305,9,"hr-qualification-UserEducationViewController"],"./hr/qualification/UserLanguageViewController":[7578,9,"hr-qualification-UserLanguageViewController"],"./hr/qualification/UserLanguageViewController.js":[7578,9,"hr-qualification-UserLanguageViewController"],"./hr/qualification/UserLicenseViewController":[5495,9,"hr-qualification-UserLicenseViewController"],"./hr/qualification/UserLicenseViewController.js":[5495,9,"hr-qualification-UserLicenseViewController"],"./hr/qualification/UserMembershipViewController":[9633,9,"hr-qualification-UserMembershipViewController"],"./hr/qualification/UserMembershipViewController.js":[9633,9,"hr-qualification-UserMembershipViewController"],"./hr/qualification/UserSkillViewController":[1634,9,"hr-qualification-UserSkillViewController"],"./hr/qualification/UserSkillViewController.js":[1634,9,"hr-qualification-UserSkillViewController"],"./hr/recruitment/JobApplicantEducationViewController":[7580,9,"hr-recruitment-JobApplicantEducationViewController"],"./hr/recruitment/JobApplicantEducationViewController.js":[7580,9,"hr-recruitment-JobApplicantEducationViewController"],"./hr/recruitment/JobApplicantEmploymentViewController":[2257,9,"hr-recruitment-JobApplicantEmploymentViewController"],"./hr/recruitment/JobApplicantEmploymentViewController.js":[2257,9,"hr-recruitment-JobApplicantEmploymentViewController"],"./hr/recruitment/JobApplicantLanguageViewController":[2048,9,"hr-recruitment-JobApplicantLanguageViewController"],"./hr/recruitment/JobApplicantLanguageViewController.js":[2048,9,"hr-recruitment-JobApplicantLanguageViewController"],"./hr/recruitment/JobApplicantLicenseViewController":[1854,9,"hr-recruitment-JobApplicantLicenseViewController"],"./hr/recruitment/JobApplicantLicenseViewController.js":[1854,9,"hr-recruitment-JobApplicantLicenseViewController"],"./hr/recruitment/JobApplicantLocationViewController":[6436,9,"hr-recruitment-JobApplicantLocationViewController"],"./hr/recruitment/JobApplicantLocationViewController.js":[6436,9,"hr-recruitment-JobApplicantLocationViewController"],"./hr/recruitment/JobApplicantMembershipViewController":[5283,9,"hr-recruitment-JobApplicantMembershipViewController"],"./hr/recruitment/JobApplicantMembershipViewController.js":[5283,9,"hr-recruitment-JobApplicantMembershipViewController"],"./hr/recruitment/JobApplicantReferenceViewController":[2144,9,"hr-recruitment-JobApplicantReferenceViewController"],"./hr/recruitment/JobApplicantReferenceViewController.js":[2144,9,"hr-recruitment-JobApplicantReferenceViewController"],"./hr/recruitment/JobApplicantSkillViewController":[9962,9,"hr-recruitment-JobApplicantSkillViewController"],"./hr/recruitment/JobApplicantSkillViewController.js":[9962,9,"hr-recruitment-JobApplicantSkillViewController"],"./hr/recruitment/JobApplicantViewController":[19,9,"hr-recruitment-JobApplicantViewController"],"./hr/recruitment/JobApplicantViewController.js":[19,9,"hr-recruitment-JobApplicantViewController"],"./hr/recruitment/JobApplicationViewController":[6719,9,"vendors-node_modules_pdfjs-dist_web_pdf_viewer_js","hr-recruitment-JobApplicationViewController"],"./hr/recruitment/JobApplicationViewController.js":[6719,9,"vendors-node_modules_pdfjs-dist_web_pdf_viewer_js","hr-recruitment-JobApplicationViewController"],"./hr/recruitment/JobVacancyViewController":[6191,9,"vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","hr-recruitment-JobVacancyViewController"],"./hr/recruitment/JobVacancyViewController.js":[6191,9,"vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","hr-recruitment-JobVacancyViewController"],"./hr/recruitment/RecruitmentPortalConfigViewController":[1183,9,"hr-recruitment-RecruitmentPortalConfigViewController"],"./hr/recruitment/RecruitmentPortalConfigViewController.js":[1183,9,"hr-recruitment-RecruitmentPortalConfigViewController"],"./invoice/area_policy/AreaPolicyViewController":[8477,9,"invoice-area_policy-AreaPolicyViewController"],"./invoice/area_policy/AreaPolicyViewController.js":[8477,9,"invoice-area_policy-AreaPolicyViewController"],"./invoice/client/ClientViewController":[1475,9,"invoice-client-ClientViewController"],"./invoice/client/ClientViewController.js":[1475,9,"invoice-client-ClientViewController"],"./invoice/client_contact/ClientContactViewController":[7397,9,"invoice-client_contact-ClientContactViewController"],"./invoice/client_contact/ClientContactViewController.js":[7397,9,"invoice-client_contact-ClientContactViewController"],"./invoice/client_group/ClientGroupViewController":[6510,9,"invoice-client_group-ClientGroupViewController"],"./invoice/client_group/ClientGroupViewController.js":[6510,9,"invoice-client_group-ClientGroupViewController"],"./invoice/client_payment/ClientPaymentViewController":[8253,9,"invoice-client_payment-ClientPaymentViewController"],"./invoice/client_payment/ClientPaymentViewController.js":[8253,9,"invoice-client_payment-ClientPaymentViewController"],"./invoice/district/InvoiceDistrictViewController":[5504,9,"invoice-district-InvoiceDistrictViewController"],"./invoice/district/InvoiceDistrictViewController.js":[5504,9,"invoice-district-InvoiceDistrictViewController"],"./invoice/invoice/InvoiceViewController":[4585,9,"invoice-invoice-InvoiceViewController"],"./invoice/invoice/InvoiceViewController.js":[4585,9,"invoice-invoice-InvoiceViewController"],"./invoice/invoice_transaction/InvoiceTransactionViewController":[5229,9,"invoice-invoice_transaction-InvoiceTransactionViewController"],"./invoice/invoice_transaction/InvoiceTransactionViewController.js":[5229,9,"invoice-invoice_transaction-InvoiceTransactionViewController"],"./invoice/payment_gateway/PaymentGatewayViewController":[9243,9,"invoice-payment_gateway-PaymentGatewayViewController"],"./invoice/payment_gateway/PaymentGatewayViewController.js":[9243,9,"invoice-payment_gateway-PaymentGatewayViewController"],"./invoice/product_group/ProductGroupViewController":[8698,9,"invoice-product_group-ProductGroupViewController"],"./invoice/product_group/ProductGroupViewController.js":[8698,9,"invoice-product_group-ProductGroupViewController"],"./invoice/products/ProductViewController":[1744,9,"invoice-products-ProductViewController"],"./invoice/products/ProductViewController.js":[1744,9,"invoice-products-ProductViewController"],"./invoice/settings/InvoiceConfigViewController":[2196,9,"invoice-settings-InvoiceConfigViewController"],"./invoice/settings/InvoiceConfigViewController.js":[2196,9,"invoice-settings-InvoiceConfigViewController"],"./invoice/shipping_policy/ShippingPolicyViewController":[6432,9,"invoice-shipping_policy-ShippingPolicyViewController"],"./invoice/shipping_policy/ShippingPolicyViewController.js":[6432,9,"invoice-shipping_policy-ShippingPolicyViewController"],"./invoice/tax_policy/TaxPolicyViewController":[5265,9,"invoice-tax_policy-TaxPolicyViewController"],"./invoice/tax_policy/TaxPolicyViewController.js":[5265,9,"invoice-tax_policy-TaxPolicyViewController"],"./login/LoginViewController":[2097,9,"login-LoginViewController"],"./login/LoginViewController.js":[2097,9,"login-LoginViewController"],"./my_account/expense/ExpenseAuthorizationViewController":[936,9,"my_account-expense-ExpenseAuthorizationViewController"],"./my_account/expense/ExpenseAuthorizationViewController.js":[936,9,"my_account-expense-ExpenseAuthorizationViewController"],"./my_account/expense/LoginUserExpenseViewController":[2340,9,"my_account-expense-LoginUserExpenseViewController"],"./my_account/expense/LoginUserExpenseViewController.js":[2340,9,"my_account-expense-LoginUserExpenseViewController"],"./my_account/message_control/MessageControlViewController":[4468,9,"vendors-node_modules_linkifyjs_string_js","my_account-message_control-MessageControlViewController"],"./my_account/message_control/MessageControlViewController.js":[4468,9,"vendors-node_modules_linkifyjs_string_js","my_account-message_control-MessageControlViewController"],"./my_account/notification/NotificationViewController":[2159,9,"my_account-notification-NotificationViewController"],"./my_account/notification/NotificationViewController.js":[2159,9,"my_account-notification-NotificationViewController"],"./my_account/password/ChangePasswordViewController":[1968,9,"my_account-password-ChangePasswordViewController"],"./my_account/password/ChangePasswordViewController.js":[1968,9,"my_account-password-ChangePasswordViewController"],"./my_account/request/RequestViewController":[926,9,"my_account-request-RequestViewController"],"./my_account/request/RequestViewController.js":[926,9,"my_account-request-RequestViewController"],"./my_account/request_authorization/RequestAuthorizationViewController":[5396,9,"my_account-request_authorization-RequestAuthorizationViewController"],"./my_account/request_authorization/RequestAuthorizationViewController.js":[5396,9,"my_account-request_authorization-RequestAuthorizationViewController"],"./my_account/timesheet_authorization/TimeSheetAuthorizationViewController":[8121,9,"my_account-timesheet_authorization-TimeSheetAuthorizationViewController"],"./my_account/timesheet_authorization/TimeSheetAuthorizationViewController.js":[8121,9,"my_account-timesheet_authorization-TimeSheetAuthorizationViewController"],"./my_account/user_contact/LoginUserContactViewController":[5345,9,"my_account-user_contact-LoginUserContactViewController"],"./my_account/user_contact/LoginUserContactViewController.js":[5345,9,"my_account-user_contact-LoginUserContactViewController"],"./my_account/user_preference/LoginUserPreferenceViewController":[30,9,"my_account-user_preference-LoginUserPreferenceViewController"],"./my_account/user_preference/LoginUserPreferenceViewController.js":[30,9,"my_account-user_preference-LoginUserPreferenceViewController"],"./payperiod/PayPeriodScheduleViewController":[6415,9,"payperiod-PayPeriodScheduleViewController"],"./payperiod/PayPeriodScheduleViewController.js":[6415,9,"payperiod-PayPeriodScheduleViewController"],"./payroll/company_tax_deduction/CompanyTaxDeductionViewController":[9706,9,"payroll-company_tax_deduction-CompanyTaxDeductionViewController"],"./payroll/company_tax_deduction/CompanyTaxDeductionViewController.js":[9706,9,"payroll-company_tax_deduction-CompanyTaxDeductionViewController"],"./payroll/government_document/GovernmentDocumentViewController":[424,9,"payroll-government_document-GovernmentDocumentViewController"],"./payroll/government_document/GovernmentDocumentViewController.js":[424,9,"payroll-government_document-GovernmentDocumentViewController"],"./payroll/pay_periods/PayPeriodsViewController":[505,9,"payroll-pay_periods-PayPeriodsViewController"],"./payroll/pay_periods/PayPeriodsViewController.js":[505,9,"payroll-pay_periods-PayPeriodsViewController"],"./payroll/pay_stub/PayStubViewController":[3436,9,"vendors-node_modules_decimal_js_decimal_mjs","payroll-pay_stub-PayStubViewController"],"./payroll/pay_stub/PayStubViewController.js":[3436,9,"vendors-node_modules_decimal_js_decimal_mjs","payroll-pay_stub-PayStubViewController"],"./payroll/pay_stub_amendment/PayStubAmendmentViewController":[4776,9,"vendors-node_modules_decimal_js_decimal_mjs","payroll-pay_stub_amendment-PayStubAmendmentViewController"],"./payroll/pay_stub_amendment/PayStubAmendmentViewController.js":[4776,9,"vendors-node_modules_decimal_js_decimal_mjs","payroll-pay_stub_amendment-PayStubAmendmentViewController"],"./payroll/pay_stub_entry_account/PayStubEntryAccountViewController":[9378,9,"payroll-pay_stub_entry_account-PayStubEntryAccountViewController"],"./payroll/pay_stub_entry_account/PayStubEntryAccountViewController.js":[9378,9,"payroll-pay_stub_entry_account-PayStubEntryAccountViewController"],"./payroll/pay_stub_transaction/PayStubTransactionViewController":[7900,9,"payroll-pay_stub_transaction-PayStubTransactionViewController"],"./payroll/pay_stub_transaction/PayStubTransactionViewController.js":[7900,9,"payroll-pay_stub_transaction-PayStubTransactionViewController"],"./payroll/process_transactions_wizard/ProcessTransactionsWizard":[171,9,"payroll-process_transactions_wizard-ProcessTransactionsWizard"],"./payroll/process_transactions_wizard/ProcessTransactionsWizard.js":[171,9,"payroll-process_transactions_wizard-ProcessTransactionsWizard"],"./payroll/process_transactions_wizard/ProcessTransactionsWizardController":[3248,9,"payroll-process_transactions_wizard-ProcessTransactionsWizardController"],"./payroll/process_transactions_wizard/ProcessTransactionsWizardController.js":[3248,9,"payroll-process_transactions_wizard-ProcessTransactionsWizardController"],"./payroll/process_transactions_wizard/ProcessTransactionsWizardStepHome":[3267,9,"payroll-process_transactions_wizard-ProcessTransactionsWizardStepHome"],"./payroll/process_transactions_wizard/ProcessTransactionsWizardStepHome.js":[3267,9,"payroll-process_transactions_wizard-ProcessTransactionsWizardStepHome"],"./payroll/recurring_pay_stub_amendment/RecurringPayStubAmendmentViewController":[4744,9,"payroll-recurring_pay_stub_amendment-RecurringPayStubAmendmentViewController"],"./payroll/recurring_pay_stub_amendment/RecurringPayStubAmendmentViewController.js":[4744,9,"payroll-recurring_pay_stub_amendment-RecurringPayStubAmendmentViewController"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizard":[7591,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizard"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizard.js":[7591,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizard"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardController":[5095,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardController"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardController.js":[5095,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardController"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepHome":[9468,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepHome"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepHome.js":[9468,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepHome"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepPublish":[1947,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepPublish"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepPublish.js":[1947,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepPublish"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepReview":[7547,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepReview"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepReview.js":[7547,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepReview"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepSubmit":[6554,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepSubmit"],"./payroll/remittance_wizard/PayrollRemittanceAgencyEventWizardStepSubmit.js":[6554,9,"payroll-remittance_wizard-PayrollRemittanceAgencyEventWizardStepSubmit"],"./payroll/user_expense/UserExpenseViewController":[3434,9,"payroll-user_expense-UserExpenseViewController"],"./payroll/user_expense/UserExpenseViewController.js":[3434,9,"payroll-user_expense-UserExpenseViewController"],"./policy/absence_policy/AbsencePolicyViewController":[1308,9,"policy-absence_policy-AbsencePolicyViewController"],"./policy/absence_policy/AbsencePolicyViewController.js":[1308,9,"policy-absence_policy-AbsencePolicyViewController"],"./policy/accrual_policy/AccrualPolicyAccountViewController":[242,9,"policy-accrual_policy-AccrualPolicyAccountViewController"],"./policy/accrual_policy/AccrualPolicyAccountViewController.js":[242,9,"policy-accrual_policy-AccrualPolicyAccountViewController"],"./policy/accrual_policy/AccrualPolicyUserModifierViewController":[7369,9,"policy-accrual_policy-AccrualPolicyUserModifierViewController"],"./policy/accrual_policy/AccrualPolicyUserModifierViewController.js":[7369,9,"policy-accrual_policy-AccrualPolicyUserModifierViewController"],"./policy/accrual_policy/AccrualPolicyViewController":[5594,9,"policy-accrual_policy-AccrualPolicyViewController"],"./policy/accrual_policy/AccrualPolicyViewController.js":[5594,9,"policy-accrual_policy-AccrualPolicyViewController"],"./policy/break_policy/BreakPolicyViewController":[2658,9,"policy-break_policy-BreakPolicyViewController"],"./policy/break_policy/BreakPolicyViewController.js":[2658,9,"policy-break_policy-BreakPolicyViewController"],"./policy/contributing_pay_code_policy/ContributingPayCodePolicyViewController":[335,9,"policy-contributing_pay_code_policy-ContributingPayCodePolicyViewController"],"./policy/contributing_pay_code_policy/ContributingPayCodePolicyViewController.js":[335,9,"policy-contributing_pay_code_policy-ContributingPayCodePolicyViewController"],"./policy/contributing_shift_policy/ContributingShiftPolicyViewController":[4362,9,"policy-contributing_shift_policy-ContributingShiftPolicyViewController"],"./policy/contributing_shift_policy/ContributingShiftPolicyViewController.js":[4362,9,"policy-contributing_shift_policy-ContributingShiftPolicyViewController"],"./policy/exception_policy/ExceptionPolicyControlViewController":[6556,9,"policy-exception_policy-ExceptionPolicyControlViewController"],"./policy/exception_policy/ExceptionPolicyControlViewController.js":[6556,9,"policy-exception_policy-ExceptionPolicyControlViewController"],"./policy/expense_policy/ExpensePolicyViewController":[6859,9,"policy-expense_policy-ExpensePolicyViewController"],"./policy/expense_policy/ExpensePolicyViewController.js":[6859,9,"policy-expense_policy-ExpensePolicyViewController"],"./policy/holiday/HolidayViewController":[677,9,"policy-holiday-HolidayViewController"],"./policy/holiday/HolidayViewController.js":[677,9,"policy-holiday-HolidayViewController"],"./policy/holiday_policy/HolidayPolicyViewController":[935,9,"policy-holiday_policy-HolidayPolicyViewController"],"./policy/holiday_policy/HolidayPolicyViewController.js":[935,9,"policy-holiday_policy-HolidayPolicyViewController"],"./policy/meal_policy/MealPolicyViewController":[7473,9,"policy-meal_policy-MealPolicyViewController"],"./policy/meal_policy/MealPolicyViewController.js":[7473,9,"policy-meal_policy-MealPolicyViewController"],"./policy/overtime_policy/OvertimePolicyViewController":[7645,9,"policy-overtime_policy-OvertimePolicyViewController"],"./policy/overtime_policy/OvertimePolicyViewController.js":[7645,9,"policy-overtime_policy-OvertimePolicyViewController"],"./policy/pay_code/PayCodeViewController":[6050,9,"policy-pay_code-PayCodeViewController"],"./policy/pay_code/PayCodeViewController.js":[6050,9,"policy-pay_code-PayCodeViewController"],"./policy/pay_formula_policy/PayFormulaPolicyViewController":[5787,9,"policy-pay_formula_policy-PayFormulaPolicyViewController"],"./policy/pay_formula_policy/PayFormulaPolicyViewController.js":[5787,9,"policy-pay_formula_policy-PayFormulaPolicyViewController"],"./policy/policy_group/PolicyGroupViewController":[3585,9,"policy-policy_group-PolicyGroupViewController"],"./policy/policy_group/PolicyGroupViewController.js":[3585,9,"policy-policy_group-PolicyGroupViewController"],"./policy/premium_policy/PremiumPolicyViewController":[5668,9,"policy-premium_policy-PremiumPolicyViewController"],"./policy/premium_policy/PremiumPolicyViewController.js":[5668,9,"policy-premium_policy-PremiumPolicyViewController"],"./policy/recurring_holiday/RecurringHolidayViewController":[2625,9,"policy-recurring_holiday-RecurringHolidayViewController"],"./policy/recurring_holiday/RecurringHolidayViewController.js":[2625,9,"policy-recurring_holiday-RecurringHolidayViewController"],"./policy/regular_time_policy/RegularTimePolicyViewController":[3247,9,"policy-regular_time_policy-RegularTimePolicyViewController"],"./policy/regular_time_policy/RegularTimePolicyViewController.js":[3247,9,"policy-regular_time_policy-RegularTimePolicyViewController"],"./policy/round_interval_policy/RoundIntervalPolicyViewController":[6392,9,"policy-round_interval_policy-RoundIntervalPolicyViewController"],"./policy/round_interval_policy/RoundIntervalPolicyViewController.js":[6392,9,"policy-round_interval_policy-RoundIntervalPolicyViewController"],"./policy/schedule_policy/SchedulePolicyViewController":[7911,9,"policy-schedule_policy-SchedulePolicyViewController"],"./policy/schedule_policy/SchedulePolicyViewController.js":[7911,9,"policy-schedule_policy-SchedulePolicyViewController"],"./portal/PortalBaseViewController":[97,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./portal/PortalBaseViewController.js":[97,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./portal/header/HeaderUploadResumeWidget":[3295,9,"portal-header-HeaderUploadResumeWidget"],"./portal/header/HeaderUploadResumeWidget.js":[3295,9,"portal-header-HeaderUploadResumeWidget"],"./portal/header/HeaderViewController":[3246,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./portal/header/HeaderViewController.js":[3246,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./portal/hr/my_jobapplication/MyJobApplicationViewController":[4813,9,"BaseViewController","portal-hr-my_jobapplication-MyJobApplicationViewController"],"./portal/hr/my_jobapplication/MyJobApplicationViewController.js":[4813,9,"BaseViewController","portal-hr-my_jobapplication-MyJobApplicationViewController"],"./portal/hr/my_profile/DocumentSubViewController":[9495,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","DocumentSubViewController"],"./portal/hr/my_profile/DocumentSubViewController.js":[9495,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","DocumentSubViewController"],"./portal/hr/my_profile/JobApplicantEducationSubViewController":[6042,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantEducationSubViewController"],"./portal/hr/my_profile/JobApplicantEducationSubViewController.js":[6042,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantEducationSubViewController"],"./portal/hr/my_profile/JobApplicantEmploymentSubViewController":[2838,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantEmploymentSubViewController"],"./portal/hr/my_profile/JobApplicantEmploymentSubViewController.js":[2838,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantEmploymentSubViewController"],"./portal/hr/my_profile/JobApplicantLanguageSubViewController":[864,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantLanguageSubViewController"],"./portal/hr/my_profile/JobApplicantLanguageSubViewController.js":[864,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantLanguageSubViewController"],"./portal/hr/my_profile/JobApplicantLicenseSubViewController":[536,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantLicenseSubViewController"],"./portal/hr/my_profile/JobApplicantLicenseSubViewController.js":[536,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantLicenseSubViewController"],"./portal/hr/my_profile/JobApplicantLocationSubViewController":[8157,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantLocationSubViewController"],"./portal/hr/my_profile/JobApplicantLocationSubViewController.js":[8157,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantLocationSubViewController"],"./portal/hr/my_profile/JobApplicantMembershipSubViewController":[1993,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantMembershipSubViewController"],"./portal/hr/my_profile/JobApplicantMembershipSubViewController.js":[1993,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantMembershipSubViewController"],"./portal/hr/my_profile/JobApplicantReferenceSubViewController":[9232,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantReferenceSubViewController"],"./portal/hr/my_profile/JobApplicantReferenceSubViewController.js":[9232,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantReferenceSubViewController"],"./portal/hr/my_profile/JobApplicantSkillSubViewController":[9548,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantSkillSubViewController"],"./portal/hr/my_profile/JobApplicantSkillSubViewController.js":[9548,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicantSkillSubViewController"],"./portal/hr/my_profile/JobApplicantSubBaseViewController":[3757,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantSubBaseViewController"],"./portal/hr/my_profile/JobApplicantSubBaseViewController.js":[3757,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-my_profile-JobApplicantSubBaseViewController"],"./portal/hr/my_profile/JobApplicationSubViewController":[3510,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicationSubViewController"],"./portal/hr/my_profile/JobApplicationSubViewController.js":[3510,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","JobApplicationSubViewController"],"./portal/hr/my_profile/MyProfileViewController":[388,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_jquery-ui_ui_widgets_datepicker_js","portal-PortalBaseViewController","portal-hr-my_profile-MyProfileViewController"],"./portal/hr/my_profile/MyProfileViewController.js":[388,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_jquery-ui_ui_widgets_datepicker_js","portal-PortalBaseViewController","portal-hr-my_profile-MyProfileViewController"],"./portal/hr/recruitment/PortalJobVacancyDetailController":[86,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyDetailController"],"./portal/hr/recruitment/PortalJobVacancyDetailController.js":[86,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyDetailController"],"./portal/hr/recruitment/PortalJobVacancyDetailViewController":[5246,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyDetailViewController"],"./portal/hr/recruitment/PortalJobVacancyDetailViewController.js":[5246,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyDetailViewController"],"./portal/hr/recruitment/PortalJobVacancyRowController":[1730,9,"portal-hr-recruitment-PortalJobVacancyRowController"],"./portal/hr/recruitment/PortalJobVacancyRowController.js":[1730,9,"portal-hr-recruitment-PortalJobVacancyRowController"],"./portal/hr/recruitment/PortalJobVacancyViewController":[8471,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyViewController"],"./portal/hr/recruitment/PortalJobVacancyViewController.js":[8471,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController","portal-hr-recruitment-PortalJobVacancyViewController"],"./portal/sign_in/PortalForgotPasswordController":[76,9,"portal-sign_in-PortalForgotPasswordController"],"./portal/sign_in/PortalForgotPasswordController.js":[76,9,"portal-sign_in-PortalForgotPasswordController"],"./portal/sign_in/PortalResetForgotPasswordController":[5866,9,"portal-sign_in-PortalResetForgotPasswordController"],"./portal/sign_in/PortalResetForgotPasswordController.js":[5866,9,"portal-sign_in-PortalResetForgotPasswordController"],"./portal/sign_in/SignInController":[9903,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./portal/sign_in/SignInController.js":[9903,9,"vendors-node_modules_bootstrap-select_dist_js_bootstrap-select_js","portal-PortalBaseViewController"],"./quick_punch/QuickPunchBaseViewController":[9942,9,"quick_punch-QuickPunchBaseViewController"],"./quick_punch/QuickPunchBaseViewController.js":[9942,9,"quick_punch-QuickPunchBaseViewController"],"./quick_punch/header/HeaderViewController":[5196,9,"quick_punch-header-HeaderViewController"],"./quick_punch/header/HeaderViewController.js":[5196,9,"quick_punch-header-HeaderViewController"],"./quick_punch/login/QuickPunchLoginViewController":[3562,9,"quick_punch-login-QuickPunchLoginViewController"],"./quick_punch/login/QuickPunchLoginViewController.js":[3562,9,"quick_punch-login-QuickPunchLoginViewController"],"./quick_punch/punch/QuickPunchViewController":[3e3,9,"quick_punch-punch-QuickPunchViewController"],"./quick_punch/punch/QuickPunchViewController.js":[3e3,9,"quick_punch-punch-QuickPunchViewController"],"./reports/ReportBaseViewController":[7867,9,"BaseViewController","reports-ReportBaseViewController"],"./reports/ReportBaseViewController.js":[7867,9,"BaseViewController","reports-ReportBaseViewController"],"./reports/accrual_balance_summary/AccrualBalanceSummaryReportViewController":[1709,9,"reports-accrual_balance_summary-AccrualBalanceSummaryReportViewController"],"./reports/accrual_balance_summary/AccrualBalanceSummaryReportViewController.js":[1709,9,"reports-accrual_balance_summary-AccrualBalanceSummaryReportViewController"],"./reports/affordable_care/AffordableCareReportViewController":[1466,9,"reports-affordable_care-AffordableCareReportViewController"],"./reports/affordable_care/AffordableCareReportViewController.js":[1466,9,"reports-affordable_care-AffordableCareReportViewController"],"./reports/audittrail/AuditTrailReportViewController":[9380,9,"reports-audittrail-AuditTrailReportViewController"],"./reports/audittrail/AuditTrailReportViewController.js":[9380,9,"reports-audittrail-AuditTrailReportViewController"],"./reports/custom_column/CustomColumnViewController":[6729,9,"reports-custom_column-CustomColumnViewController"],"./reports/custom_column/CustomColumnViewController.js":[6729,9,"reports-custom_column-CustomColumnViewController"],"./reports/employee_information/UserSummaryReportViewController":[4319,9,"reports-employee_information-UserSummaryReportViewController"],"./reports/employee_information/UserSummaryReportViewController.js":[4319,9,"reports-employee_information-UserSummaryReportViewController"],"./reports/exception_summary/ExceptionSummaryReportViewController":[1703,9,"reports-exception_summary-ExceptionSummaryReportViewController"],"./reports/exception_summary/ExceptionSummaryReportViewController.js":[1703,9,"reports-exception_summary-ExceptionSummaryReportViewController"],"./reports/expense_summary/ExpenseSummaryReportViewController":[9864,9,"reports-expense_summary-ExpenseSummaryReportViewController"],"./reports/expense_summary/ExpenseSummaryReportViewController.js":[9864,9,"reports-expense_summary-ExpenseSummaryReportViewController"],"./reports/form1099/Form1099NecReportViewController":[7237,9,"reports-form1099-Form1099NecReportViewController"],"./reports/form1099/Form1099NecReportViewController.js":[7237,9,"reports-form1099-Form1099NecReportViewController"],"./reports/form940/Form940ReportViewController":[6667,9,"reports-form940-Form940ReportViewController"],"./reports/form940/Form940ReportViewController.js":[6667,9,"reports-form940-Form940ReportViewController"],"./reports/form941/Form941ReportViewController":[1022,9,"reports-form941-Form941ReportViewController"],"./reports/form941/Form941ReportViewController.js":[1022,9,"reports-form941-Form941ReportViewController"],"./reports/formw2/FormW2ReportViewController":[7705,9,"reports-formw2-FormW2ReportViewController"],"./reports/formw2/FormW2ReportViewController.js":[7705,9,"reports-formw2-FormW2ReportViewController"],"./reports/general_ledger_summary/GeneralLedgerSummaryReportViewController":[852,9,"reports-general_ledger_summary-GeneralLedgerSummaryReportViewController"],"./reports/general_ledger_summary/GeneralLedgerSummaryReportViewController.js":[852,9,"reports-general_ledger_summary-GeneralLedgerSummaryReportViewController"],"./reports/invoice_transaction_summary/InvoiceTransactionSummaryReportViewController":[2736,9,"reports-invoice_transaction_summary-InvoiceTransactionSummaryReportViewController"],"./reports/invoice_transaction_summary/InvoiceTransactionSummaryReportViewController.js":[2736,9,"reports-invoice_transaction_summary-InvoiceTransactionSummaryReportViewController"],"./reports/job_analysis/JobAnalysisReportViewController":[1478,9,"reports-job_analysis-JobAnalysisReportViewController"],"./reports/job_analysis/JobAnalysisReportViewController.js":[1478,9,"reports-job_analysis-JobAnalysisReportViewController"],"./reports/job_info/JobInformationReportViewController":[9956,9,"reports-job_info-JobInformationReportViewController"],"./reports/job_info/JobInformationReportViewController.js":[9956,9,"reports-job_info-JobInformationReportViewController"],"./reports/job_item_info/JobItemInformationReportViewController":[609,9,"reports-job_item_info-JobItemInformationReportViewController"],"./reports/job_item_info/JobItemInformationReportViewController.js":[609,9,"reports-job_item_info-JobItemInformationReportViewController"],"./reports/job_summary/JobSummaryReportViewController":[9783,9,"reports-job_summary-JobSummaryReportViewController"],"./reports/job_summary/JobSummaryReportViewController.js":[9783,9,"reports-job_summary-JobSummaryReportViewController"],"./reports/pay_stub_summary/PayStubSummaryReportViewController":[4421,9,"reports-pay_stub_summary-PayStubSummaryReportViewController"],"./reports/pay_stub_summary/PayStubSummaryReportViewController.js":[4421,9,"reports-pay_stub_summary-PayStubSummaryReportViewController"],"./reports/pay_stub_transaction_summary/PayStubTransactionSummaryReportViewController":[1619,9,"reports-pay_stub_transaction_summary-PayStubTransactionSummaryReportViewController"],"./reports/pay_stub_transaction_summary/PayStubTransactionSummaryReportViewController.js":[1619,9,"reports-pay_stub_transaction_summary-PayStubTransactionSummaryReportViewController"],"./reports/payroll_export/PayrollExportReportViewController":[5613,9,"reports-payroll_export-PayrollExportReportViewController"],"./reports/payroll_export/PayrollExportReportViewController.js":[5613,9,"reports-payroll_export-PayrollExportReportViewController"],"./reports/punch_summary/PunchSummaryReportViewController":[5663,9,"reports-punch_summary-PunchSummaryReportViewController"],"./reports/punch_summary/PunchSummaryReportViewController.js":[5663,9,"reports-punch_summary-PunchSummaryReportViewController"],"./reports/qualification_summary/UserQualificationReportViewController":[1884,9,"reports-qualification_summary-UserQualificationReportViewController"],"./reports/qualification_summary/UserQualificationReportViewController.js":[1884,9,"reports-qualification_summary-UserQualificationReportViewController"],"./reports/recruitment_detail/UserRecruitmentDetailReportViewController":[1369,9,"reports-recruitment_detail-UserRecruitmentDetailReportViewController"],"./reports/recruitment_detail/UserRecruitmentDetailReportViewController.js":[1369,9,"reports-recruitment_detail-UserRecruitmentDetailReportViewController"],"./reports/recruitment_summary/UserRecruitmentSummaryReportViewController":[7933,9,"reports-recruitment_summary-UserRecruitmentSummaryReportViewController"],"./reports/recruitment_summary/UserRecruitmentSummaryReportViewController.js":[7933,9,"reports-recruitment_summary-UserRecruitmentSummaryReportViewController"],"./reports/remittance_summary/RemittanceSummaryReportViewController":[2246,9,"reports-remittance_summary-RemittanceSummaryReportViewController"],"./reports/remittance_summary/RemittanceSummaryReportViewController.js":[2246,9,"reports-remittance_summary-RemittanceSummaryReportViewController"],"./reports/report_schedule/ReportScheduleViewController":[649,9,"reports-report_schedule-ReportScheduleViewController"],"./reports/report_schedule/ReportScheduleViewController.js":[649,9,"reports-report_schedule-ReportScheduleViewController"],"./reports/review_summary/KPIReportViewController":[1862,9,"reports-review_summary-KPIReportViewController"],"./reports/review_summary/KPIReportViewController.js":[1862,9,"reports-review_summary-KPIReportViewController"],"./reports/saved_report/SavedReportViewController":[9372,9,"reports-saved_report-SavedReportViewController"],"./reports/saved_report/SavedReportViewController.js":[9372,9,"reports-saved_report-SavedReportViewController"],"./reports/schedule_summary/ScheduleSummaryReportViewController":[2247,9,"reports-schedule_summary-ScheduleSummaryReportViewController"],"./reports/schedule_summary/ScheduleSummaryReportViewController.js":[2247,9,"reports-schedule_summary-ScheduleSummaryReportViewController"],"./reports/t4_summary/T4SummaryReportViewController":[2283,9,"reports-t4_summary-T4SummaryReportViewController"],"./reports/t4_summary/T4SummaryReportViewController.js":[2283,9,"reports-t4_summary-T4SummaryReportViewController"],"./reports/t4a_summary/T4ASummaryReportViewController":[9994,9,"reports-t4a_summary-T4ASummaryReportViewController"],"./reports/t4a_summary/T4ASummaryReportViewController.js":[9994,9,"reports-t4a_summary-T4ASummaryReportViewController"],"./reports/tax_summary/TaxSummaryReportViewController":[7905,9,"reports-tax_summary-TaxSummaryReportViewController"],"./reports/tax_summary/TaxSummaryReportViewController.js":[7905,9,"reports-tax_summary-TaxSummaryReportViewController"],"./reports/timesheet_detail/TimesheetDetailReportViewController":[2805,9,"reports-timesheet_detail-TimesheetDetailReportViewController"],"./reports/timesheet_detail/TimesheetDetailReportViewController.js":[2805,9,"reports-timesheet_detail-TimesheetDetailReportViewController"],"./reports/timesheet_summary/TimesheetSummaryReportViewController":[2259,9,"reports-timesheet_summary-TimesheetSummaryReportViewController"],"./reports/timesheet_summary/TimesheetSummaryReportViewController.js":[2259,9,"reports-timesheet_summary-TimesheetSummaryReportViewController"],"./reports/us_state_unemployment/USStateUnemploymentReportViewController":[2786,9,"reports-us_state_unemployment-USStateUnemploymentReportViewController"],"./reports/us_state_unemployment/USStateUnemploymentReportViewController.js":[2786,9,"reports-us_state_unemployment-USStateUnemploymentReportViewController"],"./reports/whos_in_summary/ActiveShiftReportViewController":[7081,9,"reports-whos_in_summary-ActiveShiftReportViewController"],"./reports/whos_in_summary/ActiveShiftReportViewController.js":[7081,9,"reports-whos_in_summary-ActiveShiftReportViewController"],"./ui_kit_sample/UIKitChildSampleViewController":[249,9,"ui_kit_sample-UIKitChildSampleViewController"],"./ui_kit_sample/UIKitChildSampleViewController.js":[249,9,"ui_kit_sample-UIKitChildSampleViewController"],"./ui_kit_sample/UIKitSampleViewController":[5872,9,"vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","color-picker-TColorPicker","ui_kit_sample-UIKitSampleViewController"],"./ui_kit_sample/UIKitSampleViewController.js":[5872,9,"vendors-node_modules_css-loader_dist_cjs_js_node_modules_tinymce_skins_content_default_conten-a516be","color-picker-TColorPicker","ui_kit_sample-UIKitSampleViewController"],"./wizard/BaseWizardController":[9312,9,"wizard-BaseWizardController"],"./wizard/BaseWizardController.js":[9312,9,"wizard-BaseWizardController"],"./wizard/dashlet/DashletWizardController":[9022,9,"wizard-dashlet-DashletWizardController"],"./wizard/dashlet/DashletWizardController.js":[9022,9,"wizard-dashlet-DashletWizardController"],"./wizard/find_available/FindAvailableViewController":[2921,9,"wizard-find_available-FindAvailableViewController"],"./wizard/find_available/FindAvailableViewController.js":[2921,9,"wizard-find_available-FindAvailableViewController"],"./wizard/find_available/FindAvailableWizardController":[6792,9,"wizard-find_available-FindAvailableWizardController"],"./wizard/find_available/FindAvailableWizardController.js":[6792,9,"wizard-find_available-FindAvailableWizardController"],"./wizard/forgot_password/ForgotPasswordWizardController":[1002,9,"wizard-forgot_password-ForgotPasswordWizardController"],"./wizard/forgot_password/ForgotPasswordWizardController.js":[1002,9,"wizard-forgot_password-ForgotPasswordWizardController"],"./wizard/formula_builder_wizard/FormulaBuilderWizardController":[3313,9,"wizard-formula_builder_wizard-FormulaBuilderWizardController"],"./wizard/formula_builder_wizard/FormulaBuilderWizardController.js":[3313,9,"wizard-formula_builder_wizard-FormulaBuilderWizardController"],"./wizard/generate_pay_stub/GeneratePayStubWizardController":[7534,9,"wizard-generate_pay_stub-GeneratePayStubWizardController"],"./wizard/generate_pay_stub/GeneratePayStubWizardController.js":[7534,9,"wizard-generate_pay_stub-GeneratePayStubWizardController"],"./wizard/import_csv/ImportCSVWizardController":[8884,9,"wizard-import_csv-ImportCSVWizardController"],"./wizard/import_csv/ImportCSVWizardController.js":[8884,9,"wizard-import_csv-ImportCSVWizardController"],"./wizard/install/InstallWizardController":[6868,9,"wizard-install-InstallWizardController"],"./wizard/install/InstallWizardController.js":[6868,9,"wizard-install-InstallWizardController"],"./wizard/job_invoice/JobInvoiceWizardController":[428,9,"wizard-job_invoice-JobInvoiceWizardController"],"./wizard/job_invoice/JobInvoiceWizardController.js":[428,9,"wizard-job_invoice-JobInvoiceWizardController"],"./wizard/login_user/LoginUserViewController":[533,9,"wizard-login_user-LoginUserViewController"],"./wizard/login_user/LoginUserViewController.js":[533,9,"wizard-login_user-LoginUserViewController"],"./wizard/login_user/LoginUserWizardController":[2042,9,"wizard-login_user-LoginUserWizardController"],"./wizard/login_user/LoginUserWizardController.js":[2042,9,"wizard-login_user-LoginUserWizardController"],"./wizard/pay_code/PayCodeWizardController":[538,9,"wizard-pay_code-PayCodeWizardController"],"./wizard/pay_code/PayCodeWizardController.js":[538,9,"wizard-pay_code-PayCodeWizardController"],"./wizard/pay_stub_account/PayStubAccountWizardController":[6701,9,"wizard-pay_stub_account-PayStubAccountWizardController"],"./wizard/pay_stub_account/PayStubAccountWizardController.js":[6701,9,"wizard-pay_stub_account-PayStubAccountWizardController"],"./wizard/permission_wizard/PermissionWizardController":[1827,9,"wizard-permission_wizard-PermissionWizardController"],"./wizard/permission_wizard/PermissionWizardController.js":[1827,9,"wizard-permission_wizard-PermissionWizardController"],"./wizard/process_payroll/ProcessPayrollWizardController":[5630,9,"wizard-process_payroll-ProcessPayrollWizardController"],"./wizard/process_payroll/ProcessPayrollWizardController.js":[5630,9,"wizard-process_payroll-ProcessPayrollWizardController"],"./wizard/quick_start/QuickStartWizardController":[5344,9,"wizard-quick_start-QuickStartWizardController"],"./wizard/quick_start/QuickStartWizardController.js":[5344,9,"wizard-quick_start-QuickStartWizardController"],"./wizard/re_calculate_accrual/ReCalculateAccrualWizardController":[1490,9,"wizard-re_calculate_accrual-ReCalculateAccrualWizardController"],"./wizard/re_calculate_accrual/ReCalculateAccrualWizardController.js":[1490,9,"wizard-re_calculate_accrual-ReCalculateAccrualWizardController"],"./wizard/re_calculate_timesheet/ReCalculateTimeSheetWizardController":[2971,9,"wizard-re_calculate_timesheet-ReCalculateTimeSheetWizardController"],"./wizard/re_calculate_timesheet/ReCalculateTimeSheetWizardController.js":[2971,9,"wizard-re_calculate_timesheet-ReCalculateTimeSheetWizardController"],"./wizard/report_view/ReportViewWizardController":[2140,9,"wizard-report_view-ReportViewWizardController"],"./wizard/report_view/ReportViewWizardController.js":[2140,9,"wizard-report_view-ReportViewWizardController"],"./wizard/reset_forgot_password/ResetForgotPasswordWizardController":[1732,9,"wizard-reset_forgot_password-ResetForgotPasswordWizardController"],"./wizard/reset_forgot_password/ResetForgotPasswordWizardController.js":[1732,9,"wizard-reset_forgot_password-ResetForgotPasswordWizardController"],"./wizard/reset_password/ResetPasswordWizardController":[3097,9,"wizard-reset_password-ResetPasswordWizardController"],"./wizard/reset_password/ResetPasswordWizardController.js":[3097,9,"wizard-reset_password-ResetPasswordWizardController"],"./wizard/share_report/ShareReportWizardController":[3238,9,"wizard-share_report-ShareReportWizardController"],"./wizard/share_report/ShareReportWizardController.js":[3238,9,"wizard-share_report-ShareReportWizardController"],"./wizard/user_generic_data_status/UserGenericStatusWindowController":[1706,9,"wizard-user_generic_data_status-UserGenericStatusWindowController"],"./wizard/user_generic_data_status/UserGenericStatusWindowController.js":[1706,9,"wizard-user_generic_data_status-UserGenericStatusWindowController"],"./wizard/user_photo/UserPhotoWizardController":[5184,9,"wizard-user_photo-UserPhotoWizardController"],"./wizard/user_photo/UserPhotoWizardController.js":[5184,9,"wizard-user_photo-UserPhotoWizardController"]};function c(g){if(!I.o(n,g))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+g+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=n[g],c=t[0];return Promise.all(t.slice(2).map(I.e)).then((()=>I.t(c,16|t[1])))}c.keys=()=>Object.keys(n),c.id=1430,g.exports=c},2316:(module,exports,__webpack_require__)=>{eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.4.1\n\n// (c) 2010-2022 Jeremy Ashkenas and DocumentCloud\n// Backbone may be freely distributed under the MIT license.\n// For all details and documentation:\n// http://backbonejs.org\n\n(function(factory) {\n\n // Establish the root object, `window` (`self`) in the browser, or `global` on the server.\n // We use `self` instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof __webpack_require__.g == 'object' && __webpack_require__.g.global === __webpack_require__.g && __webpack_require__.g;\n\n // Set up Backbone appropriately for the environment. Start with AMD.\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(9050), __webpack_require__(9755), exports], __WEBPACK_AMD_DEFINE_RESULT__ = (function(_, $, exports) {\n // Export global even in AMD case in case this script is loaded with\n // others that may still expect a global Backbone.\n root.Backbone = factory(root, exports, _, $);\n }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n // Next for Node.js or CommonJS. jQuery may not be needed as a module.\n } else { var _, $; }\n\n})(function(root, Backbone, _, $) {\n\n // Initial Setup\n // -------------\n\n // Save the previous value of the `Backbone` variable, so that it can be\n // restored later on, if `noConflict` is used.\n var previousBackbone = root.Backbone;\n\n // Create a local reference to a common array method we'll want to use later.\n var slice = Array.prototype.slice;\n\n // Current version of the library. Keep in sync with `package.json`.\n Backbone.VERSION = '1.4.1';\n\n // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n // the `$` variable.\n Backbone.$ = $;\n\n // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n // to its previous owner. Returns a reference to this Backbone object.\n Backbone.noConflict = function() {\n root.Backbone = previousBackbone;\n return this;\n };\n\n // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n // will fake `\"PATCH\"`, `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n // set a `X-Http-Method-Override` header.\n Backbone.emulateHTTP = false;\n\n // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n // `application/json` requests ... this will encode the body as\n // `application/x-www-form-urlencoded` instead and will send the model in a\n // form param named `model`.\n Backbone.emulateJSON = false;\n\n // Backbone.Events\n // ---------------\n\n // A module that can be mixed in to *any object* in order to provide it with\n // a custom event channel. You may bind a callback to an event with `on` or\n // remove with `off`; `trigger`-ing an event fires all callbacks in\n // succession.\n //\n // var object = {};\n // _.extend(object, Backbone.Events);\n // object.on('expand', function(){ alert('expanded'); });\n // object.trigger('expand');\n //\n var Events = Backbone.Events = {};\n\n // Regular expression used to split event strings.\n var eventSplitter = /\\s+/;\n\n // A private global variable to share between listeners and listenees.\n var _listening;\n\n // Iterates over the standard `event, callback` (as well as the fancy multiple\n // space-separated events `\"change blur\", callback` and jQuery-style event\n // maps `{event: callback}`).\n var eventsApi = function(iteratee, events, name, callback, opts) {\n var i = 0, names;\n if (name && typeof name === 'object') {\n // Handle event maps.\n if (callback !== void 0 && 'context' in opts && opts.context === void 0) opts.context = callback;\n for (names = _.keys(name); i < names.length ; i++) {\n events = eventsApi(iteratee, events, names[i], name[names[i]], opts);\n }\n } else if (name && eventSplitter.test(name)) {\n // Handle space-separated event names by delegating them individually.\n for (names = name.split(eventSplitter); i < names.length; i++) {\n events = iteratee(events, names[i], callback, opts);\n }\n } else {\n // Finally, standard events.\n events = iteratee(events, name, callback, opts);\n }\n return events;\n };\n\n // Bind an event to a `callback` function. Passing `\"all\"` will bind\n // the callback to all events fired.\n Events.on = function(name, callback, context) {\n this._events = eventsApi(onApi, this._events || {}, name, callback, {\n context: context,\n ctx: this,\n listening: _listening\n });\n\n if (_listening) {\n var listeners = this._listeners || (this._listeners = {});\n listeners[_listening.id] = _listening;\n // Allow the listening to use a counter, instead of tracking\n // callbacks for library interop\n _listening.interop = false;\n }\n\n return this;\n };\n\n // Inversion-of-control versions of `on`. Tell *this* object to listen to\n // an event in another object... keeping track of what it's listening to\n // for easier unbinding later.\n Events.listenTo = function(obj, name, callback) {\n if (!obj) return this;\n var id = obj._listenId || (obj._listenId = _.uniqueId('l'));\n var listeningTo = this._listeningTo || (this._listeningTo = {});\n var listening = _listening = listeningTo[id];\n\n // This object is not listening to any other events on `obj` yet.\n // Setup the necessary references to track the listening callbacks.\n if (!listening) {\n this._listenId || (this._listenId = _.uniqueId('l'));\n listening = _listening = listeningTo[id] = new Listening(this, obj);\n }\n\n // Bind callbacks on obj.\n var error = tryCatchOn(obj, name, callback, this);\n _listening = void 0;\n\n if (error) throw error;\n // If the target obj is not Backbone.Events, track events manually.\n if (listening.interop) listening.on(name, callback);\n\n return this;\n };\n\n // The reducing API that adds a callback to the `events` object.\n var onApi = function(events, name, callback, options) {\n if (callback) {\n var handlers = events[name] || (events[name] = []);\n var context = options.context, ctx = options.ctx, listening = options.listening;\n if (listening) listening.count++;\n\n handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});\n }\n return events;\n };\n\n // An try-catch guarded #on function, to prevent poisoning the global\n // `_listening` variable.\n var tryCatchOn = function(obj, name, callback, context) {\n try {\n obj.on(name, callback, context);\n } catch (e) {\n return e;\n }\n };\n\n // Remove one or many callbacks. If `context` is null, removes all\n // callbacks with that function. If `callback` is null, removes all\n // callbacks for the event. If `name` is null, removes all bound\n // callbacks for all events.\n Events.off = function(name, callback, context) {\n if (!this._events) return this;\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: context,\n listeners: this._listeners\n });\n\n return this;\n };\n\n // Tell this object to stop listening to either specific events ... or\n // to every object it's currently listening to.\n Events.stopListening = function(obj, name, callback) {\n var listeningTo = this._listeningTo;\n if (!listeningTo) return this;\n\n var ids = obj ? [obj._listenId] : _.keys(listeningTo);\n for (var i = 0; i < ids.length; i++) {\n var listening = listeningTo[ids[i]];\n\n // If listening doesn't exist, this object is not currently\n // listening to obj. Break out early.\n if (!listening) break;\n\n listening.obj.off(name, callback, this);\n if (listening.interop) listening.off(name, callback);\n }\n if (_.isEmpty(listeningTo)) this._listeningTo = void 0;\n\n return this;\n };\n\n // The reducing API that removes a callback from the `events` object.\n var offApi = function(events, name, callback, options) {\n if (!events) return;\n\n var context = options.context, listeners = options.listeners;\n var i = 0, names;\n\n // Delete all event listeners and \"drop\" events.\n if (!name && !context && !callback) {\n for (names = _.keys(listeners); i < names.length; i++) {\n listeners[names[i]].cleanup();\n }\n return;\n }\n\n names = name ? [name] : _.keys(events);\n for (; i < names.length; i++) {\n name = names[i];\n var handlers = events[name];\n\n // Bail out if there are no events stored.\n if (!handlers) break;\n\n // Find any remaining events.\n var remaining = [];\n for (var j = 0; j < handlers.length; j++) {\n var handler = handlers[j];\n if (\n callback && callback !== handler.callback &&\n callback !== handler.callback._callback ||\n context && context !== handler.context\n ) {\n remaining.push(handler);\n } else {\n var listening = handler.listening;\n if (listening) listening.off(name, callback);\n }\n }\n\n // Replace events if there are any remaining. Otherwise, clean up.\n if (remaining.length) {\n events[name] = remaining;\n } else {\n delete events[name];\n }\n }\n\n return events;\n };\n\n // Bind an event to only be triggered a single time. After the first time\n // the callback is invoked, its listener will be removed. If multiple events\n // are passed in using the space-separated syntax, the handler will fire\n // once for each event, not once for a combination of all events.\n Events.once = function(name, callback, context) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.off.bind(this));\n if (typeof name === 'string' && context == null) callback = void 0;\n return this.on(events, callback, context);\n };\n\n // Inversion-of-control versions of `once`.\n Events.listenToOnce = function(obj, name, callback) {\n // Map the event into a `{event: once}` object.\n var events = eventsApi(onceMap, {}, name, callback, this.stopListening.bind(this, obj));\n return this.listenTo(obj, events);\n };\n\n // Reduces the event callbacks into a map of `{event: onceWrapper}`.\n // `offer` unbinds the `onceWrapper` after it has been called.\n var onceMap = function(map, name, callback, offer) {\n if (callback) {\n var once = map[name] = _.once(function() {\n offer(name, once);\n callback.apply(this, arguments);\n });\n once._callback = callback;\n }\n return map;\n };\n\n // Trigger one or many events, firing all bound callbacks. Callbacks are\n // passed the same arguments as `trigger` is, apart from the event name\n // (unless you're listening on `\"all\"`, which will cause your callback to\n // receive the true name of the event as the first argument).\n Events.trigger = function(name) {\n if (!this._events) return this;\n\n var length = Math.max(0, arguments.length - 1);\n var args = Array(length);\n for (var i = 0; i < length; i++) args[i] = arguments[i + 1];\n\n eventsApi(triggerApi, this._events, name, void 0, args);\n return this;\n };\n\n // Handles triggering the appropriate event callbacks.\n var triggerApi = function(objEvents, name, callback, args) {\n if (objEvents) {\n var events = objEvents[name];\n var allEvents = objEvents.all;\n if (events && allEvents) allEvents = allEvents.slice();\n if (events) triggerEvents(events, args);\n if (allEvents) triggerEvents(allEvents, [name].concat(args));\n }\n return objEvents;\n };\n\n // A difficult-to-believe, but optimized internal dispatch function for\n // triggering events. Tries to keep the usual cases speedy (most internal\n // Backbone events have 3 arguments).\n var triggerEvents = function(events, args) {\n var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n switch (args.length) {\n case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;\n }\n };\n\n // A listening class that tracks and cleans up memory bindings\n // when all callbacks have been offed.\n var Listening = function(listener, obj) {\n this.id = listener._listenId;\n this.listener = listener;\n this.obj = obj;\n this.interop = true;\n this.count = 0;\n this._events = void 0;\n };\n\n Listening.prototype.on = Events.on;\n\n // Offs a callback (or several).\n // Uses an optimized counter if the listenee uses Backbone.Events.\n // Otherwise, falls back to manual tracking to support events\n // library interop.\n Listening.prototype.off = function(name, callback) {\n var cleanup;\n if (this.interop) {\n this._events = eventsApi(offApi, this._events, name, callback, {\n context: void 0,\n listeners: void 0\n });\n cleanup = !this._events;\n } else {\n this.count--;\n cleanup = this.count === 0;\n }\n if (cleanup) this.cleanup();\n };\n\n // Cleans up memory bindings between the listener and the listenee.\n Listening.prototype.cleanup = function() {\n delete this.listener._listeningTo[this.obj._listenId];\n if (!this.interop) delete this.obj._listeners[this.id];\n };\n\n // Aliases for backwards compatibility.\n Events.bind = Events.on;\n Events.unbind = Events.off;\n\n // Allow the `Backbone` object to serve as a global event bus, for folks who\n // want global \"pubsub\" in a convenient place.\n _.extend(Backbone, Events);\n\n // Backbone.Model\n // --------------\n\n // Backbone **Models** are the basic data object in the framework --\n // frequently representing a row in a table in a database on your server.\n // A discrete chunk of data and a bunch of useful, related methods for\n // performing computations and transformations on that data.\n\n // Create a new model with the specified attributes. A client id (`cid`)\n // is automatically generated and assigned for you.\n var Model = Backbone.Model = function(attributes, options) {\n var attrs = attributes || {};\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n this.cid = _.uniqueId(this.cidPrefix);\n this.attributes = {};\n if (options.collection) this.collection = options.collection;\n if (options.parse) attrs = this.parse(attrs, options) || {};\n var defaults = _.result(this, 'defaults');\n attrs = _.defaults(_.extend({}, defaults, attrs), defaults);\n this.set(attrs, options);\n this.changed = {};\n this.initialize.apply(this, arguments);\n };\n\n // Attach all inheritable methods to the Model prototype.\n _.extend(Model.prototype, Events, {\n\n // A hash of attributes whose current and previous value differ.\n changed: null,\n\n // The value returned during the last failed validation.\n validationError: null,\n\n // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n // CouchDB users may want to set this to `\"_id\"`.\n idAttribute: 'id',\n\n // The prefix is used to create the client id which is used to identify models locally.\n // You may want to override this if you're experiencing name clashes with model ids.\n cidPrefix: 'c',\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Model.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Return a copy of the model's `attributes` object.\n toJSON: function(options) {\n return _.clone(this.attributes);\n },\n\n // Proxy `Backbone.sync` by default -- but override this if you need\n // custom syncing semantics for *this* particular model.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Get the value of an attribute.\n get: function(attr) {\n return this.attributes[attr];\n },\n\n // Get the HTML-escaped value of an attribute.\n escape: function(attr) {\n return _.escape(this.get(attr));\n },\n\n // Returns `true` if the attribute contains a value that is not null\n // or undefined.\n has: function(attr) {\n return this.get(attr) != null;\n },\n\n // Special-cased proxy to underscore's `_.matches` method.\n matches: function(attrs) {\n return !!_.iteratee(attrs, this)(this.attributes);\n },\n\n // Set a hash of model attributes on the object, firing `\"change\"`. This is\n // the core primitive operation of a model, updating the data and notifying\n // anyone who needs to know about the change in state. The heart of the beast.\n set: function(key, val, options) {\n if (key == null) return this;\n\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options || (options = {});\n\n // Run validation.\n if (!this._validate(attrs, options)) return false;\n\n // Extract attributes and options.\n var unset = options.unset;\n var silent = options.silent;\n var changes = [];\n var changing = this._changing;\n this._changing = true;\n\n if (!changing) {\n this._previousAttributes = _.clone(this.attributes);\n this.changed = {};\n }\n\n var current = this.attributes;\n var changed = this.changed;\n var prev = this._previousAttributes;\n\n // For each `set` attribute, update or delete the current value.\n for (var attr in attrs) {\n val = attrs[attr];\n if (!_.isEqual(current[attr], val)) changes.push(attr);\n if (!_.isEqual(prev[attr], val)) {\n changed[attr] = val;\n } else {\n delete changed[attr];\n }\n unset ? delete current[attr] : current[attr] = val;\n }\n\n // Update the `id`.\n if (this.idAttribute in attrs) {\n var prevId = this.id;\n this.id = this.get(this.idAttribute);\n this.trigger('changeId', this, prevId, options);\n }\n\n // Trigger all relevant attribute changes.\n if (!silent) {\n if (changes.length) this._pending = options;\n for (var i = 0; i < changes.length; i++) {\n this.trigger('change:' + changes[i], this, current[changes[i]], options);\n }\n }\n\n // You might be wondering why there's a `while` loop here. Changes can\n // be recursively nested within `\"change\"` events.\n if (changing) return this;\n if (!silent) {\n while (this._pending) {\n options = this._pending;\n this._pending = false;\n this.trigger('change', this, options);\n }\n }\n this._pending = false;\n this._changing = false;\n return this;\n },\n\n // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n // if the attribute doesn't exist.\n unset: function(attr, options) {\n return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n },\n\n // Clear all attributes on the model, firing `\"change\"`.\n clear: function(options) {\n var attrs = {};\n for (var key in this.attributes) attrs[key] = void 0;\n return this.set(attrs, _.extend({}, options, {unset: true}));\n },\n\n // Determine if the model has changed since the last `\"change\"` event.\n // If you specify an attribute name, determine if that attribute has changed.\n hasChanged: function(attr) {\n if (attr == null) return !_.isEmpty(this.changed);\n return _.has(this.changed, attr);\n },\n\n // Return an object containing all the attributes that have changed, or\n // false if there are no changed attributes. Useful for determining what\n // parts of a view need to be updated and/or what attributes need to be\n // persisted to the server. Unset attributes will be set to undefined.\n // You can also pass an attributes object to diff against the model,\n // determining if there *would be* a change.\n changedAttributes: function(diff) {\n if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n var old = this._changing ? this._previousAttributes : this.attributes;\n var changed = {};\n var hasChanged;\n for (var attr in diff) {\n var val = diff[attr];\n if (_.isEqual(old[attr], val)) continue;\n changed[attr] = val;\n hasChanged = true;\n }\n return hasChanged ? changed : false;\n },\n\n // Get the previous value of an attribute, recorded at the time the last\n // `\"change\"` event was fired.\n previous: function(attr) {\n if (attr == null || !this._previousAttributes) return null;\n return this._previousAttributes[attr];\n },\n\n // Get all of the attributes of the model at the time of the previous\n // `\"change\"` event.\n previousAttributes: function() {\n return _.clone(this._previousAttributes);\n },\n\n // Fetch the model from the server, merging the response with the model's\n // local attributes. Any changed attributes will trigger a \"change\" event.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var model = this;\n var success = options.success;\n options.success = function(resp) {\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (!model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Set a hash of model attributes, and sync the model to the server.\n // If the server returns an attributes hash that differs, the model's\n // state will be `set` again.\n save: function(key, val, options) {\n // Handle both `\"key\", value` and `{key: value}` -style arguments.\n var attrs;\n if (key == null || typeof key === 'object') {\n attrs = key;\n options = val;\n } else {\n (attrs = {})[key] = val;\n }\n\n options = _.extend({validate: true, parse: true}, options);\n var wait = options.wait;\n\n // If we're not waiting and attributes exist, save acts as\n // `set(attr).save(null, opts)` with validation. Otherwise, check if\n // the model will be valid when the attributes, if any, are set.\n if (attrs && !wait) {\n if (!this.set(attrs, options)) return false;\n } else if (!this._validate(attrs, options)) {\n return false;\n }\n\n // After a successful server-side save, the client is (optionally)\n // updated with the server-side state.\n var model = this;\n var success = options.success;\n var attributes = this.attributes;\n options.success = function(resp) {\n // Ensure attributes are restored during synchronous saves.\n model.attributes = attributes;\n var serverAttrs = options.parse ? model.parse(resp, options) : resp;\n if (wait) serverAttrs = _.extend({}, attrs, serverAttrs);\n if (serverAttrs && !model.set(serverAttrs, options)) return false;\n if (success) success.call(options.context, model, resp, options);\n model.trigger('sync', model, resp, options);\n };\n wrapError(this, options);\n\n // Set temporary attributes if `{wait: true}` to properly find new ids.\n if (attrs && wait) this.attributes = _.extend({}, attributes, attrs);\n\n var method = this.isNew() ? 'create' : options.patch ? 'patch' : 'update';\n if (method === 'patch' && !options.attrs) options.attrs = attrs;\n var xhr = this.sync(method, this, options);\n\n // Restore attributes.\n this.attributes = attributes;\n\n return xhr;\n },\n\n // Destroy this model on the server if it was already persisted.\n // Optimistically removes the model from its collection, if it has one.\n // If `wait: true` is passed, waits for the server to respond before removal.\n destroy: function(options) {\n options = options ? _.clone(options) : {};\n var model = this;\n var success = options.success;\n var wait = options.wait;\n\n var destroy = function() {\n model.stopListening();\n model.trigger('destroy', model, model.collection, options);\n };\n\n options.success = function(resp) {\n if (wait) destroy();\n if (success) success.call(options.context, model, resp, options);\n if (!model.isNew()) model.trigger('sync', model, resp, options);\n };\n\n var xhr = false;\n if (this.isNew()) {\n _.defer(options.success);\n } else {\n wrapError(this, options);\n xhr = this.sync('delete', this, options);\n }\n if (!wait) destroy();\n return xhr;\n },\n\n // Default URL for the model's representation on the server -- if you're\n // using Backbone's restful methods, override this to change the endpoint\n // that will be called.\n url: function() {\n var base =\n _.result(this, 'urlRoot') ||\n _.result(this.collection, 'url') ||\n urlError();\n if (this.isNew()) return base;\n var id = this.get(this.idAttribute);\n return base.replace(/[^\\/]$/, '$&/') + encodeURIComponent(id);\n },\n\n // **parse** converts a response into the hash of attributes to be `set` on\n // the model. The default implementation is just to pass the response along.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new model with identical attributes to this one.\n clone: function() {\n return new this.constructor(this.attributes);\n },\n\n // A model is new if it has never been saved to the server, and lacks an id.\n isNew: function() {\n return !this.has(this.idAttribute);\n },\n\n // Check if the model is currently in a valid state.\n isValid: function(options) {\n return this._validate({}, _.extend({}, options, {validate: true}));\n },\n\n // Run validation against the next complete set of model attributes,\n // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n _validate: function(attrs, options) {\n if (!options.validate || !this.validate) return true;\n attrs = _.extend({}, this.attributes, attrs);\n var error = this.validationError = this.validate(attrs, options) || null;\n if (!error) return true;\n this.trigger('invalid', this, error, _.extend(options, {validationError: error}));\n return false;\n }\n\n });\n\n // Backbone.Collection\n // -------------------\n\n // If models tend to represent a single row of data, a Backbone Collection is\n // more analogous to a table full of data ... or a small slice or page of that\n // table, or a collection of rows that belong together for a particular reason\n // -- all of the messages in this particular folder, all of the documents\n // belonging to this particular author, and so on. Collections maintain\n // indexes of their models, both in order, and for lookup by `id`.\n\n // Create a new **Collection**, perhaps to contain a specific type of `model`.\n // If a `comparator` is specified, the Collection will maintain\n // its models in sort order, as they're added and removed.\n var Collection = Backbone.Collection = function(models, options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.model) this.model = options.model;\n if (options.comparator !== void 0) this.comparator = options.comparator;\n this._reset();\n this.initialize.apply(this, arguments);\n if (models) this.reset(models, _.extend({silent: true}, options));\n };\n\n // Default options for `Collection#set`.\n var setOptions = {add: true, remove: true, merge: true};\n var addOptions = {add: true, remove: false};\n\n // Splices `insert` into `array` at index `at`.\n var splice = function(array, insert, at) {\n at = Math.min(Math.max(at, 0), array.length);\n var tail = Array(array.length - at);\n var length = insert.length;\n var i;\n for (i = 0; i < tail.length; i++) tail[i] = array[i + at];\n for (i = 0; i < length; i++) array[i + at] = insert[i];\n for (i = 0; i < tail.length; i++) array[i + length + at] = tail[i];\n };\n\n // Define the Collection's inheritable methods.\n _.extend(Collection.prototype, Events, {\n\n // The default model for a collection is just a **Backbone.Model**.\n // This should be overridden in most cases.\n model: Model,\n\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Collection.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // The JSON representation of a Collection is an array of the\n // models' attributes.\n toJSON: function(options) {\n return this.map(function(model) { return model.toJSON(options); });\n },\n\n // Proxy `Backbone.sync` by default.\n sync: function() {\n return Backbone.sync.apply(this, arguments);\n },\n\n // Add a model, or list of models to the set. `models` may be Backbone\n // Models or raw JavaScript objects to be converted to Models, or any\n // combination of the two.\n add: function(models, options) {\n return this.set(models, _.extend({merge: false}, options, addOptions));\n },\n\n // Remove a model, or a list of models from the set.\n remove: function(models, options) {\n options = _.extend({}, options);\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n var removed = this._removeModels(models, options);\n if (!options.silent && removed.length) {\n options.changes = {added: [], merged: [], removed: removed};\n this.trigger('update', this, options);\n }\n return singular ? removed[0] : removed;\n },\n\n // Update a collection by `set`-ing a new list of models, adding new ones,\n // removing models that are no longer present, and merging models that\n // already exist in the collection, as necessary. Similar to **Model#set**,\n // the core operation for updating the data contained by the collection.\n set: function(models, options) {\n if (models == null) return;\n\n options = _.extend({}, setOptions, options);\n if (options.parse && !this._isModel(models)) {\n models = this.parse(models, options) || [];\n }\n\n var singular = !_.isArray(models);\n models = singular ? [models] : models.slice();\n\n var at = options.at;\n if (at != null) at = +at;\n if (at > this.length) at = this.length;\n if (at < 0) at += this.length + 1;\n\n var set = [];\n var toAdd = [];\n var toMerge = [];\n var toRemove = [];\n var modelMap = {};\n\n var add = options.add;\n var merge = options.merge;\n var remove = options.remove;\n\n var sort = false;\n var sortable = this.comparator && at == null && options.sort !== false;\n var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n\n // Turn bare objects into model references, and prevent invalid models\n // from being added.\n var model, i;\n for (i = 0; i < models.length; i++) {\n model = models[i];\n\n // If a duplicate is found, prevent it from being added and\n // optionally merge it into the existing model.\n var existing = this.get(model);\n if (existing) {\n if (merge && model !== existing) {\n var attrs = this._isModel(model) ? model.attributes : model;\n if (options.parse) attrs = existing.parse(attrs, options);\n existing.set(attrs, options);\n toMerge.push(existing);\n if (sortable && !sort) sort = existing.hasChanged(sortAttr);\n }\n if (!modelMap[existing.cid]) {\n modelMap[existing.cid] = true;\n set.push(existing);\n }\n models[i] = existing;\n\n // If this is a new, valid model, push it to the `toAdd` list.\n } else if (add) {\n model = models[i] = this._prepareModel(model, options);\n if (model) {\n toAdd.push(model);\n this._addReference(model, options);\n modelMap[model.cid] = true;\n set.push(model);\n }\n }\n }\n\n // Remove stale models.\n if (remove) {\n for (i = 0; i < this.length; i++) {\n model = this.models[i];\n if (!modelMap[model.cid]) toRemove.push(model);\n }\n if (toRemove.length) this._removeModels(toRemove, options);\n }\n\n // See if sorting is needed, update `length` and splice in new models.\n var orderChanged = false;\n var replace = !sortable && add && remove;\n if (set.length && replace) {\n orderChanged = this.length !== set.length || _.some(this.models, function(m, index) {\n return m !== set[index];\n });\n this.models.length = 0;\n splice(this.models, set, 0);\n this.length = this.models.length;\n } else if (toAdd.length) {\n if (sortable) sort = true;\n splice(this.models, toAdd, at == null ? this.length : at);\n this.length = this.models.length;\n }\n\n // Silently sort the collection if appropriate.\n if (sort) this.sort({silent: true});\n\n // Unless silenced, it's time to fire all appropriate add/sort/update events.\n if (!options.silent) {\n for (i = 0; i < toAdd.length; i++) {\n if (at != null) options.index = at + i;\n model = toAdd[i];\n model.trigger('add', model, this, options);\n }\n if (sort || orderChanged) this.trigger('sort', this, options);\n if (toAdd.length || toRemove.length || toMerge.length) {\n options.changes = {\n added: toAdd,\n removed: toRemove,\n merged: toMerge\n };\n this.trigger('update', this, options);\n }\n }\n\n // Return the added (or merged) model (or models).\n return singular ? models[0] : models;\n },\n\n // When you have more items than you want to add or remove individually,\n // you can reset the entire set with a new list of models, without firing\n // any granular `add` or `remove` events. Fires `reset` when finished.\n // Useful for bulk operations and optimizations.\n reset: function(models, options) {\n options = options ? _.clone(options) : {};\n for (var i = 0; i < this.models.length; i++) {\n this._removeReference(this.models[i], options);\n }\n options.previousModels = this.models;\n this._reset();\n models = this.add(models, _.extend({silent: true}, options));\n if (!options.silent) this.trigger('reset', this, options);\n return models;\n },\n\n // Add a model to the end of the collection.\n push: function(model, options) {\n return this.add(model, _.extend({at: this.length}, options));\n },\n\n // Remove a model from the end of the collection.\n pop: function(options) {\n var model = this.at(this.length - 1);\n return this.remove(model, options);\n },\n\n // Add a model to the beginning of the collection.\n unshift: function(model, options) {\n return this.add(model, _.extend({at: 0}, options));\n },\n\n // Remove a model from the beginning of the collection.\n shift: function(options) {\n var model = this.at(0);\n return this.remove(model, options);\n },\n\n // Slice out a sub-array of models from the collection.\n slice: function() {\n return slice.apply(this.models, arguments);\n },\n\n // Get a model from the set by id, cid, model object with id or cid\n // properties, or an attributes object that is transformed through modelId.\n get: function(obj) {\n if (obj == null) return void 0;\n return this._byId[obj] ||\n this._byId[this.modelId(this._isModel(obj) ? obj.attributes : obj, obj.idAttribute)] ||\n obj.cid && this._byId[obj.cid];\n },\n\n // Returns `true` if the model is in the collection.\n has: function(obj) {\n return this.get(obj) != null;\n },\n\n // Get the model at the given index.\n at: function(index) {\n if (index < 0) index += this.length;\n return this.models[index];\n },\n\n // Return models with matching attributes. Useful for simple cases of\n // `filter`.\n where: function(attrs, first) {\n return this[first ? 'find' : 'filter'](attrs);\n },\n\n // Return the first model with matching attributes. Useful for simple cases\n // of `find`.\n findWhere: function(attrs) {\n return this.where(attrs, true);\n },\n\n // Force the collection to re-sort itself. You don't need to call this under\n // normal circumstances, as the set will maintain sort order as each item\n // is added.\n sort: function(options) {\n var comparator = this.comparator;\n if (!comparator) throw new Error('Cannot sort a set without a comparator');\n options || (options = {});\n\n var length = comparator.length;\n if (_.isFunction(comparator)) comparator = comparator.bind(this);\n\n // Run sort based on type of `comparator`.\n if (length === 1 || _.isString(comparator)) {\n this.models = this.sortBy(comparator);\n } else {\n this.models.sort(comparator);\n }\n if (!options.silent) this.trigger('sort', this, options);\n return this;\n },\n\n // Pluck an attribute from each model in the collection.\n pluck: function(attr) {\n return this.map(attr + '');\n },\n\n // Fetch the default set of models for this collection, resetting the\n // collection when they arrive. If `reset: true` is passed, the response\n // data will be passed through the `reset` method instead of `set`.\n fetch: function(options) {\n options = _.extend({parse: true}, options);\n var success = options.success;\n var collection = this;\n options.success = function(resp) {\n var method = options.reset ? 'reset' : 'set';\n collection[method](resp, options);\n if (success) success.call(options.context, collection, resp, options);\n collection.trigger('sync', collection, resp, options);\n };\n wrapError(this, options);\n return this.sync('read', this, options);\n },\n\n // Create a new instance of a model in this collection. Add the model to the\n // collection immediately, unless `wait: true` is passed, in which case we\n // wait for the server to agree.\n create: function(model, options) {\n options = options ? _.clone(options) : {};\n var wait = options.wait;\n model = this._prepareModel(model, options);\n if (!model) return false;\n if (!wait) this.add(model, options);\n var collection = this;\n var success = options.success;\n options.success = function(m, resp, callbackOpts) {\n if (wait) collection.add(m, callbackOpts);\n if (success) success.call(callbackOpts.context, m, resp, callbackOpts);\n };\n model.save(null, options);\n return model;\n },\n\n // **parse** converts a response into a list of models to be added to the\n // collection. The default implementation is just to pass it through.\n parse: function(resp, options) {\n return resp;\n },\n\n // Create a new collection with an identical list of models as this one.\n clone: function() {\n return new this.constructor(this.models, {\n model: this.model,\n comparator: this.comparator\n });\n },\n\n // Define how to uniquely identify models in the collection.\n modelId: function(attrs, idAttribute) {\n return attrs[idAttribute || this.model.prototype.idAttribute || 'id'];\n },\n\n // Get an iterator of all models in this collection.\n values: function() {\n return new CollectionIterator(this, ITERATOR_VALUES);\n },\n\n // Get an iterator of all model IDs in this collection.\n keys: function() {\n return new CollectionIterator(this, ITERATOR_KEYS);\n },\n\n // Get an iterator of all [ID, model] tuples in this collection.\n entries: function() {\n return new CollectionIterator(this, ITERATOR_KEYSVALUES);\n },\n\n // Private method to reset all internal state. Called when the collection\n // is first initialized or reset.\n _reset: function() {\n this.length = 0;\n this.models = [];\n this._byId = {};\n },\n\n // Prepare a hash of attributes (or other model) to be added to this\n // collection.\n _prepareModel: function(attrs, options) {\n if (this._isModel(attrs)) {\n if (!attrs.collection) attrs.collection = this;\n return attrs;\n }\n options = options ? _.clone(options) : {};\n options.collection = this;\n\n var model;\n if (this.model.prototype) {\n model = new this.model(attrs, options);\n } else {\n // ES class methods didn't have prototype\n model = this.model(attrs, options);\n }\n\n if (!model.validationError) return model;\n this.trigger('invalid', this, model.validationError, options);\n return false;\n },\n\n // Internal method called by both remove and set.\n _removeModels: function(models, options) {\n var removed = [];\n for (var i = 0; i < models.length; i++) {\n var model = this.get(models[i]);\n if (!model) continue;\n\n var index = this.indexOf(model);\n this.models.splice(index, 1);\n this.length--;\n\n // Remove references before triggering 'remove' event to prevent an\n // infinite loop. #3693\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n\n if (!options.silent) {\n options.index = index;\n model.trigger('remove', model, this, options);\n }\n\n removed.push(model);\n this._removeReference(model, options);\n }\n return removed;\n },\n\n // Method for checking whether an object should be considered a model for\n // the purposes of adding to the collection.\n _isModel: function(model) {\n return model instanceof Model;\n },\n\n // Internal method to create a model's ties to a collection.\n _addReference: function(model, options) {\n this._byId[model.cid] = model;\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) this._byId[id] = model;\n model.on('all', this._onModelEvent, this);\n },\n\n // Internal method to sever a model's ties to a collection.\n _removeReference: function(model, options) {\n delete this._byId[model.cid];\n var id = this.modelId(model.attributes, model.idAttribute);\n if (id != null) delete this._byId[id];\n if (this === model.collection) delete model.collection;\n model.off('all', this._onModelEvent, this);\n },\n\n // Internal method called every time a model in the set fires an event.\n // Sets need to update their indexes when models change ids. All other\n // events simply proxy through. \"add\" and \"remove\" events that originate\n // in other collections are ignored.\n _onModelEvent: function(event, model, collection, options) {\n if (model) {\n if ((event === 'add' || event === 'remove') && collection !== this) return;\n if (event === 'destroy') this.remove(model, options);\n if (event === 'changeId') {\n var prevId = this.modelId(model.previousAttributes(), model.idAttribute);\n var id = this.modelId(model.attributes, model.idAttribute);\n if (prevId != null) delete this._byId[prevId];\n if (id != null) this._byId[id] = model;\n }\n }\n this.trigger.apply(this, arguments);\n }\n\n });\n\n // Defining an @@iterator method implements JavaScript's Iterable protocol.\n // In modern ES2015 browsers, this value is found at Symbol.iterator.\n /* global Symbol */\n var $$iterator = typeof Symbol === 'function' && Symbol.iterator;\n if ($$iterator) {\n Collection.prototype[$$iterator] = Collection.prototype.values;\n }\n\n // CollectionIterator\n // ------------------\n\n // A CollectionIterator implements JavaScript's Iterator protocol, allowing the\n // use of `for of` loops in modern browsers and interoperation between\n // Backbone.Collection and other JavaScript functions and third-party libraries\n // which can operate on Iterables.\n var CollectionIterator = function(collection, kind) {\n this._collection = collection;\n this._kind = kind;\n this._index = 0;\n };\n\n // This \"enum\" defines the three possible kinds of values which can be emitted\n // by a CollectionIterator that correspond to the values(), keys() and entries()\n // methods on Collection, respectively.\n var ITERATOR_VALUES = 1;\n var ITERATOR_KEYS = 2;\n var ITERATOR_KEYSVALUES = 3;\n\n // All Iterators should themselves be Iterable.\n if ($$iterator) {\n CollectionIterator.prototype[$$iterator] = function() {\n return this;\n };\n }\n\n CollectionIterator.prototype.next = function() {\n if (this._collection) {\n\n // Only continue iterating if the iterated collection is long enough.\n if (this._index < this._collection.length) {\n var model = this._collection.at(this._index);\n this._index++;\n\n // Construct a value depending on what kind of values should be iterated.\n var value;\n if (this._kind === ITERATOR_VALUES) {\n value = model;\n } else {\n var id = this._collection.modelId(model.attributes, model.idAttribute);\n if (this._kind === ITERATOR_KEYS) {\n value = id;\n } else { // ITERATOR_KEYSVALUES\n value = [id, model];\n }\n }\n return {value: value, done: false};\n }\n\n // Once exhausted, remove the reference to the collection so future\n // calls to the next method always return done.\n this._collection = void 0;\n }\n\n return {value: void 0, done: true};\n };\n\n // Backbone.View\n // -------------\n\n // Backbone Views are almost more convention than they are actual code. A View\n // is simply a JavaScript object that represents a logical chunk of UI in the\n // DOM. This might be a single item, an entire list, a sidebar or panel, or\n // even the surrounding frame which wraps your whole app. Defining a chunk of\n // UI as a **View** allows you to define your DOM events declaratively, without\n // having to worry about render order ... and makes it easy for the view to\n // react to specific changes in the state of your models.\n\n // Creating a Backbone.View creates its initial element outside of the DOM,\n // if an existing element is not provided...\n var View = Backbone.View = function(options) {\n this.cid = _.uniqueId('view');\n this.preinitialize.apply(this, arguments);\n _.extend(this, _.pick(options, viewOptions));\n this._ensureElement();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regex to split keys for `delegate`.\n var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\n // List of view options to be set as properties.\n var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\n // Set up all inheritable **Backbone.View** properties and methods.\n _.extend(View.prototype, Events, {\n\n // The default `tagName` of a View's element is `\"div\"`.\n tagName: 'div',\n\n // jQuery delegate for element lookup, scoped to DOM elements within the\n // current view. This should be preferred to global lookups where possible.\n $: function(selector) {\n return this.$el.find(selector);\n },\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the View\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // **render** is the core function that your view should override, in order\n // to populate its element (`this.el`), with the appropriate HTML. The\n // convention is for **render** to always return `this`.\n render: function() {\n return this;\n },\n\n // Remove this view by taking the element out of the DOM, and removing any\n // applicable Backbone.Events listeners.\n remove: function() {\n this._removeElement();\n this.stopListening();\n return this;\n },\n\n // Remove this view's element from the document and all event listeners\n // attached to it. Exposed for subclasses using an alternative DOM\n // manipulation API.\n _removeElement: function() {\n this.$el.remove();\n },\n\n // Change the view's element (`this.el` property) and re-delegate the\n // view's events on the new element.\n setElement: function(element) {\n this.undelegateEvents();\n this._setElement(element);\n this.delegateEvents();\n return this;\n },\n\n // Creates the `this.el` and `this.$el` references for this view using the\n // given `el`. `el` can be a CSS selector or an HTML string, a jQuery\n // context or an element. Subclasses can override this to utilize an\n // alternative DOM manipulation API and are only required to set the\n // `this.el` property.\n _setElement: function(el) {\n this.$el = el instanceof Backbone.$ ? el : Backbone.$(el);\n this.el = this.$el[0];\n },\n\n // Set callbacks, where `this.events` is a hash of\n //\n // *{\"event selector\": \"callback\"}*\n //\n // {\n // 'mousedown .title': 'edit',\n // 'click .button': 'save',\n // 'click .open': function(e) { ... }\n // }\n //\n // pairs. Callbacks will be bound to the view, with `this` set properly.\n // Uses event delegation for efficiency.\n // Omitting the selector binds the event to `this.el`.\n delegateEvents: function(events) {\n events || (events = _.result(this, 'events'));\n if (!events) return this;\n this.undelegateEvents();\n for (var key in events) {\n var method = events[key];\n if (!_.isFunction(method)) method = this[method];\n if (!method) continue;\n var match = key.match(delegateEventSplitter);\n this.delegate(match[1], match[2], method.bind(this));\n }\n return this;\n },\n\n // Add a single event listener to the view's element (or a child element\n // using `selector`). This only works for delegate-able events: not `focus`,\n // `blur`, and not `change`, `submit`, and `reset` in Internet Explorer.\n delegate: function(eventName, selector, listener) {\n this.$el.on(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Clears all callbacks previously bound to the view by `delegateEvents`.\n // You usually don't need to use this, but may wish to if you have multiple\n // Backbone views attached to the same DOM element.\n undelegateEvents: function() {\n if (this.$el) this.$el.off('.delegateEvents' + this.cid);\n return this;\n },\n\n // A finer-grained `undelegateEvents` for removing a single delegated event.\n // `selector` and `listener` are both optional.\n undelegate: function(eventName, selector, listener) {\n this.$el.off(eventName + '.delegateEvents' + this.cid, selector, listener);\n return this;\n },\n\n // Produces a DOM element to be assigned to your view. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _createElement: function(tagName) {\n return document.createElement(tagName);\n },\n\n // Ensure that the View has a DOM element to render into.\n // If `this.el` is a string, pass it through `$()`, take the first\n // matching element, and re-assign it to `el`. Otherwise, create\n // an element from the `id`, `className` and `tagName` properties.\n _ensureElement: function() {\n if (!this.el) {\n var attrs = _.extend({}, _.result(this, 'attributes'));\n if (this.id) attrs.id = _.result(this, 'id');\n if (this.className) attrs['class'] = _.result(this, 'className');\n this.setElement(this._createElement(_.result(this, 'tagName')));\n this._setAttributes(attrs);\n } else {\n this.setElement(_.result(this, 'el'));\n }\n },\n\n // Set attributes from a hash on this view's element. Exposed for\n // subclasses using an alternative DOM manipulation API.\n _setAttributes: function(attributes) {\n this.$el.attr(attributes);\n }\n\n });\n\n // Proxy Backbone class methods to Underscore functions, wrapping the model's\n // `attributes` object or collection's `models` array behind the scenes.\n //\n // collection.filter(function(model) { return model.get('age') > 10 });\n // collection.each(this.addView);\n //\n // `Function#apply` can be slow so we use the method's arg count, if we know it.\n var addMethod = function(base, length, method, attribute) {\n switch (length) {\n case 1: return function() {\n return base[method](this[attribute]);\n };\n case 2: return function(value) {\n return base[method](this[attribute], value);\n };\n case 3: return function(iteratee, context) {\n return base[method](this[attribute], cb(iteratee, this), context);\n };\n case 4: return function(iteratee, defaultVal, context) {\n return base[method](this[attribute], cb(iteratee, this), defaultVal, context);\n };\n default: return function() {\n var args = slice.call(arguments);\n args.unshift(this[attribute]);\n return base[method].apply(base, args);\n };\n }\n };\n\n var addUnderscoreMethods = function(Class, base, methods, attribute) {\n _.each(methods, function(length, method) {\n if (base[method]) Class.prototype[method] = addMethod(base, length, method, attribute);\n });\n };\n\n // Support `collection.sortBy('attr')` and `collection.findWhere({id: 1})`.\n var cb = function(iteratee, instance) {\n if (_.isFunction(iteratee)) return iteratee;\n if (_.isObject(iteratee) && !instance._isModel(iteratee)) return modelMatcher(iteratee);\n if (_.isString(iteratee)) return function(model) { return model.get(iteratee); };\n return iteratee;\n };\n var modelMatcher = function(attrs) {\n var matcher = _.matches(attrs);\n return function(model) {\n return matcher(model.attributes);\n };\n };\n\n // Underscore methods that we want to implement on the Collection.\n // 90% of the core usefulness of Backbone Collections is actually implemented\n // right here:\n var collectionMethods = {forEach: 3, each: 3, map: 3, collect: 3, reduce: 0,\n foldl: 0, inject: 0, reduceRight: 0, foldr: 0, find: 3, detect: 3, filter: 3,\n select: 3, reject: 3, every: 3, all: 3, some: 3, any: 3, include: 3, includes: 3,\n contains: 3, invoke: 0, max: 3, min: 3, toArray: 1, size: 1, first: 3,\n head: 3, take: 3, initial: 3, rest: 3, tail: 3, drop: 3, last: 3,\n without: 0, difference: 0, indexOf: 3, shuffle: 1, lastIndexOf: 3,\n isEmpty: 1, chain: 1, sample: 3, partition: 3, groupBy: 3, countBy: 3,\n sortBy: 3, indexBy: 3, findIndex: 3, findLastIndex: 3};\n\n\n // Underscore methods that we want to implement on the Model, mapped to the\n // number of arguments they take.\n var modelMethods = {keys: 1, values: 1, pairs: 1, invert: 1, pick: 0,\n omit: 0, chain: 1, isEmpty: 1};\n\n // Mix in each Underscore method as a proxy to `Collection#models`.\n\n _.each([\n [Collection, collectionMethods, 'models'],\n [Model, modelMethods, 'attributes']\n ], function(config) {\n var Base = config[0],\n methods = config[1],\n attribute = config[2];\n\n Base.mixin = function(obj) {\n var mappings = _.reduce(_.functions(obj), function(memo, name) {\n memo[name] = 0;\n return memo;\n }, {});\n addUnderscoreMethods(Base, obj, mappings, attribute);\n };\n\n addUnderscoreMethods(Base, _, methods, attribute);\n });\n\n // Backbone.sync\n // -------------\n\n // Override this function to change the manner in which Backbone persists\n // models to the server. You will be passed the type of request, and the\n // model in question. By default, makes a RESTful Ajax request\n // to the model's `url()`. Some possible customizations could be:\n //\n // * Use `setTimeout` to batch rapid-fire updates into a single request.\n // * Send up the models as XML instead of JSON.\n // * Persist models via WebSockets instead of Ajax.\n //\n // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n // as `POST`, with a `_method` parameter containing the true HTTP method,\n // as well as all requests with the body as `application/x-www-form-urlencoded`\n // instead of `application/json` with the model in a param named `model`.\n // Useful when interfacing with server-side languages like **PHP** that make\n // it difficult to read the body of `PUT` requests.\n Backbone.sync = function(method, model, options) {\n var type = methodMap[method];\n\n // Default options, unless specified.\n _.defaults(options || (options = {}), {\n emulateHTTP: Backbone.emulateHTTP,\n emulateJSON: Backbone.emulateJSON\n });\n\n // Default JSON-request options.\n var params = {type: type, dataType: 'json'};\n\n // Ensure that we have a URL.\n if (!options.url) {\n params.url = _.result(model, 'url') || urlError();\n }\n\n // Ensure that we have the appropriate request data.\n if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n params.contentType = 'application/json';\n params.data = JSON.stringify(options.attrs || model.toJSON(options));\n }\n\n // For older servers, emulate JSON by encoding the request into an HTML-form.\n if (options.emulateJSON) {\n params.contentType = 'application/x-www-form-urlencoded';\n params.data = params.data ? {model: params.data} : {};\n }\n\n // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n // And an `X-HTTP-Method-Override` header.\n if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n params.type = 'POST';\n if (options.emulateJSON) params.data._method = type;\n var beforeSend = options.beforeSend;\n options.beforeSend = function(xhr) {\n xhr.setRequestHeader('X-HTTP-Method-Override', type);\n if (beforeSend) return beforeSend.apply(this, arguments);\n };\n }\n\n // Don't process data on a non-GET request.\n if (params.type !== 'GET' && !options.emulateJSON) {\n params.processData = false;\n }\n\n // Pass along `textStatus` and `errorThrown` from jQuery.\n var error = options.error;\n options.error = function(xhr, textStatus, errorThrown) {\n options.textStatus = textStatus;\n options.errorThrown = errorThrown;\n if (error) error.call(options.context, xhr, textStatus, errorThrown);\n };\n\n // Make the request, allowing the user to override any Ajax options.\n var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n model.trigger('request', model, xhr, options);\n return xhr;\n };\n\n // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n var methodMap = {\n 'create': 'POST',\n 'update': 'PUT',\n 'patch': 'PATCH',\n 'delete': 'DELETE',\n 'read': 'GET'\n };\n\n // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n // Override this if you'd like to use a different library.\n Backbone.ajax = function() {\n return Backbone.$.ajax.apply(Backbone.$, arguments);\n };\n\n // Backbone.Router\n // ---------------\n\n // Routers map faux-URLs to actions, and fire events when routes are\n // matched. Creating a new one sets its `routes` hash, if not set statically.\n var Router = Backbone.Router = function(options) {\n options || (options = {});\n this.preinitialize.apply(this, arguments);\n if (options.routes) this.routes = options.routes;\n this._bindRoutes();\n this.initialize.apply(this, arguments);\n };\n\n // Cached regular expressions for matching named param parts and splatted\n // parts of route strings.\n var optionalParam = /\\((.*?)\\)/g;\n var namedParam = /(\\(\\?)?:\\w+/g;\n var splatParam = /\\*\\w+/g;\n var escapeRegExp = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\n // Set up all inheritable **Backbone.Router** properties and methods.\n _.extend(Router.prototype, Events, {\n\n // preinitialize is an empty function by default. You can override it with a function\n // or object. preinitialize will run before any instantiation logic is run in the Router.\n preinitialize: function(){},\n\n // Initialize is an empty function by default. Override it with your own\n // initialization logic.\n initialize: function(){},\n\n // Manually bind a single named route to a callback. For example:\n //\n // this.route('search/:query/p:num', 'search', function(query, num) {\n // ...\n // });\n //\n route: function(route, name, callback) {\n if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n if (_.isFunction(name)) {\n callback = name;\n name = '';\n }\n if (!callback) callback = this[name];\n var router = this;\n Backbone.history.route(route, function(fragment) {\n var args = router._extractParameters(route, fragment);\n if (router.execute(callback, args, name) !== false) {\n router.trigger.apply(router, ['route:' + name].concat(args));\n router.trigger('route', name, args);\n Backbone.history.trigger('route', router, name, args);\n }\n });\n return this;\n },\n\n // Execute a route handler with the provided parameters. This is an\n // excellent place to do pre-route setup or post-route cleanup.\n execute: function(callback, args, name) {\n if (callback) callback.apply(this, args);\n },\n\n // Simple proxy to `Backbone.history` to save a fragment into the history.\n navigate: function(fragment, options) {\n Backbone.history.navigate(fragment, options);\n return this;\n },\n\n // Bind all defined routes to `Backbone.history`. We have to reverse the\n // order of the routes here to support behavior where the most general\n // routes can be defined at the bottom of the route map.\n _bindRoutes: function() {\n if (!this.routes) return;\n this.routes = _.result(this, 'routes');\n var route, routes = _.keys(this.routes);\n while ((route = routes.pop()) != null) {\n this.route(route, this.routes[route]);\n }\n },\n\n // Convert a route string into a regular expression, suitable for matching\n // against the current location hash.\n _routeToRegExp: function(route) {\n route = route.replace(escapeRegExp, '\\\\$&')\n .replace(optionalParam, '(?:$1)?')\n .replace(namedParam, function(match, optional) {\n return optional ? match : '([^/?]+)';\n })\n .replace(splatParam, '([^?]*?)');\n return new RegExp('^' + route + '(?:\\\\?([\\\\s\\\\S]*))?$');\n },\n\n // Given a route, and a URL fragment that it matches, return the array of\n // extracted decoded parameters. Empty or unmatched parameters will be\n // treated as `null` to normalize cross-browser behavior.\n _extractParameters: function(route, fragment) {\n var params = route.exec(fragment).slice(1);\n return _.map(params, function(param, i) {\n // Don't decode the search params.\n if (i === params.length - 1) return param || null;\n return param ? decodeURIComponent(param) : null;\n });\n }\n\n });\n\n // Backbone.History\n // ----------------\n\n // Handles cross-browser history management, based on either\n // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n // and URL fragments. If the browser supports neither (old IE, natch),\n // falls back to polling.\n var History = Backbone.History = function() {\n this.handlers = [];\n this.checkUrl = this.checkUrl.bind(this);\n\n // Ensure that `History` can be used outside of the browser.\n if (typeof window !== 'undefined') {\n this.location = window.location;\n this.history = window.history;\n }\n };\n\n // Cached regex for stripping a leading hash/slash and trailing space.\n var routeStripper = /^[#\\/]|\\s+$/g;\n\n // Cached regex for stripping leading and trailing slashes.\n var rootStripper = /^\\/+|\\/+$/g;\n\n // Cached regex for stripping urls of hash.\n var pathStripper = /#.*$/;\n\n // Has the history handling already been started?\n History.started = false;\n\n // Set up all inheritable **Backbone.History** properties and methods.\n _.extend(History.prototype, Events, {\n\n // The default interval to poll for hash changes, if necessary, is\n // twenty times a second.\n interval: 50,\n\n // Are we at the app root?\n atRoot: function() {\n var path = this.location.pathname.replace(/[^\\/]$/, '$&/');\n return path === this.root && !this.getSearch();\n },\n\n // Does the pathname match the root?\n matchRoot: function() {\n var path = this.decodeFragment(this.location.pathname);\n var rootPath = path.slice(0, this.root.length - 1) + '/';\n return rootPath === this.root;\n },\n\n // Unicode characters in `location.pathname` are percent encoded so they're\n // decoded for comparison. `%25` should not be decoded since it may be part\n // of an encoded parameter.\n decodeFragment: function(fragment) {\n return decodeURI(fragment.replace(/%25/g, '%2525'));\n },\n\n // In IE6, the hash fragment and search params are incorrect if the\n // fragment contains `?`.\n getSearch: function() {\n var match = this.location.href.replace(/#.*/, '').match(/\\?.+/);\n return match ? match[0] : '';\n },\n\n // Gets the true hash value. Cannot use location.hash directly due to bug\n // in Firefox where location.hash will always be decoded.\n getHash: function(window) {\n var match = (window || this).location.href.match(/#(.*)$/);\n return match ? match[1] : '';\n },\n\n // Get the pathname and search params, without the root.\n getPath: function() {\n var path = this.decodeFragment(\n this.location.pathname + this.getSearch()\n ).slice(this.root.length - 1);\n return path.charAt(0) === '/' ? path.slice(1) : path;\n },\n\n // Get the cross-browser normalized URL fragment from the path or hash.\n getFragment: function(fragment) {\n if (fragment == null) {\n if (this._usePushState || !this._wantsHashChange) {\n fragment = this.getPath();\n } else {\n fragment = this.getHash();\n }\n }\n return fragment.replace(routeStripper, '');\n },\n\n // Start the hash change handling, returning `true` if the current URL matches\n // an existing route, and `false` otherwise.\n start: function(options) {\n if (History.started) throw new Error('Backbone.history has already been started');\n History.started = true;\n\n // Figure out the initial configuration. Do we need an iframe?\n // Is pushState desired ... is it available?\n this.options = _.extend({root: '/'}, this.options, options);\n this.root = this.options.root;\n this._wantsHashChange = this.options.hashChange !== false;\n this._hasHashChange = 'onhashchange' in window && (document.documentMode === void 0 || document.documentMode > 7);\n this._useHashChange = this._wantsHashChange && this._hasHashChange;\n this._wantsPushState = !!this.options.pushState;\n this._hasPushState = !!(this.history && this.history.pushState);\n this._usePushState = this._wantsPushState && this._hasPushState;\n this.fragment = this.getFragment();\n\n // Normalize root to always include a leading and trailing slash.\n this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\n // Transition from hashChange to pushState or vice versa if both are\n // requested.\n if (this._wantsHashChange && this._wantsPushState) {\n\n // If we've started off with a route from a `pushState`-enabled\n // browser, but we're currently in a browser that doesn't support it...\n if (!this._hasPushState && !this.atRoot()) {\n var rootPath = this.root.slice(0, -1) || '/';\n this.location.replace(rootPath + '#' + this.getPath());\n // Return immediately as browser will do redirect to new url\n return true;\n\n // Or if we've started out with a hash-based route, but we're currently\n // in a browser where it could be `pushState`-based instead...\n } else if (this._hasPushState && this.atRoot()) {\n this.navigate(this.getHash(), {replace: true});\n }\n\n }\n\n // Proxy an iframe to handle location events if the browser doesn't\n // support the `hashchange` event, HTML5 history, or the user wants\n // `hashChange` but not `pushState`.\n if (!this._hasHashChange && this._wantsHashChange && !this._usePushState) {\n this.iframe = document.createElement('iframe');\n this.iframe.src = 'javascript:0';\n this.iframe.style.display = 'none';\n this.iframe.tabIndex = -1;\n var body = document.body;\n // Using `appendChild` will throw on IE < 9 if the document is not ready.\n var iWindow = body.insertBefore(this.iframe, body.firstChild).contentWindow;\n iWindow.document.open();\n iWindow.document.close();\n iWindow.location.hash = '#' + this.fragment;\n }\n\n // Add a cross-platform `addEventListener` shim for older browsers.\n var addEventListener = window.addEventListener || function(eventName, listener) {\n return attachEvent('on' + eventName, listener);\n };\n\n // Depending on whether we're using pushState or hashes, and whether\n // 'onhashchange' is supported, determine how we check the URL state.\n if (this._usePushState) {\n addEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n addEventListener('hashchange', this.checkUrl, false);\n } else if (this._wantsHashChange) {\n this._checkUrlInterval = setInterval(this.checkUrl, this.interval);\n }\n\n if (!this.options.silent) return this.loadUrl();\n },\n\n // Disable Backbone.history, perhaps temporarily. Not useful in a real app,\n // but possibly useful for unit testing Routers.\n stop: function() {\n // Add a cross-platform `removeEventListener` shim for older browsers.\n var removeEventListener = window.removeEventListener || function(eventName, listener) {\n return detachEvent('on' + eventName, listener);\n };\n\n // Remove window listeners.\n if (this._usePushState) {\n removeEventListener('popstate', this.checkUrl, false);\n } else if (this._useHashChange && !this.iframe) {\n removeEventListener('hashchange', this.checkUrl, false);\n }\n\n // Clean up the iframe if necessary.\n if (this.iframe) {\n document.body.removeChild(this.iframe);\n this.iframe = null;\n }\n\n // Some environments will throw when clearing an undefined interval.\n if (this._checkUrlInterval) clearInterval(this._checkUrlInterval);\n History.started = false;\n },\n\n // Add a route to be tested when the fragment changes. Routes added later\n // may override previous routes.\n route: function(route, callback) {\n this.handlers.unshift({route: route, callback: callback});\n },\n\n // Checks the current URL to see if it has changed, and if it has,\n // calls `loadUrl`, normalizing across the hidden iframe.\n checkUrl: function(e) {\n var current = this.getFragment();\n\n // If the user pressed the back button, the iframe's hash will have\n // changed and we should use that for comparison.\n if (current === this.fragment && this.iframe) {\n current = this.getHash(this.iframe.contentWindow);\n }\n\n if (current === this.fragment) return false;\n if (this.iframe) this.navigate(current);\n this.loadUrl();\n },\n\n // Attempt to load the current URL fragment. If a route succeeds with a\n // match, returns `true`. If no defined routes matches the fragment,\n // returns `false`.\n loadUrl: function(fragment) {\n // If the root doesn't match, no routes can match either.\n if (!this.matchRoot()) return false;\n fragment = this.fragment = this.getFragment(fragment);\n return _.some(this.handlers, function(handler) {\n if (handler.route.test(fragment)) {\n handler.callback(fragment);\n return true;\n }\n });\n },\n\n // Save a fragment into the hash history, or replace the URL state if the\n // 'replace' option is passed. You are responsible for properly URL-encoding\n // the fragment in advance.\n //\n // The options object can contain `trigger: true` if you wish to have the\n // route callback be fired (not usually desirable), or `replace: true`, if\n // you wish to modify the current URL without adding an entry to the history.\n navigate: function(fragment, options) {\n if (!History.started) return false;\n if (!options || options === true) options = {trigger: !!options};\n\n // Normalize the fragment.\n fragment = this.getFragment(fragment || '');\n\n // Don't include a trailing slash on the root.\n var rootPath = this.root;\n if (fragment === '' || fragment.charAt(0) === '?') {\n rootPath = rootPath.slice(0, -1) || '/';\n }\n var url = rootPath + fragment;\n\n // Strip the fragment of the query and hash for matching.\n fragment = fragment.replace(pathStripper, '');\n\n // Decode for matching.\n var decodedFragment = this.decodeFragment(fragment);\n\n if (this.fragment === decodedFragment) return;\n this.fragment = decodedFragment;\n\n // If pushState is available, we use it to set the fragment as a real URL.\n if (this._usePushState) {\n this.history[options.replace ? 'replaceState' : 'pushState']({}, document.title, url);\n\n // If hash changes haven't been explicitly disabled, update the hash\n // fragment to store history.\n } else if (this._wantsHashChange) {\n this._updateHash(this.location, fragment, options.replace);\n if (this.iframe && fragment !== this.getHash(this.iframe.contentWindow)) {\n var iWindow = this.iframe.contentWindow;\n\n // Opening and closing the iframe tricks IE7 and earlier to push a\n // history entry on hash-tag change. When replace is true, we don't\n // want this.\n if (!options.replace) {\n iWindow.document.open();\n iWindow.document.close();\n }\n\n this._updateHash(iWindow.location, fragment, options.replace);\n }\n\n // If you've told us that you explicitly don't want fallback hashchange-\n // based history, then `navigate` becomes a page refresh.\n } else {\n return this.location.assign(url);\n }\n if (options.trigger) return this.loadUrl(fragment);\n },\n\n // Update the hash location, either replacing the current entry, or adding\n // a new one to the browser history.\n _updateHash: function(location, fragment, replace) {\n if (replace) {\n var href = location.href.replace(/(javascript:|#).*$/, '');\n location.replace(href + '#' + fragment);\n } else {\n // Some browsers require that `hash` contains a leading #.\n location.hash = '#' + fragment;\n }\n }\n\n });\n\n // Create the default Backbone.history.\n Backbone.history = new History;\n\n // Helpers\n // -------\n\n // Helper function to correctly set up the prototype chain for subclasses.\n // Similar to `goog.inherits`, but uses a hash of prototype properties and\n // class properties to be extended.\n var extend = function(protoProps, staticProps) {\n var parent = this;\n var child;\n\n // The constructor function for the new subclass is either defined by you\n // (the \"constructor\" property in your `extend` definition), or defaulted\n // by us to simply call the parent constructor.\n if (protoProps && _.has(protoProps, 'constructor')) {\n child = protoProps.constructor;\n } else {\n child = function(){ return parent.apply(this, arguments); };\n }\n\n // Add static properties to the constructor function, if supplied.\n _.extend(child, parent, staticProps);\n\n // Set the prototype chain to inherit from `parent`, without calling\n // `parent`'s constructor function and add the prototype properties.\n child.prototype = _.create(parent.prototype, protoProps);\n child.prototype.constructor = child;\n\n // Set a convenience property in case the parent's prototype is needed\n // later.\n child.__super__ = parent.prototype;\n\n return child;\n };\n\n // Set up inheritance for the model, collection, router, view and history.\n Model.extend = Collection.extend = Router.extend = View.extend = History.extend = extend;\n\n // Throw an error when a URL is needed, and none is supplied.\n var urlError = function() {\n throw new Error('A \"url\" property or function must be specified');\n };\n\n // Wrap an optional error callback with a fallback error event.\n var wrapError = function(model, options) {\n var error = options.error;\n options.error = function(resp) {\n if (error) error.call(options.context, model, resp, options);\n model.trigger('error', model, resp, options);\n };\n };\n\n return Backbone;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMxNi5qcyIsIm1hc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gcmVtYWluaW5nID0gW107XG4gICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGhhbmRsZXJzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgIHZhciBoYW5kbGVyID0gaGFuZGxlcnNbal07XG4gICAgICAgIGlmIChcbiAgICAgICAgICBjYWxsYmFjayAmJiBjYWxsYmFjayAhPT0gaGFuZGxlci5jYWxsYmFjayAmJlxuICAgICAgICAgICAgY2FsbGJhY2sgIT09IGhhbmRsZXIuY2FsbGJhY2suX2NhbGxiYWNrIHx8XG4gICAgICAgICAgICAgIGNvbnRleHQgJiYgY29udGV4dCAhPT0gaGFuZGxlci5jb250ZXh0XG4gICAgICAgICkge1xuICAgICAgICAgIHJlbWFpbmluZy5wdXNoKGhhbmRsZXIpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHZhciBsaXN0ZW5pbmcgPSBoYW5kbGVyLmxpc3RlbmluZztcbiAgICAgICAgICBpZiAobGlzdGVuaW5nKSBsaXN0ZW5pbmcub2ZmKG5hbWUsIGNhbGxiYWNrKTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBSZXBsYWNlIGV2ZW50cyBpZiB0aGVyZSBhcmUgYW55IHJlbWFpbmluZy4gIE90aGVyd2lzZSwgY2xlYW4gdXAuXG4gICAgICBpZiAocmVtYWluaW5nLmxlbmd0aCkge1xuICAgICAgICBldmVudHNbbmFtZV0gPSByZW1haW5pbmc7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBkZWxldGUgZXZlbnRzW25hbWVdO1xuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBldmVudHM7XG4gIH07XG5cbiAgLy8gQmluZCBhbiBldmVudCB0byBvbmx5IGJlIHRyaWdnZXJlZCBhIHNpbmdsZSB0aW1lLiBBZnRlciB0aGUgZmlyc3QgdGltZVxuICAvLyB0aGUgY2FsbGJhY2sgaXMgaW52b2tlZCwgaXRzIGxpc3RlbmVyIHdpbGwgYmUgcmVtb3ZlZC4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exports,__webpack_require__){eval('/*!\n * Bootstrap v4.6.2 (https://getbootstrap.com/)\n * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n(function (global, factory) {\n true ? factory(exports, __webpack_require__(9755), __webpack_require__(4575)) :\n 0;\n})(this, (function (exports, $, Popper) { \'use strict\';\n\n function _interopDefaultLegacy (e) { return e && typeof e === \'object\' && \'default\' in e ? e : { \'default\': e }; }\n\n var $__default = /*#__PURE__*/_interopDefaultLegacy($);\n var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, "prototype", {\n writable: false\n });\n return Constructor;\n }\n\n function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n\n _setPrototypeOf(subClass, superClass);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.6.2): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * Private TransitionEnd Helpers\n */\n\n var TRANSITION_END = \'transitionend\';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n if (obj === null || typeof obj === \'undefined\') {\n return "" + obj;\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($__default["default"](event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined;\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $__default["default"](this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator;\n $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * Public Util API\n */\n\n\n var Util = {\n TRANSITION_END: \'bsTransitionEnd\',\n getUID: function getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute(\'data-target\');\n\n if (!selector || selector === \'#\') {\n var hrefAttr = element.getAttribute(\'href\');\n selector = hrefAttr && hrefAttr !== \'#\' ? hrefAttr.trim() : \'\';\n }\n\n try {\n return document.querySelector(selector) ? selector : null;\n } catch (_) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $__default["default"](element).css(\'transition-duration\');\n var transitionDelay = $__default["default"](element).css(\'transition-delay\');\n var floatTransitionDuration = parseFloat(transitionDuration);\n var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(\',\')[0];\n transitionDelay = transitionDelay.split(\',\')[0];\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $__default["default"](element).trigger(TRANSITION_END);\n },\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? \'element\' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + ": " + ("Option \\"" + property + "\\" provided type \\"" + valueType + "\\" ") + ("but expected type \\"" + expectedTypes + "\\"."));\n }\n }\n }\n },\n findShadowRoot: function findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it\'ll return the document\n\n\n if (typeof element.getRootNode === \'function\') {\n var root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don\'t find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return Util.findShadowRoot(element.parentNode);\n },\n jQueryDetection: function jQueryDetection() {\n if (typeof $__default["default"] === \'undefined\') {\n throw new TypeError(\'Bootstrap\\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\\'s JavaScript.\');\n }\n\n var version = $__default["default"].fn.jquery.split(\' \')[0].split(\'.\');\n var minMajor = 1;\n var ltMajor = 2;\n var minMinor = 9;\n var minPatch = 1;\n var maxMajor = 4;\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error(\'Bootstrap\\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0\');\n }\n }\n };\n Util.jQueryDetection();\n setTransitionEndSupport();\n\n /**\n * Constants\n */\n\n var NAME$a = \'alert\';\n var VERSION$a = \'4.6.2\';\n var DATA_KEY$a = \'bs.alert\';\n var EVENT_KEY$a = "." + DATA_KEY$a;\n var DATA_API_KEY$7 = \'.data-api\';\n var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a];\n var CLASS_NAME_ALERT = \'alert\';\n var CLASS_NAME_FADE$5 = \'fade\';\n var CLASS_NAME_SHOW$7 = \'show\';\n var EVENT_CLOSE = "close" + EVENT_KEY$a;\n var EVENT_CLOSED = "closed" + EVENT_KEY$a;\n var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7;\n var SELECTOR_DISMISS = \'[data-dismiss="alert"]\';\n /**\n * Class definition\n */\n\n var Alert = /*#__PURE__*/function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$a);\n this._element = null;\n } // Private\n ;\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n if (!parent) {\n parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $__default["default"].Event(EVENT_CLOSE);\n $__default["default"](element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $__default["default"](element).removeClass(CLASS_NAME_SHOW$7);\n\n if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $__default["default"](element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $__default["default"](element).detach().trigger(EVENT_CLOSED).remove();\n } // Static\n ;\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default["default"](this);\n var data = $element.data(DATA_KEY$a);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY$a, data);\n }\n\n if (config === \'close\') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$a;\n }\n }]);\n\n return Alert;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$a] = Alert._jQueryInterface;\n $__default["default"].fn[NAME$a].Constructor = Alert;\n\n $__default["default"].fn[NAME$a].noConflict = function () {\n $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a;\n return Alert._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$9 = \'button\';\n var VERSION$9 = \'4.6.2\';\n var DATA_KEY$9 = \'bs.button\';\n var EVENT_KEY$9 = "." + DATA_KEY$9;\n var DATA_API_KEY$6 = \'.data-api\';\n var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9];\n var CLASS_NAME_ACTIVE$3 = \'active\';\n var CLASS_NAME_BUTTON = \'btn\';\n var CLASS_NAME_FOCUS = \'focus\';\n var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6;\n var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6);\n var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6;\n var SELECTOR_DATA_TOGGLE_CARROT = \'[data-toggle^="button"]\';\n var SELECTOR_DATA_TOGGLES = \'[data-toggle="buttons"]\';\n var SELECTOR_DATA_TOGGLE$4 = \'[data-toggle="button"]\';\n var SELECTOR_DATA_TOGGLES_BUTTONS = \'[data-toggle="buttons"] .btn\';\n var SELECTOR_INPUT = \'input:not([type="hidden"])\';\n var SELECTOR_ACTIVE$2 = \'.active\';\n var SELECTOR_BUTTON = \'.btn\';\n /**\n * Class definition\n */\n\n var Button = /*#__PURE__*/function () {\n function Button(element) {\n this._element = element;\n this.shouldAvoidTriggerChange = false;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0];\n\n if (rootElement) {\n var input = this._element.querySelector(SELECTOR_INPUT);\n\n if (input) {\n if (input.type === \'radio\') {\n if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2);\n\n if (activeElement) {\n $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3);\n }\n }\n }\n\n if (triggerChangeEvent) {\n // if it\'s not a radio button or checkbox don\'t add a pointless/invalid checked property to the input\n if (input.type === \'checkbox\' || input.type === \'radio\') {\n input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3);\n }\n\n if (!this.shouldAvoidTriggerChange) {\n $__default["default"](input).trigger(\'change\');\n }\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (!(this._element.hasAttribute(\'disabled\') || this._element.classList.contains(\'disabled\'))) {\n if (addAriaPressed) {\n this._element.setAttribute(\'aria-pressed\', !this._element.classList.contains(CLASS_NAME_ACTIVE$3));\n }\n\n if (triggerChangeEvent) {\n $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3);\n }\n }\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$9);\n this._element = null;\n } // Static\n ;\n\n Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {\n return this.each(function () {\n var $element = $__default["default"](this);\n var data = $element.data(DATA_KEY$9);\n\n if (!data) {\n data = new Button(this);\n $element.data(DATA_KEY$9, data);\n }\n\n data.shouldAvoidTriggerChange = avoidTriggerChange;\n\n if (config === \'toggle\') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$9;\n }\n }]);\n\n return Button;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) {\n var button = event.target;\n var initialButton = button;\n\n if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) {\n button = $__default["default"](button).closest(SELECTOR_BUTTON)[0];\n }\n\n if (!button || button.hasAttribute(\'disabled\') || button.classList.contains(\'disabled\')) {\n event.preventDefault(); // work around Firefox bug #1540995\n } else {\n var inputBtn = button.querySelector(SELECTOR_INPUT);\n\n if (inputBtn && (inputBtn.hasAttribute(\'disabled\') || inputBtn.classList.contains(\'disabled\'))) {\n event.preventDefault(); // work around Firefox bug #1540995\n\n return;\n }\n\n if (initialButton.tagName === \'INPUT\' || button.tagName !== \'LABEL\') {\n Button._jQueryInterface.call($__default["default"](button), \'toggle\', initialButton.tagName === \'INPUT\');\n }\n }\n }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {\n var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0];\n $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));\n });\n $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () {\n // ensure correct active class is set to match the controls\' actual values/states\n // find all checkboxes/readio buttons inside data-toggle groups\n var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));\n\n for (var i = 0, len = buttons.length; i < len; i++) {\n var button = buttons[i];\n var input = button.querySelector(SELECTOR_INPUT);\n\n if (input.checked || input.hasAttribute(\'checked\')) {\n button.classList.add(CLASS_NAME_ACTIVE$3);\n } else {\n button.classList.remove(CLASS_NAME_ACTIVE$3);\n }\n } // find all button toggles\n\n\n buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4));\n\n for (var _i = 0, _len = buttons.length; _i < _len; _i++) {\n var _button = buttons[_i];\n\n if (_button.getAttribute(\'aria-pressed\') === \'true\') {\n _button.classList.add(CLASS_NAME_ACTIVE$3);\n } else {\n _button.classList.remove(CLASS_NAME_ACTIVE$3);\n }\n }\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$9] = Button._jQueryInterface;\n $__default["default"].fn[NAME$9].Constructor = Button;\n\n $__default["default"].fn[NAME$9].noConflict = function () {\n $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9;\n return Button._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$8 = \'carousel\';\n var VERSION$8 = \'4.6.2\';\n var DATA_KEY$8 = \'bs.carousel\';\n var EVENT_KEY$8 = "." + DATA_KEY$8;\n var DATA_API_KEY$5 = \'.data-api\';\n var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var SWIPE_THRESHOLD = 40;\n var CLASS_NAME_CAROUSEL = \'carousel\';\n var CLASS_NAME_ACTIVE$2 = \'active\';\n var CLASS_NAME_SLIDE = \'slide\';\n var CLASS_NAME_RIGHT = \'carousel-item-right\';\n var CLASS_NAME_LEFT = \'carousel-item-left\';\n var CLASS_NAME_NEXT = \'carousel-item-next\';\n var CLASS_NAME_PREV = \'carousel-item-prev\';\n var CLASS_NAME_POINTER_EVENT = \'pointer-event\';\n var DIRECTION_NEXT = \'next\';\n var DIRECTION_PREV = \'prev\';\n var DIRECTION_LEFT = \'left\';\n var DIRECTION_RIGHT = \'right\';\n var EVENT_SLIDE = "slide" + EVENT_KEY$8;\n var EVENT_SLID = "slid" + EVENT_KEY$8;\n var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8;\n var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8;\n var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8;\n var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8;\n var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8;\n var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8;\n var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8;\n var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8;\n var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8;\n var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5;\n var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5;\n var SELECTOR_ACTIVE$1 = \'.active\';\n var SELECTOR_ACTIVE_ITEM = \'.active.carousel-item\';\n var SELECTOR_ITEM = \'.carousel-item\';\n var SELECTOR_ITEM_IMG = \'.carousel-item img\';\n var SELECTOR_NEXT_PREV = \'.carousel-item-next, .carousel-item-prev\';\n var SELECTOR_INDICATORS = \'.carousel-indicators\';\n var SELECTOR_DATA_SLIDE = \'[data-slide], [data-slide-to]\';\n var SELECTOR_DATA_RIDE = \'[data-ride="carousel"]\';\n var Default$7 = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: \'hover\',\n wrap: true,\n touch: true\n };\n var DefaultType$7 = {\n interval: \'(number|boolean)\',\n keyboard: \'boolean\',\n slide: \'(boolean|string)\',\n pause: \'(string|boolean)\',\n wrap: \'boolean\',\n touch: \'boolean\'\n };\n var PointerType = {\n TOUCH: \'touch\',\n PEN: \'pen\'\n };\n /**\n * Class definition\n */\n\n var Carousel = /*#__PURE__*/function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._element = element;\n this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);\n this._touchSupported = \'ontouchstart\' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(DIRECTION_NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n var $element = $__default["default"](this._element); // Don\'t call next when the page isn\'t visible\n // or the carousel or its parent isn\'t visible\n\n if (!document.hidden && $element.is(\':visible\') && $element.css(\'visibility\') !== \'hidden\') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(DIRECTION_PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (this._element.querySelector(SELECTOR_NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._updateInterval();\n\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $__default["default"](this._element).one(EVENT_SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $__default["default"](this._element).off(EVENT_KEY$8);\n $__default["default"].removeData(this._element, DATA_KEY$8);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$7, config);\n Util.typeCheckConfig(NAME$8, config, DefaultType$7);\n return config;\n };\n\n _proto._handleSwipe = function _handleSwipe() {\n var absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n var direction = absDeltax / this.touchDeltaX;\n this.touchDeltaX = 0; // swipe left\n\n if (direction > 0) {\n this.prev();\n } // swipe right\n\n\n if (direction < 0) {\n this.next();\n }\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === \'hover\') {\n $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(EVENT_MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners();\n }\n };\n\n _proto._addTouchEventListeners = function _addTouchEventListeners() {\n var _this3 = this;\n\n if (!this._touchSupported) {\n return;\n }\n\n var start = function start(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchStartX = event.originalEvent.clientX;\n } else if (!_this3._pointerEvent) {\n _this3.touchStartX = event.originalEvent.touches[0].clientX;\n }\n };\n\n var move = function move(event) {\n // ensure swiping with one touch and not pinching\n _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX;\n };\n\n var end = function end(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;\n }\n\n _this3._handleSwipe();\n\n if (_this3._config.pause === \'hover\') {\n // If it\'s a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it\'s the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n _this3.pause();\n\n if (_this3.touchTimeout) {\n clearTimeout(_this3.touchTimeout);\n }\n\n _this3.touchTimeout = setTimeout(function (event) {\n return _this3.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);\n }\n };\n\n $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {\n return e.preventDefault();\n });\n\n if (this._pointerEvent) {\n $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) {\n return start(event);\n });\n $__default["default"](this._element).on(EVENT_POINTERUP, function (event) {\n return end(event);\n });\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) {\n return start(event);\n });\n $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) {\n return move(event);\n });\n $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) {\n return end(event);\n });\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === DIRECTION_NEXT;\n var isPrevDirection = direction === DIRECTION_PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === DIRECTION_PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));\n\n var slideEvent = $__default["default"].Event(EVENT_SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $__default["default"](this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));\n $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2);\n }\n }\n };\n\n _proto._updateInterval = function _updateInterval() {\n var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM);\n\n if (!element) {\n return;\n }\n\n var elementInterval = parseInt(element.getAttribute(\'data-interval\'), 10);\n\n if (elementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = elementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this4 = this;\n\n var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === DIRECTION_NEXT) {\n directionalClassName = CLASS_NAME_LEFT;\n orderClassName = CLASS_NAME_NEXT;\n eventDirectionName = DIRECTION_LEFT;\n } else {\n directionalClassName = CLASS_NAME_RIGHT;\n orderClassName = CLASS_NAME_PREV;\n eventDirectionName = DIRECTION_RIGHT;\n }\n\n if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n this._activeElement = nextElement;\n var slidEvent = $__default["default"].Event(EVENT_SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) {\n $__default["default"](nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $__default["default"](activeElement).addClass(directionalClassName);\n $__default["default"](nextElement).addClass(directionalClassName);\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $__default["default"](activeElement).one(Util.TRANSITION_END, function () {\n $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2);\n $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName);\n _this4._isSliding = false;\n setTimeout(function () {\n return $__default["default"](_this4._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2);\n $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2);\n this._isSliding = false;\n $__default["default"](this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n } // Static\n ;\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default["default"](this).data(DATA_KEY$8);\n\n var _config = _extends({}, Default$7, $__default["default"](this).data());\n\n if (typeof config === \'object\') {\n _config = _extends({}, _config, config);\n }\n\n var action = typeof config === \'string\' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $__default["default"](this).data(DATA_KEY$8, data);\n }\n\n if (typeof config === \'number\') {\n data.to(config);\n } else if (typeof action === \'string\') {\n if (typeof data[action] === \'undefined\') {\n throw new TypeError("No method named \\"" + action + "\\"");\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $__default["default"](selector)[0];\n\n if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) {\n return;\n }\n\n var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data());\n\n var slideIndex = this.getAttribute(\'data-slide-to\');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($__default["default"](target), config);\n\n if (slideIndex) {\n $__default["default"](target).data(DATA_KEY$8).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$8;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$7;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);\n $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () {\n var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));\n\n for (var i = 0, len = carousels.length; i < len; i++) {\n var $carousel = $__default["default"](carousels[i]);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n }\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$8] = Carousel._jQueryInterface;\n $__default["default"].fn[NAME$8].Constructor = Carousel;\n\n $__default["default"].fn[NAME$8].noConflict = function () {\n $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8;\n return Carousel._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$7 = \'collapse\';\n var VERSION$7 = \'4.6.2\';\n var DATA_KEY$7 = \'bs.collapse\';\n var EVENT_KEY$7 = "." + DATA_KEY$7;\n var DATA_API_KEY$4 = \'.data-api\';\n var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7];\n var CLASS_NAME_SHOW$6 = \'show\';\n var CLASS_NAME_COLLAPSE = \'collapse\';\n var CLASS_NAME_COLLAPSING = \'collapsing\';\n var CLASS_NAME_COLLAPSED = \'collapsed\';\n var DIMENSION_WIDTH = \'width\';\n var DIMENSION_HEIGHT = \'height\';\n var EVENT_SHOW$4 = "show" + EVENT_KEY$7;\n var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7;\n var EVENT_HIDE$4 = "hide" + EVENT_KEY$7;\n var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7;\n var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4;\n var SELECTOR_ACTIVES = \'.show, .collapsing\';\n var SELECTOR_DATA_TOGGLE$3 = \'[data-toggle="collapse"]\';\n var Default$6 = {\n toggle: true,\n parent: \'\'\n };\n var DefaultType$6 = {\n toggle: \'boolean\',\n parent: \'(string|element)\'\n };\n /**\n * Class definition\n */\n\n var Collapse = /*#__PURE__*/function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\\"collapse\\"][href=\\"#" + element.id + "\\"]," + ("[data-toggle=\\"collapse\\"][data-target=\\"#" + element.id + "\\"]")));\n var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3));\n\n for (var i = 0, len = toggleList.length; i < len; i++) {\n var elem = toggleList[i];\n var selector = Util.getSelectorFromElement(elem);\n var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {\n return foundElem === element;\n });\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {\n if (typeof _this._config.parent === \'string\') {\n return elem.getAttribute(\'data-parent\') === _this._config.parent;\n }\n\n return elem.classList.contains(CLASS_NAME_COLLAPSE);\n });\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $__default["default"].Event(EVENT_SHOW$4);\n $__default["default"](this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), \'hide\');\n\n if (!activesData) {\n $__default["default"](actives).data(DATA_KEY$7, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length) {\n $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr(\'aria-expanded\', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6);\n _this._element.style[dimension] = \'\';\n\n _this.setTransitioning(false);\n\n $__default["default"](_this._element).trigger(EVENT_SHOWN$4);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = "scroll" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + "px";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) {\n return;\n }\n\n var startEvent = $__default["default"].Event(EVENT_HIDE$4);\n $__default["default"](this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";\n Util.reflow(this._element);\n $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6);\n var triggerArrayLength = this._triggerArray.length;\n\n if (triggerArrayLength > 0) {\n for (var i = 0; i < triggerArrayLength; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector)));\n\n if (!$elem.hasClass(CLASS_NAME_SHOW$6)) {\n $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr(\'aria-expanded\', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4);\n };\n\n this._element.style[dimension] = \'\';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$7);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$6, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME$7, config, DefaultType$6);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH);\n return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It\'s a jQuery object\n\n if (typeof this._config.parent.jquery !== \'undefined\') {\n parent = this._config.parent[0];\n }\n } else {\n parent = document.querySelector(this._config.parent);\n }\n\n var selector = "[data-toggle=\\"collapse\\"][data-parent=\\"" + this._config.parent + "\\"]";\n var children = [].slice.call(parent.querySelectorAll(selector));\n $__default["default"](children).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6);\n\n if (triggerArray.length) {\n $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr(\'aria-expanded\', isOpen);\n }\n } // Static\n ;\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default["default"](this);\n var data = $element.data(DATA_KEY$7);\n\n var _config = _extends({}, Default$6, $element.data(), typeof config === \'object\' && config ? config : {});\n\n if (!data && _config.toggle && typeof config === \'string\' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $element.data(DATA_KEY$7, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$7;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$6;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) {\n // preventDefault only for <a> elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === \'A\') {\n event.preventDefault();\n }\n\n var $trigger = $__default["default"](this);\n var selector = Util.getSelectorFromElement(this);\n var selectors = [].slice.call(document.querySelectorAll(selector));\n $__default["default"](selectors).each(function () {\n var $target = $__default["default"](this);\n var data = $target.data(DATA_KEY$7);\n var config = data ? \'toggle\' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$7] = Collapse._jQueryInterface;\n $__default["default"].fn[NAME$7].Constructor = Collapse;\n\n $__default["default"].fn[NAME$7].noConflict = function () {\n $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7;\n return Collapse._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$6 = \'dropdown\';\n var VERSION$6 = \'4.6.2\';\n var DATA_KEY$6 = \'bs.dropdown\';\n var EVENT_KEY$6 = "." + DATA_KEY$6;\n var DATA_API_KEY$3 = \'.data-api\';\n var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6];\n var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1);\n var CLASS_NAME_DISABLED$1 = \'disabled\';\n var CLASS_NAME_SHOW$5 = \'show\';\n var CLASS_NAME_DROPUP = \'dropup\';\n var CLASS_NAME_DROPRIGHT = \'dropright\';\n var CLASS_NAME_DROPLEFT = \'dropleft\';\n var CLASS_NAME_MENURIGHT = \'dropdown-menu-right\';\n var CLASS_NAME_POSITION_STATIC = \'position-static\';\n var EVENT_HIDE$3 = "hide" + EVENT_KEY$6;\n var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6;\n var EVENT_SHOW$3 = "show" + EVENT_KEY$6;\n var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6;\n var EVENT_CLICK = "click" + EVENT_KEY$6;\n var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3;\n var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3;\n var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3;\n var SELECTOR_DATA_TOGGLE$2 = \'[data-toggle="dropdown"]\';\n var SELECTOR_FORM_CHILD = \'.dropdown form\';\n var SELECTOR_MENU = \'.dropdown-menu\';\n var SELECTOR_NAVBAR_NAV = \'.navbar-nav\';\n var SELECTOR_VISIBLE_ITEMS = \'.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)\';\n var PLACEMENT_TOP = \'top-start\';\n var PLACEMENT_TOPEND = \'top-end\';\n var PLACEMENT_BOTTOM = \'bottom-start\';\n var PLACEMENT_BOTTOMEND = \'bottom-end\';\n var PLACEMENT_RIGHT = \'right-start\';\n var PLACEMENT_LEFT = \'left-start\';\n var Default$5 = {\n offset: 0,\n flip: true,\n boundary: \'scrollParent\',\n reference: \'toggle\',\n display: \'dynamic\',\n popperConfig: null\n };\n var DefaultType$5 = {\n offset: \'(number|string|function)\',\n flip: \'boolean\',\n boundary: \'(string|element)\',\n reference: \'(string|element)\',\n display: \'string\',\n popperConfig: \'(null|object)\'\n };\n /**\n * Class definition\n */\n\n var Dropdown = /*#__PURE__*/function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) {\n return;\n }\n\n var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n this.show(true);\n };\n\n _proto.show = function show(usePopper) {\n if (usePopper === void 0) {\n usePopper = false;\n }\n\n if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $__default["default"](parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Totally disable Popper for Dropdowns in Navbar\n\n\n if (!this._inNavbar && usePopper) {\n // Check for Popper dependency\n if (typeof Popper__default["default"] === \'undefined\') {\n throw new TypeError(\'Bootstrap\\\'s dropdowns require Popper (https://popper.js.org)\');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === \'parent\') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it\'s jQuery element\n\n if (typeof this._config.reference.jquery !== \'undefined\') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to "escape" the scroll parent\'s boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== \'scrollParent\') {\n $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC);\n }\n\n this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body\'s immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if (\'ontouchstart\' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {\n $__default["default"](document.body).children().on(\'mouseover\', null, $__default["default"].noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute(\'aria-expanded\', true);\n\n $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5);\n $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget));\n };\n\n _proto.hide = function hide() {\n if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $__default["default"](parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5);\n $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$6);\n $__default["default"](this._element).off(EVENT_KEY$6);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Private\n ;\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $__default["default"](this._element).on(EVENT_CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config);\n Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n if (parent) {\n this._menu = parent.querySelector(SELECTOR_MENU);\n }\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $__default["default"](this._element.parentNode);\n var placement = PLACEMENT_BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {\n placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {\n placement = PLACEMENT_RIGHT;\n } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {\n placement = PLACEMENT_LEFT;\n } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {\n placement = PLACEMENT_BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $__default["default"](this._element).closest(\'.navbar\').length > 0;\n };\n\n _proto._getOffset = function _getOffset() {\n var _this2 = this;\n\n var offset = {};\n\n if (typeof this._config.offset === \'function\') {\n offset.fn = function (data) {\n data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element));\n return data;\n };\n } else {\n offset.offset = this._config.offset;\n }\n\n return offset;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }; // Disable Popper if we have a static display\n\n if (this._config.display === \'static\') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return _extends({}, popperConfig, this._config.popperConfig);\n } // Static\n ;\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default["default"](this).data(DATA_KEY$6);\n\n var _config = typeof config === \'object\' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $__default["default"](this).data(DATA_KEY$6, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === \'keyup\' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));\n\n for (var i = 0, len = toggles.length; i < len; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $__default["default"](toggles[i]).data(DATA_KEY$6);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (event && event.type === \'click\') {\n relatedTarget.clickEvent = event;\n }\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) {\n continue;\n }\n\n if (event && (event.type === \'click\' && /input|textarea/i.test(event.target.tagName) || event.type === \'keyup\' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget);\n $__default["default"](parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if (\'ontouchstart\' in document.documentElement) {\n $__default["default"](document.body).children().off(\'mouseover\', null, $__default["default"].noop);\n }\n\n toggles[i].setAttribute(\'aria-expanded\', \'false\');\n\n if (context._popper) {\n context._popper.destroy();\n }\n\n $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5);\n $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n return parent || element.parentNode;\n } // eslint-disable-next-line complexity\n ;\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5);\n\n if (!isActive && event.which === ESCAPE_KEYCODE$1) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) {\n if (event.which === ESCAPE_KEYCODE$1) {\n $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger(\'focus\');\n }\n\n $__default["default"](this).trigger(\'click\');\n return;\n }\n\n var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {\n return $__default["default"](item).is(\':visible\');\n });\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$6;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$5;\n }\n }, {\n key: "DefaultType",\n get: function get() {\n return DefaultType$5;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($__default["default"](this), \'toggle\');\n }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface;\n $__default["default"].fn[NAME$6].Constructor = Dropdown;\n\n $__default["default"].fn[NAME$6].noConflict = function () {\n $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6;\n return Dropdown._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$5 = \'modal\';\n var VERSION$5 = \'4.6.2\';\n var DATA_KEY$5 = \'bs.modal\';\n var EVENT_KEY$5 = "." + DATA_KEY$5;\n var DATA_API_KEY$2 = \'.data-api\';\n var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var CLASS_NAME_SCROLLABLE = \'modal-dialog-scrollable\';\n var CLASS_NAME_SCROLLBAR_MEASURER = \'modal-scrollbar-measure\';\n var CLASS_NAME_BACKDROP = \'modal-backdrop\';\n var CLASS_NAME_OPEN = \'modal-open\';\n var CLASS_NAME_FADE$4 = \'fade\';\n var CLASS_NAME_SHOW$4 = \'show\';\n var CLASS_NAME_STATIC = \'modal-static\';\n var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;\n var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;\n var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;\n var EVENT_SHOW$2 = "show" + EVENT_KEY$5;\n var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;\n var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;\n var EVENT_RESIZE = "resize" + EVENT_KEY$5;\n var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5;\n var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;\n var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;\n var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;\n var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2;\n var SELECTOR_DIALOG = \'.modal-dialog\';\n var SELECTOR_MODAL_BODY = \'.modal-body\';\n var SELECTOR_DATA_TOGGLE$1 = \'[data-toggle="modal"]\';\n var SELECTOR_DATA_DISMISS$1 = \'[data-dismiss="modal"]\';\n var SELECTOR_FIXED_CONTENT = \'.fixed-top, .fixed-bottom, .is-fixed, .sticky-top\';\n var SELECTOR_STICKY_CONTENT = \'.sticky-top\';\n var Default$4 = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType$4 = {\n backdrop: \'(boolean|string)\',\n keyboard: \'boolean\',\n focus: \'boolean\',\n show: \'boolean\'\n };\n /**\n * Class definition\n */\n\n var Modal = /*#__PURE__*/function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = element.querySelector(SELECTOR_DIALOG);\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n var showEvent = $__default["default"].Event(EVENT_SHOW$2, {\n relatedTarget: relatedTarget\n });\n $__default["default"](this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) {\n this._isTransitioning = true;\n }\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) {\n return _this.hide(event);\n });\n $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {\n $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {\n if ($__default["default"](event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n var hideEvent = $__default["default"].Event(EVENT_HIDE$2);\n $__default["default"](this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $__default["default"](document).off(EVENT_FOCUSIN);\n $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4);\n $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1);\n $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default["default"](this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n [window, this._element, this._dialog].forEach(function (htmlElement) {\n return $__default["default"](htmlElement).off(EVENT_KEY$5);\n });\n /**\n * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `EVENT_CLICK_DATA_API` event that should remain\n */\n\n $__default["default"](document).off(EVENT_FOCUSIN);\n $__default["default"].removeData(this._element, DATA_KEY$5);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._isTransitioning = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$4, config);\n Util.typeCheckConfig(NAME$5, config, DefaultType$4);\n return config;\n };\n\n _proto._triggerBackdropTransition = function _triggerBackdropTransition() {\n var _this3 = this;\n\n var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED);\n $__default["default"](this._element).trigger(hideEventPrevented);\n\n if (hideEventPrevented.isDefaultPrevented()) {\n return;\n }\n\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!isModalOverflowing) {\n this._element.style.overflowY = \'hidden\';\n }\n\n this._element.classList.add(CLASS_NAME_STATIC);\n\n var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $__default["default"](this._element).off(Util.TRANSITION_END);\n $__default["default"](this._element).one(Util.TRANSITION_END, function () {\n _this3._element.classList.remove(CLASS_NAME_STATIC);\n\n if (!isModalOverflowing) {\n $__default["default"](_this3._element).one(Util.TRANSITION_END, function () {\n _this3._element.style.overflowY = \'\';\n }).emulateTransitionEnd(_this3._element, modalTransitionDuration);\n }\n }).emulateTransitionEnd(modalTransitionDuration);\n\n this._element.focus();\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this4 = this;\n\n var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4);\n var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don\'t move modal\'s DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = \'block\';\n\n this._element.removeAttribute(\'aria-hidden\');\n\n this._element.setAttribute(\'aria-modal\', true);\n\n this._element.setAttribute(\'role\', \'dialog\');\n\n if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {\n modalBody.scrollTop = 0;\n } else {\n this._element.scrollTop = 0;\n }\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this4._config.focus) {\n _this4._element.focus();\n }\n\n _this4._isTransitioning = false;\n $__default["default"](_this4._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this5 = this;\n\n $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop\n .on(EVENT_FOCUSIN, function (event) {\n if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) {\n _this5._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {\n if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {\n event.preventDefault();\n\n _this6.hide();\n } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) {\n _this6._triggerBackdropTransition();\n }\n });\n } else if (!this._isShown) {\n $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this7 = this;\n\n if (this._isShown) {\n $__default["default"](window).on(EVENT_RESIZE, function (event) {\n return _this7.handleUpdate(event);\n });\n } else {\n $__default["default"](window).off(EVENT_RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this8 = this;\n\n this._element.style.display = \'none\';\n\n this._element.setAttribute(\'aria-hidden\', true);\n\n this._element.removeAttribute(\'aria-modal\');\n\n this._element.removeAttribute(\'role\');\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $__default["default"](document.body).removeClass(CLASS_NAME_OPEN);\n\n _this8._resetAdjustments();\n\n _this8._resetScrollbar();\n\n $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $__default["default"](this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this9 = this;\n\n var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : \'\';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement(\'div\');\n this._backdrop.className = CLASS_NAME_BACKDROP;\n\n if (animate) {\n this._backdrop.classList.add(animate);\n }\n\n $__default["default"](this._backdrop).appendTo(document.body);\n $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) {\n if (_this9._ignoreBackdropClick) {\n _this9._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n if (_this9._config.backdrop === \'static\') {\n _this9._triggerBackdropTransition();\n } else {\n _this9.hide();\n }\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4);\n\n var callbackRemove = function callbackRemove() {\n _this9._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n ;\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + "px";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + "px";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = \'\';\n this._element.style.paddingRight = \'\';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this10 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or \'\' if not set\n // while $(DOMNode).css(\'padding-right\') returns the calculated value or 0 if not set\n var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));\n var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding\n\n $__default["default"](fixedContent).each(function (index, element) {\n var actualPadding = element.style.paddingRight;\n var calculatedPadding = $__default["default"](element).css(\'padding-right\');\n $__default["default"](element).data(\'padding-right\', actualPadding).css(\'padding-right\', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");\n }); // Adjust sticky content margin\n\n $__default["default"](stickyContent).each(function (index, element) {\n var actualMargin = element.style.marginRight;\n var calculatedMargin = $__default["default"](element).css(\'margin-right\');\n $__default["default"](element).data(\'margin-right\', actualMargin).css(\'margin-right\', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $__default["default"](document.body).css(\'padding-right\');\n $__default["default"](document.body).data(\'padding-right\', actualPadding).css(\'padding-right\', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");\n }\n\n $__default["default"](document.body).addClass(CLASS_NAME_OPEN);\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));\n $__default["default"](fixedContent).each(function (index, element) {\n var padding = $__default["default"](element).data(\'padding-right\');\n $__default["default"](element).removeData(\'padding-right\');\n element.style.paddingRight = padding ? padding : \'\';\n }); // Restore sticky content\n\n var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));\n $__default["default"](elements).each(function (index, element) {\n var margin = $__default["default"](element).data(\'margin-right\');\n\n if (typeof margin !== \'undefined\') {\n $__default["default"](element).css(\'margin-right\', margin).removeData(\'margin-right\');\n }\n }); // Restore body padding\n\n var padding = $__default["default"](document.body).data(\'padding-right\');\n $__default["default"](document.body).removeData(\'padding-right\');\n document.body.style.paddingRight = padding ? padding : \'\';\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement(\'div\');\n scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n } // Static\n ;\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $__default["default"](this).data(DATA_KEY$5);\n\n var _config = _extends({}, Default$4, $__default["default"](this).data(), typeof config === \'object\' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $__default["default"](this).data(DATA_KEY$5, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$5;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$4;\n }\n }]);\n\n return Modal;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) {\n var _this11 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n var config = $__default["default"](target).data(DATA_KEY$5) ? \'toggle\' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data());\n\n if (this.tagName === \'A\' || this.tagName === \'AREA\') {\n event.preventDefault();\n }\n\n var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(EVENT_HIDDEN$2, function () {\n if ($__default["default"](_this11).is(\':visible\')) {\n _this11.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($__default["default"](target), config, this);\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$5] = Modal._jQueryInterface;\n $__default["default"].fn[NAME$5].Constructor = Modal;\n\n $__default["default"].fn[NAME$5].noConflict = function () {\n $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5;\n return Modal._jQueryInterface;\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.6.2): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n var uriAttrs = [\'background\', \'cite\', \'href\', \'itemtype\', \'longdesc\', \'poster\', \'src\', \'xlink:href\'];\n var ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n var DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n \'*\': [\'class\', \'dir\', \'id\', \'lang\', \'role\', ARIA_ATTRIBUTE_PATTERN],\n a: [\'target\', \'href\', \'title\', \'rel\'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: [\'src\', \'srcset\', \'alt\', \'title\', \'width\', \'height\'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n };\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i;\n\n function allowedAttribute(attr, allowedAttributeList) {\n var attrName = attr.nodeName.toLowerCase();\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue));\n }\n\n return true;\n }\n\n var regExp = allowedAttributeList.filter(function (attrRegex) {\n return attrRegex instanceof RegExp;\n }); // Check if a regular expression validates the attribute.\n\n for (var i = 0, len = regExp.length; i < len; i++) {\n if (regExp[i].test(attrName)) {\n return true;\n }\n }\n\n return false;\n }\n\n function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === \'function\') {\n return sanitizeFn(unsafeHtml);\n }\n\n var domParser = new window.DOMParser();\n var createdDocument = domParser.parseFromString(unsafeHtml, \'text/html\');\n var whitelistKeys = Object.keys(whiteList);\n var elements = [].slice.call(createdDocument.body.querySelectorAll(\'*\'));\n\n var _loop = function _loop(i, len) {\n var el = elements[i];\n var elName = el.nodeName.toLowerCase();\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el);\n return "continue";\n }\n\n var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread\n\n var whitelistedAttributes = [].concat(whiteList[\'*\'] || [], whiteList[elName] || []);\n attributeList.forEach(function (attr) {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName);\n }\n });\n };\n\n for (var i = 0, len = elements.length; i < len; i++) {\n var _ret = _loop(i);\n\n if (_ret === "continue") continue;\n }\n\n return createdDocument.body.innerHTML;\n }\n\n /**\n * Constants\n */\n\n var NAME$4 = \'tooltip\';\n var VERSION$4 = \'4.6.2\';\n var DATA_KEY$4 = \'bs.tooltip\';\n var EVENT_KEY$4 = "." + DATA_KEY$4;\n var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4];\n var CLASS_PREFIX$1 = \'bs-tooltip\';\n var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\\\s)" + CLASS_PREFIX$1 + "\\\\S+", \'g\');\n var DISALLOWED_ATTRIBUTES = [\'sanitize\', \'whiteList\', \'sanitizeFn\'];\n var CLASS_NAME_FADE$3 = \'fade\';\n var CLASS_NAME_SHOW$3 = \'show\';\n var HOVER_STATE_SHOW = \'show\';\n var HOVER_STATE_OUT = \'out\';\n var SELECTOR_TOOLTIP_INNER = \'.tooltip-inner\';\n var SELECTOR_ARROW = \'.arrow\';\n var TRIGGER_HOVER = \'hover\';\n var TRIGGER_FOCUS = \'focus\';\n var TRIGGER_CLICK = \'click\';\n var TRIGGER_MANUAL = \'manual\';\n var AttachmentMap = {\n AUTO: \'auto\',\n TOP: \'top\',\n RIGHT: \'right\',\n BOTTOM: \'bottom\',\n LEFT: \'left\'\n };\n var Default$3 = {\n animation: true,\n template: \'<div class="tooltip" role="tooltip">\' + \'<div class="arrow"></div>\' + \'<div class="tooltip-inner"></div></div>\',\n trigger: \'hover focus\',\n title: \'\',\n delay: 0,\n html: false,\n selector: false,\n placement: \'top\',\n offset: 0,\n container: false,\n fallbackPlacement: \'flip\',\n boundary: \'scrollParent\',\n customClass: \'\',\n sanitize: true,\n sanitizeFn: null,\n whiteList: DefaultWhitelist,\n popperConfig: null\n };\n var DefaultType$3 = {\n animation: \'boolean\',\n template: \'string\',\n title: \'(string|element|function)\',\n trigger: \'string\',\n delay: \'(number|object)\',\n html: \'boolean\',\n selector: \'(string|boolean)\',\n placement: \'(string|function)\',\n offset: \'(number|string|function)\',\n container: \'(string|element|boolean)\',\n fallbackPlacement: \'(string|array)\',\n boundary: \'(string|element)\',\n customClass: \'(string|function)\',\n sanitize: \'boolean\',\n sanitizeFn: \'(null|function)\',\n whiteList: \'object\',\n popperConfig: \'(null|object)\'\n };\n var Event$1 = {\n HIDE: "hide" + EVENT_KEY$4,\n HIDDEN: "hidden" + EVENT_KEY$4,\n SHOW: "show" + EVENT_KEY$4,\n SHOWN: "shown" + EVENT_KEY$4,\n INSERTED: "inserted" + EVENT_KEY$4,\n CLICK: "click" + EVENT_KEY$4,\n FOCUSIN: "focusin" + EVENT_KEY$4,\n FOCUSOUT: "focusout" + EVENT_KEY$4,\n MOUSEENTER: "mouseenter" + EVENT_KEY$4,\n MOUSELEAVE: "mouseleave" + EVENT_KEY$4\n };\n /**\n * Class definition\n */\n\n var Tooltip = /*#__PURE__*/function () {\n function Tooltip(element, config) {\n if (typeof Popper__default["default"] === \'undefined\') {\n throw new TypeError(\'Bootstrap\\\'s tooltips require Popper (https://popper.js.org)\');\n } // Private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = \'\';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $__default["default"](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default["default"](event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $__default["default"].removeData(this.element, this.constructor.DATA_KEY);\n $__default["default"](this.element).off(this.constructor.EVENT_KEY);\n $__default["default"](this.element).closest(\'.modal\').off(\'hide.bs.modal\', this._hideModalHandler);\n\n if (this.tip) {\n $__default["default"](this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($__default["default"](this.element).css(\'display\') === \'none\') {\n throw new Error(\'Please use show on visible elements\');\n }\n\n var showEvent = $__default["default"].Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $__default["default"](this.element).trigger(showEvent);\n var shadowRoot = Util.findShadowRoot(this.element);\n var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute(\'id\', tipId);\n this.element.setAttribute(\'aria-describedby\', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $__default["default"](tip).addClass(CLASS_NAME_FADE$3);\n }\n\n var placement = typeof this.config.placement === \'function\' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n\n var container = this._getContainer();\n\n $__default["default"](tip).data(this.constructor.DATA_KEY, this);\n\n if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) {\n $__default["default"](tip).appendTo(container);\n }\n\n $__default["default"](this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment));\n $__default["default"](tip).addClass(CLASS_NAME_SHOW$3);\n $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body\'s immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if (\'ontouchstart\' in document.documentElement) {\n $__default["default"](document.body).children().on(\'mouseover\', null, $__default["default"].noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HOVER_STATE_OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute(\'aria-describedby\');\n\n $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $__default["default"](this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if (\'ontouchstart\' in document.documentElement) {\n $__default["default"](document.body).children().off(\'mouseover\', null, $__default["default"].noop);\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n\n if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = \'\';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Protected\n ;\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $__default["default"](this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var tip = this.getTipElement();\n this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());\n $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n if (typeof content === \'object\' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$__default["default"](content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($__default["default"](content).text());\n }\n\n return;\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);\n }\n\n $element.html(content);\n } else {\n $element.text(content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute(\'data-original-title\');\n\n if (!title) {\n title = typeof this.config.title === \'function\' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n } // Private\n ;\n\n _proto._getPopperConfig = function _getPopperConfig(attachment) {\n var _this3 = this;\n\n var defaultBsConfig = {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: SELECTOR_ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this3._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n return _this3._handlePopperPlacementChange(data);\n }\n };\n return _extends({}, defaultBsConfig, this.config.popperConfig);\n };\n\n _proto._getOffset = function _getOffset() {\n var _this4 = this;\n\n var offset = {};\n\n if (typeof this.config.offset === \'function\') {\n offset.fn = function (data) {\n data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element));\n return data;\n };\n } else {\n offset.offset = this.config.offset;\n }\n\n return offset;\n };\n\n _proto._getContainer = function _getContainer() {\n if (this.config.container === false) {\n return document.body;\n }\n\n if (Util.isElement(this.config.container)) {\n return $__default["default"](this.config.container);\n }\n\n return $__default["default"](document).find(this.config.container);\n };\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this5 = this;\n\n var triggers = this.config.trigger.split(\' \');\n triggers.forEach(function (trigger) {\n if (trigger === \'click\') {\n $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {\n return _this5.toggle(event);\n });\n } else if (trigger !== TRIGGER_MANUAL) {\n var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;\n var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;\n $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) {\n return _this5._enter(event);\n }).on(eventOut, _this5.config.selector, function (event) {\n return _this5._leave(event);\n });\n }\n });\n\n this._hideModalHandler = function () {\n if (_this5.element) {\n _this5.hide();\n }\n };\n\n $__default["default"](this.element).closest(\'.modal\').on(\'hide.bs.modal\', this._hideModalHandler);\n\n if (this.config.selector) {\n this.config = _extends({}, this.config, {\n trigger: \'manual\',\n selector: \'\'\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute(\'data-original-title\');\n\n if (this.element.getAttribute(\'title\') || titleType !== \'string\') {\n this.element.setAttribute(\'data-original-title\', this.element.getAttribute(\'title\') || \'\');\n this.element.setAttribute(\'title\', \'\');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $__default["default"](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default["default"](event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === \'focusin\' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n }\n\n if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {\n context._hoverState = HOVER_STATE_SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HOVER_STATE_SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $__default["default"](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default["default"](event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === \'focusout\' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HOVER_STATE_OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n var dataAttributes = $__default["default"](this.element).data();\n Object.keys(dataAttributes).forEach(function (dataAttr) {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr];\n }\n });\n config = _extends({}, this.constructor.Default, dataAttributes, typeof config === \'object\' && config ? config : {});\n\n if (typeof config.delay === \'number\') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === \'number\') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === \'number\') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);\n }\n\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $__default["default"](this.getTipElement());\n var tabClass = $tip.attr(\'class\').match(BSCLS_PREFIX_REGEX$1);\n\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(\'\'));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {\n this.tip = popperData.instance.popper;\n\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(popperData.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute(\'x-placement\') !== null) {\n return;\n }\n\n $__default["default"](tip).removeClass(CLASS_NAME_FADE$3);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n } // Static\n ;\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default["default"](this);\n var data = $element.data(DATA_KEY$4);\n\n var _config = typeof config === \'object\' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $element.data(DATA_KEY$4, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$4;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$3;\n }\n }, {\n key: "NAME",\n get: function get() {\n return NAME$4;\n }\n }, {\n key: "DATA_KEY",\n get: function get() {\n return DATA_KEY$4;\n }\n }, {\n key: "Event",\n get: function get() {\n return Event$1;\n }\n }, {\n key: "EVENT_KEY",\n get: function get() {\n return EVENT_KEY$4;\n }\n }, {\n key: "DefaultType",\n get: function get() {\n return DefaultType$3;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * jQuery\n */\n\n\n $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface;\n $__default["default"].fn[NAME$4].Constructor = Tooltip;\n\n $__default["default"].fn[NAME$4].noConflict = function () {\n $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4;\n return Tooltip._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$3 = \'popover\';\n var VERSION$3 = \'4.6.2\';\n var DATA_KEY$3 = \'bs.popover\';\n var EVENT_KEY$3 = "." + DATA_KEY$3;\n var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3];\n var CLASS_PREFIX = \'bs-popover\';\n var BSCLS_PREFIX_REGEX = new RegExp("(^|\\\\s)" + CLASS_PREFIX + "\\\\S+", \'g\');\n var CLASS_NAME_FADE$2 = \'fade\';\n var CLASS_NAME_SHOW$2 = \'show\';\n var SELECTOR_TITLE = \'.popover-header\';\n var SELECTOR_CONTENT = \'.popover-body\';\n\n var Default$2 = _extends({}, Tooltip.Default, {\n placement: \'right\',\n trigger: \'click\',\n content: \'\',\n template: \'<div class="popover" role="tooltip">\' + \'<div class="arrow"></div>\' + \'<h3 class="popover-header"></h3>\' + \'<div class="popover-body"></div></div>\'\n });\n\n var DefaultType$2 = _extends({}, Tooltip.DefaultType, {\n content: \'(string|element|function)\'\n });\n\n var Event = {\n HIDE: "hide" + EVENT_KEY$3,\n HIDDEN: "hidden" + EVENT_KEY$3,\n SHOW: "show" + EVENT_KEY$3,\n SHOWN: "shown" + EVENT_KEY$3,\n INSERTED: "inserted" + EVENT_KEY$3,\n CLICK: "click" + EVENT_KEY$3,\n FOCUSIN: "focusin" + EVENT_KEY$3,\n FOCUSOUT: "focusout" + EVENT_KEY$3,\n MOUSEENTER: "mouseenter" + EVENT_KEY$3,\n MOUSELEAVE: "mouseleave" + EVENT_KEY$3\n };\n /**\n * Class definition\n */\n\n var Popover = /*#__PURE__*/function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $__default["default"](this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === \'function\') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(SELECTOR_CONTENT), content);\n $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2);\n } // Private\n ;\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute(\'data-content\') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $__default["default"](this.getTipElement());\n var tabClass = $tip.attr(\'class\').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(\'\'));\n }\n } // Static\n ;\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default["default"](this).data(DATA_KEY$3);\n\n var _config = typeof config === \'object\' ? config : null;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $__default["default"](this).data(DATA_KEY$3, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: "VERSION",\n get: // Getters\n function get() {\n return VERSION$3;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$2;\n }\n }, {\n key: "NAME",\n get: function get() {\n return NAME$3;\n }\n }, {\n key: "DATA_KEY",\n get: function get() {\n return DATA_KEY$3;\n }\n }, {\n key: "Event",\n get: function get() {\n return Event;\n }\n }, {\n key: "EVENT_KEY",\n get: function get() {\n return EVENT_KEY$3;\n }\n }, {\n key: "DefaultType",\n get: function get() {\n return DefaultType$2;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * jQuery\n */\n\n\n $__default["default"].fn[NAME$3] = Popover._jQueryInterface;\n $__default["default"].fn[NAME$3].Constructor = Popover;\n\n $__default["default"].fn[NAME$3].noConflict = function () {\n $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3;\n return Popover._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$2 = \'scrollspy\';\n var VERSION$2 = \'4.6.2\';\n var DATA_KEY$2 = \'bs.scrollspy\';\n var EVENT_KEY$2 = "." + DATA_KEY$2;\n var DATA_API_KEY$1 = \'.data-api\';\n var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2];\n var CLASS_NAME_DROPDOWN_ITEM = \'dropdown-item\';\n var CLASS_NAME_ACTIVE$1 = \'active\';\n var EVENT_ACTIVATE = "activate" + EVENT_KEY$2;\n var EVENT_SCROLL = "scroll" + EVENT_KEY$2;\n var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1;\n var METHOD_OFFSET = \'offset\';\n var METHOD_POSITION = \'position\';\n var SELECTOR_DATA_SPY = \'[data-spy="scroll"]\';\n var SELECTOR_NAV_LIST_GROUP$1 = \'.nav, .list-group\';\n var SELECTOR_NAV_LINKS = \'.nav-link\';\n var SELECTOR_NAV_ITEMS = \'.nav-item\';\n var SELECTOR_LIST_ITEMS = \'.list-group-item\';\n var SELECTOR_DROPDOWN$1 = \'.dropdown\';\n var SELECTOR_DROPDOWN_ITEMS = \'.dropdown-item\';\n var SELECTOR_DROPDOWN_TOGGLE$1 = \'.dropdown-toggle\';\n var Default$1 = {\n offset: 10,\n method: \'auto\',\n target: \'\'\n };\n var DefaultType$1 = {\n offset: \'number\',\n method: \'string\',\n target: \'(string|element)\'\n };\n /**\n * Class definition\n */\n\n var ScrollSpy = /*#__PURE__*/function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === \'BODY\' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;\n var offsetMethod = this._config.method === \'auto\' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = [].slice.call(document.querySelectorAll(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = document.querySelector(targetSelector);\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(Boolean).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$2);\n $__default["default"](this._scrollElement).off(EVENT_KEY$2);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$1, typeof config === \'object\' && config ? config : {});\n\n if (typeof config.target !== \'string\' && Util.isElement(config.target)) {\n var id = $__default["default"](config.target).attr(\'id\');\n\n if (!id) {\n id = Util.getUID(NAME$2);\n $__default["default"](config.target).attr(\'id\', id);\n }\n\n config.target = "#" + id;\n }\n\n Util.typeCheckConfig(NAME$2, config, DefaultType$1);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (var i = this._offsets.length; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === \'undefined\' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(\',\').map(function (selector) {\n return selector + "[data-target=\\"" + target + "\\"]," + selector + "[href=\\"" + target + "\\"]";\n });\n\n var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(\',\'))));\n\n if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {\n $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1);\n $link.addClass(CLASS_NAME_ACTIVE$1);\n } else {\n // Set triggered link as active\n $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active\n // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor\n\n $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item\n\n $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1);\n }\n\n $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, {\n relatedTarget: target\n });\n };\n\n _proto._clear = function _clear() {\n [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {\n return node.classList.contains(CLASS_NAME_ACTIVE$1);\n }).forEach(function (node) {\n return node.classList.remove(CLASS_NAME_ACTIVE$1);\n });\n } // Static\n ;\n\n ScrollSpy._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default["default"](this).data(DATA_KEY$2);\n\n var _config = typeof config === \'object\' && config;\n\n if (!data) {\n data = new ScrollSpy(this, _config);\n $__default["default"](this).data(DATA_KEY$2, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(ScrollSpy, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$2;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default$1;\n }\n }]);\n\n return ScrollSpy;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](window).on(EVENT_LOAD_DATA_API, function () {\n var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));\n var scrollSpysLength = scrollSpys.length;\n\n for (var i = scrollSpysLength; i--;) {\n var $spy = $__default["default"](scrollSpys[i]);\n\n ScrollSpy._jQueryInterface.call($spy, $spy.data());\n }\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface;\n $__default["default"].fn[NAME$2].Constructor = ScrollSpy;\n\n $__default["default"].fn[NAME$2].noConflict = function () {\n $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2;\n return ScrollSpy._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME$1 = \'tab\';\n var VERSION$1 = \'4.6.2\';\n var DATA_KEY$1 = \'bs.tab\';\n var EVENT_KEY$1 = "." + DATA_KEY$1;\n var DATA_API_KEY = \'.data-api\';\n var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1];\n var CLASS_NAME_DROPDOWN_MENU = \'dropdown-menu\';\n var CLASS_NAME_ACTIVE = \'active\';\n var CLASS_NAME_DISABLED = \'disabled\';\n var CLASS_NAME_FADE$1 = \'fade\';\n var CLASS_NAME_SHOW$1 = \'show\';\n var EVENT_HIDE$1 = "hide" + EVENT_KEY$1;\n var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1;\n var EVENT_SHOW$1 = "show" + EVENT_KEY$1;\n var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1;\n var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY;\n var SELECTOR_DROPDOWN = \'.dropdown\';\n var SELECTOR_NAV_LIST_GROUP = \'.nav, .list-group\';\n var SELECTOR_ACTIVE = \'.active\';\n var SELECTOR_ACTIVE_UL = \'> li > .active\';\n var SELECTOR_DATA_TOGGLE = \'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]\';\n var SELECTOR_DROPDOWN_TOGGLE = \'.dropdown-toggle\';\n var SELECTOR_DROPDOWN_ACTIVE_CHILD = \'> .dropdown-menu .active\';\n /**\n * Class definition\n */\n\n var Tab = /*#__PURE__*/function () {\n function Tab(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Tab.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute(\'disabled\')) {\n return;\n }\n\n var target;\n var previous;\n var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0];\n var selector = Util.getSelectorFromElement(this._element);\n\n if (listElement) {\n var itemSelector = listElement.nodeName === \'UL\' || listElement.nodeName === \'OL\' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE;\n previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector));\n previous = previous[previous.length - 1];\n }\n\n var hideEvent = $__default["default"].Event(EVENT_HIDE$1, {\n relatedTarget: this._element\n });\n var showEvent = $__default["default"].Event(EVENT_SHOW$1, {\n relatedTarget: previous\n });\n\n if (previous) {\n $__default["default"](previous).trigger(hideEvent);\n }\n\n $__default["default"](this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n this._activate(this._element, listElement);\n\n var complete = function complete() {\n var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, {\n relatedTarget: _this._element\n });\n var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, {\n relatedTarget: previous\n });\n $__default["default"](previous).trigger(hiddenEvent);\n $__default["default"](_this._element).trigger(shownEvent);\n };\n\n if (target) {\n this._activate(target, target.parentNode, complete);\n } else {\n complete();\n }\n };\n\n _proto.dispose = function dispose() {\n $__default["default"].removeData(this._element, DATA_KEY$1);\n this._element = null;\n } // Private\n ;\n\n _proto._activate = function _activate(element, container, callback) {\n var _this2 = this;\n\n var activeElements = container && (container.nodeName === \'UL\' || container.nodeName === \'OL\') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE);\n var active = activeElements[0];\n var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1);\n\n var complete = function complete() {\n return _this2._transitionComplete(element, active, callback);\n };\n\n if (active && isTransitioning) {\n var transitionDuration = Util.getTransitionDurationFromElement(active);\n $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._transitionComplete = function _transitionComplete(element, active, callback) {\n if (active) {\n $__default["default"](active).removeClass(CLASS_NAME_ACTIVE);\n var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];\n\n if (dropdownChild) {\n $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE);\n }\n\n if (active.getAttribute(\'role\') === \'tab\') {\n active.setAttribute(\'aria-selected\', false);\n }\n }\n\n $__default["default"](element).addClass(CLASS_NAME_ACTIVE);\n\n if (element.getAttribute(\'role\') === \'tab\') {\n element.setAttribute(\'aria-selected\', true);\n }\n\n Util.reflow(element);\n\n if (element.classList.contains(CLASS_NAME_FADE$1)) {\n element.classList.add(CLASS_NAME_SHOW$1);\n }\n\n var parent = element.parentNode;\n\n if (parent && parent.nodeName === \'LI\') {\n parent = parent.parentNode;\n }\n\n if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) {\n var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0];\n\n if (dropdownElement) {\n var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE));\n $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE);\n }\n\n element.setAttribute(\'aria-expanded\', true);\n }\n\n if (callback) {\n callback();\n }\n } // Static\n ;\n\n Tab._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $this = $__default["default"](this);\n var data = $this.data(DATA_KEY$1);\n\n if (!data) {\n data = new Tab(this);\n $this.data(DATA_KEY$1, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tab, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION$1;\n }\n }]);\n\n return Tab;\n }();\n /**\n * Data API implementation\n */\n\n\n $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault();\n\n Tab._jQueryInterface.call($__default["default"](this), \'show\');\n });\n /**\n * jQuery\n */\n\n $__default["default"].fn[NAME$1] = Tab._jQueryInterface;\n $__default["default"].fn[NAME$1].Constructor = Tab;\n\n $__default["default"].fn[NAME$1].noConflict = function () {\n $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1;\n return Tab._jQueryInterface;\n };\n\n /**\n * Constants\n */\n\n var NAME = \'toast\';\n var VERSION = \'4.6.2\';\n var DATA_KEY = \'bs.toast\';\n var EVENT_KEY = "." + DATA_KEY;\n var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME];\n var CLASS_NAME_FADE = \'fade\';\n var CLASS_NAME_HIDE = \'hide\';\n var CLASS_NAME_SHOW = \'show\';\n var CLASS_NAME_SHOWING = \'showing\';\n var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;\n var EVENT_HIDE = "hide" + EVENT_KEY;\n var EVENT_HIDDEN = "hidden" + EVENT_KEY;\n var EVENT_SHOW = "show" + EVENT_KEY;\n var EVENT_SHOWN = "shown" + EVENT_KEY;\n var SELECTOR_DATA_DISMISS = \'[data-dismiss="toast"]\';\n var Default = {\n animation: true,\n autohide: true,\n delay: 500\n };\n var DefaultType = {\n animation: \'boolean\',\n autohide: \'boolean\',\n delay: \'number\'\n };\n /**\n * Class definition\n */\n\n var Toast = /*#__PURE__*/function () {\n function Toast(element, config) {\n this._element = element;\n this._config = this._getConfig(config);\n this._timeout = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Toast.prototype;\n\n // Public\n _proto.show = function show() {\n var _this = this;\n\n var showEvent = $__default["default"].Event(EVENT_SHOW);\n $__default["default"](this._element).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._clearTimeout();\n\n if (this._config.animation) {\n this._element.classList.add(CLASS_NAME_FADE);\n }\n\n var complete = function complete() {\n _this._element.classList.remove(CLASS_NAME_SHOWING);\n\n _this._element.classList.add(CLASS_NAME_SHOW);\n\n $__default["default"](_this._element).trigger(EVENT_SHOWN);\n\n if (_this._config.autohide) {\n _this._timeout = setTimeout(function () {\n _this.hide();\n }, _this._config.delay);\n }\n };\n\n this._element.classList.remove(CLASS_NAME_HIDE);\n\n Util.reflow(this._element);\n\n this._element.classList.add(CLASS_NAME_SHOWING);\n\n if (this._config.animation) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto.hide = function hide() {\n if (!this._element.classList.contains(CLASS_NAME_SHOW)) {\n return;\n }\n\n var hideEvent = $__default["default"].Event(EVENT_HIDE);\n $__default["default"](this._element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._close();\n };\n\n _proto.dispose = function dispose() {\n this._clearTimeout();\n\n if (this._element.classList.contains(CLASS_NAME_SHOW)) {\n this._element.classList.remove(CLASS_NAME_SHOW);\n }\n\n $__default["default"](this._element).off(EVENT_CLICK_DISMISS);\n $__default["default"].removeData(this._element, DATA_KEY);\n this._element = null;\n this._config = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === \'object\' && config ? config : {});\n Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._setListeners = function _setListeners() {\n var _this2 = this;\n\n $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () {\n return _this2.hide();\n });\n };\n\n _proto._close = function _close() {\n var _this3 = this;\n\n var complete = function complete() {\n _this3._element.classList.add(CLASS_NAME_HIDE);\n\n $__default["default"](_this3._element).trigger(EVENT_HIDDEN);\n };\n\n this._element.classList.remove(CLASS_NAME_SHOW);\n\n if (this._config.animation) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n };\n\n _proto._clearTimeout = function _clearTimeout() {\n clearTimeout(this._timeout);\n this._timeout = null;\n } // Static\n ;\n\n Toast._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default["default"](this);\n var data = $element.data(DATA_KEY);\n\n var _config = typeof config === \'object\' && config;\n\n if (!data) {\n data = new Toast(this, _config);\n $element.data(DATA_KEY, data);\n }\n\n if (typeof config === \'string\') {\n if (typeof data[config] === \'undefined\') {\n throw new TypeError("No method named \\"" + config + "\\"");\n }\n\n data[config](this);\n }\n });\n };\n\n _createClass(Toast, null, [{\n key: "VERSION",\n get: function get() {\n return VERSION;\n }\n }, {\n key: "DefaultType",\n get: function get() {\n return DefaultType;\n }\n }, {\n key: "Default",\n get: function get() {\n return Default;\n }\n }]);\n\n return Toast;\n }();\n /**\n * jQuery\n */\n\n\n $__default["default"].fn[NAME] = Toast._jQueryInterface;\n $__default["default"].fn[NAME].Constructor = Toast;\n\n $__default["default"].fn[NAME].noConflict = function () {\n $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT;\n return Toast._jQueryInterface;\n };\n\n exports.Alert = Alert;\n exports.Button = Button;\n exports.Carousel = Carousel;\n exports.Collapse = Collapse;\n exports.Dropdown = Dropdown;\n exports.Modal = Modal;\n exports.Popover = Popover;\n exports.Scrollspy = ScrollSpy;\n exports.Tab = Tab;\n exports.Toast = Toast;\n exports.Tooltip = Tooltip;\n exports.Util = Util;\n\n Object.defineProperty(exports, \'__esModule\', { value: true });\n\n}));\n//# sourceMappingURL=bootstrap.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzczNC5qcyIsIm1hcHB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hKERBVEFfS0VZJDcpO1xuXG4gICAgICAgIHZhciBfY29uZmlnID0gX2V4dGVuZHMoe30sIERlZmF1bHQkNiwgJGVsZW1lbnQuZGF0YSgpLCB0eXBlb2YgY29uZmlnID09PSAnb2JqZWN0JyAmJiBjb25maWcgPyBjb25maWcgOiB7fSk7XG5cbiAgICAgICAgaWYgKCFkYXRhICYmIF9jb25maWcudG9nZ2xlICYmIHR5cGVvZiBjb25maWcgPT09ICdzdHJpbmcnICYmIC9zaG93fGhpZGUvLnRlc3QoY29uZmlnKSkge1xuICAgICAgICAgIF9jb25maWcudG9nZ2xlID0gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoIWRhdGEpIHtcbiAgICAgICAgICBkYXRhID0gbmV3IENvbGxhcHNlKHRoaXMsIF9jb25maWcpO1xuICAgICAgICAgICRlbGVtZW50LmRhdGEoREFUQV9LRVkkNywgZGF0YSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodHlwZW9mIGNvbmZpZyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICBpZiAodHlwZW9mIGRhdGFbY29uZmlnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJObyBtZXRob2QgbmFtZWQgXFxcIlwiICsgY29uZmlnICsgXCJcXFwiXCIpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGRhdGFbY29uZmlnXSgpO1xuICAgICAgICB9XG4gICAgICB9KTtcbiAgICB9O1xuXG4gICAgX2NyZWF0ZUNsYXNzKENvbGxhcHNlLCBudWxsLCBbe1xuICAgICAga2V5OiBcIlZFUlNJT05cIixcbiAgICAgIGdldDogZnVuY3Rpb24gZ2V0KCkge1xuICAgICAgICByZXR1cm4gVkVSU0lPTiQ3O1xuICAgICAgfVxuICAgIH0sIHtcbiAgICAgIGtleTogXCJEZWZhdWx0XCIsXG4gICAgICBnZXQ6IGZ1bmN0aW9uIGdldCgpIHtcb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cHBlbmQoY29udGVudCk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICRlbGVtZW50LnRleHQoJF9fZGVmYXVsdFtcImRlZmF1bHRcIl0oY29udGVudCkudGV4dCgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgaWYgKHRoaXMuY29uZmlnLmh0bWwpIHtcbiAgICAgICAgaWYgKHRoaXMuY29uZmlnLnNhbml0aXplKSB7XG4gICAgICAgICAgY29udGVudCA9IHNhbml0aXplSHRtbChjb250ZW50LCB0aGlzLmNvbmZpZy53aGl0ZUxpc3QsIHRoaXMuY29uZmlnLnNhbml0aXplRm4pO1xuICAgICAgICB9XG5cbiAgICAgICAgJGVsZW1lbnQuaHRtbChjb250ZW50KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgICRlbGVtZW50LnRleHQoY29udGVudCk7XG4gICAgICB9XG4gICAgfTtcblxuICAgIF9wcm90by5nZXRUaXRsZSA9IGZ1bmN0aW9uIGdldFRpdGxlKCkge1xuICAgICAgdmFyIHRpdGxlID0gdGhpcy5lbGVtZW50LmdldEF0dHJpYnV0ZSgnZGF0YS1vcmlnaW5hbC10aXRsZScpO1xuXG4gICAgICBpZiAoIXRpdGxlKSB7XG4gICAgICAgIHRpdGxlID0gdHlwZW9mIHRoaXMuY29uZmlnLnRpdGxlID09PSAnZnVuY3Rpb24nID8gdGhpcy5jb25maWcudGl0bGUuY2FsbCh0aGlzLmVsZW1lbnQpIDogdGhpcy5jb25maWcudGl0bGU7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aXRsZTtcbiAgICB9IC8vIFByaXZhdGVcbiAgICA7XG5cbiAgICBfcHJvdG8uX2dldFBvcHBlckNvbmZpZyA9IGZ1bmN0aW9uIF9nZXRQb3BwZXJDb25maWcoYXR0YWNobWVudCkge1xuICAgICAgdmFyIF90aGlzMyA9IHRoaXM7XG5cbiAgICAgIHZhciBkZWZhdWx0QnNDb25maWcgPSB7XG4gICAgICAgIHBsYWNlbWVudDogYXR0YWNobWVudCxcbiAgICAgICAgbW9kaWZpZXJzOiB7XG4gICAgICAgICAgb2Zmc2V0OiB0aGlzLl9nZXRPZmZzZXQoKSxcbiAgICAgICAgICBmbGlwOiB7XG4gICAgICAgICAgICBiZWhhdmlvcjogdGhpcy5jb25maWcuZmFsbGJhY2tQbGFjZW1lbnRcbiAgICAgICAgICB9LFxuICAgICAgICAgIGFycm93OiB7XG4gICAgICAgICAgICBlbGVtZW50OiBTRUxFQ1RPUl9BUlJPV1xuICAgICAgICAgIH0sXG4gICAgICAgICAgcHJldmVudE92ZXJmbG93OiB7XG4gICAgICAgICAgICBib3VuZGFyaWVzRWxlbWVudDogdGhpcy5jb25maWcuYm91bmRhcnlcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG9uQ3JlYXRlOiBmdW5jdGlvbiBvbkNyZWF0ZShkYXRhKSB7XG4gICAgICAgICAgaWYgKGRhdGEub3JpZ2luYWxQbGFjZW1lbnQgIT09IGRhdGEucGxhY2VtZW50KSB7XG4gICAgICAgICAgICBfdGhpczMuX2hhbmRsZVBvcHBlclBsYWNlbWVudENoYW5nZShkYXRhKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG9uVXBkYXRlOiBmdW5jdGlvbiBvblVwZGF0ZShkYXRhKSB7XG4gICAgICAgICAgcmV0dXJuIF90aGlzMy5faGFuZGxlUG9wcGVyUGxhY2VtZW50Q2hhbmdlKGRhdGEpO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgICAgcmV0dXJuIF9leHRlbmRzKHt9LCBkZWZhdWx0QnNDb25maWcsIHRoaXMuY29uZmlnLnBvcHBlckNvbmZpZyk7XG4gICAgfTtcblxuICAgIF9wcm90by5fZ2V0T2Zmc2V0ID0gZnVuY3Rpb24gX2dldE9mZnNldCgpIHtcbiAgICAgIHZhciBfdGhpczQgPSB0aGlzO1xuXG4gICAgICB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mdW5jdGlvbiAoKSB7XG4gICAgJF9fZGVmYXVsdFtcImRlZmF1bHRcIl0uZm5bTkFNRV0gPSBKUVVFUllfTk9fQ09ORkxJQ1Q7XG4gICAgcmV0dXJuIFRvYXN0Ll9qUXVlcnlJbnRlcmZhY2U7XG4gIH07XG5cbiAgZXhwb3J0cy5BbGVydCA9IEFsZXJ0O1xuICBleHBvcnRzLkJ1dHRvbiA9IEJ1dHRvbjtcbiAgZXhwb3J0cy5DYXJvdXNlbCA9IENhcm91c2VsO1xuICBleHBvcnRzLkNvbGxhcHNlID0gQ29sbGFwc2U7XG4gIGV4cG9ydHMuRHJvcGRvd24gPSBEcm9wZG93bjtcbiAgZXhwb3J0cy5Nb2RhbCA9IE1vZGFsO1xuICBleHBvcnRzLlBvcG92ZXIgPSBQb3BvdmVyO1xuICBleHBvcnRzLlNjcm9sbHNweSA9IFNjcm9sbFNweTtcbiAgZXhwb3J0cy5UYWIgPSBUYWI7XG4gIGV4cG9ydHMuVG9hc3QgPSBUb2FzdDtcbiAgZXhwb3J0cy5Ub29sdGlwID0gVG9vbHRpcDtcbiAgZXhwb3J0cy5VdGlsID0gVXRpbDtcblxuICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywgJ19fZXNNb2R1bGUnLCB7IHZhbHVlOiB0cnVlIH0pO1xuXG59KSk7XG4vLyMgc291cmNlTWFwcGluZ1VSTD1ib290c3RyYXAuanMubWFwXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3734\n')},9180:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(9829)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code])?$/;\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var regExp = /(.+?)(?::(\\d+))?(?::(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[()]/g, ''));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^()]*)|(\\),.*$)/g, '');\n }\n var sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', '<anonymous>'].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return filtered.map(function(line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval:\\d+:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, ''));\n\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split('\\n').filter(function(line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n\n return filtered.map(function(line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(/<anonymous function(: (\\w+))?>/, '$2')\n .replace(/\\([^)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^(]+\\(([^)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?\n undefined : argsRaw.split(',');\n\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTE4MC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxRQUFRLElBQTBDO0FBQ2xELFFBQVEsaUNBQTZCLENBQUMseUJBQVksQ0FBQyxvQ0FBRSxPQUFPO0FBQUE7QUFBQTtBQUFBLGtHQUFDO0FBQzdELE1BQU0sS0FBSyxFQUlOO0FBQ0wsQ0FBQztBQUNEOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLG1CQUFtQixPQUFPO0FBQzFCLG9CQUFvQixPQUFPO0FBQzNCO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsY0FBYztBQUNkO0FBQ0EsY0FBYztBQUNkO0FBQ0EsY0FBYztBQUNkO0FBQ0E7QUFDQSxTQUFTOztBQUVUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxTQUFTOztBQUVUO0FBQ0E7QUFDQTtBQUNBLGFBQWE7O0FBRWI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsaUJBQWlCO0FBQ2pCLGFBQWE7QUFDYixTQUFTOztBQUVUO0FBQ0E7QUFDQTtBQUNBLGFBQWE7O0FBRWI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLHFCQU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GJ1dCByZXR1cm4gbG9jYXRpb25zIGxpa2UgXCIobmF0aXZlKVwiXG4gICAgICAgICAgICBpZiAodXJsTGlrZS5pbmRleE9mKCc6JykgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFt1cmxMaWtlXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHJlZ0V4cCA9IC8oLis/KSg/OjooXFxkKykpPyg/OjooXFxkKykpPyQvO1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gcmVnRXhwLmV4ZWModXJsTGlrZS5yZXBsYWNlKC9bKCldL2csICcnKSk7XG4gICAgICAgICAgICByZXR1cm4gW3BhcnRzWzFdLCBwYXJ0c1syXSB8fCB1bmRlZmluZWQsIHBhcnRzWzNdIHx8IHVuZGVmaW5lZF07XG4gICAgICAgIH0sXG5cbiAgICAgICAgcGFyc2VWOE9ySUU6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlVjhPcklFKGVycm9yKSB7XG4gICAgICAgICAgICB2YXIgZmlsdGVyZWQgPSBlcnJvci5zdGFjay5zcGxpdCgnXFxuJykuZmlsdGVyKGZ1bmN0aW9uKGxpbmUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gISFsaW5lLm1hdGNoKENIUk9NRV9JRV9TVEFDS19SRUdFWFApO1xuICAgICAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgICAgIHJldHVybiBmaWx0ZXJlZC5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIGlmIChsaW5lLmluZGV4T2YoJyhldmFsICcpID4gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhyb3cgYXdheSBldmFsIGluZm9ybWF0aW9uIHVudGlsIHdlIGltcGxlbWVudCBzdGFja3RyYWNlLmpzL3N0YWNrZnJhbWUjOFxuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5yZXBsYWNlKC9ldmFsIGNvZGUvZywgJ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V4dHJhY3RMb2NhdGlvbihsb2NhdGlvbiA/IGxvY2F0aW9uWzFdIDogdG9rZW5zLnBvcCgpKTtcbiAgICAgICAgICAgICAgICB2YXIgZnVuY3Rpb25OYW1lID0gdG9rZW5zLmpvaW4oJyAnKSB8fCB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgdmFyIGZpbGVOYW1lID0gWydldmFsJywgJzxhbm9ueW1vdXM+J10uaW5kZXhPZihsb2NhdGlvblBhcnRzWzBdKSA+IC0xID8gdW5kZWZpbmVkIDogbG9jYXRpb25QYXJ0c1swXTtcblxuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uTmFtZTogZnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogZmlsZU5hbWUsXG4gICAgICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxvY2F0aW9uUGFydHNbMV0sXG4gICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogbG9jYXRpb25QYXJ0c1syXSxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlOiBsaW5lXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZUZGT3JTYWZhcmk6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlRkZPclNhZmFyaShlcnJvcikge1xuICAgICAgICAgICAgdmFyIGZpbHRlcmVkID0gZXJyb3Iuc3RhY2suc3BsaXQoJ1xcbicpLmZpbHRlcihmdW5jdGlvbihsaW5lKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuICFsaW5lLm1hdGNoKFNBRkFSSV9OQVRJVkVfQ09ERV9SRUdFWFApO1xuICAgICAgICAgICAgfSwgdGhpcyk7XG5cbiAgICAgICAgICAgIHJldHVybiBmaWx0ZXJlZC5tYXAoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIC8vIFRocm93IGF3YXkgZXZhbCBpbmZvcm1hdGlvbiB1bnRpbCB3ZSBpbXBsZW1lbnQgc3RhY2t0cmFjZS5qcy9zdGFja2ZyYW1lIzhcbiAgICAgICAgICAgICAgICBpZiAobGluZS5pbmRleE9mKCcgPiBldmFsJykgPiAtMSkge1xuICAgICAgICAgICAgICAgICAgICBsaW5lID0gbGluZS5yZXBsYWNlKC8gbGluZSAoXFxkKykoPzogPiBldmFsIGxpbmUgXFxkKykqID4gZXZhbDpcXGQrOlxcZCsvZywgJzokMScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGlmIChsaW5lLmluZGV4T2YoJ0AnKSA9PT0gLTEgJiYgbGluZS5pbmRleE9mKCc6JykgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIFNhZmFyaSBldmFsIGZyYW1lcyBvbmx5IGhhdmUgZnVuY3Rpb24gbmFtZXMgYW5kIG5vdGhpbmcgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0YWNrRnJhbWUoe1xuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb25OYW1lOiBsaW5lXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBmdW5jdGlvbk5hbWVSZWdleCA9IC8oKC4qXCIuK1wiW15AXSopP1teQF0qKSg/OkApLztcbiAgICAgICAgICAgICAgICAgICAgdmFyIG1hdGNoZXMgPSBsaW5lLm1hdGNoKGZ1bmN0aW9uTmFtZVJlZ2V4KTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZ1bmN0aW9uTmFtZSA9IG1hdGNoZXMgJiYgbWF0Y2hlc1sxXSA/IG1hdGNoZXNbMV0gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIHZhciBsb2NhdGlvblBhcnRzID0gdGhpcy5leHRyYWN0TG9jYXRpb24obGluZS5yZXBsYWNlKGZ1bmN0aW9uTmFtZVJlZ2V4LCAnJykpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lOiBsb2NhdGlvblBhcnRzWzBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZU51bWJlcjogbG9jYXRpb25QYXJ0c1sxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogbG9jYXRpb25QYXJ0c1syXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogbGluZVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZU9wZXJhOiBmdW5jdGlvbiBFcnJvclN0YWNrUGFyc2VyJCRwYXJzZU9wZXJhKGUpIHtcbiAgICAgICAgICAgIGlmICghZS5zdGFja3RyYWNlIHx8IChlLm1lc3NhZ2UuaW5kZXhPZignXFxuJykgPiAtMSAmJlxuICAgICAgICAgICAgICAgIGUubWVzc2FnZS5zcGxpdCgnXFxuJykubGVuZ3RoID4gZS5zdGFja3RyYWNlLnNwbGl0KCdcXG4nKS5sZW5ndGgpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcGVyYTkoZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFlLnN0YWNrKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcGVyYTEwKGUpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9wZXJhMTEoZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgcGFyc2VPcGVyYTk6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlT3BlcmE5KGUpIHtcbiAgICAgICAgICAgIHZhciBsaW5lUkUgPSAvTGluZSAoXFxkKykuKnNjcmlwdCAoPzppbiApPyhcXFMrKS9pO1xuICAgICAgICAgICAgdmFyIGxpbmVzID0gZS5tZXNzYWdlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDIsIGxlbiA9IGxpbmVzLmxlbmd0aDsgaSA8IGxlbjsgaSArPSAyKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gbGluZVJFLmV4ZWMobGluZXNbaV0pO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbWF0Y2hbMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBtYXRjaFsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogbGluZXNbaV1cbiAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgfSxcblxuICAgICAgICBwYXJzZU9wZXJhMTA6IGZ1bmN0aW9uIEVycm9yU3RhY2tQYXJzZXIkJHBhcnNlT3BlcmExMChlKSB7XG4gICAgICAgICAgICB2YXIgbGluZVJFID0gL0xpbmUgKFxcZCspLipzY3JpcHQgKD86aW4gKT8oXFxTKykoPzo6IEluIGZ1bmN0aW9uIChcXFMrKSk/JC9pO1xuICAgICAgICAgICAgdmFyIGxpbmVzID0gZS5zdGFja3RyYWNlLnNwbGl0KCdcXG4nKTtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGxlbiA9IGxpbmVzLmxlbmd0aDsgaSA8IGxlbjsgaSArPSAyKSB7XG4gICAgICAgICAgICAgICAgdmFyIG1hdGNoID0gbGluZVJFLmV4ZWMobGluZXNbaV0pO1xuICAgICAgICAgICAgICAgIGlmIChtYXRjaCkge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBTdGFja0ZyYW1lKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IG1hdGNoWzNdIHx8IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbWF0Y2hbMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZU51bWJlcjogbWF0Y2hbMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlOiBsaW5lc1tpXVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLy8gT3BlcmEgMTAuNjUrIEVycm9yLnN0YWNrIHZlcnkgc2ltaWxhciB0byBGRi9TYWZhcmlcbiAgICAgICAgcGFyc2VPcGVyYTExOiBmdW5jdGlvbiBFcnJvclN0YWNrUGFyc2VyJCRwYXJzZU9wZXJhMTEoZXJyb3IpIHtcbiAgICAgICAgICAgIHZhciBmaWx0ZXJlZCA9IGVycm9yLnN0YWNrLnNwbGl0KCdcXG4nKS5maWx0ZXIoZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiAhIWxpbmUubW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wbGl0KCcsJyk7XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFN0YWNrRnJhbWUoe1xuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbk5hbWU6IGZ1bmN0aW9uTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgYXJnczogYXJncyxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWU6IGxvY2F0aW9uUGFydHNbMF0sXG4gICAgICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxvY2F0aW9uUGFydHNbMV0sXG4gICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogbG9jYXRpb25QYXJ0c1syXSxcbiAgICAgICAgICAgICAgICAgICAgc291cmNlOiBsaW5lXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCB0aGlzKTtcbiAgICAgICAgfVxuICAgIH07XG59KSk7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9180\n")},1120:function(module){eval("/*!\n * html2canvas 1.4.1 <https://html2canvas.hertzen.com>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n}(this, (function () { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\r\n\r\n function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n }\r\n\r\n function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n }\r\n\r\n function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n }\n\n var Bounds = /** @class */ (function () {\n function Bounds(left, top, width, height) {\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n }\n Bounds.prototype.add = function (x, y, w, h) {\n return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);\n };\n Bounds.fromClientRect = function (context, clientRect) {\n return new Bounds(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);\n };\n Bounds.fromDOMRectList = function (context, domRectList) {\n var domRect = Array.from(domRectList).find(function (rect) { return rect.width !== 0; });\n return domRect\n ? new Bounds(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height)\n : Bounds.EMPTY;\n };\n Bounds.EMPTY = new Bounds(0, 0, 0, 0);\n return Bounds;\n }());\n var parseBounds = function (context, node) {\n return Bounds.fromClientRect(context, node.getBoundingClientRect());\n };\n var parseDocumentSize = function (document) {\n var body = document.body;\n var documentElement = document.documentElement;\n if (!body || !documentElement) {\n throw new Error(\"Unable to get document size\");\n }\n var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));\n var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));\n return new Bounds(0, 0, width, height);\n };\n\n /*\n * css-line-break 2.1.0 <https://github.com/niklasvh/css-line-break#readme>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var toCodePoints$1 = function (str) {\n var codePoints = [];\n var i = 0;\n var length = str.length;\n while (i < length) {\n var value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n var extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n }\n else {\n codePoints.push(value);\n i--;\n }\n }\n else {\n codePoints.push(value);\n }\n }\n return codePoints;\n };\n var fromCodePoint$1 = function () {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n if (String.fromCodePoint) {\n return String.fromCodePoint.apply(String, codePoints);\n }\n var length = codePoints.length;\n if (!length) {\n return '';\n }\n var codeUnits = [];\n var index = -1;\n var result = '';\n while (++index < length) {\n var codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n }\n else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode.apply(String, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n var chars$2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup$2 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i$2 = 0; i$2 < chars$2.length; i$2++) {\n lookup$2[chars$2.charCodeAt(i$2)] = i$2;\n }\n\n /*\n * utrie 1.0.2 <https://github.com/niklasvh/utrie>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var chars$1$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup$1$1 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) {\n lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1;\n }\n var decode$1 = function (base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var buffer = typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup$1$1[base64.charCodeAt(i)];\n encoded2 = lookup$1$1[base64.charCodeAt(i + 1)];\n encoded3 = lookup$1$1[base64.charCodeAt(i + 2)];\n encoded4 = lookup$1$1[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return buffer;\n };\n var polyUint16Array$1 = function (buffer) {\n var length = buffer.length;\n var bytes = [];\n for (var i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n };\n var polyUint32Array$1 = function (buffer) {\n var length = buffer.length;\n var bytes = [];\n for (var i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n };\n\n /** Shift size for getting the index-2 table offset. */\n var UTRIE2_SHIFT_2$1 = 5;\n /** Shift size for getting the index-1 table offset. */\n var UTRIE2_SHIFT_1$1 = 6 + 5;\n /**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\n var UTRIE2_INDEX_SHIFT$1 = 2;\n /**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\n var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1;\n /**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\n var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 0x10000 >> UTRIE2_SHIFT_2$1;\n /** Number of entries in a data block. 32=0x20 */\n var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1;\n /** Mask for getting the lower bits for the in-data-block offset. */\n var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1;\n var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 0x400 >> UTRIE2_SHIFT_2$1;\n /** Count the lengths of both BMP pieces. 2080=0x820 */\n var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1;\n /**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\n var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1;\n var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n /**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\n var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1;\n /**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\n var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 0x10000 >> UTRIE2_SHIFT_1$1;\n /** Number of entries in an index-2 block. 64=0x40 */\n var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1;\n /** Mask for getting the lower bits for the in-index-2-block offset. */\n var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1;\n var slice16$1 = function (view, start, end) {\n if (view.slice) {\n return view.slice(start, end);\n }\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n };\n var slice32$1 = function (view, start, end) {\n if (view.slice) {\n return view.slice(start, end);\n }\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n };\n var createTrieFromBase64$1 = function (base64, _byteLength) {\n var buffer = decode$1(base64);\n var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer);\n var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer);\n var headerLength = 24;\n var index = slice16$1(view16, headerLength / 2, view32[4] / 2);\n var data = view32[5] === 2\n ? slice16$1(view16, (headerLength + view32[4]) / 2)\n : slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4));\n return new Trie$1(view32[0], view32[1], view32[2], view32[3], index, data);\n };\n var Trie$1 = /** @class */ (function () {\n function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n Trie.prototype.get = function (codePoint) {\n var ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2$1];\n ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);\n return this.data[ix];\n }\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2$1)];\n ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);\n return this.data[ix];\n }\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2$1) & UTRIE2_INDEX_2_MASK$1;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n };\n return Trie;\n }());\n\n /*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var chars$3 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup$3 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i$3 = 0; i$3 < chars$3.length; i$3++) {\n lookup$3[chars$3.charCodeAt(i$3)] = i$3;\n }\n\n var base64$1 = 'KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxA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LAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBc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AwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp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ywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAw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AVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAU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gAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwAr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AB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKw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AUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQA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JQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==';\n\n var LETTER_NUMBER_MODIFIER = 50;\n // Non-tailorable Line Breaking Classes\n var BK = 1; // Cause a line break (after)\n var CR$1 = 2; // Cause a line break (after), except between CR and LF\n var LF$1 = 3; // Cause a line break (after)\n var CM = 4; // Prohibit a line break between the character and the preceding character\n var NL = 5; // Cause a line break (after)\n var WJ = 7; // Prohibit line breaks before and after\n var ZW = 8; // Provide a break opportunity\n var GL = 9; // Prohibit line breaks before and after\n var SP = 10; // Enable indirect line breaks\n var ZWJ$1 = 11; // Prohibit line breaks within joiner sequences\n // Break Opportunities\n var B2 = 12; // Provide a line break opportunity before and after the character\n var BA = 13; // Generally provide a line break opportunity after the character\n var BB = 14; // Generally provide a line break opportunity before the character\n var HY = 15; // Provide a line break opportunity after the character, except in numeric context\n var CB = 16; // Provide a line break opportunity contingent on additional information\n // Characters Prohibiting Certain Breaks\n var CL = 17; // Prohibit line breaks before\n var CP = 18; // Prohibit line breaks before\n var EX = 19; // Prohibit line breaks before\n var IN = 20; // Allow only indirect line breaks between pairs\n var NS = 21; // Allow only indirect line breaks before\n var OP = 22; // Prohibit line breaks after\n var QU = 23; // Act like they are both opening and closing\n // Numeric Context\n var IS = 24; // Prevent breaks after any and before numeric\n var NU = 25; // Form numeric expressions for line breaking purposes\n var PO = 26; // Do not break following a numeric expression\n var PR = 27; // Do not break in front of a numeric expression\n var SY = 28; // Prevent a break before; and allow a break after\n // Other Characters\n var AI = 29; // Act like AL when the resolvedEAW is N; otherwise; act as ID\n var AL = 30; // Are alphabetic characters or symbols that are used with alphabetic characters\n var CJ = 31; // Treat as NS or ID for strict or normal breaking.\n var EB = 32; // Do not break from following Emoji Modifier\n var EM = 33; // Do not break from preceding Emoji Base\n var H2 = 34; // Form Korean syllable blocks\n var H3 = 35; // Form Korean syllable blocks\n var HL = 36; // Do not break around a following hyphen; otherwise act as Alphabetic\n var ID = 37; // Break before or after; except in some numeric context\n var JL = 38; // Form Korean syllable blocks\n var JV = 39; // Form Korean syllable blocks\n var JT = 40; // Form Korean syllable blocks\n var RI$1 = 41; // Keep pairs together. For pairs; break before and after other classes\n var SA = 42; // Provide a line break opportunity contingent on additional, language-specific context analysis\n var XX = 43; // Have as yet unknown line breaking behavior or unassigned code positions\n var ea_OP = [0x2329, 0xff08];\n var BREAK_MANDATORY = '!';\n var BREAK_NOT_ALLOWED$1 = '×';\n var BREAK_ALLOWED$1 = '÷';\n var UnicodeTrie$1 = createTrieFromBase64$1(base64$1);\n var ALPHABETICS = [AL, HL];\n var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL];\n var SPACE$1 = [SP, ZW];\n var PREFIX_POSTFIX = [PR, PO];\n var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);\n var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];\n var HYPHEN = [HY, BA];\n var codePointsToCharacterClasses = function (codePoints, lineBreak) {\n if (lineBreak === void 0) { lineBreak = 'strict'; }\n var types = [];\n var indices = [];\n var categories = [];\n codePoints.forEach(function (codePoint, index) {\n var classType = UnicodeTrie$1.get(codePoint);\n if (classType > LETTER_NUMBER_MODIFIER) {\n categories.push(true);\n classType -= LETTER_NUMBER_MODIFIER;\n }\n else {\n categories.push(false);\n }\n if (['normal', 'auto', 'loose'].indexOf(lineBreak) !== -1) {\n // U+2010, – U+2013, 〜 U+301C, ゠ U+30A0\n if ([0x2010, 0x2013, 0x301c, 0x30a0].indexOf(codePoint) !== -1) {\n indices.push(index);\n return types.push(CB);\n }\n }\n if (classType === CM || classType === ZWJ$1) {\n // LB10 Treat any remaining combining mark or ZWJ as AL.\n if (index === 0) {\n indices.push(index);\n return types.push(AL);\n }\n // LB9 Do not break a combining character sequence; treat it as if it has the line breaking class of\n // the base character in all of the following rules. Treat ZWJ as if it were CM.\n var prev = types[index - 1];\n if (LINE_BREAKS.indexOf(prev) === -1) {\n indices.push(indices[index - 1]);\n return types.push(prev);\n }\n indices.push(index);\n return types.push(AL);\n }\n indices.push(index);\n if (classType === CJ) {\n return types.push(lineBreak === 'strict' ? NS : ID);\n }\n if (classType === SA) {\n return types.push(AL);\n }\n if (classType === AI) {\n return types.push(AL);\n }\n // For supplementary characters, a useful default is to treat characters in the range 10000..1FFFD as AL\n // and characters in the ranges 20000..2FFFD and 30000..3FFFD as ID, until the implementation can be revised\n // to take into account the actual line breaking properties for these characters.\n if (classType === XX) {\n if ((codePoint >= 0x20000 && codePoint <= 0x2fffd) || (codePoint >= 0x30000 && codePoint <= 0x3fffd)) {\n return types.push(ID);\n }\n else {\n return types.push(AL);\n }\n }\n types.push(classType);\n });\n return [indices, types, categories];\n };\n var isAdjacentWithSpaceIgnored = function (a, b, currentIndex, classTypes) {\n var current = classTypes[currentIndex];\n if (Array.isArray(a) ? a.indexOf(current) !== -1 : a === current) {\n var i = currentIndex;\n while (i <= classTypes.length) {\n i++;\n var next = classTypes[i];\n if (next === b) {\n return true;\n }\n if (next !== SP) {\n break;\n }\n }\n }\n if (current === SP) {\n var i = currentIndex;\n while (i > 0) {\n i--;\n var prev = classTypes[i];\n if (Array.isArray(a) ? a.indexOf(prev) !== -1 : a === prev) {\n var n = currentIndex;\n while (n <= classTypes.length) {\n n++;\n var next = classTypes[n];\n if (next === b) {\n return true;\n }\n if (next !== SP) {\n break;\n }\n }\n }\n if (prev !== SP) {\n break;\n }\n }\n }\n return false;\n };\n var previousNonSpaceClassType = function (currentIndex, classTypes) {\n var i = currentIndex;\n while (i >= 0) {\n var type = classTypes[i];\n if (type === SP) {\n i--;\n }\n else {\n return type;\n }\n }\n return 0;\n };\n var _lineBreakAtIndex = function (codePoints, classTypes, indicies, index, forbiddenBreaks) {\n if (indicies[index] === 0) {\n return BREAK_NOT_ALLOWED$1;\n }\n var currentIndex = index - 1;\n if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) {\n return BREAK_NOT_ALLOWED$1;\n }\n var beforeIndex = currentIndex - 1;\n var afterIndex = currentIndex + 1;\n var current = classTypes[currentIndex];\n // LB4 Always break after hard line breaks.\n // LB5 Treat CR followed by LF, as well as CR, LF, and NL as hard line breaks.\n var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0;\n var next = classTypes[afterIndex];\n if (current === CR$1 && next === LF$1) {\n return BREAK_NOT_ALLOWED$1;\n }\n if (HARD_LINE_BREAKS.indexOf(current) !== -1) {\n return BREAK_MANDATORY;\n }\n // LB6 Do not break before hard line breaks.\n if (HARD_LINE_BREAKS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB7 Do not break before spaces or zero width space.\n if (SPACE$1.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB8 Break before any character following a zero-width space, even if one or more spaces intervene.\n if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) {\n return BREAK_ALLOWED$1;\n }\n // LB8a Do not break after a zero width joiner.\n if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // zwj emojis\n if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB11 Do not break before or after Word joiner and related characters.\n if (current === WJ || next === WJ) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB12 Do not break after NBSP and related characters.\n if (current === GL) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB12a Do not break before NBSP and related characters, except after spaces and hyphens.\n if ([SP, BA, HY].indexOf(current) === -1 && next === GL) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB13 Do not break before ‘]’ or ‘!’ or ‘;’ or ‘/’, even after spaces.\n if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB14 Do not break after ‘[’, even after spaces.\n if (previousNonSpaceClassType(currentIndex, classTypes) === OP) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB15 Do not break within ‘”[’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB16 Do not break between closing punctuation and a nonstarter (lb=NS), even with intervening spaces.\n if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB17 Do not break within ‘——’, even with intervening spaces.\n if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB18 Break after spaces.\n if (current === SP) {\n return BREAK_ALLOWED$1;\n }\n // LB19 Do not break before or after quotation marks, such as ‘ ” ’.\n if (current === QU || next === QU) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB20 Break before and after unresolved CB.\n if (next === CB || current === CB) {\n return BREAK_ALLOWED$1;\n }\n // LB21 Do not break before hyphen-minus, other hyphens, fixed-width spaces, small kana, and other non-starters, or after acute accents.\n if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB21a Don't break after Hebrew + Hyphen.\n if (before === HL && HYPHEN.indexOf(current) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB21b Don’t break between Solidus and Hebrew letters.\n if (current === SY && next === HL) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB22 Do not break before ellipsis.\n if (next === IN) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB23 Do not break between digits and letters.\n if ((ALPHABETICS.indexOf(next) !== -1 && current === NU) || (ALPHABETICS.indexOf(current) !== -1 && next === NU)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB23a Do not break between numeric prefixes and ideographs, or between ideographs and numeric postfixes.\n if ((current === PR && [ID, EB, EM].indexOf(next) !== -1) ||\n ([ID, EB, EM].indexOf(current) !== -1 && next === PO)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB24 Do not break between numeric prefix/postfix and letters, or between letters and prefix/postfix.\n if ((ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1) ||\n (PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB25 Do not break between the following pairs of classes relevant to numbers:\n if (\n // (PR | PO) × ( OP | HY )? NU\n ([PR, PO].indexOf(current) !== -1 &&\n (next === NU || ([OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU))) ||\n // ( OP | HY ) × NU\n ([OP, HY].indexOf(current) !== -1 && next === NU) ||\n // NU ×\t(NU | SY | IS)\n (current === NU && [NU, SY, IS].indexOf(next) !== -1)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // NU (NU | SY | IS)* × (NU | SY | IS | CL | CP)\n if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) {\n var prevIndex = currentIndex;\n while (prevIndex >= 0) {\n var type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED$1;\n }\n else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n }\n else {\n break;\n }\n }\n }\n // NU (NU | SY | IS)* (CL | CP)? × (PO | PR))\n if ([PR, PO].indexOf(next) !== -1) {\n var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex;\n while (prevIndex >= 0) {\n var type = classTypes[prevIndex];\n if (type === NU) {\n return BREAK_NOT_ALLOWED$1;\n }\n else if ([SY, IS].indexOf(type) !== -1) {\n prevIndex--;\n }\n else {\n break;\n }\n }\n }\n // LB26 Do not break a Korean syllable.\n if ((JL === current && [JL, JV, H2, H3].indexOf(next) !== -1) ||\n ([JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1) ||\n ([JT, H3].indexOf(current) !== -1 && next === JT)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB27 Treat a Korean Syllable Block the same as ID.\n if ((KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1) ||\n (KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB28 Do not break between alphabetics (“at”).\n if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB29 Do not break between numeric punctuation and alphabetics (“e.g.”).\n if (current === IS && ALPHABETICS.indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.\n if ((ALPHABETICS.concat(NU).indexOf(current) !== -1 &&\n next === OP &&\n ea_OP.indexOf(codePoints[afterIndex]) === -1) ||\n (ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)) {\n return BREAK_NOT_ALLOWED$1;\n }\n // LB30a Break between two regional indicator symbols if and only if there are an even number of regional\n // indicators preceding the position of the break.\n if (current === RI$1 && next === RI$1) {\n var i = indicies[currentIndex];\n var count = 1;\n while (i > 0) {\n i--;\n if (classTypes[i] === RI$1) {\n count++;\n }\n else {\n break;\n }\n }\n if (count % 2 !== 0) {\n return BREAK_NOT_ALLOWED$1;\n }\n }\n // LB30b Do not break between an emoji base and an emoji modifier.\n if (current === EB && next === EM) {\n return BREAK_NOT_ALLOWED$1;\n }\n return BREAK_ALLOWED$1;\n };\n var cssFormattedClasses = function (codePoints, options) {\n if (!options) {\n options = { lineBreak: 'normal', wordBreak: 'normal' };\n }\n var _a = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a[0], classTypes = _a[1], isLetterNumber = _a[2];\n if (options.wordBreak === 'break-all' || options.wordBreak === 'break-word') {\n classTypes = classTypes.map(function (type) { return ([NU, AL, SA].indexOf(type) !== -1 ? ID : type); });\n }\n var forbiddenBreakpoints = options.wordBreak === 'keep-all'\n ? isLetterNumber.map(function (letterNumber, i) {\n return letterNumber && codePoints[i] >= 0x4e00 && codePoints[i] <= 0x9fff;\n })\n : undefined;\n return [indicies, classTypes, forbiddenBreakpoints];\n };\n var Break = /** @class */ (function () {\n function Break(codePoints, lineBreak, start, end) {\n this.codePoints = codePoints;\n this.required = lineBreak === BREAK_MANDATORY;\n this.start = start;\n this.end = end;\n }\n Break.prototype.slice = function () {\n return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));\n };\n return Break;\n }());\n var LineBreaker = function (str, options) {\n var codePoints = toCodePoints$1(str);\n var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2];\n var length = codePoints.length;\n var lastEnd = 0;\n var nextIndex = 0;\n return {\n next: function () {\n if (nextIndex >= length) {\n return { done: true, value: null };\n }\n var lineBreak = BREAK_NOT_ALLOWED$1;\n while (nextIndex < length &&\n (lineBreak = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) ===\n BREAK_NOT_ALLOWED$1) { }\n if (lineBreak !== BREAK_NOT_ALLOWED$1 || nextIndex === length) {\n var value = new Break(codePoints, lineBreak, lastEnd, nextIndex);\n lastEnd = nextIndex;\n return { value: value, done: false };\n }\n return { done: true, value: null };\n },\n };\n };\n\n // https://www.w3.org/TR/css-syntax-3\n var FLAG_UNRESTRICTED = 1 << 0;\n var FLAG_ID = 1 << 1;\n var FLAG_INTEGER = 1 << 2;\n var FLAG_NUMBER = 1 << 3;\n var LINE_FEED = 0x000a;\n var SOLIDUS = 0x002f;\n var REVERSE_SOLIDUS = 0x005c;\n var CHARACTER_TABULATION = 0x0009;\n var SPACE = 0x0020;\n var QUOTATION_MARK = 0x0022;\n var EQUALS_SIGN = 0x003d;\n var NUMBER_SIGN = 0x0023;\n var DOLLAR_SIGN = 0x0024;\n var PERCENTAGE_SIGN = 0x0025;\n var APOSTROPHE = 0x0027;\n var LEFT_PARENTHESIS = 0x0028;\n var RIGHT_PARENTHESIS = 0x0029;\n var LOW_LINE = 0x005f;\n var HYPHEN_MINUS = 0x002d;\n var EXCLAMATION_MARK = 0x0021;\n var LESS_THAN_SIGN = 0x003c;\n var GREATER_THAN_SIGN = 0x003e;\n var COMMERCIAL_AT = 0x0040;\n var LEFT_SQUARE_BRACKET = 0x005b;\n var RIGHT_SQUARE_BRACKET = 0x005d;\n var CIRCUMFLEX_ACCENT = 0x003d;\n var LEFT_CURLY_BRACKET = 0x007b;\n var QUESTION_MARK = 0x003f;\n var RIGHT_CURLY_BRACKET = 0x007d;\n var VERTICAL_LINE = 0x007c;\n var TILDE = 0x007e;\n var CONTROL = 0x0080;\n var REPLACEMENT_CHARACTER = 0xfffd;\n var ASTERISK = 0x002a;\n var PLUS_SIGN = 0x002b;\n var COMMA = 0x002c;\n var COLON = 0x003a;\n var SEMICOLON = 0x003b;\n var FULL_STOP = 0x002e;\n var NULL = 0x0000;\n var BACKSPACE = 0x0008;\n var LINE_TABULATION = 0x000b;\n var SHIFT_OUT = 0x000e;\n var INFORMATION_SEPARATOR_ONE = 0x001f;\n var DELETE = 0x007f;\n var EOF = -1;\n var ZERO = 0x0030;\n var a = 0x0061;\n var e = 0x0065;\n var f = 0x0066;\n var u = 0x0075;\n var z = 0x007a;\n var A = 0x0041;\n var E = 0x0045;\n var F = 0x0046;\n var U = 0x0055;\n var Z = 0x005a;\n var isDigit = function (codePoint) { return codePoint >= ZERO && codePoint <= 0x0039; };\n var isSurrogateCodePoint = function (codePoint) { return codePoint >= 0xd800 && codePoint <= 0xdfff; };\n var isHex = function (codePoint) {\n return isDigit(codePoint) || (codePoint >= A && codePoint <= F) || (codePoint >= a && codePoint <= f);\n };\n var isLowerCaseLetter = function (codePoint) { return codePoint >= a && codePoint <= z; };\n var isUpperCaseLetter = function (codePoint) { return codePoint >= A && codePoint <= Z; };\n var isLetter = function (codePoint) { return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint); };\n var isNonASCIICodePoint = function (codePoint) { return codePoint >= CONTROL; };\n var isWhiteSpace = function (codePoint) {\n return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE;\n };\n var isNameStartCodePoint = function (codePoint) {\n return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE;\n };\n var isNameCodePoint = function (codePoint) {\n return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS;\n };\n var isNonPrintableCodePoint = function (codePoint) {\n return ((codePoint >= NULL && codePoint <= BACKSPACE) ||\n codePoint === LINE_TABULATION ||\n (codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE) ||\n codePoint === DELETE);\n };\n var isValidEscape = function (c1, c2) {\n if (c1 !== REVERSE_SOLIDUS) {\n return false;\n }\n return c2 !== LINE_FEED;\n };\n var isIdentifierStart = function (c1, c2, c3) {\n if (c1 === HYPHEN_MINUS) {\n return isNameStartCodePoint(c2) || isValidEscape(c2, c3);\n }\n else if (isNameStartCodePoint(c1)) {\n return true;\n }\n else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) {\n return true;\n }\n return false;\n };\n var isNumberStart = function (c1, c2, c3) {\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n if (isDigit(c2)) {\n return true;\n }\n return c2 === FULL_STOP && isDigit(c3);\n }\n if (c1 === FULL_STOP) {\n return isDigit(c2);\n }\n return isDigit(c1);\n };\n var stringToNumber = function (codePoints) {\n var c = 0;\n var sign = 1;\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n sign = -1;\n }\n c++;\n }\n var integers = [];\n while (isDigit(codePoints[c])) {\n integers.push(codePoints[c++]);\n }\n var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;\n if (codePoints[c] === FULL_STOP) {\n c++;\n }\n var fraction = [];\n while (isDigit(codePoints[c])) {\n fraction.push(codePoints[c++]);\n }\n var fracd = fraction.length;\n var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;\n if (codePoints[c] === E || codePoints[c] === e) {\n c++;\n }\n var expsign = 1;\n if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) {\n if (codePoints[c] === HYPHEN_MINUS) {\n expsign = -1;\n }\n c++;\n }\n var exponent = [];\n while (isDigit(codePoints[c])) {\n exponent.push(codePoints[c++]);\n }\n var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0;\n return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);\n };\n var LEFT_PARENTHESIS_TOKEN = {\n type: 2 /* LEFT_PARENTHESIS_TOKEN */\n };\n var RIGHT_PARENTHESIS_TOKEN = {\n type: 3 /* RIGHT_PARENTHESIS_TOKEN */\n };\n var COMMA_TOKEN = { type: 4 /* COMMA_TOKEN */ };\n var SUFFIX_MATCH_TOKEN = { type: 13 /* SUFFIX_MATCH_TOKEN */ };\n var PREFIX_MATCH_TOKEN = { type: 8 /* PREFIX_MATCH_TOKEN */ };\n var COLUMN_TOKEN = { type: 21 /* COLUMN_TOKEN */ };\n var DASH_MATCH_TOKEN = { type: 9 /* DASH_MATCH_TOKEN */ };\n var INCLUDE_MATCH_TOKEN = { type: 10 /* INCLUDE_MATCH_TOKEN */ };\n var LEFT_CURLY_BRACKET_TOKEN = {\n type: 11 /* LEFT_CURLY_BRACKET_TOKEN */\n };\n var RIGHT_CURLY_BRACKET_TOKEN = {\n type: 12 /* RIGHT_CURLY_BRACKET_TOKEN */\n };\n var SUBSTRING_MATCH_TOKEN = { type: 14 /* SUBSTRING_MATCH_TOKEN */ };\n var BAD_URL_TOKEN = { type: 23 /* BAD_URL_TOKEN */ };\n var BAD_STRING_TOKEN = { type: 1 /* BAD_STRING_TOKEN */ };\n var CDO_TOKEN = { type: 25 /* CDO_TOKEN */ };\n var CDC_TOKEN = { type: 24 /* CDC_TOKEN */ };\n var COLON_TOKEN = { type: 26 /* COLON_TOKEN */ };\n var SEMICOLON_TOKEN = { type: 27 /* SEMICOLON_TOKEN */ };\n var LEFT_SQUARE_BRACKET_TOKEN = {\n type: 28 /* LEFT_SQUARE_BRACKET_TOKEN */\n };\n var RIGHT_SQUARE_BRACKET_TOKEN = {\n type: 29 /* RIGHT_SQUARE_BRACKET_TOKEN */\n };\n var WHITESPACE_TOKEN = { type: 31 /* WHITESPACE_TOKEN */ };\n var EOF_TOKEN = { type: 32 /* EOF_TOKEN */ };\n var Tokenizer = /** @class */ (function () {\n function Tokenizer() {\n this._value = [];\n }\n Tokenizer.prototype.write = function (chunk) {\n this._value = this._value.concat(toCodePoints$1(chunk));\n };\n Tokenizer.prototype.read = function () {\n var tokens = [];\n var token = this.consumeToken();\n while (token !== EOF_TOKEN) {\n tokens.push(token);\n token = this.consumeToken();\n }\n return tokens;\n };\n Tokenizer.prototype.consumeToken = function () {\n var codePoint = this.consumeCodePoint();\n switch (codePoint) {\n case QUOTATION_MARK:\n return this.consumeStringToken(QUOTATION_MARK);\n case NUMBER_SIGN:\n var c1 = this.peekCodePoint(0);\n var c2 = this.peekCodePoint(1);\n var c3 = this.peekCodePoint(2);\n if (isNameCodePoint(c1) || isValidEscape(c2, c3)) {\n var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED;\n var value = this.consumeName();\n return { type: 5 /* HASH_TOKEN */, value: value, flags: flags };\n }\n break;\n case DOLLAR_SIGN:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUFFIX_MATCH_TOKEN;\n }\n break;\n case APOSTROPHE:\n return this.consumeStringToken(APOSTROPHE);\n case LEFT_PARENTHESIS:\n return LEFT_PARENTHESIS_TOKEN;\n case RIGHT_PARENTHESIS:\n return RIGHT_PARENTHESIS_TOKEN;\n case ASTERISK:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return SUBSTRING_MATCH_TOKEN;\n }\n break;\n case PLUS_SIGN:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case COMMA:\n return COMMA_TOKEN;\n case HYPHEN_MINUS:\n var e1 = codePoint;\n var e2 = this.peekCodePoint(0);\n var e3 = this.peekCodePoint(1);\n if (isNumberStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n if (isIdentifierStart(e1, e2, e3)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDC_TOKEN;\n }\n break;\n case FULL_STOP:\n if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n break;\n case SOLIDUS:\n if (this.peekCodePoint(0) === ASTERISK) {\n this.consumeCodePoint();\n while (true) {\n var c = this.consumeCodePoint();\n if (c === ASTERISK) {\n c = this.consumeCodePoint();\n if (c === SOLIDUS) {\n return this.consumeToken();\n }\n }\n if (c === EOF) {\n return this.consumeToken();\n }\n }\n }\n break;\n case COLON:\n return COLON_TOKEN;\n case SEMICOLON:\n return SEMICOLON_TOKEN;\n case LESS_THAN_SIGN:\n if (this.peekCodePoint(0) === EXCLAMATION_MARK &&\n this.peekCodePoint(1) === HYPHEN_MINUS &&\n this.peekCodePoint(2) === HYPHEN_MINUS) {\n this.consumeCodePoint();\n this.consumeCodePoint();\n return CDO_TOKEN;\n }\n break;\n case COMMERCIAL_AT:\n var a1 = this.peekCodePoint(0);\n var a2 = this.peekCodePoint(1);\n var a3 = this.peekCodePoint(2);\n if (isIdentifierStart(a1, a2, a3)) {\n var value = this.consumeName();\n return { type: 7 /* AT_KEYWORD_TOKEN */, value: value };\n }\n break;\n case LEFT_SQUARE_BRACKET:\n return LEFT_SQUARE_BRACKET_TOKEN;\n case REVERSE_SOLIDUS:\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n break;\n case RIGHT_SQUARE_BRACKET:\n return RIGHT_SQUARE_BRACKET_TOKEN;\n case CIRCUMFLEX_ACCENT:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return PREFIX_MATCH_TOKEN;\n }\n break;\n case LEFT_CURLY_BRACKET:\n return LEFT_CURLY_BRACKET_TOKEN;\n case RIGHT_CURLY_BRACKET:\n return RIGHT_CURLY_BRACKET_TOKEN;\n case u:\n case U:\n var u1 = this.peekCodePoint(0);\n var u2 = this.peekCodePoint(1);\n if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) {\n this.consumeCodePoint();\n this.consumeUnicodeRangeToken();\n }\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n case VERTICAL_LINE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return DASH_MATCH_TOKEN;\n }\n if (this.peekCodePoint(0) === VERTICAL_LINE) {\n this.consumeCodePoint();\n return COLUMN_TOKEN;\n }\n break;\n case TILDE:\n if (this.peekCodePoint(0) === EQUALS_SIGN) {\n this.consumeCodePoint();\n return INCLUDE_MATCH_TOKEN;\n }\n break;\n case EOF:\n return EOF_TOKEN;\n }\n if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n return WHITESPACE_TOKEN;\n }\n if (isDigit(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeNumericToken();\n }\n if (isNameStartCodePoint(codePoint)) {\n this.reconsumeCodePoint(codePoint);\n return this.consumeIdentLikeToken();\n }\n return { type: 6 /* DELIM_TOKEN */, value: fromCodePoint$1(codePoint) };\n };\n Tokenizer.prototype.consumeCodePoint = function () {\n var value = this._value.shift();\n return typeof value === 'undefined' ? -1 : value;\n };\n Tokenizer.prototype.reconsumeCodePoint = function (codePoint) {\n this._value.unshift(codePoint);\n };\n Tokenizer.prototype.peekCodePoint = function (delta) {\n if (delta >= this._value.length) {\n return -1;\n }\n return this._value[delta];\n };\n Tokenizer.prototype.consumeUnicodeRangeToken = function () {\n var digits = [];\n var codePoint = this.consumeCodePoint();\n while (isHex(codePoint) && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n var questionMarks = false;\n while (codePoint === QUESTION_MARK && digits.length < 6) {\n digits.push(codePoint);\n codePoint = this.consumeCodePoint();\n questionMarks = true;\n }\n if (questionMarks) {\n var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? ZERO : digit); })), 16);\n var end = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? F : digit); })), 16);\n return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start_1, end: end };\n }\n var start = parseInt(fromCodePoint$1.apply(void 0, digits), 16);\n if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {\n this.consumeCodePoint();\n codePoint = this.consumeCodePoint();\n var endDigits = [];\n while (isHex(codePoint) && endDigits.length < 6) {\n endDigits.push(codePoint);\n codePoint = this.consumeCodePoint();\n }\n var end = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);\n return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start, end: end };\n }\n else {\n return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start, end: start };\n }\n };\n Tokenizer.prototype.consumeIdentLikeToken = function () {\n var value = this.consumeName();\n if (value.toLowerCase() === 'url' && this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return this.consumeUrlToken();\n }\n else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: 19 /* FUNCTION_TOKEN */, value: value };\n }\n return { type: 20 /* IDENT_TOKEN */, value: value };\n };\n Tokenizer.prototype.consumeUrlToken = function () {\n var value = [];\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF) {\n return { type: 22 /* URL_TOKEN */, value: '' };\n }\n var next = this.peekCodePoint(0);\n if (next === APOSTROPHE || next === QUOTATION_MARK) {\n var stringToken = this.consumeStringToken(this.consumeCodePoint());\n if (stringToken.type === 0 /* STRING_TOKEN */) {\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: 22 /* URL_TOKEN */, value: stringToken.value };\n }\n }\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n while (true) {\n var codePoint = this.consumeCodePoint();\n if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {\n return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };\n }\n else if (isWhiteSpace(codePoint)) {\n this.consumeWhiteSpace();\n if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {\n this.consumeCodePoint();\n return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };\n }\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n else if (codePoint === QUOTATION_MARK ||\n codePoint === APOSTROPHE ||\n codePoint === LEFT_PARENTHESIS ||\n isNonPrintableCodePoint(codePoint)) {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n else if (codePoint === REVERSE_SOLIDUS) {\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n value.push(this.consumeEscapedCodePoint());\n }\n else {\n this.consumeBadUrlRemnants();\n return BAD_URL_TOKEN;\n }\n }\n else {\n value.push(codePoint);\n }\n }\n };\n Tokenizer.prototype.consumeWhiteSpace = function () {\n while (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n };\n Tokenizer.prototype.consumeBadUrlRemnants = function () {\n while (true) {\n var codePoint = this.consumeCodePoint();\n if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) {\n return;\n }\n if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n this.consumeEscapedCodePoint();\n }\n }\n };\n Tokenizer.prototype.consumeStringSlice = function (count) {\n var SLICE_STACK_SIZE = 50000;\n var value = '';\n while (count > 0) {\n var amount = Math.min(SLICE_STACK_SIZE, count);\n value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));\n count -= amount;\n }\n this._value.shift();\n return value;\n };\n Tokenizer.prototype.consumeStringToken = function (endingCodePoint) {\n var value = '';\n var i = 0;\n do {\n var codePoint = this._value[i];\n if (codePoint === EOF || codePoint === undefined || codePoint === endingCodePoint) {\n value += this.consumeStringSlice(i);\n return { type: 0 /* STRING_TOKEN */, value: value };\n }\n if (codePoint === LINE_FEED) {\n this._value.splice(0, i);\n return BAD_STRING_TOKEN;\n }\n if (codePoint === REVERSE_SOLIDUS) {\n var next = this._value[i + 1];\n if (next !== EOF && next !== undefined) {\n if (next === LINE_FEED) {\n value += this.consumeStringSlice(i);\n i = -1;\n this._value.shift();\n }\n else if (isValidEscape(codePoint, next)) {\n value += this.consumeStringSlice(i);\n value += fromCodePoint$1(this.consumeEscapedCodePoint());\n i = -1;\n }\n }\n }\n i++;\n } while (true);\n };\n Tokenizer.prototype.consumeNumber = function () {\n var repr = [];\n var type = FLAG_INTEGER;\n var c1 = this.peekCodePoint(0);\n if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) {\n repr.push(this.consumeCodePoint());\n }\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n c1 = this.peekCodePoint(0);\n var c2 = this.peekCodePoint(1);\n if (c1 === FULL_STOP && isDigit(c2)) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n c1 = this.peekCodePoint(0);\n c2 = this.peekCodePoint(1);\n var c3 = this.peekCodePoint(2);\n if ((c1 === E || c1 === e) && (((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3)) || isDigit(c2))) {\n repr.push(this.consumeCodePoint(), this.consumeCodePoint());\n type = FLAG_NUMBER;\n while (isDigit(this.peekCodePoint(0))) {\n repr.push(this.consumeCodePoint());\n }\n }\n return [stringToNumber(repr), type];\n };\n Tokenizer.prototype.consumeNumericToken = function () {\n var _a = this.consumeNumber(), number = _a[0], flags = _a[1];\n var c1 = this.peekCodePoint(0);\n var c2 = this.peekCodePoint(1);\n var c3 = this.peekCodePoint(2);\n if (isIdentifierStart(c1, c2, c3)) {\n var unit = this.consumeName();\n return { type: 15 /* DIMENSION_TOKEN */, number: number, flags: flags, unit: unit };\n }\n if (c1 === PERCENTAGE_SIGN) {\n this.consumeCodePoint();\n return { type: 16 /* PERCENTAGE_TOKEN */, number: number, flags: flags };\n }\n return { type: 17 /* NUMBER_TOKEN */, number: number, flags: flags };\n };\n Tokenizer.prototype.consumeEscapedCodePoint = function () {\n var codePoint = this.consumeCodePoint();\n if (isHex(codePoint)) {\n var hex = fromCodePoint$1(codePoint);\n while (isHex(this.peekCodePoint(0)) && hex.length < 6) {\n hex += fromCodePoint$1(this.consumeCodePoint());\n }\n if (isWhiteSpace(this.peekCodePoint(0))) {\n this.consumeCodePoint();\n }\n var hexCodePoint = parseInt(hex, 16);\n if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 0x10ffff) {\n return REPLACEMENT_CHARACTER;\n }\n return hexCodePoint;\n }\n if (codePoint === EOF) {\n return REPLACEMENT_CHARACTER;\n }\n return codePoint;\n };\n Tokenizer.prototype.consumeName = function () {\n var result = '';\n while (true) {\n var codePoint = this.consumeCodePoint();\n if (isNameCodePoint(codePoint)) {\n result += fromCodePoint$1(codePoint);\n }\n else if (isValidEscape(codePoint, this.peekCodePoint(0))) {\n result += fromCodePoint$1(this.consumeEscapedCodePoint());\n }\n else {\n this.reconsumeCodePoint(codePoint);\n return result;\n }\n }\n };\n return Tokenizer;\n }());\n\n var Parser = /** @class */ (function () {\n function Parser(tokens) {\n this._tokens = tokens;\n }\n Parser.create = function (value) {\n var tokenizer = new Tokenizer();\n tokenizer.write(value);\n return new Parser(tokenizer.read());\n };\n Parser.parseValue = function (value) {\n return Parser.create(value).parseComponentValue();\n };\n Parser.parseValues = function (value) {\n return Parser.create(value).parseComponentValues();\n };\n Parser.prototype.parseComponentValue = function () {\n var token = this.consumeToken();\n while (token.type === 31 /* WHITESPACE_TOKEN */) {\n token = this.consumeToken();\n }\n if (token.type === 32 /* EOF_TOKEN */) {\n throw new SyntaxError(\"Error parsing CSS component value, unexpected EOF\");\n }\n this.reconsumeToken(token);\n var value = this.consumeComponentValue();\n do {\n token = this.consumeToken();\n } while (token.type === 31 /* WHITESPACE_TOKEN */);\n if (token.type === 32 /* EOF_TOKEN */) {\n return value;\n }\n throw new SyntaxError(\"Error parsing CSS component value, multiple values found when expecting only one\");\n };\n Parser.prototype.parseComponentValues = function () {\n var values = [];\n while (true) {\n var value = this.consumeComponentValue();\n if (value.type === 32 /* EOF_TOKEN */) {\n return values;\n }\n values.push(value);\n values.push();\n }\n };\n Parser.prototype.consumeComponentValue = function () {\n var token = this.consumeToken();\n switch (token.type) {\n case 11 /* LEFT_CURLY_BRACKET_TOKEN */:\n case 28 /* LEFT_SQUARE_BRACKET_TOKEN */:\n case 2 /* LEFT_PARENTHESIS_TOKEN */:\n return this.consumeSimpleBlock(token.type);\n case 19 /* FUNCTION_TOKEN */:\n return this.consumeFunction(token);\n }\n return token;\n };\n Parser.prototype.consumeSimpleBlock = function (type) {\n var block = { type: type, values: [] };\n var token = this.consumeToken();\n while (true) {\n if (token.type === 32 /* EOF_TOKEN */ || isEndingTokenFor(token, type)) {\n return block;\n }\n this.reconsumeToken(token);\n block.values.push(this.consumeComponentValue());\n token = this.consumeToken();\n }\n };\n Parser.prototype.consumeFunction = function (functionToken) {\n var cssFunction = {\n name: functionToken.value,\n values: [],\n type: 18 /* FUNCTION */\n };\n while (true) {\n var token = this.consumeToken();\n if (token.type === 32 /* EOF_TOKEN */ || token.type === 3 /* RIGHT_PARENTHESIS_TOKEN */) {\n return cssFunction;\n }\n this.reconsumeToken(token);\n cssFunction.values.push(this.consumeComponentValue());\n }\n };\n Parser.prototype.consumeToken = function () {\n var token = this._tokens.shift();\n return typeof token === 'undefined' ? EOF_TOKEN : token;\n };\n Parser.prototype.reconsumeToken = function (token) {\n this._tokens.unshift(token);\n };\n return Parser;\n }());\n var isDimensionToken = function (token) { return token.type === 15 /* DIMENSION_TOKEN */; };\n var isNumberToken = function (token) { return token.type === 17 /* NUMBER_TOKEN */; };\n var isIdentToken = function (token) { return token.type === 20 /* IDENT_TOKEN */; };\n var isStringToken = function (token) { return token.type === 0 /* STRING_TOKEN */; };\n var isIdentWithValue = function (token, value) {\n return isIdentToken(token) && token.value === value;\n };\n var nonWhiteSpace = function (token) { return token.type !== 31 /* WHITESPACE_TOKEN */; };\n var nonFunctionArgSeparator = function (token) {\n return token.type !== 31 /* WHITESPACE_TOKEN */ && token.type !== 4 /* COMMA_TOKEN */;\n };\n var parseFunctionArgs = function (tokens) {\n var args = [];\n var arg = [];\n tokens.forEach(function (token) {\n if (token.type === 4 /* COMMA_TOKEN */) {\n if (arg.length === 0) {\n throw new Error(\"Error parsing function args, zero tokens for arg\");\n }\n args.push(arg);\n arg = [];\n return;\n }\n if (token.type !== 31 /* WHITESPACE_TOKEN */) {\n arg.push(token);\n }\n });\n if (arg.length) {\n args.push(arg);\n }\n return args;\n };\n var isEndingTokenFor = function (token, type) {\n if (type === 11 /* LEFT_CURLY_BRACKET_TOKEN */ && token.type === 12 /* RIGHT_CURLY_BRACKET_TOKEN */) {\n return true;\n }\n if (type === 28 /* LEFT_SQUARE_BRACKET_TOKEN */ && token.type === 29 /* RIGHT_SQUARE_BRACKET_TOKEN */) {\n return true;\n }\n return type === 2 /* LEFT_PARENTHESIS_TOKEN */ && token.type === 3 /* RIGHT_PARENTHESIS_TOKEN */;\n };\n\n var isLength = function (token) {\n return token.type === 17 /* NUMBER_TOKEN */ || token.type === 15 /* DIMENSION_TOKEN */;\n };\n\n var isLengthPercentage = function (token) {\n return token.type === 16 /* PERCENTAGE_TOKEN */ || isLength(token);\n };\n var parseLengthPercentageTuple = function (tokens) {\n return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]];\n };\n var ZERO_LENGTH = {\n type: 17 /* NUMBER_TOKEN */,\n number: 0,\n flags: FLAG_INTEGER\n };\n var FIFTY_PERCENT = {\n type: 16 /* PERCENTAGE_TOKEN */,\n number: 50,\n flags: FLAG_INTEGER\n };\n var HUNDRED_PERCENT = {\n type: 16 /* PERCENTAGE_TOKEN */,\n number: 100,\n flags: FLAG_INTEGER\n };\n var getAbsoluteValueForTuple = function (tuple, width, height) {\n var x = tuple[0], y = tuple[1];\n return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== 'undefined' ? y : x, height)];\n };\n var getAbsoluteValue = function (token, parent) {\n if (token.type === 16 /* PERCENTAGE_TOKEN */) {\n return (token.number / 100) * parent;\n }\n if (isDimensionToken(token)) {\n switch (token.unit) {\n case 'rem':\n case 'em':\n return 16 * token.number; // TODO use correct font-size\n case 'px':\n default:\n return token.number;\n }\n }\n return token.number;\n };\n\n var DEG = 'deg';\n var GRAD = 'grad';\n var RAD = 'rad';\n var TURN = 'turn';\n var angle = {\n name: 'angle',\n parse: function (_context, value) {\n if (value.type === 15 /* DIMENSION_TOKEN */) {\n switch (value.unit) {\n case DEG:\n return (Math.PI * value.number) / 180;\n case GRAD:\n return (Math.PI / 200) * value.number;\n case RAD:\n return value.number;\n case TURN:\n return Math.PI * 2 * value.number;\n }\n }\n throw new Error(\"Unsupported angle type\");\n }\n };\n var isAngle = function (value) {\n if (value.type === 15 /* DIMENSION_TOKEN */) {\n if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) {\n return true;\n }\n }\n return false;\n };\n var parseNamedSide = function (tokens) {\n var sideOrCorner = tokens\n .filter(isIdentToken)\n .map(function (ident) { return ident.value; })\n .join(' ');\n switch (sideOrCorner) {\n case 'to bottom right':\n case 'to right bottom':\n case 'left top':\n case 'top left':\n return [ZERO_LENGTH, ZERO_LENGTH];\n case 'to top':\n case 'bottom':\n return deg(0);\n case 'to bottom left':\n case 'to left bottom':\n case 'right top':\n case 'top right':\n return [ZERO_LENGTH, HUNDRED_PERCENT];\n case 'to right':\n case 'left':\n return deg(90);\n case 'to top left':\n case 'to left top':\n case 'right bottom':\n case 'bottom right':\n return [HUNDRED_PERCENT, HUNDRED_PERCENT];\n case 'to bottom':\n case 'top':\n return deg(180);\n case 'to top right':\n case 'to right top':\n case 'left bottom':\n case 'bottom left':\n return [HUNDRED_PERCENT, ZERO_LENGTH];\n case 'to left':\n case 'right':\n return deg(270);\n }\n return 0;\n };\n var deg = function (deg) { return (Math.PI * deg) / 180; };\n\n var color$1 = {\n name: 'color',\n parse: function (context, value) {\n if (value.type === 18 /* FUNCTION */) {\n var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name];\n if (typeof colorFunction === 'undefined') {\n throw new Error(\"Attempting to parse an unsupported color function \\\"\" + value.name + \"\\\"\");\n }\n return colorFunction(context, value.values);\n }\n if (value.type === 5 /* HASH_TOKEN */) {\n if (value.value.length === 3) {\n var r = value.value.substring(0, 1);\n var g = value.value.substring(1, 2);\n var b = value.value.substring(2, 3);\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1);\n }\n if (value.value.length === 4) {\n var r = value.value.substring(0, 1);\n var g = value.value.substring(1, 2);\n var b = value.value.substring(2, 3);\n var a = value.value.substring(3, 4);\n return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a + a, 16) / 255);\n }\n if (value.value.length === 6) {\n var r = value.value.substring(0, 2);\n var g = value.value.substring(2, 4);\n var b = value.value.substring(4, 6);\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1);\n }\n if (value.value.length === 8) {\n var r = value.value.substring(0, 2);\n var g = value.value.substring(2, 4);\n var b = value.value.substring(4, 6);\n var a = value.value.substring(6, 8);\n return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a, 16) / 255);\n }\n }\n if (value.type === 20 /* IDENT_TOKEN */) {\n var namedColor = COLORS[value.value.toUpperCase()];\n if (typeof namedColor !== 'undefined') {\n return namedColor;\n }\n }\n return COLORS.TRANSPARENT;\n }\n };\n var isTransparent = function (color) { return (0xff & color) === 0; };\n var asString = function (color) {\n var alpha = 0xff & color;\n var blue = 0xff & (color >> 8);\n var green = 0xff & (color >> 16);\n var red = 0xff & (color >> 24);\n return alpha < 255 ? \"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha / 255 + \")\" : \"rgb(\" + red + \",\" + green + \",\" + blue + \")\";\n };\n var pack = function (r, g, b, a) {\n return ((r << 24) | (g << 16) | (b << 8) | (Math.round(a * 255) << 0)) >>> 0;\n };\n var getTokenColorValue = function (token, i) {\n if (token.type === 17 /* NUMBER_TOKEN */) {\n return token.number;\n }\n if (token.type === 16 /* PERCENTAGE_TOKEN */) {\n var max = i === 3 ? 1 : 255;\n return i === 3 ? (token.number / 100) * max : Math.round((token.number / 100) * max);\n }\n return 0;\n };\n var rgb = function (_context, args) {\n var tokens = args.filter(nonFunctionArgSeparator);\n if (tokens.length === 3) {\n var _a = tokens.map(getTokenColorValue), r = _a[0], g = _a[1], b = _a[2];\n return pack(r, g, b, 1);\n }\n if (tokens.length === 4) {\n var _b = tokens.map(getTokenColorValue), r = _b[0], g = _b[1], b = _b[2], a = _b[3];\n return pack(r, g, b, a);\n }\n return 0;\n };\n function hue2rgb(t1, t2, hue) {\n if (hue < 0) {\n hue += 1;\n }\n if (hue >= 1) {\n hue -= 1;\n }\n if (hue < 1 / 6) {\n return (t2 - t1) * hue * 6 + t1;\n }\n else if (hue < 1 / 2) {\n return t2;\n }\n else if (hue < 2 / 3) {\n return (t2 - t1) * 6 * (2 / 3 - hue) + t1;\n }\n else {\n return t1;\n }\n }\n var hsl = function (context, args) {\n var tokens = args.filter(nonFunctionArgSeparator);\n var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3];\n var h = (hue.type === 17 /* NUMBER_TOKEN */ ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2);\n var s = isLengthPercentage(saturation) ? saturation.number / 100 : 0;\n var l = isLengthPercentage(lightness) ? lightness.number / 100 : 0;\n var a = typeof alpha !== 'undefined' && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1;\n if (s === 0) {\n return pack(l * 255, l * 255, l * 255, 1);\n }\n var t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var t1 = l * 2 - t2;\n var r = hue2rgb(t1, t2, h + 1 / 3);\n var g = hue2rgb(t1, t2, h);\n var b = hue2rgb(t1, t2, h - 1 / 3);\n return pack(r * 255, g * 255, b * 255, a);\n };\n var SUPPORTED_COLOR_FUNCTIONS = {\n hsl: hsl,\n hsla: hsl,\n rgb: rgb,\n rgba: rgb\n };\n var parseColor = function (context, value) {\n return color$1.parse(context, Parser.create(value).parseComponentValue());\n };\n var COLORS = {\n ALICEBLUE: 0xf0f8ffff,\n ANTIQUEWHITE: 0xfaebd7ff,\n AQUA: 0x00ffffff,\n AQUAMARINE: 0x7fffd4ff,\n AZURE: 0xf0ffffff,\n BEIGE: 0xf5f5dcff,\n BISQUE: 0xffe4c4ff,\n BLACK: 0x000000ff,\n BLANCHEDALMOND: 0xffebcdff,\n BLUE: 0x0000ffff,\n BLUEVIOLET: 0x8a2be2ff,\n BROWN: 0xa52a2aff,\n BURLYWOOD: 0xdeb887ff,\n CADETBLUE: 0x5f9ea0ff,\n CHARTREUSE: 0x7fff00ff,\n CHOCOLATE: 0xd2691eff,\n CORAL: 0xff7f50ff,\n CORNFLOWERBLUE: 0x6495edff,\n CORNSILK: 0xfff8dcff,\n CRIMSON: 0xdc143cff,\n CYAN: 0x00ffffff,\n DARKBLUE: 0x00008bff,\n DARKCYAN: 0x008b8bff,\n DARKGOLDENROD: 0xb886bbff,\n DARKGRAY: 0xa9a9a9ff,\n DARKGREEN: 0x006400ff,\n DARKGREY: 0xa9a9a9ff,\n DARKKHAKI: 0xbdb76bff,\n DARKMAGENTA: 0x8b008bff,\n DARKOLIVEGREEN: 0x556b2fff,\n DARKORANGE: 0xff8c00ff,\n DARKORCHID: 0x9932ccff,\n DARKRED: 0x8b0000ff,\n DARKSALMON: 0xe9967aff,\n DARKSEAGREEN: 0x8fbc8fff,\n DARKSLATEBLUE: 0x483d8bff,\n DARKSLATEGRAY: 0x2f4f4fff,\n DARKSLATEGREY: 0x2f4f4fff,\n DARKTURQUOISE: 0x00ced1ff,\n DARKVIOLET: 0x9400d3ff,\n DEEPPINK: 0xff1493ff,\n DEEPSKYBLUE: 0x00bfffff,\n DIMGRAY: 0x696969ff,\n DIMGREY: 0x696969ff,\n DODGERBLUE: 0x1e90ffff,\n FIREBRICK: 0xb22222ff,\n FLORALWHITE: 0xfffaf0ff,\n FORESTGREEN: 0x228b22ff,\n FUCHSIA: 0xff00ffff,\n GAINSBORO: 0xdcdcdcff,\n GHOSTWHITE: 0xf8f8ffff,\n GOLD: 0xffd700ff,\n GOLDENROD: 0xdaa520ff,\n GRAY: 0x808080ff,\n GREEN: 0x008000ff,\n GREENYELLOW: 0xadff2fff,\n GREY: 0x808080ff,\n HONEYDEW: 0xf0fff0ff,\n HOTPINK: 0xff69b4ff,\n INDIANRED: 0xcd5c5cff,\n INDIGO: 0x4b0082ff,\n IVORY: 0xfffff0ff,\n KHAKI: 0xf0e68cff,\n LAVENDER: 0xe6e6faff,\n LAVENDERBLUSH: 0xfff0f5ff,\n LAWNGREEN: 0x7cfc00ff,\n LEMONCHIFFON: 0xfffacdff,\n LIGHTBLUE: 0xadd8e6ff,\n LIGHTCORAL: 0xf08080ff,\n LIGHTCYAN: 0xe0ffffff,\n LIGHTGOLDENRODYELLOW: 0xfafad2ff,\n LIGHTGRAY: 0xd3d3d3ff,\n LIGHTGREEN: 0x90ee90ff,\n LIGHTGREY: 0xd3d3d3ff,\n LIGHTPINK: 0xffb6c1ff,\n LIGHTSALMON: 0xffa07aff,\n LIGHTSEAGREEN: 0x20b2aaff,\n LIGHTSKYBLUE: 0x87cefaff,\n LIGHTSLATEGRAY: 0x778899ff,\n LIGHTSLATEGREY: 0x778899ff,\n LIGHTSTEELBLUE: 0xb0c4deff,\n LIGHTYELLOW: 0xffffe0ff,\n LIME: 0x00ff00ff,\n LIMEGREEN: 0x32cd32ff,\n LINEN: 0xfaf0e6ff,\n MAGENTA: 0xff00ffff,\n MAROON: 0x800000ff,\n MEDIUMAQUAMARINE: 0x66cdaaff,\n MEDIUMBLUE: 0x0000cdff,\n MEDIUMORCHID: 0xba55d3ff,\n MEDIUMPURPLE: 0x9370dbff,\n MEDIUMSEAGREEN: 0x3cb371ff,\n MEDIUMSLATEBLUE: 0x7b68eeff,\n MEDIUMSPRINGGREEN: 0x00fa9aff,\n MEDIUMTURQUOISE: 0x48d1ccff,\n MEDIUMVIOLETRED: 0xc71585ff,\n MIDNIGHTBLUE: 0x191970ff,\n MINTCREAM: 0xf5fffaff,\n MISTYROSE: 0xffe4e1ff,\n MOCCASIN: 0xffe4b5ff,\n NAVAJOWHITE: 0xffdeadff,\n NAVY: 0x000080ff,\n OLDLACE: 0xfdf5e6ff,\n OLIVE: 0x808000ff,\n OLIVEDRAB: 0x6b8e23ff,\n ORANGE: 0xffa500ff,\n ORANGERED: 0xff4500ff,\n ORCHID: 0xda70d6ff,\n PALEGOLDENROD: 0xeee8aaff,\n PALEGREEN: 0x98fb98ff,\n PALETURQUOISE: 0xafeeeeff,\n PALEVIOLETRED: 0xdb7093ff,\n PAPAYAWHIP: 0xffefd5ff,\n PEACHPUFF: 0xffdab9ff,\n PERU: 0xcd853fff,\n PINK: 0xffc0cbff,\n PLUM: 0xdda0ddff,\n POWDERBLUE: 0xb0e0e6ff,\n PURPLE: 0x800080ff,\n REBECCAPURPLE: 0x663399ff,\n RED: 0xff0000ff,\n ROSYBROWN: 0xbc8f8fff,\n ROYALBLUE: 0x4169e1ff,\n SADDLEBROWN: 0x8b4513ff,\n SALMON: 0xfa8072ff,\n SANDYBROWN: 0xf4a460ff,\n SEAGREEN: 0x2e8b57ff,\n SEASHELL: 0xfff5eeff,\n SIENNA: 0xa0522dff,\n SILVER: 0xc0c0c0ff,\n SKYBLUE: 0x87ceebff,\n SLATEBLUE: 0x6a5acdff,\n SLATEGRAY: 0x708090ff,\n SLATEGREY: 0x708090ff,\n SNOW: 0xfffafaff,\n SPRINGGREEN: 0x00ff7fff,\n STEELBLUE: 0x4682b4ff,\n TAN: 0xd2b48cff,\n TEAL: 0x008080ff,\n THISTLE: 0xd8bfd8ff,\n TOMATO: 0xff6347ff,\n TRANSPARENT: 0x00000000,\n TURQUOISE: 0x40e0d0ff,\n VIOLET: 0xee82eeff,\n WHEAT: 0xf5deb3ff,\n WHITE: 0xffffffff,\n WHITESMOKE: 0xf5f5f5ff,\n YELLOW: 0xffff00ff,\n YELLOWGREEN: 0x9acd32ff\n };\n\n var backgroundClip = {\n name: 'background-clip',\n initialValue: 'border-box',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return tokens.map(function (token) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return 1 /* PADDING_BOX */;\n case 'content-box':\n return 2 /* CONTENT_BOX */;\n }\n }\n return 0 /* BORDER_BOX */;\n });\n }\n };\n\n var backgroundColor = {\n name: \"background-color\",\n initialValue: 'transparent',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'color'\n };\n\n var parseColorStop = function (context, args) {\n var color = color$1.parse(context, args[0]);\n var stop = args[1];\n return stop && isLengthPercentage(stop) ? { color: color, stop: stop } : { color: color, stop: null };\n };\n var processColorStops = function (stops, lineLength) {\n var first = stops[0];\n var last = stops[stops.length - 1];\n if (first.stop === null) {\n first.stop = ZERO_LENGTH;\n }\n if (last.stop === null) {\n last.stop = HUNDRED_PERCENT;\n }\n var processStops = [];\n var previous = 0;\n for (var i = 0; i < stops.length; i++) {\n var stop_1 = stops[i].stop;\n if (stop_1 !== null) {\n var absoluteValue = getAbsoluteValue(stop_1, lineLength);\n if (absoluteValue > previous) {\n processStops.push(absoluteValue);\n }\n else {\n processStops.push(previous);\n }\n previous = absoluteValue;\n }\n else {\n processStops.push(null);\n }\n }\n var gapBegin = null;\n for (var i = 0; i < processStops.length; i++) {\n var stop_2 = processStops[i];\n if (stop_2 === null) {\n if (gapBegin === null) {\n gapBegin = i;\n }\n }\n else if (gapBegin !== null) {\n var gapLength = i - gapBegin;\n var beforeGap = processStops[gapBegin - 1];\n var gapValue = (stop_2 - beforeGap) / (gapLength + 1);\n for (var g = 1; g <= gapLength; g++) {\n processStops[gapBegin + g - 1] = gapValue * g;\n }\n gapBegin = null;\n }\n }\n return stops.map(function (_a, i) {\n var color = _a.color;\n return { color: color, stop: Math.max(Math.min(1, processStops[i] / lineLength), 0) };\n });\n };\n var getAngleFromCorner = function (corner, width, height) {\n var centerX = width / 2;\n var centerY = height / 2;\n var x = getAbsoluteValue(corner[0], width) - centerX;\n var y = centerY - getAbsoluteValue(corner[1], height);\n return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2);\n };\n var calculateGradientDirection = function (angle, width, height) {\n var radian = typeof angle === 'number' ? angle : getAngleFromCorner(angle, width, height);\n var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian));\n var halfWidth = width / 2;\n var halfHeight = height / 2;\n var halfLineLength = lineLength / 2;\n var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength;\n var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength;\n return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff];\n };\n var distance = function (a, b) { return Math.sqrt(a * a + b * b); };\n var findCorner = function (width, height, x, y, closest) {\n var corners = [\n [0, 0],\n [0, height],\n [width, 0],\n [width, height]\n ];\n return corners.reduce(function (stat, corner) {\n var cx = corner[0], cy = corner[1];\n var d = distance(x - cx, y - cy);\n if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {\n return {\n optimumCorner: corner,\n optimumDistance: d\n };\n }\n return stat;\n }, {\n optimumDistance: closest ? Infinity : -Infinity,\n optimumCorner: null\n }).optimumCorner;\n };\n var calculateRadius = function (gradient, x, y, width, height) {\n var rx = 0;\n var ry = 0;\n switch (gradient.size) {\n case 0 /* CLOSEST_SIDE */:\n // The ending shape is sized so that that it exactly meets the side of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, it exactly meets the closest side in each dimension.\n if (gradient.shape === 0 /* CIRCLE */) {\n rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n }\n else if (gradient.shape === 1 /* ELLIPSE */) {\n rx = Math.min(Math.abs(x), Math.abs(x - width));\n ry = Math.min(Math.abs(y), Math.abs(y - height));\n }\n break;\n case 2 /* CLOSEST_CORNER */:\n // The ending shape is sized so that that it passes through the corner of the gradient box closest to the gradient’s center.\n // If the shape is an ellipse, the ending shape is given the same aspect-ratio it would have if closest-side were specified.\n if (gradient.shape === 0 /* CIRCLE */) {\n rx = ry = Math.min(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));\n }\n else if (gradient.shape === 1 /* ELLIPSE */) {\n // Compute the ratio ry/rx (which is to be the same as for \"closest-side\")\n var c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width));\n var _a = findCorner(width, height, x, y, true), cx = _a[0], cy = _a[1];\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n case 1 /* FARTHEST_SIDE */:\n // Same as closest-side, except the ending shape is sized based on the farthest side(s)\n if (gradient.shape === 0 /* CIRCLE */) {\n rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height));\n }\n else if (gradient.shape === 1 /* ELLIPSE */) {\n rx = Math.max(Math.abs(x), Math.abs(x - width));\n ry = Math.max(Math.abs(y), Math.abs(y - height));\n }\n break;\n case 3 /* FARTHEST_CORNER */:\n // Same as closest-corner, except the ending shape is sized based on the farthest corner.\n // If the shape is an ellipse, the ending shape is given the same aspect ratio it would have if farthest-side were specified.\n if (gradient.shape === 0 /* CIRCLE */) {\n rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height));\n }\n else if (gradient.shape === 1 /* ELLIPSE */) {\n // Compute the ratio ry/rx (which is to be the same as for \"farthest-side\")\n var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width));\n var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1];\n rx = distance(cx - x, (cy - y) / c);\n ry = c * rx;\n }\n break;\n }\n if (Array.isArray(gradient.size)) {\n rx = getAbsoluteValue(gradient.size[0], width);\n ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx;\n }\n return [rx, ry];\n };\n\n var linearGradient = function (context, tokens) {\n var angle$1 = deg(180);\n var stops = [];\n parseFunctionArgs(tokens).forEach(function (arg, i) {\n if (i === 0) {\n var firstToken = arg[0];\n if (firstToken.type === 20 /* IDENT_TOKEN */ && firstToken.value === 'to') {\n angle$1 = parseNamedSide(arg);\n return;\n }\n else if (isAngle(firstToken)) {\n angle$1 = angle.parse(context, firstToken);\n return;\n }\n }\n var colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n return { angle: angle$1, stops: stops, type: 1 /* LINEAR_GRADIENT */ };\n };\n\n var prefixLinearGradient = function (context, tokens) {\n var angle$1 = deg(180);\n var stops = [];\n parseFunctionArgs(tokens).forEach(function (arg, i) {\n if (i === 0) {\n var firstToken = arg[0];\n if (firstToken.type === 20 /* IDENT_TOKEN */ &&\n ['top', 'left', 'right', 'bottom'].indexOf(firstToken.value) !== -1) {\n angle$1 = parseNamedSide(arg);\n return;\n }\n else if (isAngle(firstToken)) {\n angle$1 = (angle.parse(context, firstToken) + deg(270)) % deg(360);\n return;\n }\n }\n var colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n });\n return {\n angle: angle$1,\n stops: stops,\n type: 1 /* LINEAR_GRADIENT */\n };\n };\n\n var webkitGradient = function (context, tokens) {\n var angle = deg(180);\n var stops = [];\n var type = 1 /* LINEAR_GRADIENT */;\n var shape = 0 /* CIRCLE */;\n var size = 3 /* FARTHEST_CORNER */;\n var position = [];\n parseFunctionArgs(tokens).forEach(function (arg, i) {\n var firstToken = arg[0];\n if (i === 0) {\n if (isIdentToken(firstToken) && firstToken.value === 'linear') {\n type = 1 /* LINEAR_GRADIENT */;\n return;\n }\n else if (isIdentToken(firstToken) && firstToken.value === 'radial') {\n type = 2 /* RADIAL_GRADIENT */;\n return;\n }\n }\n if (firstToken.type === 18 /* FUNCTION */) {\n if (firstToken.name === 'from') {\n var color = color$1.parse(context, firstToken.values[0]);\n stops.push({ stop: ZERO_LENGTH, color: color });\n }\n else if (firstToken.name === 'to') {\n var color = color$1.parse(context, firstToken.values[0]);\n stops.push({ stop: HUNDRED_PERCENT, color: color });\n }\n else if (firstToken.name === 'color-stop') {\n var values = firstToken.values.filter(nonFunctionArgSeparator);\n if (values.length === 2) {\n var color = color$1.parse(context, values[1]);\n var stop_1 = values[0];\n if (isNumberToken(stop_1)) {\n stops.push({\n stop: { type: 16 /* PERCENTAGE_TOKEN */, number: stop_1.number * 100, flags: stop_1.flags },\n color: color\n });\n }\n }\n }\n }\n });\n return type === 1 /* LINEAR_GRADIENT */\n ? {\n angle: (angle + deg(180)) % deg(360),\n stops: stops,\n type: type\n }\n : { size: size, shape: shape, stops: stops, position: position, type: type };\n };\n\n var CLOSEST_SIDE = 'closest-side';\n var FARTHEST_SIDE = 'farthest-side';\n var CLOSEST_CORNER = 'closest-corner';\n var FARTHEST_CORNER = 'farthest-corner';\n var CIRCLE = 'circle';\n var ELLIPSE = 'ellipse';\n var COVER = 'cover';\n var CONTAIN = 'contain';\n var radialGradient = function (context, tokens) {\n var shape = 0 /* CIRCLE */;\n var size = 3 /* FARTHEST_CORNER */;\n var stops = [];\n var position = [];\n parseFunctionArgs(tokens).forEach(function (arg, i) {\n var isColorStop = true;\n if (i === 0) {\n var isAtPosition_1 = false;\n isColorStop = arg.reduce(function (acc, token) {\n if (isAtPosition_1) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return acc;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return acc;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return acc;\n }\n }\n else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n }\n }\n else if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = 0 /* CIRCLE */;\n return false;\n case ELLIPSE:\n shape = 1 /* ELLIPSE */;\n return false;\n case 'at':\n isAtPosition_1 = true;\n return false;\n case CLOSEST_SIDE:\n size = 0 /* CLOSEST_SIDE */;\n return false;\n case COVER:\n case FARTHEST_SIDE:\n size = 1 /* FARTHEST_SIDE */;\n return false;\n case CONTAIN:\n case CLOSEST_CORNER:\n size = 2 /* CLOSEST_CORNER */;\n return false;\n case FARTHEST_CORNER:\n size = 3 /* FARTHEST_CORNER */;\n return false;\n }\n }\n else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n if (isColorStop) {\n var colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n return { size: size, shape: shape, stops: stops, position: position, type: 2 /* RADIAL_GRADIENT */ };\n };\n\n var prefixRadialGradient = function (context, tokens) {\n var shape = 0 /* CIRCLE */;\n var size = 3 /* FARTHEST_CORNER */;\n var stops = [];\n var position = [];\n parseFunctionArgs(tokens).forEach(function (arg, i) {\n var isColorStop = true;\n if (i === 0) {\n isColorStop = arg.reduce(function (acc, token) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'center':\n position.push(FIFTY_PERCENT);\n return false;\n case 'top':\n case 'left':\n position.push(ZERO_LENGTH);\n return false;\n case 'right':\n case 'bottom':\n position.push(HUNDRED_PERCENT);\n return false;\n }\n }\n else if (isLengthPercentage(token) || isLength(token)) {\n position.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n else if (i === 1) {\n isColorStop = arg.reduce(function (acc, token) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case CIRCLE:\n shape = 0 /* CIRCLE */;\n return false;\n case ELLIPSE:\n shape = 1 /* ELLIPSE */;\n return false;\n case CONTAIN:\n case CLOSEST_SIDE:\n size = 0 /* CLOSEST_SIDE */;\n return false;\n case FARTHEST_SIDE:\n size = 1 /* FARTHEST_SIDE */;\n return false;\n case CLOSEST_CORNER:\n size = 2 /* CLOSEST_CORNER */;\n return false;\n case COVER:\n case FARTHEST_CORNER:\n size = 3 /* FARTHEST_CORNER */;\n return false;\n }\n }\n else if (isLength(token) || isLengthPercentage(token)) {\n if (!Array.isArray(size)) {\n size = [];\n }\n size.push(token);\n return false;\n }\n return acc;\n }, isColorStop);\n }\n if (isColorStop) {\n var colorStop = parseColorStop(context, arg);\n stops.push(colorStop);\n }\n });\n return { size: size, shape: shape, stops: stops, position: position, type: 2 /* RADIAL_GRADIENT */ };\n };\n\n var isLinearGradient = function (background) {\n return background.type === 1 /* LINEAR_GRADIENT */;\n };\n var isRadialGradient = function (background) {\n return background.type === 2 /* RADIAL_GRADIENT */;\n };\n var image = {\n name: 'image',\n parse: function (context, value) {\n if (value.type === 22 /* URL_TOKEN */) {\n var image_1 = { url: value.value, type: 0 /* URL */ };\n context.cache.addImage(value.value);\n return image_1;\n }\n if (value.type === 18 /* FUNCTION */) {\n var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name];\n if (typeof imageFunction === 'undefined') {\n throw new Error(\"Attempting to parse an unsupported image function \\\"\" + value.name + \"\\\"\");\n }\n return imageFunction(context, value.values);\n }\n throw new Error(\"Unsupported image type \" + value.type);\n }\n };\n function isSupportedImage(value) {\n return (!(value.type === 20 /* IDENT_TOKEN */ && value.value === 'none') &&\n (value.type !== 18 /* FUNCTION */ || !!SUPPORTED_IMAGE_FUNCTIONS[value.name]));\n }\n var SUPPORTED_IMAGE_FUNCTIONS = {\n 'linear-gradient': linearGradient,\n '-moz-linear-gradient': prefixLinearGradient,\n '-ms-linear-gradient': prefixLinearGradient,\n '-o-linear-gradient': prefixLinearGradient,\n '-webkit-linear-gradient': prefixLinearGradient,\n 'radial-gradient': radialGradient,\n '-moz-radial-gradient': prefixRadialGradient,\n '-ms-radial-gradient': prefixRadialGradient,\n '-o-radial-gradient': prefixRadialGradient,\n '-webkit-radial-gradient': prefixRadialGradient,\n '-webkit-gradient': webkitGradient\n };\n\n var backgroundImage = {\n name: 'background-image',\n initialValue: 'none',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (context, tokens) {\n if (tokens.length === 0) {\n return [];\n }\n var first = tokens[0];\n if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {\n return [];\n }\n return tokens\n .filter(function (value) { return nonFunctionArgSeparator(value) && isSupportedImage(value); })\n .map(function (value) { return image.parse(context, value); });\n }\n };\n\n var backgroundOrigin = {\n name: 'background-origin',\n initialValue: 'border-box',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return tokens.map(function (token) {\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'padding-box':\n return 1 /* PADDING_BOX */;\n case 'content-box':\n return 2 /* CONTENT_BOX */;\n }\n }\n return 0 /* BORDER_BOX */;\n });\n }\n };\n\n var backgroundPosition = {\n name: 'background-position',\n initialValue: '0% 0%',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (_context, tokens) {\n return parseFunctionArgs(tokens)\n .map(function (values) { return values.filter(isLengthPercentage); })\n .map(parseLengthPercentageTuple);\n }\n };\n\n var backgroundRepeat = {\n name: 'background-repeat',\n initialValue: 'repeat',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return parseFunctionArgs(tokens)\n .map(function (values) {\n return values\n .filter(isIdentToken)\n .map(function (token) { return token.value; })\n .join(' ');\n })\n .map(parseBackgroundRepeat);\n }\n };\n var parseBackgroundRepeat = function (value) {\n switch (value) {\n case 'no-repeat':\n return 1 /* NO_REPEAT */;\n case 'repeat-x':\n case 'repeat no-repeat':\n return 2 /* REPEAT_X */;\n case 'repeat-y':\n case 'no-repeat repeat':\n return 3 /* REPEAT_Y */;\n case 'repeat':\n default:\n return 0 /* REPEAT */;\n }\n };\n\n var BACKGROUND_SIZE;\n (function (BACKGROUND_SIZE) {\n BACKGROUND_SIZE[\"AUTO\"] = \"auto\";\n BACKGROUND_SIZE[\"CONTAIN\"] = \"contain\";\n BACKGROUND_SIZE[\"COVER\"] = \"cover\";\n })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {}));\n var backgroundSize = {\n name: 'background-size',\n initialValue: '0',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return parseFunctionArgs(tokens).map(function (values) { return values.filter(isBackgroundSizeInfoToken); });\n }\n };\n var isBackgroundSizeInfoToken = function (value) {\n return isIdentToken(value) || isLengthPercentage(value);\n };\n\n var borderColorForSide = function (side) { return ({\n name: \"border-\" + side + \"-color\",\n initialValue: 'transparent',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'color'\n }); };\n var borderTopColor = borderColorForSide('top');\n var borderRightColor = borderColorForSide('right');\n var borderBottomColor = borderColorForSide('bottom');\n var borderLeftColor = borderColorForSide('left');\n\n var borderRadiusForSide = function (side) { return ({\n name: \"border-radius-\" + side,\n initialValue: '0 0',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return parseLengthPercentageTuple(tokens.filter(isLengthPercentage));\n }\n }); };\n var borderTopLeftRadius = borderRadiusForSide('top-left');\n var borderTopRightRadius = borderRadiusForSide('top-right');\n var borderBottomRightRadius = borderRadiusForSide('bottom-right');\n var borderBottomLeftRadius = borderRadiusForSide('bottom-left');\n\n var borderStyleForSide = function (side) { return ({\n name: \"border-\" + side + \"-style\",\n initialValue: 'solid',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, style) {\n switch (style) {\n case 'none':\n return 0 /* NONE */;\n case 'dashed':\n return 2 /* DASHED */;\n case 'dotted':\n return 3 /* DOTTED */;\n case 'double':\n return 4 /* DOUBLE */;\n }\n return 1 /* SOLID */;\n }\n }); };\n var borderTopStyle = borderStyleForSide('top');\n var borderRightStyle = borderStyleForSide('right');\n var borderBottomStyle = borderStyleForSide('bottom');\n var borderLeftStyle = borderStyleForSide('left');\n\n var borderWidthForSide = function (side) { return ({\n name: \"border-\" + side + \"-width\",\n initialValue: '0',\n type: 0 /* VALUE */,\n prefix: false,\n parse: function (_context, token) {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n }); };\n var borderTopWidth = borderWidthForSide('top');\n var borderRightWidth = borderWidthForSide('right');\n var borderBottomWidth = borderWidthForSide('bottom');\n var borderLeftWidth = borderWidthForSide('left');\n\n var color = {\n name: \"color\",\n initialValue: 'transparent',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'color'\n };\n\n var direction = {\n name: 'direction',\n initialValue: 'ltr',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, direction) {\n switch (direction) {\n case 'rtl':\n return 1 /* RTL */;\n case 'ltr':\n default:\n return 0 /* LTR */;\n }\n }\n };\n\n var display = {\n name: 'display',\n initialValue: 'inline-block',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return tokens.filter(isIdentToken).reduce(function (bit, token) {\n return bit | parseDisplayValue(token.value);\n }, 0 /* NONE */);\n }\n };\n var parseDisplayValue = function (display) {\n switch (display) {\n case 'block':\n case '-webkit-box':\n return 2 /* BLOCK */;\n case 'inline':\n return 4 /* INLINE */;\n case 'run-in':\n return 8 /* RUN_IN */;\n case 'flow':\n return 16 /* FLOW */;\n case 'flow-root':\n return 32 /* FLOW_ROOT */;\n case 'table':\n return 64 /* TABLE */;\n case 'flex':\n case '-webkit-flex':\n return 128 /* FLEX */;\n case 'grid':\n case '-ms-grid':\n return 256 /* GRID */;\n case 'ruby':\n return 512 /* RUBY */;\n case 'subgrid':\n return 1024 /* SUBGRID */;\n case 'list-item':\n return 2048 /* LIST_ITEM */;\n case 'table-row-group':\n return 4096 /* TABLE_ROW_GROUP */;\n case 'table-header-group':\n return 8192 /* TABLE_HEADER_GROUP */;\n case 'table-footer-group':\n return 16384 /* TABLE_FOOTER_GROUP */;\n case 'table-row':\n return 32768 /* TABLE_ROW */;\n case 'table-cell':\n return 65536 /* TABLE_CELL */;\n case 'table-column-group':\n return 131072 /* TABLE_COLUMN_GROUP */;\n case 'table-column':\n return 262144 /* TABLE_COLUMN */;\n case 'table-caption':\n return 524288 /* TABLE_CAPTION */;\n case 'ruby-base':\n return 1048576 /* RUBY_BASE */;\n case 'ruby-text':\n return 2097152 /* RUBY_TEXT */;\n case 'ruby-base-container':\n return 4194304 /* RUBY_BASE_CONTAINER */;\n case 'ruby-text-container':\n return 8388608 /* RUBY_TEXT_CONTAINER */;\n case 'contents':\n return 16777216 /* CONTENTS */;\n case 'inline-block':\n return 33554432 /* INLINE_BLOCK */;\n case 'inline-list-item':\n return 67108864 /* INLINE_LIST_ITEM */;\n case 'inline-table':\n return 134217728 /* INLINE_TABLE */;\n case 'inline-flex':\n return 268435456 /* INLINE_FLEX */;\n case 'inline-grid':\n return 536870912 /* INLINE_GRID */;\n }\n return 0 /* NONE */;\n };\n\n var float = {\n name: 'float',\n initialValue: 'none',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, float) {\n switch (float) {\n case 'left':\n return 1 /* LEFT */;\n case 'right':\n return 2 /* RIGHT */;\n case 'inline-start':\n return 3 /* INLINE_START */;\n case 'inline-end':\n return 4 /* INLINE_END */;\n }\n return 0 /* NONE */;\n }\n };\n\n var letterSpacing = {\n name: 'letter-spacing',\n initialValue: '0',\n prefix: false,\n type: 0 /* VALUE */,\n parse: function (_context, token) {\n if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'normal') {\n return 0;\n }\n if (token.type === 17 /* NUMBER_TOKEN */) {\n return token.number;\n }\n if (token.type === 15 /* DIMENSION_TOKEN */) {\n return token.number;\n }\n return 0;\n }\n };\n\n var LINE_BREAK;\n (function (LINE_BREAK) {\n LINE_BREAK[\"NORMAL\"] = \"normal\";\n LINE_BREAK[\"STRICT\"] = \"strict\";\n })(LINE_BREAK || (LINE_BREAK = {}));\n var lineBreak = {\n name: 'line-break',\n initialValue: 'normal',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, lineBreak) {\n switch (lineBreak) {\n case 'strict':\n return LINE_BREAK.STRICT;\n case 'normal':\n default:\n return LINE_BREAK.NORMAL;\n }\n }\n };\n\n var lineHeight = {\n name: 'line-height',\n initialValue: 'normal',\n prefix: false,\n type: 4 /* TOKEN_VALUE */\n };\n var computeLineHeight = function (token, fontSize) {\n if (isIdentToken(token) && token.value === 'normal') {\n return 1.2 * fontSize;\n }\n else if (token.type === 17 /* NUMBER_TOKEN */) {\n return fontSize * token.number;\n }\n else if (isLengthPercentage(token)) {\n return getAbsoluteValue(token, fontSize);\n }\n return fontSize;\n };\n\n var listStyleImage = {\n name: 'list-style-image',\n initialValue: 'none',\n type: 0 /* VALUE */,\n prefix: false,\n parse: function (context, token) {\n if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'none') {\n return null;\n }\n return image.parse(context, token);\n }\n };\n\n var listStylePosition = {\n name: 'list-style-position',\n initialValue: 'outside',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, position) {\n switch (position) {\n case 'inside':\n return 0 /* INSIDE */;\n case 'outside':\n default:\n return 1 /* OUTSIDE */;\n }\n }\n };\n\n var listStyleType = {\n name: 'list-style-type',\n initialValue: 'none',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, type) {\n switch (type) {\n case 'disc':\n return 0 /* DISC */;\n case 'circle':\n return 1 /* CIRCLE */;\n case 'square':\n return 2 /* SQUARE */;\n case 'decimal':\n return 3 /* DECIMAL */;\n case 'cjk-decimal':\n return 4 /* CJK_DECIMAL */;\n case 'decimal-leading-zero':\n return 5 /* DECIMAL_LEADING_ZERO */;\n case 'lower-roman':\n return 6 /* LOWER_ROMAN */;\n case 'upper-roman':\n return 7 /* UPPER_ROMAN */;\n case 'lower-greek':\n return 8 /* LOWER_GREEK */;\n case 'lower-alpha':\n return 9 /* LOWER_ALPHA */;\n case 'upper-alpha':\n return 10 /* UPPER_ALPHA */;\n case 'arabic-indic':\n return 11 /* ARABIC_INDIC */;\n case 'armenian':\n return 12 /* ARMENIAN */;\n case 'bengali':\n return 13 /* BENGALI */;\n case 'cambodian':\n return 14 /* CAMBODIAN */;\n case 'cjk-earthly-branch':\n return 15 /* CJK_EARTHLY_BRANCH */;\n case 'cjk-heavenly-stem':\n return 16 /* CJK_HEAVENLY_STEM */;\n case 'cjk-ideographic':\n return 17 /* CJK_IDEOGRAPHIC */;\n case 'devanagari':\n return 18 /* DEVANAGARI */;\n case 'ethiopic-numeric':\n return 19 /* ETHIOPIC_NUMERIC */;\n case 'georgian':\n return 20 /* GEORGIAN */;\n case 'gujarati':\n return 21 /* GUJARATI */;\n case 'gurmukhi':\n return 22 /* GURMUKHI */;\n case 'hebrew':\n return 22 /* HEBREW */;\n case 'hiragana':\n return 23 /* HIRAGANA */;\n case 'hiragana-iroha':\n return 24 /* HIRAGANA_IROHA */;\n case 'japanese-formal':\n return 25 /* JAPANESE_FORMAL */;\n case 'japanese-informal':\n return 26 /* JAPANESE_INFORMAL */;\n case 'kannada':\n return 27 /* KANNADA */;\n case 'katakana':\n return 28 /* KATAKANA */;\n case 'katakana-iroha':\n return 29 /* KATAKANA_IROHA */;\n case 'khmer':\n return 30 /* KHMER */;\n case 'korean-hangul-formal':\n return 31 /* KOREAN_HANGUL_FORMAL */;\n case 'korean-hanja-formal':\n return 32 /* KOREAN_HANJA_FORMAL */;\n case 'korean-hanja-informal':\n return 33 /* KOREAN_HANJA_INFORMAL */;\n case 'lao':\n return 34 /* LAO */;\n case 'lower-armenian':\n return 35 /* LOWER_ARMENIAN */;\n case 'malayalam':\n return 36 /* MALAYALAM */;\n case 'mongolian':\n return 37 /* MONGOLIAN */;\n case 'myanmar':\n return 38 /* MYANMAR */;\n case 'oriya':\n return 39 /* ORIYA */;\n case 'persian':\n return 40 /* PERSIAN */;\n case 'simp-chinese-formal':\n return 41 /* SIMP_CHINESE_FORMAL */;\n case 'simp-chinese-informal':\n return 42 /* SIMP_CHINESE_INFORMAL */;\n case 'tamil':\n return 43 /* TAMIL */;\n case 'telugu':\n return 44 /* TELUGU */;\n case 'thai':\n return 45 /* THAI */;\n case 'tibetan':\n return 46 /* TIBETAN */;\n case 'trad-chinese-formal':\n return 47 /* TRAD_CHINESE_FORMAL */;\n case 'trad-chinese-informal':\n return 48 /* TRAD_CHINESE_INFORMAL */;\n case 'upper-armenian':\n return 49 /* UPPER_ARMENIAN */;\n case 'disclosure-open':\n return 50 /* DISCLOSURE_OPEN */;\n case 'disclosure-closed':\n return 51 /* DISCLOSURE_CLOSED */;\n case 'none':\n default:\n return -1 /* NONE */;\n }\n }\n };\n\n var marginForSide = function (side) { return ({\n name: \"margin-\" + side,\n initialValue: '0',\n prefix: false,\n type: 4 /* TOKEN_VALUE */\n }); };\n var marginTop = marginForSide('top');\n var marginRight = marginForSide('right');\n var marginBottom = marginForSide('bottom');\n var marginLeft = marginForSide('left');\n\n var overflow = {\n name: 'overflow',\n initialValue: 'visible',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return tokens.filter(isIdentToken).map(function (overflow) {\n switch (overflow.value) {\n case 'hidden':\n return 1 /* HIDDEN */;\n case 'scroll':\n return 2 /* SCROLL */;\n case 'clip':\n return 3 /* CLIP */;\n case 'auto':\n return 4 /* AUTO */;\n case 'visible':\n default:\n return 0 /* VISIBLE */;\n }\n });\n }\n };\n\n var overflowWrap = {\n name: 'overflow-wrap',\n initialValue: 'normal',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, overflow) {\n switch (overflow) {\n case 'break-word':\n return \"break-word\" /* BREAK_WORD */;\n case 'normal':\n default:\n return \"normal\" /* NORMAL */;\n }\n }\n };\n\n var paddingForSide = function (side) { return ({\n name: \"padding-\" + side,\n initialValue: '0',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'length-percentage'\n }); };\n var paddingTop = paddingForSide('top');\n var paddingRight = paddingForSide('right');\n var paddingBottom = paddingForSide('bottom');\n var paddingLeft = paddingForSide('left');\n\n var textAlign = {\n name: 'text-align',\n initialValue: 'left',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, textAlign) {\n switch (textAlign) {\n case 'right':\n return 2 /* RIGHT */;\n case 'center':\n case 'justify':\n return 1 /* CENTER */;\n case 'left':\n default:\n return 0 /* LEFT */;\n }\n }\n };\n\n var position = {\n name: 'position',\n initialValue: 'static',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, position) {\n switch (position) {\n case 'relative':\n return 1 /* RELATIVE */;\n case 'absolute':\n return 2 /* ABSOLUTE */;\n case 'fixed':\n return 3 /* FIXED */;\n case 'sticky':\n return 4 /* STICKY */;\n }\n return 0 /* STATIC */;\n }\n };\n\n var textShadow = {\n name: 'text-shadow',\n initialValue: 'none',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (context, tokens) {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n return parseFunctionArgs(tokens).map(function (values) {\n var shadow = {\n color: COLORS.TRANSPARENT,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH\n };\n var c = 0;\n for (var i = 0; i < values.length; i++) {\n var token = values[i];\n if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n }\n else if (c === 1) {\n shadow.offsetY = token;\n }\n else {\n shadow.blur = token;\n }\n c++;\n }\n else {\n shadow.color = color$1.parse(context, token);\n }\n }\n return shadow;\n });\n }\n };\n\n var textTransform = {\n name: 'text-transform',\n initialValue: 'none',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, textTransform) {\n switch (textTransform) {\n case 'uppercase':\n return 2 /* UPPERCASE */;\n case 'lowercase':\n return 1 /* LOWERCASE */;\n case 'capitalize':\n return 3 /* CAPITALIZE */;\n }\n return 0 /* NONE */;\n }\n };\n\n var transform$1 = {\n name: 'transform',\n initialValue: 'none',\n prefix: true,\n type: 0 /* VALUE */,\n parse: function (_context, token) {\n if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'none') {\n return null;\n }\n if (token.type === 18 /* FUNCTION */) {\n var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name];\n if (typeof transformFunction === 'undefined') {\n throw new Error(\"Attempting to parse an unsupported transform function \\\"\" + token.name + \"\\\"\");\n }\n return transformFunction(token.values);\n }\n return null;\n }\n };\n var matrix = function (args) {\n var values = args.filter(function (arg) { return arg.type === 17 /* NUMBER_TOKEN */; }).map(function (arg) { return arg.number; });\n return values.length === 6 ? values : null;\n };\n // doesn't support 3D transforms at the moment\n var matrix3d = function (args) {\n var values = args.filter(function (arg) { return arg.type === 17 /* NUMBER_TOKEN */; }).map(function (arg) { return arg.number; });\n var a1 = values[0], b1 = values[1]; values[2]; values[3]; var a2 = values[4], b2 = values[5]; values[6]; values[7]; values[8]; values[9]; values[10]; values[11]; var a4 = values[12], b4 = values[13]; values[14]; values[15];\n return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null;\n };\n var SUPPORTED_TRANSFORM_FUNCTIONS = {\n matrix: matrix,\n matrix3d: matrix3d\n };\n\n var DEFAULT_VALUE = {\n type: 16 /* PERCENTAGE_TOKEN */,\n number: 50,\n flags: FLAG_INTEGER\n };\n var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE];\n var transformOrigin = {\n name: 'transform-origin',\n initialValue: '50% 50%',\n prefix: true,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n var origins = tokens.filter(isLengthPercentage);\n if (origins.length !== 2) {\n return DEFAULT;\n }\n return [origins[0], origins[1]];\n }\n };\n\n var visibility = {\n name: 'visible',\n initialValue: 'none',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, visibility) {\n switch (visibility) {\n case 'hidden':\n return 1 /* HIDDEN */;\n case 'collapse':\n return 2 /* COLLAPSE */;\n case 'visible':\n default:\n return 0 /* VISIBLE */;\n }\n }\n };\n\n var WORD_BREAK;\n (function (WORD_BREAK) {\n WORD_BREAK[\"NORMAL\"] = \"normal\";\n WORD_BREAK[\"BREAK_ALL\"] = \"break-all\";\n WORD_BREAK[\"KEEP_ALL\"] = \"keep-all\";\n })(WORD_BREAK || (WORD_BREAK = {}));\n var wordBreak = {\n name: 'word-break',\n initialValue: 'normal',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, wordBreak) {\n switch (wordBreak) {\n case 'break-all':\n return WORD_BREAK.BREAK_ALL;\n case 'keep-all':\n return WORD_BREAK.KEEP_ALL;\n case 'normal':\n default:\n return WORD_BREAK.NORMAL;\n }\n }\n };\n\n var zIndex = {\n name: 'z-index',\n initialValue: 'auto',\n prefix: false,\n type: 0 /* VALUE */,\n parse: function (_context, token) {\n if (token.type === 20 /* IDENT_TOKEN */) {\n return { auto: true, order: 0 };\n }\n if (isNumberToken(token)) {\n return { auto: false, order: token.number };\n }\n throw new Error(\"Invalid z-index number parsed\");\n }\n };\n\n var time = {\n name: 'time',\n parse: function (_context, value) {\n if (value.type === 15 /* DIMENSION_TOKEN */) {\n switch (value.unit.toLowerCase()) {\n case 's':\n return 1000 * value.number;\n case 'ms':\n return value.number;\n }\n }\n throw new Error(\"Unsupported time type\");\n }\n };\n\n var opacity = {\n name: 'opacity',\n initialValue: '1',\n type: 0 /* VALUE */,\n prefix: false,\n parse: function (_context, token) {\n if (isNumberToken(token)) {\n return token.number;\n }\n return 1;\n }\n };\n\n var textDecorationColor = {\n name: \"text-decoration-color\",\n initialValue: 'transparent',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'color'\n };\n\n var textDecorationLine = {\n name: 'text-decoration-line',\n initialValue: 'none',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n return tokens\n .filter(isIdentToken)\n .map(function (token) {\n switch (token.value) {\n case 'underline':\n return 1 /* UNDERLINE */;\n case 'overline':\n return 2 /* OVERLINE */;\n case 'line-through':\n return 3 /* LINE_THROUGH */;\n case 'none':\n return 4 /* BLINK */;\n }\n return 0 /* NONE */;\n })\n .filter(function (line) { return line !== 0 /* NONE */; });\n }\n };\n\n var fontFamily = {\n name: \"font-family\",\n initialValue: '',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n var accumulator = [];\n var results = [];\n tokens.forEach(function (token) {\n switch (token.type) {\n case 20 /* IDENT_TOKEN */:\n case 0 /* STRING_TOKEN */:\n accumulator.push(token.value);\n break;\n case 17 /* NUMBER_TOKEN */:\n accumulator.push(token.number.toString());\n break;\n case 4 /* COMMA_TOKEN */:\n results.push(accumulator.join(' '));\n accumulator.length = 0;\n break;\n }\n });\n if (accumulator.length) {\n results.push(accumulator.join(' '));\n }\n return results.map(function (result) { return (result.indexOf(' ') === -1 ? result : \"'\" + result + \"'\"); });\n }\n };\n\n var fontSize = {\n name: \"font-size\",\n initialValue: '0',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'length'\n };\n\n var fontWeight = {\n name: 'font-weight',\n initialValue: 'normal',\n type: 0 /* VALUE */,\n prefix: false,\n parse: function (_context, token) {\n if (isNumberToken(token)) {\n return token.number;\n }\n if (isIdentToken(token)) {\n switch (token.value) {\n case 'bold':\n return 700;\n case 'normal':\n default:\n return 400;\n }\n }\n return 400;\n }\n };\n\n var fontVariant = {\n name: 'font-variant',\n initialValue: 'none',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (_context, tokens) {\n return tokens.filter(isIdentToken).map(function (token) { return token.value; });\n }\n };\n\n var fontStyle = {\n name: 'font-style',\n initialValue: 'normal',\n prefix: false,\n type: 2 /* IDENT_VALUE */,\n parse: function (_context, overflow) {\n switch (overflow) {\n case 'oblique':\n return \"oblique\" /* OBLIQUE */;\n case 'italic':\n return \"italic\" /* ITALIC */;\n case 'normal':\n default:\n return \"normal\" /* NORMAL */;\n }\n }\n };\n\n var contains = function (bit, value) { return (bit & value) !== 0; };\n\n var content = {\n name: 'content',\n initialValue: 'none',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (_context, tokens) {\n if (tokens.length === 0) {\n return [];\n }\n var first = tokens[0];\n if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {\n return [];\n }\n return tokens;\n }\n };\n\n var counterIncrement = {\n name: 'counter-increment',\n initialValue: 'none',\n prefix: true,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n if (tokens.length === 0) {\n return null;\n }\n var first = tokens[0];\n if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {\n return null;\n }\n var increments = [];\n var filtered = tokens.filter(nonWhiteSpace);\n for (var i = 0; i < filtered.length; i++) {\n var counter = filtered[i];\n var next = filtered[i + 1];\n if (counter.type === 20 /* IDENT_TOKEN */) {\n var increment = next && isNumberToken(next) ? next.number : 1;\n increments.push({ counter: counter.value, increment: increment });\n }\n }\n return increments;\n }\n };\n\n var counterReset = {\n name: 'counter-reset',\n initialValue: 'none',\n prefix: true,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n if (tokens.length === 0) {\n return [];\n }\n var resets = [];\n var filtered = tokens.filter(nonWhiteSpace);\n for (var i = 0; i < filtered.length; i++) {\n var counter = filtered[i];\n var next = filtered[i + 1];\n if (isIdentToken(counter) && counter.value !== 'none') {\n var reset = next && isNumberToken(next) ? next.number : 0;\n resets.push({ counter: counter.value, reset: reset });\n }\n }\n return resets;\n }\n };\n\n var duration = {\n name: 'duration',\n initialValue: '0s',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (context, tokens) {\n return tokens.filter(isDimensionToken).map(function (token) { return time.parse(context, token); });\n }\n };\n\n var quotes = {\n name: 'quotes',\n initialValue: 'none',\n prefix: true,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n if (tokens.length === 0) {\n return null;\n }\n var first = tokens[0];\n if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {\n return null;\n }\n var quotes = [];\n var filtered = tokens.filter(isStringToken);\n if (filtered.length % 2 !== 0) {\n return null;\n }\n for (var i = 0; i < filtered.length; i += 2) {\n var open_1 = filtered[i].value;\n var close_1 = filtered[i + 1].value;\n quotes.push({ open: open_1, close: close_1 });\n }\n return quotes;\n }\n };\n var getQuote = function (quotes, depth, open) {\n if (!quotes) {\n return '';\n }\n var quote = quotes[Math.min(depth, quotes.length - 1)];\n if (!quote) {\n return '';\n }\n return open ? quote.open : quote.close;\n };\n\n var boxShadow = {\n name: 'box-shadow',\n initialValue: 'none',\n type: 1 /* LIST */,\n prefix: false,\n parse: function (context, tokens) {\n if (tokens.length === 1 && isIdentWithValue(tokens[0], 'none')) {\n return [];\n }\n return parseFunctionArgs(tokens).map(function (values) {\n var shadow = {\n color: 0x000000ff,\n offsetX: ZERO_LENGTH,\n offsetY: ZERO_LENGTH,\n blur: ZERO_LENGTH,\n spread: ZERO_LENGTH,\n inset: false\n };\n var c = 0;\n for (var i = 0; i < values.length; i++) {\n var token = values[i];\n if (isIdentWithValue(token, 'inset')) {\n shadow.inset = true;\n }\n else if (isLength(token)) {\n if (c === 0) {\n shadow.offsetX = token;\n }\n else if (c === 1) {\n shadow.offsetY = token;\n }\n else if (c === 2) {\n shadow.blur = token;\n }\n else {\n shadow.spread = token;\n }\n c++;\n }\n else {\n shadow.color = color$1.parse(context, token);\n }\n }\n return shadow;\n });\n }\n };\n\n var paintOrder = {\n name: 'paint-order',\n initialValue: 'normal',\n prefix: false,\n type: 1 /* LIST */,\n parse: function (_context, tokens) {\n var DEFAULT_VALUE = [0 /* FILL */, 1 /* STROKE */, 2 /* MARKERS */];\n var layers = [];\n tokens.filter(isIdentToken).forEach(function (token) {\n switch (token.value) {\n case 'stroke':\n layers.push(1 /* STROKE */);\n break;\n case 'fill':\n layers.push(0 /* FILL */);\n break;\n case 'markers':\n layers.push(2 /* MARKERS */);\n break;\n }\n });\n DEFAULT_VALUE.forEach(function (value) {\n if (layers.indexOf(value) === -1) {\n layers.push(value);\n }\n });\n return layers;\n }\n };\n\n var webkitTextStrokeColor = {\n name: \"-webkit-text-stroke-color\",\n initialValue: 'currentcolor',\n prefix: false,\n type: 3 /* TYPE_VALUE */,\n format: 'color'\n };\n\n var webkitTextStrokeWidth = {\n name: \"-webkit-text-stroke-width\",\n initialValue: '0',\n type: 0 /* VALUE */,\n prefix: false,\n parse: function (_context, token) {\n if (isDimensionToken(token)) {\n return token.number;\n }\n return 0;\n }\n };\n\n var CSSParsedDeclaration = /** @class */ (function () {\n function CSSParsedDeclaration(context, declaration) {\n var _a, _b;\n this.animationDuration = parse(context, duration, declaration.animationDuration);\n this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip);\n this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor);\n this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage);\n this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin);\n this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition);\n this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat);\n this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize);\n this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor);\n this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor);\n this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor);\n this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor);\n this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius);\n this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius);\n this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius);\n this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius);\n this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle);\n this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle);\n this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle);\n this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle);\n this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth);\n this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth);\n this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth);\n this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth);\n this.boxShadow = parse(context, boxShadow, declaration.boxShadow);\n this.color = parse(context, color, declaration.color);\n this.direction = parse(context, direction, declaration.direction);\n this.display = parse(context, display, declaration.display);\n this.float = parse(context, float, declaration.cssFloat);\n this.fontFamily = parse(context, fontFamily, declaration.fontFamily);\n this.fontSize = parse(context, fontSize, declaration.fontSize);\n this.fontStyle = parse(context, fontStyle, declaration.fontStyle);\n this.fontVariant = parse(context, fontVariant, declaration.fontVariant);\n this.fontWeight = parse(context, fontWeight, declaration.fontWeight);\n this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing);\n this.lineBreak = parse(context, lineBreak, declaration.lineBreak);\n this.lineHeight = parse(context, lineHeight, declaration.lineHeight);\n this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage);\n this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition);\n this.listStyleType = parse(context, listStyleType, declaration.listStyleType);\n this.marginTop = parse(context, marginTop, declaration.marginTop);\n this.marginRight = parse(context, marginRight, declaration.marginRight);\n this.marginBottom = parse(context, marginBottom, declaration.marginBottom);\n this.marginLeft = parse(context, marginLeft, declaration.marginLeft);\n this.opacity = parse(context, opacity, declaration.opacity);\n var overflowTuple = parse(context, overflow, declaration.overflow);\n this.overflowX = overflowTuple[0];\n this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];\n this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap);\n this.paddingTop = parse(context, paddingTop, declaration.paddingTop);\n this.paddingRight = parse(context, paddingRight, declaration.paddingRight);\n this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom);\n this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft);\n this.paintOrder = parse(context, paintOrder, declaration.paintOrder);\n this.position = parse(context, position, declaration.position);\n this.textAlign = parse(context, textAlign, declaration.textAlign);\n this.textDecorationColor = parse(context, textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== void 0 ? _a : declaration.color);\n this.textDecorationLine = parse(context, textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== void 0 ? _b : declaration.textDecoration);\n this.textShadow = parse(context, textShadow, declaration.textShadow);\n this.textTransform = parse(context, textTransform, declaration.textTransform);\n this.transform = parse(context, transform$1, declaration.transform);\n this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin);\n this.visibility = parse(context, visibility, declaration.visibility);\n this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor);\n this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);\n this.wordBreak = parse(context, wordBreak, declaration.wordBreak);\n this.zIndex = parse(context, zIndex, declaration.zIndex);\n }\n CSSParsedDeclaration.prototype.isVisible = function () {\n return this.display > 0 && this.opacity > 0 && this.visibility === 0 /* VISIBLE */;\n };\n CSSParsedDeclaration.prototype.isTransparent = function () {\n return isTransparent(this.backgroundColor);\n };\n CSSParsedDeclaration.prototype.isTransformed = function () {\n return this.transform !== null;\n };\n CSSParsedDeclaration.prototype.isPositioned = function () {\n return this.position !== 0 /* STATIC */;\n };\n CSSParsedDeclaration.prototype.isPositionedWithZIndex = function () {\n return this.isPositioned() && !this.zIndex.auto;\n };\n CSSParsedDeclaration.prototype.isFloating = function () {\n return this.float !== 0 /* NONE */;\n };\n CSSParsedDeclaration.prototype.isInlineLevel = function () {\n return (contains(this.display, 4 /* INLINE */) ||\n contains(this.display, 33554432 /* INLINE_BLOCK */) ||\n contains(this.display, 268435456 /* INLINE_FLEX */) ||\n contains(this.display, 536870912 /* INLINE_GRID */) ||\n contains(this.display, 67108864 /* INLINE_LIST_ITEM */) ||\n contains(this.display, 134217728 /* INLINE_TABLE */));\n };\n return CSSParsedDeclaration;\n }());\n var CSSParsedPseudoDeclaration = /** @class */ (function () {\n function CSSParsedPseudoDeclaration(context, declaration) {\n this.content = parse(context, content, declaration.content);\n this.quotes = parse(context, quotes, declaration.quotes);\n }\n return CSSParsedPseudoDeclaration;\n }());\n var CSSParsedCounterDeclaration = /** @class */ (function () {\n function CSSParsedCounterDeclaration(context, declaration) {\n this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement);\n this.counterReset = parse(context, counterReset, declaration.counterReset);\n }\n return CSSParsedCounterDeclaration;\n }());\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var parse = function (context, descriptor, style) {\n var tokenizer = new Tokenizer();\n var value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;\n tokenizer.write(value);\n var parser = new Parser(tokenizer.read());\n switch (descriptor.type) {\n case 2 /* IDENT_VALUE */:\n var token = parser.parseComponentValue();\n return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue);\n case 0 /* VALUE */:\n return descriptor.parse(context, parser.parseComponentValue());\n case 1 /* LIST */:\n return descriptor.parse(context, parser.parseComponentValues());\n case 4 /* TOKEN_VALUE */:\n return parser.parseComponentValue();\n case 3 /* TYPE_VALUE */:\n switch (descriptor.format) {\n case 'angle':\n return angle.parse(context, parser.parseComponentValue());\n case 'color':\n return color$1.parse(context, parser.parseComponentValue());\n case 'image':\n return image.parse(context, parser.parseComponentValue());\n case 'length':\n var length_1 = parser.parseComponentValue();\n return isLength(length_1) ? length_1 : ZERO_LENGTH;\n case 'length-percentage':\n var value_1 = parser.parseComponentValue();\n return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH;\n case 'time':\n return time.parse(context, parser.parseComponentValue());\n }\n break;\n }\n };\n\n var elementDebuggerAttribute = 'data-html2canvas-debug';\n var getElementDebugType = function (element) {\n var attribute = element.getAttribute(elementDebuggerAttribute);\n switch (attribute) {\n case 'all':\n return 1 /* ALL */;\n case 'clone':\n return 2 /* CLONE */;\n case 'parse':\n return 3 /* PARSE */;\n case 'render':\n return 4 /* RENDER */;\n default:\n return 0 /* NONE */;\n }\n };\n var isDebugging = function (element, type) {\n var elementType = getElementDebugType(element);\n return elementType === 1 /* ALL */ || type === elementType;\n };\n\n var ElementContainer = /** @class */ (function () {\n function ElementContainer(context, element) {\n this.context = context;\n this.textNodes = [];\n this.elements = [];\n this.flags = 0;\n if (isDebugging(element, 3 /* PARSE */)) {\n debugger;\n }\n this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null));\n if (isHTMLElementNode(element)) {\n if (this.styles.animationDuration.some(function (duration) { return duration > 0; })) {\n element.style.animationDuration = '0s';\n }\n if (this.styles.transform !== null) {\n // getBoundingClientRect takes transforms into account\n element.style.transform = 'none';\n }\n }\n this.bounds = parseBounds(this.context, element);\n if (isDebugging(element, 4 /* RENDER */)) {\n this.flags |= 16 /* DEBUG_RENDER */;\n }\n }\n return ElementContainer;\n }());\n\n /*\n * text-segmentation 1.0.3 <https://github.com/niklasvh/text-segmentation>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var base64 = 'AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIA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ACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIA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AAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=';\n\n /*\n * utrie 1.0.2 <https://github.com/niklasvh/utrie>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup$1 = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i$1 = 0; i$1 < chars$1.length; i$1++) {\n lookup$1[chars$1.charCodeAt(i$1)] = i$1;\n }\n var decode = function (base64) {\n var bufferLength = base64.length * 0.75, len = base64.length, i, p = 0, encoded1, encoded2, encoded3, encoded4;\n if (base64[base64.length - 1] === '=') {\n bufferLength--;\n if (base64[base64.length - 2] === '=') {\n bufferLength--;\n }\n }\n var buffer = typeof ArrayBuffer !== 'undefined' &&\n typeof Uint8Array !== 'undefined' &&\n typeof Uint8Array.prototype.slice !== 'undefined'\n ? new ArrayBuffer(bufferLength)\n : new Array(bufferLength);\n var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer);\n for (i = 0; i < len; i += 4) {\n encoded1 = lookup$1[base64.charCodeAt(i)];\n encoded2 = lookup$1[base64.charCodeAt(i + 1)];\n encoded3 = lookup$1[base64.charCodeAt(i + 2)];\n encoded4 = lookup$1[base64.charCodeAt(i + 3)];\n bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n }\n return buffer;\n };\n var polyUint16Array = function (buffer) {\n var length = buffer.length;\n var bytes = [];\n for (var i = 0; i < length; i += 2) {\n bytes.push((buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n };\n var polyUint32Array = function (buffer) {\n var length = buffer.length;\n var bytes = [];\n for (var i = 0; i < length; i += 4) {\n bytes.push((buffer[i + 3] << 24) | (buffer[i + 2] << 16) | (buffer[i + 1] << 8) | buffer[i]);\n }\n return bytes;\n };\n\n /** Shift size for getting the index-2 table offset. */\n var UTRIE2_SHIFT_2 = 5;\n /** Shift size for getting the index-1 table offset. */\n var UTRIE2_SHIFT_1 = 6 + 5;\n /**\n * Shift size for shifting left the index array values.\n * Increases possible data size with 16-bit index values at the cost\n * of compactability.\n * This requires data blocks to be aligned by UTRIE2_DATA_GRANULARITY.\n */\n var UTRIE2_INDEX_SHIFT = 2;\n /**\n * Difference between the two shift sizes,\n * for getting an index-1 offset from an index-2 offset. 6=11-5\n */\n var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2;\n /**\n * The part of the index-2 table for U+D800..U+DBFF stores values for\n * lead surrogate code _units_ not code _points_.\n * Values for lead surrogate code _points_ are indexed with this portion of the table.\n * Length=32=0x20=0x400>>UTRIE2_SHIFT_2. (There are 1024=0x400 lead surrogates.)\n */\n var UTRIE2_LSCP_INDEX_2_OFFSET = 0x10000 >> UTRIE2_SHIFT_2;\n /** Number of entries in a data block. 32=0x20 */\n var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2;\n /** Mask for getting the lower bits for the in-data-block offset. */\n var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1;\n var UTRIE2_LSCP_INDEX_2_LENGTH = 0x400 >> UTRIE2_SHIFT_2;\n /** Count the lengths of both BMP pieces. 2080=0x820 */\n var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH;\n /**\n * The 2-byte UTF-8 version of the index-2 table follows at offset 2080=0x820.\n * Length 32=0x20 for lead bytes C0..DF, regardless of UTRIE2_SHIFT_2.\n */\n var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH;\n var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 0x800 >> 6; /* U+0800 is the first code point after 2-byte UTF-8 */\n /**\n * The index-1 table, only used for supplementary code points, at offset 2112=0x840.\n * Variable length, for code points up to highStart, where the last single-value range starts.\n * Maximum length 512=0x200=0x100000>>UTRIE2_SHIFT_1.\n * (For 0x100000 supplementary code points U+10000..U+10ffff.)\n *\n * The part of the index-2 table for supplementary code points starts\n * after this index-1 table.\n *\n * Both the index-1 table and the following part of the index-2 table\n * are omitted completely if there is only BMP data.\n */\n var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH;\n /**\n * Number of index-1 entries for the BMP. 32=0x20\n * This part of the index-1 table is omitted from the serialized form.\n */\n var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 0x10000 >> UTRIE2_SHIFT_1;\n /** Number of entries in an index-2 block. 64=0x40 */\n var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2;\n /** Mask for getting the lower bits for the in-index-2-block offset. */\n var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1;\n var slice16 = function (view, start, end) {\n if (view.slice) {\n return view.slice(start, end);\n }\n return new Uint16Array(Array.prototype.slice.call(view, start, end));\n };\n var slice32 = function (view, start, end) {\n if (view.slice) {\n return view.slice(start, end);\n }\n return new Uint32Array(Array.prototype.slice.call(view, start, end));\n };\n var createTrieFromBase64 = function (base64, _byteLength) {\n var buffer = decode(base64);\n var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer);\n var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer);\n var headerLength = 24;\n var index = slice16(view16, headerLength / 2, view32[4] / 2);\n var data = view32[5] === 2\n ? slice16(view16, (headerLength + view32[4]) / 2)\n : slice32(view32, Math.ceil((headerLength + view32[4]) / 4));\n return new Trie(view32[0], view32[1], view32[2], view32[3], index, data);\n };\n var Trie = /** @class */ (function () {\n function Trie(initialValue, errorValue, highStart, highValueIndex, index, data) {\n this.initialValue = initialValue;\n this.errorValue = errorValue;\n this.highStart = highStart;\n this.highValueIndex = highValueIndex;\n this.index = index;\n this.data = data;\n }\n /**\n * Get the value for a code point as stored in the Trie.\n *\n * @param codePoint the code point\n * @return the value\n */\n Trie.prototype.get = function (codePoint) {\n var ix;\n if (codePoint >= 0) {\n if (codePoint < 0x0d800 || (codePoint > 0x0dbff && codePoint <= 0x0ffff)) {\n // Ordinary BMP code point, excluding leading surrogates.\n // BMP uses a single level lookup. BMP index starts at offset 0 in the Trie2 index.\n // 16 bit data is stored in the index array itself.\n ix = this.index[codePoint >> UTRIE2_SHIFT_2];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0xffff) {\n // Lead Surrogate Code Point. A Separate index section is stored for\n // lead surrogate code units and code points.\n // The main index has the code unit data.\n // For this function, we need the code point data.\n // Note: this expression could be refactored for slightly improved efficiency, but\n // surrogate code points will be so rare in practice that it's not worth it.\n ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + ((codePoint - 0xd800) >> UTRIE2_SHIFT_2)];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint < this.highStart) {\n // Supplemental code point, use two-level lookup.\n ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1);\n ix = this.index[ix];\n ix += (codePoint >> UTRIE2_SHIFT_2) & UTRIE2_INDEX_2_MASK;\n ix = this.index[ix];\n ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK);\n return this.data[ix];\n }\n if (codePoint <= 0x10ffff) {\n return this.data[this.highValueIndex];\n }\n }\n // Fall through. The code point is outside of the legal range of 0..0x10ffff.\n return this.errorValue;\n };\n return Trie;\n }());\n\n /*\n * base64-arraybuffer 1.0.2 <https://github.com/niklasvh/base64-arraybuffer>\n * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>\n * Released under MIT License\n */\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n // Use a lookup table to find the index.\n var lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n\n var Prepend = 1;\n var CR = 2;\n var LF = 3;\n var Control = 4;\n var Extend = 5;\n var SpacingMark = 7;\n var L = 8;\n var V = 9;\n var T = 10;\n var LV = 11;\n var LVT = 12;\n var ZWJ = 13;\n var Extended_Pictographic = 14;\n var RI = 15;\n var toCodePoints = function (str) {\n var codePoints = [];\n var i = 0;\n var length = str.length;\n while (i < length) {\n var value = str.charCodeAt(i++);\n if (value >= 0xd800 && value <= 0xdbff && i < length) {\n var extra = str.charCodeAt(i++);\n if ((extra & 0xfc00) === 0xdc00) {\n codePoints.push(((value & 0x3ff) << 10) + (extra & 0x3ff) + 0x10000);\n }\n else {\n codePoints.push(value);\n i--;\n }\n }\n else {\n codePoints.push(value);\n }\n }\n return codePoints;\n };\n var fromCodePoint = function () {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n if (String.fromCodePoint) {\n return String.fromCodePoint.apply(String, codePoints);\n }\n var length = codePoints.length;\n if (!length) {\n return '';\n }\n var codeUnits = [];\n var index = -1;\n var result = '';\n while (++index < length) {\n var codePoint = codePoints[index];\n if (codePoint <= 0xffff) {\n codeUnits.push(codePoint);\n }\n else {\n codePoint -= 0x10000;\n codeUnits.push((codePoint >> 10) + 0xd800, (codePoint % 0x400) + 0xdc00);\n }\n if (index + 1 === length || codeUnits.length > 0x4000) {\n result += String.fromCharCode.apply(String, codeUnits);\n codeUnits.length = 0;\n }\n }\n return result;\n };\n var UnicodeTrie = createTrieFromBase64(base64);\n var BREAK_NOT_ALLOWED = '×';\n var BREAK_ALLOWED = '÷';\n var codePointToClass = function (codePoint) { return UnicodeTrie.get(codePoint); };\n var _graphemeBreakAtIndex = function (_codePoints, classTypes, index) {\n var prevIndex = index - 2;\n var prev = classTypes[prevIndex];\n var current = classTypes[index - 1];\n var next = classTypes[index];\n // GB3 Do not break between a CR and LF\n if (current === CR && next === LF) {\n return BREAK_NOT_ALLOWED;\n }\n // GB4 Otherwise, break before and after controls.\n if (current === CR || current === LF || current === Control) {\n return BREAK_ALLOWED;\n }\n // GB5\n if (next === CR || next === LF || next === Control) {\n return BREAK_ALLOWED;\n }\n // Do not break Hangul syllable sequences.\n // GB6\n if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) {\n return BREAK_NOT_ALLOWED;\n }\n // GB7\n if ((current === LV || current === V) && (next === V || next === T)) {\n return BREAK_NOT_ALLOWED;\n }\n // GB8\n if ((current === LVT || current === T) && next === T) {\n return BREAK_NOT_ALLOWED;\n }\n // GB9 Do not break before extending characters or ZWJ.\n if (next === ZWJ || next === Extend) {\n return BREAK_NOT_ALLOWED;\n }\n // Do not break before SpacingMarks, or after Prepend characters.\n // GB9a\n if (next === SpacingMark) {\n return BREAK_NOT_ALLOWED;\n }\n // GB9a\n if (current === Prepend) {\n return BREAK_NOT_ALLOWED;\n }\n // GB11 Do not break within emoji modifier sequences or emoji zwj sequences.\n if (current === ZWJ && next === Extended_Pictographic) {\n while (prev === Extend) {\n prev = classTypes[--prevIndex];\n }\n if (prev === Extended_Pictographic) {\n return BREAK_NOT_ALLOWED;\n }\n }\n // GB12 Do not break within emoji flag sequences.\n // That is, do not break between regional indicator (RI) symbols\n // if there is an odd number of RI characters before the break point.\n if (current === RI && next === RI) {\n var countRI = 0;\n while (prev === RI) {\n countRI++;\n prev = classTypes[--prevIndex];\n }\n if (countRI % 2 === 0) {\n return BREAK_NOT_ALLOWED;\n }\n }\n return BREAK_ALLOWED;\n };\n var GraphemeBreaker = function (str) {\n var codePoints = toCodePoints(str);\n var length = codePoints.length;\n var index = 0;\n var lastEnd = 0;\n var classTypes = codePoints.map(codePointToClass);\n return {\n next: function () {\n if (index >= length) {\n return { done: true, value: null };\n }\n var graphemeBreak = BREAK_NOT_ALLOWED;\n while (index < length &&\n (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED) { }\n if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) {\n var value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index));\n lastEnd = index;\n return { value: value, done: false };\n }\n return { done: true, value: null };\n },\n };\n };\n var splitGraphemes = function (str) {\n var breaker = GraphemeBreaker(str);\n var graphemes = [];\n var bk;\n while (!(bk = breaker.next()).done) {\n if (bk.value) {\n graphemes.push(bk.value.slice());\n }\n }\n return graphemes;\n };\n\n var testRangeBounds = function (document) {\n var TEST_HEIGHT = 123;\n if (document.createRange) {\n var range = document.createRange();\n if (range.getBoundingClientRect) {\n var testElement = document.createElement('boundtest');\n testElement.style.height = TEST_HEIGHT + \"px\";\n testElement.style.display = 'block';\n document.body.appendChild(testElement);\n range.selectNode(testElement);\n var rangeBounds = range.getBoundingClientRect();\n var rangeHeight = Math.round(rangeBounds.height);\n document.body.removeChild(testElement);\n if (rangeHeight === TEST_HEIGHT) {\n return true;\n }\n }\n }\n return false;\n };\n var testIOSLineBreak = function (document) {\n var testElement = document.createElement('boundtest');\n testElement.style.width = '50px';\n testElement.style.display = 'block';\n testElement.style.fontSize = '12px';\n testElement.style.letterSpacing = '0px';\n testElement.style.wordSpacing = '0px';\n document.body.appendChild(testElement);\n var range = document.createRange();\n testElement.innerHTML = typeof ''.repeat === 'function' ? '👨'.repeat(10) : '';\n var node = testElement.firstChild;\n var textList = toCodePoints$1(node.data).map(function (i) { return fromCodePoint$1(i); });\n var offset = 0;\n var prev = {};\n // ios 13 does not handle range getBoundingClientRect line changes correctly #2177\n var supports = textList.every(function (text, i) {\n range.setStart(node, offset);\n range.setEnd(node, offset + text.length);\n var rect = range.getBoundingClientRect();\n offset += text.length;\n var boundAhead = rect.x > prev.x || rect.y > prev.y;\n prev = rect;\n if (i === 0) {\n return true;\n }\n return boundAhead;\n });\n document.body.removeChild(testElement);\n return supports;\n };\n var testCORS = function () { return typeof new Image().crossOrigin !== 'undefined'; };\n var testResponseType = function () { return typeof new XMLHttpRequest().responseType === 'string'; };\n var testSVG = function (document) {\n var img = new Image();\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n if (!ctx) {\n return false;\n }\n img.src = \"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>\";\n try {\n ctx.drawImage(img, 0, 0);\n canvas.toDataURL();\n }\n catch (e) {\n return false;\n }\n return true;\n };\n var isGreenPixel = function (data) {\n return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255;\n };\n var testForeignObject = function (document) {\n var canvas = document.createElement('canvas');\n var size = 100;\n canvas.width = size;\n canvas.height = size;\n var ctx = canvas.getContext('2d');\n if (!ctx) {\n return Promise.reject(false);\n }\n ctx.fillStyle = 'rgb(0, 255, 0)';\n ctx.fillRect(0, 0, size, size);\n var img = new Image();\n var greenImageSrc = canvas.toDataURL();\n img.src = greenImageSrc;\n var svg = createForeignObjectSVG(size, size, 0, 0, img);\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n return loadSerializedSVG$1(svg)\n .then(function (img) {\n ctx.drawImage(img, 0, 0);\n var data = ctx.getImageData(0, 0, size, size).data;\n ctx.fillStyle = 'red';\n ctx.fillRect(0, 0, size, size);\n var node = document.createElement('div');\n node.style.backgroundImage = \"url(\" + greenImageSrc + \")\";\n node.style.height = size + \"px\";\n // Firefox 55 does not render inline <img /> tags\n return isGreenPixel(data)\n ? loadSerializedSVG$1(createForeignObjectSVG(size, size, 0, 0, node))\n : Promise.reject(false);\n })\n .then(function (img) {\n ctx.drawImage(img, 0, 0);\n // Edge does not render background-images\n return isGreenPixel(ctx.getImageData(0, 0, size, size).data);\n })\n .catch(function () { return false; });\n };\n var createForeignObjectSVG = function (width, height, x, y, node) {\n var xmlns = 'http://www.w3.org/2000/svg';\n var svg = document.createElementNS(xmlns, 'svg');\n var foreignObject = document.createElementNS(xmlns, 'foreignObject');\n svg.setAttributeNS(null, 'width', width.toString());\n svg.setAttributeNS(null, 'height', height.toString());\n foreignObject.setAttributeNS(null, 'width', '100%');\n foreignObject.setAttributeNS(null, 'height', '100%');\n foreignObject.setAttributeNS(null, 'x', x.toString());\n foreignObject.setAttributeNS(null, 'y', y.toString());\n foreignObject.setAttributeNS(null, 'externalResourcesRequired', 'true');\n svg.appendChild(foreignObject);\n foreignObject.appendChild(node);\n return svg;\n };\n var loadSerializedSVG$1 = function (svg) {\n return new Promise(function (resolve, reject) {\n var img = new Image();\n img.onload = function () { return resolve(img); };\n img.onerror = reject;\n img.src = \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(new XMLSerializer().serializeToString(svg));\n });\n };\n var FEATURES = {\n get SUPPORT_RANGE_BOUNDS() {\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n },\n get SUPPORT_WORD_BREAKING() {\n var value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document);\n Object.defineProperty(FEATURES, 'SUPPORT_WORD_BREAKING', { value: value });\n return value;\n },\n get SUPPORT_SVG_DRAWING() {\n var value = testSVG(document);\n Object.defineProperty(FEATURES, 'SUPPORT_SVG_DRAWING', { value: value });\n return value;\n },\n get SUPPORT_FOREIGNOBJECT_DRAWING() {\n var value = typeof Array.from === 'function' && typeof window.fetch === 'function'\n ? testForeignObject(document)\n : Promise.resolve(false);\n Object.defineProperty(FEATURES, 'SUPPORT_FOREIGNOBJECT_DRAWING', { value: value });\n return value;\n },\n get SUPPORT_CORS_IMAGES() {\n var value = testCORS();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_IMAGES', { value: value });\n return value;\n },\n get SUPPORT_RESPONSE_TYPE() {\n var value = testResponseType();\n Object.defineProperty(FEATURES, 'SUPPORT_RESPONSE_TYPE', { value: value });\n return value;\n },\n get SUPPORT_CORS_XHR() {\n var value = 'withCredentials' in new XMLHttpRequest();\n Object.defineProperty(FEATURES, 'SUPPORT_CORS_XHR', { value: value });\n return value;\n },\n get SUPPORT_NATIVE_TEXT_SEGMENTATION() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var value = !!(typeof Intl !== 'undefined' && Intl.Segmenter);\n Object.defineProperty(FEATURES, 'SUPPORT_NATIVE_TEXT_SEGMENTATION', { value: value });\n return value;\n }\n };\n\n var TextBounds = /** @class */ (function () {\n function TextBounds(text, bounds) {\n this.text = text;\n this.bounds = bounds;\n }\n return TextBounds;\n }());\n var parseTextBounds = function (context, value, styles, node) {\n var textList = breakText(value, styles);\n var textBounds = [];\n var offset = 0;\n textList.forEach(function (text) {\n if (styles.textDecorationLine.length || text.trim().length > 0) {\n if (FEATURES.SUPPORT_RANGE_BOUNDS) {\n var clientRects = createRange(node, offset, text.length).getClientRects();\n if (clientRects.length > 1) {\n var subSegments = segmentGraphemes(text);\n var subOffset_1 = 0;\n subSegments.forEach(function (subSegment) {\n textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));\n subOffset_1 += subSegment.length;\n });\n }\n else {\n textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects)));\n }\n }\n else {\n var replacementNode = node.splitText(text.length);\n textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));\n node = replacementNode;\n }\n }\n else if (!FEATURES.SUPPORT_RANGE_BOUNDS) {\n node = node.splitText(text.length);\n }\n offset += text.length;\n });\n return textBounds;\n };\n var getWrapperBounds = function (context, node) {\n var ownerDocument = node.ownerDocument;\n if (ownerDocument) {\n var wrapper = ownerDocument.createElement('html2canvaswrapper');\n wrapper.appendChild(node.cloneNode(true));\n var parentNode = node.parentNode;\n if (parentNode) {\n parentNode.replaceChild(wrapper, node);\n var bounds = parseBounds(context, wrapper);\n if (wrapper.firstChild) {\n parentNode.replaceChild(wrapper.firstChild, wrapper);\n }\n return bounds;\n }\n }\n return Bounds.EMPTY;\n };\n var createRange = function (node, offset, length) {\n var ownerDocument = node.ownerDocument;\n if (!ownerDocument) {\n throw new Error('Node has no owner document');\n }\n var range = ownerDocument.createRange();\n range.setStart(node, offset);\n range.setEnd(node, offset + length);\n return range;\n };\n var segmentGraphemes = function (value) {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var segmenter = new Intl.Segmenter(void 0, { granularity: 'grapheme' });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });\n }\n return splitGraphemes(value);\n };\n var segmentWords = function (value, styles) {\n if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var segmenter = new Intl.Segmenter(void 0, {\n granularity: 'word'\n });\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });\n }\n return breakWords(value, styles);\n };\n var breakText = function (value, styles) {\n return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles);\n };\n // https://drafts.csswg.org/css-text/#word-separator\n var wordSeparators = [0x0020, 0x00a0, 0x1361, 0x10100, 0x10101, 0x1039, 0x1091];\n var breakWords = function (str, styles) {\n var breaker = LineBreaker(str, {\n lineBreak: styles.lineBreak,\n wordBreak: styles.overflowWrap === \"break-word\" /* BREAK_WORD */ ? 'break-word' : styles.wordBreak\n });\n var words = [];\n var bk;\n var _loop_1 = function () {\n if (bk.value) {\n var value = bk.value.slice();\n var codePoints = toCodePoints$1(value);\n var word_1 = '';\n codePoints.forEach(function (codePoint) {\n if (wordSeparators.indexOf(codePoint) === -1) {\n word_1 += fromCodePoint$1(codePoint);\n }\n else {\n if (word_1.length) {\n words.push(word_1);\n }\n words.push(fromCodePoint$1(codePoint));\n word_1 = '';\n }\n });\n if (word_1.length) {\n words.push(word_1);\n }\n }\n };\n while (!(bk = breaker.next()).done) {\n _loop_1();\n }\n return words;\n };\n\n var TextContainer = /** @class */ (function () {\n function TextContainer(context, node, styles) {\n this.text = transform(node.data, styles.textTransform);\n this.textBounds = parseTextBounds(context, this.text, styles, node);\n }\n return TextContainer;\n }());\n var transform = function (text, transform) {\n switch (transform) {\n case 1 /* LOWERCASE */:\n return text.toLowerCase();\n case 3 /* CAPITALIZE */:\n return text.replace(CAPITALIZE, capitalize);\n case 2 /* UPPERCASE */:\n return text.toUpperCase();\n default:\n return text;\n }\n };\n var CAPITALIZE = /(^|\\s|:|-|\\(|\\))([a-z])/g;\n var capitalize = function (m, p1, p2) {\n if (m.length > 0) {\n return p1 + p2.toUpperCase();\n }\n return m;\n };\n\n var ImageElementContainer = /** @class */ (function (_super) {\n __extends(ImageElementContainer, _super);\n function ImageElementContainer(context, img) {\n var _this = _super.call(this, context, img) || this;\n _this.src = img.currentSrc || img.src;\n _this.intrinsicWidth = img.naturalWidth;\n _this.intrinsicHeight = img.naturalHeight;\n _this.context.cache.addImage(_this.src);\n return _this;\n }\n return ImageElementContainer;\n }(ElementContainer));\n\n var CanvasElementContainer = /** @class */ (function (_super) {\n __extends(CanvasElementContainer, _super);\n function CanvasElementContainer(context, canvas) {\n var _this = _super.call(this, context, canvas) || this;\n _this.canvas = canvas;\n _this.intrinsicWidth = canvas.width;\n _this.intrinsicHeight = canvas.height;\n return _this;\n }\n return CanvasElementContainer;\n }(ElementContainer));\n\n var SVGElementContainer = /** @class */ (function (_super) {\n __extends(SVGElementContainer, _super);\n function SVGElementContainer(context, img) {\n var _this = _super.call(this, context, img) || this;\n var s = new XMLSerializer();\n var bounds = parseBounds(context, img);\n img.setAttribute('width', bounds.width + \"px\");\n img.setAttribute('height', bounds.height + \"px\");\n _this.svg = \"data:image/svg+xml,\" + encodeURIComponent(s.serializeToString(img));\n _this.intrinsicWidth = img.width.baseVal.value;\n _this.intrinsicHeight = img.height.baseVal.value;\n _this.context.cache.addImage(_this.svg);\n return _this;\n }\n return SVGElementContainer;\n }(ElementContainer));\n\n var LIElementContainer = /** @class */ (function (_super) {\n __extends(LIElementContainer, _super);\n function LIElementContainer(context, element) {\n var _this = _super.call(this, context, element) || this;\n _this.value = element.value;\n return _this;\n }\n return LIElementContainer;\n }(ElementContainer));\n\n var OLElementContainer = /** @class */ (function (_super) {\n __extends(OLElementContainer, _super);\n function OLElementContainer(context, element) {\n var _this = _super.call(this, context, element) || this;\n _this.start = element.start;\n _this.reversed = typeof element.reversed === 'boolean' && element.reversed === true;\n return _this;\n }\n return OLElementContainer;\n }(ElementContainer));\n\n var CHECKBOX_BORDER_RADIUS = [\n {\n type: 15 /* DIMENSION_TOKEN */,\n flags: 0,\n unit: 'px',\n number: 3\n }\n ];\n var RADIO_BORDER_RADIUS = [\n {\n type: 16 /* PERCENTAGE_TOKEN */,\n flags: 0,\n number: 50\n }\n ];\n var reformatInputBounds = function (bounds) {\n if (bounds.width > bounds.height) {\n return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height);\n }\n else if (bounds.width < bounds.height) {\n return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width);\n }\n return bounds;\n };\n var getInputValue = function (node) {\n var value = node.type === PASSWORD ? new Array(node.value.length + 1).join('\\u2022') : node.value;\n return value.length === 0 ? node.placeholder || '' : value;\n };\n var CHECKBOX = 'checkbox';\n var RADIO = 'radio';\n var PASSWORD = 'password';\n var INPUT_COLOR = 0x2a2a2aff;\n var InputElementContainer = /** @class */ (function (_super) {\n __extends(InputElementContainer, _super);\n function InputElementContainer(context, input) {\n var _this = _super.call(this, context, input) || this;\n _this.type = input.type.toLowerCase();\n _this.checked = input.checked;\n _this.value = getInputValue(input);\n if (_this.type === CHECKBOX || _this.type === RADIO) {\n _this.styles.backgroundColor = 0xdededeff;\n _this.styles.borderTopColor =\n _this.styles.borderRightColor =\n _this.styles.borderBottomColor =\n _this.styles.borderLeftColor =\n 0xa5a5a5ff;\n _this.styles.borderTopWidth =\n _this.styles.borderRightWidth =\n _this.styles.borderBottomWidth =\n _this.styles.borderLeftWidth =\n 1;\n _this.styles.borderTopStyle =\n _this.styles.borderRightStyle =\n _this.styles.borderBottomStyle =\n _this.styles.borderLeftStyle =\n 1 /* SOLID */;\n _this.styles.backgroundClip = [0 /* BORDER_BOX */];\n _this.styles.backgroundOrigin = [0 /* BORDER_BOX */];\n _this.bounds = reformatInputBounds(_this.bounds);\n }\n switch (_this.type) {\n case CHECKBOX:\n _this.styles.borderTopRightRadius =\n _this.styles.borderTopLeftRadius =\n _this.styles.borderBottomRightRadius =\n _this.styles.borderBottomLeftRadius =\n CHECKBOX_BORDER_RADIUS;\n break;\n case RADIO:\n _this.styles.borderTopRightRadius =\n _this.styles.borderTopLeftRadius =\n _this.styles.borderBottomRightRadius =\n _this.styles.borderBottomLeftRadius =\n RADIO_BORDER_RADIUS;\n break;\n }\n return _this;\n }\n return InputElementContainer;\n }(ElementContainer));\n\n var SelectElementContainer = /** @class */ (function (_super) {\n __extends(SelectElementContainer, _super);\n function SelectElementContainer(context, element) {\n var _this = _super.call(this, context, element) || this;\n var option = element.options[element.selectedIndex || 0];\n _this.value = option ? option.text || '' : '';\n return _this;\n }\n return SelectElementContainer;\n }(ElementContainer));\n\n var TextareaElementContainer = /** @class */ (function (_super) {\n __extends(TextareaElementContainer, _super);\n function TextareaElementContainer(context, element) {\n var _this = _super.call(this, context, element) || this;\n _this.value = element.value;\n return _this;\n }\n return TextareaElementContainer;\n }(ElementContainer));\n\n var IFrameElementContainer = /** @class */ (function (_super) {\n __extends(IFrameElementContainer, _super);\n function IFrameElementContainer(context, iframe) {\n var _this = _super.call(this, context, iframe) || this;\n _this.src = iframe.src;\n _this.width = parseInt(iframe.width, 10) || 0;\n _this.height = parseInt(iframe.height, 10) || 0;\n _this.backgroundColor = _this.styles.backgroundColor;\n try {\n if (iframe.contentWindow &&\n iframe.contentWindow.document &&\n iframe.contentWindow.document.documentElement) {\n _this.tree = parseTree(context, iframe.contentWindow.document.documentElement);\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n var documentBackgroundColor = iframe.contentWindow.document.documentElement\n ? parseColor(context, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor)\n : COLORS.TRANSPARENT;\n var bodyBackgroundColor = iframe.contentWindow.document.body\n ? parseColor(context, getComputedStyle(iframe.contentWindow.document.body).backgroundColor)\n : COLORS.TRANSPARENT;\n _this.backgroundColor = isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? _this.styles.backgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor;\n }\n }\n catch (e) { }\n return _this;\n }\n return IFrameElementContainer;\n }(ElementContainer));\n\n var LIST_OWNERS = ['OL', 'UL', 'MENU'];\n var parseNodeTree = function (context, node, parent, root) {\n for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {\n nextNode = childNode.nextSibling;\n if (isTextNode(childNode) && childNode.data.trim().length > 0) {\n parent.textNodes.push(new TextContainer(context, childNode, parent.styles));\n }\n else if (isElementNode(childNode)) {\n if (isSlotElement(childNode) && childNode.assignedNodes) {\n childNode.assignedNodes().forEach(function (childNode) { return parseNodeTree(context, childNode, parent, root); });\n }\n else {\n var container = createContainer(context, childNode);\n if (container.styles.isVisible()) {\n if (createsRealStackingContext(childNode, container, root)) {\n container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;\n }\n else if (createsStackingContext(container.styles)) {\n container.flags |= 2 /* CREATES_STACKING_CONTEXT */;\n }\n if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) {\n container.flags |= 8 /* IS_LIST_OWNER */;\n }\n parent.elements.push(container);\n childNode.slot;\n if (childNode.shadowRoot) {\n parseNodeTree(context, childNode.shadowRoot, container, root);\n }\n else if (!isTextareaElement(childNode) &&\n !isSVGElement(childNode) &&\n !isSelectElement(childNode)) {\n parseNodeTree(context, childNode, container, root);\n }\n }\n }\n }\n }\n };\n var createContainer = function (context, element) {\n if (isImageElement(element)) {\n return new ImageElementContainer(context, element);\n }\n if (isCanvasElement(element)) {\n return new CanvasElementContainer(context, element);\n }\n if (isSVGElement(element)) {\n return new SVGElementContainer(context, element);\n }\n if (isLIElement(element)) {\n return new LIElementContainer(context, element);\n }\n if (isOLElement(element)) {\n return new OLElementContainer(context, element);\n }\n if (isInputElement(element)) {\n return new InputElementContainer(context, element);\n }\n if (isSelectElement(element)) {\n return new SelectElementContainer(context, element);\n }\n if (isTextareaElement(element)) {\n return new TextareaElementContainer(context, element);\n }\n if (isIFrameElement(element)) {\n return new IFrameElementContainer(context, element);\n }\n return new ElementContainer(context, element);\n };\n var parseTree = function (context, element) {\n var container = createContainer(context, element);\n container.flags |= 4 /* CREATES_REAL_STACKING_CONTEXT */;\n parseNodeTree(context, element, container, container);\n return container;\n };\n var createsRealStackingContext = function (node, container, root) {\n return (container.styles.isPositionedWithZIndex() ||\n container.styles.opacity < 1 ||\n container.styles.isTransformed() ||\n (isBodyElement(node) && root.styles.isTransparent()));\n };\n var createsStackingContext = function (styles) { return styles.isPositioned() || styles.isFloating(); };\n var isTextNode = function (node) { return node.nodeType === Node.TEXT_NODE; };\n var isElementNode = function (node) { return node.nodeType === Node.ELEMENT_NODE; };\n var isHTMLElementNode = function (node) {\n return isElementNode(node) && typeof node.style !== 'undefined' && !isSVGElementNode(node);\n };\n var isSVGElementNode = function (element) {\n return typeof element.className === 'object';\n };\n var isLIElement = function (node) { return node.tagName === 'LI'; };\n var isOLElement = function (node) { return node.tagName === 'OL'; };\n var isInputElement = function (node) { return node.tagName === 'INPUT'; };\n var isHTMLElement = function (node) { return node.tagName === 'HTML'; };\n var isSVGElement = function (node) { return node.tagName === 'svg'; };\n var isBodyElement = function (node) { return node.tagName === 'BODY'; };\n var isCanvasElement = function (node) { return node.tagName === 'CANVAS'; };\n var isVideoElement = function (node) { return node.tagName === 'VIDEO'; };\n var isImageElement = function (node) { return node.tagName === 'IMG'; };\n var isIFrameElement = function (node) { return node.tagName === 'IFRAME'; };\n var isStyleElement = function (node) { return node.tagName === 'STYLE'; };\n var isScriptElement = function (node) { return node.tagName === 'SCRIPT'; };\n var isTextareaElement = function (node) { return node.tagName === 'TEXTAREA'; };\n var isSelectElement = function (node) { return node.tagName === 'SELECT'; };\n var isSlotElement = function (node) { return node.tagName === 'SLOT'; };\n // https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n var isCustomElement = function (node) { return node.tagName.indexOf('-') > 0; };\n\n var CounterState = /** @class */ (function () {\n function CounterState() {\n this.counters = {};\n }\n CounterState.prototype.getCounterValue = function (name) {\n var counter = this.counters[name];\n if (counter && counter.length) {\n return counter[counter.length - 1];\n }\n return 1;\n };\n CounterState.prototype.getCounterValues = function (name) {\n var counter = this.counters[name];\n return counter ? counter : [];\n };\n CounterState.prototype.pop = function (counters) {\n var _this = this;\n counters.forEach(function (counter) { return _this.counters[counter].pop(); });\n };\n CounterState.prototype.parse = function (style) {\n var _this = this;\n var counterIncrement = style.counterIncrement;\n var counterReset = style.counterReset;\n var canReset = true;\n if (counterIncrement !== null) {\n counterIncrement.forEach(function (entry) {\n var counter = _this.counters[entry.counter];\n if (counter && entry.increment !== 0) {\n canReset = false;\n if (!counter.length) {\n counter.push(1);\n }\n counter[Math.max(0, counter.length - 1)] += entry.increment;\n }\n });\n }\n var counterNames = [];\n if (canReset) {\n counterReset.forEach(function (entry) {\n var counter = _this.counters[entry.counter];\n counterNames.push(entry.counter);\n if (!counter) {\n counter = _this.counters[entry.counter] = [];\n }\n counter.push(entry.reset);\n });\n }\n return counterNames;\n };\n return CounterState;\n }());\n var ROMAN_UPPER = {\n integers: [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\n values: ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I']\n };\n var ARMENIAN = {\n integers: [\n 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70,\n 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\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 var HEBREW = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20,\n 19, 18, 17, 16, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\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 var GEORGIAN = {\n integers: [\n 10000, 9000, 8000, 7000, 6000, 5000, 4000, 3000, 2000, 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90,\n 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1\n ],\n values: [\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 var createAdditiveCounter = function (value, min, max, symbols, fallback, suffix) {\n if (value < min || value > max) {\n return createCounterText(value, fallback, suffix.length > 0);\n }\n return (symbols.integers.reduce(function (string, integer, index) {\n while (value >= integer) {\n value -= integer;\n string += symbols.values[index];\n }\n return string;\n }, '') + suffix);\n };\n var createCounterStyleWithSymbolResolver = function (value, codePointRangeLength, isNumeric, resolver) {\n var string = '';\n do {\n if (!isNumeric) {\n value--;\n }\n string = resolver(value) + string;\n value /= codePointRangeLength;\n } while (value * codePointRangeLength >= codePointRangeLength);\n return string;\n };\n var createCounterStyleFromRange = function (value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) {\n var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1;\n return ((value < 0 ? '-' : '') +\n (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function (codePoint) {\n return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart);\n }) +\n suffix));\n };\n var createCounterStyleFromSymbols = function (value, symbols, suffix) {\n if (suffix === void 0) { suffix = '. '; }\n var codePointRangeLength = symbols.length;\n return (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) { return symbols[Math.floor(codePoint % codePointRangeLength)]; }) + suffix);\n };\n var CJK_ZEROS = 1 << 0;\n var CJK_TEN_COEFFICIENTS = 1 << 1;\n var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2;\n var CJK_HUNDRED_COEFFICIENTS = 1 << 3;\n var createCJKCounter = function (value, numbers, multipliers, negativeSign, suffix, flags) {\n if (value < -9999 || value > 9999) {\n return createCounterText(value, 4 /* CJK_DECIMAL */, suffix.length > 0);\n }\n var tmp = Math.abs(value);\n var string = suffix;\n if (tmp === 0) {\n return numbers[0] + string;\n }\n for (var digit = 0; tmp > 0 && digit <= 4; digit++) {\n var coefficient = tmp % 10;\n if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== '') {\n string = numbers[coefficient] + string;\n }\n else if (coefficient > 1 ||\n (coefficient === 1 && digit === 0) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS)) ||\n (coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100) ||\n (coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS))) {\n string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : '') + string;\n }\n else if (coefficient === 1 && digit > 0) {\n string = multipliers[digit - 1] + string;\n }\n tmp = Math.floor(tmp / 10);\n }\n return (value < 0 ? negativeSign : '') + string;\n };\n var CHINESE_INFORMAL_MULTIPLIERS = '十百千萬';\n var CHINESE_FORMAL_MULTIPLIERS = '拾佰仟萬';\n var JAPANESE_NEGATIVE = 'マイナス';\n var KOREAN_NEGATIVE = '마이너스';\n var createCounterText = function (value, type, appendSuffix) {\n var defaultSuffix = appendSuffix ? '. ' : '';\n var cjkSuffix = appendSuffix ? '、' : '';\n var koreanSuffix = appendSuffix ? ', ' : '';\n var spaceSuffix = appendSuffix ? ' ' : '';\n switch (type) {\n case 0 /* DISC */:\n return '•' + spaceSuffix;\n case 1 /* CIRCLE */:\n return '◦' + spaceSuffix;\n case 2 /* SQUARE */:\n return '◾' + spaceSuffix;\n case 5 /* DECIMAL_LEADING_ZERO */:\n var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n return string.length < 4 ? \"0\" + string : string;\n case 4 /* CJK_DECIMAL */:\n return createCounterStyleFromSymbols(value, '〇一二三四五六七八九', cjkSuffix);\n case 6 /* LOWER_ROMAN */:\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3 /* DECIMAL */, defaultSuffix).toLowerCase();\n case 7 /* UPPER_ROMAN */:\n return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3 /* DECIMAL */, defaultSuffix);\n case 8 /* LOWER_GREEK */:\n return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix);\n case 9 /* LOWER_ALPHA */:\n return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix);\n case 10 /* UPPER_ALPHA */:\n return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix);\n case 11 /* ARABIC_INDIC */:\n return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix);\n case 12 /* ARMENIAN */:\n case 49 /* UPPER_ARMENIAN */:\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3 /* DECIMAL */, defaultSuffix);\n case 35 /* LOWER_ARMENIAN */:\n return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3 /* DECIMAL */, defaultSuffix).toLowerCase();\n case 13 /* BENGALI */:\n return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix);\n case 14 /* CAMBODIAN */:\n case 30 /* KHMER */:\n return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix);\n case 15 /* CJK_EARTHLY_BRANCH */:\n return createCounterStyleFromSymbols(value, '子丑寅卯辰巳午未申酉戌亥', cjkSuffix);\n case 16 /* CJK_HEAVENLY_STEM */:\n return createCounterStyleFromSymbols(value, '甲乙丙丁戊己庚辛壬癸', cjkSuffix);\n case 17 /* CJK_IDEOGRAPHIC */:\n case 48 /* TRAD_CHINESE_INFORMAL */:\n return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\n case 47 /* TRAD_CHINESE_FORMAL */:\n return createCJKCounter(value, '零壹貳參肆伍陸柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '負', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\n case 42 /* SIMP_CHINESE_INFORMAL */:\n return createCJKCounter(value, '零一二三四五六七八九', CHINESE_INFORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\n case 41 /* SIMP_CHINESE_FORMAL */:\n return createCJKCounter(value, '零壹贰叁肆伍陆柒捌玖', CHINESE_FORMAL_MULTIPLIERS, '负', cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS);\n case 26 /* JAPANESE_INFORMAL */:\n return createCJKCounter(value, '〇一二三四五六七八九', '十百千万', JAPANESE_NEGATIVE, cjkSuffix, 0);\n case 25 /* JAPANESE_FORMAL */:\n return createCJKCounter(value, '零壱弐参四伍六七八九', '拾百千万', JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\n case 31 /* KOREAN_HANGUL_FORMAL */:\n return createCJKCounter(value, '영일이삼사오육칠팔구', '십백천만', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\n case 33 /* KOREAN_HANJA_INFORMAL */:\n return createCJKCounter(value, '零一二三四五六七八九', '十百千萬', KOREAN_NEGATIVE, koreanSuffix, 0);\n case 32 /* KOREAN_HANJA_FORMAL */:\n return createCJKCounter(value, '零壹貳參四五六七八九', '拾百千', KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS);\n case 18 /* DEVANAGARI */:\n return createCounterStyleFromRange(value, 0x966, 0x96f, true, defaultSuffix);\n case 20 /* GEORGIAN */:\n return createAdditiveCounter(value, 1, 19999, GEORGIAN, 3 /* DECIMAL */, defaultSuffix);\n case 21 /* GUJARATI */:\n return createCounterStyleFromRange(value, 0xae6, 0xaef, true, defaultSuffix);\n case 22 /* GURMUKHI */:\n return createCounterStyleFromRange(value, 0xa66, 0xa6f, true, defaultSuffix);\n case 22 /* HEBREW */:\n return createAdditiveCounter(value, 1, 10999, HEBREW, 3 /* DECIMAL */, defaultSuffix);\n case 23 /* HIRAGANA */:\n return createCounterStyleFromSymbols(value, 'あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん');\n case 24 /* HIRAGANA_IROHA */:\n return createCounterStyleFromSymbols(value, 'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす');\n case 27 /* KANNADA */:\n return createCounterStyleFromRange(value, 0xce6, 0xcef, true, defaultSuffix);\n case 28 /* KATAKANA */:\n return createCounterStyleFromSymbols(value, 'アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン', cjkSuffix);\n case 29 /* KATAKANA_IROHA */:\n return createCounterStyleFromSymbols(value, 'イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス', cjkSuffix);\n case 34 /* LAO */:\n return createCounterStyleFromRange(value, 0xed0, 0xed9, true, defaultSuffix);\n case 37 /* MONGOLIAN */:\n return createCounterStyleFromRange(value, 0x1810, 0x1819, true, defaultSuffix);\n case 38 /* MYANMAR */:\n return createCounterStyleFromRange(value, 0x1040, 0x1049, true, defaultSuffix);\n case 39 /* ORIYA */:\n return createCounterStyleFromRange(value, 0xb66, 0xb6f, true, defaultSuffix);\n case 40 /* PERSIAN */:\n return createCounterStyleFromRange(value, 0x6f0, 0x6f9, true, defaultSuffix);\n case 43 /* TAMIL */:\n return createCounterStyleFromRange(value, 0xbe6, 0xbef, true, defaultSuffix);\n case 44 /* TELUGU */:\n return createCounterStyleFromRange(value, 0xc66, 0xc6f, true, defaultSuffix);\n case 45 /* THAI */:\n return createCounterStyleFromRange(value, 0xe50, 0xe59, true, defaultSuffix);\n case 46 /* TIBETAN */:\n return createCounterStyleFromRange(value, 0xf20, 0xf29, true, defaultSuffix);\n case 3 /* DECIMAL */:\n default:\n return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix);\n }\n };\n\n var IGNORE_ATTRIBUTE = 'data-html2canvas-ignore';\n var DocumentCloner = /** @class */ (function () {\n function DocumentCloner(context, element, options) {\n this.context = context;\n this.options = options;\n this.scrolledElements = [];\n this.referenceElement = element;\n this.counters = new CounterState();\n this.quoteDepth = 0;\n if (!element.ownerDocument) {\n throw new Error('Cloned element does not have an owner document');\n }\n this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false);\n }\n DocumentCloner.prototype.toIFrame = function (ownerDocument, windowSize) {\n var _this = this;\n var iframe = createIFrameContainer(ownerDocument, windowSize);\n if (!iframe.contentWindow) {\n return Promise.reject(\"Unable to find iframe window\");\n }\n var scrollX = ownerDocument.defaultView.pageXOffset;\n var scrollY = ownerDocument.defaultView.pageYOffset;\n var cloneWindow = iframe.contentWindow;\n var documentClone = cloneWindow.document;\n /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle\n if window url is about:blank, we can assign the url to current by writing onto the document\n */\n var iframeLoad = iframeLoader(iframe).then(function () { return __awaiter(_this, void 0, void 0, function () {\n var onclone, referenceElement;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.scrolledElements.forEach(restoreNodeScroll);\n if (cloneWindow) {\n cloneWindow.scrollTo(windowSize.left, windowSize.top);\n if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) &&\n (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) {\n this.context.logger.warn('Unable to restore scroll position for cloned document');\n this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize.left, cloneWindow.scrollY - windowSize.top, 0, 0);\n }\n }\n onclone = this.options.onclone;\n referenceElement = this.clonedReferenceElement;\n if (typeof referenceElement === 'undefined') {\n return [2 /*return*/, Promise.reject(\"Error finding the \" + this.referenceElement.nodeName + \" in the cloned document\")];\n }\n if (!(documentClone.fonts && documentClone.fonts.ready)) return [3 /*break*/, 2];\n return [4 /*yield*/, documentClone.fonts.ready];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2:\n if (!/(AppleWebKit)/g.test(navigator.userAgent)) return [3 /*break*/, 4];\n return [4 /*yield*/, imagesReady(documentClone)];\n case 3:\n _a.sent();\n _a.label = 4;\n case 4:\n if (typeof onclone === 'function') {\n return [2 /*return*/, Promise.resolve()\n .then(function () { return onclone(documentClone, referenceElement); })\n .then(function () { return iframe; })];\n }\n return [2 /*return*/, iframe];\n }\n });\n }); });\n documentClone.open();\n documentClone.write(serializeDoctype(document.doctype) + \"<html></html>\");\n // Chrome scrolls the parent document for some reason after the write to the cloned window???\n restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY);\n documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement);\n documentClone.close();\n return iframeLoad;\n };\n DocumentCloner.prototype.createElementClone = function (node) {\n if (isDebugging(node, 2 /* CLONE */)) {\n debugger;\n }\n if (isCanvasElement(node)) {\n return this.createCanvasClone(node);\n }\n if (isVideoElement(node)) {\n return this.createVideoClone(node);\n }\n if (isStyleElement(node)) {\n return this.createStyleClone(node);\n }\n var clone = node.cloneNode(false);\n if (isImageElement(clone)) {\n if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) {\n clone.src = node.currentSrc;\n clone.srcset = '';\n }\n if (clone.loading === 'lazy') {\n clone.loading = 'eager';\n }\n }\n if (isCustomElement(clone)) {\n return this.createCustomElementClone(clone);\n }\n return clone;\n };\n DocumentCloner.prototype.createCustomElementClone = function (node) {\n var clone = document.createElement('html2canvascustomelement');\n copyCSSStyles(node.style, clone);\n return clone;\n };\n DocumentCloner.prototype.createStyleClone = function (node) {\n try {\n var sheet = node.sheet;\n if (sheet && sheet.cssRules) {\n var css = [].slice.call(sheet.cssRules, 0).reduce(function (css, rule) {\n if (rule && typeof rule.cssText === 'string') {\n return css + rule.cssText;\n }\n return css;\n }, '');\n var style = node.cloneNode(false);\n style.textContent = css;\n return style;\n }\n }\n catch (e) {\n // accessing node.sheet.cssRules throws a DOMException\n this.context.logger.error('Unable to access cssRules property', e);\n if (e.name !== 'SecurityError') {\n throw e;\n }\n }\n return node.cloneNode(false);\n };\n DocumentCloner.prototype.createCanvasClone = function (canvas) {\n var _a;\n if (this.options.inlineImages && canvas.ownerDocument) {\n var img = canvas.ownerDocument.createElement('img');\n try {\n img.src = canvas.toDataURL();\n return img;\n }\n catch (e) {\n this.context.logger.info(\"Unable to inline canvas contents, canvas is tainted\", canvas);\n }\n }\n var clonedCanvas = canvas.cloneNode(false);\n try {\n clonedCanvas.width = canvas.width;\n clonedCanvas.height = canvas.height;\n var ctx = canvas.getContext('2d');\n var clonedCtx = clonedCanvas.getContext('2d');\n if (clonedCtx) {\n if (!this.options.allowTaint && ctx) {\n clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0);\n }\n else {\n var gl = (_a = canvas.getContext('webgl2')) !== null && _a !== void 0 ? _a : canvas.getContext('webgl');\n if (gl) {\n var attribs = gl.getContextAttributes();\n if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) {\n this.context.logger.warn('Unable to clone WebGL context as it has preserveDrawingBuffer=false', canvas);\n }\n }\n clonedCtx.drawImage(canvas, 0, 0);\n }\n }\n return clonedCanvas;\n }\n catch (e) {\n this.context.logger.info(\"Unable to clone canvas as it is tainted\", canvas);\n }\n return clonedCanvas;\n };\n DocumentCloner.prototype.createVideoClone = function (video) {\n var canvas = video.ownerDocument.createElement('canvas');\n canvas.width = video.offsetWidth;\n canvas.height = video.offsetHeight;\n var ctx = canvas.getContext('2d');\n try {\n if (ctx) {\n ctx.drawImage(video, 0, 0, canvas.width, canvas.height);\n if (!this.options.allowTaint) {\n ctx.getImageData(0, 0, canvas.width, canvas.height);\n }\n }\n return canvas;\n }\n catch (e) {\n this.context.logger.info(\"Unable to clone video as it is tainted\", video);\n }\n var blankCanvas = video.ownerDocument.createElement('canvas');\n blankCanvas.width = video.offsetWidth;\n blankCanvas.height = video.offsetHeight;\n return blankCanvas;\n };\n DocumentCloner.prototype.appendChildNode = function (clone, child, copyStyles) {\n if (!isElementNode(child) ||\n (!isScriptElement(child) &&\n !child.hasAttribute(IGNORE_ATTRIBUTE) &&\n (typeof this.options.ignoreElements !== 'function' || !this.options.ignoreElements(child)))) {\n if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) {\n clone.appendChild(this.cloneNode(child, copyStyles));\n }\n }\n };\n DocumentCloner.prototype.cloneChildNodes = function (node, clone, copyStyles) {\n var _this = this;\n for (var child = node.shadowRoot ? node.shadowRoot.firstChild : node.firstChild; child; child = child.nextSibling) {\n if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === 'function') {\n var assignedNodes = child.assignedNodes();\n if (assignedNodes.length) {\n assignedNodes.forEach(function (assignedNode) { return _this.appendChildNode(clone, assignedNode, copyStyles); });\n }\n }\n else {\n this.appendChildNode(clone, child, copyStyles);\n }\n }\n };\n DocumentCloner.prototype.cloneNode = function (node, copyStyles) {\n if (isTextNode(node)) {\n return document.createTextNode(node.data);\n }\n if (!node.ownerDocument) {\n return node.cloneNode(false);\n }\n var window = node.ownerDocument.defaultView;\n if (window && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) {\n var clone = this.createElementClone(node);\n clone.style.transitionProperty = 'none';\n var style = window.getComputedStyle(node);\n var styleBefore = window.getComputedStyle(node, ':before');\n var styleAfter = window.getComputedStyle(node, ':after');\n if (this.referenceElement === node && isHTMLElementNode(clone)) {\n this.clonedReferenceElement = clone;\n }\n if (isBodyElement(clone)) {\n createPseudoHideStyles(clone);\n }\n var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n var before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE);\n if (isCustomElement(node)) {\n copyStyles = true;\n }\n if (!isVideoElement(node)) {\n this.cloneChildNodes(node, clone, copyStyles);\n }\n if (before) {\n clone.insertBefore(before, clone.firstChild);\n }\n var after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER);\n if (after) {\n clone.appendChild(after);\n }\n this.counters.pop(counters);\n if ((style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node)) ||\n copyStyles) {\n copyCSSStyles(style, clone);\n }\n if (node.scrollTop !== 0 || node.scrollLeft !== 0) {\n this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]);\n }\n if ((isTextareaElement(node) || isSelectElement(node)) &&\n (isTextareaElement(clone) || isSelectElement(clone))) {\n clone.value = node.value;\n }\n return clone;\n }\n return node.cloneNode(false);\n };\n DocumentCloner.prototype.resolvePseudoContent = function (node, clone, style, pseudoElt) {\n var _this = this;\n if (!style) {\n return;\n }\n var value = style.content;\n var document = clone.ownerDocument;\n if (!document || !value || value === 'none' || value === '-moz-alt-content' || style.display === 'none') {\n return;\n }\n this.counters.parse(new CSSParsedCounterDeclaration(this.context, style));\n var declaration = new CSSParsedPseudoDeclaration(this.context, style);\n var anonymousReplacedElement = document.createElement('html2canvaspseudoelement');\n copyCSSStyles(style, anonymousReplacedElement);\n declaration.content.forEach(function (token) {\n if (token.type === 0 /* STRING_TOKEN */) {\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n }\n else if (token.type === 22 /* URL_TOKEN */) {\n var img = document.createElement('img');\n img.src = token.value;\n img.style.opacity = '1';\n anonymousReplacedElement.appendChild(img);\n }\n else if (token.type === 18 /* FUNCTION */) {\n if (token.name === 'attr') {\n var attr = token.values.filter(isIdentToken);\n if (attr.length) {\n anonymousReplacedElement.appendChild(document.createTextNode(node.getAttribute(attr[0].value) || ''));\n }\n }\n else if (token.name === 'counter') {\n var _a = token.values.filter(nonFunctionArgSeparator), counter = _a[0], counterStyle = _a[1];\n if (counter && isIdentToken(counter)) {\n var counterState = _this.counters.getCounterValue(counter.value);\n var counterType = counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(_this.context, counterStyle.value)\n : 3 /* DECIMAL */;\n anonymousReplacedElement.appendChild(document.createTextNode(createCounterText(counterState, counterType, false)));\n }\n }\n else if (token.name === 'counters') {\n var _b = token.values.filter(nonFunctionArgSeparator), counter = _b[0], delim = _b[1], counterStyle = _b[2];\n if (counter && isIdentToken(counter)) {\n var counterStates = _this.counters.getCounterValues(counter.value);\n var counterType_1 = counterStyle && isIdentToken(counterStyle)\n ? listStyleType.parse(_this.context, counterStyle.value)\n : 3 /* DECIMAL */;\n var separator = delim && delim.type === 0 /* STRING_TOKEN */ ? delim.value : '';\n var text = counterStates\n .map(function (value) { return createCounterText(value, counterType_1, false); })\n .join(separator);\n anonymousReplacedElement.appendChild(document.createTextNode(text));\n }\n }\n else ;\n }\n else if (token.type === 20 /* IDENT_TOKEN */) {\n switch (token.value) {\n case 'open-quote':\n anonymousReplacedElement.appendChild(document.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true)));\n break;\n case 'close-quote':\n anonymousReplacedElement.appendChild(document.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false)));\n break;\n default:\n // safari doesn't parse string tokens correctly because of lack of quotes\n anonymousReplacedElement.appendChild(document.createTextNode(token.value));\n }\n }\n });\n anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + \" \" + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;\n var newClassName = pseudoElt === PseudoElementType.BEFORE\n ? \" \" + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE\n : \" \" + PSEUDO_HIDE_ELEMENT_CLASS_AFTER;\n if (isSVGElementNode(clone)) {\n clone.className.baseValue += newClassName;\n }\n else {\n clone.className += newClassName;\n }\n return anonymousReplacedElement;\n };\n DocumentCloner.destroy = function (container) {\n if (container.parentNode) {\n container.parentNode.removeChild(container);\n return true;\n }\n return false;\n };\n return DocumentCloner;\n }());\n var PseudoElementType;\n (function (PseudoElementType) {\n PseudoElementType[PseudoElementType[\"BEFORE\"] = 0] = \"BEFORE\";\n PseudoElementType[PseudoElementType[\"AFTER\"] = 1] = \"AFTER\";\n })(PseudoElementType || (PseudoElementType = {}));\n var createIFrameContainer = function (ownerDocument, bounds) {\n var cloneIframeContainer = ownerDocument.createElement('iframe');\n cloneIframeContainer.className = 'html2canvas-container';\n cloneIframeContainer.style.visibility = 'hidden';\n cloneIframeContainer.style.position = 'fixed';\n cloneIframeContainer.style.left = '-10000px';\n cloneIframeContainer.style.top = '0px';\n cloneIframeContainer.style.border = '0';\n cloneIframeContainer.width = bounds.width.toString();\n cloneIframeContainer.height = bounds.height.toString();\n cloneIframeContainer.scrolling = 'no'; // ios won't scroll without it\n cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, 'true');\n ownerDocument.body.appendChild(cloneIframeContainer);\n return cloneIframeContainer;\n };\n var imageReady = function (img) {\n return new Promise(function (resolve) {\n if (img.complete) {\n resolve();\n return;\n }\n if (!img.src) {\n resolve();\n return;\n }\n img.onload = resolve;\n img.onerror = resolve;\n });\n };\n var imagesReady = function (document) {\n return Promise.all([].slice.call(document.images, 0).map(imageReady));\n };\n var iframeLoader = function (iframe) {\n return new Promise(function (resolve, reject) {\n var cloneWindow = iframe.contentWindow;\n if (!cloneWindow) {\n return reject(\"No window assigned for iframe\");\n }\n var documentClone = cloneWindow.document;\n cloneWindow.onload = iframe.onload = function () {\n cloneWindow.onload = iframe.onload = null;\n var interval = setInterval(function () {\n if (documentClone.body.childNodes.length > 0 && documentClone.readyState === 'complete') {\n clearInterval(interval);\n resolve(iframe);\n }\n }, 50);\n };\n });\n };\n var ignoredStyleProperties = [\n 'all',\n 'd',\n 'content' // Safari shows pseudoelements if content is set\n ];\n var copyCSSStyles = function (style, target) {\n // Edge does not provide value for cssText\n for (var i = style.length - 1; i >= 0; i--) {\n var property = style.item(i);\n if (ignoredStyleProperties.indexOf(property) === -1) {\n target.style.setProperty(property, style.getPropertyValue(property));\n }\n }\n return target;\n };\n var serializeDoctype = function (doctype) {\n var str = '';\n if (doctype) {\n str += '<!DOCTYPE ';\n if (doctype.name) {\n str += doctype.name;\n }\n if (doctype.internalSubset) {\n str += doctype.internalSubset;\n }\n if (doctype.publicId) {\n str += \"\\\"\" + doctype.publicId + \"\\\"\";\n }\n if (doctype.systemId) {\n str += \"\\\"\" + doctype.systemId + \"\\\"\";\n }\n str += '>';\n }\n return str;\n };\n var restoreOwnerScroll = function (ownerDocument, x, y) {\n if (ownerDocument &&\n ownerDocument.defaultView &&\n (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) {\n ownerDocument.defaultView.scrollTo(x, y);\n }\n };\n var restoreNodeScroll = function (_a) {\n var element = _a[0], x = _a[1], y = _a[2];\n element.scrollLeft = x;\n element.scrollTop = y;\n };\n var PSEUDO_BEFORE = ':before';\n var PSEUDO_AFTER = ':after';\n var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = '___html2canvas___pseudoelement_before';\n var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = '___html2canvas___pseudoelement_after';\n var PSEUDO_HIDE_ELEMENT_STYLE = \"{\\n content: \\\"\\\" !important;\\n display: none !important;\\n}\";\n var createPseudoHideStyles = function (body) {\n createStyles(body, \".\" + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + \"\\n .\" + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE);\n };\n var createStyles = function (body, styles) {\n var document = body.ownerDocument;\n if (document) {\n var style = document.createElement('style');\n style.textContent = styles;\n body.appendChild(style);\n }\n };\n\n var CacheStorage = /** @class */ (function () {\n function CacheStorage() {\n }\n CacheStorage.getOrigin = function (url) {\n var link = CacheStorage._link;\n if (!link) {\n return 'about:blank';\n }\n link.href = url;\n link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/\n return link.protocol + link.hostname + link.port;\n };\n CacheStorage.isSameOrigin = function (src) {\n return CacheStorage.getOrigin(src) === CacheStorage._origin;\n };\n CacheStorage.setContext = function (window) {\n CacheStorage._link = window.document.createElement('a');\n CacheStorage._origin = CacheStorage.getOrigin(window.location.href);\n };\n CacheStorage._origin = 'about:blank';\n return CacheStorage;\n }());\n var Cache = /** @class */ (function () {\n function Cache(context, _options) {\n this.context = context;\n this._options = _options;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this._cache = {};\n }\n Cache.prototype.addImage = function (src) {\n var result = Promise.resolve();\n if (this.has(src)) {\n return result;\n }\n if (isBlobImage(src) || isRenderable(src)) {\n (this._cache[src] = this.loadImage(src)).catch(function () {\n // prevent unhandled rejection\n });\n return result;\n }\n return result;\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Cache.prototype.match = function (src) {\n return this._cache[src];\n };\n Cache.prototype.loadImage = function (key) {\n return __awaiter(this, void 0, void 0, function () {\n var isSameOrigin, useCORS, useProxy, src;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n isSameOrigin = CacheStorage.isSameOrigin(key);\n useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin;\n useProxy = !isInlineImage(key) &&\n !isSameOrigin &&\n !isBlobImage(key) &&\n typeof this._options.proxy === 'string' &&\n FEATURES.SUPPORT_CORS_XHR &&\n !useCORS;\n if (!isSameOrigin &&\n this._options.allowTaint === false &&\n !isInlineImage(key) &&\n !isBlobImage(key) &&\n !useProxy &&\n !useCORS) {\n return [2 /*return*/];\n }\n src = key;\n if (!useProxy) return [3 /*break*/, 2];\n return [4 /*yield*/, this.proxy(src)];\n case 1:\n src = _a.sent();\n _a.label = 2;\n case 2:\n this.context.logger.debug(\"Added image \" + key.substring(0, 256));\n return [4 /*yield*/, new Promise(function (resolve, reject) {\n var img = new Image();\n img.onload = function () { return resolve(img); };\n img.onerror = reject;\n //ios safari 10.3 taints canvas with data urls unless crossOrigin is set to anonymous\n if (isInlineBase64Image(src) || useCORS) {\n img.crossOrigin = 'anonymous';\n }\n img.src = src;\n if (img.complete === true) {\n // Inline XML images may fail to parse, throwing an Error later on\n setTimeout(function () { return resolve(img); }, 500);\n }\n if (_this._options.imageTimeout > 0) {\n setTimeout(function () { return reject(\"Timed out (\" + _this._options.imageTimeout + \"ms) loading image\"); }, _this._options.imageTimeout);\n }\n })];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Cache.prototype.has = function (key) {\n return typeof this._cache[key] !== 'undefined';\n };\n Cache.prototype.keys = function () {\n return Promise.resolve(Object.keys(this._cache));\n };\n Cache.prototype.proxy = function (src) {\n var _this = this;\n var proxy = this._options.proxy;\n if (!proxy) {\n throw new Error('No proxy defined');\n }\n var key = src.substring(0, 256);\n return new Promise(function (resolve, reject) {\n var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? 'blob' : 'text';\n var xhr = new XMLHttpRequest();\n xhr.onload = function () {\n if (xhr.status === 200) {\n if (responseType === 'text') {\n resolve(xhr.response);\n }\n else {\n var reader_1 = new FileReader();\n reader_1.addEventListener('load', function () { return resolve(reader_1.result); }, false);\n reader_1.addEventListener('error', function (e) { return reject(e); }, false);\n reader_1.readAsDataURL(xhr.response);\n }\n }\n else {\n reject(\"Failed to proxy resource \" + key + \" with status code \" + xhr.status);\n }\n };\n xhr.onerror = reject;\n var queryString = proxy.indexOf('?') > -1 ? '&' : '?';\n xhr.open('GET', \"\" + proxy + queryString + \"url=\" + encodeURIComponent(src) + \"&responseType=\" + responseType);\n if (responseType !== 'text' && xhr instanceof XMLHttpRequest) {\n xhr.responseType = responseType;\n }\n if (_this._options.imageTimeout) {\n var timeout_1 = _this._options.imageTimeout;\n xhr.timeout = timeout_1;\n xhr.ontimeout = function () { return reject(\"Timed out (\" + timeout_1 + \"ms) proxying \" + key); };\n }\n xhr.send();\n });\n };\n return Cache;\n }());\n var INLINE_SVG = /^data:image\\/svg\\+xml/i;\n var INLINE_BASE64 = /^data:image\\/.*;base64,/i;\n var INLINE_IMG = /^data:image\\/.*/i;\n var isRenderable = function (src) { return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src); };\n var isInlineImage = function (src) { return INLINE_IMG.test(src); };\n var isInlineBase64Image = function (src) { return INLINE_BASE64.test(src); };\n var isBlobImage = function (src) { return src.substr(0, 4) === 'blob'; };\n var isSVG = function (src) { return src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src); };\n\n var Vector = /** @class */ (function () {\n function Vector(x, y) {\n this.type = 0 /* VECTOR */;\n this.x = x;\n this.y = y;\n }\n Vector.prototype.add = function (deltaX, deltaY) {\n return new Vector(this.x + deltaX, this.y + deltaY);\n };\n return Vector;\n }());\n\n var lerp = function (a, b, t) {\n return new Vector(a.x + (b.x - a.x) * t, a.y + (b.y - a.y) * t);\n };\n var BezierCurve = /** @class */ (function () {\n function BezierCurve(start, startControl, endControl, end) {\n this.type = 1 /* BEZIER_CURVE */;\n this.start = start;\n this.startControl = startControl;\n this.endControl = endControl;\n this.end = end;\n }\n BezierCurve.prototype.subdivide = function (t, firstHalf) {\n var ab = lerp(this.start, this.startControl, t);\n var bc = lerp(this.startControl, this.endControl, t);\n var cd = lerp(this.endControl, this.end, t);\n var abbc = lerp(ab, bc, t);\n var bccd = lerp(bc, cd, t);\n var dest = lerp(abbc, bccd, t);\n return firstHalf ? new BezierCurve(this.start, ab, abbc, dest) : new BezierCurve(dest, bccd, cd, this.end);\n };\n BezierCurve.prototype.add = function (deltaX, deltaY) {\n return new BezierCurve(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY));\n };\n BezierCurve.prototype.reverse = function () {\n return new BezierCurve(this.end, this.endControl, this.startControl, this.start);\n };\n return BezierCurve;\n }());\n var isBezierCurve = function (path) { return path.type === 1 /* BEZIER_CURVE */; };\n\n var BoundCurves = /** @class */ (function () {\n function BoundCurves(element) {\n var styles = element.styles;\n var bounds = element.bounds;\n var _a = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a[0], tlv = _a[1];\n var _b = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b[0], trv = _b[1];\n var _c = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c[0], brv = _c[1];\n var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1];\n var factors = [];\n factors.push((tlh + trh) / bounds.width);\n factors.push((blh + brh) / bounds.width);\n factors.push((tlv + blv) / bounds.height);\n factors.push((trv + brv) / bounds.height);\n var maxFactor = Math.max.apply(Math, factors);\n if (maxFactor > 1) {\n tlh /= maxFactor;\n tlv /= maxFactor;\n trh /= maxFactor;\n trv /= maxFactor;\n brh /= maxFactor;\n brv /= maxFactor;\n blh /= maxFactor;\n blv /= maxFactor;\n }\n var topWidth = bounds.width - trh;\n var rightHeight = bounds.height - brv;\n var bottomWidth = bounds.width - brh;\n var leftHeight = bounds.height - blv;\n var borderTopWidth = styles.borderTopWidth;\n var borderRightWidth = styles.borderRightWidth;\n var borderBottomWidth = styles.borderBottomWidth;\n var borderLeftWidth = styles.borderLeftWidth;\n var paddingTop = getAbsoluteValue(styles.paddingTop, element.bounds.width);\n var paddingRight = getAbsoluteValue(styles.paddingRight, element.bounds.width);\n var paddingBottom = getAbsoluteValue(styles.paddingBottom, element.bounds.width);\n var paddingLeft = getAbsoluteValue(styles.paddingLeft, element.bounds.width);\n this.topLeftBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3, tlh - borderLeftWidth / 3, tlv - borderTopWidth / 3, CORNER.TOP_LEFT)\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + borderTopWidth / 3);\n this.topRightBorderDoubleOuterBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth / 3, trh - borderRightWidth / 3, trv - borderTopWidth / 3, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + borderTopWidth / 3);\n this.bottomRightBorderDoubleOuterBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth / 3, brv - borderBottomWidth / 3, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);\n this.bottomLeftBorderDoubleOuterBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth / 3, bounds.top + leftHeight, blh - borderLeftWidth / 3, blv - borderBottomWidth / 3, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left + borderLeftWidth / 3, bounds.top + bounds.height - borderBottomWidth / 3);\n this.topLeftBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3, tlh - (borderLeftWidth * 2) / 3, tlv - (borderTopWidth * 2) / 3, CORNER.TOP_LEFT)\n : new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);\n this.topRightBorderDoubleInnerBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top + (borderTopWidth * 2) / 3, trh - (borderRightWidth * 2) / 3, trv - (borderTopWidth * 2) / 3, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width - (borderRightWidth * 2) / 3, bounds.top + (borderTopWidth * 2) / 3);\n this.bottomRightBorderDoubleInnerBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - (borderRightWidth * 2) / 3, brv - (borderBottomWidth * 2) / 3, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width - (borderRightWidth * 2) / 3, bounds.top + bounds.height - (borderBottomWidth * 2) / 3);\n this.bottomLeftBorderDoubleInnerBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + leftHeight, blh - (borderLeftWidth * 2) / 3, blv - (borderBottomWidth * 2) / 3, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left + (borderLeftWidth * 2) / 3, bounds.top + bounds.height - (borderBottomWidth * 2) / 3);\n this.topLeftBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2, tlh - borderLeftWidth / 2, tlv - borderTopWidth / 2, CORNER.TOP_LEFT)\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + borderTopWidth / 2);\n this.topRightBorderStroke =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth / 2, trh - borderRightWidth / 2, trv - borderTopWidth / 2, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + borderTopWidth / 2);\n this.bottomRightBorderStroke =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth / 2, brv - borderBottomWidth / 2, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);\n this.bottomLeftBorderStroke =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth / 2, bounds.top + leftHeight, blh - borderLeftWidth / 2, blv - borderBottomWidth / 2, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left + borderLeftWidth / 2, bounds.top + bounds.height - borderBottomWidth / 2);\n this.topLeftBorderBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT)\n : new Vector(bounds.left, bounds.top);\n this.topRightBorderBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top);\n this.bottomRightBorderBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width, bounds.top + bounds.height);\n this.bottomLeftBorderBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left, bounds.top + bounds.height);\n this.topLeftPaddingBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth, bounds.top + borderTopWidth, Math.max(0, tlh - borderLeftWidth), Math.max(0, tlv - borderTopWidth), CORNER.TOP_LEFT)\n : new Vector(bounds.left + borderLeftWidth, bounds.top + borderTopWidth);\n this.topRightPaddingBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width - borderRightWidth), bounds.top + borderTopWidth, topWidth > bounds.width + borderRightWidth ? 0 : Math.max(0, trh - borderRightWidth), Math.max(0, trv - borderTopWidth), CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + borderTopWidth);\n this.bottomRightPaddingBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth), bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth), Math.max(0, brh - borderRightWidth), Math.max(0, brv - borderBottomWidth), CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width - borderRightWidth, bounds.top + bounds.height - borderBottomWidth);\n this.bottomLeftPaddingBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth, bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth), Math.max(0, blh - borderLeftWidth), Math.max(0, blv - borderBottomWidth), CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left + borderLeftWidth, bounds.top + bounds.height - borderBottomWidth);\n this.topLeftContentBox =\n tlh > 0 || tlv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop, Math.max(0, tlh - (borderLeftWidth + paddingLeft)), Math.max(0, tlv - (borderTopWidth + paddingTop)), CORNER.TOP_LEFT)\n : new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + borderTopWidth + paddingTop);\n this.topRightContentBox =\n trh > 0 || trv > 0\n ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth + paddingLeft), bounds.top + borderTopWidth + paddingTop, topWidth > bounds.width + borderLeftWidth + paddingLeft ? 0 : trh - borderLeftWidth + paddingLeft, trv - (borderTopWidth + paddingTop), CORNER.TOP_RIGHT)\n : new Vector(bounds.left + bounds.width - (borderRightWidth + paddingRight), bounds.top + borderTopWidth + paddingTop);\n this.bottomRightContentBox =\n brh > 0 || brv > 0\n ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth + paddingLeft)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth + paddingTop), Math.max(0, brh - (borderRightWidth + paddingRight)), brv - (borderBottomWidth + paddingBottom), CORNER.BOTTOM_RIGHT)\n : new Vector(bounds.left + bounds.width - (borderRightWidth + paddingRight), bounds.top + bounds.height - (borderBottomWidth + paddingBottom));\n this.bottomLeftContentBox =\n blh > 0 || blv > 0\n ? getCurvePoints(bounds.left + borderLeftWidth + paddingLeft, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth + paddingLeft)), blv - (borderBottomWidth + paddingBottom), CORNER.BOTTOM_LEFT)\n : new Vector(bounds.left + borderLeftWidth + paddingLeft, bounds.top + bounds.height - (borderBottomWidth + paddingBottom));\n }\n return BoundCurves;\n }());\n var CORNER;\n (function (CORNER) {\n CORNER[CORNER[\"TOP_LEFT\"] = 0] = \"TOP_LEFT\";\n CORNER[CORNER[\"TOP_RIGHT\"] = 1] = \"TOP_RIGHT\";\n CORNER[CORNER[\"BOTTOM_RIGHT\"] = 2] = \"BOTTOM_RIGHT\";\n CORNER[CORNER[\"BOTTOM_LEFT\"] = 3] = \"BOTTOM_LEFT\";\n })(CORNER || (CORNER = {}));\n var getCurvePoints = function (x, y, r1, r2, position) {\n var kappa = 4 * ((Math.sqrt(2) - 1) / 3);\n var ox = r1 * kappa; // control point offset horizontal\n var oy = r2 * kappa; // control point offset vertical\n var xm = x + r1; // x-middle\n var ym = y + r2; // y-middle\n switch (position) {\n case CORNER.TOP_LEFT:\n return new BezierCurve(new Vector(x, ym), new Vector(x, ym - oy), new Vector(xm - ox, y), new Vector(xm, y));\n case CORNER.TOP_RIGHT:\n return new BezierCurve(new Vector(x, y), new Vector(x + ox, y), new Vector(xm, ym - oy), new Vector(xm, ym));\n case CORNER.BOTTOM_RIGHT:\n return new BezierCurve(new Vector(xm, y), new Vector(xm, y + oy), new Vector(x + ox, ym), new Vector(x, ym));\n case CORNER.BOTTOM_LEFT:\n default:\n return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x, y + oy), new Vector(x, y));\n }\n };\n var calculateBorderBoxPath = function (curves) {\n return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox];\n };\n var calculateContentBoxPath = function (curves) {\n return [\n curves.topLeftContentBox,\n curves.topRightContentBox,\n curves.bottomRightContentBox,\n curves.bottomLeftContentBox\n ];\n };\n var calculatePaddingBoxPath = function (curves) {\n return [\n curves.topLeftPaddingBox,\n curves.topRightPaddingBox,\n curves.bottomRightPaddingBox,\n curves.bottomLeftPaddingBox\n ];\n };\n\n var TransformEffect = /** @class */ (function () {\n function TransformEffect(offsetX, offsetY, matrix) {\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n this.matrix = matrix;\n this.type = 0 /* TRANSFORM */;\n this.target = 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */;\n }\n return TransformEffect;\n }());\n var ClipEffect = /** @class */ (function () {\n function ClipEffect(path, target) {\n this.path = path;\n this.target = target;\n this.type = 1 /* CLIP */;\n }\n return ClipEffect;\n }());\n var OpacityEffect = /** @class */ (function () {\n function OpacityEffect(opacity) {\n this.opacity = opacity;\n this.type = 2 /* OPACITY */;\n this.target = 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */;\n }\n return OpacityEffect;\n }());\n var isTransformEffect = function (effect) {\n return effect.type === 0 /* TRANSFORM */;\n };\n var isClipEffect = function (effect) { return effect.type === 1 /* CLIP */; };\n var isOpacityEffect = function (effect) { return effect.type === 2 /* OPACITY */; };\n\n var equalPath = function (a, b) {\n if (a.length === b.length) {\n return a.some(function (v, i) { return v === b[i]; });\n }\n return false;\n };\n var transformPath = function (path, deltaX, deltaY, deltaW, deltaH) {\n return path.map(function (point, index) {\n switch (index) {\n case 0:\n return point.add(deltaX, deltaY);\n case 1:\n return point.add(deltaX + deltaW, deltaY);\n case 2:\n return point.add(deltaX + deltaW, deltaY + deltaH);\n case 3:\n return point.add(deltaX, deltaY + deltaH);\n }\n return point;\n });\n };\n\n var StackingContext = /** @class */ (function () {\n function StackingContext(container) {\n this.element = container;\n this.inlineLevel = [];\n this.nonInlineLevel = [];\n this.negativeZIndex = [];\n this.zeroOrAutoZIndexOrTransformedOrOpacity = [];\n this.positiveZIndex = [];\n this.nonPositionedFloats = [];\n this.nonPositionedInlineLevel = [];\n }\n return StackingContext;\n }());\n var ElementPaint = /** @class */ (function () {\n function ElementPaint(container, parent) {\n this.container = container;\n this.parent = parent;\n this.effects = [];\n this.curves = new BoundCurves(this.container);\n if (this.container.styles.opacity < 1) {\n this.effects.push(new OpacityEffect(this.container.styles.opacity));\n }\n if (this.container.styles.transform !== null) {\n var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number;\n var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number;\n var matrix = this.container.styles.transform;\n this.effects.push(new TransformEffect(offsetX, offsetY, matrix));\n }\n if (this.container.styles.overflowX !== 0 /* VISIBLE */) {\n var borderBox = calculateBorderBoxPath(this.curves);\n var paddingBox = calculatePaddingBoxPath(this.curves);\n if (equalPath(borderBox, paddingBox)) {\n this.effects.push(new ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));\n }\n else {\n this.effects.push(new ClipEffect(borderBox, 2 /* BACKGROUND_BORDERS */));\n this.effects.push(new ClipEffect(paddingBox, 4 /* CONTENT */));\n }\n }\n }\n ElementPaint.prototype.getEffects = function (target) {\n var inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(this.container.styles.position) === -1;\n var parent = this.parent;\n var effects = this.effects.slice(0);\n while (parent) {\n var croplessEffects = parent.effects.filter(function (effect) { return !isClipEffect(effect); });\n if (inFlow || parent.container.styles.position !== 0 /* STATIC */ || !parent.parent) {\n effects.unshift.apply(effects, croplessEffects);\n inFlow = [2 /* ABSOLUTE */, 3 /* FIXED */].indexOf(parent.container.styles.position) === -1;\n if (parent.container.styles.overflowX !== 0 /* VISIBLE */) {\n var borderBox = calculateBorderBoxPath(parent.curves);\n var paddingBox = calculatePaddingBoxPath(parent.curves);\n if (!equalPath(borderBox, paddingBox)) {\n effects.unshift(new ClipEffect(paddingBox, 2 /* BACKGROUND_BORDERS */ | 4 /* CONTENT */));\n }\n }\n }\n else {\n effects.unshift.apply(effects, croplessEffects);\n }\n parent = parent.parent;\n }\n return effects.filter(function (effect) { return contains(effect.target, target); });\n };\n return ElementPaint;\n }());\n var parseStackTree = function (parent, stackingContext, realStackingContext, listItems) {\n parent.container.elements.forEach(function (child) {\n var treatAsRealStackingContext = contains(child.flags, 4 /* CREATES_REAL_STACKING_CONTEXT */);\n var createsStackingContext = contains(child.flags, 2 /* CREATES_STACKING_CONTEXT */);\n var paintContainer = new ElementPaint(child, parent);\n if (contains(child.styles.display, 2048 /* LIST_ITEM */)) {\n listItems.push(paintContainer);\n }\n var listOwnerItems = contains(child.flags, 8 /* IS_LIST_OWNER */) ? [] : listItems;\n if (treatAsRealStackingContext || createsStackingContext) {\n var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext;\n var stack = new StackingContext(paintContainer);\n if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) {\n var order_1 = child.styles.zIndex.order;\n if (order_1 < 0) {\n var index_1 = 0;\n parentStack.negativeZIndex.some(function (current, i) {\n if (order_1 > current.element.container.styles.zIndex.order) {\n index_1 = i;\n return false;\n }\n else if (index_1 > 0) {\n return true;\n }\n return false;\n });\n parentStack.negativeZIndex.splice(index_1, 0, stack);\n }\n else if (order_1 > 0) {\n var index_2 = 0;\n parentStack.positiveZIndex.some(function (current, i) {\n if (order_1 >= current.element.container.styles.zIndex.order) {\n index_2 = i + 1;\n return false;\n }\n else if (index_2 > 0) {\n return true;\n }\n return false;\n });\n parentStack.positiveZIndex.splice(index_2, 0, stack);\n }\n else {\n parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack);\n }\n }\n else {\n if (child.styles.isFloating()) {\n parentStack.nonPositionedFloats.push(stack);\n }\n else {\n parentStack.nonPositionedInlineLevel.push(stack);\n }\n }\n parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems);\n }\n else {\n if (child.styles.isInlineLevel()) {\n stackingContext.inlineLevel.push(paintContainer);\n }\n else {\n stackingContext.nonInlineLevel.push(paintContainer);\n }\n parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems);\n }\n if (contains(child.flags, 8 /* IS_LIST_OWNER */)) {\n processListItems(child, listOwnerItems);\n }\n });\n };\n var processListItems = function (owner, elements) {\n var numbering = owner instanceof OLElementContainer ? owner.start : 1;\n var reversed = owner instanceof OLElementContainer ? owner.reversed : false;\n for (var i = 0; i < elements.length; i++) {\n var item = elements[i];\n if (item.container instanceof LIElementContainer &&\n typeof item.container.value === 'number' &&\n item.container.value !== 0) {\n numbering = item.container.value;\n }\n item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true);\n numbering += reversed ? -1 : 1;\n }\n };\n var parseStackingContexts = function (container) {\n var paintContainer = new ElementPaint(container, null);\n var root = new StackingContext(paintContainer);\n var listItems = [];\n parseStackTree(paintContainer, root, root, listItems);\n processListItems(paintContainer.container, listItems);\n return root;\n };\n\n var parsePathForBorder = function (curves, borderSide) {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox);\n case 1:\n return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox);\n case 2:\n return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox);\n case 3:\n default:\n return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox);\n }\n };\n var parsePathForBorderDoubleOuter = function (curves, borderSide) {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox, curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox);\n case 1:\n return createPathFromCurves(curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox, curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox);\n case 2:\n return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox, curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox);\n case 3:\n default:\n return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox, curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox);\n }\n };\n var parsePathForBorderDoubleInner = function (curves, borderSide) {\n switch (borderSide) {\n case 0:\n return createPathFromCurves(curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox, curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox);\n case 1:\n return createPathFromCurves(curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox, curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox);\n case 2:\n return createPathFromCurves(curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox);\n case 3:\n default:\n return createPathFromCurves(curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox, curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox);\n }\n };\n var parsePathForBorderStroke = function (curves, borderSide) {\n switch (borderSide) {\n case 0:\n return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke);\n case 1:\n return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke);\n case 2:\n return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke);\n case 3:\n default:\n return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke);\n }\n };\n var createStrokePathFromCurves = function (outer1, outer2) {\n var path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n }\n else {\n path.push(outer1);\n }\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n }\n else {\n path.push(outer2);\n }\n return path;\n };\n var createPathFromCurves = function (outer1, inner1, outer2, inner2) {\n var path = [];\n if (isBezierCurve(outer1)) {\n path.push(outer1.subdivide(0.5, false));\n }\n else {\n path.push(outer1);\n }\n if (isBezierCurve(outer2)) {\n path.push(outer2.subdivide(0.5, true));\n }\n else {\n path.push(outer2);\n }\n if (isBezierCurve(inner2)) {\n path.push(inner2.subdivide(0.5, true).reverse());\n }\n else {\n path.push(inner2);\n }\n if (isBezierCurve(inner1)) {\n path.push(inner1.subdivide(0.5, false).reverse());\n }\n else {\n path.push(inner1);\n }\n return path;\n };\n\n var paddingBox = function (element) {\n var bounds = element.bounds;\n var styles = element.styles;\n return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth));\n };\n var contentBox = function (element) {\n var styles = element.styles;\n var bounds = element.bounds;\n var paddingLeft = getAbsoluteValue(styles.paddingLeft, bounds.width);\n var paddingRight = getAbsoluteValue(styles.paddingRight, bounds.width);\n var paddingTop = getAbsoluteValue(styles.paddingTop, bounds.width);\n var paddingBottom = getAbsoluteValue(styles.paddingBottom, bounds.width);\n return bounds.add(paddingLeft + styles.borderLeftWidth, paddingTop + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft + paddingRight), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop + paddingBottom));\n };\n\n var calculateBackgroundPositioningArea = function (backgroundOrigin, element) {\n if (backgroundOrigin === 0 /* BORDER_BOX */) {\n return element.bounds;\n }\n if (backgroundOrigin === 2 /* CONTENT_BOX */) {\n return contentBox(element);\n }\n return paddingBox(element);\n };\n var calculateBackgroundPaintingArea = function (backgroundClip, element) {\n if (backgroundClip === 0 /* BORDER_BOX */) {\n return element.bounds;\n }\n if (backgroundClip === 2 /* CONTENT_BOX */) {\n return contentBox(element);\n }\n return paddingBox(element);\n };\n var calculateBackgroundRendering = function (container, index, intrinsicSize) {\n var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index), container);\n var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index), container);\n var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea);\n var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1];\n var position = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight);\n var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea);\n var offsetX = Math.round(backgroundPositioningArea.left + position[0]);\n var offsetY = Math.round(backgroundPositioningArea.top + position[1]);\n return [path, offsetX, offsetY, sizeWidth, sizeHeight];\n };\n var isAuto = function (token) { return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO; };\n var hasIntrinsicValue = function (value) { return typeof value === 'number'; };\n var calculateBackgroundSize = function (size, _a, bounds) {\n var intrinsicWidth = _a[0], intrinsicHeight = _a[1], intrinsicProportion = _a[2];\n var first = size[0], second = size[1];\n if (!first) {\n return [0, 0];\n }\n if (isLengthPercentage(first) && second && isLengthPercentage(second)) {\n return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)];\n }\n var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion);\n if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) {\n if (hasIntrinsicValue(intrinsicProportion)) {\n var targetRatio = bounds.width / bounds.height;\n return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER)\n ? [bounds.width, bounds.width / intrinsicProportion]\n : [bounds.height * intrinsicProportion, bounds.height];\n }\n return [bounds.width, bounds.height];\n }\n var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth);\n var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight);\n var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight;\n // If the background-size is auto or auto auto:\n if (isAuto(first) && (!second || isAuto(second))) {\n // If the image has both horizontal and vertical intrinsic dimensions, it's rendered at that size.\n if (hasIntrinsicWidth && hasIntrinsicHeight) {\n return [intrinsicWidth, intrinsicHeight];\n }\n // If the image has no intrinsic dimensions and has no intrinsic proportions,\n // it's rendered at the size of the background positioning area.\n if (!hasIntrinsicProportion && !hasIntrinsicDimensions) {\n return [bounds.width, bounds.height];\n }\n // TODO If the image has no intrinsic dimensions but has intrinsic proportions, it's rendered as if contain had been specified instead.\n // If the image has only one intrinsic dimension and has intrinsic proportions, it's rendered at the size corresponding to that one dimension.\n // The other dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicDimensions && hasIntrinsicProportion) {\n var width_1 = hasIntrinsicWidth\n ? intrinsicWidth\n : intrinsicHeight * intrinsicProportion;\n var height_1 = hasIntrinsicHeight\n ? intrinsicHeight\n : intrinsicWidth / intrinsicProportion;\n return [width_1, height_1];\n }\n // If the image has only one intrinsic dimension but has no intrinsic proportions,\n // it's rendered using the specified dimension and the other dimension of the background positioning area.\n var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width;\n var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height;\n return [width_2, height_2];\n }\n // If the image has intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the specified dimension and the intrinsic proportions.\n if (hasIntrinsicProportion) {\n var width_3 = 0;\n var height_3 = 0;\n if (isLengthPercentage(first)) {\n width_3 = getAbsoluteValue(first, bounds.width);\n }\n else if (isLengthPercentage(second)) {\n height_3 = getAbsoluteValue(second, bounds.height);\n }\n if (isAuto(first)) {\n width_3 = height_3 * intrinsicProportion;\n }\n else if (!second || isAuto(second)) {\n height_3 = width_3 / intrinsicProportion;\n }\n return [width_3, height_3];\n }\n // If the image has no intrinsic proportions, it's stretched to the specified dimension.\n // The unspecified dimension is computed using the image's corresponding intrinsic dimension,\n // if there is one. If there is no such intrinsic dimension,\n // it becomes the corresponding dimension of the background positioning area.\n var width = null;\n var height = null;\n if (isLengthPercentage(first)) {\n width = getAbsoluteValue(first, bounds.width);\n }\n else if (second && isLengthPercentage(second)) {\n height = getAbsoluteValue(second, bounds.height);\n }\n if (width !== null && (!second || isAuto(second))) {\n height =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (width / intrinsicWidth) * intrinsicHeight\n : bounds.height;\n }\n if (height !== null && isAuto(first)) {\n width =\n hasIntrinsicWidth && hasIntrinsicHeight\n ? (height / intrinsicHeight) * intrinsicWidth\n : bounds.width;\n }\n if (width !== null && height !== null) {\n return [width, height];\n }\n throw new Error(\"Unable to calculate background-size for element\");\n };\n var getBackgroundValueForIndex = function (values, index) {\n var value = values[index];\n if (typeof value === 'undefined') {\n return values[0];\n }\n return value;\n };\n var calculateBackgroundRepeatPath = function (repeat, _a, _b, backgroundPositioningArea, backgroundPaintingArea) {\n var x = _a[0], y = _a[1];\n var width = _b[0], height = _b[1];\n switch (repeat) {\n case 2 /* REPEAT_X */:\n return [\n new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)),\n new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y)),\n new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height + backgroundPositioningArea.top + y)),\n new Vector(Math.round(backgroundPositioningArea.left), Math.round(height + backgroundPositioningArea.top + y))\n ];\n case 3 /* REPEAT_Y */:\n return [\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)),\n new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top)),\n new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)),\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top))\n ];\n case 1 /* NO_REPEAT */:\n return [\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y)),\n new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y)),\n new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y + height)),\n new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y + height))\n ];\n default:\n return [\n new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)),\n new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)),\n new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)),\n new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top))\n ];\n }\n };\n\n var SMALL_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n\n var SAMPLE_TEXT = 'Hidden Text';\n var FontMetrics = /** @class */ (function () {\n function FontMetrics(document) {\n this._data = {};\n this._document = document;\n }\n FontMetrics.prototype.parseMetrics = function (fontFamily, fontSize) {\n var container = this._document.createElement('div');\n var img = this._document.createElement('img');\n var span = this._document.createElement('span');\n var body = this._document.body;\n container.style.visibility = 'hidden';\n container.style.fontFamily = fontFamily;\n container.style.fontSize = fontSize;\n container.style.margin = '0';\n container.style.padding = '0';\n container.style.whiteSpace = 'nowrap';\n body.appendChild(container);\n img.src = SMALL_IMAGE;\n img.width = 1;\n img.height = 1;\n img.style.margin = '0';\n img.style.padding = '0';\n img.style.verticalAlign = 'baseline';\n span.style.fontFamily = fontFamily;\n span.style.fontSize = fontSize;\n span.style.margin = '0';\n span.style.padding = '0';\n span.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n container.appendChild(span);\n container.appendChild(img);\n var baseline = img.offsetTop - span.offsetTop + 2;\n container.removeChild(span);\n container.appendChild(this._document.createTextNode(SAMPLE_TEXT));\n container.style.lineHeight = 'normal';\n img.style.verticalAlign = 'super';\n var middle = img.offsetTop - container.offsetTop + 2;\n body.removeChild(container);\n return { baseline: baseline, middle: middle };\n };\n FontMetrics.prototype.getMetrics = function (fontFamily, fontSize) {\n var key = fontFamily + \" \" + fontSize;\n if (typeof this._data[key] === 'undefined') {\n this._data[key] = this.parseMetrics(fontFamily, fontSize);\n }\n return this._data[key];\n };\n return FontMetrics;\n }());\n\n var Renderer = /** @class */ (function () {\n function Renderer(context, options) {\n this.context = context;\n this.options = options;\n }\n return Renderer;\n }());\n\n var MASK_OFFSET = 10000;\n var CanvasRenderer = /** @class */ (function (_super) {\n __extends(CanvasRenderer, _super);\n function CanvasRenderer(context, options) {\n var _this = _super.call(this, context, options) || this;\n _this._activeEffects = [];\n _this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n _this.ctx = _this.canvas.getContext('2d');\n if (!options.canvas) {\n _this.canvas.width = Math.floor(options.width * options.scale);\n _this.canvas.height = Math.floor(options.height * options.scale);\n _this.canvas.style.width = options.width + \"px\";\n _this.canvas.style.height = options.height + \"px\";\n }\n _this.fontMetrics = new FontMetrics(document);\n _this.ctx.scale(_this.options.scale, _this.options.scale);\n _this.ctx.translate(-options.x, -options.y);\n _this.ctx.textBaseline = 'bottom';\n _this._activeEffects = [];\n _this.context.logger.debug(\"Canvas renderer initialized (\" + options.width + \"x\" + options.height + \") with scale \" + options.scale);\n return _this;\n }\n CanvasRenderer.prototype.applyEffects = function (effects) {\n var _this = this;\n while (this._activeEffects.length) {\n this.popEffect();\n }\n effects.forEach(function (effect) { return _this.applyEffect(effect); });\n };\n CanvasRenderer.prototype.applyEffect = function (effect) {\n this.ctx.save();\n if (isOpacityEffect(effect)) {\n this.ctx.globalAlpha = effect.opacity;\n }\n if (isTransformEffect(effect)) {\n this.ctx.translate(effect.offsetX, effect.offsetY);\n this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]);\n this.ctx.translate(-effect.offsetX, -effect.offsetY);\n }\n if (isClipEffect(effect)) {\n this.path(effect.path);\n this.ctx.clip();\n }\n this._activeEffects.push(effect);\n };\n CanvasRenderer.prototype.popEffect = function () {\n this._activeEffects.pop();\n this.ctx.restore();\n };\n CanvasRenderer.prototype.renderStack = function (stack) {\n return __awaiter(this, void 0, void 0, function () {\n var styles;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n styles = stack.element.container.styles;\n if (!styles.isVisible()) return [3 /*break*/, 2];\n return [4 /*yield*/, this.renderStackContent(stack)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderNode = function (paint) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (contains(paint.container.flags, 16 /* DEBUG_RENDER */)) {\n debugger;\n }\n if (!paint.container.styles.isVisible()) return [3 /*break*/, 3];\n return [4 /*yield*/, this.renderNodeBackgroundAndBorders(paint)];\n case 1:\n _a.sent();\n return [4 /*yield*/, this.renderNodeContent(paint)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderTextWithLetterSpacing = function (text, letterSpacing, baseline) {\n var _this = this;\n if (letterSpacing === 0) {\n this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline);\n }\n else {\n var letters = segmentGraphemes(text.text);\n letters.reduce(function (left, letter) {\n _this.ctx.fillText(letter, left, text.bounds.top + baseline);\n return left + _this.ctx.measureText(letter).width;\n }, text.bounds.left);\n }\n };\n CanvasRenderer.prototype.createFontStyle = function (styles) {\n var fontVariant = styles.fontVariant\n .filter(function (variant) { return variant === 'normal' || variant === 'small-caps'; })\n .join('');\n var fontFamily = fixIOSSystemFonts(styles.fontFamily).join(', ');\n var fontSize = isDimensionToken(styles.fontSize)\n ? \"\" + styles.fontSize.number + styles.fontSize.unit\n : styles.fontSize.number + \"px\";\n return [\n [styles.fontStyle, fontVariant, styles.fontWeight, fontSize, fontFamily].join(' '),\n fontFamily,\n fontSize\n ];\n };\n CanvasRenderer.prototype.renderTextNode = function (text, styles) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, font, fontFamily, fontSize, _b, baseline, middle, paintOrder;\n var _this = this;\n return __generator(this, function (_c) {\n _a = this.createFontStyle(styles), font = _a[0], fontFamily = _a[1], fontSize = _a[2];\n this.ctx.font = font;\n this.ctx.direction = styles.direction === 1 /* RTL */ ? 'rtl' : 'ltr';\n this.ctx.textAlign = 'left';\n this.ctx.textBaseline = 'alphabetic';\n _b = this.fontMetrics.getMetrics(fontFamily, fontSize), baseline = _b.baseline, middle = _b.middle;\n paintOrder = styles.paintOrder;\n text.textBounds.forEach(function (text) {\n paintOrder.forEach(function (paintOrderLayer) {\n switch (paintOrderLayer) {\n case 0 /* FILL */:\n _this.ctx.fillStyle = asString(styles.color);\n _this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);\n var textShadows = styles.textShadow;\n if (textShadows.length && text.text.trim().length) {\n textShadows\n .slice(0)\n .reverse()\n .forEach(function (textShadow) {\n _this.ctx.shadowColor = asString(textShadow.color);\n _this.ctx.shadowOffsetX = textShadow.offsetX.number * _this.options.scale;\n _this.ctx.shadowOffsetY = textShadow.offsetY.number * _this.options.scale;\n _this.ctx.shadowBlur = textShadow.blur.number;\n _this.renderTextWithLetterSpacing(text, styles.letterSpacing, baseline);\n });\n _this.ctx.shadowColor = '';\n _this.ctx.shadowOffsetX = 0;\n _this.ctx.shadowOffsetY = 0;\n _this.ctx.shadowBlur = 0;\n }\n if (styles.textDecorationLine.length) {\n _this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color);\n styles.textDecorationLine.forEach(function (textDecorationLine) {\n switch (textDecorationLine) {\n case 1 /* UNDERLINE */:\n // Draws a line at the baseline of the font\n // TODO As some browsers display the line as more than 1px if the font-size is big,\n // need to take that into account both in position and size\n _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top + baseline), text.bounds.width, 1);\n break;\n case 2 /* OVERLINE */:\n _this.ctx.fillRect(text.bounds.left, Math.round(text.bounds.top), text.bounds.width, 1);\n break;\n case 3 /* LINE_THROUGH */:\n // TODO try and find exact position for line-through\n _this.ctx.fillRect(text.bounds.left, Math.ceil(text.bounds.top + middle), text.bounds.width, 1);\n break;\n }\n });\n }\n break;\n case 1 /* STROKE */:\n if (styles.webkitTextStrokeWidth && text.text.trim().length) {\n _this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor);\n _this.ctx.lineWidth = styles.webkitTextStrokeWidth;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _this.ctx.lineJoin = !!window.chrome ? 'miter' : 'round';\n _this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + baseline);\n }\n _this.ctx.strokeStyle = '';\n _this.ctx.lineWidth = 0;\n _this.ctx.lineJoin = 'miter';\n break;\n }\n });\n });\n return [2 /*return*/];\n });\n });\n };\n CanvasRenderer.prototype.renderReplacedElement = function (container, curves, image) {\n if (image && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) {\n var box = contentBox(container);\n var path = calculatePaddingBoxPath(curves);\n this.path(path);\n this.ctx.save();\n this.ctx.clip();\n this.ctx.drawImage(image, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height);\n this.ctx.restore();\n }\n };\n CanvasRenderer.prototype.renderNodeContent = function (paint) {\n return __awaiter(this, void 0, void 0, function () {\n var container, curves, styles, _i, _a, child, image, image, iframeRenderer, canvas, size, _b, fontFamily, fontSize, baseline, bounds, x, textBounds, img, image, url, fontFamily, bounds;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n this.applyEffects(paint.getEffects(4 /* CONTENT */));\n container = paint.container;\n curves = paint.curves;\n styles = container.styles;\n _i = 0, _a = container.textNodes;\n _c.label = 1;\n case 1:\n if (!(_i < _a.length)) return [3 /*break*/, 4];\n child = _a[_i];\n return [4 /*yield*/, this.renderTextNode(child, styles)];\n case 2:\n _c.sent();\n _c.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4:\n if (!(container instanceof ImageElementContainer)) return [3 /*break*/, 8];\n _c.label = 5;\n case 5:\n _c.trys.push([5, 7, , 8]);\n return [4 /*yield*/, this.context.cache.match(container.src)];\n case 6:\n image = _c.sent();\n this.renderReplacedElement(container, curves, image);\n return [3 /*break*/, 8];\n case 7:\n _c.sent();\n this.context.logger.error(\"Error loading image \" + container.src);\n return [3 /*break*/, 8];\n case 8:\n if (container instanceof CanvasElementContainer) {\n this.renderReplacedElement(container, curves, container.canvas);\n }\n if (!(container instanceof SVGElementContainer)) return [3 /*break*/, 12];\n _c.label = 9;\n case 9:\n _c.trys.push([9, 11, , 12]);\n return [4 /*yield*/, this.context.cache.match(container.svg)];\n case 10:\n image = _c.sent();\n this.renderReplacedElement(container, curves, image);\n return [3 /*break*/, 12];\n case 11:\n _c.sent();\n this.context.logger.error(\"Error loading svg \" + container.svg.substring(0, 255));\n return [3 /*break*/, 12];\n case 12:\n if (!(container instanceof IFrameElementContainer && container.tree)) return [3 /*break*/, 14];\n iframeRenderer = new CanvasRenderer(this.context, {\n scale: this.options.scale,\n backgroundColor: container.backgroundColor,\n x: 0,\n y: 0,\n width: container.width,\n height: container.height\n });\n return [4 /*yield*/, iframeRenderer.render(container.tree)];\n case 13:\n canvas = _c.sent();\n if (container.width && container.height) {\n this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height);\n }\n _c.label = 14;\n case 14:\n if (container instanceof InputElementContainer) {\n size = Math.min(container.bounds.width, container.bounds.height);\n if (container.type === CHECKBOX) {\n if (container.checked) {\n this.ctx.save();\n this.path([\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79),\n new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549),\n new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071),\n new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649),\n new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23),\n new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085),\n new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79)\n ]);\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n }\n else if (container.type === RADIO) {\n if (container.checked) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true);\n this.ctx.fillStyle = asString(INPUT_COLOR);\n this.ctx.fill();\n this.ctx.restore();\n }\n }\n }\n if (isTextInputElement(container) && container.value.length) {\n _b = this.createFontStyle(styles), fontFamily = _b[0], fontSize = _b[1];\n baseline = this.fontMetrics.getMetrics(fontFamily, fontSize).baseline;\n this.ctx.font = fontFamily;\n this.ctx.fillStyle = asString(styles.color);\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = canvasTextAlign(container.styles.textAlign);\n bounds = contentBox(container);\n x = 0;\n switch (container.styles.textAlign) {\n case 1 /* CENTER */:\n x += bounds.width / 2;\n break;\n case 2 /* RIGHT */:\n x += bounds.width;\n break;\n }\n textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1);\n this.ctx.save();\n this.path([\n new Vector(bounds.left, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top),\n new Vector(bounds.left + bounds.width, bounds.top + bounds.height),\n new Vector(bounds.left, bounds.top + bounds.height)\n ]);\n this.ctx.clip();\n this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing, baseline);\n this.ctx.restore();\n this.ctx.textBaseline = 'alphabetic';\n this.ctx.textAlign = 'left';\n }\n if (!contains(container.styles.display, 2048 /* LIST_ITEM */)) return [3 /*break*/, 20];\n if (!(container.styles.listStyleImage !== null)) return [3 /*break*/, 19];\n img = container.styles.listStyleImage;\n if (!(img.type === 0 /* URL */)) return [3 /*break*/, 18];\n image = void 0;\n url = img.url;\n _c.label = 15;\n case 15:\n _c.trys.push([15, 17, , 18]);\n return [4 /*yield*/, this.context.cache.match(url)];\n case 16:\n image = _c.sent();\n this.ctx.drawImage(image, container.bounds.left - (image.width + 10), container.bounds.top);\n return [3 /*break*/, 18];\n case 17:\n _c.sent();\n this.context.logger.error(\"Error loading list-style-image \" + url);\n return [3 /*break*/, 18];\n case 18: return [3 /*break*/, 20];\n case 19:\n if (paint.listValue && container.styles.listStyleType !== -1 /* NONE */) {\n fontFamily = this.createFontStyle(styles)[0];\n this.ctx.font = fontFamily;\n this.ctx.fillStyle = asString(styles.color);\n this.ctx.textBaseline = 'middle';\n this.ctx.textAlign = 'right';\n bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1);\n this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2);\n this.ctx.textBaseline = 'bottom';\n this.ctx.textAlign = 'left';\n }\n _c.label = 20;\n case 20: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderStackContent = function (stack) {\n return __awaiter(this, void 0, void 0, function () {\n var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;\n return __generator(this, function (_p) {\n switch (_p.label) {\n case 0:\n if (contains(stack.element.container.flags, 16 /* DEBUG_RENDER */)) {\n debugger;\n }\n // https://www.w3.org/TR/css-position-3/#painting-order\n // 1. the background and borders of the element forming the stacking context.\n return [4 /*yield*/, this.renderNodeBackgroundAndBorders(stack.element)];\n case 1:\n // https://www.w3.org/TR/css-position-3/#painting-order\n // 1. the background and borders of the element forming the stacking context.\n _p.sent();\n _i = 0, _a = stack.negativeZIndex;\n _p.label = 2;\n case 2:\n if (!(_i < _a.length)) return [3 /*break*/, 5];\n child = _a[_i];\n return [4 /*yield*/, this.renderStack(child)];\n case 3:\n _p.sent();\n _p.label = 4;\n case 4:\n _i++;\n return [3 /*break*/, 2];\n case 5: \n // 3. For all its in-flow, non-positioned, block-level descendants in tree order:\n return [4 /*yield*/, this.renderNodeContent(stack.element)];\n case 6:\n // 3. For all its in-flow, non-positioned, block-level descendants in tree order:\n _p.sent();\n _b = 0, _c = stack.nonInlineLevel;\n _p.label = 7;\n case 7:\n if (!(_b < _c.length)) return [3 /*break*/, 10];\n child = _c[_b];\n return [4 /*yield*/, this.renderNode(child)];\n case 8:\n _p.sent();\n _p.label = 9;\n case 9:\n _b++;\n return [3 /*break*/, 7];\n case 10:\n _d = 0, _e = stack.nonPositionedFloats;\n _p.label = 11;\n case 11:\n if (!(_d < _e.length)) return [3 /*break*/, 14];\n child = _e[_d];\n return [4 /*yield*/, this.renderStack(child)];\n case 12:\n _p.sent();\n _p.label = 13;\n case 13:\n _d++;\n return [3 /*break*/, 11];\n case 14:\n _f = 0, _g = stack.nonPositionedInlineLevel;\n _p.label = 15;\n case 15:\n if (!(_f < _g.length)) return [3 /*break*/, 18];\n child = _g[_f];\n return [4 /*yield*/, this.renderStack(child)];\n case 16:\n _p.sent();\n _p.label = 17;\n case 17:\n _f++;\n return [3 /*break*/, 15];\n case 18:\n _h = 0, _j = stack.inlineLevel;\n _p.label = 19;\n case 19:\n if (!(_h < _j.length)) return [3 /*break*/, 22];\n child = _j[_h];\n return [4 /*yield*/, this.renderNode(child)];\n case 20:\n _p.sent();\n _p.label = 21;\n case 21:\n _h++;\n return [3 /*break*/, 19];\n case 22:\n _k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity;\n _p.label = 23;\n case 23:\n if (!(_k < _l.length)) return [3 /*break*/, 26];\n child = _l[_k];\n return [4 /*yield*/, this.renderStack(child)];\n case 24:\n _p.sent();\n _p.label = 25;\n case 25:\n _k++;\n return [3 /*break*/, 23];\n case 26:\n _m = 0, _o = stack.positiveZIndex;\n _p.label = 27;\n case 27:\n if (!(_m < _o.length)) return [3 /*break*/, 30];\n child = _o[_m];\n return [4 /*yield*/, this.renderStack(child)];\n case 28:\n _p.sent();\n _p.label = 29;\n case 29:\n _m++;\n return [3 /*break*/, 27];\n case 30: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.mask = function (paths) {\n this.ctx.beginPath();\n this.ctx.moveTo(0, 0);\n this.ctx.lineTo(this.canvas.width, 0);\n this.ctx.lineTo(this.canvas.width, this.canvas.height);\n this.ctx.lineTo(0, this.canvas.height);\n this.ctx.lineTo(0, 0);\n this.formatPath(paths.slice(0).reverse());\n this.ctx.closePath();\n };\n CanvasRenderer.prototype.path = function (paths) {\n this.ctx.beginPath();\n this.formatPath(paths);\n this.ctx.closePath();\n };\n CanvasRenderer.prototype.formatPath = function (paths) {\n var _this = this;\n paths.forEach(function (point, index) {\n var start = isBezierCurve(point) ? point.start : point;\n if (index === 0) {\n _this.ctx.moveTo(start.x, start.y);\n }\n else {\n _this.ctx.lineTo(start.x, start.y);\n }\n if (isBezierCurve(point)) {\n _this.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y);\n }\n });\n };\n CanvasRenderer.prototype.renderRepeat = function (path, pattern, offsetX, offsetY) {\n this.path(path);\n this.ctx.fillStyle = pattern;\n this.ctx.translate(offsetX, offsetY);\n this.ctx.fill();\n this.ctx.translate(-offsetX, -offsetY);\n };\n CanvasRenderer.prototype.resizeImage = function (image, width, height) {\n var _a;\n if (image.width === width && image.height === height) {\n return image;\n }\n var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== void 0 ? _a : document;\n var canvas = ownerDocument.createElement('canvas');\n canvas.width = Math.max(1, width);\n canvas.height = Math.max(1, height);\n var ctx = canvas.getContext('2d');\n ctx.drawImage(image, 0, 0, image.width, image.height, 0, 0, width, height);\n return canvas;\n };\n CanvasRenderer.prototype.renderBackgroundImage = function (container) {\n return __awaiter(this, void 0, void 0, function () {\n var index, _loop_1, this_1, _i, _a, backgroundImage;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n index = container.styles.backgroundImage.length - 1;\n _loop_1 = function (backgroundImage) {\n var image, url, _c, path, x, y, width, height, pattern, _d, path, x, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path, left, top_1, width, height, position, x, y, _g, rx, ry, radialGradient_1, midX, midY, f, invF;\n return __generator(this, function (_h) {\n switch (_h.label) {\n case 0:\n if (!(backgroundImage.type === 0 /* URL */)) return [3 /*break*/, 5];\n image = void 0;\n url = backgroundImage.url;\n _h.label = 1;\n case 1:\n _h.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this_1.context.cache.match(url)];\n case 2:\n image = _h.sent();\n return [3 /*break*/, 4];\n case 3:\n _h.sent();\n this_1.context.logger.error(\"Error loading background-image \" + url);\n return [3 /*break*/, 4];\n case 4:\n if (image) {\n _c = calculateBackgroundRendering(container, index, [\n image.width,\n image.height,\n image.width / image.height\n ]), path = _c[0], x = _c[1], y = _c[2], width = _c[3], height = _c[4];\n pattern = this_1.ctx.createPattern(this_1.resizeImage(image, width, height), 'repeat');\n this_1.renderRepeat(path, pattern, x, y);\n }\n return [3 /*break*/, 6];\n case 5:\n if (isLinearGradient(backgroundImage)) {\n _d = calculateBackgroundRendering(container, index, [null, null, null]), path = _d[0], x = _d[1], y = _d[2], width = _d[3], height = _d[4];\n _e = calculateGradientDirection(backgroundImage.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4];\n canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n ctx = canvas.getContext('2d');\n gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1);\n processColorStops(backgroundImage.stops, lineLength).forEach(function (colorStop) {\n return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color));\n });\n ctx.fillStyle = gradient_1;\n ctx.fillRect(0, 0, width, height);\n if (width > 0 && height > 0) {\n pattern = this_1.ctx.createPattern(canvas, 'repeat');\n this_1.renderRepeat(path, pattern, x, y);\n }\n }\n else if (isRadialGradient(backgroundImage)) {\n _f = calculateBackgroundRendering(container, index, [\n null,\n null,\n null\n ]), path = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4];\n position = backgroundImage.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage.position;\n x = getAbsoluteValue(position[0], width);\n y = getAbsoluteValue(position[position.length - 1], height);\n _g = calculateRadius(backgroundImage, x, y, width, height), rx = _g[0], ry = _g[1];\n if (rx > 0 && ry > 0) {\n radialGradient_1 = this_1.ctx.createRadialGradient(left + x, top_1 + y, 0, left + x, top_1 + y, rx);\n processColorStops(backgroundImage.stops, rx * 2).forEach(function (colorStop) {\n return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color));\n });\n this_1.path(path);\n this_1.ctx.fillStyle = radialGradient_1;\n if (rx !== ry) {\n midX = container.bounds.left + 0.5 * container.bounds.width;\n midY = container.bounds.top + 0.5 * container.bounds.height;\n f = ry / rx;\n invF = 1 / f;\n this_1.ctx.save();\n this_1.ctx.translate(midX, midY);\n this_1.ctx.transform(1, 0, 0, f, 0, 0);\n this_1.ctx.translate(-midX, -midY);\n this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF);\n this_1.ctx.restore();\n }\n else {\n this_1.ctx.fill();\n }\n }\n }\n _h.label = 6;\n case 6:\n index--;\n return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _i = 0, _a = container.styles.backgroundImage.slice(0).reverse();\n _b.label = 1;\n case 1:\n if (!(_i < _a.length)) return [3 /*break*/, 4];\n backgroundImage = _a[_i];\n return [5 /*yield**/, _loop_1(backgroundImage)];\n case 2:\n _b.sent();\n _b.label = 3;\n case 3:\n _i++;\n return [3 /*break*/, 1];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderSolidBorder = function (color, side, curvePoints) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.path(parsePathForBorder(curvePoints, side));\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n return [2 /*return*/];\n });\n });\n };\n CanvasRenderer.prototype.renderDoubleBorder = function (color, width, side, curvePoints) {\n return __awaiter(this, void 0, void 0, function () {\n var outerPaths, innerPaths;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(width < 3)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.renderSolidBorder(color, side, curvePoints)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n case 2:\n outerPaths = parsePathForBorderDoubleOuter(curvePoints, side);\n this.path(outerPaths);\n this.ctx.fillStyle = asString(color);\n this.ctx.fill();\n innerPaths = parsePathForBorderDoubleInner(curvePoints, side);\n this.path(innerPaths);\n this.ctx.fill();\n return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderNodeBackgroundAndBorders = function (paint) {\n return __awaiter(this, void 0, void 0, function () {\n var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.applyEffects(paint.getEffects(2 /* BACKGROUND_BORDERS */));\n styles = paint.container.styles;\n hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length;\n borders = [\n { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth },\n { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth },\n { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth },\n { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth }\n ];\n backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves);\n if (!(hasBackground || styles.boxShadow.length)) return [3 /*break*/, 2];\n this.ctx.save();\n this.path(backgroundPaintingArea);\n this.ctx.clip();\n if (!isTransparent(styles.backgroundColor)) {\n this.ctx.fillStyle = asString(styles.backgroundColor);\n this.ctx.fill();\n }\n return [4 /*yield*/, this.renderBackgroundImage(paint.container)];\n case 1:\n _a.sent();\n this.ctx.restore();\n styles.boxShadow\n .slice(0)\n .reverse()\n .forEach(function (shadow) {\n _this.ctx.save();\n var borderBoxArea = calculateBorderBoxPath(paint.curves);\n var maskOffset = shadow.inset ? 0 : MASK_OFFSET;\n var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2));\n if (shadow.inset) {\n _this.path(borderBoxArea);\n _this.ctx.clip();\n _this.mask(shadowPaintingArea);\n }\n else {\n _this.mask(borderBoxArea);\n _this.ctx.clip();\n _this.path(shadowPaintingArea);\n }\n _this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset;\n _this.ctx.shadowOffsetY = shadow.offsetY.number;\n _this.ctx.shadowColor = asString(shadow.color);\n _this.ctx.shadowBlur = shadow.blur.number;\n _this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : 'rgba(0,0,0,1)';\n _this.ctx.fill();\n _this.ctx.restore();\n });\n _a.label = 2;\n case 2:\n side = 0;\n _i = 0, borders_1 = borders;\n _a.label = 3;\n case 3:\n if (!(_i < borders_1.length)) return [3 /*break*/, 13];\n border = borders_1[_i];\n if (!(border.style !== 0 /* NONE */ && !isTransparent(border.color) && border.width > 0)) return [3 /*break*/, 11];\n if (!(border.style === 2 /* DASHED */)) return [3 /*break*/, 5];\n return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 2 /* DASHED */)];\n case 4:\n _a.sent();\n return [3 /*break*/, 11];\n case 5:\n if (!(border.style === 3 /* DOTTED */)) return [3 /*break*/, 7];\n return [4 /*yield*/, this.renderDashedDottedBorder(border.color, border.width, side, paint.curves, 3 /* DOTTED */)];\n case 6:\n _a.sent();\n return [3 /*break*/, 11];\n case 7:\n if (!(border.style === 4 /* DOUBLE */)) return [3 /*break*/, 9];\n return [4 /*yield*/, this.renderDoubleBorder(border.color, border.width, side, paint.curves)];\n case 8:\n _a.sent();\n return [3 /*break*/, 11];\n case 9: return [4 /*yield*/, this.renderSolidBorder(border.color, side, paint.curves)];\n case 10:\n _a.sent();\n _a.label = 11;\n case 11:\n side++;\n _a.label = 12;\n case 12:\n _i++;\n return [3 /*break*/, 3];\n case 13: return [2 /*return*/];\n }\n });\n });\n };\n CanvasRenderer.prototype.renderDashedDottedBorder = function (color, width, side, curvePoints, style) {\n return __awaiter(this, void 0, void 0, function () {\n var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;\n return __generator(this, function (_a) {\n this.ctx.save();\n strokePaths = parsePathForBorderStroke(curvePoints, side);\n boxPaths = parsePathForBorder(curvePoints, side);\n if (style === 2 /* DASHED */) {\n this.path(boxPaths);\n this.ctx.clip();\n }\n if (isBezierCurve(boxPaths[0])) {\n startX = boxPaths[0].start.x;\n startY = boxPaths[0].start.y;\n }\n else {\n startX = boxPaths[0].x;\n startY = boxPaths[0].y;\n }\n if (isBezierCurve(boxPaths[1])) {\n endX = boxPaths[1].end.x;\n endY = boxPaths[1].end.y;\n }\n else {\n endX = boxPaths[1].x;\n endY = boxPaths[1].y;\n }\n if (side === 0 || side === 2) {\n length = Math.abs(startX - endX);\n }\n else {\n length = Math.abs(startY - endY);\n }\n this.ctx.beginPath();\n if (style === 3 /* DOTTED */) {\n this.formatPath(strokePaths);\n }\n else {\n this.formatPath(boxPaths.slice(0, 2));\n }\n dashLength = width < 3 ? width * 3 : width * 2;\n spaceLength = width < 3 ? width * 2 : width;\n if (style === 3 /* DOTTED */) {\n dashLength = width;\n spaceLength = width;\n }\n useLineDash = true;\n if (length <= dashLength * 2) {\n useLineDash = false;\n }\n else if (length <= dashLength * 2 + spaceLength) {\n multiplier = length / (2 * dashLength + spaceLength);\n dashLength *= multiplier;\n spaceLength *= multiplier;\n }\n else {\n numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength));\n minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1);\n maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes;\n spaceLength =\n maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace)\n ? minSpace\n : maxSpace;\n }\n if (useLineDash) {\n if (style === 3 /* DOTTED */) {\n this.ctx.setLineDash([0, dashLength + spaceLength]);\n }\n else {\n this.ctx.setLineDash([dashLength, spaceLength]);\n }\n }\n if (style === 3 /* DOTTED */) {\n this.ctx.lineCap = 'round';\n this.ctx.lineWidth = width;\n }\n else {\n this.ctx.lineWidth = width * 2 + 1.1;\n }\n this.ctx.strokeStyle = asString(color);\n this.ctx.stroke();\n this.ctx.setLineDash([]);\n // dashed round edge gap\n if (style === 2 /* DASHED */) {\n if (isBezierCurve(boxPaths[0])) {\n path1 = boxPaths[3];\n path2 = boxPaths[0];\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n if (isBezierCurve(boxPaths[1])) {\n path1 = boxPaths[1];\n path2 = boxPaths[2];\n this.ctx.beginPath();\n this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]);\n this.ctx.stroke();\n }\n }\n this.ctx.restore();\n return [2 /*return*/];\n });\n });\n };\n CanvasRenderer.prototype.render = function (element) {\n return __awaiter(this, void 0, void 0, function () {\n var stack;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height);\n }\n stack = parseStackingContexts(element);\n return [4 /*yield*/, this.renderStack(stack)];\n case 1:\n _a.sent();\n this.applyEffects([]);\n return [2 /*return*/, this.canvas];\n }\n });\n });\n };\n return CanvasRenderer;\n }(Renderer));\n var isTextInputElement = function (container) {\n if (container instanceof TextareaElementContainer) {\n return true;\n }\n else if (container instanceof SelectElementContainer) {\n return true;\n }\n else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) {\n return true;\n }\n return false;\n };\n var calculateBackgroundCurvedPaintingArea = function (clip, curves) {\n switch (clip) {\n case 0 /* BORDER_BOX */:\n return calculateBorderBoxPath(curves);\n case 2 /* CONTENT_BOX */:\n return calculateContentBoxPath(curves);\n case 1 /* PADDING_BOX */:\n default:\n return calculatePaddingBoxPath(curves);\n }\n };\n var canvasTextAlign = function (textAlign) {\n switch (textAlign) {\n case 1 /* CENTER */:\n return 'center';\n case 2 /* RIGHT */:\n return 'right';\n case 0 /* LEFT */:\n default:\n return 'left';\n }\n };\n // see https://github.com/niklasvh/html2canvas/pull/2645\n var iOSBrokenFonts = ['-apple-system', 'system-ui'];\n var fixIOSSystemFonts = function (fontFamilies) {\n return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent)\n ? fontFamilies.filter(function (fontFamily) { return iOSBrokenFonts.indexOf(fontFamily) === -1; })\n : fontFamilies;\n };\n\n var ForeignObjectRenderer = /** @class */ (function (_super) {\n __extends(ForeignObjectRenderer, _super);\n function ForeignObjectRenderer(context, options) {\n var _this = _super.call(this, context, options) || this;\n _this.canvas = options.canvas ? options.canvas : document.createElement('canvas');\n _this.ctx = _this.canvas.getContext('2d');\n _this.options = options;\n _this.canvas.width = Math.floor(options.width * options.scale);\n _this.canvas.height = Math.floor(options.height * options.scale);\n _this.canvas.style.width = options.width + \"px\";\n _this.canvas.style.height = options.height + \"px\";\n _this.ctx.scale(_this.options.scale, _this.options.scale);\n _this.ctx.translate(-options.x, -options.y);\n _this.context.logger.debug(\"EXPERIMENTAL ForeignObject renderer initialized (\" + options.width + \"x\" + options.height + \" at \" + options.x + \",\" + options.y + \") with scale \" + options.scale);\n return _this;\n }\n ForeignObjectRenderer.prototype.render = function (element) {\n return __awaiter(this, void 0, void 0, function () {\n var svg, img;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n svg = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element);\n return [4 /*yield*/, loadSerializedSVG(svg)];\n case 1:\n img = _a.sent();\n if (this.options.backgroundColor) {\n this.ctx.fillStyle = asString(this.options.backgroundColor);\n this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale);\n }\n this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale);\n return [2 /*return*/, this.canvas];\n }\n });\n });\n };\n return ForeignObjectRenderer;\n }(Renderer));\n var loadSerializedSVG = function (svg) {\n return new Promise(function (resolve, reject) {\n var img = new Image();\n img.onload = function () {\n resolve(img);\n };\n img.onerror = reject;\n img.src = \"data:image/svg+xml;charset=utf-8,\" + encodeURIComponent(new XMLSerializer().serializeToString(svg));\n });\n };\n\n var Logger = /** @class */ (function () {\n function Logger(_a) {\n var id = _a.id, enabled = _a.enabled;\n this.id = id;\n this.enabled = enabled;\n this.start = Date.now();\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Logger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.debug === 'function') {\n // eslint-disable-next-line no-console\n console.debug.apply(console, __spreadArray([this.id, this.getTime() + \"ms\"], args));\n }\n else {\n this.info.apply(this, args);\n }\n }\n };\n Logger.prototype.getTime = function () {\n return Date.now() - this.start;\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Logger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.info === 'function') {\n // eslint-disable-next-line no-console\n console.info.apply(console, __spreadArray([this.id, this.getTime() + \"ms\"], args));\n }\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Logger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.warn === 'function') {\n // eslint-disable-next-line no-console\n console.warn.apply(console, __spreadArray([this.id, this.getTime() + \"ms\"], args));\n }\n else {\n this.info.apply(this, args);\n }\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Logger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (this.enabled) {\n // eslint-disable-next-line no-console\n if (typeof window !== 'undefined' && window.console && typeof console.error === 'function') {\n // eslint-disable-next-line no-console\n console.error.apply(console, __spreadArray([this.id, this.getTime() + \"ms\"], args));\n }\n else {\n this.info.apply(this, args);\n }\n }\n };\n Logger.instances = {};\n return Logger;\n }());\n\n var Context = /** @class */ (function () {\n function Context(options, windowBounds) {\n var _a;\n this.windowBounds = windowBounds;\n this.instanceName = \"#\" + Context.instanceCount++;\n this.logger = new Logger({ id: this.instanceName, enabled: options.logging });\n this.cache = (_a = options.cache) !== null && _a !== void 0 ? _a : new Cache(this, options);\n }\n Context.instanceCount = 1;\n return Context;\n }());\n\n var html2canvas = function (element, options) {\n if (options === void 0) { options = {}; }\n return renderElement(element, options);\n };\n if (typeof window !== 'undefined') {\n CacheStorage.setContext(window);\n }\n var renderElement = function (element, opts) { return __awaiter(void 0, void 0, void 0, function () {\n var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a, width, height, left, top, backgroundColor, renderOptions, canvas, renderer, root, renderer;\n var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;\n return __generator(this, function (_u) {\n switch (_u.label) {\n case 0:\n if (!element || typeof element !== 'object') {\n return [2 /*return*/, Promise.reject('Invalid element provided as first argument')];\n }\n ownerDocument = element.ownerDocument;\n if (!ownerDocument) {\n throw new Error(\"Element is not attached to a Document\");\n }\n defaultView = ownerDocument.defaultView;\n if (!defaultView) {\n throw new Error(\"Document is not attached to a Window\");\n }\n resourceOptions = {\n allowTaint: (_b = opts.allowTaint) !== null && _b !== void 0 ? _b : false,\n imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15000,\n proxy: opts.proxy,\n useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false\n };\n contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);\n windowOptions = {\n windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,\n windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,\n scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,\n scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset\n };\n windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);\n context = new Context(contextOptions, windowBounds);\n foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;\n cloneOptions = {\n allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,\n onclone: opts.onclone,\n ignoreElements: opts.ignoreElements,\n inlineImages: foreignObjectRendering,\n copyStyles: foreignObjectRendering\n };\n context.logger.debug(\"Starting document clone with size \" + windowBounds.width + \"x\" + windowBounds.height + \" scrolled to \" + -windowBounds.left + \",\" + -windowBounds.top);\n documentCloner = new DocumentCloner(context, element, cloneOptions);\n clonedElement = documentCloner.clonedReferenceElement;\n if (!clonedElement) {\n return [2 /*return*/, Promise.reject(\"Unable to find element in cloned iframe\")];\n }\n return [4 /*yield*/, documentCloner.toIFrame(ownerDocument, windowBounds)];\n case 1:\n container = _u.sent();\n _a = isBodyElement(clonedElement) || isHTMLElement(clonedElement)\n ? parseDocumentSize(clonedElement.ownerDocument)\n : parseBounds(context, clonedElement), width = _a.width, height = _a.height, left = _a.left, top = _a.top;\n backgroundColor = parseBackgroundColor(context, clonedElement, opts.backgroundColor);\n renderOptions = {\n canvas: opts.canvas,\n backgroundColor: backgroundColor,\n scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1,\n x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left,\n y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top,\n width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width),\n height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height)\n };\n if (!foreignObjectRendering) return [3 /*break*/, 3];\n context.logger.debug(\"Document cloned, using foreign object rendering\");\n renderer = new ForeignObjectRenderer(context, renderOptions);\n return [4 /*yield*/, renderer.render(clonedElement)];\n case 2:\n canvas = _u.sent();\n return [3 /*break*/, 5];\n case 3:\n context.logger.debug(\"Document cloned, element located at \" + left + \",\" + top + \" with size \" + width + \"x\" + height + \" using computed rendering\");\n context.logger.debug(\"Starting DOM parsing\");\n root = parseTree(context, clonedElement);\n if (backgroundColor === root.styles.backgroundColor) {\n root.styles.backgroundColor = COLORS.TRANSPARENT;\n }\n context.logger.debug(\"Starting renderer for element at \" + renderOptions.x + \",\" + renderOptions.y + \" with size \" + renderOptions.width + \"x\" + renderOptions.height);\n renderer = new CanvasRenderer(context, renderOptions);\n return [4 /*yield*/, renderer.render(root)];\n case 4:\n canvas = _u.sent();\n _u.label = 5;\n case 5:\n if ((_t = opts.removeContainer) !== null && _t !== void 0 ? _t : true) {\n if (!DocumentCloner.destroy(container)) {\n context.logger.error(\"Cannot detach cloned iframe as it is not in the DOM anymore\");\n }\n }\n context.logger.debug(\"Finished rendering\");\n return [2 /*return*/, canvas];\n }\n });\n }); };\n var parseBackgroundColor = function (context, element, backgroundColorOverride) {\n var ownerDocument = element.ownerDocument;\n // http://www.w3.org/TR/css3-background/#special-backgrounds\n var documentBackgroundColor = ownerDocument.documentElement\n ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor)\n : COLORS.TRANSPARENT;\n var bodyBackgroundColor = ownerDocument.body\n ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor)\n : COLORS.TRANSPARENT;\n var defaultBackgroundColor = typeof backgroundColorOverride === 'string'\n ? parseColor(context, backgroundColorOverride)\n : backgroundColorOverride === null\n ? COLORS.TRANSPARENT\n : 0xffffffff;\n return element === ownerDocument.documentElement\n ? isTransparent(documentBackgroundColor)\n ? isTransparent(bodyBackgroundColor)\n ? defaultBackgroundColor\n : bodyBackgroundColor\n : documentBackgroundColor\n : defaultBackgroundColor;\n };\n\n return html2canvas;\n\n})));\n//# sourceMappingURL=html2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cnkge1xyXG4gICAgICAgICAgICAgICAgaWYgKGYgPSAxLCB5ICYmICh0ID0gb3BbMF0gJiAyID8geVtcInJldHVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICAgICAgaWYgKHkgPSAwLCB0KSBvcCA9IFtvcFswXSAmIDIsIHQudmFsdWVdO1xyXG4gICAgICAgICAgICAgICAgc3dpdGNoIChvcFswXSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNDogXy5sYWJlbCsrOyByZXR1cm4geyB2YWx1ZTogb3BbMV0sIGRvbmU6IGZhbHNlIH07XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA1OiBfLmxhYmVsKys7IHkgPSBvcFsxXTsgb3AgPSBbMF07IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0ID0gXy50cnlzLCB0ID0gdC5sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSA2ICYmIF8ubGFiZWwgPCB0WzFdKSB7IF8ubGFiZWwgPSB0WzFdOyB0ID0gb3A7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBfLnRyeXMucG9wKCk7IGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgb3AgPSBib2R5LmNhbGwodGhpc0FyZywgXyk7XHJcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsgb3AgPSBbNiwgZV07IHkgPSAwOyB9IGZpbmFsbHkgeyBmID0gdCA9IDA7IH1cclxuICAgICAgICAgICAgaWYgKG9wWzBdICYgNSkgdGhyb3cgb3BbMV07IHJldHVybiB7IHZhbHVlOiBvcFswXSA/IG9wWzFdIDogdm9pZCAwLCBkb25lOiB0cnVlIH07XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG5cclxuICAgIGZ1bmN0aW9uIF9fc3ByZWFkQXJyYXkodG8sIGZyb20sIHBhY2spIHtcclxuICAgICAgICBpZiAocGFjayB8fCBhcmd1bWVudHMubGVuZ3RoID09PSAyKSBmb3IgKHZhciBpID0gMCwgbCA9IGZyb20ubGVuZ3RoLCBhcjsgaSA8IGw7IGkrKykge1xyXG4gICAgICAgICAgICBpZiAoYXIgfHwgIShpIGluIGZyb20pKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIWFyKSBhciA9IEFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGZyb20sIDAsIGkpO1xyXG4gICAgICAgICAgICAgICAgYXJbaV0gPSBmcm9tW2ldO1xyXG4gICAgICAg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xlbmd0aCkge1xuICAgICAgICAgICAgICAgIHZhciBleHRyYSA9IHN0ci5jaGFyQ29kZUF0KGkrKyk7XG4gICAgICAgICAgICAgICAgaWYgKChleHRyYSAmIDB4ZmMwMCkgPT09IDB4ZGMwMCkge1xuICAgICAgICAgICAgICAgICAgICBjb2RlUG9pbnRzLnB1c2goKCh2YWx1ZSAmIDB4M2ZmKSA8PCAxMCkgKyAoZXh0cmEgJiAweDNmZikgKyAweDEwMDAwKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNvZGVQb2ludHMucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2RlUG9pbnRzLnB1c2godmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb2RlUG9pbnRzO1xuICAgIH07XG4gICAgdmFyIGZyb21Db2RlUG9pbnQkMSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgdmFyIGNvZGVQb2ludHMgPSBbXTtcbiAgICAgICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgIGNvZGVQb2ludHNbX2ldID0gYXJndW1lbnRzW19pXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoU3RyaW5nLmZyb21Db2RlUG9pbnQpIHtcbiAgICAgICAgICAgIHJldHVybiBTdHJpbmcuZnJvbUNvZGVQb2ludC5hcHBseShTdHJpbmcsIGNvZGVQb2ludHMpO1xuICAgICAgICB9XG4gICAgICAgIHZhciBsZW5ndGggPSBjb2RlUG9pbnRzLmxlbmd0aDtcbiAgICAgICAgaWYgKCFsZW5ndGgpIHtcbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuICAgICAgICB2YXIgY29kZVVuaXRzID0gW107XG4gICAgICAgIHZhciBpbmRleCA9IC0xO1xuICAgICAgICB2YXIgcmVzdWx0ID0gJyc7XG4gICAgICAgIHdoaWxlICgrK2luZGV4IDwgbGVuZ3RoKSB7XG4gICAgICAgICAgICB2YXIgY29kZVBvaW50ID0gY29kZVBvaW50c1tpbmRleF07XG4gICAgICAgICAgICBpZiAoY29kZVBvaW50IDw9IDB4ZmZmZikge1xuICAgICAgICAgICAgICAgIGNvZGVVbml0cy5wdXNoKGNvZGVQb2ludCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb2RlUG9pbnQgLT0gMHgxMDAwMDtcbiAgICAgICAgICAgICAgICBjb2RlVW5pdHMucHVzaCgoY29kZVBvaW50ID4+IDEwKSArIDB4ZDgwMCwgKGNvZGVQb2ludCAlIDB4NDAwKSArIDB4ZGMwMCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaW5kZXggKyAxID09PSBsZW5ndGggfHwgY29kZVVuaXRzLmxlbmd0aCA+IDB4NDAwMCkge1xuICAgICAgICAgICAgICAgIHJlc3VsdCArPSBTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KFN0cmluZywgY29kZVVuaXRzKTtcbiAgICAgICAgICAgICAgICBjb2RlVW5pdHMubGVuZ3RoID0gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH07XG4gICAgdmFyIGNoYXJzJDIgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7XG4gICAgLy8gVXNlIGEgbG9va3VwIHRhYmxlIHRvIGZpbmQgdGhlIGluZGV4LlxuICAgIHZhciBsb29rdXAkMiA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAndW5kZ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gICAgICAgIGlmIChjb2RlUG9pbnQgPCAweDBkODAwIHx8IChjb2RlUG9pbnQgPiAweDBkYmZmICYmIGNvZGVQb2ludCA8PSAweDBmZmZmKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBPcmRpbmFyeSBCTVAgY29kZSBwb2ludCwgZXhjbHVkaW5nIGxlYWRpbmcgc3Vycm9nYXRlcy5cbiAgICAgICAgICAgICAgICAgICAgLy8gQk1QIHVzZXMgYSBzaW5nbGUgbGV2ZWwgbG9va3VwLiAgQk1QIGluZGV4IHN0YXJ0cyBhdCBvZmZzZXQgMCBpbiB0aGUgVHJpZTIgaW5kZXguXG4gICAgICAgICAgICAgICAgICAgIC8vIDE2IGJpdCBkYXRhIGlzIHN0b3JlZCBpbiB0aGUgaW5kZXggYXJyYXkgaXRzZWxmLlxuICAgICAgICAgICAgICAgICAgICBpeCA9IHRoaXMuaW5kZXhbY29kZVBvaW50ID4+IFVUUklFMl9TSElGVF8yJDFdO1xuICAgICAgICAgICAgICAgICAgICBpeCA9IChpeCA8PCBVVFJJRTJfSU5ERVhfU0hJRlQkMSkgKyAoY29kZVBvaW50ICYgVVRSSUUyX0RBVEFfTUFTSyQxKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YVtpeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPD0gMHhmZmZmKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIExlYWQgU3Vycm9nYXRlIENvZGUgUG9pbnQuICBBIFNlcGFyYXRlIGluZGV4IHNlY3Rpb24gaXMgc3RvcmVkIGZvclxuICAgICAgICAgICAgICAgICAgICAvLyBsZWFkIHN1cnJvZ2F0ZSBjb2RlIHVuaXRzIGFuZCBjb2RlIHBvaW50cy5cbiAgICAgICAgICAgICAgICAgICAgLy8gICBUaGUgbWFpbiBpbmRleCBoYXMgdGhlIGNvZGUgdW5pdCBkYXRhLlxuICAgICAgICAgICAgIC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yaWUkMS5nZXQoY29kZVBvaW50KTtcbiAgICAgICAgICAgIGlmIChjbGFzc1R5cGUgPiBMRVRURVJfTlVNQkVSX01PRElGSUVSKSB7XG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKHRydWUpO1xuICAgICAgICAgICAgICAgIGNsYXNzVHlwZSAtPSBMRVRURVJfTlVNQkVSX01PRElGSUVSO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGZhbHNlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChbJ25vcm1hbCcsICdhdXRvJywgJ2xvb3NlJ10uaW5kZXhPZihsaW5lQnJlYWspICE9PSAtMSkge1xuICAgICAgICAgICAgICAgIC8vIFUrMjAxMCwg4oCTIFUrMjAxMywg44CcIFUrMzAxQywg44KgIFUrMzBBMFxuICAgICAgICAgICAgICAgIGlmIChbMHgyMDEwLCAweDIwMTMsIDB4MzAxYywgMHgzMGEwXS5pbmRleE9mKGNvZGVQb2ludCkgIT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGljZXMucHVzaChpbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0eXBlcy5wdXNoKENCKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2xhc3NUeXBlID09PSBDTSB8fCBjbGFzc1R5cGUgPT09IFpXSiQxKSB7XG4gICAgICAgICAgICAgICAgLy8gTEIxMCBUcmVhdCBhbnkgcmVtYWluaW5nIGNvbWJpbmluZyBtYXJrIG9yIFpXSiBhcyBBTC5cbiAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kaWNlcy5wdXNoKGluZGV4KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVzLnB1c2goQUwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBMQjkgRG8gbm90IGJyZWFrIGEgY29tYmluaW5nIGNoYXJhY3RlciBzZXF1ZW5jZTsgdHJlYXQgaXQgYXMgaWYgaXQgaGFzIHRoZSBsaW5lIGJyZWFraW5nIGNsYXNzIG9mXG4gICAgICAgICAgICAgICAgLy8gdGhlIGJhc2UgY2hhcmFjdGVyIGluIGFsbCBvZiB0aGUgZm9sbG93aW5nIHJ1bGVzLiBUcmVhdCBaV0ogYXMgaWYgaXQgd2VyZSBDTS5cbiAgICAgICAgICAgICAgICB2YXIgcHJldiA9IHR5cGVzW2luZGV4IC0gMV07XG4gICAgICAgICAgICAgICAgaWYgKExJTkVfQlJFQUtTLmluZGV4T2YocHJldikgPT09IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgIGluZGljZXMucHVzaChpbmRpY2VzW2luZGV4IC0gMV0pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHlwZXMucHVzaChwcmV2KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaW5kaWNlcy5wdXNoKGluZGV4KTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHlwZXMucHVzaChBTCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpbmRpY2VzLnB1c2goaW5kZXgpO1xuICAgICAgICAgICAgaWYgKGNsYXNzVHlwZSA9PT0gQ0opIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHlwZXMucHVzaChsaW5lQnJlYWsgPT09ICdzdHJpY3QnID8gTlMgOiBJRCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY2xhc3NUeXBlID09PSBTQSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0eXBlcy5wdXNoKEFMKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjbGFzc1R5cGUgPT09IEFJKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGVzLnB1c2goQUwpO1xuICA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bmRleCwgY2xhc3NUeXBlcykge1xuICAgICAgICB2YXIgY3VycmVudCA9IGNsYXNzVHlwZXNbY3VycmVudEluZGV4XTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYSkgPyBhLmluZGV4T2YoY3VycmVudCkgIT09IC0xIDogYSA9PT0gY3VycmVudCkge1xuICAgICAgICAgICAgdmFyIGkgPSBjdXJyZW50SW5kZXg7XG4gICAgICAgICAgICB3aGlsZSAoaSA8PSBjbGFzc1R5cGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgICAgICB2YXIgbmV4dCA9IGNsYXNzVHlwZXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKG5leHQgPT09IGIpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChuZXh0ICE9PSBTUCkge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGN1cnJlbnQgPT09IFNQKSB7XG4gICAgICAgICAgICB2YXIgaSA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgICAgIHdoaWxlIChpID4gMCkge1xuICAgICAgICAgICAgICAgIGktLTtcbiAgICAgICAgICAgICAgICB2YXIgcHJldiA9IGNsYXNzVHlwZXNbaV07XG4gICAgICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkoYSkgPyBhLmluZGV4T2YocHJldikgIT09IC0xIDogYSA9PT0gcHJldikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbiA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG4gPD0gY2xhc3NUeXBlcy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG4rKztcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gY2xhc3NUeXBlc1tuXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0ID09PSBiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCAhPT0gU1ApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAocHJldiAhPT0gU1ApIHtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9O1xuICAgIHZhciBwcmV2aW91c05vblNwYWNlQ2xhc3NUeXBlID0gZnVuY3Rpb24gKGN1cnJlbnRJbmRleCwgY2xhc3NUeXBlcykge1xuICAgICAgICB2YXIgaSA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgd2hpbGUgKGkgPj0gMCkge1xuICAgICAgICAgICAgdmFyIHR5cGUgPSBjbGFzc1R5cGVzW2ldO1xuICAgICAgICAgICAgaWYgKHR5cGUgPT09IFNQKSB7XG4gICAgICAgICAgICAgICAgaS0tO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHR5cGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIDA7XG4gICAgfTtcbiAgICB2YXIgX2xpbmVCcmVha0F0SW5kZXggPSBmdW5jdGlvbiAoY29kZVBvaW50cywgY2xhc3NUeXBlcywgaW5kaWNpZXMsIGluZGV4LCBmb3JiaWRkZW5CcmVha3MpIHtcbiAgICAgICAgaWYgKGluZGljaWVzW2luZGV4XS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udCkgIT09IC0xICYmIG5leHQgPT09IFBPKSkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEJDE7XG4gICAgICAgIH1cbiAgICAgICAgLy8gTEIyNCBEbyBub3QgYnJlYWsgYmV0d2VlbiBudW1lcmljIHByZWZpeC9wb3N0Zml4IGFuZCBsZXR0ZXJzLCBvciBiZXR3ZWVuIGxldHRlcnMgYW5kIHByZWZpeC9wb3N0Zml4LlxuICAgICAgICBpZiAoKEFMUEhBQkVUSUNTLmluZGV4T2YoY3VycmVudCkgIT09IC0xICYmIFBSRUZJWF9QT1NURklYLmluZGV4T2YobmV4dCkgIT09IC0xKSB8fFxuICAgICAgICAgICAgKFBSRUZJWF9QT1NURklYLmluZGV4T2YoY3VycmVudCkgIT09IC0xICYmIEFMUEhBQkVUSUNTLmluZGV4T2YobmV4dCkgIT09IC0xKSkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEJDE7XG4gICAgICAgIH1cbiAgICAgICAgLy8gTEIyNSBEbyBub3QgYnJlYWsgYmV0d2VlbiB0aGUgZm9sbG93aW5nIHBhaXJzIG9mIGNsYXNzZXMgcmVsZXZhbnQgdG8gbnVtYmVyczpcbiAgICAgICAgaWYgKFxuICAgICAgICAvLyAoUFIgfCBQTykgw5cgKCBPUCB8IEhZICk/IE5VXG4gICAgICAgIChbUFIsIFBPXS5pbmRleE9mKGN1cnJlbnQpICE9PSAtMSAmJlxuICAgICAgICAgICAgKG5leHQgPT09IE5VIHx8IChbT1AsIEhZXS5pbmRleE9mKG5leHQpICE9PSAtMSAmJiBjbGFzc1R5cGVzW2FmdGVySW5kZXggKyAxXSA9PT0gTlUpKSkgfHxcbiAgICAgICAgICAgIC8vICggT1AgfCBIWSApIMOXIE5VXG4gICAgICAgICAgICAoW09QLCBIWV0uaW5kZXhPZihjdXJyZW50KSAhPT0gLTEgJiYgbmV4dCA9PT0gTlUpIHx8XG4gICAgICAgICAgICAvLyBOVSDDl1x0KE5VIHwgU1kgfCBJUylcbiAgICAgICAgICAgIChjdXJyZW50ID09PSBOVSAmJiBbTlUsIFNZLCBJU10uaW5kZXhPZihuZXh0KSAhPT0gLTEpKSB7XG4gICAgICAgICAgICByZXR1cm4gQlJFQUtfTk9UX0FMTE9XRUQkMTtcbiAgICAgICAgfVxuICAgICAgICAvLyBOVSAoTlUgfCBTWSB8IElTKSogw5cgKE5VIHwgU1kgfCBJUyB8IENMIHwgQ1ApXG4gICAgICAgIGlmIChbTlUsIFNZLCBJUywgQ0wsIENQXS5pbmRleE9mKG5leHQpICE9PSAtMSkge1xuICAgICAgICAgICAgdmFyIHByZXZJbmRleCA9IGN1cnJlbnRJbmRleDtcbiAgICAgICAgICAgIHdoaWxlIChwcmV2SW5kZXggPj0gMCkge1xuICAgICAgICAgICAgICAgIHZhciB0eXBlID0gY2xhc3NUeXBlc1twcmV2SW5kZXhdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlID09PSBOVSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gQlJFQUtfTk9UX0FMTE9XRUQkMTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoW1NZLCBJU10uaW5kZXhPZih0eXBlKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgcHJldkluZGV4LS07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgLy8gTlUgKE5VIHwgU1kgfCBJUykqIChDTCB8IENQKT8gw5cgKFBPIHwgUFIpKVxuICAgICAgICBpZiAoW1BSLCBQT10uaW5kZXhPZihuZXh0KSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHZhciBwcmV2SW5kZXggPSBbQ0wsIENQXS5pbmRleE9mKGN1cnJlbnQpICE9PSAtMSA/IGJlZm9yZUluZGV4IDogY3VycmVudEluZGV4O1xuICAgICAgICAgICAgd2hpbGUgKHByZXZJbmRleCA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGUgPSBjbGFzc1R5cGVzW3ByZXZJbmRleF07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09IE5VKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBCUkVBS19OT1RfQUxMT1dFRCQxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChbU1ksIElTXS5pbmRleE9mKHR5cGUpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBwcmV2SW5kZXgtLTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBMQjI2IERvIG5vdCBicmVhayBhIEtvcmVhbiBzeWxsYWJsZS5cbiAgICAgICAgaWYgKChKTCA9PT0gY3VycmVudCAmJiBbSkwsIEpWLCBIMiwgSDNdLmluZGV4T2YobmV4dCkgIT09IC0xKSB8fFxuICAgICAgICAgICAgKFtKViwgSDJdLmluZGV4T2YoY3VycmVudCkgIT09IC0xICYmIFtKViwgSlRdLmluZGV4T2YobmV4dCkgIT09IC0xKSB8fFxuICAgICAgICAgICAgKFtKVCwgSDNdLmluZGV4T2YoY3VycmVudCkgIT09IC0xICYmIG5leHQgPT09IEpUKSkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEJDE7XG4gICAgICAgIH1cbiAgICAgICAgLy8gTEIyNyBUcmVhdCBhIEtvcmVhbiBTeWxsYWJsZSBCbG9jayB0aGUgc2FtZSBhcyBJRC5cbiAgICAgICAgaWYgKChLT1JFQU5fU1lMTEFCTEVfQkxPQ0suaW5kZXhPZihjdXJyZW50KS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RleF0pID09PSAtMSkgfHxcbiAgICAgICAgICAgIChBTFBIQUJFVElDUy5jb25jYXQoTlUpLmluZGV4T2YobmV4dCkgIT09IC0xICYmIGN1cnJlbnQgPT09IENQKSkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEJDE7XG4gICAgICAgIH1cbiAgICAgICAgLy8gTEIzMGEgQnJlYWsgYmV0d2VlbiB0d28gcmVnaW9uYWwgaW5kaWNhdG9yIHN5bWJvbHMgaWYgYW5kIG9ubHkgaWYgdGhlcmUgYXJlIGFuIGV2ZW4gbnVtYmVyIG9mIHJlZ2lvbmFsXG4gICAgICAgIC8vIGluZGljYXRvcnMgcHJlY2VkaW5nIHRoZSBwb3NpdGlvbiBvZiB0aGUgYnJlYWsuXG4gICAgICAgIGlmIChjdXJyZW50ID09PSBSSSQxICYmIG5leHQgPT09IFJJJDEpIHtcbiAgICAgICAgICAgIHZhciBpID0gaW5kaWNpZXNbY3VycmVudEluZGV4XTtcbiAgICAgICAgICAgIHZhciBjb3VudCA9IDE7XG4gICAgICAgICAgICB3aGlsZSAoaSA+IDApIHtcbiAgICAgICAgICAgICAgICBpLS07XG4gICAgICAgICAgICAgICAgaWYgKGNsYXNzVHlwZXNbaV0gPT09IFJJJDEpIHtcbiAgICAgICAgICAgICAgICAgICAgY291bnQrKztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb3VudCAlIDIgIT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gQlJFQUtfTk9UX0FMTE9XRUQkMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBMQjMwYiBEbyBub3QgYnJlYWsgYmV0d2VlbiBhbiBlbW9qaSBiYXNlIGFuZCBhbiBlbW9qaSBtb2RpZmllci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GZvcmJpZGRlbkJyZWFrcG9pbnRzID0gX2FbMl07XG4gICAgICAgIHZhciBsZW5ndGggPSBjb2RlUG9pbnRzLmxlbmd0aDtcbiAgICAgICAgdmFyIGxhc3RFbmQgPSAwO1xuICAgICAgICB2YXIgbmV4dEluZGV4ID0gMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIG5leHQ6IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICBpZiAobmV4dEluZGV4ID49IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBkb25lOiB0cnVlLCB2YWx1ZTogbnVsbCB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgbGluZUJyZWFrID0gQlJFQUtfTk9UX0FMTE9XRUQkMTtcbiAgICAgICAgICAgICAgICB3aGlsZSAobmV4dEluZGV4IDwgbGVuZ3RoICYmXG4gICAgICAgICAgICAgICAgICAgIChsaW5lQnJlYWsgPSBfbGluZUJyZWFrQXRJbmRleChjb2RlUG9pbnRzLCBjbGFzc1R5cGVzLCBpbmRpY2llcywgKytuZXh0SW5kZXgsIGZvcmJpZGRlbkJyZWFrcG9pbnRzKSkgPT09XG4gICAgICAgICAgICAgICAgICAgICAgICBCUkVBS19OT1RfQUxMT1dFRCQxKSB7IH1cbiAgICAgICAgICAgICAgICBpZiAobGluZUJyZWFrICE9PSBCUkVBS19OT1RfQUxMT1dFRCQxIHx8IG5leHRJbmRleCA9PT0gbGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IG5ldyBCcmVhayhjb2RlUG9pbnRzLCBsaW5lQnJlYWssIGxhc3RFbmQsIG5leHRJbmRleCk7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RFbmQgPSBuZXh0SW5kZXg7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7IHZhbHVlOiB2YWx1ZSwgZG9uZTogZmFsc2UgfTtcbiAgICAgICAgICAg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AgICAgIHJldHVybiBjMiA9PT0gRlVMTF9TVE9QICYmIGlzRGlnaXQoYzMpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjMSA9PT0gRlVMTF9TVE9QKSB7XG4gICAgICAgICAgICByZXR1cm4gaXNEaWdpdChjMik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGlzRGlnaXQoYzEpO1xuICAgIH07XG4gICAgdmFyIHN0cmluZ1RvTnVtYmVyID0gZnVuY3Rpb24gKGNvZGVQb2ludHMpIHtcbiAgICAgICAgdmFyIGMgPSAwO1xuICAgICAgICB2YXIgc2lnbiA9IDE7XG4gICAgICAgIGlmIChjb2RlUG9pbnRzW2NdID09PSBQTFVTX1NJR04gfHwgY29kZVBvaW50c1tjXSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICBpZiAoY29kZVBvaW50c1tjXSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICAgICAgc2lnbiA9IC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYysrO1xuICAgICAgICB9XG4gICAgICAgIHZhciBpbnRlZ2VycyA9IFtdO1xuICAgICAgICB3aGlsZSAoaXNEaWdpdChjb2RlUG9pbnRzW2NdKSkge1xuICAgICAgICAgICAgaW50ZWdlcnMucHVzaChjb2RlUG9pbnRzW2MrK10pO1xuICAgICAgICB9XG4gICAgICAgIHZhciBpbnQgPSBpbnRlZ2Vycy5sZW5ndGggPyBwYXJzZUludChmcm9tQ29kZVBvaW50JDEuYXBwbHkodm9pZCAwLCBpbnRlZ2VycyksIDEwKSA6IDA7XG4gICAgICAgIGlmIChjb2RlUG9pbnRzW2NdID09PSBGVUxMX1NUT1ApIHtcbiAgICAgICAgICAgIGMrKztcbiAgICAgICAgfVxuICAgICAgICB2YXIgZnJhY3Rpb24gPSBbXTtcbiAgICAgICAgd2hpbGUgKGlzRGlnaXQoY29kZVBvaW50c1tjXSkpIHtcbiAgICAgICAgICAgIGZyYWN0aW9uLnB1c2goY29kZVBvaW50c1tjKytdKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgZnJhY2QgPSBmcmFjdGlvbi5sZW5ndGg7XG4gICAgICAgIHZhciBmcmFjID0gZnJhY2QgPyBwYXJzZUludChmcm9tQ29kZVBvaW50JDEuYXBwbHkodm9pZCAwLCBmcmFjdGlvbiksIDEwKSA6IDA7XG4gICAgICAgIGlmIChjb2RlUG9pbnRzW2NdID09PSBFIHx8IGNvZGVQb2ludHNbY10gPT09IGUpIHtcbiAgICAgICAgICAgIGMrKztcbiAgICAgICAgfVxuICAgICAgICB2YXIgZXhwc2lnbiA9IDE7XG4gICAgICAgIGlmIChjb2RlUG9pbnRzW2NdID09PSBQTFVTX1NJR04gfHwgY29kZVBvaW50c1tjXSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICBpZiAoY29kZVBvaW50c1tjXSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICAgICAgZXhwc2lnbiA9IC0xO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYysrO1xuICAgICAgICB9XG4gICAgICAgIHZhciBleHBvbmVudCA9IFtdO1xuICAgICAgICB3aGlsZSAoaXNEaWdpdChjb2RlUG9pbnRzW2NdKSkge1xuICAgICAgICAgICAgZXhwb25lbnQucHVzaChjb2RlUG9pbnRzW2MrK10pO1xuICAgICAgICB9XG4gICAgICAgIHZhciBleHAgPSBleHBvbmVudC5sZW5ndGggPyBwYXJzZUludChmcm9tQ29kZVBvaW50JDEuYXBwbHkodm9pZCAwLCBleHBvbmVudCksIDEwKSA6IDA7XG4gICAgICAgIHJldHVybiBzaWduICogKGludCArIGZyYWMgKiBNYXRoLnBvdygxMCwgLWZyYWNkKSkgKiBNYXRoLnBvdygxMCwgZXhwc2lnbiAqIGV4cCk7XG4gICAgfTtcbiAgICB2YXIgTEVGVF9QQVJFTlRIRVNJU19UT0tFTiA9IHtcbiAgICAgICAgdHlwZTogMiAvKiBMRUZUX1BBU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G9Db2RlUG9pbnRzJDEoY2h1bmspKTtcbiAgICAgICAgfTtcbiAgICAgICAgVG9rZW5pemVyLnByb3RvdHlwZS5yZWFkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHRva2VucyA9IFtdO1xuICAgICAgICAgICAgdmFyIHRva2VuID0gdGhpcy5jb25zdW1lVG9rZW4oKTtcbiAgICAgICAgICAgIHdoaWxlICh0b2tlbiAhPT0gRU9GX1RPS0VOKSB7XG4gICAgICAgICAgICAgICAgdG9rZW5zLnB1c2godG9rZW4pO1xuICAgICAgICAgICAgICAgIHRva2VuID0gdGhpcy5jb25zdW1lVG9rZW4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0b2tlbnM7XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUuY29uc3VtZVRva2VuID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9IHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgc3dpdGNoIChjb2RlUG9pbnQpIHtcbiAgICAgICAgICAgICAgICBjYXNlIFFVT1RBVElPTl9NQVJLOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jb25zdW1lU3RyaW5nVG9rZW4oUVVPVEFUSU9OX01BUkspO1xuICAgICAgICAgICAgICAgIGNhc2UgTlVNQkVSX1NJR046XG4gICAgICAgICAgICAgICAgICAgIHZhciBjMSA9IHRoaXMucGVla0NvZGVQb2ludCgwKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGMyID0gdGhpcy5wZWVrQ29kZVBvaW50KDEpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYzMgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc05hbWVDb2RlUG9pbnQoYzEpIHx8IGlzVmFsaWRFc2NhcGUoYzIsIGMzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZsYWdzID0gaXNJZGVudGlmaWVyU3RhcnQoYzEsIGMyLCBjMykgPyBGTEFHX0lEIDogRkxBR19VTlJFU1RSSUNURUQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmNvbnN1bWVOYW1lKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyB0eXBlOiA1IC8qIEhBU0hfVE9LRU4gKi8sIHZhbHVlOiB2YWx1ZSwgZmxhZ3M6IGZsYWdzIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBET0xMQVJfU0lHTjpcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gRVFVQUxTX1NJR04pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNVRkZJWF9NQVRDSF9UT0tFTjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIEFQT1NUUk9QSEU6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVTdHJpbmdUb2tlbihBUE9TVFJPUEhFKTtcbiAgICAgICAgICAgICAgICBjYXNlIExFRlRfUEFSRU5USEVTSVM6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBMRUZUX1BBUkVOVEhFU0lTX1RPS0VOO1xuICAgICAgICAgICAgICAgIGNhc2UgUklHSFRfUEFSRU5USEVTSVM6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBSSUdIVF9QQVJFTlRIRVNJU19UT0tFTjtcbiAgICAgICAgICAgICAgICBjYXNlIEFTVEVSSVNLOlxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5wZWVrQ29kZVBvaW50KDApID09PSBFUVVBTFNfU0lHTikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gU1VCU1RSSU5HX01BVENIX1RPS0VOO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgUExVU19TSUdOOlxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOdW1iZXJTdGFydChjb2RlUG9pbnQsIHRoaXMucGVla0NvZGVQb2ludCgwKSwgdGhpcy5wZWVrQ29kZVBvaW50KDEpKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWNvbnN1bWVDb2RlUG9pbnQoY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVOdW1lcmljVG9rZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIENPTU1BOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ09NTUFfVE9LRU47XG4gICAgICAgICAgICAgICAgY2FzZSBIWVBIRU5fTUlOVVM6XG4gICAgICAgICAgICAgICAgICAgIHZhciBlMSA9IGNvZGVQb2ludDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGUyID0gdGhpcy5wZWVrQ29kZVBvaW50KDApO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZTMgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc051bWJlclN0YXJ0KGUxLCBlMiwgZTMpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlY29uc3VtZUNvZGVQb2ludChjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZU51bWVyaWNUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChlMSwgZTIsIGUzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWNvbnN1bWVDb2RlUG9pbnQoY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVJZGVudExpa2VUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlMiA9PT0gSFlQSEVOX01JTlVTICYmIGUzID09PSBHUkVBVEVSX1RIQU5fU0lHTikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDRENfVE9LRU47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBGVUxMX1NUT1A6XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc051bWJlclN0YXJ0KGNvZGVQb2ludCwgdGhpcy5wZWVrQ29kZVBvaW50KDApLCB0aGlzLnBlZWtDb2RlUG9pbnQoMSkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlY29uc3VtZUNvZGVQb2ludChjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZU51bWVyaWNUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgU09MSURVUzpcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gQVNURVJJU0spIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09PSBBU1RFUklTSykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09PSBTT0xJRFVTKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jb25zdW1lVG9rZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYyA9PT0gRU9GKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIENPTE9OOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ09MT05fVE9LRU47XG4gICAgICAgICAgICAgICAgY2FzZSBTRU1JQ09MT046XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBTRU1JQ09MT05fVE9LRU47XG4gICAgICAgICAgICAgICAgY2FzZSBMRVNTX1RIQU5fU0lHTjpcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gRVhDTEFNQVRJT05fTUFSSyAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wZWVrQ29kZVBvaW50KDEpID09PSBIWVBIRU5fTUlOVVMgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGVla0NvZGVQb2ludCgyKSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIENET19UT0tFTjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIENPTU1FUkNJQUxfQVQ6XG4gICAgICAgICAgICAgICAgICAgIHZhciBhMSA9IHRoaXMucGVla0NvZGVQb2ludCgwKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGEyID0gdGhpcy5wZWVrQ29kZVBvaW50KDEpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYTMgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMik7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChhMSwgYTIsIGEzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gdGhpcy5jb25zdW1lTmFtZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgdHlwZTogNyAvKiBBVF9LRVlXT1JEX1RPS0VOICovLCB2YWx1ZTogdmFsdWUgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIExFRlRfU1FVQVJFX0JSQUNLRVQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBMRUZUX1NRVUFSRV9CUkFDS0VUX1RPS0VOO1xuICAgICAgICAgICAgICAgIGNhc2UgUkVWRVJTRV9TT0xJRFVTOlxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNWYWxpZEVzY2FwZShjb2RlUG9pbnQsIHRoaXMucGVla0NvZGVQb2ludCgwKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVjb25zdW1lQ29kZVBvaW50KGNvZGVQb2ludCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jb25zdW1lSWRlbnRMaWtlVG9rZW4oKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIFJJR0hUX1NRVUFSRV9CUkFDS0VUOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUklHSFRfU1FVQVJFX0JSQUNLRVRfVE9LRU47XG4gICAgICAgICAgICAgICAgY2FzZSBDSVJDVU1GTEVYX0FDQ0VOVDpcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gRVFVQUxTX1NJR04pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBSRUZJWF9NQVRDSF9UT0tFTjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlIExFRlRfQ1VSTFlfQlJBQ0tFVDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIExFRlRfQ1VSTFlfQlJBQ0tFVF9UT0tFTjtcbiAgICAgICAgICAgICAgICBjYXNlIFJJR0hUX0NVUkxZX0JSQUNLRVQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBSSUdIVF9DVVJMWV9CUkFDS0VUX1RPS0VOO1xuICAgICAgICAgICAgICAgIGNhc2UgdTpcbiAgICAgICAgICAgICAgICBjYXNlIFU6XG4gICAgICAgICAgICAgICAgICAgIHZhciB1MSA9IHRoaXMucGVla0NvZGVQb2ludCgwKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHUyID0gdGhpcy5wZWVrQ29kZVBvaW50KDEpO1xuICAgICAgICAgICAgICAgICAgICBpZiAodTEgPT09IFBMVVNfU0lHTiAmJiAoaXNIZXgodTIpIHx8IHUyID09PSBRVUVTVElPTl9NQVJLKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVVbmljb2RlUmFuZ2VUb2tlbigpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVjb25zdW1lQ29kZVBvaW50KGNvZGVQb2ludCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVJZGVudExpa2VUb2tlbigpO1xuICAgICAgICAgICAgICAgIGNhc2UgVkVSVElDQUxfTElORTpcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gRVFVQUxTX1NJR04pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIERBU0hfTUFUQ0hfVE9LRU47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gVkVSVElDQUxfTElORSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ09MVU1OX1RPS0VOO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgVElMREU6XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IEVRVUFMU19TSUdOKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBJTkNMVURFX01BVENIX1RPS0VOO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIGNhc2UgRU9GOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRU9GX1RPS0VOO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzV2hpdGVTcGFjZShjb2RlUG9pbnQpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lV2hpdGVTcGFjZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBXSElURVNQQUNFX1RPS0VOO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzRGlnaXQoY29kZVBvaW50KSkge1xuICAgICAgICAgICAgICAgIHRoaXMucmVjb25zdW1lQ29kZVBvaW50KGNvZGVQb2ludCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZU51bWVyaWNUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzTmFtZVN0YXJ0Q29kZVBvaW50KGNvZGVQb2ludCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlY29uc3VtZUNvZGVQb2ludChjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNvbnN1bWVJZGVudExpa2VUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHsgdHlwZTogNiAvKiBERUxJTV9UT0tFTiAqLywgdmFsdWU6IGZyb21Db2RlUG9pbnQkMShjb2RlUG9pbnQpIH07XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUuY29uc3VtZUNvZGVQb2ludCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuX3ZhbHVlLnNoaWZ0KCk7XG4gICAgICAgICAgICByZXR1cm4gdHlwZW9mIHZhbHVlID09PSAndW5kZWZpbmVkJyA/IC0xIDogdmFsdWU7XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUucmVjb25zdW1lQ29kZVBvaW50ID0gZnVuY3Rpb24gKGNvZGVQb2ludCkge1xuICAgICAgICAgICAgdGhpcy5fdmFsdWUudW5zaGlmdChjb2RlUG9pbnQpO1xuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLnBlZWtDb2RlUG9pbnQgPSBmdW5jdGlvbiAoZGVsdGEpIHtcbiAgICAgICAgICAgIGlmIChkZWx0YSA+PSB0aGlzLl92YWx1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fdmFsdWVbZGVsdGFdO1xuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLmNvbnN1bWVVbmljb2RlUmFuZ2VUb2tlbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBkaWdpdHMgPSBbXTtcbiAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgIHdoaWxlIChpc0hleChjb2RlUG9pbnQpICYmIGRpZ2l0cy5sZW5ndGggPCA2KSB7XG4gICAgICAgICAgICAgICAgZGlnaXRzLnB1c2goY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICBjb2RlUG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biAgICAgICAgICAgIGlmICh0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IEhZUEhFTl9NSU5VUyAmJiBpc0hleCh0aGlzLnBlZWtDb2RlUG9pbnQoMSkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgY29kZVBvaW50ID0gdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgdmFyIGVuZERpZ2l0cyA9IFtdO1xuICAgICAgICAgICAgICAgIHdoaWxlIChpc0hleChjb2RlUG9pbnQpICYmIGVuZERpZ2l0cy5sZW5ndGggPCA2KSB7XG4gICAgICAgICAgICAgICAgICAgIGVuZERpZ2l0cy5wdXNoKGNvZGVQb2ludCk7XG4gICAgICAgICAgICAgICAgICAgIGNvZGVQb2ludCA9IHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgZW5kID0gcGFyc2VJbnQoZnJvbUNvZGVQb2ludCQxLmFwcGx5KHZvaWQgMCwgZW5kRGlnaXRzKSwgMTYpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDMwIC8qIFVOSUNPREVfUkFOR0VfVE9LRU4gKi8sIHN0YXJ0OiBzdGFydCwgZW5kOiBlbmQgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDMwIC8qIFVOSUNPREVfUkFOR0VfVE9LRU4gKi8sIHN0YXJ0OiBzdGFydCwgZW5kOiBzdGFydCB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLmNvbnN1bWVJZGVudExpa2VUb2tlbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuY29uc3VtZU5hbWUoKTtcbiAgICAgICAgICAgIGlmICh2YWx1ZS50b0xvd2VyQ2FzZSgpID09PSAndXJsJyAmJiB0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IExFRlRfUEFSRU5USEVTSVMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jb25zdW1lVXJsVG9rZW4oKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKHRoaXMucGVla0NvZGVQb2ludCgwKSA9PT0gTEVGVF9QQVJFTlRIRVNJUykge1xuICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDE5IC8qIEZVTkNUSU9OX1RPS0VOICovLCB2YWx1ZTogdmFsdWUgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDIwIC8qIElERU5UX1RPS0VOICovLCB2YWx1ZTogdmFsdWUgfTtcbiAgICAgICAgfTtcbiAgICAgICAgVG9rZW5pemVyLnByb3RvdHlwZS5jb25zdW1lVXJsVG9rZW4gPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgdmFsdWUgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuY29uc3VtZVdoaXRlU3BhY2UoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IEVPRikge1xuICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDIyIC8qIFVSTF9UT0tFTiAqLywgdmFsdWU6ICcnIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgbmV4dCA9IHRoaXMucGVla0NvZGVQb2ludCgwKTtcbiAgICAgICAgICAgIGlmIChuZXh0ID09PSBBUE9TVFJPUEhFIHx8IG5leHQgPT09IFFVT1RBVElPTl9NQVJLKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cmluZ1Rva2VuID0gdGhpcy5jb25zdW1lU3RyaW5nVG9rZW4odGhpcy5jb25zdW1lQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgICAgIGlmIChzdHJpbmdUb2tlbi50eXBlID09PSAwIC8qIFNUUklOR19UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVXaGl0ZVNwYWNlKCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IEVPRiB8fCB0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IFJJR0hUX1BBUkVOVEhFU0lTKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDIyIC8qIFVSTF9UT0tFTiAqLywgdmFsdWU6IHN0cmluZ1Rva2VuLnZhbHVlIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQmFkVXJsUmVtbmFudHMoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1VSTF9UT0tFTjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9IHRoaXMuY29uc3VtZUNvZGVQb2ludCgpO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPT09IEVPRiB8fCBjb2RlUG9pbnQgPT09IFJJR0hUX1BBUkVOVEhFU0lTKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDIyIC8qIFVSTF9UT0tFTiAqLywgdmFsdWU6IGZyb21Db2RlUG9pbnQkMS5hcHBseSh2b2lkIDAsIHZhbHVlKSB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc1doaXRlU3BhY2UoY29kZVBvaW50KSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVXaGl0ZVNwYWNlKCk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IEVPRiB8fCB0aGlzLnBlZWtDb2RlUG9pbnQoMCkgPT09IFJJR0hUX1BBUkVOVEhFU0lTKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDIyIC8qIFVSTF9UT0tFTiAqLywgdmFsdWU6IGZyb21Db2RlUG9pbnQkMS5hcHBseSh2b2lkIDAsIHZhbHVlKSB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY29uc3VtZUJhZFVybFJlbW5hbnRzKCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVVJMX1RPS0VOO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjb2RlUG9pbnQgPT09IFFVT1RBVElPTl9NQVJLIHx8XG4gICAgICAgICAgICAgICAgICAgIGNvZGVQb2ludCA9PT0gQVBPU1RST1BIRSB8fFxuICAgICAgICAgICAgICAgICAgICBjb2RlUG9pbnQgPT09IExFRlRfUEFSRU5USEVTSVMgfHxcbiAgICAgICAgICAgICAgICAgICAgaXNOb25QcmludGFibGVDb2RlUG9pbnQoY29kZVBvaW50KSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVCYWRVcmxSZW1uYW50cygpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1VSTF9UT0tFTjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY29kZVBvaW50ID09PSBSRVZFUlNFX1NPTElEVVMpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVmFsaWRFc2NhcGUoY29kZVBvaW50LCB0aGlzLnBlZWtDb2RlUG9pbnQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5wdXNoKHRoaXMuY29uc3VtZUVzY2FwZWRDb2RlUG9pbnQoKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVCYWRVcmxSZW1uYW50cygpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9VUkxfVE9LRU47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlLnB1c2goY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUuY29uc3VtZVdoaXRlU3BhY2UgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB3aGlsZSAoaXNXaGl0ZVNwYWNlKHRoaXMucGVla0NvZGVQb2ludCgwKSkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgVG9rZW5pemVyLnByb3RvdHlwZS5jb25zdW1lQmFkVXJsUmVtbmFudHMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICBpZiAoY29kZVBvaW50ID09PSBSSUdIVF9QQVJFTlRIRVNJUyB8fCBjb2RlUG9pbnQgPT09IEVPRikge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc1ZhbGlkRXNjYXBlKGNvZGVQb2ludCwgdGhpcy5wZWVrQ29kZVBvaW50KDApKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVFc2NhcGVkQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLmNvbnN1bWVTdHJpbmdTbGljZSA9IGZ1bmN0aW9uIChjb3VudCkge1xuICAgICAgICAgICAgdmFyIFNMSUNFX1NUQUNLX1NJWkUgPSA1MDAwMDtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9ICcnO1xuICAgICAgICAgICAgd2hpbGUgKGNvdW50ID4gMCkge1xuICAgICAgICAgICAgICAgIHZhciBhbW91bnQgPSBNYXRoLm1pbihTTElDRV9TVEFDS19TSVpFLCBjb3VudCk7XG4gICAgICAgICAgICAgICAgdmFsdWUgKz0gZnJvbUNvZGVQb2ludCQxLmFwcGx5KHZvaWQgMCwgdGhpcy5fdmFsdWUuc3BsaWNlKDAsIGFtb3VudCkpO1xuICAgICAgICAgICAgICAgIGNvdW50IC09IGFtb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX3ZhbHVlLnNoaWZ0KCk7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUuY29uc3VtZVN0cmluZ1Rva2VuID0gZnVuY3Rpb24gKGVuZGluZ0NvZGVQb2ludCkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gJyc7XG4gICAgICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgdmFyIGNvZGVQb2ludCA9IHRoaXMuX3ZhbHVlW2ldO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPT09IEVPRiB8fCBjb2RlUG9pbnQgPT09IHVuZGVmaW5lZCB8fCBjb2RlUG9pbnQgPT09IGVuZGluZ0NvZGVQb2ludCkge1xuICAgICAgICAgICAgICAgICAgICB2YWx1ZSArPSB0aGlzLmNvbnN1bWVTdHJpbmdTbGljZShpKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsgdHlwZTogMCAvKiBTVFJJTkdfVE9LRU4gKi8sIHZhbHVlOiB2YWx1ZSB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoY29kZVBvaW50ID09PSBMSU5FX0ZFRUQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fdmFsdWUuc3BsaWNlKDAsIGkpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1NUUklOR19UT0tFTjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGNvZGVQb2ludCA9PT0gUkVWRVJTRV9TT0xJRFVTKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gdGhpcy5fdmFsdWVbaSArIDFdO1xuICAgICAgICAgICAgICAgICAgICBpZiAobmV4dCAhPT0gRU9GICYmIG5leHQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgPT09IExJTkVfRkVFRCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IHRoaXMuY29uc3VtZVN0cmluZ1NsaWNlKGkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAtMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl92YWx1ZS5zaGlmdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNWYWxpZEVzY2FwZShjb2RlUG9pbnQsIG5leHQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gdGhpcy5jb25zdW1lU3RyaW5nU2xpY2UoaSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gZnJvbUNvZGVQb2ludCQxKHRoaXMuY29uc3VtZUVzY2FwZWRDb2RlUG9pbnQoKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0xO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGkrKztcbiAgICAgICAgICAgIH0gd2hpbGUgKHRydWUpO1xuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLmNvbnN1bWVOdW1iZXIgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgcmVwciA9IFtdO1xuICAgICAgICAgICAgdmFyIHR5cGUgPSBGTEFHX0lOVEVHRVI7XG4gICAgICAgICAgICB2YXIgYzEgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMCk7XG4gICAgICAgICAgICBpZiAoYzEgPT09IFBMVVNfU0lHTiB8fCBjMSA9PT0gSFlQSEVOX01JTlVTKSB7XG4gICAgICAgICAgICAgICAgcmVwci5wdXNoKHRoaXMuY29uc3VtZUNvZGVQb2ludCgpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHdoaWxlIChpc0RpZ2l0KHRoaXMucGVla0NvZGVQb2ludCgwKSkpIHtcbiAgICAgICAgICAgICAgICByZXByLnB1c2godGhpcy5jb25zdW1lQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYzEgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMCk7XG4gICAgICAgICAgICB2YXIgYzIgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMSk7XG4gICAgICAgICAgICBpZiAoYzEgPT09IEZVTExfU1RPUCAmJiBpc0RpZ2l0KGMyKSkge1xuICAgICAgICAgICAgICAgIHJlcHIucHVzaCh0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKSwgdGhpcy5jb25zdW1lQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgICAgIHR5cGUgPSBGTEFHX05VTUJFUjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaXNEaWdpdCh0aGlzLnBlZWtDb2RlUG9pbnQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcHIucHVzaCh0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYzEgPSB0aGlzLnBlZWtDb2RlUG9pbnQoMCk7XG4gICAgICAgICAgICBjMiA9IHRoaXMucGVla0NvZGVQb2ludCgxKTtcbiAgICAgICAgICAgIHZhciBjMyA9IHRoaXMucGVla0NvZGVQb2ludCgyKTtcbiAgICAgICAgICAgIGlmICgoYzEgPT09IEUgfHwgYzEgPT09IGUpICYmICgoKGMyID09PSBQTFVTX1NJR04gfHwgYzIgPT09IEhZUEhFTl9NSU5VUykgJiYgaXNEaWdpdChjMykpIHx8IGlzRGlnaXQoYzIpKSkge1xuICAgICAgICAgICAgICAgIHJlcHIucHVzaCh0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKSwgdGhpcy5jb25zdW1lQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgICAgIHR5cGUgPSBGTEFHX05VTUJFUjtcbiAgICAgICAgICAgICAgICB3aGlsZSAoaXNEaWdpdCh0aGlzLnBlZWtDb2RlUG9pbnQoMCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcHIucHVzaCh0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIFtzdHJpbmdUb051bWJlcihyZXByKSwgdHlwZV07XG4gICAgICAgIH07XG4gICAgICAgIFRva2VuaXplci5wcm90b3R5cGUuY29uc3VtZU51bWVyaWNUb2tlbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBfYSA9IHRoaXMuY29uc3VtZU51bWJlcigpLCBudW1iZXIgPSBfYVswXSwgZmxhZ3MgPSBfYVsxXTtcbiAgICAgICAgICAgIHZhciBjMSA9IHRoaXMucGVla0NvZGVQb2ludCgwKTtcbiAgICAgICAgICAgIHZhciBjMiA9IHRoaXMucGVla0NvZGVQb2ludCgxKTtcbiAgICAgICAgICAgIHZhciBjMyA9IHRoaXMucGVla0NvZGVQb2ludCgyKTtcbiAgICAgICAgICAgIGlmIChpc0lkZW50aWZpZXJTdGFydChjMSwgYzIsIGMzKSkge1xuICAgICAgICAgICAgICAgIHZhciB1bml0ID0gdGhpcy5jb25zdW1lTmFtZSgpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7IHR5cGU6IDE1IC8qIERJTUVOU0lPTl9UT0tFTiAqLywgbnVtYmVyOiBudW1iZXIsIGZsYWdzOiBmbGFncywgdW5pdDogdW5pdCB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGMxID09PSBQRVJDRU5UQUdFX1NJR04pIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgICAgICByZXR1cm4geyB0eXBlOiAxNiAvKiBQRVJDRU5UQUdFX1RPS0VOICovLCBudW1iZXI6IG51bWJlciwgZmxhZ3M6IGZsYWdzIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4geyB0eXBlOiAxNyAvKiBOVU1CRVJfVE9LRU4gKi8sIG51bWJlcjogbnVtYmVyLCBmbGFnczogZmxhZ3MgfTtcbiAgICAgICAgfTtcbiAgICAgICAgVG9rZW5pemVyLnByb3RvdHlwZS5jb25zdW1lRXNjYXBlZENvZGVQb2ludCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSB0aGlzLmNvbnN1bWVDb2RlUG9pbnQoKTtcbiAgICAgICAgICAgIGlmIChpc0hleChjb2RlUG9pbnQpKSB7XG4gICAgICAgICAgICAgICAgdmFyIGhleCA9IGZyb21Db2RlUG9pbnQkMShjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgIHdoaWxlIChpc0hleCh0aGlzLnBlZWtDb2RlUG9pbnQoMCkpICYmIGhleC5sZW5ndGggPCA2KSB7XG4gICAgICAgICAgICAgICAgICAgIGhleCArPSBmcm9tQ29kZVBvaW50JDEodGhpcy5jb25zdW1lQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNXaGl0ZVNwYWNlKHRoaXMucGVla0NvZGVQb2ludCgwKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBoZXhDb2RlUG9pbnQgPSBwYXJzZUludChoZXgsIDE2KTtcbiAgICAgICAgICAgICAgICBpZiAoaGV4Q29kZVBvaW50ID09PSAwIHx8IGlzU3Vycm9nYXRlQ29kZVBvaW50KGhleENvZGVQb2ludCkgfHwgaGV4Q29kZVBvaW50ID4gMHgxMGZmZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFJFUExBQ0VNRU5UX0NIQVJBQ1RFUjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGhleENvZGVQb2ludDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPT09IEVPRikge1xuICAgICAgICAgICAgICAgIHJldHVybiBSRVBMQUNFTUVOVF9DSEFSQUNURVI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY29kZVBvaW50O1xuICAgICAgICB9O1xuICAgICAgICBUb2tlbml6ZXIucHJvdG90eXBlLmNvbnN1bWVOYW1lID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHJlc3VsdCA9ICcnO1xuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgY29kZVBvaW50ID0gdGhpcy5jb25zdW1lQ29kZVBvaW50KCk7XG4gICAgICAgICAgICAgICAgaWYgKGlzTmFtZUNvZGVQb2ludChjb2RlUG9pbnQpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSBmcm9tQ29kZVBvaW50JDEoY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNWYWxpZEVzY2FwZShjb2RlUG9pbnQsIHRoaXMucGVla0NvZGVQb2ludCgwKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IGZyb21Db2RlUG9pbnQkMSh0aGlzLmNvbnN1bWVFc2NhcGVkQ29kZVBvaW50KCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWNvbnN1bWVDb2RlUG9pbnQoY29kZVBvaW50KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBUb2tlbml6ZXI7XG4gICAgfSgpKTtcblxuICAgIHZhciBQYXJzZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgICAgIGZ1bmN0aW9uIFBhcnNlcih0b2tlbnMpIHtcbiAgICAgICAgICAgIHRoaXMuX3Rva2VucyA9IHRva2VucztcbiAgICAgICAgfVxuICAgICAgICBQYXJzZXIuY3JlYXRlID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICB2YXIgdG9rZW5pemVyID0gbmV3IFRva2VuaXplcigpO1xuICAgICAgICAgICAgdG9rZW5pemVyLndyaXRlKHZhbHVlKTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUGFyc2VyKHRva2VuaXplci5yZWFkKCkpO1xuICAgICAgICB9O1xuICAgICAgICBQYXJzZXIucGFyc2VWYWx1ZSA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICAgICAgcmV0dXJuIFBhcnNlci5jcmVhdGUodmFsdWUpLnBhcnNlQ29tcG9uZW50VmFsdWUoKTtcbiAgICAgICAgfTtcbiAgICAgICAgUGFyc2VyLnBhcnNlVmFsdWVzID0gZnVuY3Rpb24gKHZhbHVlKSB7XG4gICAgICAgICAgICByZXR1cm4gUGFyc2VyLmNyZWF0ZSh2YWx1ZSkucGFyc2VDb21wb25lbnRWYWx1ZXMoKTtcbiAgICAgICAgfTtcbiAgICAgICAgUGFyc2VyLnByb3RvdHlwZS5wYXJzZUNvbXBvbmVudFZhbHVlID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIHRva2VuID0gdGhpcy5jb25zdW1lVG9rZW4oKTtcbiAgICAgICAgICAgIHdoaWxlICh0b2tlbi50eXBlID09PSAzMSAvKiBXSElURVNQQUNFX1RPS0VOICovKSB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRva2VuLnR5cGUgPT09IDMyIC8qIEVPRl9UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBTeW50YXhFcnJvcihcIkVycm9yIHBhcnNpbmcgQ1NTIGNvbXBvbmVudCB2YWx1ZSwgdW5leHBlY3RlZCBFT0ZcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnJlY29uc3VtZVRva2VuKHRva2VuKTtcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuY29uc3VtZUNvbXBvbmVudFZhbHVlKCk7XG4gICAgICAgICAgICBkbyB7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgfSB3aGlsZSAodG9rZW4udHlwZSA9PT0gMzEgLyogV0hJVEVTUEFDRV9UT0tFTiAqLyk7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMzIgLyogRU9GX1RPS0VOICovKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IFN5bnRheEVycm9yKFwiRXJyb3IgcGFyc2luZyBDU1MgY29tcG9uZW50IHZhbHVlLCBtdWx0aXBsZSB2YWx1ZXMgZm91bmQgd2hlbiBleHBlY3Rpbmcgb25seSBvbmVcIik7XG4gICAgICAgIH07XG4gICAgICAgIFBhcnNlci5wcm90b3R5cGUucGFyc2VDb21wb25lbnRWYWx1ZXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgdmFsdWVzID0gW107XG4gICAgICAgICAgICB3aGlsZSAodHJ1ZSkge1xuICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHRoaXMuY29uc3VtZUNvbXBvbmVudFZhbHVlKCk7XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlLnR5cGUgPT09IDMyIC8qIEVPRl9UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWVzO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YWx1ZXMucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgdmFsdWVzLnB1c2goKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgUGFyc2VyLnByb3RvdHlwZS5jb25zdW1lQ29tcG9uZW50VmFsdWUgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgc3dpdGNoICh0b2tlbi50eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAxMSAvKiBMRUZUX0NVUkxZX0JSQUNLRVRfVE9LRU4gKi86XG4gICAgICAgICAgICAgICAgY2FzZSAyOCAvKiBMRUZUX1NRVUFSRV9CUkFDS0VUX1RPS0VOICovOlxuICAgICAgICAgICAgICAgIGNhc2UgMiAvKiBMRUZUX1BBUkVOVEhFU0lTX1RPS0VOICovOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jb25zdW1lU2ltcGxlQmxvY2sodG9rZW4udHlwZSk7XG4gICAgICAgICAgICAgICAgY2FzZSAxOSAvKiBGVU5DVElPTl9UT0tFTiAqLzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY29uc3VtZUZ1bmN0aW9uKHRva2VuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0b2tlbjtcbiAgICAgICAgfTtcbiAgICAgICAgUGFyc2VyLnByb3RvdHlwZS5jb25zdW1lU2ltcGxlQmxvY2sgPSBmdW5jdGlvbiAodHlwZSkge1xuICAgICAgICAgICAgdmFyIGJsb2NrID0geyB0eXBlOiB0eXBlLCB2YWx1ZXM6IFtdIH07XG4gICAgICAgICAgICB2YXIgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMzIgLyogRU9GX1RPS0VOICovIHx8IGlzRW5kaW5nVG9rZW5Gb3IodG9rZW4sIHR5cGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBibG9jaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5yZWNvbnN1bWVUb2tlbih0b2tlbik7XG4gICAgICAgICAgICAgICAgYmxvY2sudmFsdWVzLnB1c2godGhpcy5jb25zdW1lQ29tcG9uZW50VmFsdWUoKSk7XG4gICAgICAgICAgICAgICAgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBQYXJzZXIucHJvdG90eXBlLmNvbnN1bWVGdW5jdGlvbiA9IGZ1bmN0aW9uIChmdW5jdGlvblRva2VuKSB7XG4gICAgICAgICAgICB2YXIgY3NzRnVuY3Rpb24gPSB7XG4gICAgICAgICAgICAgICAgbmFtZTogZnVuY3Rpb25Ub2tlbi52YWx1ZSxcbiAgICAgICAgICAgICAgICB2YWx1ZXM6IFtdLFxuICAgICAgICAgICAgICAgIHR5cGU6IDE4IC8qIEZVTkNUSU9OICovXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgdG9rZW4gPSB0aGlzLmNvbnN1bWVUb2tlbigpO1xuICAgICAgICAgICAgICAgIGlmICh0b2tlbi50eXBlID09PSAzMiAvKiBFT0ZfVE9LRU4gKi8gfHwgdG9rZW4udHlwZSA9PT0gMyAvKiBSSUdIVF9QQVJFTlRIRVNJU19UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3NzRnVuY3Rpb247XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRoaXMucmVjb25zdW1lVG9rZW4odG9rZW4pO1xuICAgICAgICAgICAgICAgIGNzc0Z1bmN0aW9uLnZhbHVlcy5wdXNoKHRoaXMuY29uc3VtZUNvbXBvbmVudFZhbHVlKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBQYXJzZXIucHJvdG90eXBlLmNvbnN1bWVUb2tlbiA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciB0b2tlbiA9IHRoaXMuX3Rva2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0VfVE9LRU4gKi87IH07XG4gICAgdmFyIG5vbkZ1bmN0aW9uQXJnU2VwYXJhdG9yID0gZnVuY3Rpb24gKHRva2VuKSB7XG4gICAgICAgIHJldHVybiB0b2tlbi50eXBlICE9PSAzMSAvKiBXSElURVNQQUNFX1RPS0VOICovICYmIHRva2VuLnR5cGUgIT09IDQgLyogQ09NTUFfVE9LRU4gKi87XG4gICAgfTtcbiAgICB2YXIgcGFyc2VGdW5jdGlvbkFyZ3MgPSBmdW5jdGlvbiAodG9rZW5zKSB7XG4gICAgICAgIHZhciBhcmdzID0gW107XG4gICAgICAgIHZhciBhcmcgPSBbXTtcbiAgICAgICAgdG9rZW5zLmZvckVhY2goZnVuY3Rpb24gKHRva2VuKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gNCAvKiBDT01NQV9UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgIGlmIChhcmcubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVycm9yIHBhcnNpbmcgZnVuY3Rpb24gYXJncywgemVybyB0b2tlbnMgZm9yIGFyZ1wiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYXJncy5wdXNoKGFyZyk7XG4gICAgICAgICAgICAgICAgYXJnID0gW107XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRva2VuLnR5cGUgIT09IDMxIC8qIFdISVRFU1BBQ0VfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICBhcmcucHVzaCh0b2tlbik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICBpZiAoYXJnLmxlbmd0aCkge1xuICAgICAgICAgICAgYXJncy5wdXNoKGFyZyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGFyZ3M7XG4gICAgfTtcbiAgICB2YXIgaXNFbmRpbmdUb2tlbkZ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Rva2Vuc1sxXV0gOiBbdG9rZW5zWzBdXTtcbiAgICB9O1xuICAgIHZhciBaRVJPX0xFTkdUSCA9IHtcbiAgICAgICAgdHlwZTogMTcgLyogTlVNQkVSX1RPS0VOICovLFxuICAgICAgICBudW1iZXI6IDAsXG4gICAgICAgIGZsYWdzOiBGTEFHX0lOVEVHRVJcbiAgICB9O1xuICAgIHZhciBGSUZUWV9QRVJDRU5UID0ge1xuICAgICAgICB0eXBlOiAxNiAvKiBQRVJDRU5UQUdFX1RPS0VOICovLFxuICAgICAgICBudW1iZXI6IDUwLFxuICAgICAgICBmbGFnczogRkxBR19JTlRFR0VSXG4gICAgfTtcbiAgICB2YXIgSFVORFJFRF9QRVJDRU5UID0ge1xuICAgICAgICB0eXBlOiAxNiAvKiBQRVJDRU5UQUdFX1RPS0VOICovLFxuICAgICAgICBudW1iZXI6IDEwMCxcbiAgICAgICAgZmxhZ3M6IEZMQUdfSU5URUdFUlxuICAgIH07XG4gICAgdmFyIGdldEFic29sdXRlVmFsdWVGb3JUdXBsZSA9IGZ1bmN0aW9uICh0dXBsZSwgd2lkdGgsIGhlaWdodCkge1xuICAgICAgICB2YXIgeCA9IHR1cGxlWzBdLCB5ID0gdHVwbGVbMV07XG4gICAgICAgIHJldHVybiBbZ2V0QWJzb2x1dGVWYWx1ZSh4LCB3aWR0aCksIGdldEFic29sdXRlVmFsdWUodHlwZW9mIHkgIT09ICd1bmRlZmluZWQnID8geSA6IHgsIGhlaWdodCldO1xuICAgIH07XG4gICAgdmFyIGdldEFic29sdXRlVmFsdWUgPSBmdW5jdGlvbiAodG9rZW4sIHBhcmVudCkge1xuICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMTYgLyogUEVSQ0VOVEFHRV9UT0tFTiAqLykge1xuICAgICAgICAgICAgcmV0dXJuICh0b2tlbi5udW1iZXIgLyAxMDApICogcGFyZW50O1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0RpbWVuc2lvblRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgc3dpdGNoICh0b2tlbi51bml0KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAncmVtJzpcbiAgICAgICAgICAgICAgICBjYXNlICdlbSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxNiAqIHRva2VuLm51bWJlcjsgLy8gVE9ETyB1c2UgY29ycmVjdCBmb250LXNpemVcbiAgICAgICAgICAgICAgICBjYXNlICdweCc6XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRva2VuLm51bWJlcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdG9rZW4ubnVtYmVyO1xuICAgIH07XG5cbiAgICB2YXIgREVHID0gJ2RlZyc7XG4gICAgdmFyIEdSQUQgPSAnZ3JhZCc7XG4gICAgdmFyIFJBRCA9ICdyYWQnO1xuICAgIHZhciBUVVJOID0gJ3R1cm4nO1xuICAgIHZhciBhbmdsZSA9IHtcbiAgICAgICAgbmFtZTogJ2FuZ2xlJyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh2YWx1ZS50eXBlID09PSAxNSAvKiBESU1FTlNJT05fVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHZhbHVlLnVuaXQpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSBERUc6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKE1hdGguUEkgKiB2YWx1ZS5udW1iZXIpIC8gMTgwO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIEdSQUQ6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKE1hdGguUEkgLyAyMDApICogdmFsdWUubnVtYmVyO1xuICAgICAgICAgICAgICAgICAgICBjYXNlIFJBRDpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5udW1iZXI7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgVFVSTjpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLlBJICogMiAqIHZhbHVlLm51bWJlcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbnN1cHBvcnRlZCBhbmdsZSB0eXBlXCIpO1xuICAgICAgICB9XG4gICAgfTtcbiAgICB2YXIgaXNBbmdsZSA9IGZ1bmN0aW9uICh2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMTUgLyogRElNRU5TSU9OX1RPS0VOICovKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUudW5pdCA9PT0gREVHIHx8IHZhbHVlLnVuaXQgPT09IEdSQUQgfHwgdmFsdWUudW5pdCA9PT0gUkFEIHx8IHZhbHVlLnVuaXQgPT09IFRVUk4pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfTtcbiAgICB2YXIgcGFyc2VOYW1lZFNpZGUgPSBmdW5jdGlvbiAodG9rZW5zKSB7XG4gICAgICAgIHZhciBzaWRlT3JDb3JuZXIgPSB0b2tlbnNcbiAgICAgICAgICAgIC5maWx0ZXIoaXNJZGVudFRva2VuKVxuICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAoaWRlbnQpIHsgcmV0dXJuIGlkZW50LnZhbHVlOyB9KVxuICAgICAgICAgICAgLmpvaW4oJyAnKTtcbiAgICAgICAgc3dpdGNoIChzaWRlT3JDb3JuZXIpIHtcbiAgICAgICAgICAgIGNhc2UgJ3RvIGJvdHRvbSByaWdodCc6XG4gICAgICAgICAgICBjYXNlICd0byByaWdodCBib3R0b20nOlxuICAgICAgICAgICAgY2FzZSAnbGVmdCB0b3AnOlxuICAgICAgICAgICAgY2FzZSAndG9wIGxlZnQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBbWkVST19MRU5HVEgsIFpFUk9fTEVOR1RIXTtcbiAgICAgICAgICAgIGNhc2UgJ3RvIHRvcCc6XG4gICAgICAgICAgICBjYXNlICdib3R0b20nOlxuICAgICAgICAgICAgICAgIHJldHVybiBkZWcoMCk7XG4gICAgICAgICAgICBjYXNlICd0byBib3R0b20gbGVmdCc6XG4gICAgICAgICAgICBjYXNlICd0byBsZWZ0IGJvdHRvbSc6XG4gICAgICAgICAgICBjYXNlICdyaWdodCB0b3AnOlxuICAgICAgICAgICAgY2FzZSAndG9wIHJpZ2h0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gW1pFUk9fTEVOR1RILCBIVU5EUkVEX1BFUkNFTlRdO1xuICAgICAgICAgICAgY2FzZSAndG8gcmlnaHQnOlxuICAgICAgICAgICAgY2FzZSAnbGVmdCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRlZyg5MCk7XG4gICAgICAgICAgICBjYXNlICd0byB0b3AgbGVmdCc6XG4gICAgICAgICAgICBjYXNlICd0byBsZWZ0IHRvcCc6XG4gICAgICAgICAgICBjYXNlICdyaWdodCBib3R0b20nOlxuICAgICAgICAgICAgY2FzZSAnYm90dG9tIHJpZ2h0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gW0hVTkRSRURfUEVSQ0VOVCwgSFVORFJFRF9QRVJDRU5UXTtcbiAgICAgICAgICAgIGNhc2UgJ3RvIGJvdHRvbSc6XG4gICAgICAgICAgICBjYXNlICd0b3AnOlxuICAgICAgICAgICAgICAgIHJldHVybiBkZWcoMTgwKTtcbiAgICAgICAgICAgIGNhc2UgJ3RvIHRvcCByaWdodCc6XG4gICAgICAgICAgICBjYXNlICd0byByaWdodCB0b3AnOlxuICAgICAgICAgICAgY2FzZSAnbGVmdCBib3R0b20nOlxuICAgICAgICAgICAgY2FzZSAnYm90dG9tIGxlZnQnOlxuICAgICAgICAgICAgICAgIHJldHVybiBbSFVORFJFRF9QRVJDRU5ULCBaRVJPX0xFTkdUSF07XG4gICAgICAgICAgICBjYXNlICd0byBsZWZ0JzpcbiAgICAgICAgICAgIGNhc2UgJ3JpZ2h0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gZGVnKDI3MCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIDA7XG4gICAgfTtcbiAgICB2YXIgZGVnID0gZnVuY3Rpb24gKGRlZykgeyByZXR1cm4gKE1hdGguUEkgKiBkZWcpIC8gMTgwOyB9O1xuXG4gICAgdmFyIGNvbG9yJDEgPSB7XG4gICAgICAgIG5hbWU6ICdjb2xvcicsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoY29udGV4dCwgdmFsdWUpIHtcbiAgICAgICAgICAgIGlmICh2YWx1ZS50eXBlID09PSAxOCAvKiBGVU5DVElPTiAqLykge1xuICAgICAgICAgICAgICAgIHZhciBjb2xvckZ1bmN0aW9uID0gU1VQUE9SVEVEX0NPTE9SX0ZVTkNUSU9OU1t2YWx1ZS5uYW1lXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvbG9yRnVuY3Rpb24gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkF0dGVtcHRpbmcgdG8gcGFyc2UgYW4gdW5zdXBwb3J0ZWQgY29sb3IgZnVuY3Rpb24gXFxcIlwiICsgdmFsdWUubmFtZSArIFwiXFxcIlwiKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yRnVuY3Rpb24oY29udGV4dCwgdmFsdWUudmFsdWVzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh2YWx1ZS50eXBlID09PSA1IC8qIEhBU0hfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUudmFsdWUubGVuZ3RoID09PSAzKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByID0gdmFsdWUudmFsdWUuc3Vic3RyaW5nKDAsIDEpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZyA9IHZhbHVlLnZhbHVlLnN1YnN0cmluZygxLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGIgPSB2YWx1ZS52YWx1ZS5zdWJzdHJpbmcoMiwgMyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwYWNrKHBhcnNlSW50KHIgKyByLCAxNiksIHBhcnNlSW50KGcgKyBnLCAxNiksIHBhcnNlSW50KGIgKyBiLCAxNiksIDEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodmFsdWUudmFsdWUubGVuZ3RoID09PSA0KSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByID0gdmFsdWUudmFsdWUuc3Vic3RyaW5nKDAsIDEpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgZyA9IHZhbHVlLnZhbHVlLnN1YnN0cmluZygxLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGIgPSB2YWx1ZS52YWx1ZS5zdWJzdHJpbmcoMiwgMyk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhID0gdmFsdWUudmFsdWUuc3Vic3RyaW5nKDMsIDQpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFjayhwYXJzZUludChyICsgciwgMTYpLCBwYXJzZUludChnICsgZywgMTYpLCBwYXJzZUludChiICsgYiwgMTYpLCBwYXJzZUludChhICsgYSwgMTYpIC8gMjU1KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlLnZhbHVlLmxlbmd0aCA9PT0gNikge1xuICAgICAgICAgICAgICAgICAgICB2YXIgciA9IHZhbHVlLnZhbHVlLnN1YnN0cmluZygwLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGcgPSB2YWx1ZS52YWx1ZS5zdWJzdHJpbmcoMiwgNCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiID0gdmFsdWUudmFsdWUuc3Vic3RyaW5nKDQsIDYpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFjayhwYXJzZUludChyLCAxNiksIHBhcnNlSW50KGcsIDE2KSwgcGFyc2VJbnQoYiwgMTYpLCAxKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHZhbHVlLnZhbHVlLmxlbmd0aCA9PT0gOCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgciA9IHZhbHVlLnZhbHVlLnN1YnN0cmluZygwLCAyKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGcgPSB2YWx1ZS52YWx1ZS5zdWJzdHJpbmcoMiwgNCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBiID0gdmFsdWUudmFsdWUuc3Vic3RyaW5nKDQsIDYpO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IHZhbHVlLnZhbHVlLnN1YnN0cmluZyg2LCA4KTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhY2socGFyc2VJbnQociwgMTYpLCBwYXJzZUludChnLCAxNiksIHBhcnNlSW50KGIsIDE2KSwgcGFyc2VJbnQoYSwgMTYpIC8gMjU1KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICB2YXIgbmFtZWRDb2xvciA9IENPTE9SU1t2YWx1ZS52YWx1ZS50b1VwcGVyQ2FzZSgpXTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG5hbWVkQ29sb3IgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuYW1lZENvbG9yO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBDT0xPUlMuVFJBTlNQQV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heCA9IGkgPT09IDMgPyAxIDogMjU1O1xuICAgICAgICAgICAgcmV0dXJuIGkgPT09IDMgPyAodG9rZW4ubnVtYmVyIC8gMTAwKSAqIG1heCA6IE1hdGgucm91bmQoKHRva2VuLm51bWJlciAvIDEwMCkgKiBtYXgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAwO1xuICAgIH07XG4gICAgdmFyIHJnYiA9IGZ1bmN0aW9uIChfY29udGV4dCwgYXJncykge1xuICAgICAgICB2YXIgdG9rZW5zID0gYXJncy5maWx0ZXIobm9uRnVuY3Rpb25BcmdTZXBhcmF0b3IpO1xuICAgICAgICBpZiAodG9rZW5zLmxlbmd0aCA9PT0gMykge1xuICAgICAgICAgICAgdmFyIF9hID0gdG9rZW5zLm1hcChnZXRUb2tlbkNvbG9yVmFsdWUpLCByID0gX2FbMF0sIGcgPSBfYVsxXSwgYiA9IF9hWzJdO1xuICAgICAgICAgICAgcmV0dXJuIHBhY2sociwgZywgYiwgMSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHRva2Vucy5sZW5ndGggPT09IDQpIHtcbiAgICAgICAgICAgIHZhciBfYiA9IHRva2Vucy5tYXAoZ2V0VG9rZW5Db2xvclZhbHVlKSwgciA9IF9iWzBdLCBnID0gX2JbMV0sIGIgPSBfYlsyXSwgYSA9IF9iWzNdO1xuICAgICAgICAgICAgcmV0dXJuIHBhY2sociwgZywgYiwgYSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIDA7XG4gICAgfTtcbiAgICBmdW5jdGlvbiBodWUycmdiKHQxLCB0MiwgaHVlKSB7XG4gICAgICAgIGlmIChodWUgPCAwKSB7XG4gICAgICAgICAgICBodWUgKz0gMTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaHVlID49IDEpIHtcbiAgICAgICAgICAgIGh1ZSAtPSAxO1xuICAgICAgICB9XG4gICAgICAgIGlmIChodWUgPCAxIC8gNikge1xuICAgICAgICAgICAgcmV0dXJuICh0MiAtIHQxK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lKGFscGhhLCAxKSA6IDE7XG4gICAgICAgIGlmIChzID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gcGFjayhsICogMjU1LCBsICogMjU1LCBsICogMjU1LCAxKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgdDIgPSBsIDw9IDAuNSA/IGwgKiAocyArIDEpIDogbCArIHMgLSBsICogcztcbiAgICAgICAgdmFyIHQxID0gbCAqIDIgLSB0MjtcbiAgICAgICAgdmFyIHIgPSBodWUycmdiKHQxLCB0MiwgaCArIDEgLyAzKTtcbiAgICAgICAgdmFyIGcgPSBodWUycmdiKHQxLCB0MiwgaCk7XG4gICAgICAgIHZhciBiID0gaHVlMnJnYih0MSwgdDIsIGggLSAxIC8gMyk7XG4gICAgICAgIHJldHVybiBwYWNrKHIgKiAyNTUsIGcgKiAyNTUsIGIgKiAyNTUsIGEpO1xuICAgIH07XG4gICAgdmFyIFNVUFBPUlRFRF9DT0xPUl9GVU5DVElPTlMgPSB7XG4gICAgICAgIGhzbDogaHNsLFxuICAgICAgICBoc2xhOiBoc2wsXG4gICAgICAgIHJnYjogcmdiLFxuICAgICAgICByZ2JhOiByZ2JcbiAgICB9O1xuICAgIHZhciBwYXJzZUNvbG9yID0gZnVuY3Rpb24gKGNvbnRleHQsIHZhbHVlKSB7XG4gICAgICAgIHJldHVybiBjb2xvciQxLnBhcnNlKGNvbnRleHQsIFBhcnNlci5jcmVhdGUodmFsdWUpLnBhcnNlQ29tcG9uZW50VmFsdWUoKSk7XG4gICAgfTtcbiAgICB2YXIgQ09MT1JTID0ge1xuICAgICAgICBBTElDRUJMVUU6IDB4ZjBmOGZmZmYsXG4gICAgICAgIEFOVElRVUVXSElURTogMHhmYWViZDdmZixcbiAgICAgICAgQVFVQTogMHgwMGZmZmZmZixcbiAgICAgICAgQVFVQU1BUklORTogMHg3ZmZmZDRmZixcbiAgICAgICAgQVpVUkU6IDB4ZjBmZmZmZmYsXG4gICAgICAgIEJFSUdFOiAweGY1ZjVkY2ZmLFxuICAgICAgICBCSVNRVUU6IDB4ZmZlNGM0ZmYsXG4gICAgICAgIEJMQUNLOiAweDAwMDAwMGZmLFxuICAgICAgICBCTEFOQ0hFREFMTU9ORDogMHhmZmViY2RmZixcbiAgICAgICAgQkxVRTogMHgwMDAwZmZmZixcbiAgICAgICAgQkxVRVZJT0xFVDogMHg4YTJiZTJmZixcbiAgICAgICAgQlJPV046IDB4YTUyYTJhZmYsXG4gICAgICAgIEJVUkxZV09PRDogMHhkZWI4ODdmZixcbiAgICAgICAgQ0FERVRCTFVFOiAweDVmOWVhMGZmLFxuICAgICAgICBDSEFSVFJFVVNFOiAweDdmZmYwMGZmLFxuICAgICAgICBDSE9DT0xBVEU6IDB4ZDI2OTFlZmYsXG4gICAgICAgIENPUkFMOiAweGZmN2Y1MGZmLFxuICAgICAgICBDT1JORkxPV0VSQkxVRTogMHg2NDk1ZWRmZixcbiAgICAgICAgQ09STlNJTEs6IDB4ZmZmOGRjZmYsXG4gICAgICAgIENSSU1TT046IDB4ZGMxNDNjZmYsXG4gICAgICAgIENZQU46IDB4MDBmZmZmZmYsXG4gICAgICAgIERBUktCTFVFOiAweDAwMDA4YmZmLFxuICAgICAgICBEQVJLQ1lBTjogMHgwMDhiOGJmZixcbiAgICAgICAgREFSS0dPTERFTlJPRDogMHhiODg2YmJmZixcbiAgICAgICAgREFSS0dSQVk6IDB4YTlhOWE5ZmYsXG4gICAgICAgIERBUktHUkVFTjogMHgwMDY0MDBmZixcbiAgICAgICAgREFSS0dSRVk6IDB4YTlhOWE5ZmYsXG4gICAgICAgIERBUktLSEFLSTogMHhiZGI3NmJmZixcbiAgICAgICAgREFSS01BR0VOVEE6IDB4OGIwMDhiZmYsXG4gICAgICAgIERBUktPTElWRUdSRUVOOiAweDU1NmIyZmZmLFxuICAgICAgICBEQVJLT1JBTkdFOiAweGZmOGMwMGZmLFxuICAgICAgICBEQVJLT1JDSElEOiAweDk5MzJjY2ZmLFxuICAgICAgICBEQVJLUkVEOiAweDhiMDAwMGZmLFxuICAgICAgICBEQVJLU0FMTU9OOiAweGU5OTY3YWZmLFxuICAgICAgICBEQVJLU0VBR1JFRU46IDB4OGZiYzhmZmYsXG4gICAgICAgIERBUktTTEFURUJMVUU6IDB4NDgzZDhiZmYsXG4gICAgICAgIERBUktTTEFURUdSQVk6IDB4MmY0ZjRmZmYsXG4gICAgICAgIERBUktTTEFURUdSRVk6IDB4MmY0ZjRmZmYsXG4gICAgICAgIERBUktUVVJRVU9JU0U6IDB4MDBjZWQxZmYsXG4gICAgICAgIERBUktWSU9MRVQ6IDB4OTQwMGQzZmYsXG4gICAgICAgIERFRVBQSU5LOiAweGZmMTQ5M2ZmLFxuICAgICAgICBERUVQU0tZQkxVRTogMHgwMGJmZmZmZixcbiAgICAgICAgRElNR1JBWTogMHg2OTY5NjlmZixcbiAgICAgICAgRElNR1JFWTogMHg2OTY5NjlmZixcbiAgICAgICAgRE9ER0VSQkxVRTogMHgxZTkwZmZmZixcbiAgICAgICAgRklSRUJSSUNLOiAweGIyMjIyMmZmLFxuICAgICAgICBGTE9SQUxXSElURTogMHhmZmZhZjBmZixcbiAgICAgICAgRk9SRVNUR1JFRU46IDB4MjI4YjIyZmYsXG4gICAgICAgIEZVQ0hTSUE6IDB4ZmYwMGZmZmYsXG4gICAgICAgIEdBSU5TQk9STzogMHhkY2RjZGNmZixcbiAgICAgICAgR0hPU1RXSElURTogMHhmOGY4ZmZmZixcbiAgICAgICAgR09MRDogMHhmZmQ3MDBmZixcbiAgICAgICAgR09MREVOUk9EOiAweGRhYTUyMGZmLFxuICAgICAgICBHUkFZOiAweDgwODA4MGZmLFxuICAgICAgICBHUkVFTjogMHgwMDgwMDBmZixcbiAgICAgICAgR1JFRU5ZRUxMT1c6IDB4YWRmZjJmZmYsXG4gICAgICAgIEdSRVk6IDB4ODA4MDgwZmYsXG4gICAgICAgIEhPTkVZREVXOiAweGYwZmZmMGZmLFxuICAgICAgICBIT1RQSU5LOiAweGZmNjliNGZmLFxuICAg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GZmLFxuICAgICAgICBUQU46IDB4ZDJiNDhjZmYsXG4gICAgICAgIFRFQUw6IDB4MDA4MDgwZmYsXG4gICAgICAgIFRISVNUTEU6IDB4ZDhiZmQ4ZmYsXG4gICAgICAgIFRPTUFUTzogMHhmZjYzNDdmZixcbiAgICAgICAgVFJBTlNQQVJFTlQ6IDB4MDAwMDAwMDAsXG4gICAgICAgIFRVUlFVT0lTRTogMHg0MGUwZDBmZixcbiAgICAgICAgVklPTEVUOiAweGVlODJlZWZmLFxuICAgICAgICBXSEVBVDogMHhmNWRlYjNmZixcbiAgICAgICAgV0hJVEU6IDB4ZmZmZmZmZmYsXG4gICAgICAgIFdISVRFU01PS0U6IDB4ZjVmNWY1ZmYsXG4gICAgICAgIFlFTExPVzogMHhmZmZmMDBmZixcbiAgICAgICAgWUVMTE9XR1JFRU46IDB4OWFjZDMyZmZcbiAgICB9O1xuXG4gICAgdmFyIGJhY2tncm91bmRDbGlwID0ge1xuICAgICAgICBuYW1lOiAnYmFja2dyb3VuZC1jbGlwJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnYm9yZGVyLWJveCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDEgLyogTElTVCAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5zLm1hcChmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNJZGVudFRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwYWRkaW5nLWJveCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEgLyogUEFERElOR19CT1ggKi87XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjb250ZW50LWJveCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIgLyogQ09OVEVOVF9CT1ggKi87XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogQk9SREVSX0JPWCAqLztcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBiYWNrZ3JvdW5kQ29sb3IgPSB7XG4gICAgICAgIG5hbWU6IFwiYmFja2dyb3VuZC1jb2xvclwiLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDMgLyogVFlQRV9WQUxVRSAqLyxcbiAgICAgICAgZm9ybWF0OiAnY29sb3InXG4gICAgfTtcblxuICAgIHZhciBwYXJzZUNvbG9yU3RvcCA9IGZ1bmN0aW9uIChjb250ZXh0LCBhcmdzKSB7XG4gICAgICAgIHZhciBjb2xvciA9IGNvbG9yJDEucGFyc2UoY29udGV4dCwgYXJnc1swXSk7XG4gICAgICAgIHZhciBzdG9wID0gYXJnc1sxXTtcbiAgICAgICAgcmV0dXJuIHN0b3AgJiYgaXNMZW5ndGhQZXJjZW50YWdlKHN0b3ApID8geyBjb2xvcjogY29sb3IsIHN0b3A6IHN0b3AgfSA6IHsgY29sb3I6IGNvbG9yLCBzdG9wOiBudWxsIH07XG4gICAgfTtcbiAgICB2YXIgcHJvY2Vzc0NvbG9yU3RvcHMgPSBmdW5jdGlvbiAoc3RvcHMsIGxpbmVMZW5ndGgpIHtcbiAgICAgICAgdmFyIGZpcnN0ID0gc3RvcHNbMF07XG4gICAgICAgIHZhciBsYXN0ID0gc3RvcHNbc3RvcHMubGVuZ3RoIC0gMV07XG4gICAgICAgIGlmIChmaXJzdC5zdG9wID09PSBudWxsKSB7XG4gICAgICAgICAgICBmaXJzdC5zdG9wID0gWkVST19MRU5HVEg7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxhc3Quc3RvcCA9PT0gbnVsbCkge1xuICAgICAgICAgICAgbGFzdC5zdG9wID0gSFVORFJFRF9QRVJDRU5UO1xuICAgICAgICB9XG4gICAgICAgIHZhciBwcm9jZXNzU3RvcHMgPSBbXTtcbiAgICAgICAgdmFyIHByZXZpb3VzID0gMDtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdG9wcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgdmFyIHN0b3BfMSA9IHN0b3BzW2ldLnN0b3A7XG4gICAgICAgICAgICBpZiAoc3RvcF8xICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgdmFyIGFic29sdXRlVmFsdWUgPSBnZXRBYnNvbHV0ZVZhbHVlKHN0b3BfMSwgbGluZUxlbmd0aCk7XG4gICAgICAgICAgICAgICAgaWYgKGFic29sdXRlVmFsdWUgPiBwcmV2aW91cykge1xuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzU3RvcHMucHVzaChhYnNvbHV0ZVZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHByb2Nlc3NTdG9wcy5wdXNoKHByZXZpb3VzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcHJldmlvdXMgPSBhYnNvbHV0ZVZhbHVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcHJvY2Vzc1N0b3BzLnB1c2gobnVsbCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGdhcEJlZ2luID0gbnVsbDtcbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwcm9jZXNzU3RvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBzdG9wXzIgPSBwcm9jZXNzU3RvcHNbaV07XG4gICAgICAgICAgICBpZiAoc3RvcF8yID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgaWYgKGdhcEJlZ2luID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGdhcEJlZ2luID0gaTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmIChnYXBCZWdpbiAhPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHZhciBnYXBMZW5ndGggPSBpIC0gZ2FwQmVnaW47XG4gICAgICAgICAgICAgICAgdmFyIGJlZm9yZUdhcCA9IHByb2Nlc3NTdG9wc1tnYXBCZWdpbiAtIDFdO1xuICAgICAgICAgICAgICAgIHZhciBnYXBWYWx1ZSA9IChzdG9wXzIgLSBiZWZvcmVHYXApIC8gKGdhcExlbmd0aCArIDEpO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGcgPSAxOyBnIDw9IGdhcExlbmd0aDsgZysrKSB7XG4gICAgICAgICAgICAgICAgICAgIHByb2Nlc3NTdG9wc1tnYXBCZWdpbiArIGcgLSAxXSA9IGdhcFZhbHVlICogZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZ2FwQmVnaW4gPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdG9wcy5tYXAoZnVuY3Rpb24gKF9hLCBpKSB7XG4gICAgICAgICAgICB2YXIgY29sb3IgPSBfYS5jb2xvcjtcbiAgICAgICAgICAgIHJldHVybiB7IGNvbG9yOiBjb2xvciwgc3RvcDogTWF0aC5tYXgoTWF0aC5taW4oMSwgcHJvY2Vzc1N0b3BzW2ldIC8gbGluZUxlbmd0aCksIDApIH07XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgdmFyIGdldEFuZ2xlRnJvbUNvcm5lciA9IGZ1bmN0aW9uIChjb3JuZXIsIHdpZHRoLCBoZWlnaHQpIHtcbiAgICAgICAgdmFyIGNlbnRlclggPSB3aWR0aCAvI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CArIHhEaWZmLCBoYWxmSGVpZ2h0IC0geURpZmYsIGhhbGZIZWlnaHQgKyB5RGlmZl07XG4gICAgfTtcbiAgICB2YXIgZGlzdGFuY2UgPSBmdW5jdGlvbiAoYSwgYikgeyByZXR1cm4gTWF0aC5zcXJ0KGEgKiBhICsgYiAqIGIpOyB9O1xuICAgIHZhciBmaW5kQ29ybmVyID0gZnVuY3Rpb24gKHdpZHRoLCBoZWlnaHQsIHgsIHksIGNsb3Nlc3QpIHtcbiAgICAgICAgdmFyIGNvcm5lcnMgPSBbXG4gICAgICAgICAgICBbMCwgMF0sXG4gICAgICAgICAgICBbMCwgaGVpZ2h0XSxcbiAgICAgICAgICAgIFt3aWR0aCwgMF0sXG4gICAgICAgICAgICBbd2lkdGgsIGhlaWdodF1cbiAgICAgICAgXTtcbiAgICAgICAgcmV0dXJuIGNvcm5lcnMucmVkdWNlKGZ1bmN0aW9uIChzdGF0LCBjb3JuZXIpIHtcbiAgICAgICAgICAgIHZhciBjeCA9IGNvcm5lclswXSwgY3kgPSBjb3JuZXJbMV07XG4gICAgICAgICAgICB2YXIgZCA9IGRpc3RhbmNlKHggLSBjeCwgeSAtIGN5KTtcbiAgICAgICAgICAgIGlmIChjbG9zZXN0ID8gZCA8IHN0YXQub3B0aW11bURpc3RhbmNlIDogZCA+IHN0YXQub3B0aW11bURpc3RhbmNlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgb3B0aW11bUNvcm5lcjogY29ybmVyLFxuICAgICAgICAgICAgICAgICAgICBvcHRpbXVtRGlzdGFuY2U6IGRcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHN0YXQ7XG4gICAgICAgIH0sIHtcbiAgICAgICAgICAgIG9wdGltdW1EaXN0YW5jZTogY2xvc2VzdCA/IEluZmluaXR5IDogLUluZmluaXR5LFxuICAgICAgICAgICAgb3B0aW11bUNvcm5lcjogbnV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ZWlnaHQpKSAvIE1hdGgubWluKE1hdGguYWJzKHgpLCBNYXRoLmFicyh4IC0gd2lkdGgpKTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIF9hID0gZmluZENvcm5lcih3aWR0aCwgaGVpZ2h0LCB4LCB5LCB0cnVlKSwgY3ggPSBfYVswXSwgY3kgPSBfYVsxXTtcbiAgICAgICAgICAgICAgICAgICAgcnggPSBkaXN0YW5jZShjeCAtIHgsIChjeSAtIHkpIC8gYyk7XG4gICAgICAgICAgICAgICAgICAgIHJ5ID0gYyAqIHJ4O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgMSAvKiBGQVJUSEVTVF9TSURFICovOlxuICAgICAgICAgICAgICAgIC8vIFNhbWUgYXMgY2xvc2VzdC1zaWRlLCBleGNlcHQgdGhlIGVuZGluZyBzaGFwZSBpcyBzaXplZCBiYXNlZCBvbiB0aGUgZmFydGhlc3Qgc2lkZShzKVxuICAgICAgICAgICAgICAgIGlmIChncmFkaWVudC5zaGFwZSA9PT0gMCAvKiBDSVJDTEUgKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgcnggPSByeSA9IE1hdGgubWF4KE1hdGguYWJzKHgpLCBNYXRoLmFicyh4IC0gd2lkdGgpLCBNYXRoLmFicyh5KSwgTWF0aC5hYnMoeSAtIGhlaWdodCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChncmFkaWVudC5zaGFwZSA9PT0gMSAvKiBFTExJUFNFICovKSB7XG4gICAgICAgICAgICAgICAgICAgIHJ4ID0gTWF0aC5tYXgoTWF0aC5hYnMoeCksIE1hdGguYWJzKHggLSB3aWR0aCkpO1xuICAgICAgICAgICAgICAgICAgICByeSA9IE1hdGgubWF4KE1hdGguYWJzKHkpLCBNYXRoLmFicyh5IC0gaGVpZ2h0KSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJ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Db3JuZXIod2lkdGgsIGhlaWdodCwgeCwgeSwgZmFsc2UpLCBjeCA9IF9iWzBdLCBjeSA9IF9iWzFdO1xuICAgICAgICAgICAgICAgICAgICByeCA9IGRpc3RhbmNlKGN4IC0geCwgKGN5IC0geSkgLyBjKTtcbiAgICAgICAgICAgICAgICAgICAgcnkgPSBjICogcng7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KGdyYWRpZW50LnNpemUpKSB7XG4gICAgICAgICAgICByeCA9IGdldEFic29sdXRlVmFsdWUoZ3JhZGllbnQuc2l6ZVswXSwgd2lkdGgpO1xuICAgICAgICAgICAgcnkgPSBncmFkaWVudC5zaXplLmxlbmd0aCA9PT0gMiA/IGdldEFic29sdXRlVmFsdWUoZ3JhZGllbnQuc2l6ZVsxXSwgaGVpZ2h0KSA6IHJ4O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBbcngsIHJ5XTtcbiAgICB9O1xuXG4gICAgdmFyIGxpbmVhckdyYWRpZW50ID0gZnVuY3Rpb24gKGNvbnRleHQsIHRva2Vucykge1xuICAgICAgICB2YXIgYW5nbGUkMSA9IGRlZygxODApO1xuICAgICAgICB2YXIgc3RvcHMgPSBbXTtcbiAgICAgICAgcGFyc2VGdW5jdGlvbkFyZ3ModG9rZW5zKS5mb3JFYWNoKGZ1bmN0aW9uIChhcmcsIGkpIHtcbiAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0VG9rZW4gPSBhcmdbMF07XG4gICAgICAgICAgICAgICAgaWYgKGZpcnN0VG9rZW4udHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8gJiYgZmlyc3RUb2tlbi52YWx1ZSA9PT0gJ3RvJykge1xuICAgICAgICAgICAgICAgICAgICBhbmdsZSQxID0gcGFyc2VOYW1lZFNpZGUoYXJnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0FuZ2xlKGZpcnN0VG9rZW4pKSB7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlJDEgPSBhbmdsZS5wYXJzZShjb250ZXh0LCBmaXJzdFRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBjb2xvclN0b3AgPSBwYXJzZUNvbG9yU3RvcChjb250ZXh0LCBhcmcpO1xuICAgICAgICAgICAgc3RvcHMucHVzaChjb2xvclN0b3ApO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHsgYW5nbGU6IGFuZ2xlJDEsIHN0b3BzOiBzdG9wcywgdHlwZTogMSAvKiBMSU5FQVJfR1JBRElFTlQgKi8gfTtcbiAgICB9O1xuXG4gICAgdmFyIHByZWZpeExpbmVhckdyYWRpZW50ID0gZnVuY3Rpb24gKGNvbnRleHQsIHRva2Vucykge1xuICAgICAgICB2YXIgYW5nbGUkMSA9IGRlZygxODApO1xuICAgICAgICB2YXIgc3RvcHMgPSBbXTtcbiAgICAgICAgcGFyc2VGdW5jdGlvbkFyZ3ModG9rZW5zKS5mb3JFYWNoKGZ1bmN0aW9uIChhcmcsIGkpIHtcbiAgICAgICAgICAgIGlmIChpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGZpcnN0VG9rZW4gPSBhcmdbMF07XG4gICAgICAgICAgICAgICAgaWYgKGZpcnN0VG9rZW4udHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8gJiZcbiAgICAgICAgICAgICAgICAgICAgWyd0b3AnLCAnbGVmdCcsICdyaWdodCcsICdib3R0b20nXS5pbmRleE9mKGZpcnN0VG9rZW4udmFsdWUpICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBhbmdsZSQxID0gcGFyc2VOYW1lZFNpZGUoYXJnKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0FuZ2xlKGZpcnN0VG9rZW4pKSB7XG4gICAgICAgICAgICAgICAgICAgIGFuZ2xlJDEgPSAoYW5nbGUucGFyc2UoY29udGV4dCwgZmlyc3RUb2tlbikgKyBkZWcoMjcwKSkgJSBkZWcoMzYwKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBjb2xvclN0b3AgPSBwYXJzZUNvbG9yU3RvcChjb250ZXh0LCBhcmcpO1xuICAgICAgICAgICAgc3RvcHMucHVzaChjb2xvclN0b3ApO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGFuZ2xlOiBhbmdsZSQxLFxuICAgICAgICAgICAgc3RvcHM6IHN0b3BzLFxuICAgICAgICAgICAgdHlwZTogMSAvKiBMSU5FQVJfR1JBRElFTlQgKi9cbiAgICAgICAgfTtcbiAgICB9O1xuXG4gICAgdmFyIHdlYmtpdEdyYWRpZW50ID0gZnVuY3Rpb24gKGNvbnRleHQsIHRva2Vucykge1xuICAgICAgICB2YXIgYW5nbGUgPSBkZWcoMTgwKTtcbiAgICAgICAgdmFyIHN0b3BzID0gW107XG4gICAgICAgIHZhciB0eXBlID0gMSAvKiBMSU5FQVJfR1JBRElFTlQgKi87XG4gICAgICAgIHZhciBzaGFwZSA9IDAgLyogQ0lSQ0xFICovO1xuICAgICAgICB2YXIgc2l6ZSA9IDMgLyogRkFSVEhFU1RfQ09STkVSICovO1xuICAgICAgICB2YXIgcG9zaXRpb24gPSBbXTtcbiAgICAgICAgcGFyc2VGdW5jdGlvbkFyZ3ModG9rZW5zKS5mb3JFYWNoKGZ1bmN0aW9uIChhcmcsIGkpIHtcbiAgICAgICAgICAgIHZhciBmaXJzdFRva2VuID0gYXJnWzBdO1xuICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNJZGVudFRva2VuKGZpcnN0VG9rZW4pICYmIGZpcnN0VG9rZW4udmFsdWUgPT09ICdsaW5lYXInKSB7XG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAxIC8qIExJTkVBUl9HUkFESUVOVCAqLztcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0lkZW50VG9rZW4oZmlyc3RUb2tlbikgJiYgZmlyc3RUb2tlbi52YWx1ZSA9PT0gJ3JhZGlhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IDIgLyogUkFESUFMX0dSQURJRU5UICovO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGZpcnN0VG9rZW4udHlwZSA9PT0gMTggLyogRlVOQ1RJT04gKi8pIHtcbiAgICAgICAgICAgICAgICBpZiAoZmlyc3RUb2tlbi5uYW1lID09PSAnZnJvbScpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbG9yID0gY29sb3IkMS5wYXJzZShjb250ZXh0LCBmaXJzdFRva2VuLnZhbHVlc1swXSk7XG4gICAgICAgICAgICAgICAgICAgIHN0b3BzLnB1c2goeyBzdG9wOiBaRVJPX0xFTkdUSCwgY29sb3I6IGNvbG9yIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChmaXJzdFRva2VuLm5hbWUgPT09ICd0bycpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvbG9yID0gY29sb3IkMS5wYXJzZShjb250ZXh0LCBmaXJzdFRva2VuLnZhbHVlc1swXSk7XG4gICAgICAgICAgICAgICAgICAgIHN0b3BzLnB1c2goeyBzdG9wOiBIVU5EUkVEX1BFUkNFTlQsIGNvbG9yOiBjb2xvciB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoZmlyc3RUb2tlbi5uYW1lID09PSAnY29sb3Itc3RvcCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlcyA9IGZpcnN0VG9rZW4udmFsdWVzLmZpbHRlcihub25GdW5jdGlvbkFyZ1NlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZXMubGVuZ3RoID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29sb3IgPSBjb2xvciQxLnBhcnNlKGNvbnRleHQsIHZhbHVlc1sxXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RvcF8xID0gdmFsdWVzWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTnVtYmVyVG9rZW4oc3RvcF8xKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BzLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9wOiB7IHR5cGU6IDE2IC8qIFBFUkNFTlRBR0VfVE9LRU4gKi8sIG51bWJlcjogc3RvcF8xLm51bWJlciAqIDEwMCwgZmxhZ3M6IHN0b3BfMS5mbGFncyB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogY29sb3JcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB0eXBlID09PSAxIC8qIExJTkVBUl9HUkFESUVOVCAqL1xuICAgICAgICAgICAgPyB7XG4gICAgICAgICAgICAgICAgYW5nbGU6IChhbm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NpdGlvbl8xID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaXNDb2xvclN0b3AgPSBhcmcucmVkdWNlKGZ1bmN0aW9uIChhY2MsIHRva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0F0UG9zaXRpb25fMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzSWRlbnRUb2tlbih0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2NlbnRlcic6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbi5wdXNoKEZJRlRZX1BFUkNFTlQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFjYztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndG9wJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGVmdCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbi5wdXNoKFpFUk9fTEVOR1RIKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhY2M7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3JpZ2h0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYm90dG9tJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLnB1c2goSFVORFJFRF9QRVJDRU5UKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhY2M7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNMZW5ndGhQZXJjZW50YWdlKHRva2VuKSB8fCBpc0xlbmd0aCh0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbi5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0lkZW50VG9rZW4odG9rZW4pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDSVJDTEU6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlID0gMCAvKiBDSVJDTEUgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEVMTElQU0U6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlID0gMSAvKiBFTExJUFNFICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYXQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0F0UG9zaXRpb25fMSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENMT1NFU1RfU0lERTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDAgLyogQ0xPU0VTVF9TSURFICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDT1ZFUjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEZBUlRIRVNUX1NJREU6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSAxIC8qIEZBUlRIRVNUX1NJREUgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTlRBSU46XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTE9TRVNUX0NPUk5FUjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDIgLyogQ0xPU0VTVF9DT1JORVIgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEZBUlRIRVNUX0NPUk5FUjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDMgLyogRkFSVEhFU1RfQ09STkVSICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNMZW5ndGgodG9rZW4pIHx8IGlzTGVuZ3RoUGVyY2VudGFnZSh0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghQXJyYXkuaXNBcnJheShzaXplKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHNpemUucHVzaCh0b2tlbik7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFjYztcbiAgICAgICAgICAgICAgICB9LCBpc0NvbG9yU3RvcCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNDb2xvclN0b3ApIHtcbiAgICAgICAgICAgICAgICB2YXIgY29sb3JTdG9wID0gcGFyc2VDb2xvclN0b3AoY29udGV4dCwgYXJnKTtcbiAgICAgICAgICAgICAgICBzdG9wcy5wdXNoKGNvbG9yU3RvcCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4geyBzaXplOiBzaXplLCBzaGFwZTogc2hhcGUsIHN0b3BzOiBzdG9wcywgcG9zaXRpb246IHBvc2l0aW9uLCB0eXBlOiAyIC8qIFJBRElBTF9HUkFESUVOVCAqLyB9O1xuICAgIH07XG5cbiAgICB2YXIgcHJlZml4UmFkaWFsR3JhZGllbnQgPSBmdW5jdGlvbiAoY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgIHZhciBzaGFwZSA9IDAgLyogQ0lSQ0xFICovO1xuICAgICAgICB2YXIgc2l6ZSA9IDMgLyogRkFSVEhFU1RfQ09STkVSICovO1xuICAgICAgICB2YXIgc3RvcHMgPSBbXTtcbiAgICAgICAgdmFyIHBvc2l0aW9uID0gW107XG4gICAgICAgIHBhcnNlRnVuY3Rpb25BcmdzKHRva2VucykuZm9yRWFjaChmdW5jdGlvbiAoYXJnLCBpKSB7XG4gICAgICAgICAgICB2YXIgaXNDb2xvclN0b3AgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKGkgPT09IDApIHtcbiAgICAgICAgICAgICAgICBpc0NvbG9yU3RvcCA9IGFyZy5yZWR1Y2UoZnVuY3Rpb24gKGFjYywgdG9rZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzSWRlbnRUb2tlbih0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAodG9rZW4udmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjZW50ZXInOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbi5wdXNoKEZJRlRZX1BFUkNFTlQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndG9wJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsZWZ0JzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24ucHVzaChaRVJPX0xFTkdUSCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyaWdodCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYm90dG9tJzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24ucHVzaChIVU5EUkVEX1BFUkNFTlQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNMZW5ndGhQZXJjZW50YWdlKHRva2VuKSB8fCBpc0xlbmd0aCh0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uLnB1c2godG9rZW4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhY2M7XG4gICAgICAgICAgICAgICAgfSwgaXNDb2xvclN0b3ApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoaSA9PT0gMSkge1xuICAgICAgICAgICAgICAgIGlzQ29sb3JTdG9wID0gYXJnLnJlZHVjZShmdW5jdGlvbiAoYWNjLCB0b2tlbikge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNJZGVudFRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0b2tlbi52YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ0lSQ0xFOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFwZSA9IDAgLyogQ0lSQ0xFICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBFTExJUFNFOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFwZSA9IDEgLyogRUxMSVBTRSAqLztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgQ09OVEFJTjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENMT1NFU1RfU0lERTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDAgLyogQ0xPU0VTVF9TSURFICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBGQVJUSEVTVF9TSURFOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gMSAvKiBGQVJUSEVTVF9TSURFICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBDTE9TRVNUX0NPUk5FUjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IDIgLyogQ0xPU0VTVF9DT1JORVIgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPVkVSOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRkFSVEhFU1RfQ09STkVSOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplID0gMyAvKiBGQVJUSEVTVF9DT1JORVIgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0xlbmd0aCh0b2tlbikgfHwgaXNMZW5ndGhQZXJjZW50YWdlKHRva2VuKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFBcnJheS5pc0FycmF5KHNpemUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IFtdO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZS5wdXNoKHRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWNjO1xuICAgICAgICAgICAgICAgIH0sIGlzQ29sb3JTdG9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc0NvbG9yU3RvcCkge1xuICAgICAgICAgICAgICAgIHZhciBjb2xvclN0b3AgPSBwYXJzZUNvbG9yU3RvcChjb250ZXh0LCBhcmcpO1xuICAgICAgICAgICAgICAgIHN0b3BzLnB1c2goY29sb3JTdG9wKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiB7IHNpemU6IHNpemUsIHNoYXBlOiBzaGFwZSwgc3RvcHM6IHN0b3BzLCBwb3NpdGlvbjogcG9zaXRpb24sIHR5cGU6IDIgLyogUkFESUFMX0dSQURJRU5UICovIH07XG4gICAgfTtcblxuICAgIHZhciBpc0xpbmVhckdyYWRpZW50ID0gZnVuY3Rpb24gKGJhY2tncm91bmQpIHtcbiAgICAgICAgcmV0dXJuIGJhY2tncm91bmQudHlwZSA9PT0gMSAvKiBMSU5FQVJfR1JBRElFTlQgKi87XG4gICAgfTtcbiAgICB2YXIgaXNSYWRpYWxHcmFkaWVudCA9IGZ1bmN0aW9uIChiYWNrZ3JvdW5kKSB7XG4gICAgICAgIHJldHVybiBiYWNrZ3JvdW5kLnR5cGUgPT09IDIgLyogUkFESUFMX0dSQURJRU5UICovO1xuICAgIH07XG4gICAgdmFyIGltYWdlID0ge1xuICAgICAgICBuYW1lOiAnaW1hZ2UnLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGNvbnRleHQsIHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMjIgLyogVVJMX1RPS0VOICovKSB7XG4gICAgICAgICAgICAgICAgdmFyIGltYWdlXzEgPSB7IHVybDogdmFsdWUudmFsdWUsIHR5cGU6IDAgLyogVVJMICovIH07XG4gICAgICAgICAgICAgICAgY29udGV4dC5jYWNoZS5hZGRJbWFnZSh2YWx1ZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGltYWdlXzE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMTggLyogRlVOQ1RJT04gKi8pIHtcbiAgICAgICAgICAgICAgICB2YXIgaW1hZ2VGdW5jdGlvbiA9IFNVUFBPUlRFRF9JTUFHRV9GVU5DVElPTlNbdmFsdWUubmFtZV07XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpbWFnZUZ1bmN0aW9uID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJBdHRlbXB0aW5nIHRvIHBhcnNlIGFuIHVuc3VwcG9ydGVkIGltYWdlIGZ1bmN0aW9uIFxcXCJcIiArIHZhbHVlLm5hbWUgKyBcIlxcXCJcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBpbWFnZUZ1bmN0aW9uKGNvbnRleHQsIHZhbHVlLnZhbHVlcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbnN1cHBvcnRlZCBpbWFnZSB0eXBlIFwiICsgdmFsdWUudHlwZSk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIGZ1bmN0aW9uIGlzU3VwcG9ydGVkSW1hZ2UodmFsdWUpIHtcbiAgICAgICAgcmV0dXJuICghKHZhbHVlLnR5cGUgPT09IDIwIC8qIElERU5UX1RPS0VOICovICYmIHZhbHVlLnZhbHVlID09PSAnbm9uZScpICYmXG4gICAgICAgICAgICAodmFsdWUudHlwZSAhPT0gMTggLyogRlVOQ1RJT04gKi8gfHwgISFTVVBQT1JURURfSU1BR0VfRlVOQ1RJT05TW3ZhbHVlLm5hbWVdKSk7XG4gICAgfVxuICAgIHZhciBTVVBQT1JURURfSU1BR0VfRlVOQ1RJT05TID0ge1xuICAgICAgICAnbGluZWFyLWdyYWRpZW50JzogbGluZWFyR3JhZGllbnQsXG4gICAgICAgICctbW96LWxpbmVhci1ncmFkaWVudCc6IHByZWZpeExpbmVhckdyYWRpZW50LFxuICAgICAgICAnLW1zLWxpbmVhci1ncmFkaWVudCc6IHByZWZpeExpbmVhckdyYWRpZW50LFxuICAgICAgICAnLW8tbGluZWFyLWdyYWRpZW50JzogcHJlZml4TGluZWFyR3JhZGllbnQsXG4gICAgICAgICctd2Via2l0LWxpbmVhci1ncmFkaWVudCc6IHByZWZpeExpbmVhckdyYWRpZW50LFxuICAgICAgICAncmFkaWFsLWdyYWRpZW50JzogcmFkaWFsR3JhZGllbnQsXG4gICAgICAgICctbW96LXJhZGlhbC1ncmFkaWVudCc6IHByZWZpeFJhZGlhbEdyYWRpZW50LFxuICAgICAgICAnLW1zLXJhZGlhbC1ncmFkaWVudCc6IHByZW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ICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgYmFja2dyb3VuZE9yaWdpbiA9IHtcbiAgICAgICAgbmFtZTogJ2JhY2tncm91bmQtb3JpZ2luJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnYm9yZGVyLWJveCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDEgLyogTElTVCAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5zLm1hcChmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNJZGVudFRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwYWRkaW5nLWJveCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEgLyogUEFERElOR19CT1ggKi87XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjb250ZW50LWJveCc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIgLyogQ09OVEVOVF9CT1ggKi87XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogQk9SREVSX0JPWCAqLztcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBiYWNrZ3JvdW5kUG9zaXRpb24gPSB7XG4gICAgICAgIG5hbWU6ICdiYWNrZ3JvdW5kLXBvc2l0aW9uJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnMCUgMCUnLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgcmV0dXJuIHBhcnNlRnVuY3Rpb25BcmdzKHRva2VucylcbiAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uICh2YWx1ZXMpIHsgcmV0dXJuIHZhbHVlcy5maWx0ZXIoaXNMZW5ndGhQZXJjZW50YWdlKTsgfSlcbiAgICAgICAgICAgICAgICAubWFwKHBhcnNlTGVuZ3RoUGVyY2VudGFnZVR1cGxlKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgYmFja2dyb3VuZFJlcGVhdCA9IHtcbiAgICAgICAgbmFtZTogJ2JhY2tncm91bmQtcmVwZWF0JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAncmVwZWF0JyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCB0b2tlbnMpIHtcbiAgICAgICAgICAgIHJldHVybiBwYXJzZUZ1bmN0aW9uQXJncyh0b2tlbnMpXG4gICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlc1xuICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKGlzSWRlbnRUb2tlbilcbiAgICAgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodG9rZW4pIHsgcmV0dXJuIHRva2VuLnZhbHVlOyB9KVxuICAgICAgICAgICAgICAgICAgICAuam9pbignICcpO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAubWFwKHBhcnNlQmFja2dyb3VuZFJlcGVhdCk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHZhciBwYXJzZUJhY2tncm91bmRSZXBlYXQgPSBmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgc3dpdGNoICh2YWx1ZSkge1xuICAgICAgICAgICAgY2FzZSAnbm8tcmVwZWF0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMSAvKiBOT19SRVBFQVQgKi87XG4gICAgICAgICAgICBjYXNlICdyZXBlYXQteCc6XG4gICAgICAgICAgICBjYXNlICdyZXBlYXQgbm8tcmVwZWF0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMiAvKiBSRVBFQVRfWCAqLztcbiAgICAgICAgICAgIGNhc2UgJ3JlcGVhdC15JzpcbiAgICAgICAgICAgIGNhc2UgJ25vLXJlcGVhdCByZXBlYXQnOlxuICAgICAgICAgICAgICAgIHJldHVybiAzIC8qIFJFUEVBVF9ZICovO1xuICAgICAgICAgICAgY2FzZSAncmVwZWF0JzpcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogUkVQRUFUICovO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBCQUNLR1JPVU5EX1NJWkU7XG4gICAgKGZ1bmN0aW9uIChCQUNLR1JPVU5EX1NJWkUpIHtcbiAgICAgICAgQkFDS0dST1VORF9TSVpFW1wiQVVUT1wiXSA9IFwiYXV0b1wiO1xuICAgICAgICBCQUNLR1JPVU5EX1NJWkVbXCJDT05UQUlOXCJdID0gXCJjb250YWluXCI7XG4gICAgICAgIEJBQ0tHUk9VTkRfU0laRVtcIkNPVkVSXCJdID0gXCJjb3ZlclwiO1xuICAgIH0pKEJBQ0tHUk9VTkRfU0laRSB8fCAoQkFDS0dST1VORF9TSVpFID0ge30pKTtcbiAgICB2YXIgYmFja2dyb3VuZFNpemUgPSB7XG4gICAgICAgIG5hbWU6ICdiYWNrZ3JvdW5kLXNpemUnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICcwJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCB0b2tlbnMpIHtcbiAgICAgICAgIC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cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogTk9ORSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdkYXNoZWQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMiAvKiBEQVNIRUQgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnZG90dGVkJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMgLyogRE9UVEVEICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2RvdWJsZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0IC8qIERPVUJMRSAqLztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAxIC8qIFNPTElEICovO1xuICAgICAgICB9XG4gICAgfSk7IH07XG4gICAgdmFyIGJvcmRlclRvcFN0eWxlID0gYm9yZGVyU3R5bGVGb3JTaWRlKCd0b3AnKTtcbiAgICB2YXIgYm9yZGVyUmlnaHRTdHlsZSA9IGJvcmRlclN0eWxlRm9yU2lkZSgncmlnaHQnKTtcbiAgICB2YXIgYm9yZGVyQm90dG9tU3R5bGUgPSBib3JkZXJTdHlsZUZvclNpZGUoJ2JvdHRvbScpO1xuICAgIHZhciBib3JkZXJMZWZ0U3R5bGUgPSBib3JkZXJTdHlsZUZvclNpZGUoJ2xlZnQnKTtcblxuICAgIHZhciBib3JkZXJXaWR0aEZvclNpZGUgPSBmdW5jdGlvbiAoc2lkZSkgeyByZXR1cm4gKHtcbiAgICAgICAgbmFtZTogXCJib3JkZXItXCIgKyBzaWRlICsgXCItd2lkdGhcIixcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnMCcsXG4gICAgICAgIHR5cGU6IDAgLyogVkFMVUUgKi8sXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2VuKSB7XG4gICAgICAgICAgICBpZiAoaXNEaW1lbnNpb25Ub2tlbih0b2tlbikpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4ubnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIDA7XG4gICAgICAgIH1cbiAgICB9KTsgfTtcbiAgICB2YXIgYm9yZGVyVG9wV2lkdGggPSBib3JkZXJXaWR0aEZvclNpZGUoJ3RvcCcpO1xuICAgIHZhciBib3JkZXJSaWdodFdpZHRoID0gYm9yZGVyV2lkdGhGb3JTaWRlKCdyaWdodCcpO1xuICAgIHZhciBib3JkZXJCb3R0b21XaWR0aCA9IGJvcmRlcldpZHRoRm9yU2lkZSgnYm90dG9tJyk7XG4gICAgdmFyIGJvcmRlckxlZnRXaWR0aCA9IGJvcmRlcldpZHRoRm9yU2lkZSgnbGVmdCcpO1xuXG4gICAgdmFyIGNvbG9yID0ge1xuICAgICAgICBuYW1lOiBcImNvbG9yXCIsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ3RyYW5zcGFyZW50JyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMyAvKiBUWVBFX1ZBTFVFICovLFxuICAgICAgICBmb3JtYXQ6ICdjb2xvcidcbiAgICB9O1xuXG4gICAgdmFyIGRpcmVjdGlvbiA9IHtcbiAgICAgICAgbmFtZTogJ2RpcmVjdGlvbicsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ2x0cicsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDIgLyogSURFTlRfVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIGRpcmVjdGlvbikge1xuICAgICAgICAgICAgc3dpdGNoIChkaXJlY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBjYXNlICdydGwnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMSAvKiBSVEwgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbHRyJzpcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMCAvKiBMVFIgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIGRpc3BsYXkgPSB7XG4gICAgICAgIG5hbWU6ICdkaXNwbGF5JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnaW5saW5lLWJsb2NrJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCB0b2tlbnMpIHtcbiAgICAgICAgICAgIHJldHVybiB0b2tlbnMuZmlsdGVyKGlzSWRlbnRUb2tlbikucmVkdWNlKGZ1bmN0aW9uIChiaXQsIHRva2VuKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJpdCB8IHBhcnNlRGlzcGxheVZhbHVlKHRva2VuLnZhbHVlKTtcbiAgICAgICAgICAgIH0sIDAgLyogTk9ORSAqLyk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHZhciBwYXJzZURpc3BsYXlWYWx1ZSA9IGZ1bmN0aW9uIChkaXNwbGF5KSB7XG4gICAgICAgIHN3aXRjaCAoZGlzcGxheSkge1xuICAgICAgICAgICAgY2FzZSAnYmxvY2snOlxuICAgICAgICAgICAgY2FzZSAnLXdlYmtpdC1ib3gnOlxuICAgICAgICAgICAgICAgIHJldHVybiAyIC8qIEJMT0NLICovO1xuICAgICAgICAgICAgY2FzZSAnaW5saW5lJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gNCAvKiBJTkxJTkUgKi87XG4gICAgICAgICAgICBjYXNlICdydW4taW4nOlxuICAgICAgICAgICAgICAgIHJldHVybiA4IC8qIFJVTl9JTiAqLztcbiAgICAgICAgICAgIGNhc2UgJ2Zsb3cnOlxuICAgICAgICAgICAgICAgIHJldHVybiAxNiAvKiBGTE9XICovO1xuICAgICAgICAgICAgY2FzZSAnZmxvdy1yb290JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMzIgLyogRkxPV19ST09UICovO1xuICAgICAgICAgICAgY2FzZSAndGFibGUnOlxuICAgICAgICAgICAgICAgIHJldHVybiA2NCAvKiBUQUJMRSAqLztcbiAgICAgICAgICAgIGNhc2UgJ2ZsZXgnOlxuICAgICAgICAgICAgY2FzZSAnLXdlYmtpdC1mbGV4JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMTI4IC8qIEZMRVggKi87XG4gICAgICAgICAgICBjYXNlICdncmlkJzpcbiAgICAgICAgICAgIGNhc2UgJy1tcy1ncmlkJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMjU2IC8qIEdSSUQgKi87XG4gICAgICAgICAgICBjYXNlICdydWJ5JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gNTEyIC8qIFJVQlkgKi87XG4gICAgICAgICAgICBjYXNlICdzdWJncmlkJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMTAyNCAvKiBTVUJHUklEICovO1xuICAgICAgICAgICAgY2FzZSAnbGlzdC1pdGVtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMjA0OCAvKiBMSVNUX0lURU0gKi87XG4gICAgICAgICAgICBjYXNlICd0YWJsZS1yb3ctZ3JvdXAnOlxuICAgICAgICAgICAgICAgIHJldHVybiA0MDk2IC8qIFRBQkxFX1JPV19HUk9VUCAqLztcbiAgICAgICAgICAgIGNhc2UgJ3RhYmxlLWhlYWRlci1ncm91cCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDgxOTIgLyogVEFCTEVfSEVBREVSX0dST1VQICovO1xuICAgICAgICAgICAgY2FzZSAndGFibGUtZm9vdGVyLWdyb3VwJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMTYzODQgLyogVEFCTEVfRk9PVEVSX0dST1VQICovO1xuICAgICAgICAgICAgY2FzZSAndGFibGUtcm93JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMzI3NjggLyogVEFCTEVfUk9XICovO1xuICAgICAgICAgICAgY2FzZSAndGFibGUtY2VsbCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDY1NTM2IC8qIFRBQkxFX0NFTEwgKi87XG4gICAgICAgICAgICBjYXNlICd0YWJsZS1jb2x1bW4tZ3JvdXAnOlxuICAgICAgICAgICAgICAgIHJldHVybiAxMzEwNzIgLyogVEFCTEVfQ09MVU1OX0dST1VQICovO1xuICAgICAgICAgICAgY2FzZSAndGFibGUtY29sdW1uJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMjYyMTQ0IC8qIFRBQkxFX0NPTFVNTiAqLztcbiAgICAgICAgICAgIGNhc2UgJ3RhYmxlLWNhcHRpb24nOlxuICAgICAgICAgICAgICAgIHJldHVybiA1MjQyODggLyogVEFCTEVfQ0FQVElPTiAqLztcbiAgICAgICAgICAgIGNhc2UgJ3J1YnktYmFzZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDEwNDg1NzYgLyogUlVCWV9CQVNFICovO1xuICAgICAgICAgICAgY2FzZSAncnVieS10ZXh0JzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMjA5NzE1MiAvKiBSVUJZX1RFWFQgKi87XG4gICAgICAgICAgICBjYXNlICdydWJ5LWJhc2UtY29udGFpbmVyJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gNDE5NDMwNCAvKiBSVUJZX0JBU0VfQ09OVEFJTkVSICovO1xuICAgICAgICAgICAgY2FzZSAncnVieS10ZXh0LWNvbnRhaW5lcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDgzODg2MDggLyogUlVCWV9URVhUX0NPTlRBSU5FUiAqLztcbiAgICAgICAgICAgIGNhc2UgJ2NvbnRlbnRzJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMTY3NzcyMTYgLyogQ09OVEVOVFMgKi87XG4gICAgICAgICAgICBjYXNlICdpbmxpbmUtYmxvY2snOlxuICAgICAgICAgICAgICAgIHJldHVybiAzMzU1NDQzMiAvKiBJTkxJTkVfQkxPQ0sgKi87XG4gICAgICAgICAgICBjYXNlICdpbmxpbmUtbGlzdC1pdGVtJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gNjcxMDg4NjQgLyogSU5MSU5FX0xJU1RfSVRFTSAqLztcbiAgICAgICAgICAgIGNhc2UgJ2lubGluZS10YWJsZSc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDEzNDIxNzcyOCAvKiBJTkxJTkVfVEFCTEUgKi87XG4gICAgICAgICAgICBjYXNlICdpbmxpbmUtZmxleCc6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDI2ODQzNTQ1NiAvKiBJTkxJTkVfRkxFWCAqLztcbiAgICAgICAgICAgIGNhc2UgJ2lubGluZS1ncmlkJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gNTM2ODcwOTEyIC8qIElOTElORV9HUklEICovO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAwIC8qIE5PTkUgKi87XG4gICAgfTtcblxuICAgIHZhciBmbG9hdCA9IHtcbiAgICAgICAgbmFtZTogJ2Zsb2F0JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9uZScsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDIgLyogSURFTlRfVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIGZsb2F0KSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGZsb2F0KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnbGVmdCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIExFRlQgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAncmlnaHQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMiAvKiBSSUdIVCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdpbmxpbmUtc3RhcnQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMyAvKiBJTkxJTkVfU1RBUlQgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnaW5saW5lLWVuZCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0IC8qIElOTElORV9FTkQgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gMCAvKiBOT05FICovO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBsZXR0ZXJTcGFjaW5nID0ge1xuICAgICAgICBuYW1lOiAnbGV0dGVyLXNwYWNpbmcnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICcwJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMCAvKiBWQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW4pIHtcbiAgICAgICAgICAgIGlmICh0b2tlbi50eXBlID09PSAyMCAvKiBJREVOVF9UT0tFTiAqLyAmJiB0b2tlbi52YWx1ZSA9PT0gJ25vcm1hbCcpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0b2tlbi50eXBlID09PSAxNyAvKiBOVU1CRVJfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4ubnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRva2VuLnR5cGUgPT09IDE1IC8qIERJTUVOU0lPTl9UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbi5udW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gMDtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgTElORV9CUkVBSztcbiAgICAoZnVuY3Rpb24gKExJTkVfQlJFQUspIHtcbiAgICAgICAgTElORV9CUkVBS1tcIk5PUk1BTFwiXSA9IFwibm9ybWFsXCI7XG4gICAgICAgIExJTkVfQlJFQUtbXCJTVFJJQ1RcIl0gPSBcInN0cmljdFwiO1xuICAgIH0pKExJTkVfQlJFQUsgfHwgKExJTkVfQlJFQUsgPSB7fSkpO1xuICAgIHZhciBsaW5lQnJlYWsgPSB7XG4gICAgICAgIG5hbWU6ICdsaW5lLWJyZWFrJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9ybWFsJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMiAvKiBJREVOVF9WQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgbGluZUJyZWFrKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGxpbmVCcmVhaykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ3N0cmljdCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBMSU5FX0JSRUFLLlNUUklDVDtcbiAgICAgICAgICAgICAgICBjYXNlICdub3JtYWwnOlxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBMSU5FX0JSRUFLLk5PUk1BTDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgbGluZUhlaWdodCA9IHtcbiAgICAgICAgbmFtZTogJ2xpbmUtaGVpZ2h0JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9ybWFsJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogNCAvKiBUT0tFTl9WQUxVRSAqL1xuICAgIH07XG4gICAgdmFyIGNvbXB1dGVMaW5lSGVpZ2h0ID0gZnVuY3Rpb24gKHRva2VuLCBmb250U2l6ZSkge1xuICAgICAgICBpZiAoaXNJZGVudFRva2VuKHRva2VuKSAmJiB0b2tlbi52YWx1ZSA9PT0gJ25vcm1hbCcpIHtcbiAgICAgICAgICAgIHJldHVybiAxLjIgKiBmb250U2l6ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmICh0b2tlbi50eXBlID09PSAxNyAvKiBOVU1CRVJfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgIHJldHVybiBmb250U2l6ZSAqIHRva2VuLm51bWJlcjtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChpc0xlbmd0aFBlcmNlbnRhZ2UodG9rZW4pKSB7XG4gICAgICAgICAgICByZXR1cm4gZ2V0QWJzb2x1dGVWYWx1ZSh0b2tlbiwgZm9udFNpemUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBmb250U2l6ZTtcbiAgICB9O1xuXG4gICAgdmFyIGxpc3RTdHlsZUltYWdlID0ge1xuICAgICAgICBuYW1lOiAnbGlzdC1zdHlsZS1pbWFnZScsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ25vbmUnLFxuICAgICAgICB0eXBlOiAwIC8qIFZBTFVFICovLFxuICAgICAgICBwcmVmaXg6IGZhbHNlLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGNvbnRleHQsIHRva2VuKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8gJiYgdG9rZW4udmFsdWUgPT09ICdub25lJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGltYWdlLnBhcnNlKGNvbnRleHQsIHRva2VuKTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgbGlzdFN0eWxlUG9zaXRpb24gPSB7XG4gICAgICAgIG5hbWU6ICdsaXN0LXN0eWxlLXBvc2l0aW9uJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnb3V0c2lkZScsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDIgLyogSURFTlRfVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHBvc2l0aW9uKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHBvc2l0aW9uKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnaW5zaWRlJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogSU5TSURFICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ291dHNpZGUnOlxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIE9VVFNJREUgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIGxpc3RTdHlsZVR5cGUgPSB7XG4gICAgICAgIG5hbWU6ICdsaXN0LXN0eWxlLXR5cGUnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMiAvKiBJREVOVF9WQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdHlwZSkge1xuICAgICAgICAgICAgc3dpdGNoICh0eXBlKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnZGlzYyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8qIERJU0MgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnY2lyY2xlJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEgLyogQ0lSQ0xFICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3NxdWFyZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyIC8qIFNRVUFSRSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdkZWNpbWFsJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMgLyogREVDSU1BTCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdjamstZGVjaW1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0IC8qIENKS19ERUNJTUFMICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2RlY2ltYWwtbGVhZGluZy16ZXJvJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDUgLyogREVDSU1BTF9MRUFESU5HX1pFUk8gKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbG93ZXItcm9tYW4nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNiAvKiBMT1dFUl9ST01BTiAqLztcbiAgICAgICAgICAgICAgICBjYXNlICd1cHBlci1yb21hbic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA3IC8qIFVQUEVSX1JPTUFOICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xvd2VyLWdyZWVrJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDggLyogTE9XRVJfR1JFRUsgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbG93ZXItYWxwaGEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gOSAvKiBMT1dFUl9BTFBIQSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICd1cHBlci1hbHBoYSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxMCAvKiBVUFBFUl9BTFBIQSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdhcmFiaWMtaW5kaWMnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTEgLyogQVJBQklDX0lORElDICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2FybWVuaWFuJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDEyIC8qIEFSTUVOSUFOICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2JlbmdhbGknOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTMgLyogQkVOR0FMSSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdjYW1ib2RpYW4nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTQgLyogQ0FNQk9ESUFOICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2Nqay1lYXJ0aGx5LWJyYW5jaCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxNSAvKiBDSktfRUFSVEhMWV9CUkFOQ0ggKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnY2prLWhlYXZlbmx5LXN0ZW0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTYgLyogQ0pLX0hFQVZFTkxZX1NURU0gKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnY2prLWlkZW9ncmFwaGljJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE3IC8qIENKS19JREVPR1JBUEhJQyAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdkZXZhbmFnYXJpJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE4IC8qIERFVkFOQUdBUkkgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnZXRoaW9waWMtbnVtZXJpYyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxOSAvKiBFVEhJT1BJQ19OVU1FUklDICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2dlb3JnaWFuJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIwIC8qIEdFT1JHSUFOICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2d1amFyYXRpJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIxIC8qIEdVSkFSQVRJICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2d1cm11a2hpJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIyIC8qIEdVUk1VS0hJICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2hlYnJldyc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyMiAvKiBIRUJSRVcgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnaGlyYWdhbmEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjMgLyogSElSQUdBTkEgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnaGlyYWdhbmEtaXJvaGEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjQgLyogSElSQUdBTkFfSVJPSEEgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnamFwYW5lc2UtZm9ybWFsJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDI1IC8qIEpBUEFORVNFX0ZPUk1BTCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdqYXBhbmVzZS1pbmZvcm1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyNiAvKiBKQVBBTkVTRV9JTkZPUk1BTCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdrYW5uYWRhJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDI3IC8qIEtBTk5BREEgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAna2F0YWthbmEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjggLyogS0FUQUtBTkEgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAna2F0YWthbmEtaXJvaGEnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMjkgLyogS0FUQUtBTkFfSVJPSEEgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAna2htZXInOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMzAgLyogS0hNRVIgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAna29yZWFuLWhhbmd1bC1mb3JtYWwnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMzEgLyogS09SRUFOX0hBTkdVTF9GT1JNQUwgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAna29yZWFuLWhhbmphLWZvcm1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMiAvKiBLT1JFQU5fSEFOSkFfRk9STUFMICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2tvcmVhbi1oYW5qYS1pbmZvcm1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzMyAvKiBLT1JFQU5fSEFOSkFfSU5GT1JNQUwgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbGFvJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDM0IC8qIExBTyAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdsb3dlci1hcm1lbmlhbic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzNSAvKiBMT1dFUl9BUk1FTklBTiAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdtYWxheWFsYW0nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMzYgLyogTUFMQVlBTEFNICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ21vbmdvbGlhbic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzNyAvKiBNT05HT0xJQU4gKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbXlhbm1hcic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAzOCAvKiBNWUFOTUFSICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ29yaXlhJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDM5IC8qIE9SSVlBICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3BlcnNpYW4nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNDAgLyogUEVSU0lBTiAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdzaW1wLWNoaW5lc2UtZm9ybWFsJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQxIC8qIFNJTVBfQ0hJTkVTRV9GT1JNQUwgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnc2ltcC1jaGluZXNlLWluZm9ybWFsJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQyIC8qIFNJTVBfQ0hJTkVTRV9JTkZPUk1BTCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICd0YW1pbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0MyAvKiBUQU1JTCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICd0ZWx1Z3UnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNDQgLyogVEVMVUdVICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3RoYWknOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNDUgLyogVEhBSSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICd0aWJldGFuJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQ2IC8qIFRJQkVUQU4gKi87XG4gICAgICAgICAgICAgICAgY2FzZSAndHJhZC1jaGluZXNlLWZvcm1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0NyAvKiBUUkFEX0NISU5FU0VfRk9STUFMICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3RyYWQtY2hpbmVzZS1pbmZvcm1hbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA0OCAvKiBUUkFEX0NISU5FU0VfSU5GT1JNQUwgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAndXBwZXItYXJtZW5pYW4nOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNDkgLyogVVBQRVJfQVJNRU5JQU4gKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnZGlzY2xvc3VyZS1vcGVuJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDUwIC8qIERJU0NMT1NVUkVfT1BFTiAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdkaXNjbG9zdXJlLWNsb3NlZCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA1MSAvKiBESVNDTE9TVVJFX0NMT1NFRCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdub25lJzpcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTEgLyogTk9ORSAqLztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgbWFyZ2luRm9yU2lkZSA9IGZ1bmN0aW9uIChzaWRlKSB7IHJldHVybiAoe1xuICAgICAgICBuYW1lOiB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ElQICovO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdhdXRvJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0IC8qIEFVVE8gKi87XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Zpc2libGUnOlxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogVklTSUJMRSAqLztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgb3ZlcmZsb3dXcmFwID0ge1xuICAgICAgICBuYW1lOiAnb3ZlcmZsb3ctd3JhcCcsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ25vcm1hbCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDIgLyogSURFTlRfVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIG92ZXJmbG93KSB7XG4gICAgICAgICAgICBzd2l0Y2ggKG92ZXJmbG93KSB7XG4gICAgICAgICAgICAgICAgY2FzZSAnYnJlYWstd29yZCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcImJyZWFrLXdvcmRcIiAvKiBCUkVBS19XT1JEICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ25vcm1hbCc6XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwibm9ybWFsXCIgLyogTk9STUFMICovO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBwYWRkaW5nRm9yU2lkZSA9IGZ1bmN0aW9uIChzaWRlKSB7IHJldHVybiAoe1xuICAgICAgICBuYW1lOiBcInBhZGRpbmctXCIgKyBzaWRlLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICcwJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZS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cbiAgICAgICAgbmFtZTogJ3Bvc2l0aW9uJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnc3RhdGljJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMiAvKiBJREVOVF9WQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgcG9zaXRpb24pIHtcbiAgICAgICAgICAgIHN3aXRjaCAocG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICBjYXNlICdyZWxhdGl2ZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIFJFTEFUSVZFICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2Fic29sdXRlJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIgLyogQUJTT0xVVEUgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnZml4ZWQnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMyAvKiBGSVhFRCAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdzdGlja3knOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gNCAvKiBTVElDS1kgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gMCAvKiBTVEFUSUMgKi87XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHRleHRTaGFkb3cgPSB7XG4gICAgICAgIG5hbWU6ICd0ZXh0LXNoYWRvdycsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ25vbmUnLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICBpZiAodG9rZW5zLmxlbmd0aCA9PT0gMSAmJiBpc0lkZW50V2l0aFZhbHVlKHRva2Vuc1swXSwgJ25vbmUnKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBwYXJzZUZ1bmN0aW9uQXJncyh0b2tlbnMpLm1hcChmdW5jdGlvbiAodmFsdWVzKSB7XG4gICAgICAgICAgICAgICAgdmFyIHNoYWRvdyA9IHtcbiAgICAgICAgICAgICAgICAgICAgY29sb3I6IENPTE9SUy5UUkFOU1BBUkVOVCxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0WDogWkVST19MRU5HVEgsXG4gICAgICAgICAgICAgICAgICAgIG9mZnNldFk6IFpFUk9fTEVOR1RILFxuICAgICAgICAgICAgICAgICAgICBibHVyOiBaRVJPX0xFTkdUSFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgdmFyIGMgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdmFsdWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0b2tlbiA9IHZhbHVlc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzTGVuZ3RoKHRva2VuKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGMgPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3cub2Zmc2V0WCA9IHRva2VuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA9PT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYWRvdy5vZmZzZXRZID0gdG9rZW47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3cuYmx1ciA9IHRva2VuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgYysrO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2hhZG93LmNvbG9yID0gY29sb3IkMS5wYXJzZShjb250ZXh0LCB0b2tlbik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIHNoYWRvdztcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciB0ZXh0VHJhbnNmb3JtID0ge1xuICAgICAgICBuYW1lOiAndGV4dC10cmFuc2Zvcm0nLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMiAvKiBJREVOVF9WQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdGV4dFRyYW5zZm9ybSkge1xuICAgICAgICAgICAgc3dpdGNoICh0ZXh0VHJhbnNmb3JtKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAndXBwZXJjYXNlJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDIgLyogVVBQRVJDQVNFICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ2xvd2VyY2FzZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIExPV0VSQ0FTRSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdjYXBpdGFsaXplJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMgLyogQ0FQSVRBTElaRSAqLztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiAwIC8qIE5PTkUgKi87XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHRyYW5zZm9ybSQxID0ge1xuICAgICAgICBuYW1lOiAndHJhbnNmb3JtJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9uZScsXG4gICAgICAgIHByZWZpeDogd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A1MCxcbiAgICAgICAgZmxhZ3M6IEZMQUdfSU5URUdFUlxuICAgIH07XG4gICAgdmFyIERFRkFVTFQgPSBbREVGQVVMVF9WQUxVRSwgREVGQVVMVF9WQUxVRV07XG4gICAgdmFyIHRyYW5zZm9ybU9yaWdpbiA9IHtcbiAgICAgICAgbmFtZTogJ3RyYW5zZm9ybS1vcmlnaW4nLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICc1MCUgNTAlJyxcbiAgICAgICAgcHJlZml4OiB0cnVlLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgdmFyIG9yaWdpbnMgPSB0b2tlbnMuZmlsdGVyKGlzTGVuZ3RoUGVyY2VudGFnZSk7XG4gICAgICAgICAgICBpZiAob3JpZ2lucy5sZW5ndGggIT09IDIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gREVGQVVMVDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBbb3JpZ2luc1swXSwgb3JpZ2luc1sxXV07XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHZpc2liaWxpdHkgPSB7XG4gICAgICAgIG5hbWU6ICd2aXNpYmxlJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9uZScsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDIgLyogSURFTlRfVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHZpc2liaWxpdHkpIHtcbiAgICAgICAgICAgIHN3aXRjaCAodmlzaWJpbGl0eSkge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2hpZGRlbic6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIEhJRERFTiAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdjb2xsYXBzZSc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAyIC8qIENPTExBUFNFICovO1xuICAgICAgICAgICAgICAgIGNhc2UgJ3Zpc2libGUnOlxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8qIFZJU0lCTEUgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIFdPUkRfQlJFQUs7XG4gICAgKGZ1bmN0aW9uIChXT1JEX0JSRUFLKSB7XG4gICAgICAgIFdPUkRfQlJFQUtbXCJOT1JNQUxcIl0gPSBcIm5vcm1hbFwiO1xuICAgICAgICBXT1JEX0JSRUFLW1wiQlJFQUtfQUxMXCJdID0gXCJicmVhay1hbGxcIjtcbiAgICAgICAgV09SRF9CUkVBS1tcIktFRVBfQUxMXCJdID0gXCJrZWVwLWFsbFwiO1xuICAgIH0pKFdPUkRfQlJFQUsgfHwgKFdPUkRfQlJFQUsgPSB7fSkpO1xuICAgIHZhciB3b3JkQnJlYWsgPSB7XG4gICAgICAgIG5hbWU6ICd3b3JkLWJyZWFrJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9ybWFsJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMiAvKiBJREVOVF9WQUxVRSAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgd29yZEJyZWFrKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKHdvcmRCcmVhaykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ2JyZWFrLWFsbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBXT1JEX0JSRUFLLkJSRUFLX0FMTDtcbiAgICAgICAgICAgICAgICBjYXNlICdrZWVwLWFsbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBXT1JEX0JSRUFLLktFRVBfQUxMO1xuICAgICAgICAgICAgICAgIGNhc2UgJ25vcm1hbCc6XG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFdPUkRfQlJFQUsuTk9STUFMO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciB6SW5kZXggPSB7XG4gICAgICAgIG5hbWU6ICd6LWluZGV4JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnYXV0bycsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDAgLyogVkFMVUUgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2VuKSB7XG4gICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICByZXR1cm4geyBhdXRvOiB0cnVlLCBvcmRlcjogMCB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzTnVtYmVyVG9rZW4odG9rZW4pKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHsgYXV0bzogZmFsc2UsIG9yZGVyOiB0b2tlbi5udW1iZXIgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkludmFsaWQgei1pbmRleCBudW1iZXIgcGFyc2VkXCIpO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciB0aW1lID0ge1xuICAgICAgICBuYW1lOiAndGltZScsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHZhbHVlKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMTUgLyogRElNRU5TSU9OX1RPS0VOICovKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh2YWx1ZS51bml0LnRvTG93ZXJDYXNlKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAncyc6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTAwMCAqIHZhbHVlLm51bWJlcjtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXMnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlLm51bWJlcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbnN1cHBvcnRlZCB0aW1lIHR5cGVcIik7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIG9wYWNpdHkgPSB7XG4gICAgICAgIG5hbWU6ICdvcGFjaXR5JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnMScsXG4gICAgICAgIHR5cGU6IDAgLyogVkFMVUUgKi8sXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2VuKSB7XG4gICAgICAgICAgICBpZiAoaXNOdW1iZXJUb2tlbih0b2tlbikpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9rZW4ubnVtYmVyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHRleHREZWNvcmF0aW9uQ29sb3IgPSB7XG4gICAgICAgIG5hbWU6IFwidGV4dC1kZWNvcmF0aW9uLWNvbG9yXCIsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ3RyYW5zcGFyZW50JyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMyAvKiBUWVBFX1ZBTFVFICovLFxuICAgICAgICBmb3JtYXQ6ICdjb2xvcidcbiAgICB9O1xuXG4gICAgdmFyIHRleHREZWNvcmF0aW9uTGluZSA9IHtcbiAgICAgICAgbmFtZTogJ3RleHQtZGVjb3JhdGlvbi1saW5lJyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9uZScsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDEgLyogTElTVCAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5zXG4gICAgICAgICAgICAgICAgLmZpbHRlcihpc0lkZW50VG9rZW4pXG4gICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3VuZGVybGluZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMSAvKiBVTkRFUkxJTkUgKi87XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ292ZXJsaW5lJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAyIC8qIE9WRVJMSU5FICovO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdsaW5lLXRocm91Z2gnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDMgLyogTElORV9USFJPVUdIICovO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdub25lJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiA0IC8qIEJMSU5LICovO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gMCAvKiBOT05FICovO1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uIChsaW5lKSB7IHJldHVybiBsaW5lICE9PSAwIC8qIE5PTkUgKi87IH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBmb250RmFtaWx5ID0ge1xuICAgICAgICBuYW1lOiBcImZvbnQtZmFtaWx5XCIsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJycsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDEgLyogTElTVCAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICB2YXIgYWNjdW11bGF0b3IgPSBbXTtcbiAgICAgICAgICAgIHZhciByZXN1bHRzID0gW107XG4gICAgICAgICAgICB0b2tlbnMuZm9yRWFjaChmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRva2VuLnR5cGUpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAyMCAvKiBJREVOVF9UT0tFTiAqLzpcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAwIC8qIFNUUklOR19UT0tFTiAqLzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY3VtdWxhdG9yLnB1c2godG9rZW4udmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMTcgLyogTlVNQkVSX1RPS0VOICovOlxuICAgICAgICAgICAgICAgICAgICAgICAgYWNjdW11bGF0b3IucHVzaCh0b2tlbi5udW1iZXIudG9TdHJpbmcoKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgY2FzZSA0IC8qIENPTU1BX1RPS0VOICovOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKGFjY3VtdWxhdG9yLmpvaW4oJyAnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2N1bXVsYXRvci5sZW5ndGggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAoYWNjdW11bGF0b3IubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0cy5wdXNoKGFjY3VtdWxhdG9yLmpvaW4oJyAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0cy5tYXAoZnVuY3Rpb24gKHJlc3VsdCkgeyByZXR1cm4gKHJlc3VsdC5pbmRleE9mKCcgJykgPT09IC0xID8gcmVzdWx0IDogXCInXCIgKyByZXN1bHQgKyBcIidcIik7IH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBmb250U2l6ZSA9IHtcbiAgICAgICAgbmFtZTogXCJmb250LXNpemVcIixcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnMCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDMgLyogVFlQRV9WQUxVRSAqLyxcbiAgICAgICAgZm9ybWF0OiAnbGVuZ3RoJ1xuICAgIH07XG5cbiAgICB2YXIgZm9udFdlaWdodCA9IHtcbiAgICAgICAgbmFtZTogJ2ZvbnQtd2VpZ2h0JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9ybWFsJyxcbiAgICAgICAgdHlwZTogMCAvKiBWQUxVRSAqLyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW4pIHtcbiAgICAgICAgICAgIGlmIChpc051bWJlclRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b2tlbi5udW1iZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNJZGVudFRva2VuKHRva2VuKSkge1xuICAgICAgICAgICAgICAgIHN3aXRjaCAodG9rZW4udmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYm9sZCc6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gNzAwO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdub3JtYWwnOlxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDQwMDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gNDAwO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBmb250VmFyaWFudCA9IHtcbiAgICAgICAgbmFtZTogJ2ZvbnQtdmFyaWFudCcsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ25vbmUnLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgcmV0dXJuIHRva2Vucy5maWx0ZXIoaXNJZGVudFRva2VuKS5tYXAoZnVuY3Rpb24gKHRva2VuKSB7IHJldHVybiB0b2tlbi52YWx1ZTsgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIGZvbnRTdHlsZSA9IHtcbiAgICAgICAgbmFtZTogJ2ZvbnQtc3R5bGUnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub3JtYWwnLFxuICAgICAgICBwcmVmaXg6IGZhbHNlLFxuICAgICAgICB0eXBlOiAyIC8qIElERU5UX1ZBTFVFICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCBvdmVyZmxvdykge1xuICAgICAgICAgICAgc3dpdGNoIChvdmVyZmxvdykge1xuICAgICAgICAgICAgICAgIGNhc2UgJ29ibGlxdWUnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJvYmxpcXVlXCIgLyogT0JMSVFVRSAqLztcbiAgICAgICAgICAgICAgICBjYXNlICdpdGFsaWMnOlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJpdGFsaWNcIiAvKiBJVEFMSUMgKi87XG4gICAgICAgICAgICAgICAgY2FzZSAnbm9ybWFsJzpcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJub3JtYWxcIiAvKiBOT1JNQUwgKi87XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIGNvbnRhaW5zID0gZnVuY3Rpb24gKGJpdCwgdmFsdWUpIHsgcmV0dXJuIChiaXQgJiB2YWx1ZSkgIT09IDA7IH07XG5cbiAgICB2YXIgY29udGVudCA9IHtcbiAgICAgICAgbmFtZTogJ2NvbnRlbnQnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwcmVmaXg6IGZhbHNlLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCB0b2tlbnMpIHtcbiAgICAgICAgICAgIGlmICh0b2tlbnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGZpcnN0ID0gdG9rZW5zWzBdO1xuICAgICAgICAgICAgaWYgKGZpcnN0LnR5cGUgPT09IDIwIC8qIElERU5UX1RPS0VOICovICYmIGZpcnN0LnZhbHVlID09PSAnbm9uZScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdG9rZW5zO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBjb3VudGVySW5jcmVtZW50ID0ge1xuICAgICAgICBuYW1lOiAnY291bnRlci1pbmNyZW1lbnQnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgcHJlZml4OiB0cnVlLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgaWYgKHRva2Vucy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBmaXJzdCA9IHRva2Vuc1swXTtcbiAgICAgICAgICAgIGlmIChmaXJzdC50eXBlID09PSAyMCAvKiBJREVOVF9UT0tFTiAqLyAmJiBmaXJzdC52YWx1ZSA9PT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgaW5jcmVtZW50cyA9IFtdO1xuICAgICAgICAgICAgdmFyIGZpbHRlcmVkID0gdG9rZW5zLmZpbHRlcihub25XaGl0ZVNwYWNlKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmlsdGVyZWQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY291bnRlciA9IGZpbHRlcmVkW2ldO1xuICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gZmlsdGVyZWRbaSArIDFdO1xuICAgICAgICAgICAgICAgIGlmIChjb3VudGVyLnR5cGUgPT09IDIwIC8qIElERU5UX1RPS0VOICovKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBpbmNyZW1lbnQgPSBuZXh0ICYmIGlzTnVtYmVyVG9rZW4obmV4dCkgPyBuZXh0Lm51bWJlciA6IDE7XG4gICAgICAgICAgICAgICAgICAgIGluY3JlbWVudHMucHVzaCh7IGNvdW50ZXI6IGNvdW50ZXIudmFsdWUsIGluY3JlbWVudDogaW5jcmVtZW50IH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBpbmNyZW1lbnRzO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBjb3VudGVyUmVzZXQgPSB7XG4gICAgICAgIG5hbWU6ICdjb3VudGVyLXJlc2V0JyxcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnbm9uZScsXG4gICAgICAgIHByZWZpeDogdHJ1ZSxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKF9jb250ZXh0LCB0b2tlbnMpIHtcbiAgICAgICAgICAgIGlmICh0b2tlbnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHJlc2V0cyA9IFtdO1xuICAgICAgICAgICAgdmFyIGZpbHRlcmVkID0gdG9rZW5zLmZpbHRlcihub25XaGl0ZVNwYWNlKTtcbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmlsdGVyZWQubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgY291bnRlciA9IGZpbHRlcmVkW2ldO1xuICAgICAgICAgICAgICAgIHZhciBuZXh0ID0gZmlsdGVyZWRbaSArIDFdO1xuICAgICAgICAgICAgICAgIGlmIChpc0lkZW50VG9rZW4oY291bnRlcikgJiYgY291bnRlci52YWx1ZSAhPT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXNldCA9IG5leHQgJiYgaXNOdW1iZXJUb2tlbihuZXh0KSA/IG5leHQubnVtYmVyIDogMDtcbiAgICAgICAgICAgICAgICAgICAgcmVzZXRzLnB1c2goeyBjb3VudGVyOiBjb3VudGVyLnZhbHVlLCByZXNldDogcmVzZXQgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHJlc2V0cztcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgZHVyYXRpb24gPSB7XG4gICAgICAgIG5hbWU6ICdkdXJhdGlvbicsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJzBzJyxcbiAgICAgICAgcHJlZml4OiBmYWxzZSxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGNvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgcmV0dXJuIHRva2Vucy5maWx0ZXIoaXNEaW1lbnNpb25Ub2tlbikubWFwKGZ1bmN0aW9uICh0b2tlbikgeyByZXR1cm4gdGltZS5wYXJzZShjb250ZXh0LCB0b2tlbik7IH0pO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciBxdW90ZXMgPSB7XG4gICAgICAgIG5hbWU6ICdxdW90ZXMnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgcHJlZml4OiB0cnVlLFxuICAgICAgICB0eXBlOiAxIC8qIExJU1QgKi8sXG4gICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoX2NvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgaWYgKHRva2Vucy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBmaXJzdCA9IHRva2Vuc1swXTtcbiAgICAgICAgICAgIGlmIChmaXJzdC50eXBlID09PSAyMCAvKiBJREVOVF9UT0tFTiAqLyAmJiBmaXJzdC52YWx1ZSA9PT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgcXVvdGVzID0gW107XG4gICAgICAgICAgICB2YXIgZmlsdGVyZWQgPSB0b2tlbnMuZmlsdGVyKGlzU3RyaW5nVG9rZW4pO1xuICAgICAgICAgICAgaWYgKGZpbHRlcmVkLmxlbmd0aCAlIDIgIT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZmlsdGVyZWQubGVuZ3RoOyBpICs9IDIpIHtcbiAgICAgICAgICAgICAgICB2YXIgb3Blbl8xID0gZmlsdGVyZWRbaV0udmFsdWU7XG4gICAgICAgICAgICAgICAgdmFyIGNsb3NlXzEgPSBmaWx0ZXJlZFtpICsgMV0udmFsdWU7XG4gICAgICAgICAgICAgICAgcXVvdGVzLnB1c2goeyBvcGVuOiBvcGVuXzEsIGNsb3NlOiBjbG9zZV8xIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHF1b3RlcztcbiAgICAgICAgfVxuICAgIH07XG4gICAgdmFyIGdldFF1b3RlID0gZnVuY3Rpb24gKHF1b3RlcywgZGVwdGgsIG9wZW4pIHtcbiAgICAgICAgaWYgKCFxdW90ZXMpIHtcbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuICAgICAgICB2YXIgcXVvdGUgPSBxdW90ZXNbTWF0aC5taW4oZGVwdGgsIHF1b3Rlcy5sZW5ndGggLSAxKV07XG4gICAgICAgIGlmICghcXVvdGUpIHtcbiAgICAgICAgICAgIHJldHVybiAnJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gb3BlbiA/IHF1b3RlLm9wZW4gOiBxdW90ZS5jbG9zZTtcbiAgICB9O1xuXG4gICAgdmFyIGJveFNoYWRvdyA9IHtcbiAgICAgICAgbmFtZTogJ2JveC1zaGFkb3cnLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdub25lJyxcbiAgICAgICAgdHlwZTogMSAvKiBMSVNUICovLFxuICAgICAgICBwcmVmaXg6IGZhbHNlLFxuICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGNvbnRleHQsIHRva2Vucykge1xuICAgICAgICAgICAgaWYgKHRva2Vucy5sZW5ndGggPT09IDEgJiYgaXNJZGVudFdpdGhWYWx1ZSh0b2tlbnNbMF0sICdub25lJykpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcGFyc2VGdW5jdGlvbkFyZ3ModG9rZW5zKS5tYXAoZnVuY3Rpb24gKHZhbHVlcykge1xuICAgICAgICAgICAgICAgIHZhciBzaGFkb3cgPSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbG9yOiAweDAwMDAwMGZmLFxuICAgICAgICAgICAgICAgICAgICBvZmZzZXRYOiBaRVJPX0xFTkdUSCxcbiAgICAgICAgICAgICAgICAgICAgb2Zmc2V0WTogWkVST19MRU5HVEgsXG4gICAgICAgICAgICAgICAgICAgIGJsdXI6IFpFUk9fTEVOR1RILFxuICAgICAgICAgICAgICAgICAgICBzcHJlYWQ6IFpFUk9fTEVOR1RILFxuICAgICAgICAgICAgICAgICAgICBpbnNldDogZmFsc2VcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHZhciBjID0gMDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHZhbHVlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdG9rZW4gPSB2YWx1ZXNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0lkZW50V2l0aFZhbHVlKHRva2VuLCAnaW5zZXQnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgc2hhZG93Lmluc2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0xlbmd0aCh0b2tlbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hhZG93Lm9mZnNldFggPSB0b2tlbjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGMgPT09IDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3cub2Zmc2V0WSA9IHRva2VuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYyA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYWRvdy5ibHVyID0gdG9rZW47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3cuc3ByZWFkID0gdG9rZW47XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjKys7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzaGFkb3cuY29sb3IgPSBjb2xvciQxLnBhcnNlKGNvbnRleHQsIHRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gc2hhZG93O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xuXG4gICAgdmFyIHBhaW50T3JkZXIgPSB7XG4gICAgICAgIG5hbWU6ICdwYWludC1vcmRlcicsXG4gICAgICAgIGluaXRpYWxWYWx1ZTogJ25vcm1hbCcsXG4gICAgICAgIHByZWZpeDogZmFsc2UsXG4gICAgICAgIHR5cGU6IDEgLyogTElTVCAqLyxcbiAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChfY29udGV4dCwgdG9rZW5zKSB7XG4gICAgICAgICAgICB2YXIgREVGQVVMVF9WQUxVRSA9IFswIC8qIEZJTEwgKi8sIDEgLyogU1RST0tFICovLCAyIC8qIE1BUktFUlMgKi9dO1xuICAgICAgICAgICAgdmFyIGxheWVycyA9IFtdO1xuICAgICAgICAgICAgdG9rZW5zLmZpbHRlcihpc0lkZW50VG9rZW4pLmZvckVhY2goZnVuY3Rpb24gKHRva2VuKSB7XG4gICAgICAgICAgICAgICAgc3dpdGNoICh0b2tlbi52YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdzdHJva2UnOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJzLnB1c2goMSAvKiBTVFJPS0UgKi8pO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2ZpbGwnOlxuICAgICAgICAgICAgICAgICAgICAgICAgbGF5ZXJzLnB1c2goMCAvKiBGSUxMICovKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdtYXJrZXJzJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxheWVycy5wdXNoKDIgLyogTUFSS0VSUyAqLyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIERFRkFVTFRfVkFMVUUuZm9yRWFjaChmdW5jdGlvbiAodmFsdWUpIHtcbiAgICAgICAgICAgICAgICBpZiAobGF5ZXJzLmluZGV4T2YodmFsdWUpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICBsYXllcnMucHVzaCh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXR1cm4gbGF5ZXJzO1xuICAgICAgICB9XG4gICAgfTtcblxuICAgIHZhciB3ZWJraXRUZXh0U3Ryb2tlQ29sb3IgPSB7XG4gICAgICAgIG5hbWU6IFwiLXdlYmtpdC10ZXh0LXN0cm9rZS1jb2xvclwiLFxuICAgICAgICBpbml0aWFsVmFsdWU6ICdjdXJyZW50Y29sb3InLFxuICAgICAgICBwcmVmaXg6IGZhbHNlLFxuICAgICAgICB0eXBlOiAzIC8qIFRZUEVfVkFMVUUgKi8sXG4gICAgICAgIGZvcm1hdDogJ2NvbG9yJ1xuICAgIH07XG5cbiAgICB2YXIgd2Via2l0VGV4dFN0cm9rZVdpZHRoID0ge1xuICAgICAgICBuYW1lOiBcIi13ZWJraXQtdGV4dC1zdHJva2Utd2lkdGhcIixcbiAgICAgICAgaW5pdGlhbFZhbHVlOiAnMCcsXG4gICAgICAg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vbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5mbG9hdCAhPT0gMCAvKiBOT05FICovO1xuICAgICAgICB9O1xuICAgICAgICBDU1NQYXJzZWREZWNsYXJhdGlvbi5wcm90b3R5cGUuaXNJbmxpbmVMZXZlbCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiAoY29udGFpbnModGhpcy5kaXNwbGF5LCA0IC8qIElOTElORSAqLykgfHxcbiAgICAgICAgICAgICAgICBjb250YWlucyh0aGlzLmRpc3BsYXksIDMzNTU0NDMyIC8qIElOTElORV9CTE9DSyAqLykgfHxcbiAgICAgICAgICAgICAgICBjb250YWlucyh0aGlzLmRpc3BsYXksIDI2ODQzNTQ1NiAvKiBJTkxJTkVfRkxFWCAqLykgfHxcbiAgICAgICAgICAgICAgICBjb250YWlucyh0aGlzLmRpc3BsYXksIDUzNjg3MDkxMiAvKiBJTkxJTkVfR1JJRCAqLykgfHxcbiAgICAgICAgICAgICAgICBjb250YWlucyh0aGlzLmRpc3BsYXksIDY3MTA4ODY0IC8qIElOTElORV9MSVNUX0lURU0gKi8pIHx8XG4gICAgICAgICAgICAgICAgY29udGFpbnModGhpcy5kaXNwbGF5LCAxMzQyMTc3MjggLyogSU5MSU5FX1RBQkxFICovKSk7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBDU1NQYXJzZWREZWNsYXJhdGlvbjtcbiAgICB9KCkpO1xuICAgIHZhciBDU1NQYXJzZWRQc2V1ZG9EZWNsYXJhdGlvbiA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgZnVuY3Rpb24gQ1NTUGFyc2VkUHNldWRvRGVjbGFyYXRpb24oY29udGV4dCwgZGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMuY29udGVudCA9IHBhcnNlKGNvbnRleHQsIGNvbnRlbnQsIGRlY2xhcmF0aW9uLmNvbnRlbnQpO1xuICAgICAgICAgICAgdGhpc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gICBjYXNlICdjb2xvcic6XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29sb3IkMS5wYXJzZShjb250ZXh0LCBwYXJzZXIucGFyc2VDb21wb25lbnRWYWx1ZSgpKTtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaW1hZ2UnOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGltYWdlLnBhcnNlKGNvbnRleHQsIHBhcnNlci5wYXJzZUNvbXBvbmVudFZhbHVlKCkpO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdsZW5ndGgnOlxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxlbmd0aF8xID0gcGFyc2VyLnBhcnNlQ29tcG9uZW50VmFsdWUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpc0xlbmd0aChsZW5ndGhfMSkgPyBsZW5ndGhfMSA6IFpFUk9fTEVOR1RIO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICdsZW5ndGgtcGVyY2VudGFnZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWVfMSA9IHBhcnNlci5wYXJzZUNvbXBvbmVudFZhbHVlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXNMZW5ndGhQZXJjZW50YWdlKHZhbHVlXzEpID8gdmFsdWVfMSA6IFpFUk9fTEVOR1RIO1xuICAgICAgICAgICAgICAgICAgICBjYXNlICd0aW1lJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aW1lLnBhcnNlKGNvbnRleHQsIHBhcnNlci5wYXJzZUNvbXBvbmVudFZhbHVlKCkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgIH07XG5cbiAgICB2YXIgZWxlbWVudERlYnVnZ2VyQXR0cmlidXRlID0gJ2RhdGEtaHRtbDJjYW52YXMtZGVidWcnO1xuICAgIHZhciBnZXRFbGVtZW50RGVidWdUeXBlID0gZnVuY3Rpb24gKGVsZW1lbnQpIHtcbiAgICAgICAgdmFyIGF0dHJpYnV0ZSA9IGVsZW1lbnQuZ2V0QXR0cmlidXRlKGVsZW1lbnREZWJ1Z2dlckF0dHJpYnV0ZSk7XG4gICAgICAgIHN3aXRjaCAoYXR0cmlidXRlKSB7XG4gICAgICAgICAgICBjYXNlICdhbGwnOlxuICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIEFMTCAqLztcbiAgICAgICAgICAgIGNhc2UgJ2Nsb25lJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMiAvKiBDTE9ORSAqLztcbiAgICAgICAgICAgIGNhc2UgJ3BhcnNlJzpcbiAgICAgICAgICAgICAgICByZXR1cm4gMyAvKiBQQVJTRSAqLztcbiAgICAgICAgICAgIGNhc2UgJ3JlbmRlcic6XG4gICAgICAgICAgICAgICAgcmV0dXJuIDQgLyogUkVOREVSICovO1xuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gMCAvKiBOT05FICovO1xuICAgICAgICB9XG4gICAgfTtcbiAgICB2YXIgaXNEZWJ1Z2dpbmcgPSBmdW5jdGlvbiAoZWxlbWVudCwgdHlwZSkge1xuICAgICAgICB2YXIgZWxlbWVudFR5cGUgPSBnZXRFbGVtZW50RGVidWdUeXBlKGVsZW1lbnQpO1xuICAgICAgICByZXR1cm4gZWxlbWVudFR5cGUgPT09IDEgLyogQUxMICovIHx8IHR5cGUgPT09IGVsZW1lbnRUeXBlO1xuICAgIH07XG5cbiAgICB2YXIgRWxlbWVudENvbnRhaW5lciA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgZnVuY3Rpb24gRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KSB7XG4gICAgICAgICAgICB0aGlzLmNvbnRleHQgPSBjb250ZXh0O1xuICAgICAgICAgICAgdGhpcy50ZXh0Tm9kZXMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuZWxlbWVudHMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMuZmxhZ3MgPSAwO1xuICAgICAgICAgICAgaWYgKGlzRGVidWdnaW5nKGVsZW1lbnQsIDMgLyogUEFSU0UgKi8pKSB7XG4gICAgICAgICAgICAgICAgZGVidWdnZXI7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLnN0eWxlcyA9IG5ldyBDU1NQYXJzZWREZWNsYXJhdGlvbihjb250ZXh0LCB3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShlbGVtZW50LCBudWxsKSk7XG4gICAgICAgICAgICBpZiAoaXNIVE1MRWxlbWVudE5vZGUoZWxlbWVudCkpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zdHlsZXMuYW5pbWF0aW9uRHVyYXRpb24uc29tZShmdW5jdGlvbiAoZHVyYXRpb24pIHsgcmV0dXJuIGR1cmF0aW9uID4gMDsgfSkpIHtcbiAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zdHlsZS5hbmltYXRpb25EdXJhdGlvbiA9ICcwcyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICh0aGlzLnN0eWxlcy50cmFuc2Zvcm0gIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZ2V0Qm91bmRpbmdDbGllbnRSZWN0IHRha2VzIHRyYW5zZm9ybXMgaW50byBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuc3R5bGUudHJhbnNmb3JtID0gJ25vbmUnO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuYm91bmRzID0gcGFyc2VCb3VuZHModGhpcy5jb250ZXh0LCBlbGVtZW50KTtcbiAgICAgICAgICAgIGlmIChpc0RlYnVnZ2luZyhlbGVtZW50LCA0IC8qIFJFTkRFUiAqLykpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm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1BfSU5ERVhfMl9PRkZTRVQgKyAoKGNvZGVQb2ludCAtIDB4ZDgwMCkgPj4gVVRSSUUyX1NISUZUXzIpXTtcbiAgICAgICAgICAgICAgICAgICAgaXggPSAoaXggPDwgVVRSSUUyX0lOREVYX1NISUZUKSArIChjb2RlUG9pbnQgJiBVVFJJRTJfREFUQV9NQVNLKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YVtpeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPCB0aGlzLmhpZ2hTdGFydCkge1xuICAgICAgICAgICAgICAgICAgICAvLyBTdXBwbGVtZW50YWwgY29kZSBwb2ludCwgdXNlIHR3by1sZXZlbCBsb29rdXAuXG4gICAgICAgICAgICAgICAgICAgIGl4ID0gVVRSSUUyX0lOREVYXzFfT0ZGU0VUIC0gVVRSSUUyX09NSVRURURfQk1QX0lOREVYXzFfTEVOR1RIICsgKGNvZGVQb2ludCA+PiBVVFJJRTJfU0hJRlRfMSk7XG4gICAgICAgICAgICAgICAgICAgIGl4ID0gdGhpcy5pbmRleFtpeF07XG4gICAgICAgICAgICAgICAgICAgIGl4ICs9IChjb2RlUG9pbnQgPj4gVVRSSUUyX1NISUZUXzIpICYgVVRSSUUyX0lOREVYXzJfTUFTSztcbiAgICAgICAgICAgICAgICAgICAgaXggPSB0aGlzLmluZGV4W2l4XTtcbiAgICAgICAgICAgICAgICAgICAgaXggPSAoaXggPDwgVVRSSUUyX0lOREVYX1NISUZUKSArIChjb2RlUG9pbnQgJiBVVFJJRTJfREFUQV9NQVNLKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YVtpeF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPD0gMHgxMGZmZmYpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZGF0YVt0aGlzLmhpZ2hWY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TtcbiAgICB2YXIgU3BhY2luZ01hcmsgPSA3O1xuICAgIHZhciBMID0gODtcbiAgICB2YXIgViA9IDk7XG4gICAgdmFyIFQgPSAxMDtcbiAgICB2YXIgTFYgPSAxMTtcbiAgICB2YXIgTFZUID0gMTI7XG4gICAgdmFyIFpXSiA9IDEzO1xuICAgIHZhciBFeHRlbmRlZF9QaWN0b2dyYXBoaWMgPSAxNDtcbiAgICB2YXIgUkkgPSAxNTtcbiAgICB2YXIgdG9Db2RlUG9pbnRzID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICB2YXIgY29kZVBvaW50cyA9IFtdO1xuICAgICAgICB2YXIgaSA9IDA7XG4gICAgICAgIHZhciBsZW5ndGggPSBzdHIubGVuZ3RoO1xuICAgICAgICB3aGlsZSAoaSA8IGxlbmd0aCkge1xuICAgICAgICAgICAgdmFyIHZhbHVlID0gc3RyLmNoYXJDb2RlQXQoaSsrKTtcbiAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAweGQ4MDAgJiYgdmFsdWUgPD0gMHhkYmZmICYmIGkgPCBsZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZXh0cmEgPSBzdHIuY2hhckNvZGVBdChpKyspO1xuICAgICAgICAgICAgICAgIGlmICgoZXh0cmEgJiAweGZjMDApID09PSAweGRjMDApIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZVBvaW50cy5wdXNoKCgodmFsdWUgJiAweDNmZikgPDwgMTApICsgKGV4dHJhICYgMHgzZmYpICsgMHgxMDAwMCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBjb2RlUG9pbnRzLnB1c2godmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICBpLS07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29kZVBvaW50cy5wdXNoKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gY29kZVBvaW50cztcbiAgICB9O1xuICAgIHZhciBmcm9tQ29kZVBvaW50ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICB2YXIgY29kZVBvaW50cyA9IFtdO1xuICAgICAgICBmb3IgKHZhciBfaSA9IDA7IF9pIDwgYXJndW1lbnRzLmxlbmd0aDsgX2krKykge1xuICAgICAgICAgICAgY29kZVBvaW50c1tfaV0gPSBhcmd1bWVudHNbX2ldO1xuICAgICAgICB9XG4gICAgICAgIGlmIChTdHJpbmcuZnJvbUNvZGVQb2ludCkge1xuICAgICAgICAgICAgcmV0dXJuIFN0cmluZy5mcm9tQ29kZVBvaW50LmFwcGx5KFN0cmluZywgY29kZVBvaW50cyk7XG4gICAgICAgIH1cbiAgICAgICAgdmFyIGxlbmd0aCA9IGNvZGVQb2ludHMubGVuZ3RoO1xuICAgICAgICBpZiAoIWxlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuICcnO1xuICAgICAgICB9XG4gICAgICAgIHZhciBjb2RlVW5pdHMgPSBbXTtcbiAgICAgICAgdmFyIGluZGV4ID0gLTE7XG4gICAgICAgIHZhciByZXN1bHQgPSAnJztcbiAgICAgICAgd2hpbGUgKCsraW5kZXggPCBsZW5ndGgpIHtcbiAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBjb2RlUG9pbnRzW2luZGV4XTtcbiAgICAgICAgICAgIGlmIChjb2RlUG9pbnQgPD0gMHhmZmZmKSB7XG4gICAgICAgICAgICAgICAgY29kZVVuaXRzLnB1c2goY29kZVBvaW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNvZGVQb2ludCAtPSAweDEwMDAwO1xuICAgICAgICAgICAgICAgIGNvZGVVbml0cy5wdXNoKChjb2RlUG9pbnQgPj4gMTApICsgMHhkODAwLCAoY29kZVBvaW50ICUgMHg0MDApICsgMHhkYzAw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UQ7XG4gICAgICAgIH1cbiAgICAgICAgLy8gR0I0IE90aGVyd2lzZSwgYnJlYWsgYmVmb3JlIGFuZCBhZnRlciBjb250cm9scy5cbiAgICAgICAgaWYgKGN1cnJlbnQgPT09IENSIHx8IGN1cnJlbnQgPT09IExGIHx8IGN1cnJlbnQgPT09IENvbnRyb2wpIHtcbiAgICAgICAgICAgIHJldHVybiBCUkVBS19BTExPV0VEO1xuICAgICAgICB9XG4gICAgICAgIC8vIEdCNVxuICAgICAgICBpZiAobmV4dCA9PT0gQ1IgfHwgbmV4dCA9PT0gTEYgfHwgbmV4dCA9PT0gQ29udHJvbCkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX0FMTE9XRUQ7XG4gICAgICAgIH1cbiAgICAgICAgLy8gRG8gbm90IGJyZWFrIEhhbmd1bCBzeWxsYWJsZSBzZXF1ZW5jZXMuXG4gICAgICAgIC8vIEdCNlxuICAgICAgICBpZiAoY3VycmVudCA9PT0gTCAmJiBbTCwgViwgTFYsIExWVF0uaW5kZXhPZihuZXh0KSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHJldHVybiBCUkVBS19OT1RfQUxMT1dFRDtcbiAgICAgICAgfVxuICAgICAgICAvLyBHQjdcbiAgICAgICAgaWYgKChjdXJyZW50ID09PSBMViB8fCBjdXJyZW50ID09PSBWKSAmJiAobmV4dCA9PT0gViB8fCBuZXh0ID09PSBUKSkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICB9XG4gICAgICAgIC8vIEdCOFxuICAgICAgICBpZiAoKGN1cnJlbnQgPT09IExWVCB8fCBjdXJyZW50ID09PSBUKSAmJiBuZXh0ID09PSBUKSB7XG4gICAgICAgICAgICByZXR1cm4gQlJFQUtfTk9UX0FMTE9XRUQ7XG4gICAgICAgIH1cbiAgICAgICAgLy8gR0I5IERvIG5vdCBicmVhayBiZWZvcmUgZXh0ZW5kaW5nIGNoYXJhY3RlcnMgb3IgWldKLlxuICAgICAgICBpZiAobmV4dCA9PT0gWldKIHx8IG5leHQgPT09IEV4dGVuZCkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICB9XG4gICAgICAgIC8vIERvIG5vdCBicmVhayBiZWZvcmUgU3BhY2luZ01hcmtzLCBvciBhZnRlciBQcmVwZW5kIGNoYXJhY3RlcnMuXG4gICAgICAgIC8vIEdCOWFcbiAgICAgICAgaWYgKG5leHQgPT09IFNwYWNpbmdNYXJrKSB7XG4gICAgICAgICAgICByZXR1cm4gQlJFQUtfTk9UX0FMTE9XRUQ7XG4gICAgICAgIH1cbiAgICAgICAgLy8gR0I5YVxuICAgICAgICBpZiAoY3VycmVudCA9PT0gUHJlcGVuZCkge1xuICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICB9XG4gICAgICAgIC8vIEdCMTEgRG8gbm90IGJyZWFrIHdpdGhpbiBlbW9qaSBtb2RpZmllciBzZXF1ZW5jZXMgb3IgZW1vamkgendqIHNlcXVlbmNlcy5cbiAgICAgICAgaWYgKGN1cnJlbnQgPT09IFpXSiAmJiBuZXh0ID09PSBFeHRlbmRlZF9QaWN0b2dyYXBoaWMpIHtcbiAgICAgICAgICAgIHdoaWxlIChwcmV2ID09PSBFeHRlbmQpIHtcbiAgICAgICAgICAgICAgICBwcmV2ID0gY2xhc3NUeXBlc1stLXByZXZJbmRleF07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAocHJldiA9PT0gRXh0ZW5kZWRfUGljdG9ncmFwaGljKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIEdCMTIgRG8gbm90IGJyZWFrIHdpdGhpbiBlbW9qaSBmbGFnIHNlcXVlbmNlcy5cbiAgICAgICAgLy8gVGhhdCBpcywgZG8gbm90IGJyZWFrIGJldHdlZW4gcmVnaW9uYWwgaW5kaWNhdG9yIChSSSkgc3ltYm9sc1xuICAgICAgICAvLyBpZiB0aGVyZSBpcyBhbiBvZGQgbnVtYmVyIG9mIFJJIGNoYXJhY3RlcnMgYmVmb3JlIHRoZSBicmVhayBwb2ludC5cbiAgICAgICAgaWYgKGN1cnJlbnQgPT09IFJJICYmIG5leHQgPT09IFJJKSB7XG4gICAgICAgICAgICB2YXIgY291bnRSSSA9IDA7XG4gICAgICAgICAgICB3aGlsZSAocHJldiA9PT0gUkkpIHtcbiAgICAgICAgICAgICAgICBjb3VudFJJKys7XG4gICAgICAgICAgICAgICAgcHJldiA9IGNsYXNzVHlwZXNbLS1wcmV2SW5kZXhdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGNvdW50UkkgJSAyID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBCUkVBS19BTExPV0VEO1xuICAgIH07XG4gICAgdmFyIEdyYXBoZW1lQnJlYWtlciA9IGZ1bmN0aW9uIChzdHIpIHtcbiAgICAgICAgdmFyIGNvZGVQb2ludHMgPSB0b0NvZGVQb2ludHMoc3RyKTtcbiAgICAgICAgdmFyIGxlbmd0aCA9IGNvZGVQb2ludHMubGVuZ3RoO1xuICAgICAgICB2YXIgaW5kZXggPSAwO1xuICAgICAgICB2YXIgbGFzdEVuZCA9IDA7XG4gICAgICAgIHZhciBjbGFzc1R5cGVzID0gY29kZVBvaW50cy5tYXAoY29kZVBvaW50VG9DbGFzcyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICBuZXh0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geyBkb25lOiB0cnVlLCB2YWx1ZTogbnVsbCB9O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgZ3JhcGhlbWVCcmVhayA9IEJSRUFLX05PVF9BTExPV0VEO1xuICAgICAgICAgICAgICAgIHdoaWxlIChpbmRleCA8IGxlbmd0aCAmJlxuICAgICAgICAgICAgICAgICAgICAoZ3JhcGhlbWVCcmVhayA9IF9ncmFwaGVtZUJyZWFrQXRJbmRleChjb2RlUG9pbnRzLCBjbGFzc1R5cGVzLCArK2luZGV4KSkgPT09IEJSRUFLX05PVF9BTExPV0VEKSB7IH1cbiAgICAgICAgICAgICAgICBpZiAoZ3JhcGhlbWVCcmVhayAhPT0gQlJFQUtfTk9UX0FMTE9XRUQgfHwgaW5kZXggPT09IGxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBmcm9tQ29kZVBvaW50LmFwcGx5KG51bGwsIGNvZGVQb2ludHMuc2xpY2UobGFzdEVuZCwgaW5kZXgpKTtcbiAgICAgICAgICAgICAgICAgICAgbGFzdEVuZCA9IGluZGV4O1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4geyB2YWx1ZTogdmFsdWUsIGRvbmU6IGZhbHNlIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB7IGRvbmU6IHRydWUsIHZhbHVlOiBudWxsIH07XG4gICAgICAgICAgICB9LFxuICAgICAgICB9O1xuICAgIH07XG4gICAgdmFyIHNwbGl0R3JhcGhlbWVzID0gZnVuY3Rpb24gKHN0cikge1xuICAgICAgICB2YXIgYnJlYWtlciA9IEdyYXBoZW1lQnJlYWtlcihzdHIpO1xuICAgICAgICB2YXIgZ3JhcGhlbWVzID0gW107XG4gICAgICAgIHZhciBiaztcbiAgICAgICAgd2hpbGUgKCEoYmsgPSBicmVha2VyLm5leHQoKSkuZG9uZSkge1xuICAgICAgICAgICAgaWYgKGJrLnZhbHVlKSB7XG4gICAgICAgICAgICAgICAgZ3JhcGhlbWVzLnB1c2goYmsudmFsdWUu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HN0eWxlcywgbm9kZSkge1xuICAgICAgICB2YXIgdGV4dExpc3QgPSBicmVha1RleHQodmFsdWUsIHN0eWxlcyk7XG4gICAgICAgIHZhciB0ZXh0Qm91bmRzID0gW107XG4gICAgICAgIHZhciBvZmZzZXQgPSAwO1xuICAgICAgICB0ZXh0TGlzdC5mb3JFYWNoKGZ1bmN0aW9uICh0ZXh0KSB7XG4gICAgICAgICAgICBpZiAoc3R5bGVzLnRleHREZWNvcmF0aW9uTGluZS5sZW5ndGggfHwgdGV4dC50cmltKCkubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgIGlmIChGRUFUVVJFUy5TVVBQT1JUX1JBTkdFX0JPVU5EUykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY2xpZW50UmVjdHMgPSBjcmVhdGVSYW5nZShub2RlLCBvZmZzZXQsIHRleHQubGVuZ3RoKS5nZXRDbGllbnRSZWN0cygpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2xpZW50UmVjdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1YlNlZ21lbnRzID0gc2VnbWVudEdyYXBoZW1lcyh0ZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdWJPZmZzZXRfMSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJTZWdtZW50cy5mb3JFYWNoKGZ1bmN0aW9uIChzdWJTZWdtZW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEJvdW5kcy5wdXNoKG5ldyBUZXh0Qm91bmRzKHN1YlNlZ21lbnQsIEJvdW5kcy5mcm9tRE9NUmVjdExpc3QoY29udGV4dCwgY3JlYXRlUmFuZ2Uobm9kZSwgc3ViT2Zmc2V0XzEgKyBvZmZzZXQsIHN1YlNlZ21lbnQubGVuZ3RoKS5nZXRDbGllbnRSZWN0cygpKSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Yk9mZnNldF8xICs9IHN1YlNlZ21lbnQubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0Qm91bmRzLnB1c2gobmV3IFRleHRCb3VuZHModGV4dCwgQm91bmRzLmZyb21ET01SZWN0TGlzdChjb250ZXh0LCBjbGllbnRSZWN0cykpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcGxhY2VtZW50Tm9kZSA9IG5vZGUuc3BsaXRUZXh0KHRleHQubGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgdGV4dEJvdW5kcy5wdXNoKG5ldyBUZXh0Qm91bmRzKHRleHQsIGdldFdyYXBwZXJCb3VuZHMoY29udGV4dCwgbm9kZSkpKTtcbiAgICAgICAgICAgICAgICAgICAgbm9kZSA9IHJlcGxhY2VtZW50Tm9kZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICghRkVBVFVSRVMuU1VQUE9SVF9SQU5HRV9CT1VORFMpIHtcbiAgICAgICAgICAgICAgICBub2RlID0gbm9kZS5zcGxpdFRleHQodGV4dC5sZW5ndGgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb2Zmc2V0ICs9IHRleHQubGVuZ3RoO1xuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRleHRCb3VuZHM7XG4gICAgfTtcbiAgICB2YXIgZ2V0V3JhcHBlckJvdW5kcyA9IGZ1bmN0aW9uIChjb250ZXh0LCBub2RlKSB7XG4gICAgICAgIHZhciBvd25lckRvY3VtZW50ID0gbm9kZS5vd25lckRvY3VtZW50O1xuICAgICAgICBpZiAob3duZXJEb2N1bWVudCkge1xuICAgICAgICAgICAgdmFyIHdyYXBwZXIgPSBvd25lckRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2h0bWwyY2FudmFzd3JhcHBlcicpO1xuICAgICAgICAgICAgd3JhcHBlci5hcHBlbmRDaGlsZChub2RlLmNsb25lTm9kZSh0cnVlKSk7XG4gICAgICAgICAgICB2YXIgcGFyZW50Tm9kZSA9IG5vZGUucGFyZW50Tm9kZTtcbiAgICAgICAgICAgIGlmIChwYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgcGFyZW50Tm9kZS5yZXBsYWNlQ2hpbGQod3JhcHBlciwgbm9kZSk7XG4gICAgICAgICAgICAgICAgdmFyIGJvdW5kcyA9IHBhcnNlQm91bmRzKGNvbnRleHQsIHdyYXBwZXIpO1xuICAgICAgICAgICAgICAgIGlmICh3cmFwcGVyLmZpcnN0Q2hpbGQpIHtcbiAgICAgICAgICAgICAgICAgICAgcGFyZW50Tm9kZS5yZXBsYWNlQ2hpbGQod3JhcHBlci5maXJzdENoaWxkLCB3cmFwcGVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGJvdW5kcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQm91bmRzLkVNUFRZO1xuICAgIH07XG4gICAgdmFyIGNyZWF0ZVJhbmdlID0gZnVuY3Rpb24gKG5vZGUsIG9mZnNldCwgbGVuZ3RoKSB7XG4gICAgICAgIHZhciBvd25lckRvY3VtZW50ID0gbm9kZS5vd25lckRvY3VtZW50O1xuICAgICAgICBpZiAoIW93bmVyRG9jdW1lbnQpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm9kZSBoYXMgbm8gb3duZXIgZG9jdW1lbnQnKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgcmFuZ2UgPSBvd25lckRvY3VtZW50LmNyZWF0ZVJhbmdlKCk7XG4gICAgICAgIHJhbmdlLnNldFN0YXJ0KG5vZGUsI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XdvcmQnIDogc3R5bGVzLndvcmRCcmVha1xuICAgICAgICB9KTtcbiAgICAgICAgdmFyIHdvcmRzID0gW107XG4gICAgICAgIHZhciBiaztcbiAgICAgICAgdmFyIF9sb29wXzEgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICBpZiAoYmsudmFsdWUpIHtcbiAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBiay52YWx1ZS5zbGljZSgpO1xuICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnRzID0gdG9Db2RlUG9pbnRzJDEodmFsdWUpO1xuICAgICAgICAgICAgICAgIHZhciB3b3JkXzEgPSAnJztcbiAgICAgICAgICAgICAgICBjb2RlUG9pbnRzLmZvckVhY2goZnVuY3Rpb24gKGNvZGVQb2ludCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAod29yZFNlcGFyYXRvcnMuaW5kZXhPZihjb2RlUG9pbnQpID09PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgd29yZF8xICs9IGZyb21Db2RlUG9pbnQkMShjb2RlUG9pbnQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdvcmRfMS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3b3Jkcy5wdXNoKHdvcmRfMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB3b3Jkcy5wdXNoKGZyb21Db2RlUG9pbnQkMShjb2RlUG9pbnQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdvcmRfMSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgaWYgKHdvcmRfMS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgd29yZHMucHVzaCh3b3JkXzEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgd2hpbGUgKCEoYmsgPSBicmVha2VyLm5leHQoKSkuZG9uZSkge1xuICAgICAgICAgICAgX2xvb3BfMSgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB3b3JkcztcbiAgICB9O1xuXG4gICAgdmFyIFRleHRDb250YWluZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgICAgIGZ1bmN0aW9uIFRleHRDb250YWluZXIoY29udGV4dCwgbm9kZSwgc3R5bGVzKSB7XG4gICAgICAgICAgICB0aGlzLnRleHQgPSB0cmFuc2Zvcm0obm9kZS5kYXRhLCBzdHlsZXMudGV4dFRyYW5zZm9ybSk7XG4gICAgICAgICAgICB0aGlzLnRleHRCb3VuZHMgPSBwYXJzZVRleHRCb3VuZHMoY29udGV4dCwgdGhpcy50ZXh0LCBzdHlsZXMsIG5vZGUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBUZXh0Q29udGFpbmVyO1xuICAgIH0oKSk7XG4gICAgdmFyIHRyYW5zZm9ybSA9IGZ1bmN0aW9uICh0ZXh0LCB0cmFuc2Zvcm0pIHtcbiAgICAgICAgc3dpdGNoICh0cmFuc2Zvcm0pIHtcbiAgICAgICAgICAgIGNhc2UgMSAvKiBMT1dFUkNBU0UgKi86XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRleHQudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgICAgIGNhc2UgMyAvKiBDQVBJVEFMSVpFICovOlxuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0LnJlcGxhY2UoQ0FQSVRBTElaRSwgY2FwaXRhbGl6ZSk7XG4gICAgICAgICAgICBjYXNlIDIgLyogVVBQRVJDQVNFICovOlxuICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0LnRvVXBwZXJDYXNlKCk7XG4gICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgIHJldHVybiB0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LyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoQ2FudmFzRWxlbWVudENvbnRhaW5lciwgX3N1cGVyKTtcbiAgICAgICAgZnVuY3Rpb24gQ2FudmFzRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBjYW52YXMpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIGNvbnRleHQsIGNhbnZhcykgfHwgdGhpcztcbiAgICAgICAgICAgIF90aGlzLmNhbnZhcyA9IGNhbnZhcztcbiAgICAgICAgICAgIF90aGlzLmludHJpbnNpY1dpZHRoID0gY2FudmFzLndpZHRoO1xuICAgICAgICAgICAgX3RoaXMuaW50cmluc2ljSGVpZ2h0ID0gY2FudmFzLmhlaWdodDtcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gQ2FudmFzRWxlbWVudENvbnRhaW5lcjtcbiAgICB9KEVsZW1lbnRDb250YWluZXIpKTtcblxuICAgIHZhciBTVkdFbGVtZW50Q29udGFpbmVyID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoU1ZHRWxlbWVudENvbnRhaW5lciwgX3N1cGVyKTtcbiAgICAgICAgZnVuY3Rpb24gU1ZHRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBpbWcpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIGNvbnRleHQsIGltZykgfHwgdGhpcztcbiAgICAgICAgICAgIHZhciBzID0gbmV3IFhNTFNlcmlhbGl6ZXIoKTtcbiAgICAgICAgICAgIHZhciBib3VuZHMgPSBwYXJzZUJvdW5kcyhjb250ZXh0LCBpbWcpO1xuICAgICAgICAgICAgaW1nLnNldEF0dHJpYnV0ZSgnd2lkdGgnLCBib3VuZHMud2lkdGggKyBcInB4XCIpO1xuICAgICAgICAgICAgaW1nLnNldEF0dHJpYnV0ZSgnaGVpZ2h0JywgYm91bmRzLmhlaWdodCArIFwicHhcIik7XG4gICAgICAgICAgICBfdGhpcy5zdmcgPSBcImRhdGE6aW1hZ2Uvc3ZnK3htbCxcIiArIGVuY29kZVVSSUNvbXBvbmVudChzLnNlcmlhbGl6ZVRvU3RyaW5nKGltZykpO1xuICAgICAgICAgICAgX3RoaXMuaW50cmluc2ljV2lkdGggPSBpbWcud2lkdGguYmFzZVZhbC52YWx1ZTtcbiAgICAgICAgICAgIF90aGlzLmludHJpbnNpY0hlaWdodCA9IGltZy5oZWlnaHQuYmFzZVZhbC52YWx1ZTtcbiAgICAgICAgICAgIF90aGlzLmNvbnRleHQuY2FjaGUuYWRkSW1hZ2UoX3RoaXMuc3ZnKTtcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gU1ZHRWxlbWVudENvbnRhaW5lcjtcbiAgICB9KEVsZW1lbnRDb250YWluZXIpKTtcblxuICAgIHZhciBMSUVsZW1lbnRDb250YWluZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgICAgIF9fZXh0ZW5kcyhMSUVsZW1lbnRDb250YWluZXIsIF9zdXBlcik7XG4gICAgICAgIGZ1bmN0aW9uIExJRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzLCBjb250ZXh0LCBlbGVtZW50KSB8fCB0aGlzO1xuICAgICAgICAgICAgX3RoaXMudmFsdWUgPSBlbGVtZW50LnZhbHVlO1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBMSUVsZW1lbnRDb250YWluZXI7XG4gICAgfShFbGVtZW50Q29udGFpbmVyKSk7XG5cbiAgICB2YXIgT0xFbGVtZW50Q29udGFpbmVyID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoT0xFbGVtZW50Q29udGFpbmVyLCBfc3VwZXIpO1xuICAgICAgICBmdW5jdGlvbiBPTEVsZW1lbnRDb250YWluZXIoY29udGV4dCwgZWxlbWVudCkge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcywgY29udGV4dCwgZWxlbWVudCkgfHwgdGhpcztcbiAgICAgICAgICAgIF90aGlzLnN0YXJ0ID0gZWxlbWVudC5zdGFydDtcbiAgICAgICAgICAgIF90aGlzLnJldmVyc2VkID0gdHlwZW9mIGVsZW1lbnQucmV2ZXJzZWQgPT09ICdib29sZWFuJyAmJiBlbGVtZW50LnJldmVyc2VkID09PSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBPTEVsZW1lbnRDb250YWluZXI7XG4gICAgfShFbGVtZW50Q29udGFpbmVyKSk7XG5cbiAgICB2YXIgQ0hFQ0tCT1hfQk9SREVSX1JBRElVUyA9IFtcbiAgICAgICAge1xuICAgICAgICAgICAgdHlwZTogMTUgLyogRElNRU5TSU9OX1RPS0VOICovLFxuICAgICAgICAgICAgZmxhZ3M6IDAsXG4gICAgICAgICAgICB1bml0OiAncHgnLFxuICAgICAgICAgICAgbnVtYmVyOiAzXG4gICAgICAgIH1cbiAgICBdO1xuICAgIHZhciBSQURJT19CT1JERVJfUkFESVVTID0gW1xuICAgICAgICB7XG4gICAgICAgICAgICB0eXBlOiAxNiAvKiBQRVJDRU5UQUdFX1RPS0VOICovLFxuICAgICAgICAgICAgZmxhZ3M6IDAsXG4gICAgICAgICAgICBudW1iZXI6IDUwXG4gICAgICAgIH1cbiAgICBdO1xuICAgIHZhciByZWZvcm1hdElucHV0Qm91bmRzID0gZnVuY3Rpb24gKGJvdW5kcykge1xuICAgICAgICBpZiAoYm91bmRzLndpZHRoID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cbiAgICAgICAgZnVuY3Rpb24gSW5wdXRFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGlucHV0KSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzLCBjb250ZXh0LCBpbnB1dCkgfHwgdGhpcztcbiAgICAgICAgICAgIF90aGlzLnR5cGUgPSBpbnB1dC50eXBlLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICBfdGhpcy5jaGVja2VkID0gaW5wdXQuY2hlY2tlZDtcbiAgICAgICAgICAgIF90aGlzLnZhbHVlID0gZ2V0SW5wdXRWYWx1ZShpbnB1dCk7XG4gICAgICAgICAgICBpZiAoX3RoaXMudHlwZSA9PT0gQ0hFQ0tCT1ggfHwgX3RoaXMudHlwZSA9PT0gUkFESU8pIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYmFja2dyb3VuZENvbG9yID0gMHhkZWRlZGVmZjtcbiAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyVG9wQ29sb3IgPVxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyUmlnaHRDb2xvciA9XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyQm90dG9tQ29sb3IgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJMZWZ0Q29sb3IgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweGE1YTVhNWZmO1xuICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJUb3BXaWR0aCA9XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJSaWdodFdpZHRoID1cbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJCb3R0b21XaWR0aCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlckxlZnRXaWR0aCA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE7XG4gICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlclRvcFN0eWxlID1cbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlclJpZ2h0U3R5bGUgPVxuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlckJvdHRvbVN0eWxlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyTGVmdFN0eWxlID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAvKiBTT0xJRCAqLztcbiAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYmFja2dyb3VuZENsaXAgPSBbMCAvKiBCT1JERVJfQk9YICovXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYmFja2dyb3VuZE9yaWdpbiA9IFswIC8qIEJPUkRFUl9CT1ggKi9dO1xuICAgICAgICAgICAgICAgIF90aGlzLmJvdW5kcyA9IHJlZm9ybWF0SW5wdXRCb3VuZHMoX3RoaXMuYm91bmRzKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHN3aXRjaCAoX3RoaXMudHlwZSkge1xuICAgICAgICAgICAgICAgIGNhc2UgQ0hFQ0tCT1g6XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJUb3BSaWdodFJhZGl1cyA9XG4gICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyVG9wTGVmdFJhZGl1cyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlckJvdHRvbVJpZ2h0UmFkaXVzID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlckJvdHRvbUxlZnRSYWRpdXMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0tCT1hfQk9SREVSX1JBRElVUztcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSBSQURJTzpcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuc3R5bGVzLmJvcmRlclRvcFJpZ2h0UmFkaXVzID1cbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnN0eWxlcy5ib3JkZXJUb3BMZWZ0UmFkaXVzID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyQm90dG9tUmlnaHRSYWRpdXMgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5zdHlsZXMuYm9yZGVyQm90dG9tTGVmdFJhZGl1cyA9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSQURJT19CT1JERVJfUkFESVVTO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gSW5wdXRFbGVtZW50Q29udGFpbmVyO1xuICAgIH0oRWxlbWVudENvbnRhaW5lcikpO1xuXG4gICAgdmFyIFNlbGVjdEVsZW1lbnRDb250YWluZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgICAgIF9fZXh0ZW5kcyhTZWxlY3RFbGVtZW50Q29udGFpbmVyLCBfc3VwZXIpO1xuICAgICAgICBmdW5jdGlvbiBTZWxlY3RFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IF9zdXBlci5jYWxsKHRoaXMsIGNvbnRleHQsIGVsZW1lbnQpIHx8IHRoaXM7XG4gICAgICAgICAgICB2YXIgb3B0aW9uID0gZWxlbWVudC5vcHRpb25zW2VsZW1lbnQuc2VsZWN0ZWRJbmRleCB8fCAwXTtcbiAgICAgICAgICAgIF90aGlzLnZhbHVlID0gb3B0aW9uID8gb3B0aW9uLnRleHQgfHwgJycgOiAnJztcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gU2VsZWN0RWxlbWVudENvbnRhaW5lcjtcbiAgICB9KEVsZW1lbnRDb250YWluZXIpKTtcblxuICAgIHZhciBUZXh0YXJlYUVsZW1lbnRDb250YWluZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgICAgIF9fZXh0ZW5kcyhUZXh0YXJlYUVsZW1lbnRDb250YWluZXIsIF9zdXBlcik7XG4gICAgICAgIGZ1bmN0aW9uIFRleHRhcmVhRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzLCBjb250ZXh0LCBlbGVtZW50KSB8fCB0aGlzO1xuICAgICAgICAgICAgX3RoaXMudmFsdWUgPSBlbGVtZW50LnZhbHVlO1xuICAgICAgICAgICAgcmV0dXJuIF90aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBUZXh0YXJlYUVsZW1lbnRDb250YWluZXI7XG4gICAgfShFbGVtZW50Q29udGFpbmVyKSk7XG5cbiAgICB2YXIgSUZyYW1lRWxlbWVudENvbnRhaW5lciA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uIChfc3VwZXIpIHtcbiAgICAgICAgX19leHRlbmRzKElGcmFtZUVsZW1lbnRDb250YWluZXIsIF9zdXBlcik7XG4gICAgICAgIGZ1bmN0aW9uIElGcmFtZUVsZW1lbnRDb250YWluZXIoY29udGV4dCwgaWZyYW1lKSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSBfc3VwZXIuY2FsbCh0aGlzLCBjb250Z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sb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IENPTE9SUy5UUkFOU1BBUkVOVDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJvZHlCYWNrZ3JvdW5kQ29sb3IgPSBpZnJhbWUuY29udGVudFdpbmRvdy5kb2N1bWVudC5ib2R5XG4gICAgICAgICAgICAgICAgICAgICAgICA/IHBhcnNlQ29sb3IoY29udGV4dCwgZ2V0Q29tcHV0ZWRTdHlsZShpZnJhbWUuY29udGVudFdpbmRvdy5kb2N1bWVudC5ib2R5KS5iYWNrZ3JvdW5kQ29sb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICA6IENPTE9SUy5UUkFOU1BBUkVOVDtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuYmFja2dyb3VuZENvbG9yID0gaXNUcmFuc3BhcmVudChkb2N1bWVudEJhY2tncm91bmRDb2xvcilcbiAgICAgICAgICAgICAgICAgICAgICAgID8gaXNUcmFuc3BhcmVudChib2R5QmFja2dyb3VuZENvbG9yKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gX3RoaXMuc3R5bGVzLmJhY2tncm91bmRDb2xvclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogYm9keUJhY2tncm91bmRDb2xvclxuICAgICAgICAgICAgICAgICAgICAgICAgOiBkb2N1bWVudEJhY2tncm91bmRDb2xvcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkgeyB9XG4gICAgICAgICAgICByZXR1cm4gX3RoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIElGcmFtZUVsZW1lbnRDb250YWluZXI7XG4gICAgfShFbGVtZW50Q29udGFpbmVyKSk7XG5cbiAgICB2YXIgTElTVF9PV05FUlMgPSBbJ09MJywgJ1VMJywgJ01FTlUnXTtcbiAgICB2YXIgcGFyc2VOb2RlVHJlZSA9IGZ1bmN0aW9uIChjb250ZXh0LCBub2RlLCBwYXJlb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WxkTm9kZSwgY29udGFpbmVyLCByb290KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5mbGFncyB8PSA0IC8qIENSRUFURVNfUkVBTF9TVEFDS0lOR19DT05URVhUICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoY3JlYXRlc1N0YWNraW5nQ29udGV4dChjb250YWluZXIuc3R5bGVzKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lci5mbGFncyB8PSAyIC8qIENSRUFURVNfU1RBQ0tJTkdfQ09OVEVYVCAqLztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChMSVNUX09XTkVSUy5pbmRleE9mKGNoaWxkTm9kZS50YWdOYW1lKSAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250YWluZXIuZmxhZ3MgfD0gOCAvKiBJU19MSVNUX09XTkVSICovO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50LmVsZW1lbnRzLnB1c2goY29udGFpbmVyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkTm9kZS5zbG90O1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkTm9kZS5zaGFkb3dSb290KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VOb2RlVHJlZShjb250ZXh0LCBjaGlsZE5vZGUuc2hhZG93Um9vdCwgY29udGFpbmVyLCByb290KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCFpc1RleHRhcmVhRWxlbWVudChjaGlsZE5vZGUpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIWlzU1ZHRWxlbWVudChjaGlsZE5vZGUpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIWlzU2VsZWN0RWxlbWVudChjaGlsZE5vZGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VOb2RlVHJlZShjb250ZXh0LCBjaGlsZE5vZGUsIGNvbnRhaW5lciwgcm9vdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHZhciBjcmVhdGVDb250YWluZXIgPSBmdW5jdGlvbiAoY29udGV4dCwgZWxlbWVudCkge1xuICAgICAgICBpZiAoaXNJbWFnZUVsZW1lbnQoZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgSW1hZ2VFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0NhbnZhc0VsZW1lbnQoZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgQ2FudmFzRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNTVkdFbGVtZW50KGVsZW1lbnQpKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFNWR0VsZW1lbnRDb250YWluZXIoY29udGV4dCwgZWxlbWVudCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzTElFbGVtZW50KGVsZW1lbnQpKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IExJRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaXNPTEVsZW1lbnQoZWxlbWVudCkpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgT0xFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0lucHV0RWxlbWVudChlbGVtZW50KSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJbnB1dEVsZW1lbnRDb250YWluZXIoY29udGV4dCwgZWxlbWVudCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzU2VsZWN0RWxlbWVudChlbGVtZW50KSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBTZWxlY3RFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc1RleHRhcmVhRWxlbWVudChlbGVtZW50KSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBUZXh0YXJlYUVsZW1lbnRDb250YWluZXIoY29udGV4dCwgZWxlbWVudCk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzSUZyYW1lRWxlbWVudChlbGVtZW50KSkge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBJRnJhbWVFbGVtZW50Q29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBuZXcgRWxlbWVudENvbnRhaW5lcihjb250ZXh0LCBlbGVtZW50KTtcbiAgICB9O1xuICAgIHZhciBwYXJzZVRyZWUgPSBmdW5jdGlvbiAoY29udGV4dCwgZWxlbWVudCkge1xuICAgICAgICB2YXIgY29udGFpbmVyID0gY3JlYXRlQ29udGFpbmVyKGNvbnRleHQsIGVsZW1lbnQpO1xuICAgICAgICBjb250YWluZXIuZmxhZ3MgfD0gNCAvKiBDUkVBVEVTX1JFQUxfU1RBQ0tJTkdfQ09OVEVYVCAqLztcbiAgICAgICAgcGFyc2VOb2RlVHJlZShjb250ZXh0LCBlbGVtZW50LCBjb250YWluZXIsIGNvbnRhaW5lcik7XG4gICAgICAgIHJldHVybiBjb250YWluZXI7XG4gICAgfTtcbiAgICB2YXIgY3JlYXRlc1JlYWxTdGFja2luZ0NvbnRleHQgPSBmdW5jdGlvbiAob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gKGNvdW50ZXIgJiYgY291bnRlci5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gY291bnRlcltjb3VudGVyLmxlbmd0aCAtIDFdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIDE7XG4gICAgICAgIH07XG4gICAgICAgIENvdW50ZXJTdGF0ZS5wcm90b3R5cGUuZ2V0Q291bnRlclZhbHVlcyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuY291bnRlcnNbbmFtZV07XG4gICAgICAgICAgICByZXR1cm4gY291bnRlciA/IGNvdW50ZXIgOiBbXTtcbiAgICAgICAgfTtcbiAgICAgICAgQ291bnRlclN0YXRlLnByb3RvdHlwZS5wb3AgPSBmdW5jdGlvbiAoY291bnRlcnMpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICBjb3VudGVycy5mb3JFYWNoKGZ1bmN0aW9uIChjb3VudGVyKSB7IHJldHVybiBfdGhpcy5jb3VudGVyc1tjb3VudGVyXS5wb3AoKTsgfSk7XG4gICAgICAgIH07XG4gICAgICAgIENvdW50ZXJTdGF0ZS5wcm90b3R5cGUucGFyc2UgPSBmdW5jdGlvbiAoc3R5bGUpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgY291bnRlckluY3JlbWVudCA9IHN0eWxlLmNvdW50ZXJJbmNyZW1lbnQ7XG4gICAgICAgICAgICB2YXIgY291bnRlclJlc2V0ID0gc3R5bGUuY291bnRlclJlc2V0O1xuICAgICAgICAgICAgdmFyIGNhblJlc2V0ID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChjb3VudGVySW5jcmVtZW50ICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgY291bnRlckluY3JlbWVudC5mb3JFYWNoKGZ1bmN0aW9uIChlbnRyeSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY291bnRlciA9IF90aGlzLmNvdW50ZXJzW2VudHJ5LmNvdW50ZXJdO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRlciAmJiBlbnRyeS5pbmNyZW1lbnQgIT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhblJlc2V0ID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvdW50ZXIubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY291bnRlci5wdXNoKDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY291bnRlcltNYXRoLm1heCgwLCBjb3VudGVyLmxlbmd0aCAtIDEpXSArPSBlbnRyeS5pbmNyZW1lbnQ7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBjb3VudGVyTmFtZXMgPSBbXTtcbiAgICAgICAgICAgIGlmIChjYW5SZXNldCkge1xuICAgICAgICAgICAgICAgIGNvdW50ZXJSZXNldC5mb3JFYWNoKGZ1bmN0aW9uIChlbnRyeSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgY291bnRlciA9IF90aGlzLmNvdW50ZXJzW2VudHJ5LmNvdW50ZXJdO1xuICAgICAgICAgICAgICAgICAgICBjb3VudGVyTmFtZXMucHVzaChlbnRyeS5jb3VudGVyKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFjb3VudGVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb3VudGVyID0gX3RoaXMuY291bnRlcnNbZW50cnkuY291bnRlcl0gPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb3VudGVyLnB1c2goZW50cnkucmVzZXQpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNvdW50ZXJOYW1lcztcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIENvdW50ZXJTdGF0ZTtcbiAgICB9KCkpO1xuICAgIHZhciBST01BTl9VUFBFUiA9IHtcbiAgICAgICAgaW50ZWdlcnM6IFsxMDAwLCA5MDAsIDUwMCwgNDAwLCAxMDAsIDkwLCA1MCwgNDAsIDEwLCA5LCA1LCA0LCAxXSxcbiAgICAgICAgdmFsdWVzOiBbJ00nLCAnQ00nLCAnRCcsICdDRCcsICdDJywgJ1hDJywgJ0wnLCAnWEwnLCAnWCcsICdJWCcsICdWJywgJ0lWJywgJ0knXVxuICAgIH07XG4gICAgdmFyIEFSTUVOSUFOID0ge1xuICAgICAgICBpbnRlZ2VyczogW1xuICAgICAgICAgICAgOTAwMCwgODAwMCwgNzAwMCwgNjAwMCwgNTAwMCwgNDAwMCwgMzAwMCwgMjAwMCwgMTAwMCwgOTAwLCA4MDAsIDcwMCwgNjAwLCA1MDAsIDQwMCwgMzAwLCAyMDAsIDEwMCwgOTAsIDgwLCA3MCxcbiAgICAgICAgICAgIDYwLCA1MCwgNDAsIDMwLCAyMCwgMTAsIDksIDgsIDcsIDYsIDUsIDQsIDMsIDIsIDFcbiAgICAgICAgXSxcbiAgICAgICAgdmFsdWVzOiBbXG4gICAgICAgICAgICAn1ZQnLFxuICAgICAgICAgICAgJ9WTJyxcbiAgICAgICAgICAgICfVkicsXG4gICAgICAgICAgICAn1ZEnLFxuICAgICAgICAgICAgJ9WQJyxcbiAgICAgICAgICAgICfVjycsXG4gICAgICAgICAgICAn1Y4nLFxuICAgICAgICAgICAgJ9WNJyxcbiAgICAgICAgICAgICfVjCcsXG4gICAgICAgICAgICAn1YsnLFxuICAgICAgICAgICAgJ9WKJyxcbiAgICAgICAgICAgICfViScsXG4gICAgICAgICAgICAn1YgnLFxuICAgICAgICAgICAgJ9WHJyxcbiAgICAgICAgICAgICfVhicsXG4gICAgICAgICAgICAn1YUnLFxuICAgICAgICAgICAgJ9WEJyxcbiAgICAgICAgICAgICfVgycsXG4gICAgICAgICAgICAn1YInLFxuICAgICAgICAgICAgJ9WBJyxcbiAgICAgICAgICAgICfVgCcsXG4gICAgICAgICAgICAn1L8nLFxuICAgICAgICAgICAgJ9S+JyxcbiAgICAgICAgICAgICfUvScsXG4gICAgICAgICAgICAn1LwnLFxuICAgICAgICAgICAgJ9S7JyxcbiAgICAgICAgICAgICfUuicsXG4gICAgICAgICAgICAn1LknLFxuICAgICAgICAgICAgJ9S4JyxcbiAgICAgICAgICAgICfUtycsXG4gICAgICAgICAgICAn1LYnLFxuICAgICAgICAgICAgJ9S1JyxcbiAgICAgICAgICAgICfUtCcsXG4gICAgICAgICAgICAn1LMnLFxuICAgICAgICAgICAgJ9SyJyxcbiAgICAgICAgICAgICfUsSdcbiAgICAgICAgXVxuICAgIH07XG4gICAgdmFyIEhFQlJFVyA9IHtcbiAgICAgICAgaW50ZWdlcnM6IFtcbiAgICAgICAgICAgIDEwMDAwLCA5MDAwLCA4MDAwLCA3MDAwLCA2MDAwLCA1MDAwLCA0MDAwLCAzMDAwLCAyMDAwLCAxMDAwLCA0MDAsIDMwMCwgMjAwLCAxMDAsIDkwLCA4MCwgNzAsIDYwLCA1MCwgNDAsIDMwLCAyMCxcbiAgICAgICAgICAgIDE5LCAxOCwgMTcsIDE2LCAxNSwgMTAsIDksIDgsIDcsIDYsIDUsIDQsIDMsIDIsIDFcbiAgICAgICAgXSxcbiAgICAgICAgdmFsdWVzOiBbXG4gICAgICAgICAgICAn15nXsycsXG4gICAgICAgICAgICAn15jXsycsXG4gICAgICAgICAgICAn15fXsycsXG4gICAgICAgICAgICAn15bXsycsXG4gICAgICAgICAgICAn15XXsycsXG4gICAgICAgICAgICAn15TXsycsXG4gICAgICAgICAgICAn15PXsycsXG4gICAgICAgICAgICAn15LXsycsXG4gICAgICAgICAgICAn15HXsycsXG4gICAgICAgICAgICAn15DXsycsXG4gICAgICAgICAgICAn16onLFxuICAgICAgICAgICAgJ9epJyxcbiAgICAgICAgICAgICfXqCcsXG4gICAgICAgICAgICAn16cnLFxuICAgICAgICAgICAgJ9emJyxcbiAgICAgICAgICAgICfXpCcsXG4gICAgICAgICAgICAn16InLFxuICAgICAgICAgICAgJ9ehJyxcbiAgICAgICAgICAgICfXoCcsXG4gICAgICAgICAgICAn154nLFxuICAgICAgICAgICAgJ9ecJyxcbiAgICAgICAgICAgICfXmycsXG4gICAgICAgICAgICAn15nXmCcsXG4gICAgICAgICAgICAn15nXlycsXG4gICAgICAgICAgICAn15nXlicsXG4gICAgICAgICAgICAn15jXlicsXG4gICAgICAgICAgICAn15jXlScsXG4gICAgICAgICAgICAn15knLFxuICAgICAgICAgICAgJ9eYJyxcbiAgICAgICAgICAgICfXlycsXG4gICAgICAgICAgICAn15YnLFxuICAgICAgICAgICAgJ9eVJyxcbiAgICAgICAgICAgICfXlCcsXG4gICAgICAgICAgICAn15MnLFxuICAgICAgICAgICAgJ9eSJyxcbiAgICAgICAgICAgICfXkScsXG4gICAgICAgICAgICAn15AnXG4gICAgICAgIF1cbiAgICB9O1xuICAgIHZhciBHRU9SR0lBTiA9IHtcbiAgICAgICAgaW50ZWdlcnM6IFtcbiAgICAgICAgICAgIDEwMDAwLCA5MDAwLCA4MDAwLCA3MDAwLCA2MDAwLCA1MDAwLCA0MDAwLCAzMDAwLCAyMDAwLCAxMDAwLCA5MDAsIDgwMCwgNzAwLCA2MDAsIDUwMCwgNDAwLCAzMDAsIDIwMCwgMTAwLCA5MCxcbiAgICAgICAgICAgIDgwLCA3MCwgNjAsIDUwLCA0MCwgMzAsIDIwLCAxMCwgOSwgOCwgNywgNiwgNSwgNCwgMywgMiwgMVxuICAgICAgICBdLFxuICAgICAgICB2YWx1ZXM6IFtcbiAgICAgICAgICAgICfhg7UnLFxuICAgICAgICAgICAgJ+GDsCcsXG4gICAgICAgICAgICAn4YOvJyxcbiAgICAgICAgICAgICfhg7QnLFxuICAgICAgICAgICAgJ+GDricsXG4gICAgICAgICAgICAn4YOtJyxcbiAgICAgICAgICAgICfhg6wnLFxuICAgICAgICAgICAgJ+GDqycsXG4gICAgICAgICAgICAn4YOqJyxcbiAgICAgICAgICAgICfhg6knLFxuICAgICAgICAgICAgJ+GDqCcsXG4gICAgICAgICAgICAn4YOnJyxcbiAgICAgICAgICAgICfhg6YnLFxuICAgICAgICAgICAgJ+GDpScsXG4gICAgICAgICAgICAn4YOkJyxcbiAgICAgICAgICAgICfhg7MnLFxuICAgICAgICAgICAgJ+GDoicsXG4gICAgICAgICAgICAn4YOhJyxcbiAgICAgICAgICAgICfhg6AnLFxuICAgICAgICAgICAgJ+GDnycsXG4gICAgICAgICAgICAn4YOeJyxcbiAgICAgICAgICAgICfhg50nLFxuICAgICAgICAgICAgJ+GDsicsXG4gICAgICAgICAgICAn4YOcJyxcbiAgICAgICAgICAgICfhg5snLFxuICAgICAgICAgICAgJ+GDmicsXG4gICAgICAgICAgICAn4YOZJyxcbiAgICAgICAgICAgICfhg5gnLFxuICAgICAgICAgICAgJ+GDlycsXG4gICAgICAgICAgICAn4YOxJyxcbiAgICAgICAgICAgICfhg5YnLFxuICAgICAgICAgICAgJ+GDlScsXG4gICAgICAgICAgICAn4YOUJyxcbiAgICAgICAgICAgICfhg5MnLFxuICAgICAgICAgICAgJ+GDkicsXG4gICAgICAgICAgICAn4YORJyxcbiAgICAgICAgICAgICfhg5AnXG4gICAgICAgIF1cbiAgICB9O1xuICAgIHZhciBjcmVhdGVBZGRpdGl2ZUNvdW50ZXIgPSBmdW5jdGlvbiAodmFsdWUsIG1pbiwgbWF4LCBzeW1ib2xzLCBmYWxsYmFjaywgc3VmZml4KSB7XG4gICAgICAgIGlmICh2YWx1ZSA8IG1pbiB8fCB2YWx1ZSA+IG1heCkge1xuICAgICAgICAgICAgcmV0dXJuIGNyZWF0ZUNvdW50ZXJUZXh0KHZhbHVlLCBmYWxsYmFjaywgc3VmZml4Lmxlbmd0aCA+IDApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAoc3ltYm9sc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AgIHZhciBDSktfVEVOX0hJR0hfQ09FRkZJQ0lFTlRTID0gMSA8PCAyO1xuICAgIHZhciBDSktfSFVORFJFRF9DT0VGRklDSUVOVFMgPSAxIDw8IDM7XG4gICAgdmFyIGNyZWF0ZUNKS0NvdW50ZXIgPSBmdW5jdGlvbiAodmFsdWUsIG51bWJlcnMsIG11bHRpcGxpZXJzLCBuZWdhdGl2ZVNpZ24sIHN1ZmZpeCwgZmxhZ3MpIHtcbiAgICAgICAgaWYgKHZhbHVlIDwgLTk5OTkgfHwgdmFsdWUgPiA5OTk5KSB7XG4gICAgICAgICAgICByZXR1cm4gY3JlYXRlQ291bnRlclRleHQodmFsdWUsIDQgLyogQ0pLX0RFQ0lNQUwgKi8sIHN1ZmZpeC5sZW5ndGggPiAwKTtcbiAgICAgICAgfVxuICAgICAgICB2YXIgdG1wID0gTWF0aC5hYnModmFsdWUpO1xuICAgICAgICB2YXIgc3RyaW5nID0gc3VmZml4O1xuICAgICAgICBpZiAodG1wID09PSAwKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVtYmVyc1swXSArIHN0cmluZztcbiAgICAgICAgfVxuICAgICAgICBmb3IgKHZhciBkaWdpdCA9IDA7IHRtcCA+IDAgJiYgZGlnaXQgPD0gNDsgZGlnaXQrKykge1xuICAgICAgICAgICAgdmFyIGNvZWZmaWNpZW50ID0gdG1wICUgMTA7XG4gICAgICAgICAgICBpZiAoY29lZmZpY2llbnQgPT09IDAgJiYgY29udGFpbnMoZmxhZ3MsIENKS19aRVJPUykgJiYgc3RyaW5nICE9PSAnJykge1xuICAgICAgICAgICAgICAgIHN0cmluZyA9IG51bWJlcnNbY29lZmZpY2llbnRdICsgc3RyaW5nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY29lZmZpY2llbnQgPiAxIHx8XG4gICAgICAgICAgICAgICAgKGNvZWZmaWNpZW50ID09PSAxICYmIGRpZ2l0ID09PSAwKSB8fFxuICAgICAgICAgICAgICAgIChjb2VmZmljaWVudCA9PT0gMSAmJiBkaWdpdCA9PT0gMSAmJiBjb250YWlucyhmbGFncywgQ0pLX1RFTl9DT0VGRklDSUVOVFMpKSB8fFxuICAgICAgICAgICAgICAgIChjb2VmZmljaWVudCA9PT0gMSAmJiBkaWdpdCA9PT0gMSAmJiBjb250YWlucyhmbGFncywgQ0pLX1RFTl9ISUdIX0NPRUZGSUNJRU5UUykgJiYgdmFsdWUgPiAxMDApIHx8XG4gICAgICAgICAgICAgICAgKGNvZWZmaWNpZW50ID09PSAxICYmIGRpZ2l0ID4gMSAmJiBjb250YWlucyhmbGFncywgQ0pLX0hVTkRSRURfQ09FRkZJQ0lFTlRTKSkpIHtcbiAgICAgICAgICAgICAgICBzdHJpbmcgPSBudW1iZXJzW2NvZWZmaWNpZW50XSArIChkaWdpdCA+IDAgPyBtdWx0aXBsaWVyc1tkaWdpdCAtIDFdIDogJycpICsgc3RyaW5nO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAoY29lZmZpY2llbnQgPT09IDEgJiYgZGlnaXQgPiAwKSB7XG4gICAgICAgICAgICAgICAgc3RyaW5nID0gbXVsdGlwbGllcnNbZGlnaXQgLSAxXSArIHN0cmluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRtcCA9IE1hdGguZmxvb3IodG1wIC8gMTApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiAodmFsdWUgPCAwID8gbmVnYXRpdmVTaWduIDogJycpICsgc3RyaW5nO1xuICAgIH07XG4gICAgdmFyIENISU5FU0VfSU5GT1JNQUxfTVVMVElQTElFUlMgPSAn5Y2B55m+5Y2D6JCsJztcbiAgICB2YXIgQ0hJTkVTRV9GT1JNQUxfTVVMVElQTElFUlMgPSAn5ou+5L2w5Luf6JCsJztcbiAgICB2YXIgSkFQQU5FU0VfTkVHQVRJVkUgPSAn44Oe44Kk44OK44K5JztcbiAgICB2YXIgS09SRUFOX05FR0FUSVZFID0gJ+uniOydtOuEiOy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ICB0aGlzLnNjcm9sbGVkRWxlbWVudHMgPSBbXTtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNlRWxlbWVudCA9IGVsZW1lbnQ7XG4gICAgICAgICAgICB0aGlzLmNvdW50ZXJzID0gbmV3IENvdW50ZXJTdGF0ZSgpO1xuICAgICAgICAgICAgdGhpcy5xdW90ZURlcHRoID0gMDtcbiAgICAgICAgICAgIGlmICghZWxlbWVudC5vd25lckRvY3VtZW50KSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdDbG9uZWQgZWxlbWVudCBkb2VzIG5vdCBoYXZlIGFuIG93bmVyIGRvY3VtZW50Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmRvY3VtZW50RWxlbWVudCA9IHRoaXMuY2xvbmVOb2RlKGVsZW1lbnQub3duZXJEb2N1bWVudC5kb2N1bWVudEVsZW1lbnQsIGZhbHNlKTtcbiAgICAgICAgfVxuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUudG9JRnJhbWUgPSBmdW5jdGlvbiAob3duZXJEb2N1bWVudCwgd2luZG93U2l6ZSkge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgICAgIHZhciBpZnJhbWUgPSBjcmVhdGVJRnJhbWVDb250YWluZXIob3duZXJEb2N1bWVudCwgd2luZG93U2l6ZSk7XG4gICAgICAgICAgICBpZiAoIWlmcmFtZS5jb250ZW50V2luZG93KSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVqZWN0KFwiVW5hYmxlIHRvIGZpbmQgaWZyYW1lIHdpbmRvd1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBzY3JvbGxYID0gb3duZXJEb2N1bWVudC5kZWZhdWx0Vmlldy5wYWdlWE9mZnNldDtcbiAgICAgICAgICAgIHZhciBzY3JvbGxZID0gb3duZXJEb2N1bWVudC5kZWZhdWx0Vmlldy5wYWdlWU9mZnNldDtcbiAgICAgICAgICAgIHZhciBjbG9uZVdpbmRvdyA9IGlmcmFtZS5jb250ZW50V2luZG93O1xuICAgICAgICAgICAgdmFyIGRvY3VtZW50Q2xvbmUgPSBjbG9uZVdpbmRvdy5kb2N1bWVudDtcbiAgICAgICAgICAgIC8qIENocm9tZSBkb2Vzbid0IGRldGVjdCByZWxhdGl2ZSBiYWNrZ3JvdW5kLWltYWdlcyBhc3NpZ25lZCBpbiBpbmxpbmUgPHN0eWxlPiBzaGVldHMgd2hlbiBmZXRjaGVkIHRocm91Z2ggZ2V0Q29tcHV0ZWRTdHlsZVxuICAgICAgICAgICAgIGlmIHdpbmRvdyB1cmwgaXMgYWJvdXQ6YmxhbmssIHdlIGNhbiBhc3NpZ24gdGhlIHVybCB0byBjdXJyZW50IGJ5IHdyaXRpbmcgb250byB0aGUgZG9jdW1lbnRcbiAgICAgICAgICAgICAqL1xuICAgICAgICAgICAgdmFyIGlmcmFtZUxvYWQgPSBpZnJhbWVMb2FkZXIoaWZyYW1lKS50aGVuKGZ1bmN0aW9uICgpIHsgcmV0dXJuIF9fYXdhaXRlcihfdGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgb25jbG9uZSwgcmVmZXJlbmNlRWxlbWVudDtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNjcm9sbGVkRWxlbWVudHMuZm9yRWFjaChyZXN0b3JlTm9kZVNjcm9sbCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsb25lV2luZG93KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb25lV2luZG93LnNjcm9sbFRvKHdpbmRvd1NpemUubGVmdCwgd2luZG93U2l6ZS50b3ApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoLyhpUGFkfGlQaG9uZXxpUG9kKS9nLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbG9uZVdpbmRvdy5zY3JvbGxZICE9PSB3aW5kb3dTaXplLnRvcCB8fCBjbG9uZVdpbmRvdy5zY3JvbGxYICE9PSB3aW5kb3dTaXplLmxlZnQpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQubG9nZ2VyLndhcm4oJ1VuYWJsZSB0byByZXN0b3JlIHNjcm9sbCBwb3NpdGlvbiBmb3IgY2xvbmVkIGRvY3VtZW50Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQud2luZG93Qm91bmRzID0gdGhpcy5jb250ZXh0LndpbmRvd0JvdW5kcy5hZGQoY2xvbmVXaW5kb3cuc2Nyb2xsWCAtIHdpbmRvd1NpemUubGVmdCwgY2xvbmVXaW5kb3cuc2Nyb2xsWSAtIHdpbmRvd1NpemUudG9wLCAwLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmNsb25lID0gdGhpcy5vcHRpb25zLm9uY2xvbmU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlbmNlRWxlbWVudCA9IHRoaXMuY2xvbmVkUmVmZXJlbmNlRWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlZmVyZW5jZUVsZW1lbnQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovLCBQcm9taXNlLnJlamVjdChcIkVycm9yIGZpbmRpbmcgdGhlIFwiICsgdGhpcy5yZWZlcmVuY2VFbGVtZW50Lm5vZGVOYW1lICsgXCIgaW4gdGhlIGNsb25lZCBkb2N1bWVudFwiKV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGRvY3VtZW50Q2xvbmUuZm9udHMgJiYgZG9jdW1lbnRDbG9uZS5mb250cy5yZWFkeSkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIGRvY3VtZW50Q2xvbmUuZm9udHMucmVhZHldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5sYWJlbCA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEvKEFwcGxlV2ViS2l0KS9nLnRlc3QobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIGltYWdlc1JlYWR5KGRvY3VtZW50Q2xvbmUpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2EubGFiZWwgPSA0O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb25jbG9uZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgUHJvbWlzZS5yZXNvbHZlKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7IHJldHVybiBvbmNsb25lKGRvY3VtZW50Q2xvbmUsIHJlZmVyZW5jZUVsZW1lbnQpOyB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHsgcmV0dXJuIGlmcmFtZTsgfSldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgaWZyYW1lXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7IH0pO1xuICAgICAgICAgICAgZG9jdW1lbnRDbG9uZS5vcGVuKCk7XG4gICAgICAgICAgICBkb2N1bWVudENsb25lLndyaXRlKHNlcmlhbGl6ZURvY3R5cGUoZG9jdW1lbnQuZG9jdHlwZSkgKyBcIjxodG1sPjwvaHRtbD5cIik7XG4gICAgICAgICAgICAvLyBDaHJvbWUgc2Nyb2xscyB0aGUgcGFyZW50IGRvY3VtZW50IGZvciBzb21lIHJlYXNvbiBhZnRlciB0aGUgd3JpdGUgdG8gdGhlIGNsb25lZCB3aW5kb3c/Pz9cbiAgICAgICAgICAgIHJlc3RvcmVPd25lclNjcm9sbCh0aGlzLnJlZmVyZW5jZUVsZW1lbnQub3duZXJEb2N1bWVudCwgc2Nyb2xsWCwgc2Nyb2xsWSk7XG4gICAgICAgICAgICBkb2N1bWVudENsb25lLnJlcGxhY2VDaGlsZChkb2N1bWVudENsb25lLmFkb3B0Tm9kZSh0aGlzLmRvY3VtZW50RWxlbWVudCksIGRvY3VtZW50Q2xvbmUuZG9jdW1lbnRFbGVtZW50KTtcbiAgICAgICAgICAgIGRvY3VtZW50Q2xvbmUuY2xvc2UoKTtcbiAgICAgICAgICAgIHJldHVybiBpZnJhbWVMb2FkO1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY3JlYXRlRWxlbWVudENsb25lID0gZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgICAgIGlmIChpc0RlYnVnZ2luZyhub2RlLCAyIC8qIENMT05FICovKSkge1xuICAgICAgICAgICAgICAgIGRlYnVnZ2VyO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzQ2FudmFzRWxlbWVudChub2RlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNyZWF0ZUNhbnZhc0Nsb25lKG5vZGUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzVmlkZW9FbGVtZW50KG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuY3JlYXRlVmlkZW9DbG9uZShub2RlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc1N0eWxlRWxlbWVudChub2RlKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNyZWF0ZVN0eWxlQ2xvbmUobm9kZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgY2xvbmUgPSBub2RlLmNsb25lTm9kZShmYWxzZSk7XG4gICAgICAgICAgICBpZiAoaXNJbWFnZUVsZW1lbnQoY2xvbmUpKSB7XG4gICAgICAgICAgICAgICAgaWYgKGlzSW1hZ2VFbGVtZW50KG5vZGUpICYmIG5vZGUuY3VycmVudFNyYyAmJiBub2RlLmN1cnJlbnRTcmMgIT09IG5vZGUuc3JjKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsb25lLnNyYyA9IG5vZGUuY3VycmVudFNyYztcbiAgICAgICAgICAgICAgICAgICAgY2xvbmUuc3Jjc2V0ID0gJyc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChjbG9uZS5sb2FkaW5nID09PSAnbGF6eScpIHtcbiAgICAgICAgICAgICAgICAgICAgY2xvbmUubG9hZGluZyA9ICdlYWdlcic7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGlzQ3VzdG9tRWxlbWVudChjbG9uZSkpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jcmVhdGVDdXN0b21FbGVtZW50Q2xvbmUoY2xvbmUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY3JlYXRlQ3VzdG9tRWxlbWVudENsb25lID0gZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgICAgIHZhciBjbG9uZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2h0bWwyY2FudmFzY3VzdG9tZWxlbWVudCcpO1xuICAgICAgICAgICAgY29weUNTU1N0eWxlcyhub2RlLnN0eWxlLCBjbG9uZSk7XG4gICAgICAgICAgICByZXR1cm4gY2xvbmU7XG4gICAgICAgIH07XG4gICAgICAgIERvY3VtZW50Q2xvbmVyLnByb3RvdHlwZS5jcmVhdGVTdHlsZUNsb25lID0gZnVuY3Rpb24gKG5vZGUpIHtcbiAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgdmFyIHNoZWV0ID0gbm9kZS5zaGVldDtcbiAgICAgICAgICAgICAgICBpZiAoc2hlZXQgJiYgc2hlZXQuY3NzUnVsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNzcyA9IFtdLnNsaWNlLmNhbGwoc2hlZXQuY3NzUnVsZXMsIDApLnJlZHVjZShmdW5jdGlvbiAoY3NzLCBydWxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZSAmJiB0eXBlb2YgcnVsZS5jc3NUZXh0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjc3MgKyBydWxlLmNzc1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3NzO1xuICAgICAgICAgICAgICAgICAgICB9LCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIHZhciBzdHlsZSA9IG5vZGUuY2xvbmVOb2RlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgc3R5bGUudGV4dENvbnRlbnQgPSBjc3M7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdHlsZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIC8vIGFjY2Vzc2luZyBub2RlLnNoZWV0LmNzc1J1bGVzIHRocm93cyBhIERPTUV4Y2VwdGlvblxuICAgICAgICAgICAgICAgIHRoaXMuY29udGV4dC5sb2dnZXIuZXJyb3IoJ1VuYWJsZSB0byBhY2Nlc3MgY3NzUnVsZXMgcHJvcGVydHknLCBlKTtcbiAgICAgICAgICAgICAgICBpZiAoZS5uYW1lICE9PSAnU2VjdXJpdHlFcnJvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gbm9kZS5jbG9uZU5vZGUoZmFsc2UpO1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY3JlYXRlQ2FudmFzQ2xvbmUgPSBmdW5jdGlvbiAoY2FudmFzKSB7XG4gICAgICAgICAgICB2YXIgX2E7XG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmlubGluZUltYWdlcyAmJiBjYW52YXMub3duZXJEb2N1bWVudCkge1xuICAgICAgICAgICAgICAgIHZhciBpbWcgPSBjYW52YXMub3duZXJEb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBpbWcuc3JjID0gY2FudmFzLnRvRGF0YVVSTCgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW1nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQubG9nZ2VyLmluZm8oXCJVbmFibGUgdG8gaW5saW5lIGNhbnZhcyBjb250ZW50cywgY2FudmFzIGlzIHRhaW50ZWRcIiwgY2FudmFzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgY2xvbmVkQ2FudmFzID0gY2FudmFzLmNsb25lTm9kZShmYWxzZSk7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGNsb25lZENhbnZhcy53aWR0aCA9IGNhbnZhcy53aWR0aDtcbiAgICAgICAgICAgICAgICBjbG9uZWRDYW52YXMuaGVpZ2h0ID0gY2FudmFzLmhlaWdodDtcbiAgICAgICAgICAgICAgICB2YXIgY3R4ID0gY2FudmFzLmdldENvbnRleHQoJzJkJyk7XG4gICAgICAgICAgICAgICAgdmFyIGNsb25lZEN0eCA9IGNsb25lZENhbnZhcy5nZXRDb250ZXh0KCcyZCcpO1xuICAgICAgICAgICAgICAgIGlmIChjbG9uZWRDdHgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLm9wdGlvbnMuYWxsb3dUYWludCAmJiBjdHgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsb25lZEN0eC5wdXRJbWFnZURhdGEoY3R4LmdldEltYWdlRGF0YSgwLCAwLCBjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpLCAwLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnbCA9IChfYSA9IGNhbnZhcy5nZXRDb250ZXh0KCd3ZWJnbDInKSkgIT09IG51bGwgJiYgX2EgIT09IHZvaWQgMCA/IF9hIDogY2FudmFzLmdldENvbnRleHQoJ3dlYmdsJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2wpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0cmlicyA9IGdsLmdldENvbnRleHRBdHRyaWJ1dGVzKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhdHRyaWJzID09PSBudWxsIHx8IGF0dHJpYnMgPT09IHZvaWQgMCA/IHZvaWQgMCA6IGF0dHJpYnMucHJlc2VydmVEcmF3aW5nQnVmZmVyKSA9PT0gZmFsc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0LmxvZ2dlci53YXJuKCdVbmFibGUgdG8gY2xvbmUgV2ViR0wgY29udGV4dCBhcyBpdCBoYXMgcHJlc2VydmVEcmF3aW5nQnVmZmVyPWZhbHNlJywgY2FudmFzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBjbG9uZWRDdHguZHJhd0ltYWdlKGNhbnZhcywgMCwgMCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNsb25lZENhbnZhcztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0LmxvZ2dlci5pbmZvKFwiVW5hYmxlIHRvIGNsb25lIGNhbnZhcyBhcyBpdCBpcyB0YWludGVkXCIsIGNhbnZhcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gY2xvbmVkQ2FudmFzO1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY3JlYXRlVmlkZW9DbG9uZSA9IGZ1bmN0aW9uICh2aWRlbykge1xuICAgICAgICAgICAgdmFyIGNhbnZhcyA9IHZpZGVvLm93bmVyRG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBjYW52YXMud2lkdGggPSB2aWRlby5vZmZzZXRXaWR0aDtcbiAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSB2aWRlby5vZmZzZXRIZWlnaHQ7XG4gICAgICAgICAgICB2YXIgY3R4ID0gY2FudmFzLmdldENvbnRleHQoJzJkJyk7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGlmIChjdHgpIHtcbiAgICAgICAgICAgICAgICAgICAgY3R4LmRyYXdJbWFnZSh2aWRlbywgMCwgMCwgY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLm9wdGlvbnMuYWxsb3dUYWludCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY3R4LmdldEltYWdlRGF0YSgwLCAwLCBjYW52YXMud2lkdGgsIGNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjYW52YXM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuY29udGV4dC5sb2dnZXIuaW5mbyhcIlVuYWJsZSB0byBjbG9uZSB2aWRlbyBhcyBpdCBpcyB0YWludGVkXCIsIHZpZGVvKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBibGFua0NhbnZhcyA9IHZpZGVvLm93bmVyRG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBibGFua0NhbnZhcy53aWR0aCA9IHZpZGVvLm9mZnNldFdpZHRoO1xuICAgICAgICAgICAgYmxhbmtDYW52YXMuaGVpZ2h0ID0gdmlkZW8ub2Zmc2V0SGVpZ2h0O1xuICAgICAgICAgICAgcmV0dXJuIGJsYW5rQ2FudmFzO1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuYXBwZW5kQ2hpbGROb2RlID0gZnVuY3Rpb24gKGNsb25lLCBjaGlsZCwgY29weVN0eWxlcykge1xuICAgICAgICAgICAgaWYgKCFpc0VsZW1lbnROb2RlKGNoaWxkKSB8fFxuICAgICAgICAgICAgICAgICghaXNTY3JpcHRFbGVtZW50KGNoaWxkKSAmJlxuICAgICAgICAgICAgICAgICAgICAhY2hpbGQuaGFzQXR0cmlidXRlKElHTk9SRV9BVFRSSUJVVEUpICYmXG4gICAgICAgICAgICAgICAgICAgICh0eXBlb2YgdGhpcy5vcHRpb25zLmlnbm9yZUVsZW1lbnRzICE9PSAnZnVuY3Rpb24nIHx8ICF0aGlzLm9wdGlvbnMuaWdub3JlRWxlbWVudHMoY2hpbGQpKSkpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5jb3B5U3R5bGVzIHx8ICFpc0VsZW1lbnROb2RlKGNoaWxkKSB8fCAhaXNTdHlsZUVsZW1lbnQoY2hpbGQpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsb25lLmFwcGVuZENoaWxkKHRoaXMuY2xvbmVOb2RlKGNoaWxkLCBjb3B5U3R5bGVzKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY2xvbmVDaGlsZE5vZGVzID0gZnVuY3Rpb24gKG5vZGUsIGNsb25lLCBjb3B5U3R5bGVzKSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAgICAgZm9yICh2YXIgY2hpbGQgPSBub2RlLnNoYWRvd1Jvb3QgPyBub2RlLnNoYWRvd1Jvb3QuZmlyc3RDaGlsZCA6IG5vZGUuZmlyc3RDaGlsZDsgY2hpbGQ7IGNoaWxkID0gY2hpbGQubmV4dFNpYmxpbmcpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNFbGVtZW50Tm9kZShjaGlsZCkgJiYgaXNTbG90RWxlbWVudChjaGlsZCkgJiYgdHlwZW9mIGNoaWxkLmFzc2lnbmVkTm9kZXMgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGFzc2lnbmVkTm9kZXMgPSBjaGlsZC5hc3NpZ25lZE5vZGVzKCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChhc3NpZ25lZE5vZGVzLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgYXNzaWduZWROb2Rlcy5mb3JFYWNoKGZ1bmN0aW9uIChhc3NpZ25lZE5vZGUpIHsgcmV0dXJuIF90aGlzLmFwcGVuZENoaWxkTm9kZShjbG9uZSwgYXNzaWduZWROb2RlLCBjb3B5U3R5bGVzKTsgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuYXBwZW5kQ2hpbGROb2RlKGNsb25lLCBjaGlsZCwgY29weVN0eWxlcyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5wcm90b3R5cGUuY2xvbmVOb2RlID0gZnVuY3Rpb24gKG5vZGUsIGNvcHlTdHlsZXMpIHtcbiAgICAgICAgICAgIGlmIChpc1RleHROb2RlKG5vZGUpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKG5vZGUuZGF0YSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIW5vZGUub3duZXJEb2N1bWVudCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBub2RlLmNsb25lTm9kZShmYWxzZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgd2luZG93ID0gbm9kZS5vd25lckRvY3VtZW50LmRlZmF1bHRWaWV3O1xuICAgICAgICAgICAgaWYgKHdpbmRvdyAmJiBpc0VsZW1lbnROb2RlKG5vZGUpICYmIChpc0hUTUxFbGVtZW50Tm9kZShub2RlKSB8fCBpc1NWR0VsZW1lbnROb2RlKG5vZGUpKSkge1xuICAgICAgICAgICAgICAgIHZhciBjbG9uZSA9IHRoaXMuY3JlYXRlRWxlbWVudENsb25lKG5vZGUpO1xuICAgICAgICAgICAgICAgIGNsb25lLnN0eWxlLnRyYW5zaXRpb25Qcm9wZXJ0eSA9ICdub25lJztcbiAgICAgICAgICAgICAgICB2YXIgc3R5bGUgPSB3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShub2RlKTtcbiAgICAgICAgICAgICAgICB2YXIgc3R5bGVCZWZvcmUgPSB3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShub2RlLCAnOmJlZm9yZScpO1xuICAgICAgICAgICAgICAgIHZhciBzdHlsZUFmdGVyID0gd2luZG93LmdldENvbXB1dGVkU3R5bGUobm9kZSwgJzphZnRlcicpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnJlZmVyZW5jZUVsZW1lbnQgPT09IG5vZGUgJiYgaXNIVE1MRWxlbWVudE5vZGUoY2xvbmUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2xvbmVkUmVmZXJlbmNlRWxlbWVudCA9IGNsb25lO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaXNCb2R5RWxlbWVudChjbG9uZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY3JlYXRlUHNldWRvSGlkZVN0eWxlcyhjbG9uZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHZhciBjb3VudGVycyA9IHRoaXMuY291bnRlcnMucGFyc2UobmV3IENTU1BhcnNlZENvdW50ZXJEZWNsYXJhdGlvbih0aGlzLmNvbnRleHQsIHN0eWxlKSk7XG4gICAgICAgICAgICAgICAgdmFyIGJlZm9yZSA9IHRoaXMucmVzb2x2ZVBzZXVkb0NvbnRlbnQobm9kZSwgY2xvbmUsIHN0eWxlQmVmb3JlLCBQc2V1ZG9FbGVtZW50VHlwZS5CRUZPUkUpO1xuICAgICAgICAgICAgICAgIGlmIChpc0N1c3RvbUVsZW1lbnQobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgY29weVN0eWxlcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghaXNWaWRlb0VsZW1lbnQobm9kZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jbG9uZUNoaWxkTm9kZXMobm9kZSwgY2xvbmUsIGNvcHlTdHlsZXMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoYmVmb3JlKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsb25lLmluc2VydEJlZm9yZShiZWZvcmUsIGNsb25lLmZpcnN0Q2hpbGQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB2YXIgYWZ0ZXIgPSB0aGlzLnJlc29sdmVQc2V1ZG9Db250ZW50KG5vZGUsIGNsb25lLCBzdHlsZUFmdGVyLCBQc2V1ZG9FbGVtZW50VHlwZS5BRlRFUik7XG4gICAgICAgICAgICAgICAgaWYgKGFmdGVyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsb25lLmFwcGVuZENoaWxkKGFmdGVyKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5jb3VudGVycy5wb3AoY291bnRlcnMpO1xuICAgICAgICAgICAgICAgIGlmICgoc3R5bGUgJiYgKHRoaXMub3B0aW9ucy5jb3B5U3R5bGVzIHx8IGlzU1ZHRWxlbWVudE5vZGUobm9kZSkpICYmICFpc0lGcmFtZUVsZW1lbnQobm9kZSkpIHx8XG4gICAgICAgICAgICAgICAgICAgIGNvcHlTdHlsZXMpIHtcbiAgICAgICAgICAgICAgICAgICAgY29weUNTU1N0eWxlcyhzdHlsZSwgY2xvbmUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAobm9kZS5zY3JvbGxUb3AgIT09IDAgfHwgbm9kZS5zY3JvbGxMZWZ0ICE9PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2Nyb2xsZWRFbGVtZW50cy5wdXNoKFtjbG9uZSwgbm9kZS5zY3JvbGxMZWZ0LCBub2RlLnNjcm9sbFRvcF0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoKGlzVGV4dGFyZWFFbGVtZW50KG5vZGUpIHx8IGlzU2VsZWN0RWxlbWVudChub2RlKSkgJiZcbiAgICAgICAgICAgICAgICAgICAgKGlzVGV4dGFyZWFFbGVtZW50KGNsb25lKSB8fCBpc1NlbGVjdEVsZW1lbnQoY2xvbmUpKSkge1xuICAgICAgICAgICAgICAgICAgICBjbG9uZS52YWx1ZSA9IG5vZGUudmFsdWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBjbG9uZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBub2RlLmNsb25lTm9kZShmYWxzZSk7XG4gICAgICAgIH07XG4gICAgICAgIERvY3VtZW50Q2xvbmVyLnByb3RvdHlwZS5yZXNvbHZlUHNldWRvQ29udGVudCA9IGZ1bmN0aW9uIChub2RlLCBjbG9uZSwgc3R5bGUsIHBzZXVkb0VsdCkge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgICAgIGlmICghc3R5bGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdmFsdWUgPSBzdHlsZS5jb250ZW50O1xuICAgICAgICAgICAgdmFyIGRvY3VtZW50ID0gY2xvbmUub3duZXJEb2N1bWVudDtcbiAgICAgICAgICAgIGlmICghZG9jdW1lbnQgfHwgIXZhbHVlIHx8IHZhbHVlID09PSAnbm9uZScgfHwgdmFsdWUgPT09ICctbW96LWFsdC1jb250ZW50JyB8fCBzdHlsZS5kaXNwbGF5ID09PSAnbm9uZScpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLmNvdW50ZXJzLnBhcnNlKG5ldyBDU1NQYXJzZWRDb3VudGVyRGVjbGFyYXRpb24odGhpcy5jb250ZXh0LCBzdHlsZSkpO1xuICAgICAgICAgICAgdmFyIGRlY2xhcmF0aW9uID0gbmV3IENTU1BhcnNlZFBzZXVkb0RlY2xhcmF0aW9uKHRoaXMuY29udGV4dCwgc3R5bGUpO1xuICAgICAgICAgICAgdmFyIGFub255bW91c1JlcGxhY2VkRWxlbWVudCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2h0bWwyY2FudmFzcHNldWRvZWxlbWVudCcpO1xuICAgICAgICAgICAgY29weUNTU1N0eWxlcyhzdHlsZSwgYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50KTtcbiAgICAgICAgICAgIGRlY2xhcmF0aW9uLmNvbnRlbnQuZm9yRWFjaChmdW5jdGlvbiAodG9rZW4pIHtcbiAgICAgICAgICAgICAgICBpZiAodG9rZW4udHlwZSA9PT0gMCAvKiBTVFJJTkdfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHRva2VuLnZhbHVlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRva2VuLnR5cGUgPT09IDIyIC8qIFVSTF9UT0tFTiAqLykge1xuICAgICAgICAgICAgICAgICAgICB2YXIgaW1nID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW1nJyk7XG4gICAgICAgICAgICAgICAgICAgIGltZy5zcmMgPSB0b2tlbi52YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgaW1nLnN0eWxlLm9wYWNpdHkgPSAnMSc7XG4gICAgICAgICAgICAgICAgICAgIGFub255bW91c1JlcGxhY2VkRWxlbWVudC5hcHBlbmRDaGlsZChpbWcpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0b2tlbi50eXBlID09PSAxOCAvKiBGVU5DVElPTiAqLykge1xuICAgICAgICAgICAgICAgICAgICBpZiAodG9rZW4ubmFtZSA9PT0gJ2F0dHInKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0ciA9IHRva2VuLnZhbHVlcy5maWx0ZXIoaXNJZGVudFRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub255bW91c1JlcGxhY2VkRWxlbWVudC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShub2RlLmdldEF0dHJpYnV0ZShhdHRyWzBdLnZhbHVlKSB8fCAnJykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRva2VuLm5hbWUgPT09ICdjb3VudGVyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9hID0gdG9rZW4udmFsdWVzLmZpbHRlcihub25GdW5jdGlvbkFyZ1NlcGFyYXRvciksIGNvdW50ZXIgPSBfYVswXSwgY291bnRlclN0eWxlID0gX2FbMV07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRlciAmJiBpc0lkZW50VG9rZW4oY291bnRlcikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY291bnRlclN0YXRlID0gX3RoaXMuY291bnRlcnMuZ2V0Q291bnRlclZhbHVlKGNvdW50ZXIudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb3VudGVyVHlwZSA9IGNvdW50ZXJTdHlsZSAmJiBpc0lkZW50VG9rZW4oY291bnRlclN0eWxlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGxpc3RTdHlsZVR5cGUucGFyc2UoX3RoaXMuY29udGV4dCwgY291bnRlclN0eWxlLnZhbHVlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IDMgLyogREVDSU1BTCAqLztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm9ueW1vdXNSZXBsYWNlZEVsZW1lbnQuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoY3JlYXRlQ291bnRlclRleHQoY291bnRlclN0YXRlLCBjb3VudGVyVHlwZSwgZmFsc2UpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodG9rZW4ubmFtZSA9PT0gJ2NvdW50ZXJzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9iID0gdG9rZW4udmFsdWVzLmZpbHRlcihub25GdW5jdGlvbkFyZ1NlcGFyYXRvciksIGNvdW50ZXIgPSBfYlswXSwgZGVsaW0gPSBfYlsxXSwgY291bnRlclN0eWxlID0gX2JbMl07XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY291bnRlciAmJiBpc0lkZW50VG9rZW4oY291bnRlcikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY291bnRlclN0YXRlcyA9IF90aGlzLmNvdW50ZXJzLmdldENvdW50ZXJWYWx1ZXMoY291bnRlci52YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvdW50ZXJUeXBlXzEgPSBjb3VudGVyU3R5bGUgJiYgaXNJZGVudFRva2VuKGNvdW50ZXJTdHlsZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBsaXN0U3R5bGVUeXBlLnBhcnNlKF90aGlzLmNvbnRleHQsIGNvdW50ZXJTdHlsZS52YWx1ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAzIC8qIERFQ0lNQUwgKi87XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcGFyYXRvciA9IGRlbGltICYmIGRlbGltLnR5cGUgPT09IDAgLyogU1RSSU5HX1RPS0VOICovID8gZGVsaW0udmFsdWUgOiAnJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGV4dCA9IGNvdW50ZXJTdGF0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbiAodmFsdWUpIHsgcmV0dXJuIGNyZWF0ZUNvdW50ZXJUZXh0KHZhbHVlLCBjb3VudGVyVHlwZV8xLCBmYWxzZSk7IH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5qb2luKHNlcGFyYXRvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKHRleHQpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAodG9rZW4udHlwZSA9PT0gMjAgLyogSURFTlRfVE9LRU4gKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0b2tlbi52YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnb3Blbi1xdW90ZSc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKGdldFF1b3RlKGRlY2xhcmF0aW9uLnF1b3RlcywgX3RoaXMucXVvdGVEZXB0aCsrLCB0cnVlKSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnY2xvc2UtcXVvdGUnOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub255bW91c1JlcGxhY2VkRWxlbWVudC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShnZXRRdW90ZShkZWNsYXJhdGlvbi5xdW90ZXMsIC0tX3RoaXMucXVvdGVEZXB0aCwgZmFsc2UpKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNhZmFyaSBkb2Vzbid0IHBhcnNlIHN0cmluZyB0b2tlbnMgY29ycmVjdGx5IGJlY2F1c2Ugb2YgbGFjayBvZiBxdW90ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm9ueW1vdXNSZXBsYWNlZEVsZW1lbnQuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUodG9rZW4udmFsdWUpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50LmNsYXNzTmFtZSA9IFBTRVVET19ISURFX0VMRU1FTlRfQ0xBU1NfQkVGT1JFICsgXCIgXCIgKyBQU0VVRE9fSElERV9FTEVNRU5UX0NMQVNTX0FGVEVSO1xuICAgICAgICAgICAgdmFyIG5ld0NsYXNzTmFtZSA9IHBzZXVkb0VsdCA9PT0gUHNldWRvRWxlbWVudFR5cGUuQkVGT1JFXG4gICAgICAgICAgICAgICAgPyBcIiBcIiArIFBTRVVET19ISURFX0VMRU1FTlRfQ0xBU1NfQkVGT1JFXG4gICAgICAgICAgICAgICAgOiBcIiBcIiArIFBTRVVET19ISURFX0VMRU1FTlRfQ0xBU1NfQUZURVI7XG4gICAgICAgICAgICBpZiAoaXNTVkdFbGVtZW50Tm9kZShjbG9uZSkpIHtcbiAgICAgICAgICAgICAgICBjbG9uZS5jbGFzc05hbWUuYmFzZVZhbHVlICs9IG5ld0NsYXNzTmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGNsb25lLmNsYXNzTmFtZSArPSBuZXdDbGFzc05hbWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gYW5vbnltb3VzUmVwbGFjZWRFbGVtZW50O1xuICAgICAgICB9O1xuICAgICAgICBEb2N1bWVudENsb25lci5kZXN0cm95ID0gZnVuY3Rpb24gKGNvbnRhaW5lcikge1xuICAgICAgICAgICAgaWYgKGNvbnRhaW5lci5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgICAgICAgY29udGFpbmVyLnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoY29udGFpbmVyKTtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIERvY3VtZW50Q2xvbmVyO1xuICAgIH0oKSk7XG4gICAgdmFyIFBz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uIChpZnJhbWUpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHZhciBjbG9uZVdpbmRvdyA9IGlmcmFtZS5jb250ZW50V2luZG93O1xuICAgICAgICAgICAgaWYgKCFjbG9uZVdpbmRvdykge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoXCJObyB3aW5kb3cgYXNzaWduZWQgZm9yIGlmcmFtZVwiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHZhciBkb2N1bWVudENsb25lID0gY2xvbmVXaW5kb3cuZG9jdW1lbnQ7XG4gICAgICAgICAgICBjbG9uZVdpbmRvdy5vbmxvYWQgPSBpZnJhbWUub25sb2FkID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIGNsb25lV2luZG93Lm9ubG9hZCA9IGlmcmFtZS5vbmxvYWQgPSBudWxsO1xuICAgICAgICAgICAgICAgIHZhciBpbnRlcnZhbCA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvY3VtZW50Q2xvbmUuYm9keS5jaGlsZE5vZGVzLmxlbmd0aCA+IDAgJiYgZG9jdW1lbnRDbG9uZS5yZWFkeVN0YXRlID09PSAnY29tcGxldGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoaWZyYW1lKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sIDUwKTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pO1xuICAgIH07XG4gICAgdmFyIGlnbm9yZWRTdHlsZVByb3BlcnRpZXMgPSBbXG4gICAgICAgICdhbGwnLFxuICAgICAgICAnZCcsXG4gICAgICAgICdjb250ZW50JyAvLyBTYWZhcmkgc2hvd3MgcHNldWRvZWxlbWVudHMgaWYgY29udGVudCBpcyBzZXRcbiAgICBdO1xuICAgIHZhciBjb3B5Q1NTU3R5bGVzID0gZnVuY3Rpb24gKHN0eWxlLCB0YXJnZXQpIHtcbiAgICAgICAgLy8gRWRnZSBkb2VzIG5vdCBwcm92aWRlIHZhbHVlIGZvciBjc3NUZXh0XG4gICAgICAgIGZvciAodmFyIGkgPSBzdHlsZS5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xuICAgICAgICAgICAgdmFyIHByb3BlcnR5ID0gc3R5bGUuaXRlbShpKTtcbiAgICAgICAgICAgIGlmIChpZ25vcmVkU3R5bGVQcm9wZXJ0aWVzLmluZGV4T2YocHJvcGVydHkpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHRhcmdldC5zdHlsZS5zZXRQcm9wZXJ0eShwcm9wZXJ0eSwgc3R5bGUuZ2V0UHJvcGVydHlWYWx1ZShwcm9wZXJ0eSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0YXJnZXQ7XG4gICAgfTtcbiAgICB2YXIgc2VyaWFsaXplRG9jdHlwZSA9IGZ1bmN0aW9uIChkb2N0eXBlKSB7XG4gICAgICAgIHZhciBzdHIgPSAnJztcbiAgICAgICAgaWYgKGRvY3R5cGUpIHtcbiAgICAgICAgICAgIHN0ciArPSAnPCFET0NUWVBFICc7XG4gICAgICAgICAgICBpZiAoZG9jdHlwZS5uYW1lKSB7XG4gICAgICAgICAgICAgICAgc3RyICs9IGRvY3R5cGUubmFtZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChkb2N0eXBlLmludGVybmFsU3Vic2V0KSB7XG4gICAgICAgICAgICAgICAgc3RyICs9IGRvY3R5cGUuaW50ZXJuYWxTdWJzZXQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoZG9jdHlwZS5wdWJsaWNJZCkge1xuICAgICAgICAgICAgICAgIHN0ciArPSBcIlxcXCJcIiArIGRvY3R5cGUucHVibGljSWQgKyBcIlxcXCJcIjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChkb2N0eXBlLnN5c3RlbUlkKSB7XG4gICAgICAgICAgICAgICAgc3RyICs9IFwiXFxcIlwiICsgZG9jdHlwZS5zeXN0ZW1JZCArIFwiXFxcIlwiO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgc3RyICs9ICc+JztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RyO1xuICAgIH07XG4gICAgdmFyIHJlc3RvcmVPd25lclNjcm9sbCA9IGZ1bmN0aW9uIChvd25lckRvY3VtZW50LCB4LCB5KSB7XG4gICAgICAgIGlmIChvd25lckRvY3VtZW50ICYmXG4gICAgICAgICAgICBvd25lckRvY3VtZW50LmRlZmF1bHRWaWV3ICYmXG4gICAgICAgICAgICAoeCAhPT0gb3duZXJEb2N1bWVudC5kZWZhdWx0Vmlldy5wYWdlWE9mZnNldCB8fCB5ICE9PSBvd25lckRvY3VtZW50LmRlZmF1bHRWaWV3LnBhZ2VZT2Zmc2V0KSkge1xuICAgICAgICAgICAgb3duZXJEb2N1bWVudC5kZWZhdWx0Vmlldy5zY3JvbGxUbyh4LCB5KTtcbiAgICAgICAgfVxuICAgIH07XG4gICAgdmFyIHJlc3RvcmVOb2RlU2Nyb2xsID0gZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgIHZhciBlbGVtZW50ID0gX2FbMF0sIHggPSBfYVsxXSwgeSA9IF9hWzJdO1xuICAgICAgICBlbGVtZW50LnNjcm9sbExlZnQgPSB4O1xuICAgICAgICBlbGVtZW50LnNjcm9sbFRvcCA9IHk7XG4gICAgfTtcbiAgICB2YXIgUFNFVURPX0JFRk9SRSA9ICc6YmVmb3JlJztcbiAgICB2YXIgUFNFVURPX0FGVEVSID0gJzphZnRlcic7XG4gICAgdmFyIFBTRVVET19ISURFX0VMRU1FTlRfQ0xBU1NfQkVGT1JFID0gJ19fX2h0bWwyY2FudmFzX19fcH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VTdG9yYWdlO1xuICAgIH0oKSk7XG4gICAgdmFyIENhY2hlID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKCkge1xuICAgICAgICBmdW5jdGlvbiBDYWNoZShjb250ZXh0LCBfb3B0aW9ucykge1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0ID0gY29udGV4dDtcbiAgICAgICAgICAgIHRoaXMuX29wdGlvbnMgPSBfb3B0aW9ucztcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgICAgICB0aGlzLl9jYWNoZSA9IHt9O1xuICAgICAgICB9XG4gICAgICAgIENhY2hlLnByb3RvdHlwZS5hZGRJbWFnZSA9IGZ1bmN0aW9uIChzcmMpIHtcbiAgICAgICAgICAgIHZhciByZXN1bHQgPSBQcm9taXNlLnJlc29sdmUoKTtcbiAgICAgICAgICAgIGlmICh0aGlzLmhhcyhzcmMpKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpc0Jsb2JJbWFnZShzcmMpIHx8IGlzUmVuZGVyYWJsZShzcmMpKSB7XG4gICAgICAgICAgICAgICAgKHRoaXMuX2NhY2hlW3NyY10gPSB0aGlzLmxvYWRJbWFnZShzcmMpKS5jYXRjaChmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIHByZXZlbnQgdW5oYW5kbGVkIHJlamVjdGlvblxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgICAgICB9O1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueVxuICAgICAgICBDYWNoZS5wcm90b3R5cGUubWF0Y2ggPSBmdW5jdGlvbiAoc3JjKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fY2FjaGVbc3JjXTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FjaGUucHJvdG90eXBlLmxvYWRJbWFnZSA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgICAgICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICB2YXIgaXNTYW1lT3JpZ2luLCB1c2VDT1JTLCB1c2VQcm94eSwgc3JjO1xuICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKF9hLmxhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTYW1lT3JpZ2luID0gQ2FjaGVTdG9yYWdlLmlzU2FtZU9yaWdpbihrZXkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZUNPUlMgPSAhaXNJbmxpbmVJbWFnZShrZXkpICYmIHRoaXMuX29wdGlvbnMudXNlQ09SUyA9PT0gdHJ1ZSAmJiBGRUFUVVJFUy5TVVBQT1JUX0NPUlNfSU1BR0VTICYmICFpc1NhbWVPcmlnaW47XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlUHJveHkgPSAhaXNJbmxpbmVJbWFnZShrZXkpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpc1NhbWVPcmlnaW4gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIWlzQmxvYkltYWdlKGtleSkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZW9mIHRoaXMuX29wdGlvbnMucHJveHkgPT09ICdzdHJpbmcnICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZFQVRVUkVTLlNVUFBPUlRfQ09SU19YSFIgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIXVzZUNPUlM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1NhbWVPcmlnaW4gJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fb3B0aW9ucy5hbGxvd1RhaW50ID09PSBmYWxzZSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhaXNJbmxpbmVJbWFnZShrZXkpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpc0Jsb2JJbWFnZShrZXkpICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICF1c2VQcm94eSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhdXNlQ09SUykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYyA9IGtleTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXVzZVByb3h5KSByZXR1cm4gWzMgLypicmVhayovLCAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnByb3h5KHNyYyldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyYyA9IF9hLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5sYWJlbCA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0LmxvZ2dlci5kZWJ1ZyhcIkFkZGVkIGltYWdlIFwiICsga2V5LnN1YnN0cmluZygwLCAyNTYpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW1nID0gbmV3IEltYWdlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcub25sb2FkID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gcmVzb2x2ZShpbWcpOyB9O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nLm9uZXJyb3IgPSByZWplY3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2lvcyBzYWZhcmkgMTAuMyB0YWludHMgY2FudmFzIHdpdGggZGF0YSB1cmxzIHVubGVzcyBjcm9zc09yaWdpbiBpcyBzZXQgdG8gYW5vbnltb3VzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNJbmxpbmVCYXNlNjRJbWFnZShzcmMpIHx8IHVzZUNPUlMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcuY3Jvc3NPcmlnaW4gPSAnYW5vbnltb3VzJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZy5zcmMgPSBzcmM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nLmNvbXBsZXRlID09PSB0cnVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW5saW5lIFhNTCBpbWFnZXMgbWF5IGZhaWwgdG8gcGFyc2UsIHRocm93aW5nIGFuIEVycm9yIGxhdGVyIG9uXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7IHJldHVybiByZXNvbHZlKGltZyk7IH0sIDUwMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoX3RoaXMuX29wdGlvbnMuaW1hZ2VUaW1lb3V0ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgeyByZXR1cm4gcmVqZWN0KFwiVGltZWQgb3V0IChcIiArIF90aGlzLl9vcHRpb25zLmltYWdlVGltZW91dCArIFwibXMpIGxvYWRpbmcgaW1hZ2VcIik7IH0sIF90aGlzLl9vcHRpb25zLmltYWdlVGltZW91dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzogcmV0dXJuIFsyIC8qcmV0dXJuKi8sIF9hLnNlbnQoKV07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYWNoZS5wcm90b3R5cGUuaGFzID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgcmV0dXJuIHR5cGVvZiB0aGlzLl9jYWNoZVtrZXldICE9PSAndW5kZWZpbmVkJztcbiAgICAgICAgfTtcbiAgICAgICAgQ2FjaGUucHJvdG90eXBlLmtleXMgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKE9iamVjdC5rZXlzKHRoaXMuX2NhY2hlKSk7XG4gICAgICAgIH07XG4gICAgICAgIENhY2hlLnByb3RvdHlwZS5wcm94eSA9IGZ1bmN0aW9uIChzcmMpIHtcbiAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICB2YXIgcHJveHkgPSB0aGlzLl9vcHRpb25zLnByb3h5O1xuICAgICAgICAgICAgaWYgKCFwcm94eSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTm8gcHJveHkgZGVmaW5lZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIGtleSA9IHNyYy5zdWJzdHJpbmcoMCwgMjU2KTtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHJlc3BvbnNlVHlwZSA9IEZFQVRVUkVTLlNVUFBPUlRfUkVTUE9OU0VfVFlQRSA/ICdibG9iJyA6ICd0ZXh0JztcbiAgICAgICAgICAgICAgICB2YXIgeGhyID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XG4gICAgICAgICAgICAgICAgeGhyLm9ubG9hZCA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHhoci5zdGF0dXMgPT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlVHlwZSA9PT0gJ3RleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh4aHIucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlYWRlcl8xID0gbmV3IEZpbGVSZWFkZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFkZXJfMS5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgZnVuY3Rpb24gKCkgeyByZXR1cm4gcmVzb2x2ZShyZWFkZXJfMS5yZXN1bHQpOyB9LCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhZGVyXzEuYWRkRXZlbnRMaXN0ZW5lcignZXJyb3InLCBmdW5jdGlvbiAoZSkgeyByZXR1cm4gcmVqZWN0KGUpOyB9LCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhZGVyXzEucmVhZEFzRGF0YVVSTCh4aHIucmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KFwiRmFpbGVkIHRvIHByb3h5IHJlc291cmNlIFwiICsga2V5ICsgXCIgd2l0aCBzdGF0dXMgY29kZSBcIiArIHhoci5zdGF0dXMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB4aHIub25lcnJvciA9IHJlamVjdDtcbiAgICAgICAgICAgICAgICB2YXIgcXVlcnlTdHJpbmcgPSBwcm94eS5pbmRleE9mKCc/JykgPiAtMSA/ICcmJyA6ICc/JztcbiAgICAgICAgICAgICAgICB4aHIub3BlbignR0VUJywgXCJcIiArIHByb3h5ICsgcXVlcnlTdHJpbmcgKyBcInVybD1cIiArIGVuY29kZVVSSUNvbXBvbmVudChzcmMpICsgXCImcmVzcG9uc2VUeXBlPVwiICsgcmVzcG9uc2VUeXBlKTtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VUeXBlICE9PSAndGV4dCcgJiYgeGhyIGluc3RhbmNlb2YgWE1MSHR0cFJlcXVlc3QpIHtcbiAgICAgICAgICAgICAgICAgICAgeGhyLnJlc3BvbnNlVHlwZSA9IHJlc3BvbnNlVHlwZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKF90aGlzLl9v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VlRm9yVHVwbGUoc3R5bGVzLmJvcmRlckJvdHRvbVJpZ2h0UmFkaXVzLCBib3VuZHMud2lkdGgsIGJvdW5kcy5oZWlnaHQpLCBicmggPSBfY1swXSwgYnJ2ID0gX2NbMV07XG4gICAgICAgICAgICB2YXIgX2QgPSBnZXRBYnNvbHV0ZVZhbHVlRm9yVHVwbGUoc3R5bGVzLmJvcmRlckJvdHRvbUxlZnRSYWRpdXMsIGJvdW5kcy53aWR0aCwgYm91bmRzLmhlaWdodCksIGJsaCA9IF9kWzBdLCBibHYgPSBfZFsxXTtcbiAgICAgICAgICAgIHZhciBmYWN0b3JzID0gW107XG4gICAgICAgICAgICBmYWN0b3JzLnB1c2goKHRsaCArIHRyaCkgLyBib3VuZHMud2lkdGgpO1xuICAgICAgICAgICAgZmFjdG9ycy5wdXNoKChibGggKyBicmgpIC8gYm91bmRzLndpZHRoKTtcbiAgICAgICAgICAgIGZhY3RvcnMucHVzaCgodGx2ICsgYmx2KSAvIGJvdW5kcy5oZWlnaHQpO1xuICAgICAgICAgICAgZmFjdG9ycy5wdXNoKCh0cnYgKyBicnYpIC8gYm91bmRzLmhlaWdodCk7XG4gICAgICAgICAgICB2YXIgbWF4RmFjdG9yID0gTWF0aC5tYXguYXBwbHkoTWF0aCwgZmFjdG9ycyk7XG4gICAgICAgICAgICBpZiAobWF4RmFjdG9yID4gMSkge1xuICAgICAgICAgICAgICAgIHRsaCAvPSBtYXhGYWN0b3I7XG4gICAgICAgICAgICAgICAgdGx2IC89IG1heEZhY3RvcjtcbiAgICAgICAgICAgICAgICB0cmggLz0gbWF4RmFjdG9yO1xuICAgICAgICAgICAgICAgIHRydiAvPSBtYXhGYWN0b3I7XG4gICAgICAgICAgICAgICAgYnJoIC89IG1heEZhY3RvcjtcbiAgICAgICAgICAgICAgICBicnYgLz0gbWF4RmFjdG9yO1xuICAgICAgICAgICAgICAgIGJsaCAvPSBtYXhGYWN0b3I7XG4gICAgICAgICAgICAgICAgYmx2IC89IG1heEZ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oKTtcbiAgICAgICAgICAgIHRoaXMudG9wTGVmdEJvcmRlckRvdWJsZU91dGVyQm94ID1cbiAgICAgICAgICAgICAgICB0bGggPiAwIHx8IHRsdiA+IDBcbiAgICAgICAgICAgICAgICAgICAgPyBnZXRDdXJ2ZVBvaW50cyhib3VuZHMubGVmdCArIGJvcmRlckxlZnRXaWR0aCAvIDMsIGJvdW5kcy50b3AgKyBib3JkZXJUb3BXaWR0aCAvIDMsIHRsaCAtIGJvcmRlckxlZnRXaWR0aCAvIDMsIHRsdiAtIGJvcmRlclRvcFdpZHRoIC8gMywgQ09STkVSLlRPUF9MRUZUKVxuICAgICAgICAgICAgICAgICAgICA6IG5ldyBWZWN0b3IoYm91bmRzLmxlZnQgKyBib3JkZXJMZWZ0V2lkdGggLyAzLCBib3VuZHMudG9wICsgYm9yZGVyVG9wV2lkdGggLyAzKTtcbiAgICAgICAgICAgIHRoaXMudG9wUmlnaHRCb3JkZXJEb3VibGVPdXRlckJveCA9XG4gICAgICAgICAgICAgICAgdGxoID4gMCB8fCB0bHYgPiAwXG4gICAgICAgICAgICAgICAgICAgID8gZ2V0Q3VydmVQb2ludHMoYm91bmRzLmxlZnQgKyB0b3BXaWR0aCwgYm91bmRzLnRvcCArIGJvcmRlclRvcFdpZHRoIC8gMywgdHJoIC0gYm9yZGVyUmlnaHRXaWR0aCAvIDMsIHRydiAtIGJvcmRlclRvcFdpZHRoIC8gMywgQ09STkVSLlRPUF9SSUdIVClcbiAgICAgICAgICAgICAgICAgICAgOiBuZXcgVmVjdG9yKGJvdW5kcy5sZWZ0ICsgYm91bmRzLndpZHRoIC0gYm9yZGVyUmlnaHRXaWR0aCAvIDMsIGJvdW5kcy50b3AgKyBib3JkZXJUb3BXaWR0aCAvIDMpO1xuICAgICAgICAgICAgdGhpcy5ib3R0b21SaWdodEJvcmRlckRvdWJsZU91dGVyQm94ID1cbiAgICAgICAgICAgICAgICBicmggPiAwIHx8IGJydiA+IDBcbiAgICAgICAgICAgICAgICAgIC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3AgKyAoYm9yZGVyVG9wV2lkdGggKiAyKSAvIDMsIHRsaCAtIChib3JkZXJMZWZ0V2lkdGggKiAyKSAvIDMsIHRsdiAtIChib3JkZXJUb3BXaWR0aCAqIDIpIC8gMywgQ09STkVSLlRPUF9MRUZUKVxuICAgICAgICAgICAgICAgICAgICA6IG5ldyBWZWN0b3IoYm91bmRzLmxlZnQgKyAoYm9yZGVyTGVmdFdpZHRoICogMikgLyAzLCBib3VuZHMudG9wICsgKGJvcmRlclRvcFdpZHRoICogMikgLyAzKTtcbiAgICAgICAgICAgIHRoaXMudG9wUmlnaHRCb3JkZXJEb3VibGVJbm5lckJveCA9XG4gICAgICAgICAgICAgICAgdGxoID4gMCB8fCB0bHYgPiAwXG4gICAgICAgICAgICAgICAgICAgID8gZ2V0Q3VydmVQb2ludHMoYm91bmRzLmxlZnQgKyB0b3BXaWR0aCwgYm91bmRzLnRvcCArIChib3JkZXJUb3BXaWR0aCAqIDIpIC8gMywgdHJoIC0gKGJvcmRlclJpZ2h0V2lkdGggKiAyKSAvIDMsIHRydiAtIChib3JkZXJUb3BXaWR0aCAqIDIpIC8gMywgQ09STkVSLlRPUF9SSUdIVClcbiAgICAgICAgICAgICAgICAgICAgOiBuZXcgVmVjdG9yKGJvdW5kcy5sZWZ0ICsgYm91bmRzLndpZHRoIC0gKGJvcmRlclJpZ2h0V2lkdGggKiAyKSAvIDMsIGJvdW5kcy50b3AgKyAoYm9yZGVyVG9wV2lkdGggKiAyKSAvIDMpO1xuICAgICAgICAgICAgdGhpcy5ib3R0b21SaWdodEJvcmRlckRvdWJsZUlubmVyQm94ID1cbiAgICAgICAgICAgICAgICBicmggPiAwIHx8IGJydiA+IDBcbiAgICAgICAgICAgICAgICAgICAgPyBnZXRDdXJ2ZVBvaW50cyhib3VuZHMubGVmdCArIGJvdHRvbVdpZHRoLCBib3VuZHMudG9wICsgcmlnaHRIZWlnaHQsIGJyaCAtIChib3JkZXJSaWdodFdpZHRoICogMikgLyAzLCBicnYgLSAoYm9yZGVyQm90dG9tV2lkdGggKiAyKSAvIDMsIENPUk5FUi5CT1RUT01fUklHSFQpXG4gICAgICAgICAgICAgICAgICAgIDogbmV3IFZlY3Rvcihib3VuZHMubGVmdCArIGJvdW5kcy53aWR0aCAtIChib3JkZXJSaWdodFdpZHRoICogMikgLyAzLCBib3VuZHMudG9wICsgYm91bmRzLmhlaWdodCAtIChib3JkZXJCb3R0b21XaWR0aCAqIDIpIC8gMyk7XG4gICAgICAgICAgICB0aGlzLmJvdHRvbUxlZnRCb3JkZXJEb3VibGVJbm5lckJveCA9XG4gICAgICAgICAgICAgICAgYmxoID4gMCB8fCBibHYgPiAwXG4gICAgICAgICAgICAgICAgICAgID8gZ2V0Q3VydmVQb2ludHMoYm91bmRzLmxlZnQgKyAoYm9yZGVyTGVmdFdpZHRoICogMikgLyAzLCBib3VuZHMudG9wICsgbGVmdEhlaWdodCwgYmxoIC0gKGJvcmRlckxlZnRXaWR0aCAqIDIpIC8gMywgYmx2IC0gKGJvcmRlckJvdHRvbVdpZHRoICogMikgLyAzLCBDT1JORVIuQk9UVE9NX0xFRlQpXG4gICAgICAgICAgICAgICAgICAgIDogbmV3IFZlY3Rvcihib3VuZHMubGVmdCArIChib3JkZXJMZWZ0V2lkdGggKiAyKSAvIDMsIGJvdW5kcy50b3AgKyBib3VuZHMuaGVpZ2h0IC0gKGJvcmRlckJvdHRvbVdpZHRoICogMikgLyAzKTtcbiAgICAgICAgICAgIHRoaXMudG9wTGVmdEJvcmRlclN0cm9rZSA9XG4gICAgICAgICAgICAgICAgdGxoID4gMCB8fCB0bHYgPiAwXG4gICAgICAgICAgICAgICAgICAgID8gZ2V0Q3VydmVQb2ludHMoYm91bmRzLmxlZnQgKyBib3JkZXJMZWZ0V2lkdGggLyAyLCBib3VuZHMudG9wICsgYm9yZGVyVG9wV2lkdGggLyAyLCB0bGggLSBib3JkZXJMZWZ0V2lkdGggLyAyLCB0bHYgLSBib3JkZXJUb3BXaWR0aCAvIDIsIEN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dodCAtIGJvcmRlckJvdHRvbVdpZHRoIC8gMik7XG4gICAgICAgICAgICB0aGlzLmJvdHRvbUxlZnRCb3JkZXJTdHJva2UgPVxuICAgICAgICAgICAgICAgIGJsaCA+IDAgfHwgYmx2ID4gMFxuICAgICAgICAgICAgICAgICAgICA/IGdldEN1cnZlUG9pbnRzKGJvdW5kcy5sZWZ0ICsgYm9yZGVyTGVmdFdpZHRoIC8gMiwgYm91bmRzLnRvcCArIGxlZnRIZWlnaHQsIGJsaCAtIGJvcmRlckxlZnRXaWR0aCAvIDIsIGJsdiAtIGJvcmRlckJvdHRvbVdpZHRoIC8gMiwgQ09STkVSLkJPVFRPTV9MRUZUKVxuICAgICAgICAgICAgICAgICAgICA6IG5ldyBWZWN0b3IoYm91bmRzLmxlZnQgKyBib3JkZXJMZWZ0V2lkdGggLyAyLCBib3VuZHMudG9wICsgYm91bmRzLmhlaWdodCAtIGJvcmRlckJvdHRvbVdpZHRoIC8gMik7XG4gICAgICAgICAgICB0aGlzLnRvcExlZnRCb3JkZXJCb3ggPVxuICAgICAgICAgICAgICAgIHRsaCA+IDAgfHwgdGx2ID4gMFxuICAgICAgICAgICAgICAgICAgICA/IGdldEN1cnZlUG9pbnRzKGJvdW5kcy5sZWZ0LCBib3VuZHMudG9wLCB0bGgsIHRsdiwgQ09STkVSLlRPUF9MRUZUKVxuICAgICAgICAgICAgICAgICAgICA6IG5ldyBWZWN0b3IoYm91bmRzLmxlZnQsIGJvdW5kcy50b3ApO1xuICAgICAgICAgICAgdGhpcy50b3BSaWdodEJvcmRlckJveCA9XG4gICAgICAgICAgICAgICAgdHJoID4gMCB8fCB0cnYgPiAwXG4gICAgICAgICAgICAgICAgICAgID8gZ2V0Q3VydmVQb2ludHMoYm91bmRzLmxlZnQgKyB0b3BXaWR0aCwgYm91bmRzLnRvcCwgdHJoLCB0cnYsIENPUk5FUi5UT1BfUklHSFQpXG4gICAgICAgICAgICAgICAgICAgIDogbmV3IFZlY3Rvcihib3VuZHMubG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VudC5jb250YWluZXIuc3R5bGVzLnBvc2l0aW9uICE9PSAwIC8qIFNUQVRJQyAqLyB8fCAhcGFyZW50LnBhcmVudCkge1xuICAgICAgICAgICAgICAgICAgICBlZmZlY3RzLnVuc2hpZnQuYXBwbHkoZWZmZWN0cywgY3JvcGxlc3NFZmZlY3RzKTtcbiAgICAgICAgICAgICAgICAgICAgaW5GbG93ID0gWzIgLyogQUJTT0xVVEUgKi8sIDMgLyogRklYRUQgKi9dLmluZGV4T2YocGFyZW50LmNvbnRhaW5lci5zdHlsZXMucG9zaXRpb24pID09PSAtMTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudC5jb250YWluZXIuc3R5bGVzLm92ZXJmbG93WCAhPT0gMCAvKiBWSVNJQkxFICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYm9yZGVyQm94ID0gY2FsY3VsYXRlQm9yZGVyQm94UGF0aChwYXJlbnQuY3VydmVzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYWRkaW5nQm94ID0gY2FsY3VsYXRlUGFkZGluZ0JveFBhdGgocGFyZW50LmN1cnZlcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVxdWFsUGF0aChib3JkZXJCb3gsIHBhZGRpbmdCb3gpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0cy51bnNoaWZ0KG5ldyBDbGlwRWZmZWN0KHBhZGRpbmdCb3gsIDIgLyogQkFDS0dST1VORF9CT1JERVJTICovIHwgNCAvKiBDT05URU5UICovKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGVmZmVjdHMudW5zaGlmdC5hcHBseShlZmZlY3RzLCBjcm9wbGVzc0VmZmVjdHMpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgIC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FUiAqLykgPyBbXSA6IGxpc3RJdGVtcztcbiAgICAgICAgICAgIGlmICh0cmVhdEFzUmVhbFN0YWNraW5nQ29udGV4dCB8fCBjcmVhdGVzU3RhY2tpbmdDb250ZXh0KSB7XG4gICAgICAgICAgICAgICAgdmFyIHBhcmVudFN0YWNrID0gdHJlYXRBc1JlYWxTdGFja2luZ0NvbnRleHQgfHwgY2hpbGQuc3R5bGVzLmlzUG9zaXRpb25lZCgpID8gcmVhbFN0YWNraW5nQ29udGV4dCA6IHN0YWNraW5nQ29udGV4dDtcbiAgICAgICAgICAgICAgICB2YXIgc3RhY2sgPSBuZXcgU3RhY2tpbmdDb250ZXh0KHBhaW50Q29udGFpbmVyKTtcbiAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc3R5bGVzLmlzUG9zaXRpb25lZCgpIHx8IGNoaWxkLnN0eWxlcy5vcGFjaXR5IDwgMSB8fCBjaGlsZC5zdHlsZXMuaXNUcmFuc2Zvcm1lZCgpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBvcmRlcl8xID0gY2hpbGQuc3R5bGVzLnpJbmRleC5vcmRlcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9yZGVyXzEgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXhfMSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRTdGFjay5uZWdhdGl2ZVpJbmRleC5zb21lKGZ1bmN0aW9uIChjdXJyZW50LCBpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yZGVyXzEgPiBjdXJyZW50LmVsZW1lbnQuY29udGFpbmVyLnN0eWxlcy56SW5kZXgub3JkZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXhfMSA9IGk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaW5kZXhfMSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50U3RhY2submVnYXRpdmVaSW5kZXguc3BsaWNlKGluZGV4XzEsIDAsIHN0YWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChvcmRlcl8xID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4XzIgPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50U3RhY2sucG9zaXRpdmVaSW5kZXguc29tZShmdW5jdGlvbiAoY3VycmVudCwgaSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvcmRlcl8xID49IGN1cnJlbnQuZWxlbWVudC5jb250YWluZXIuc3R5bGVzLnpJbmRleC5vcmRlcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleF8yID0gaSArIDE7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaW5kZXhfMiA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50U3RhY2sucG9zaXRpdmVaSW5kZXguc3BsaWNlKGluZGV4XzIsIDAsIHN0YWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFN0YWNrLnplcm9PckF1dG9aSW5kZXhPclRyYW5zZm9ybWVkT3JPcGFjaXR5LnB1c2goc3RhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc3R5bGVzLmlzRmxvYXRpbmcoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50U3RhY2subm9uUG9zaXRpb25lZEZsb2F0cy5wdXNoKHN0YWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFN0YWNrLm5vblBvc2l0aW9uZWRJbmxpbmVMZXZlbC5wdXNoKHN0YWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBwYXJzZVN0YWNrVHJlZShwYWludENvbnRhaW5lciwgc3RhY2ssIHRyZWF0QXNSZWFsU3RhY2tpbmdDb250ZXh0ID8gc3RhY2sgOiByZWFsU3RhY2tpbmdDb250ZXh0LCBsaXN0T3duZXJJdGVtcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoY2hpbGQuc3R5bGVzLmlzSW5saW5lTGV2ZWwoKSkge1xuICAgICAgICAgICAgICAgICAgICBzdGFja2luZ0NvbnRleHQuaW5saW5lTGV2ZWwucHVzaChwYWludENvbnRhaW5lcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGFja2luZ0NvbnRleHQubm9uSW5saW5lTGV2ZWwucHVzaChwYWludENvbnRhaW5lcik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHBhcnNlU3RhY2tUcmVlKHBhaW50Q29udGFpbmVyLCBzdGFja2luZ0NvbnRleHQsIHJlYWxTdGFja2luZ0NvbnRleHQsIGxpc3RPd25lckl0ZW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb250YWlucyhjaGlsZC5mbGFncywgOCAvKiBJU19MSVNUX09XTkVSICovKSkge1xuICAgICAgICAgICAgICAgIHByb2Nlc3NMaXN0SXRlbXMoY2hpbGQsIGxpc3RPd25lckl0ZW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfTtcbiAgICB2YXIgcHJvY2Vzc0xpc3RJdGVtcyA9IGZ1bmN0aW9uIChvd25lciwgZWxlbWVudHMpIHtcbiAgICAgICAgdmFyIG51bWJlcmluZyA9IG93bmVyIGluc3RhbmNlb2YgT0xFbGVtZW50Q29udGFpbmVyID8gb3duZXIuc3RhcnQgOiAxO1xuICAgICAgICB2YXIgcmV2ZXJzZWQgPSBvd25lciBpbnN0YW5jZW9mIE9MRWxlbWVudENvbnRhaW5lciA/IG93bmVyLnJldmVyc2VkIDogZmFsc2U7XG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbWVudHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHZhciBpdGVtID0gZWxlbWVudHNbaV07XG4gICAgICAgICAgICBpZiAoaXRlbS5jb250YWluZXIgaW5zdGFuY2VvZiBMSUVsZW1lbnRDb250YWluZXIgJiZcbiAgICAgICAgICAgICAgICB0eXBlb2YgaXRlbS5jb250YWluZXIudmFsdWUgPT09ICdudW1iZXInICYmXG4gICAgICAgICAgICAgICAgaXRlbS5jb250YWluZXIudmFsdWUgIT09IDApIHtcbiAgICAgICAgICAgICAgICBudW1iZXJpbmc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ICAgICAgICAgIHBhdGgucHVzaChvdXRlcjEuc3ViZGl2aWRlKDAuNSwgZmFsc2UpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChvdXRlcjEpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0JlemllckN1cnZlKG91dGVyMikpIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChvdXRlcjIuc3ViZGl2aWRlKDAuNSwgdHJ1ZSkpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcGF0aC5wdXNoKG91dGVyMik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHBhdGg7XG4gICAgfTtcbiAgICB2YXIgY3JlYXRlUGF0aEZyb21DdXJ2ZXMgPSBmdW5jdGlvbiAob3V0ZXIxLCBpbm5lcjEsIG91dGVyMiwgaW5uZXIyKSB7XG4gICAgICAgIHZhciBwYXRoID0gW107XG4gICAgICAgIGlmIChpc0JlemllckN1cnZlKG91dGVyMSkpIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChvdXRlcjEuc3ViZGl2aWRlKDAuNSwgZmFsc2UpKTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChvdXRlcjEpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0JlemllckN1cnZlKG91dGVyMikpIHtcbiAgICAgICAgICAgIHBhdGgucHVzaChvdXRlcjIuc3ViZGl2aWRlKDAuNSwgdHJ1ZSkpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgcGF0aC5wdXNoKG91dGVyMik7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGlzQmV6aWVyQ3VydmUoaW5uZXIyKSkge1xuICAgICAgICAgICAgcGF0aC5wdXNoKGlubmVyMi5zdWJkaXZpZGUoMC41LCB0cnVlKS5yZXZlcnNlKCkpO1xuICAgICAgICB9XG4gICAgICA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QpKSkge1xuICAgICAgICAgICAgaGVpZ2h0ID1cbiAgICAgICAgICAgICAgICBoYXNJbnRyaW5zaWNXaWR0aCAmJiBoYXNJbnRyaW5zaWNIZWlnaHRcbiAgICAgICAgICAgICAgICAgICAgPyAod2lkdGggLyBpbnRyaW5zaWNXaWR0aCkgKiBpbnRyaW5zaWNIZWlnaHRcbiAgICAgICAgICAgICAgICAgICAgOiBib3VuZHMuaGVpZ2h0O1xuICAgICAgICB9XG4gICAgICAgIGlmIChoZWlnaHQgIT09IG51bGwgJiYgaXNBdXRvKGZpcnN0KSkge1xuICAgICAgICAgICAgd2lkdGggPVxuICAgICAgICAgICAgICAgIGhhc0ludHJpbnNpY1dpZHRoICYmIGhhc0ludHJpbnNpY0hlaWdodFxuICAgICAgICAgICAgICAgICAgICA/IChoZWlnaHQgLyBpbnRyaW5zaWNIZWlnaHQpICogaW50cmluc2ljV2lkdGhcbiAgICAgICAgICAgICAgICAgICAgOiBib3VuZHMud2lkdGg7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHdpZHRoICE9PSBudWxsICYmIGhlaWdodCAhPT0gbnVsbCkge1xuICAgICAgICAgICAgcmV0dXJuIFt3aWR0aCwgaGVpZ2h0XTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVbmFibGUgdG8gY2FsY3VsYXRlIGJhY2tncm91bmQtc2l6ZSBmb3IgZWxlbWVudFwiKTtcbiAgICB9O1xuICAgIHZhciBnZXRCYWNrZ3JvdW5kVmFsdWVGb3JJbmRleCA9IGZ1bmN0aW9uICh2YWx1ZXMsIGluZGV4KSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IHZhbHVlc1tpbmRleF07XG4gICAgICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gdmFsdWVzWzBdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9O1xuICAgI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CArIGJhY2tncm91bmRQb3NpdGlvbmluZ0FyZWEudG9wICsgeSkpXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGNhc2UgMyAvKiBSRVBFQVRfWSAqLzpcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS5sZWZ0ICsgeCksIE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS50b3ApKSxcbiAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3RvcihNYXRoLnJvdW5kKGJhY2tncm91bmRQb3NpdGlvbmluZ0FyZWEubGVmdCArIHggKyB3aWR0aCksIE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS50b3ApKSxcbiAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3RvcihNYXRoLnJvdW5kKGJhY2tncm91bmRQb3NpdGlvbmluZ0FyZWEubGVmdCArIHggKyB3aWR0aCksIE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS5oZWlnaHQgKyBiYWNrZ3JvdW5kUG9zaXRpb25pbmdBcmVhLnRvcCkpLFxuICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS5sZWZ0ICsgeCksIE1hdGgucm91bmQoYmFja2dyb3VuZFBvc2l0aW9uaW5nQXJlYS5oZWlnaHQgKyBiYWNrZ3JvdW5kUG9zaXRpb25pbmdBcmVhLnRvcCkpXG4gICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGNhc2UgMSAvKiBOT19SRVBFQVQgKi86XG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3RvcihNYXRoLnJvdW5kKGJhY2tncm91bmRQb3NpdGlv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zLl9kb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTtcbiAgICAgICAgICAgIHZhciBzcGFuID0gdGhpcy5fZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc3BhbicpO1xuICAgICAgICAgICAgdmFyIGJvZHkgPSB0aGlzLl9kb2N1bWVudC5ib2R5O1xuICAgICAgICAgICAgY29udGFpbmVyLnN0eWxlLnZpc2liaWxpdHkgPSAnaGlkZGVuJztcbiAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5mb250RmFtaWx5ID0gZm9udEZhbWlseTtcbiAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5mb250U2l6ZSA9IGZvbnRTaXplO1xuICAgICAgICAgICAgY29udGFpbmVyLnN0eWxlLm1hcmdpbiA9ICcwJztcbiAgICAgICAgICAgIGNvbnRhaW5lci5zdHlsZS5wYWRkaW5nID0gJzAnO1xuICAgICAgICAgICAgY29udGFpbmVyLnN0eWxlLndoaXRlU3BhY2UgPSAnbm93cmFwJztcbiAgICAgICAgICAgIGJvZHkuYXBwZW5kQ2hpbGQoY29udGFpbmVyKTtcbiAgICAgICAgICAgIGltZy5zcmMgPSBTTUFMTF9JTUFHRTtcbiAgICAgICAgICAgIGltZy53aWR0aCA9IDE7XG4gICAgICAgICAgICBpbWcuaGVpZ2h0ID0gMTtcbiAgICAgICAgICAgIGltZy5zdHlsZS5tYXJnaW4gPSAnMCc7XG4gICAgICAgICAgICBpbWcuc3R5bGUucGFkZGluZyA9ICcwJztcbiAgICAgICAgICAgIGltZy5zdHlsZS52ZXJ0aWNhbEFsaWduID0gJ2Jhc2VsaW5lJztcbiAgICAgICAgICAgIHNwYW4uc3R5bGUuZm9udEZhbWlseSA9IGZvbnRGYW1pbHk7XG4gICAgICAgICAgICBzcGFuLnN0eWxlLmZvbnRTaXplID0gZm9udFNpemU7XG4gICAgICAgICAgICBzcGFuLnN0eWxlLm1hcmdpbiA9ICcwJztcbiAgICAgICAgICAgIHNwYW4uc3R5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gICAgICAgICAgICB0aGlzLl9kYXRhW2tleV0gPSB0aGlzLnBhcnNlTWV0cmljcyhmb250RmFtaWx5LCBmb250U2l6ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5fZGF0YVtrZXldO1xuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gRm9udE1ldHJpY3M7XG4gICAgfSgpKTtcblxuICAgIHZhciBSZW5kZXJlciA9IC8qKiBAY2xhc3MgKi8gKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgZnVuY3Rpb24gUmVuZGVyZXIoY29udGV4dCwgb3B0aW9ucykge1xuICAgICAgICAgICAgdGhpcy5jb250ZXh0ID0gY29udGV4dDtcbiAgICAgICAgICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFJlbmRlcmVyO1xuICAgIH0oKSk7XG5cbiAgICB2YXIgTUFTS19PRkZTRVQgPSAxMDAwMDtcbiAgICB2YXIgQ2FudmFzUmVuZGVyZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoX3N1cGVyKSB7XG4gICAgICAgIF9fZXh0ZW5kcyhDYW52YXNSZW5kZXJlciwgX3N1cGVyKTtcbiAgICAgICAgZnVuY3Rpb24gQ2FudmFzUmVuZGVyZXIoY29udGV4dCwgb3B0aW9ucykge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gX3N1cGVyLmNhbGwodGhpcywgY29udGV4dCwgb3B0aW9ucykgfHwgdGhpcztcbiAgICAgICAgICAgIF90aGlzLl9hY3RpdmVFZmZlY3RzID0gW107XG4gICAgICAgICAgICBfdGhpcy5jYW52YXMgPSBvcHRpb25zLmNhbnZhcyA/IG9wdGlvbnMuY2FudmFzIDogZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBfdGhpcy5jdHggPSBfdGhpcy5jYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtc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WSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoaXNDbGlwRWZmZWN0KGVmZmVjdCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnBhdGgoZWZmZWN0LnBhdGgpO1xuICAgICAgICAgICAgICAgIHRoaXMuY3R4LmNsaXAoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMuX2FjdGl2ZUVmZmVjdHMucHVzaChlZmZlY3QpO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucG9wRWZmZWN0ID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdGhpcy5fYWN0aXZlRWZmZWN0cy5wb3AoKTtcbiAgICAgICAgICAgIHRoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlclN0YWNrID0gZnVuY3Rpb24gKHN0YWNrKSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlcztcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXMgPSBzdGFjay5lbGVtZW50LmNvbnRhaW5lci5zdHlsZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzdHlsZXMuaXNWaXNpYmxlKCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyU3RhY2tDb250ZW50KHN0YWNrKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hLmxhYmVsID0gMjtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjogcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlck5vZGUgPSBmdW5jdGlvbiAocGFpbnQpIHtcbiAgICAgICAgICAgIHJldHVybiBfX2F3YWl0ZXIodGhpcywgdm9pZCAwLCB2b2lkIDAsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29udGFpbnMocGFpbnQuY29udGFpbmVyLmZsYWdzLCAxNiAvKiBERUJVR19SRU5ERVIgKi8pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnZ2VyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBhaW50LmNvbnRhaW5lci5zdHlsZXMuaXNWaXNpYmxlKCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyTm9kZUJhY2tncm91bmRBbmRCb3JkZXJzKHBhaW50KV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyTm9kZUNvbnRlbnQocGFpbnQpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2EubGFiZWwgPSAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOiByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyVGV4dFdpdGhMZXR0ZXJTcGFjaW5nID0gZnVuY3Rpb24gKHRleHQsIGxldHRlclNwYWNpbmcsIGJhc2VsaW5lKSB7XG4gICAgICAgICAgICB2YXIgX3RoaXMgPSB0aGlzO1xuICAgICAgICAgICAgaWYgKGxldHRlclNwYWNpbmcgPT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsVGV4dCh0ZXh0LnRleHQsIHRleHQuYm91bmRzLmxlZnQsIHRleHQuYm91bmRzLnRvcCArIGJhc2VsaW5lKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciBsZXR0ZXJzID0gc2VnbWVudEdyYXBoZW1lcyh0ZXh0LnRleHQpO1xuICAgICAgICAgICAgICAgIGxldHRlcnMucmVkdWNlKGZ1bmN0aW9uIChsZWZ0LCBsZXR0ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LmZpbGxUZXh0KGxldHRlciwgbGVmdCwgdGV4dC5ib3VuZHMudG9wICsgYmFzZWxpbmUpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGVmdCArIF90aGlzLmN0eC5tZWFzdXJlVGV4dChsZXR0ZXIpLndpZHRoO1xuICAgICAgICAgICAgICAgIH0sIHRleHQuYm91bmRzLmxlZnQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUuY3JlYXRlRm9udFN0eWxlID0gZnVuY3Rpb24gKHN0eWxlcykge1xuICAgICAgICAgICAgdmFyIGZvbnRWYXJpYW50ID0gc3R5bGVzLmZvbnRWYXJpYW50XG4gICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbiAodmFyaWFudCkgeyByZXR1cm4gdmFyaWFudCA9PT0gJ25vcm1hbCcgfHwgdmFyaWFudCA9PT0gJ3NtYWxsLWNhcHMnOyB9KVxuICAgICAgICAgICAgICAgIC5qb2luKCcnKTtcbiAgICAgICAgICAgIHZhciBmb250RmFtaWx5ID0gZml4SU9TU3lzdGVtRm9udHMoc3R5bGVzLmZvbnRGYW1pbHkpLmpvaW4oJywgJyk7XG4gICAgICAgICAgICB2YXIgZm9udFNpemUgPSBpc0RpbWVuc2lvblRva2VuKHN0eWxlcy5mb250U2l6ZSlcbiAgICAgICAgICAgICAgICA/IFwiXCIgKyBzdHlsZXMuZm9udFNpemUubnVtYmVyICsgc3R5bGVzLmZvbnRTaXplLnVuaXRcbiAgICAgICAgICAgICAgICA6IHN0eWxlcy5mb250U2l6ZS5udW1iZXIgKyBcInB4XCI7XG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgIFtzdHlsZXMuZm9udFN0eWxlLCBmb250VmFyaWFudCwgc3R5bGVzLmZvbnRXZWlnaHQsIGZvbnRTaXplLCBmb250RmFtaWx5XS5qb2luKCcgJyksXG4gICAgICAgICAgICAgICAgZm9udEZhbWlseSxcbiAgICAgICAgICAgICAgICBmb250U2l6ZVxuICAgICAgICAgICAgXTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlclRleHROb2RlID0gZnVuY3Rpb24gKHRleHQsIHN0eWxlcykge1xuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBfYSwgZm9udCwgZm9udEZhbWlseSwgZm9udFNpemUsIF9iLCBiYXNlbGluZSwgbWlkZGxlLCBwYWludE9yZGVyO1xuICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYykge1xuICAgICAgICAgICAgICAgICAgICBfYSA9IHRoaXMuY3JlYXRlRm9udFN0eWxlKHN0eWxlcyksIGZvbnQgPSBfYVswXSwgZm9udEZhbWlseSA9IF9hWzFdLCBmb250U2l6ZSA9IF9hWzJdO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5mb250ID0gZm9udDtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZGlyZWN0aW9uID0gc3R5bGVzLmRpcmVjdGlvbiA9PT0gMSAvKiBSVEwgKi8gPyAncnRsJyA6ICdsdHInO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC50ZXh0QWxpZ24gPSAnbGVmdCc7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnRleHRCYXNlbGluZSA9ICdhbHBoYWJldGljJztcbiAgICAgICAgICAgICAgICAgICAgX2IgPSB0aGlzLmZvbnRNZXRyaWNzLmdldE1ldHJpY3MoZm9udEZhbWlseSwgZm9udFNpemUpLCBiYXNlbGluZSA9IF9iLmJhc2VsaW5lLCBtaWRkbGUgPSBfYi5taWRkbGU7XG4gICAgICAgICAgICAgICAgICAgIHBhaW50T3JkZXIgPSBzdHlsZXMucGFpbnRPcmRlcjtcbiAgICAgICAgICAgICAgICAgICAgdGV4dC50ZXh0Qm91bmRzLmZvckVhY2goZnVuY3Rpb24gKHRleHQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhaW50T3JkZXIuZm9yRWFjaChmdW5jdGlvbiAocGFpbnRPcmRlckxheWVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwYWludE9yZGVyTGF5ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwIC8qIEZJTEwgKi86XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguZmlsbFN0eWxlID0gYXNTdHJpbmcoc3R5bGVzLmNvbG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLnJlbmRlclRleHRXaXRoTGV0dGVyU3BhY2luZyh0ZXh0LCBzdHlsZXMubGV0dGVyU3BhY2luZywgYmFzZWxpbmUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRleHRTaGFkb3dzID0gc3R5bGVzLnRleHRTaGFkb3c7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGV4dFNoYWRvd3MubGVuZ3RoICYmIHRleHQudGV4dC50cmltKCkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNoYWRvd3NcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNsaWNlKDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXZlcnNlKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZvckVhY2goZnVuY3Rpb24gKHRleHRTaGFkb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnNoYWRvd0NvbG9yID0gYXNTdHJpbmcodGV4dFNoYWRvdy5jb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dPZmZzZXRYID0gdGV4dFNoYWRvdy5vZmZzZXRYLm51bWJlciAqIF90aGlzLm9wdGlvbnMuc2NhbGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dPZmZzZXRZID0gdGV4dFNoYWRvdy5vZmZzZXRZLm51bWJlciAqIF90aGlzLm9wdGlvbnMuc2NhbGU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dCbHVyID0gdGV4dFNoYWRvdy5ibHVyLm51bWJlcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMucmVuZGVyVGV4dFdpdGhMZXR0ZXJTcGFjaW5nKHRleHQsIHN0eWxlcy5sZXR0ZXJTcGFjaW5nLCBiYXNlbGluZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnNoYWRvd0NvbG9yID0gJyc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnNoYWRvd09mZnNldFggPSAwO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dPZmZzZXRZID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguc2hhZG93Qmx1ciA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGVzLnRleHREZWNvcmF0aW9uTGluZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguZmlsbFN0eWxlID0gYXNTdHJpbmcoc3R5bGVzLnRleHREZWNvcmF0aW9uQ29sb3IgfHwgc3R5bGVzLmNvbG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXMudGV4dERlY29yYXRpb25MaW5lLmZvckVhY2goZnVuY3Rpb24gKHRleHREZWNvcmF0aW9uTGluZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHRleHREZWNvcmF0aW9uTGluZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxIC8qIFVOREVSTElORSAqLzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEcmF3cyBhIGxpbmUgYXQgdGhlIGJhc2VsaW5lIG9mIHRoZSBmb250XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyBBcyBzb21lIGJyb3dzZXJzIGRpc3BsYXkgdGhlIGxpbmUgYXMgbW9yZSB0aGFuIDFweCBpZiB0aGUgZm9udC1zaXplIGlzIGJpZyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIHRvIHRha2UgdGhhdCBpbnRvIGFjY291bnQgYm90aCBpbiBwb3NpdGlvbiBhbmQgc2l6ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5maWxsUmVjdCh0ZXh0LmJvdW5kcy5sZWZ0LCBNYXRoLnJvdW5kKHRleHQuYm91bmRzLnRvcCArIGJhc2VsaW5lKSwgdGV4dC5ib3VuZHMud2lkdGgsIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyIC8qIE9WRVJMSU5FICovOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5maWxsUmVjdCh0ZXh0LmJvdW5kcy5sZWZ0LCBNYXRoLnJvdW5kKHRleHQuYm91bmRzLnRvcCksIHRleHQuYm91bmRzLndpZHRoLCAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMyAvKiBMSU5FX1RIUk9VR0ggKi86XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyB0cnkgYW5kIGZpbmQgZXhhY3QgcG9zaXRpb24gZm9yIGxpbmUtdGhyb3VnaFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5maWxsUmVjdCh0ZXh0LmJvdW5kcy5sZWZ0LCBNYXRoLmNlaWwodGV4dC5ib3VuZHMudG9wICsgbWlkZGxlKSwgdGV4dC5ib3VuZHMud2lkdGgsIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxIC8qIFNUUk9LRSAqLzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZXMud2Via2l0VGV4dFN0cm9rZVdpZHRoICYmIHRleHQudGV4dC50cmltKCkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnN0cm9rZVN0eWxlID0gYXNTdHJpbmcoc3R5bGVzLndlYmtpdFRleHRTdHJva2VDb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LmxpbmVXaWR0aCA9IHN0eWxlcy53ZWJraXRUZXh0U3Ryb2tlV2lkdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHgubGluZUpvaW4gPSAhIXdpbmRvdy5jaHJvbWUgPyAnbWl0ZXInIDogJ3JvdW5kJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguc3Ryb2tlVGV4dCh0ZXh0LnRleHQsIHRleHQuYm91bmRzLmxlZnQsIHRleHQuYm91bmRzLnRvcCArIGJhc2VsaW5lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zdHJva2VTdHlsZSA9ICcnO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LmxpbmVXaWR0aCA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHgubGluZUpvaW4gPSAnbWl0ZXInO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlclJlcGxhY2VkRWxlbWVudCA9IGZ1bmN0aW9uIChjb250YWluZXIsIGN1cnZlcywgaW1hZ2UpIHtcbiAgICAgICAgICAgIGlmIChpbWFnZSAmJiBjb250YWluZXIuaW50cmluc2ljV2lkdGggPiAwICYmIGNvbnRhaW5lci5pbnRyaW5zaWNIZWlnaHQgPiAwKSB7XG4gICAgICAgICAgICAgICAgdmFyIGJveCA9IGNvbnRlbnRCb3goY29udGFpbmVyKTtcbiAgICAgICAgICAgICAgICB2YXIgcGF0aCA9IGNhbGN1bGF0ZVBhZGRpbmdCb3hQYXRoKGN1cnZlcyk7XG4gICAgICAgICAgICAgICAgdGhpcy5wYXRoKHBhdGgpO1xuICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmN0eC5jbGlwKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5jdHguZHJhd0ltYWdlKGltYWdlLCAwLCAwLCBjb250YWluZXIuaW50cmluc2ljV2lkdGgsIGNvbnRhaW5lci5pbnRyaW5zaWNIZWlnaHQsIGJveC5sZWZ0LCBib3gudG9wLCBib3gud2lkdGgsIGJveC5oZWlnaHQpO1xuICAgICAgICAgICAgICAgIHRoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlck5vZGVDb250ZW50ID0gZnVuY3Rpb24gKHBhaW50KSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lciwgY3VydmVzLCBzdHlsZXMsIF9pLCBfYSwgY2hpbGQsIGltYWdlLCBpbWFnZSwgaWZyYW1lUmVuZGVyZXIsIGNhbnZhcywgc2l6ZSwgX2IsIGZvbnRGYW1pbHksIGZvbnRTaXplLCBiYXNlbGluZSwgYm91bmRzLCB4LCB0ZXh0Qm91bmRzLCBpbWcsIGltYWdlLCB1cmwsIGZvbnRGYW1pbHksIGJvdW5kcztcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9jKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2MubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmFwcGx5RWZmZWN0cyhwYWludC5nZXRFZmZlY3RzKDQgLyogQ09OVEVOVCAqLykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lciA9IHBhaW50LmNvbnRhaW5lcjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJ2ZXMgPSBwYWludC5jdXJ2ZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVzID0gY29udGFpbmVyLnN0eWxlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfaSA9IDAsIF9hID0gY29udGFpbmVyLnRleHROb2RlcztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5sYWJlbCA9IDE7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoX2kgPCBfYS5sZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCA0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IF9hW19pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclRleHROb2RlKGNoaWxkLCBzdHlsZXMpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2MubGFiZWwgPSAzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9pKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoY29udGFpbmVyIGluc3RhbmNlb2YgSW1hZ2VFbGVtZW50Q29udGFpbmVyKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgOF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2MubGFiZWwgPSA1O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA1OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jLnRyeXMucHVzaChbNSwgNywgLCA4XSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5jb250ZXh0LmNhY2hlLm1hdGNoKGNvbnRhaW5lci5zcmMpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZSA9IF9jLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbmRlclJlcGxhY2VkRWxlbWVudChjb250YWluZXIsIGN1cnZlcywgaW1hZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDhdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQubG9nZ2VyLmVycm9yKFwiRXJyb3IgbG9hZGluZyBpbWFnZSBcIiArIGNvbnRhaW5lci5zcmMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDhdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA4OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250YWluZXIgaW5zdGFuY2VvZiBDYW52YXNFbGVtZW50Q29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyUmVwbGFjZWRFbGVtZW50KGNvbnRhaW5lciwgY3VydmVzLCBjb250YWluZXIuY2FudmFzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoY29udGFpbmVyIGluc3RhbmNlb2YgU1ZHRWxlbWVudENvbnRhaW5lcikpIHJldHVybiBbMyAvKmJyZWFrKi8sIDEyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5sYWJlbCA9IDk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDk6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2MudHJ5cy5wdXNoKFs5LCAxMSwgLCAxMl0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMuY29udGV4dC5jYWNoZS5tYXRjaChjb250YWluZXIuc3ZnKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlID0gX2Muc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZGVyUmVwbGFjZWRFbGVtZW50KGNvbnRhaW5lciwgY3VydmVzLCBpbWFnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMTJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0LmxvZ2dlci5lcnJvcihcIkVycm9yIGxvYWRpbmcgc3ZnIFwiICsgY29udGFpbmVyLnN2Zy5zdWJzdHJpbmcoMCwgMjU1KSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMTJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShjb250YWluZXIgaW5zdGFuY2VvZiBJRnJhbWVFbGVtZW50Q29udGFpbmVyICYmIGNvbnRhaW5lci50cmVlKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgMTRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmcmFtZVJlbmRlcmVyID0gbmV3IENhbnZhc1JlbmRlcmVyKHRoaXMuY29udGV4dCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZTogdGhpcy5vcHRpb25zLnNjYWxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3I6IGNvbnRhaW5lci5iYWNrZ3JvdW5kQ29sb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHg6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHk6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBjb250YWluZXIud2lkdGgsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogY29udGFpbmVyLmhlaWdodFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIGlmcmFtZVJlbmRlcmVyLnJlbmRlcihjb250YWluZXIudHJlZSldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMgPSBfYy5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5lci53aWR0aCAmJiBjb250YWluZXIuaGVpZ2h0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmRyYXdJbWFnZShjYW52YXMsIDAsIDAsIGNvbnRhaW5lci53aWR0aCwgY29udGFpbmVyLmhlaWdodCwgY29udGFpbmVyLmJvdW5kcy5sZWZ0LCBjb250YWluZXIuYm91bmRzLnRvcCwgY29udGFpbmVyLmJvdW5kcy53aWR0aCwgY29udGFpbmVyLmJvdW5kcy5oZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5sYWJlbCA9IDE0O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxNDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29udGFpbmVyIGluc3RhbmNlb2YgSW5wdXRFbGVtZW50Q29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUgPSBNYXRoLm1pbihjb250YWluZXIuYm91bmRzLndpZHRoLCBjb250YWluZXIuYm91bmRzLmhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250YWluZXIudHlwZSA9PT0gQ0hFQ0tCT1gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250YWluZXIuY2hlY2tlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhdGgoW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKGNvbnRhaW5lci5ib3VuZHMubGVmdCArIHNpemUgKiAwLjM5MzYzLCBjb250YWluZXIuYm91bmRzLnRvcCArIHNpemUgKiAwLjc5KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3Rvcihjb250YWluZXIuYm91bmRzLmxlZnQgKyBzaXplICogMC4xNiwgY29udGFpbmVyLmJvdW5kcy50b3AgKyBzaXplICogMC41NTQ5KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3Rvcihjb250YWluZXIuYm91bmRzLmxlZnQgKyBzaXplICogMC4yNzM0NywgY29udGFpbmVyLmJvdW5kcy50b3AgKyBzaXplICogMC40NDA3MSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBWZWN0b3IoY29udGFpbmVyLmJvdW5kcy5sZWZ0ICsgc2l6ZSAqIDAuMzk2OTQsIGNvbnRhaW5lci5ib3VuZHMudG9wICsgc2l6ZSAqIDAuNTY0OSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBWZWN0b3IoY29udGFpbmVyLmJvdW5kcy5sZWZ0ICsgc2l6ZSAqIDAuNzI5ODMsIGNvbnRhaW5lci5ib3VuZHMudG9wICsgc2l6ZSAqIDAuMjMpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKGNvbnRhaW5lci5ib3VuZHMubGVmdCArIHNpemUgKiAwLjg0LCBjb250YWluZXIuYm91bmRzLnRvcCArIHNpemUgKiAwLjM0MDg1KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3Rvcihjb250YWluZXIuYm91bmRzLmxlZnQgKyBzaXplICogMC4zOTM2MywgY29udGFpbmVyLmJvdW5kcy50b3AgKyBzaXplICogMC43OSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsU3R5bGUgPSBhc1N0cmluZyhJTlBVVF9DT0xPUik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChjb250YWluZXIudHlwZSA9PT0gUkFESU8pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb250YWluZXIuY2hlY2tlZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5iZWdpblBhdGgoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5hcmMoY29udGFpbmVyLmJvdW5kcy5sZWZ0ICsgc2l6ZSAvIDIsIGNvbnRhaW5lci5ib3VuZHMudG9wICsgc2l6ZSAvIDIsIHNpemUgLyA0LCAwLCBNYXRoLlBJICogMiwgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbFN0eWxlID0gYXNTdHJpbmcoSU5QVVRfQ09MT1IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5yZXN0b3JlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzVGV4dElucHV0RWxlbWVudChjb250YWluZXIpICYmIGNvbnRhaW5lci52YWx1ZS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2IgPSB0aGlzLmNyZWF0ZUZvbnRTdHlsZShzdHlsZXMpLCBmb250RmFtaWx5ID0gX2JbMF0sIGZvbnRTaXplID0gX2JbMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2VsaW5lID0gdGhpcy5mb250TWV0cmljcy5nZXRNZXRyaWNzKGZvbnRGYW1pbHksIGZvbnRTaXplKS5iYXNlbGluZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZm9udCA9IGZvbnRGYW1pbHk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGxTdHlsZSA9IGFzU3RyaW5nKHN0eWxlcy5jb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnRleHRCYXNlbGluZSA9ICdhbHBoYWJldGljJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHgudGV4dEFsaWduID0gY2FudmFzVGV4dEFsaWduKGNvbnRhaW5lci5zdHlsZXMudGV4dEFsaWduKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm91bmRzID0gY29udGVudEJveChjb250YWluZXIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChjb250YWluZXIuc3R5bGVzLnRleHRBbGlnbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxIC8qIENFTlRFUiAqLzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ICs9IGJvdW5kcy53aWR0aCAvIDI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDIgLyogUklHSFQgKi86XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeCArPSBib3VuZHMud2lkdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dEJvdW5kcyA9IGJvdW5kcy5hZGQoeCwgMCwgMCwgLWJvdW5kcy5oZWlnaHQgLyAyICsgMSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoKFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBWZWN0b3IoYm91bmRzLmxlZnQsIGJvdW5kcy50b3ApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFZlY3Rvcihib3VuZHMubGVmdCArIGJvdW5kcy53aWR0aCwgYm91bmRzLnRvcCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKGJvdW5kcy5sZWZ0ICsgYm91bmRzLndpZHRoLCBib3VuZHMudG9wICsgYm91bmRzLmhlaWdodCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgVmVjdG9yKGJvdW5kcy5sZWZ0LCBib3VuZHMudG9wICsgYm91bmRzLmhlaWdodClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmNsaXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW5kZXJUZXh0V2l0aExldHRlclNwYWNpbmcobmV3IFRleHRCb3VuZHMoY29udGFpbmVyLnZhbHVlLCB0ZXh0Qm91bmRzKSwgc3R5bGVzLmxldHRlclNwYWNpbmcsIGJhc2VsaW5lKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHgucmVzdG9yZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC50ZXh0QmFzZWxpbmUgPSAnYWxwaGFiZXRpYyc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnRleHRBbGlnbiA9ICdsZWZ0JztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb250YWlucyhjb250YWluZXIuc3R5bGVzLmRpc3BsYXksIDIwNDggLyogTElTVF9JVEVNICovKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgMjBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGNvbnRhaW5lci5zdHlsZXMubGlzdFN0eWxlSW1hZ2UgIT09IG51bGwpKSByZXR1cm4gWzMgLypicmVhayovLCAxOV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gY29udGFpbmVyLnN0eWxlcy5saXN0U3R5bGVJbWFnZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShpbWcudHlwZSA9PT0gMCAvKiBVUkwgKi8pKSByZXR1cm4gWzMgLypicmVhayovLCAxOF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgPSB2b2lkIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gaW1nLnVybDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy5sYWJlbCA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxNTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYy50cnlzLnB1c2goWzE1LCAxNywgLCAxOF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMuY29udGV4dC5jYWNoZS5tYXRjaCh1cmwpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTY6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgPSBfYy5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZHJhd0ltYWdlKGltYWdlLCBjb250YWluZXIuYm91bmRzLmxlZnQgLSAoaW1hZ2Uud2lkdGggKyAxMCksIGNvbnRhaW5lci5ib3VuZHMudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCAxOF07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE3OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHQubG9nZ2VyLmVycm9yKFwiRXJyb3IgbG9hZGluZyBsaXN0LXN0eWxlLWltYWdlIFwiICsgdXJsKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCAxOF07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE4OiByZXR1cm4gWzMgLypicmVhayovLCAyMF07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE5OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYWludC5saXN0VmFsdWUgJiYgY29udGFpbmVyLnN0eWxlcy5saXN0U3R5bGVUeXBlICE9PSAtMSAvKiBOT05FICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnRGYW1pbHkgPSB0aGlzLmNyZWF0ZUZvbnRTdHlsZShzdHlsZXMpWzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5mb250ID0gZm9udEZhbWlseTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbFN0eWxlID0gYXNTdHJpbmcoc3R5bGVzLmNvbG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHgudGV4dEJhc2VsaW5lID0gJ21pZGRsZSc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnRleHRBbGlnbiA9ICdyaWdodCc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvdW5kcyA9IG5ldyBCb3VuZHMoY29udGFpbmVyLmJvdW5kcy5sZWZ0LCBjb250YWluZXIuYm91bmRzLnRvcCArIGdldEFic29sdXRlVmFsdWUoY29udGFpbmVyLnN0eWxlcy5wYWRkaW5nVG9wLCBjb250YWluZXIuYm91bmRzLndpZHRoKSwgY29udGFpbmVyLmJvdW5kcy53aWR0aCwgY29tcHV0ZUxpbmVIZWlnaHQoc3R5bGVzLmxpbmVIZWlnaHQsIHN0eWxlcy5mb250U2l6ZS5udW1iZXIpIC8gMiArIDEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbmRlclRleHRXaXRoTGV0dGVyU3BhY2luZyhuZXcgVGV4dEJvdW5kcyhwYWludC5saXN0VmFsdWUsIGJvdW5kcyksIHN0eWxlcy5sZXR0ZXJTcGFjaW5nLCBjb21wdXRlTGluZUhlaWdodChzdHlsZXMubGluZUhlaWdodCwgc3R5bGVzLmZvbnRTaXplLm51bWJlcikgLyAyICsgMik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnRleHRCYXNlbGluZSA9ICdib3R0b20nO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC50ZXh0QWxpZ24gPSAnbGVmdCc7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jLmxhYmVsID0gMjA7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDIwOiByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyU3RhY2tDb250ZW50ID0gZnVuY3Rpb24gKHN0YWNrKSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIF9pLCBfYSwgY2hpbGQsIF9iLCBfYywgY2hpbGQsIF9kLCBfZSwgY2hpbGQsIF9mLCBfZywgY2hpbGQsIF9oLCBfaiwgY2hpbGQsIF9rLCBfbCwgY2hpbGQsIF9tLCBfbywgY2hpbGQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfcCkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKF9wLmxhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5zKHN0YWNrLmVsZW1lbnQuY29udGFpbmVyLmZsYWdzLCAxNiAvKiBERUJVR19SRU5ERVIgKi8pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYnVnZ2VyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBodHRwczovL3d3dy53My5vcmcvVFIvY3NzLXBvc2l0aW9uLTMvI3BhaW50aW5nLW9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMS4gdGhlIGJhY2tncm91bmQgYW5kIGJvcmRlcnMgb2YgdGhlIGVsZW1lbnQgZm9ybWluZyB0aGUgc3RhY2tpbmcgY29udGV4dC5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlck5vZGVCYWNrZ3JvdW5kQW5kQm9yZGVycyhzdGFjay5lbGVtZW50KV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly93d3cudzMub3JnL1RSL2Nzcy1wb3NpdGlvbi0zLyNwYWludGluZy1vcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEuIHRoZSBiYWNrZ3JvdW5kIGFuZCBib3JkZXJzIG9mIHRoZSBlbGVtZW50IGZvcm1pbmcgdGhlIHN0YWNraW5nIGNvbnRleHQuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3Auc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9pID0gMCwgX2EgPSBzdGFjay5uZWdhdGl2ZVpJbmRleDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoX2kgPCBfYS5sZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCA1XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IF9hW19pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclN0YWNrKGNoaWxkKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3Auc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLmxhYmVsID0gNDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfaSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA1OiBcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIDMuIEZvciBhbGwgaXRzIGluLWZsb3csIG5vbi1wb3NpdGlvbmVkLCBibG9jay1sZXZlbCBkZXNjZW5kYW50cyBpbiB0cmVlIG9yZGVyOlxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5yZW5kZXJOb2RlQ29udGVudChzdGFjay5lbGVtZW50KV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMy4gRm9yIGFsbCBpdHMgaW4tZmxvdywgbm9uLXBvc2l0aW9uZWQsIGJsb2NrLWxldmVsIGRlc2NlbmRhbnRzIGluIHRyZWUgb3JkZXI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3Auc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9iID0gMCwgX2MgPSBzdGFjay5ub25JbmxpbmVMZXZlbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDc7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDc6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoX2IgPCBfYy5sZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCAxMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGQgPSBfY1tfYl07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5yZW5kZXJOb2RlKGNoaWxkKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3Auc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLmxhYmVsID0gOTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgOTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYisrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDddO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZCA9IDAsIF9lID0gc3RhY2subm9uUG9zaXRpb25lZEZsb2F0cztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDExO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShfZCA8IF9lLmxlbmd0aCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDE0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IF9lW19kXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclN0YWNrKGNoaWxkKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDEzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZCsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDExXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2YgPSAwLCBfZyA9IHN0YWNrLm5vblBvc2l0aW9uZWRJbmxpbmVMZXZlbDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDE1O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxNTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShfZiA8IF9nLmxlbmd0aCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDE4XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IF9nW19mXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclN0YWNrKGNoaWxkKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE2OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDE3O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxNzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZisrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDE1XTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTg6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2ggPSAwLCBfaiA9IHN0YWNrLmlubGluZUxldmVsO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLmxhYmVsID0gMTk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE5OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKF9oIDwgX2oubGVuZ3RoKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgMjJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkID0gX2pbX2hdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyTm9kZShjaGlsZCldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3AubGFiZWwgPSAyMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2grKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCAxOV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDIyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9rID0gMCwgX2wgPSBzdGFjay56ZXJvT3JBdXRvWkluZGV4T3JUcmFuc2Zvcm1lZE9yT3BhY2l0eTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDIzO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShfayA8IF9sLmxlbmd0aCkpIHJldHVybiBbMyAvKmJyZWFrKi8sIDI2XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZCA9IF9sW19rXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclN0YWNrKGNoaWxkKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI0OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfcC5sYWJlbCA9IDI1O1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyNTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfaysrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDIzXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjY6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX20gPSAwLCBfbyA9IHN0YWNrLnBvc2l0aXZlWkluZGV4O1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLmxhYmVsID0gMjc7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI3OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKF9tIDwgX28ubGVuZ3RoKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgMzBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkID0gX29bX21dO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyU3RhY2soY2hpbGQpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjg6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX3Auc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9wLmxhYmVsID0gMjk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI5OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9tKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMjddO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAzMDogcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLm1hc2sgPSBmdW5jdGlvbiAocGF0aHMpIHtcbiAgICAgICAgICAgIHRoaXMuY3R4LmJlZ2luUGF0aCgpO1xuICAgICAgICAgICAgdGhpcy5jdHgubW92ZVRvKDAsIDApO1xuICAgICAgICAgICAgdGhpcy5jdHgubGluZVRvKHRoaXMuY2FudmFzLndpZHRoLCAwKTtcbiAgICAgICAgICAgIHRoaXMuY3R4LmxpbmVUbyh0aGlzLmNhbnZhcy53aWR0aCwgdGhpcy5jYW52YXMuaGVpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY3R4LmxpbmVUbygwLCB0aGlzLmNhbnZhcy5oZWlnaHQpO1xuICAgICAgICAgICAgdGhpcy5jdHgubGluZVRvKDAsIDApO1xuICAgICAgICAgICAgdGhpcy5mb3JtYXRQYXRoKHBhdGhzLnNsaWNlKDApLnJldmVyc2UoKSk7XG4gICAgICAgICAgICB0aGlzLmN0eC5jbG9zZVBhdGgoKTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnBhdGggPSBmdW5jdGlvbiAocGF0aHMpIHtcbiAgICAgICAgICAgIHRoaXMuY3R4LmJlZ2luUGF0aCgpO1xuICAgICAgICAgICAgdGhpcy5mb3JtYXRQYXRoKHBhdGhzKTtcbiAgICAgICAgICAgIHRoaXMuY3R4LmNsb3NlUGF0aCgpO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUuZm9ybWF0UGF0aCA9IGZ1bmN0aW9uIChwYXRocykge1xuICAgICAgICAgICAgdmFyIF90aGlzID0gdGhpcztcbiAgICAgICAgICAgIHBhdGhzLmZvckVhY2goZnVuY3Rpb24gKHBvaW50LCBpbmRleCkge1xuICAgICAgICAgICAgICAgIHZhciBzdGFydCA9IGlzQmV6aWVyQ3VydmUocG9pbnQpID8gcG9pbnQuc3RhcnQgOiBwb2ludDtcbiAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4Lm1vdmVUbyhzdGFydC54LCBzdGFydC55KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5saW5lVG8oc3RhcnQueCwgc3RhcnQueSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpc0JlemllckN1cnZlKHBvaW50KSkge1xuICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguYmV6aWVyQ3VydmVUbyhwb2ludC5zdGFydENvbnRyb2wueCwgcG9pbnQuc3RhcnRDb250cm9sLnksIHBvaW50LmVuZENvbnRyb2wueCwgcG9pbnQuZW5kQ29udHJvbC55LCBwb2ludC5lbmQueCwgcG9pbnQuZW5kLnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyUmVwZWF0ID0gZnVuY3Rpb24gKHBhdGgsIHBhdHRlcm4sIG9mZnNldFgsIG9mZnNldFkpIHtcbiAgICAgICAgICAgIHRoaXMucGF0aChwYXRoKTtcbiAgICAgICAgICAgIHRoaXMuY3R4LmZpbGxTdHlsZSA9IHBh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B7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKF9oLmxhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShiYWNrZ3JvdW5kSW1hZ2UudHlwZSA9PT0gMCAvKiBVUkwgKi8pKSByZXR1cm4gWzMgLypicmVhayovLCA1XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgPSB2b2lkIDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IGJhY2tncm91bmRJbWFnZS51cmw7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9oLmxhYmVsID0gMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9oLnRyeXMucHVzaChbMSwgMywgLCA0XSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXNfMS5jb250ZXh0LmNhY2hlLm1hdGNoKHVybCldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UgPSBfaC5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2guc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzXzEuY29udGV4dC5sb2dnZXIuZXJyb3IoXCJFcnJvciBsb2FkaW5nIGJhY2tncm91bmQtaW1hZ2UgXCIgKyB1cmwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCA0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWFnZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2MgPSBjYWxjdWxhdGVCYWNrZ3JvdW5kUmVuZGVyaW5nKGNvbnRhaW5lciwgaW5kZXgsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS53aWR0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS5oZWlnaHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Uud2lkdGggLyBpbWFnZS5oZWlnaHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLCBwYXRoID0gX2NbMF0sIHggPSBfY1sxXSwgeSA9IF9jWzJdLCB3aWR0aCA9IF9jWzNdLCBoZWlnaHQgPSBfY1s0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4gPSB0aGlzXzEuY3R4LmNyZWF0ZVBhdHRlcm4odGhpc18xLnJlc2l6ZUltYWdlKGltYWdlLCB3aWR0aCwgaGVpZ2h0KSwgJ3JlcGVhdCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLnJlbmRlclJlcGVhdChwYXRoLCBwYXR0ZXJuLCB4LCB5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCA2XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0xpbmVhckdyYWRpZW50KGJhY2tncm91bmRJbWFnZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9kID0gY2FsY3VsYXRlQmFja2dyb3VuZFJlbmRlcmluZyhjb250YWluZXIsIGluZGV4LCBbbnVsbCwgbnVsbCwgbnVsbF0pLCBwYXRoID0gX2RbMF0sIHggPSBfZFsxXSwgeSA9IF9kWzJdLCB3aWR0aCA9IF9kWzNdLCBoZWlnaHQgPSBfZFs0XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9lID0gY2FsY3VsYXRlR3JhZGllbnREaXJlY3Rpb24oYmFja2dyb3VuZEltYWdlLmFuZ2xlLCB3aWR0aCwgaGVpZ2h0KSwgbGluZUxlbmd0aCA9IF9lWzBdLCB4MCA9IF9lWzFdLCB4MSA9IF9lWzJdLCB5MCA9IF9lWzNdLCB5MSA9IF9lWzRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMud2lkdGggPSB3aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyYWRpZW50XzEgPSBjdHguY3JlYXRlTGluZWFyR3JhZGllbnQoeDAsIHkwLCB4MSwgeTEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbG9yU3RvcHMoYmFja2dyb3VuZEltYWdlLnN0b3BzLCBsaW5lTGVuZ3RoKS5mb3JFYWNoKGZ1bmN0aW9uIChjb2xvclN0b3ApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JhZGllbnRfMS5hZGRDb2xvclN0b3AoY29sb3JTdG9wLnN0b3AsIGFzU3RyaW5nKGNvbG9yU3RvcC5jb2xvcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHguZmlsbFN0eWxlID0gZ3JhZGllbnRfMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0eC5maWxsUmVjdCgwLCAwLCB3aWR0aCwgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3aWR0aCA+IDAgJiYgaGVpZ2h0ID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4gPSB0aGlzXzEuY3R4LmNyZWF0ZVBhdHRlcm4oY2FudmFzLCAncmVwZWF0Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLnJlbmRlclJlcGVhdChwYXRoLCBwYXR0ZXJuLCB4LCB5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpc1JhZGlhbEdyYWRpZW50KGJhY2tncm91bmRJbWFnZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9mID0gY2FsY3VsYXRlQmFja2dyb3VuZFJlbmRlcmluZyhjb250YWluZXIsIGluZGV4LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pLCBwYXRoID0gX2ZbMF0sIGxlZnQgPSBfZlsxXSwgdG9wXzEgPSBfZlsyXSwgd2lkdGggPSBfZlszXSwgaGVpZ2h0ID0gX2ZbNF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IGJhY2tncm91bmRJbWFnZS5wb3NpdGlvbi5sZW5ndGggPT09IDAgPyBbRklGVFlfUEVSQ0VOVF0gOiBiYWNrZ3JvdW5kSW1hZ2UucG9zaXRpb247XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gZ2V0QWJzb2x1dGVWYWx1ZShwb3NpdGlvblswXSwgd2lkdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9IGdldEFic29sdXRlVmFsdWUocG9zaXRpb25bcG9zaXRpb24ubGVuZ3RoIC0gMV0sIGhlaWdodCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZyA9IGNhbGN1bGF0ZVJhZGl1cyhiYWNrZ3JvdW5kSW1hZ2UsIHgsIHksIHdpZHRoLCBoZWlnaHQpLCByeCA9IF9nWzBdLCByeSA9IF9nWzFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ4ID4gMCAmJiByeSA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpYWxHcmFkaWVudF8xID0gdGhpc18xLmN0eC5jcmVhdGVSYWRpYWxHcmFkaWVudChsZWZ0ICsgeCwgdG9wXzEgKyB5LCAwLCBsZWZ0ICsgeCwgdG9wXzEgKyB5LCByeCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbG9yU3RvcHMoYmFja2dyb3VuZEltYWdlLnN0b3BzLCByeCAqIDIpLmZvckVhY2goZnVuY3Rpb24gKGNvbG9yU3RvcCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmFkaWFsR3JhZGllbnRfMS5hZGRDb2xvclN0b3AoY29sb3JTdG9wLnN0b3AsIGFzU3RyaW5nKGNvbG9yU3RvcC5jb2xvcikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNfMS5wYXRoKHBhdGgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNfMS5jdHguZmlsbFN0eWxlID0gcmFkaWFsR3JhZGllbnRfMTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnggIT09IHJ5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pZFggPSBjb250YWluZXIuYm91bmRzLmxlZnQgKyAwLjUgKiBjb250YWluZXIuYm91bmRzLndpZHRoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaWRZID0gY29udGFpbmVyLmJvdW5kcy50b3AgKyAwLjUgKiBjb250YWluZXIuYm91bmRzLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IHJ5IC8gcng7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludkYgPSAxIC8gZjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLmN0eC5zYXZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNfMS5jdHgudHJhbnNsYXRlKG1pZFgsIG1pZFkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzXzEuY3R4LnRyYW5zZm9ybSgxLCAwLCAwLCBmLCAwLCAwKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLmN0eC50cmFuc2xhdGUoLW1pZFgsIC1taWRZKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLmN0eC5maWxsUmVjdChsZWZ0LCBpbnZGICogKHRvcF8xIC0gbWlkWSkgKyBtaWRZLCB3aWR0aCwgaGVpZ2h0ICogaW52Rik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNfMS5jdHgucmVzdG9yZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpc18xLmN0eC5maWxsKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9oLmxhYmVsID0gNjtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDY6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LS07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzXzEgPSB0aGlzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9pID0gMCwgX2EgPSBjb250YWluZXIuc3R5bGVzLmJhY2tncm91bmRJbWFnZS5zbGljZSgwKS5yZXZlcnNlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2IubGFiZWwgPSAxO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKF9pIDwgX2EubGVuZ3RoKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgNF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZEltYWdlID0gX2FbX2ldO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNSAvKnlpZWxkKiovLCBfbG9vcF8xKGJhY2tncm91bmRJbWFnZSldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9iLnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYi5sYWJlbCA9IDM7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDM6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2krKztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzMgLypicmVhayovLCAxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNDogcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgQ2FudmFzUmVuZGVyZXIucHJvdG90eXBlLnJlbmRlclNvbGlkQm9yZGVyID0gZnVuY3Rpb24gKGNvbG9yLCBzaWRlLCBjdXJ2ZVBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2EpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoKHBhcnNlUGF0aEZvckJvcmRlcihjdXJ2ZVBvaW50cywgc2lkZSkpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsU3R5bGUgPSBhc1N0cmluZyhjb2xvcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgICAgIENhbnZhc1JlbmRlcmVyLnByb3RvdHlwZS5yZW5kZXJEb3VibGVCb3JkZXIgPSBmdW5jdGlvbiAoY29sb3IsIHdpZHRoLCBzaWRlLCBjdXJ2ZVBvaW50cykge1xuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBvdXRlclBhdGhzLCBpbm5lclBhdGhzO1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2EpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChfYS5sYWJlbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKHdpZHRoIDwgMykpIHJldHVybiBbMyAvKmJyZWFrKi8sIDJdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyU29saWRCb3JkZXIoY29sb3IsIHNpZGUsIGN1cnZlUG9pbnRzKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMiAvKnJldHVybiovXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRlclBhdGhzID0gcGFyc2VQYXRoRm9yQm9yZGVyRG91YmxlT3V0ZXIoY3VydmVQb2ludHMsIHNpZGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aChvdXRlclBhdGhzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsU3R5bGUgPSBhc1N0cmluZyhjb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlubmVyUGF0aHMgPSBwYXJzZVBhdGhGb3JCb3JkZXJEb3VibGVJbm5lcihjdXJ2ZVBvaW50cywgc2lkZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoKGlubmVyUGF0aHMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyTm9kZUJhY2tncm91bmRBbmRCb3JkZXJzID0gZnVuY3Rpb24gKHBhaW50KSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlcywgaGFzQmFja2dyb3VuZCwgYm9yZGVycywgYmFja2dyb3VuZFBhaW50aW5nQXJlYSwgc2lkZSwgX2ksIGJvcmRlcnNfMSwgYm9yZGVyO1xuICAgICAgICAgICAgICAgIHZhciBfdGhpcyA9IHRoaXM7XG4gICAgICAgICAgICAgICAgcmV0dXJuIF9fZ2VuZXJhdG9yKHRoaXMsIGZ1bmN0aW9uIChfYSkge1xuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKF9hLmxhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hcHBseUVmZmVjdHMocGFpbnQuZ2V0RWZmZWN0cygyIC8qIEJBQ0tHUk9VTkRfQk9SREVSUyAqLykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlcyA9IHBhaW50LmNvbnRhaW5lci5zdHlsZXM7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQmFja2dyb3VuZCA9ICFpc1RyYW5zcGFyZW50KHN0eWxlcy5iYWNrZ3JvdW5kQ29sb3IpIHx8IHN0eWxlcy5iYWNrZ3JvdW5kSW1hZ2UubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcnMgPSBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgc3R5bGU6IHN0eWxlcy5ib3JkZXJUb3BTdHlsZSwgY29sb3I6IHN0eWxlcy5ib3JkZXJUb3BDb2xvciwgd2lkdGg6IHN0eWxlcy5ib3JkZXJUb3BXaWR0aCB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IHN0eWxlOiBzdHlsZXMuYm9yZGVyUmlnaHRTdHlsZSwgY29sb3I6IHN0eWxlcy5ib3JkZXJSaWdodENvbG9yLCB3aWR0aDogc3R5bGVzLmJvcmRlclJpZ2h0V2lkdGggfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyBzdHlsZTogc3R5bGVzLmJvcmRlckJvdHRvbVN0eWxlLCBjb2xvcjogc3R5bGVzLmJvcmRlckJvdHRvbUNvbG9yLCB3aWR0aDogc3R5bGVzLmJvcmRlckJvdHRvbVdpZHRoIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgc3R5bGU6IHN0eWxlcy5ib3JkZXJMZWZ0U3R5bGUsIGNvbG9yOiBzdHlsZXMuYm9yZGVyTGVmdENvbG9yLCB3aWR0aDogc3R5bGVzLmJvcmRlckxlZnRXaWR0aCB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kUGFpbnRpbmdBcmVhID0gY2FsY3VsYXRlQmFja2dyb3VuZEN1cnZlZFBhaW50aW5nQXJlYShnZXRCYWNrZ3JvdW5kVmFsdWVGb3JJbmRleChzdHlsZXMuYmFja2dyb3VuZENsaXAsIDApLCBwYWludC5jdXJ2ZXMpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGhhc0JhY2tncm91bmQgfHwgc3R5bGVzLmJveFNoYWRvdy5sZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCAyXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5zYXZlKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXRoKGJhY2tncm91bmRQYWludGluZ0FyZWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmNsaXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzVHJhbnNwYXJlbnQoc3R5bGVzLmJhY2tncm91bmRDb2xvcikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbFN0eWxlID0gYXNTdHJpbmcoc3R5bGVzLmJhY2tncm91bmRDb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5yZW5kZXJCYWNrZ3JvdW5kSW1hZ2UocGFpbnQuY29udGFpbmVyKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZXMuYm94U2hhZG93XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zbGljZSgwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmV2ZXJzZSgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uIChzaGFkb3cpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJvcmRlckJveEFyZWEgPSBjYWxjdWxhdGVCb3JkZXJCb3hQYXRoKHBhaW50LmN1cnZlcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYXNrT2Zmc2V0ID0gc2hhZG93Lmluc2V0ID8gMCA6IE1BU0tfT0ZGU0VUO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2hhZG93UGFpbnRpbmdBcmVhID0gdHJhbnNmb3JtUGF0aChib3JkZXJCb3hBcmVhLCAtbWFza09mZnNldCArIChzaGFkb3cuaW5zZXQgPyAxIDogLTEpICogc2hhZG93LnNwcmVhZC5udW1iZXIsIChzaGFkb3cuaW5zZXQgPyAxIDogLTEpICogc2hhZG93LnNwcmVhZC5udW1iZXIsIHNoYWRvdy5zcHJlYWQubnVtYmVyICogKHNoYWRvdy5pbnNldCA/IC0yIDogMiksIHNoYWRvdy5zcHJlYWQubnVtYmVyICogKHNoYWRvdy5pbnNldCA/IC0yIDogMikpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2hhZG93Lmluc2V0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5wYXRoKGJvcmRlckJveEFyZWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LmNsaXAoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLm1hc2soc2hhZG93UGFpbnRpbmdBcmVhKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLm1hc2soYm9yZGVyQm94QXJlYSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguY2xpcCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMucGF0aChzaGFkb3dQYWludGluZ0FyZWEpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dPZmZzZXRYID0gc2hhZG93Lm9mZnNldFgubnVtYmVyICsgbWFza09mZnNldDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnNoYWRvd09mZnNldFkgPSBzaGFkb3cub2Zmc2V0WS5udW1iZXI7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dDb2xvciA9IGFzU3RyaW5nKHNoYWRvdy5jb2xvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLmN0eC5zaGFkb3dCbHVyID0gc2hhZG93LmJsdXIubnVtYmVyO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfdGhpcy5jdHguZmlsbFN0eWxlID0gc2hhZG93Lmluc2V0ID8gYXNTdHJpbmcoc2hhZG93LmNvbG9yKSA6ICdyZ2JhKDAsMCwwLDEpJztcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LmZpbGwoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5sYWJlbCA9IDI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lkZSA9IDA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2kgPSAwLCBib3JkZXJzXzEgPSBib3JkZXJzO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hLmxhYmVsID0gMztcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShfaSA8IGJvcmRlcnNfMS5sZW5ndGgpKSByZXR1cm4gWzMgLypicmVhayovLCAxM107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyID0gYm9yZGVyc18xW19pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShib3JkZXIuc3R5bGUgIT09IDAgLyogTk9ORSAqLyAmJiAhaXNUcmFuc3BhcmVudChib3JkZXIuY29sb3IpICYmIGJvcmRlci53aWR0aCA+IDApKSByZXR1cm4gWzMgLypicmVhayovLCAxMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoYm9yZGVyLnN0eWxlID09PSAyIC8qIERBU0hFRCAqLykpIHJldHVybiBbMyAvKmJyZWFrKi8sIDVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHRoaXMucmVuZGVyRGFzaGVkRG90dGVkQm9yZGVyKGJvcmRlci5jb2xvciwgYm9yZGVyLndpZHRoLCBzaWRlLCBwYWludC5jdXJ2ZXMsIDIgLyogREFTSEVEICovKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDQ6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDExXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNTpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShib3JkZXIuc3R5bGUgPT09IDMgLyogRE9UVEVEICovKSkgcmV0dXJuIFszIC8qYnJlYWsqLywgN107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5yZW5kZXJEYXNoZWREb3R0ZWRCb3JkZXIoYm9yZGVyLmNvbG9yLCBib3JkZXIud2lkdGgsIHNpZGUsIHBhaW50LmN1cnZlcywgMyAvKiBET1RURUQgKi8pXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgNjpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgMTFdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA3OlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKGJvcmRlci5zdHlsZSA9PT0gNCAvKiBET1VCTEUgKi8pKSByZXR1cm4gWzMgLypicmVhayovLCA5XTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlckRvdWJsZUJvcmRlcihib3JkZXIuY29sb3IsIGJvcmRlci53aWR0aCwgc2lkZSwgcGFpbnQuY3VydmVzKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDg6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDExXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgOTogcmV0dXJuIFs0IC8qeWllbGQqLywgdGhpcy5yZW5kZXJTb2xpZEJvcmRlcihib3JkZXIuY29sb3IsIHNpZGUsIHBhaW50LmN1cnZlcyldO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfYS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2EubGFiZWwgPSAxMTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMTE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lkZSsrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9hLmxhYmVsID0gMTI7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEyOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9pKys7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFszIC8qYnJlYWsqLywgM107XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEzOiByZXR1cm4gWzIgLypyZXR1cm4qL107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9O1xuICAgICAgICBDYW52YXNSZW5kZXJlci5wcm90b3R5cGUucmVuZGVyRGFzaGVkRG90dGVkQm9yZGVyID0gZnVuY3Rpb24gKGNvbG9yLCB3aWR0aCwgc2lkZSwgY3VydmVQb2ludHMsIHN0eWxlKSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN0cm9rZVBhdGhzLCBib3hQYXRocywgc3RhcnRYLCBzdGFydFksIGVuZFgsIGVuZFksIGxlbmd0aCwgZGFzaExlbmd0aCwgc3BhY2VMZW5ndGgsIHVzZUxpbmVEYXNoLCBtdWx0aXBsaWVyLCBudW1iZXJPZkRhc2hlcywgbWluU3BhY2UsIG1heFNwYWNlLCBwYXRoMSwgcGF0aDIsIHBhdGgxLCBwYXRoMjtcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNhdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgc3Ryb2tlUGF0aHMgPSBwYXJzZVBhdGhGb3JCb3JkZXJTdHJva2UoY3VydmVQb2ludHMsIHNpZGUpO1xuICAgICAgICAgICAgICAgICAgICBib3hQYXRocyA9IHBhcnNlUGF0aEZvckJvcmRlcihjdXJ2ZVBvaW50cywgc2lkZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZSA9PT0gMiAvKiBEQVNIRUQgKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGF0aChib3hQYXRocyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5jbGlwKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzQmV6aWVyQ3VydmUoYm94UGF0aHNbMF0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydFggPSBib3hQYXRoc1swXS5zdGFydC54O1xuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRZID0gYm94UGF0aHNbMF0uc3RhcnQueTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0WCA9IGJveFBhdGhzWzBdLng7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydFkgPSBib3hQYXRoc1swXS55O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0JlemllckN1cnZlKGJveFBhdGhzWzFdKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW5kWCA9IGJveFBhdGhzWzFdLmVuZC54O1xuICAgICAgICAgICAgICAgICAgICAgICAgZW5kWSA9IGJveFBhdGhzWzFdLmVuZC55O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW5kWCA9IGJveFBhdGhzWzFdLng7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbmRZID0gYm94UGF0aHNbMV0ueTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoc2lkZSA9PT0gMCB8fCBzaWRlID09PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBNYXRoLmFicyhzdGFydFggLSBlbmRYKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IE1hdGguYWJzKHN0YXJ0WSAtIGVuZFkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmJlZ2luUGF0aCgpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUgPT09IDMgLyogRE9UVEVEICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmZvcm1hdFBhdGgoc3Ryb2tlUGF0aHMpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mb3JtYXRQYXRoKGJveFBhdGhzLnNsaWNlKDAsIDIpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBkYXNoTGVuZ3RoID0gd2lkdGggPCAzID8gd2lkdGggKiAzIDogd2lkdGggKiAyO1xuICAgICAgICAgICAgICAgICAgICBzcGFjZUxlbmd0aCA9IHdpZHRoIDwgMyA/IHdpZHRoICogMiA6IHdpZHRoO1xuICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUgPT09IDMgLyogRE9UVEVEICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXNoTGVuZ3RoID0gd2lkdGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBzcGFjZUxlbmd0aCA9IHdpZHRoO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHVzZUxpbmVEYXNoID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA8PSBkYXNoTGVuZ3RoICogMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdXNlTGluZURhc2ggPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChsZW5ndGggPD0gZGFzaExlbmd0aCAqIDIgKyBzcGFjZUxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbXVsdGlwbGllciA9IGxlbmd0aCAvICgyICogZGFzaExlbmd0aCArIHNwYWNlTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhc2hMZW5ndGggKj0gbXVsdGlwbGllcjtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTGVuZ3RoICo9IG11bHRpcGxpZXI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJPZkRhc2hlcyA9IE1hdGguZmxvb3IoKGxlbmd0aCArIHNwYWNlTGVuZ3RoKSAvIChkYXNoTGVuZ3RoICsgc3BhY2VMZW5ndGgpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1pblNwYWNlID0gKGxlbmd0aCAtIG51bWJlck9mRGFzaGVzICogZGFzaExlbmd0aCkgLyAobnVtYmVyT2ZEYXNoZXMgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1heFNwYWNlID0gKGxlbmd0aCAtIChudW1iZXJPZkRhc2hlcyArIDEpICogZGFzaExlbmd0aCkgLyBudW1iZXJPZkRhc2hlcztcbiAgICAgICAgICAgICAgICAgICAgICAgIHNwYWNlTGVuZ3RoID1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhTcGFjZSA8PSAwIHx8IE1hdGguYWJzKHNwYWNlTGVuZ3RoIC0gbWluU3BhY2UpIDwgTWF0aC5hYnMoc3BhY2VMZW5ndGggLSBtYXhTcGFjZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBtaW5TcGFjZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1heFNwYWNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICh1c2VMaW5lRGFzaCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0eWxlID09PSAzIC8qIERPVFRFRCAqLykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNldExpbmVEYXNoKFswLCBkYXNoTGVuZ3RoICsgc3BhY2VMZW5ndGhdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnNldExpbmVEYXNoKFtkYXNoTGVuZ3RoLCBzcGFjZUxlbmd0aF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChzdHlsZSA9PT0gMyAvKiBET1RURUQgKi8pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmxpbmVDYXAgPSAncm91bmQnO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHgubGluZVdpZHRoID0gd2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5saW5lV2lkdGggPSB3aWR0aCAqIDIgKyAxLjE7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguc3Ryb2tlU3R5bGUgPSBhc1N0cmluZyhjb2xvcik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnN0cm9rZSgpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5zZXRMaW5lRGFzaChbXSk7XG4gICAgICAgICAgICAgICAgICAgIC8vIGRhc2hlZCByb3VuZCBlZGdlIGdhcFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGUgPT09IDIgLyogREFTSEVEICovKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNCZXppZXJDdXJ2ZShib3hQYXRoc1swXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoMSA9IGJveFBhdGhzWzNdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGgyID0gYm94UGF0aHNbMF07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguYmVnaW5QYXRoKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mb3JtYXRQYXRoKFtuZXcgVmVjdG9yKHBhdGgxLmVuZC54LCBwYXRoMS5lbmQueSksIG5ldyBWZWN0b3IocGF0aDIuc3RhcnQueCwgcGF0aDIuc3RhcnQueSldKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5zdHJva2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0JlemllckN1cnZlKGJveFBhdGhzWzFdKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGgxID0gYm94UGF0aHNbMV07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDIgPSBib3hQYXRoc1syXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5iZWdpblBhdGgoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmZvcm1hdFBhdGgoW25ldyBWZWN0b3IocGF0aDEuZW5kLngsIHBhdGgxLmVuZC55KSwgbmV3IFZlY3RvcihwYXRoMi5zdGFydC54LCBwYXRoMi5zdGFydC55KV0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnN0cm9rZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LnJlc3RvcmUoKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi9dO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgICAgIENhbnZhc1JlbmRlcmVyLnByb3RvdHlwZS5yZW5kZXIgPSBmdW5jdGlvbiAoZWxlbWVudCkge1xuICAgICAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHZhciBzdGFjaztcbiAgICAgICAgICAgICAgICByZXR1cm4gX19nZW5lcmF0b3IodGhpcywgZnVuY3Rpb24gKF9hKSB7XG4gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoX2EubGFiZWwpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmJhY2tncm91bmRDb2xvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsU3R5bGUgPSBhc1N0cmluZyh0aGlzLm9wdGlvbnMuYmFja2dyb3VuZENvbG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdHguZmlsbFJlY3QodGhpcy5vcHRpb25zLngsIHRoaXMub3B0aW9ucy55LCB0aGlzLm9wdGlvbnMud2lkdGgsIHRoaXMub3B0aW9ucy5oZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFjayA9IHBhcnNlU3RhY2tpbmdDb250ZXh0cyhlbGVtZW50KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCB0aGlzLnJlbmRlclN0YWNrKHN0YWNrKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuYXBwbHlFZmZlY3RzKFtdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgdGhpcy5jYW52YXNdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIENhbnZhc1JlbmRlcmVyO1xuICAgIH0oUmVuZGVyZXIpKTtcbiAgICB2YXIgaXNUZXh0SW5wdXRFbGVtZW50ID0gZnVuY3Rpb24gKGNvbnRhaW5lcikge1xuICAgICAgICBpZiAoY29udGFpbmVyIGluc3RhbmNlb2YgVGV4dGFyZWFFbGVtZW50Q29udGFpbmVyKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjb250YWluZXIgaW5zdGFuY2VvZiBTZWxlY3RFbGVtZW50Q29udGFpbmVyKSB7XG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuICAgICAgICBlbHNlIGlmIChjb250YWluZXIgaW5zdGFuY2VvZiBJbnB1dEVsZW1lbnRDb250YWluZXIgJiYgY29udGFpbmVyLnR5cGUgIT09IFJBRElPICYmIGNvbnRhaW5lci50eXBlICE9PSBDSEVDS0JPWCkge1xuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH07XG4gICAgdmFyIGNhbGN1bGF0ZUJhY2tncm91bmRDdXJ2ZWRQYWludGluZ0FyZWEgPSBmdW5jdGlvbiAoY2xpcCwgY3VydmVzKSB7XG4gICAgICAgIHN3aXRjaCAoY2xpcCkge1xuICAgICAgICAgICAgY2FzZSAwIC8qIEJPUkRFUl9CT1ggKi86XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGN1bGF0ZUJvcmRlckJveFBhdGgoY3VydmVzKTtcbiAgICAgICAgICAgIGNhc2UgMiAvKiBDT05URU5UX0JPWCAqLzpcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsY3VsYXRlQ29udGVudEJveFBhdGgoY3VydmVzKTtcbiAgICAgICAgICAgIGNhc2UgMSAvKiBQQURESU5HX0JPWCAqLzpcbiAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGN1bGF0ZVBhZGRpbmdCb3hQYXRoKGN1cnZlcyk7XG4gICAgICAgIH1cbiAgICB9O1xuICAgIHZhciBjYW52YXNUZXh0QWxpZ24gPSBmdW5jdGlvbiAodGV4dEFsaWduKSB7XG4gICAgICAgIHN3aXRjaCAodGV4dEFsaWduKSB7XG4gICAgICAgICAgICBjYXNlIDEgLyogQ0VOVEVSICovOlxuICAgICAgICAgICAgICAgIHJldHVybiAnY2VudGVyJztcbiAgICAgICAgICAgIGNhc2UgMiAvKiBSSUdIVCAqLzpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3JpZ2h0JztcbiAgICAgICAgICAgIGNhc2UgMCAvKiBMRUZUICovOlxuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2xlZnQnO1xuICAgICAgICB9XG4gICAgfTtcbiAgICAvLyBzZWUgaHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2h0bWwyY2FudmFzL3B1bGwvMjY0NVxuICAgIHZhciBpT1NCcm9rZW5Gb250cyA9IFsnLWFwcGxlLXN5c3RlbScsICdzeXN0ZW0tdWknXTtcbiAgICB2YXIgZml4SU9TU3lzdGVtRm9udHMgPSBmdW5jdGlvbiAoZm9udEZhbWlsaWVzKSB7XG4gICAgICAgIHJldHVybiAvaVBob25lIE9TIDE1XygwfDEpLy50ZXN0KHdpbmRvdy5uYXZpZ2F0b3IudXNlckFnZW50KVxuICAgICAgICAgICAgPyBmb250RmFtaWxpZXMuZmlsdGVyKGZ1bmN0aW9uIChmb250RmFtaWx5KSB7IHJldHVybiBpT1NCcm9rZW5Gb250cy5pbmRleE9mKGZvbnRGYW1pbHkpID09PSAtMTsgfSlcbiAgICAgICAgICAgIDogZm9udEZhbWlsaWVzO1xuICAgIH07XG5cbiAgICB2YXIgRm9yZWlnbk9iamVjdFJlbmRlcmVyID0gLyoqIEBjbGFzcyAqLyAoZnVuY3Rpb24gKF9zdXBlcikge1xuICAgICAgICBfX2V4dGVuZHMoRm9yZWlnbk9iamVjdFJlbmRlcmVyLCBfc3VwZXIpO1xuICAgICAgICBmdW5jdGlvbiBGb3JlaWduT2JqZWN0UmVuZGVyZXIoY29udGV4dCwgb3B0aW9ucykge1xuICAgICAgICA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gb3B0aW9ucy55ICsgXCIpIHdpdGggc2NhbGUgXCIgKyBvcHRpb25zLnNjYWxlKTtcbiAgICAgICAgICAgIHJldHVybiBfdGhpcztcbiAgICAgICAgfVxuICAgICAgICBGb3JlaWduT2JqZWN0UmVuZGVyZXIucHJvdG90eXBlLnJlbmRlciA9IGZ1bmN0aW9uIChlbGVtZW50KSB7XG4gICAgICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdmFyIHN2ZywgaW1nO1xuICAgICAgICAgICAgICAgIHJldHVybiBfX2dlbmVyYXRvcih0aGlzLCBmdW5jdGlvbiAoX2EpIHtcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChfYS5sYWJlbCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2ZyA9IGNyZWF0ZUZvcmVpZ25PYmplY3RTVkcodGhpcy5vcHRpb25zLndpZHRoICogdGhpcy5vcHRpb25zLnNjYWxlLCB0aGlzLm9wdGlvbnMuaGVpZ2h0ICogdGhpcy5vcHRpb25zLnNjYWxlLCB0aGlzLm9wdGlvbnMuc2NhbGUsIHRoaXMub3B0aW9ucy5zY2FsZSwgZWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFs0IC8qeWllbGQqLywgbG9hZFNlcmlhbGl6ZWRTVkcoc3ZnKV07XG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gX2Euc2VudCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMuYmFja2dyb3VuZENvbG9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3R4LmZpbGxTdHlsZSA9IGFzU3RyaW5nKHRoaXMub3B0aW9ucy5iYWNrZ3JvdW5kQ29sb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5maWxsUmVjdCgwLCAwLCB0aGlzLm9wdGlvbnMud2lkdGggKiB0aGlzLm9wdGlvbnMuc2NhbGUsIHRoaXMub3B0aW9ucy5oZWlnaHQgKiB0aGlzLm9wdGlvbnMuc2NhbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmN0eC5kcmF3SW1hZ2UoaW1nLCAtdGhpcy5vcHRpb25zLnggKiB0aGlzLm9wdGlvbnMuc2NhbGUsIC10aGlzLm9wdGlvbnMueSAqIHRoaXMub3B0aW9ucy5zY2FsZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIHRoaXMuY2FudmFzXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiBGb3JlaWduT2JqZWN0UmVuZGVyZXI7XG4gICAgfShSZW5kZXJlcikpO1xuICAgIHZhciBsb2FkU2VyaWFsaXplZFNWRyA9IGZ1bmN0aW9uIChzdmcpIHtcbiAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uIChyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgIHZhciBpbWcgPSBuZXcgSW1hZ2UoKTtcbiAgICAgICAgICAgIGltZy5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZShpbWcpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGltZy5vbmVycm9yID0gcmVqZWN0O1xuICAgICAgICAgICAgaW1nLnNyYyA9IFwiZGF0YTppbWFnZS9zdmcreG1sO2NoYXJzZXQ9dXRmLTgsXCIgKyBlbmNvZGVVUklDb21wb25lbnQobmV3IFhNTFNlcmlhbGl6ZXIoKS5zZXJpYWxpemVUb1N0cmluZyhzdmcpKTtcbiAgICAgICAgfSk7XG4gICAgfTtcblxuICAgIHZhciBMb2dnZXIgPSAvKiogQGNsYXNzICovIChmdW5jdGlvbiAoKSB7XG4gICAgICAgIGZ1bmN0aW9uIExvZ2dlcihfYSkge1xuICAgICAgICAgICAgdmFyIGlkID0gX2EuaWQsIGVuYWJsZWQgPSBfYS5lbmFibGVkO1xuICAgICAgICAgICAgdGhpcy5pZCA9IGlkO1xuICAgICAgICAgICAgdGhpcy5lbmFibGVkID0gZW5hYmxlZDtcbiAgICAgICAgICAgIHRoaXMuc3RhcnQgPSBEYXRlLm5vdygpO1xuICAgICAgICB9XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tZXhwbGljaXQtYW55XG4gICAgICAgIExvZ2dlci5wcm90b3R5cGUuZGVidWcgPSBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICB2YXIgYXJncyA9IFtdO1xuICAgICAgICAgICAgZm9yICh2YXIgX2kgPSAwOyBfaSA8IGFyZ3VtZW50cy5sZW5ndGg7IF9pKyspIHtcbiAgICAgICAgICAgICAgICBhcmdzW19pXSA9IGFyZ3VtZW50c1tfaV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodGhpcy5lbmFibGVkKSB7XG4gICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGVcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93LmNvbnNvbGUgJiYgdHlwZW9mIGNvbnNvbGUuZGVidWcgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGVcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5kZWJ1Zy5hcHBseShjb25zb2xlLCBfX3NwcmVhZEFycmF5KFt0aGlzLmlkLCB0aGlzLmdldFRpbWUoKSArIFwibXNcIl0sIGFyZ3MpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5mby5hcHBseSh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG4gICAgICAgIExvZ2dlci5wcm90b3R5cGUuZ2V0VGltZSA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHJldHVybiBEYXRlLm5vdygpIC0gdGhpcy5zdGFydDtcbiAgICAgICAgfTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgTG9nZ2VyLnByb3RvdHlwZS5pbmZvID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGFyZ3MgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCBhcmd1bWVudHMubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJnc1tfaV0gPSBhcmd1bWVudHNbX2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmIHdpbmRvdy5jb25zb2xlICYmIHR5cGVvZiBjb25zb2xlLmluZm8gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGVcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS5pbmZvLmFwcGx5KGNvbnNvbGUsIF9fc3ByZWFkQXJyYXkoW3RoaXMuaWQsIHRoaXMuZ2V0VGltZSgpICsgXCJtc1wiXSwgYXJncykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgTG9nZ2VyLnByb3RvdHlwZS53YXJuID0gZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgdmFyIGFyZ3MgPSBbXTtcbiAgICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCBhcmd1bWVudHMubGVuZ3RoOyBfaSsrKSB7XG4gICAgICAgICAgICAgICAgYXJnc1tfaV0gPSBhcmd1bWVudHNbX2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHRoaXMuZW5hYmxlZCkge1xuICAgICAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25zb2xlXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cgIT09ICd1bmRlZmluZWQnICYmIHdpbmRvdy5jb25zb2xlICYmIHR5cGVvZiBjb25zb2xlLndhcm4gPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLWNvbnNvbGVcbiAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuLmFwcGx5KGNvbnNvbGUsIF9fc3ByZWFkQXJyYXkoW3RoaXMuaWQsIHRoaXMuZ2V0VGltZSgpICsgXCJtc1wiXSwgYXJncykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbmZvLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgTG9nZ2VyLnByb3RvdHlwZS5lcnJvciA9IGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIHZhciBhcmdzID0gW107XG4gICAgICAgICAgICBmb3IgKHZhciBfaSA9IDA7IF9pIDwgYXJndW1lbnRzLmxlbmd0aDsgX2krKykge1xuICAgICAgICAgICAgICAgIGFyZ3NbX2ldID0gYXJndW1lbnRzW19pXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0aGlzLmVuYWJsZWQpIHtcbiAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tY29uc29sZVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJyAmJiB3aW5kb3cuY29uc29sZSAmJiB0eXBlb2YgY29uc29sZS5lcnJvciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tY29uc29sZVxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yLmFwcGx5KGNvbnNvbGUsIF9fc3ByZWFkQXJyYXkoW3RoaXMuaWQsIHRoaXMuZ2V0VGltZSgpICsgXCJtc1wiXSwgYXJncykpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbmZvLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbi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d25lckRvY3VtZW50O1xuICAgICAgICAgICAgICAgICAgICBpZiAoIW93bmVyRG9jdW1lbnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkVsZW1lbnQgaXMgbm90IGF0dGFjaGVkIHRvIGEgRG9jdW1lbnRcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZpZXcgPSBvd25lckRvY3VtZW50LmRlZmF1bHRWaWV3O1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWRlZmF1bHRWaWV3KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJEb2N1bWVudCBpcyBub3QgYXR0YWNoZWQgdG8gYSBXaW5kb3dcIik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVzb3VyY2VPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgYWxsb3dUYWludDogKF9iID0gb3B0cy5hbGxvd1RhaW50KSAhPT0gbnVsbCAmJiBfYiAhPT0gdm9pZCAwID8gX2IgOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlVGltZW91dDogKF9jID0gb3B0cy5pbWFnZVRpbWVvdXQpICE9PSBudWxsICYmIF9jICE9PSB2b2lkIDAgPyBfYyA6IDE1MDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJveHk6IG9wdHMucHJveHksXG4gICAgICAgICAgICAgICAgICAgICAgICB1c2VDT1JTOiAoX2QgPSBvcHRzLnVzZUNPUlMpICE9PSBudWxsICYmIF9kICE9PSB2b2lkIDAgPyBfZCA6IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHRPcHRpb25zID0gX19hc3NpZ24oeyBsb2dnaW5nOiAoX2UgPSBvcHRzLmxvZ2dpbmcpICE9PSBudWxsICYmIF9lICE9PSB2b2lkIDAgPyBfZSA6IHRydWUsIGNhY2hlOiBvcHRzLmNhY2hlIH0sIHJlc291cmNlT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIHdpbmRvd09wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dXaWR0aDogKF9mID0gb3B0cy53aW5kb3dXaWR0aCkgIT09IG51bGwgJiYgX2YgIT09IHZvaWQgMCA/IF9mIDogZGVmYXVsdFZpZXcuaW5uZXJXaWR0aCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvd0hlaWdodDogKF9nID0gb3B0cy53aW5kb3dIZWlnaHQpICE9PSBudWxsICYmIF9nICE9PSB2b2lkIDAgPyBfZyA6IGRlZmF1bHRWaWV3LmlubmVySGVpZ2h0LFxuICAgICAgICAgICAgICAgICAgICAgICAgc2Nyb2xsWDogKF9oID0gb3B0cy5zY3JvbGxYKSAhPT0gbnVsbCAmJiBfaCAhPT0gdm9pZCAwID8gX2ggOiBkZWZhdWx0Vmlldy5wYWdlWE9mZnNldCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbFk6IChfaiA9IG9wdHMuc2Nyb2xsWSkgIT09IG51bGwgJiYgX2ogIT09IHZvaWQgMCA/IF9qIDogZGVmYXVsdFZpZXcucGFnZVlPZmZzZXRcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgd2luZG93Qm91bmRzID0gbmV3IEJvdW5kcyh3aW5kb3dPcHRpb25zLnNjcm9sbFgsIHdpbmRvd09wdGlvbnMuc2Nyb2xsWSwgd2luZG93T3B0aW9ucy53aW5kb3dXaWR0aCwgd2luZG93T3B0aW9ucy53aW5kb3dIZWlnaHQpO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0ID0gbmV3IENvbnRleHQoY29udGV4dE9wdGlvbnMsIHdpbmRvd0JvdW5kcyk7XG4gICAgICAgICAgICAgICAgICAgIGZvcmVpZ25PYmplY3RSZW5kZXJpbmcgPSAoX2sgPSBvcHRzLmZvcmVpZ25PYmplY3RSZW5kZXJpbmcpICE9PSBudWxsICYmIF9rICE9PSB2b2lkIDAgPyBfayA6IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBjbG9uZU9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhbGxvd1RhaW50OiAoX2wgPSBvcHRzLmFsbG93VGFpbnQpICE9PSBudWxsICYmIF9sICE9PSB2b2lkIDAgPyBfbCA6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgb25jbG9uZTogb3B0cy5vbmNsb25lLFxuICAgICAgICAgICAgICAgICAgICAgICAgaWdub3JlRWxlbWVudHM6IG9wdHMuaWdub3JlRWxlbWVudHMsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmxpbmVJbWFnZXM6IGZvcmVpZ25PYmplY3RSZW5kZXJpbmcsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb3B5U3R5bGVzOiBmb3JlaWduT2JqZWN0UmVuZGVyaW5nXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQubG9nZ2VyLmRlYnVnKFwiU3RhcnRpbmcgZG9jdW1lbnQgY2xvbmUgd2l0aCBzaXplIFwiICsgd2luZG93Qm91bmRzLndpZHRoICsgXCJ4XCIgKyB3aW5kb3dCb3VuZHMuaGVpZ2h0ICsgXCIgc2Nyb2xsZWQgdG8gXCIgKyAtd2luZG93Qm91bmRzLmxlZnQgKyBcIixcIiArIC13aW5kb3dCb3VuZHMudG9wKTtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnRDbG9uZXIgPSBuZXcgRG9jdW1lbnRDbG9uZXIoY29udGV4dCwgZWxlbWVudCwgY2xvbmVPcHRpb25zKTtcbiAgICAgICAgICAgICAgICAgICAgY2xvbmVkRWxlbWVudCA9IGRvY3VtZW50Q2xvbmVyLmNsb25lZFJlZmVyZW5jZUVsZW1lbnQ7XG4gICAgICAgICAgICAgICAgICAgIGlmICghY2xvbmVkRWxlbWVudCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFsyIC8qcmV0dXJuKi8sIFByb21pc2UucmVqZWN0KFwiVW5hYmxlIHRvIGZpbmQgZWxlbWVudCBpbiBjbG9uZWQgaWZyYW1lXCIpXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzQgLyp5aWVsZCovLCBkb2N1bWVudENsb25lci50b0lGcmFtZShvd25lckRvY3VtZW50LCB3aW5kb3dCb3VuZHMpXTtcbiAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgIGNvbnRhaW5lciA9IF91LnNlbnQoKTtcbiAgICAgICAgICAgICAgICAgICAgX2EgPSBpc0JvZHlFbGVtZW50KGNsb25lZEVsZW1lbnQpIHx8IGlzSFRNTEVsZW1lbnQoY2xvbmVkRWxlbWVudClcbiAgICAgICAgICAgICAgICAgICAgICAgID8gcGFyc2VEb2N1bWVudFNpemUoY2xvbmVkRWxlbWVudC5vd25lckRvY3VtZW50KVxuICAgICAgICAgICAgICAgICAgICAgICAgOiBwYXJzZUJvdW5kcyhjb250ZXh0LCBjbG9uZWRFbGVtZW50KSwgd2lkdGggPSBfYS53aWR0aCwgaGVpZ2h0ID0gX2EuaGVpZ2h0LCBsZWZ0ID0gX2EubGVmdCwgdG9wID0gX2EudG9wO1xuICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kQ29sb3IgPSBwYXJzZUJhY2tncm91bmRDb2xvcihjb250ZXh0LCBjbG9uZWRFbGVtZW50LCBvcHRzLmJhY2tncm91bmRDb2xvcik7XG4gICAgICAgICAgICAgICAgICAgIHJlbmRlck9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXM6IG9wdHMuY2FudmFzLFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFja2dyb3VuZENvbG9yOiBiYWNrZ3JvdW5kQ29sb3IsXG4gICAgICAgICAgICAgICAgICAgICAgICBzY2FsZTogKF9vID0gKF9tID0gb3B0cy5zY2FsZSkgIT09IG51bGwgJiYgX20gIT09IHZvaWQgMCA/IF9tIDogZGVmYXVsdFZpZXcuZGV2aWNlUGl4ZWxSYXRpbykgIT09IG51bGwgJiYgX28gIT09IHZvaWQgMCA/IF9vIDogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHg6ICgoX3AgPSBvcHRzLngpICE9PSBudWxsICYmIF9wICE9PSB2b2lkIDAgPyBfcCA6IDApICsgbGVmdCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHk6ICgoX3EgPSBvcHRzLnkpICE9PSBudWxsICYmIF9xICE9PSB2b2lkIDAgPyBfcSA6IDApICsgdG9wLFxuICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IChfciA9IG9wdHMud2lkdGgpICE9PSBudWxsICYmIF9yICE9PSB2b2lkIDAgPyBfciA6IE1hdGguY2VpbCh3aWR0aCksXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IChfcyA9IG9wdHMuaGVpZ2h0KSAhPT0gbnVsbCAmJiBfcyAhPT0gdm9pZCAwID8gX3MgOiBNYXRoLmNlaWwoaGVpZ2h0KVxuICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICBpZiAoIWZvcmVpZ25PYmplY3RSZW5kZXJpbmcpIHJldHVybiBbMyAvKmJyZWFrKi8sIDNdO1xuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmxvZ2dlci5kZWJ1ZyhcIkRvY3VtZW50IGNsb25lZCwgdXNpbmcgZm9yZWlnbiBvYmplY3QgcmVuZGVyaW5nXCIpO1xuICAgICAgICAgICAgICAgICAgICByZW5kZXJlciA9IG5ldyBGb3JlaWduT2JqZWN0UmVuZGVyZXIoY29udGV4dCwgcmVuZGVyT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHJlbmRlcmVyLnJlbmRlcihjbG9uZWRFbGVtZW50KV07XG4gICAgICAgICAgICAgICAgY2FzZSAyOlxuICAgICAgICAgICAgICAgICAgICBjYW52YXMgPSBfdS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbMyAvKmJyZWFrKi8sIDVdO1xuICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5sb2dnZXIuZGVidWcoXCJEb2N1bWVudCBjbG9uZWQsIGVsZW1lbnQgbG9jYXRlZCBhdCBcIiArIGxlZnQgKyBcIixcIiArIHRvcCArIFwiIHdpdGggc2l6ZSBcIiArIHdpZHRoICsgXCJ4XCIgKyBoZWlnaHQgKyBcIiB1c2luZyBjb21wdXRlZCByZW5kZXJpbmdcIik7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQubG9nZ2VyLmRlYnVnKFwiU3RhcnRpbmcgRE9NIHBhcnNpbmdcIik7XG4gICAgICAgICAgICAgICAgICAgIHJvb3QgPSBwYXJzZVRyZWUoY29udGV4dCwgY2xvbmVkRWxlbWVudCk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChiYWNrZ3JvdW5kQ29sb3IgPT09IHJvb3Quc3R5bGVzLmJhY2tncm91bmRDb2xvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcm9vdC5zdHlsZXMuYmFja2dyb3VuZENvbG9yID0gQ09MT1JTLlRSQU5TUEFSRU5UO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQubG9nZ2VyLmRlYnVnKFwiU3RhcnRpbmcgcmVuZGVyZXIgZm9yIGVsZW1lbnQgYXQgXCIgKyByZW5kZXJPcHRpb25zLnggKyBcIixcIiArIHJlbmRlck9wdGlvbnMueSArIFwiIHdpdGggc2l6ZSBcIiArIHJlbmRlck9wdGlvbnMud2lkdGggKyBcInhcIiArIHJlbmRlck9wdGlvbnMuaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgcmVuZGVyZXIgPSBuZXcgQ2FudmFzUmVuZGVyZXIoY29udGV4dCwgcmVuZGVyT3B0aW9ucyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbNCAvKnlpZWxkKi8sIHJlbmRlcmVyLnJlbmRlcihyb290KV07XG4gICAgICAgICAgICAgICAgY2FzZSA0OlxuICAgICAgICAgICAgICAgICAgICBjYW52YXMgPSBfdS5zZW50KCk7XG4gICAgICAgICAgICAgICAgICAgIF91LmxhYmVsID0gNTtcbiAgICAgICAgICAgICAgICBjYXNlIDU6XG4gICAgICAgICAgICAgICAgICAgIGlmICgoX3QgPSBvcHRzLnJlbW92ZUNvbnRhaW5lcikgIT09IG51bGwgJiYgX3QgIT09IHZvaWQgMCA/IF90IDogdHJ1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFEb2N1bWVudENsb25lci5kZXN0cm95KGNvbnRhaW5lcikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmxvZ2dlci5lcnJvcihcIkNhbm5vdCBkZXRhY2ggY2xvbmVkIGlmcmFtZSBhcyBpdCBpcyBub3QgaW4gdGhlIERPTSBhbnltb3JlXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQubG9nZ2VyLmRlYnVnKFwiRmluaXNoZWQgcmVuZGVyaW5nXCIpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gWzIgLypyZXR1cm4qLywgY2FudmFzXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfSk7IH07XG4gICAgdmFyIHBhcnNlQmFja2dyb3VuZENvbG9yID0gZnVuY3Rpb24gKGNvbnRleHQsIGVsZW1lbnQsIGJhY2tncm91bmRDb2xvck92ZXJyaWRlKSB7XG4gICAgICAgIHZhciBvd25lckRvY3VtZW50ID0gZWxlbWVudC5vd25lckRvY3VtZW50O1xuICAgICAgICAvLyBodHRwOi8vd3d3LnczLm9yZy9UUi9jc3MzLWJhY2tncm91bmQvI3NwZWNpYWwtYmFja2dyb3VuZHNcbiAgICAgICAgdmFyIGRvY3VtZW50QmFja2dyb3VuZENvbG9yID0gb3duZXJEb2N1bWVudC5kb2N1bWVudEVsZW1lbnRcbiAgICAgICAgICAgID8gcGFyc2VDb2xvcihjb250ZXh0LCBnZXRDb21wdXRlZFN0eWxlKG93bmVyRG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50KS5iYWNrZ3JvdW5kQ29sb3IpXG4gICAgICAgICAgICA6IENPTE9SUy5UUkFOU1BBUkVOVDtcbiAgICAgICAgdmFyIGJvZHlCYWNrZ3JvdW5kQ29sb3IgPSBvd25lckRvY3VtZW50LmJvZHlcbiAgICAgICAgICAgID8gcGFyc2VDb2xvcihjb250ZXh0LCBnZXRDb21wdXRlZFN0eWxlKG93bmVyRG9jdW1lbnQuYm9keSkuYmFja2dyb3VuZENvbG9yKVxuICAgICAgICAgICAgOiBDT0xPUlMuVFJBTlNQQVJFTlQ7XG4gICAgICAgIHZhciBkZWZhdWx0QmFja2dyb3VuZENvbG9yID0gdHlwZW9mIGJhY2tncm91bmRDb2xvck92ZXJyaWRlID09PSAnc3RyaW5nJ1xuICAgICAgICAgICAgPyBwYXJzZUNvbG9yKGNvbnRleHQsIGJhY2tncm91bmRDb2xvck92ZXJyaWRlKVxuICAgICAgICAgICAgOiBiYWNrZ3JvdW5kQ29sb3JPdmVycmlkZSA9PT0gbnVsbFxuICAgICAgICAgICAgICAgID8gQ09MT1JTLlRSQU5TUEFSRU5UXG4gICAgICAgICAgICAgICAgOiAweGZmZmZmZmZmO1xuICAgICAgICByZXR1cm4gZWxlbWVudCA9PT0gb3duZXJEb2N1bWVudC5kb2N1bWVudEVsZW1lbnRcbiAgICAgICAgICAgID8gaXNUcmFuc3BhcmVudChkb2N1bWVudEJhY2tncm91bmRDb2xvcilcbiAgICAgICAgICAgICAgICA/IGlzVHJhbnNwYXJlbnQoYm9keUJhY2tncm91bmRDb2xvcilcbiAgICAgICAgICAgICAgICAgICAgPyBkZWZhdWx0QmFja2dyb3VuZENvbG9yXG4gICAgICAgICAgICAgICAgICAgIDogYm9keUJhY2tncm91bmRDb2xvclxuICAgICAgICAgICAgICAgIDogZG9jdW1lbnRCYWNrZ3JvdW5kQ29sb3JcbiAgICAgICAgICAgIDogZGVmYXVsdEJhY2tncm91bmRDb2xvcjtcbiAgICB9O1xuXG4gICAgcmV0dXJuIGh0bWwyY2FudmFzO1xuXG59KSkpO1xuLy8jIHNvdXJjZU1hcHBpbmdVUkw9aHRtbDJjYW52YXMuanMubWFwXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///1120\n")},5592:(module,exports,__webpack_require__)=>{eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {\n\t"use strict";\n\n\tif ( true ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(9755) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n} )( function( $ ) {\n"use strict";\n\n$.ui = $.ui || {};\n\nreturn $.ui.version = "1.13.2";\n\n} );\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU5Mi5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBLE1BQU0sSUFBMEM7O0FBRWhEO0FBQ0EsRUFBRSxpQ0FBUSxFQUFFLHlCQUFRLEVBQUUsb0NBQUUsT0FBTztBQUFBO0FBQUE7QUFBQSxrR0FBRTtBQUNqQyxHQUFHLEtBQUssRUFJTjtBQUNGLEVBQUU7QUFDRjs7QUFFQTs7QUFFQTs7QUFFQSxFQUFFIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2pxdWVyeS11aS91aS92ZXJzaW9uLmpzPzQzMDkiXSwic291cmNlc0NvbnRlbnQiOlsiKCBmdW5jdGlvbiggZmFjdG9yeSApIHtcblx0XCJ1c2Ugc3RyaWN0XCI7XG5cblx0aWYgKCB0eXBlb2YgZGVmaW5lID09PSBcImZ1bmN0aW9uXCIgJiYgZGVmaW5lLmFtZCApIHtcblxuXHRcdC8vIEFNRC4gUmVnaXN0ZXIgYXMgYW4gYW5vbnltb3VzIG1vZHVsZS5cblx0XHRkZWZpbmUoIFsgXCJqcXVlcnlcIiBdLCBmYWN0b3J5ICk7XG5cdH0gZWxzZSB7XG5cblx0XHQvLyBCcm93c2VyIGdsb2JhbHNcblx0XHRmYWN0b3J5KCBqUXVlcnkgKTtcblx0fVxufSApKCBmdW5jdGlvbiggJCApIHtcblwidXNlIHN0cmljdFwiO1xuXG4kLnVpID0gJC51aSB8fCB7fTtcblxucmV0dXJuICQudWkudmVyc2lvbiA9IFwiMS4xMy4yXCI7XG5cbn0gKTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///5592\n')},6891:(module,exports,__webpack_require__)=>{eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * jQuery UI Widget 1.13.2\n * http://jqueryui.com\n *\n * Copyright jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n */\n\n//>>label: Widget\n//>>group: Core\n//>>description: Provides a factory for creating stateful widgets with a common API.\n//>>docs: http://api.jqueryui.com/jQuery.widget/\n//>>demos: http://jqueryui.com/widget/\n\n( function( factory ) {\n\t"use strict";\n\n\tif ( true ) {\n\n\t\t// AMD. Register as an anonymous module.\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(9755), __webpack_require__(5592) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else {}\n} )( function( $ ) {\n"use strict";\n\nvar widgetUuid = 0;\nvar widgetHasOwnProperty = Array.prototype.hasOwnProperty;\nvar widgetSlice = Array.prototype.slice;\n\n$.cleanData = ( function( orig ) {\n\treturn function( elems ) {\n\t\tvar events, elem, i;\n\t\tfor ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {\n\n\t\t\t// Only trigger remove when necessary to save time\n\t\t\tevents = $._data( elem, "events" );\n\t\t\tif ( events && events.remove ) {\n\t\t\t\t$( elem ).triggerHandler( "remove" );\n\t\t\t}\n\t\t}\n\t\torig( elems );\n\t};\n} )( $.cleanData );\n\n$.widget = function( name, base, prototype ) {\n\tvar existingConstructor, constructor, basePrototype;\n\n\t// ProxiedPrototype allows the provided prototype to remain unmodified\n\t// so that it can be used as a mixin for multiple widgets (#8876)\n\tvar proxiedPrototype = {};\n\n\tvar namespace = name.split( "." )[ 0 ];\n\tname = name.split( "." )[ 1 ];\n\tvar fullName = namespace + "-" + name;\n\n\tif ( !prototype ) {\n\t\tprototype = base;\n\t\tbase = $.Widget;\n\t}\n\n\tif ( Array.isArray( prototype ) ) {\n\t\tprototype = $.extend.apply( null, [ {} ].concat( prototype ) );\n\t}\n\n\t// Create selector for plugin\n\t$.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) {\n\t\treturn !!$.data( elem, fullName );\n\t};\n\n\t$[ namespace ] = $[ namespace ] || {};\n\texistingConstructor = $[ namespace ][ name ];\n\tconstructor = $[ namespace ][ name ] = function( options, element ) {\n\n\t\t// Allow instantiation without "new" keyword\n\t\tif ( !this || !this._createWidget ) {\n\t\t\treturn new constructor( options, element );\n\t\t}\n\n\t\t// Allow instantiation without initializing for simple inheritance\n\t\t// must use "new" keyword (the code above always passes args)\n\t\tif ( arguments.length ) {\n\t\t\tthis._createWidget( options, element );\n\t\t}\n\t};\n\n\t// Extend with the existing constructor to carry over any static properties\n\t$.extend( constructor, existingConstructor, {\n\t\tversion: prototype.version,\n\n\t\t// Copy the object used to create the prototype in case we need to\n\t\t// redefine the widget later\n\t\t_proto: $.extend( {}, prototype ),\n\n\t\t// Track widgets that inherit from this widget in case this widget is\n\t\t// redefined after a widget inherits from it\n\t\t_childConstructors: []\n\t} );\n\n\tbasePrototype = new base();\n\n\t// We need to make the options hash a property directly on the new instance\n\t// otherwise we\'ll modify the options hash on the prototype that we\'re\n\t// inheriting from\n\tbasePrototype.options = $.widget.extend( {}, basePrototype.options );\n\t$.each( prototype, function( prop, value ) {\n\t\tif ( typeof value !== "function" ) {\n\t\t\tproxiedPrototype[ prop ] = value;\n\t\t\treturn;\n\t\t}\n\t\tproxiedPrototype[ prop ] = ( function() {\n\t\t\tfunction _super() {\n\t\t\t\treturn base.prototype[ prop ].apply( this, arguments );\n\t\t\t}\n\n\t\t\tfunction _superApply( args ) {\n\t\t\t\treturn base.prototype[ prop ].apply( this, args );\n\t\t\t}\n\n\t\t\treturn function() {\n\t\t\t\tvar __super = this._super;\n\t\t\t\tvar __superApply = this._superApply;\n\t\t\t\tvar returnValue;\n\n\t\t\t\tthis._super = _super;\n\t\t\t\tthis._superApply = _superApply;\n\n\t\t\t\treturnValue = value.apply( this, arguments );\n\n\t\t\t\tthis._super = __super;\n\t\t\t\tthis._superApply = __superApply;\n\n\t\t\t\treturn returnValue;\n\t\t\t};\n\t\t} )();\n\t} );\n\tconstructor.prototype = $.widget.extend( basePrototype, {\n\n\t\t// TODO: remove support for widgetEventPrefix\n\t\t// always use the name + a colon as the prefix, e.g., draggable:start\n\t\t// don\'t prefix for widgets that aren\'t DOM-based\n\t\twidgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name\n\t}, proxiedPrototype, {\n\t\tconstructor: constructor,\n\t\tnamespace: namespace,\n\t\twidgetName: name,\n\t\twidgetFullName: fullName\n\t} );\n\n\t// If this widget is being redefined then we need to find all widgets that\n\t// are inheriting from it and redefine all of them so that they inherit from\n\t// the new version of this widget. We\'re essentially trying to replace one\n\t// level in the prototype chain.\n\tif ( existingConstructor ) {\n\t\t$.each( existingConstructor._childConstructors, function( i, child ) {\n\t\t\tvar childPrototype = child.prototype;\n\n\t\t\t// Redefine the child widget using the same prototype that was\n\t\t\t// originally used, but inherit from the new version of the base\n\t\t\t$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor,\n\t\t\t\tchild._proto );\n\t\t} );\n\n\t\t// Remove the list of existing child constructors from the old constructor\n\t\t// so the old child constructors can be garbage collected\n\t\tdelete existingConstructor._childConstructors;\n\t} else {\n\t\tbase._childConstructors.push( constructor );\n\t}\n\n\t$.widget.bridge( name, constructor );\n\n\treturn constructor;\n};\n\n$.widget.extend = function( target ) {\n\tvar input = widgetSlice.call( arguments, 1 );\n\tvar inputIndex = 0;\n\tvar inputLength = input.length;\n\tvar key;\n\tvar value;\n\n\tfor ( ; inputIndex < inputLength; inputIndex++ ) {\n\t\tfor ( key in input[ inputIndex ] ) {\n\t\t\tvalue = input[ inputIndex ][ key ];\n\t\t\tif ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) {\n\n\t\t\t\t// Clone objects\n\t\t\t\tif ( $.isPlainObject( value ) ) {\n\t\t\t\t\ttarget[ key ] = $.isPlainObject( target[ key ] ) ?\n\t\t\t\t\t\t$.widget.extend( {}, target[ key ], value ) :\n\n\t\t\t\t\t\t// Don\'t extend strings, arrays, etc. with objects\n\t\t\t\t\t\t$.widget.extend( {}, value );\n\n\t\t\t\t// Copy everything else by reference\n\t\t\t\t} else {\n\t\t\t\t\ttarget[ key ] = value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n};\n\n$.widget.bridge = function( name, object ) {\n\tvar fullName = object.prototype.widgetFullName || name;\n\t$.fn[ name ] = function( options ) {\n\t\tvar isMethodCall = typeof options === "string";\n\t\tvar args = widgetSlice.call( arguments, 1 );\n\t\tvar returnValue = this;\n\n\t\tif ( isMethodCall ) {\n\n\t\t\t// If this is an empty collection, we need to have the instance method\n\t\t\t// return undefined instead of the jQuery instance\n\t\t\tif ( !this.length && options === "instance" ) {\n\t\t\t\treturnValue = undefined;\n\t\t\t} else {\n\t\t\t\tthis.each( function() {\n\t\t\t\t\tvar methodValue;\n\t\t\t\t\tvar instance = $.data( this, fullName );\n\n\t\t\t\t\tif ( options === "instance" ) {\n\t\t\t\t\t\treturnValue = instance;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !instance ) {\n\t\t\t\t\t\treturn $.error( "cannot call methods on " + name +\n\t\t\t\t\t\t\t" prior to initialization; " +\n\t\t\t\t\t\t\t"attempted to call method \'" + options + "\'" );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( typeof instance[ options ] !== "function" ||\n\t\t\t\t\t\toptions.charAt( 0 ) === "_" ) {\n\t\t\t\t\t\treturn $.error( "no such method \'" + options + "\' for " + name +\n\t\t\t\t\t\t\t" widget instance" );\n\t\t\t\t\t}\n\n\t\t\t\t\tmethodValue = instance[ options ].apply( instance, args );\n\n\t\t\t\t\tif ( methodValue !== instance && methodValue !== undefined ) {\n\t\t\t\t\t\treturnValue = methodValue && methodValue.jquery ?\n\t\t\t\t\t\t\treturnValue.pushStack( methodValue.get() ) :\n\t\t\t\t\t\t\tmethodValue;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\n\t\t\t// Allow multiple hashes to be passed on init\n\t\t\tif ( args.length ) {\n\t\t\t\toptions = $.widget.extend.apply( null, [ options ].concat( args ) );\n\t\t\t}\n\n\t\t\tthis.each( function() {\n\t\t\t\tvar instance = $.data( this, fullName );\n\t\t\t\tif ( instance ) {\n\t\t\t\t\tinstance.option( options || {} );\n\t\t\t\t\tif ( instance._init ) {\n\t\t\t\t\t\tinstance._init();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$.data( this, fullName, new object( options, this ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn returnValue;\n\t};\n};\n\n$.Widget = function( /* options, element */ ) {};\n$.Widget._childConstructors = [];\n\n$.Widget.prototype = {\n\twidgetName: "widget",\n\twidgetEventPrefix: "",\n\tdefaultElement: "<div>",\n\n\toptions: {\n\t\tclasses: {},\n\t\tdisabled: false,\n\n\t\t// Callbacks\n\t\tcreate: null\n\t},\n\n\t_createWidget: function( options, element ) {\n\t\telement = $( element || this.defaultElement || this )[ 0 ];\n\t\tthis.element = $( element );\n\t\tthis.uuid = widgetUuid++;\n\t\tthis.eventNamespace = "." + this.widgetName + this.uuid;\n\n\t\tthis.bindings = $();\n\t\tthis.hoverable = $();\n\t\tthis.focusable = $();\n\t\tthis.classesElementLookup = {};\n\n\t\tif ( element !== this ) {\n\t\t\t$.data( element, this.widgetFullName, this );\n\t\t\tthis._on( true, this.element, {\n\t\t\t\tremove: function( event ) {\n\t\t\t\t\tif ( event.target === element ) {\n\t\t\t\t\t\tthis.destroy();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.document = $( element.style ?\n\n\t\t\t\t// Element within the document\n\t\t\t\telement.ownerDocument :\n\n\t\t\t\t// Element is window or document\n\t\t\t\telement.document || element );\n\t\t\tthis.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow );\n\t\t}\n\n\t\tthis.options = $.widget.extend( {},\n\t\t\tthis.options,\n\t\t\tthis._getCreateOptions(),\n\t\t\toptions );\n\n\t\tthis._create();\n\n\t\tif ( this.options.disabled ) {\n\t\t\tthis._setOptionDisabled( this.options.disabled );\n\t\t}\n\n\t\tthis._trigger( "create", null, this._getCreateEventData() );\n\t\tthis._init();\n\t},\n\n\t_getCreateOptions: function() {\n\t\treturn {};\n\t},\n\n\t_getCreateEventData: $.noop,\n\n\t_create: $.noop,\n\n\t_init: $.noop,\n\n\tdestroy: function() {\n\t\tvar that = this;\n\n\t\tthis._destroy();\n\t\t$.each( this.classesElementLookup, function( key, value ) {\n\t\t\tthat._removeClass( value, key );\n\t\t} );\n\n\t\t// We can probably remove the unbind calls in 2.0\n\t\t// all event bindings should go through this._on()\n\t\tthis.element\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeData( this.widgetFullName );\n\t\tthis.widget()\n\t\t\t.off( this.eventNamespace )\n\t\t\t.removeAttr( "aria-disabled" );\n\n\t\t// Clean up events and states\n\t\tthis.bindings.off( this.eventNamespace );\n\t},\n\n\t_destroy: $.noop,\n\n\twidget: function() {\n\t\treturn this.element;\n\t},\n\n\toption: function( key, value ) {\n\t\tvar options = key;\n\t\tvar parts;\n\t\tvar curOption;\n\t\tvar i;\n\n\t\tif ( arguments.length === 0 ) {\n\n\t\t\t// Don\'t return a reference to the internal hash\n\t\t\treturn $.widget.extend( {}, this.options );\n\t\t}\n\n\t\tif ( typeof key === "string" ) {\n\n\t\t\t// Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }\n\t\t\toptions = {};\n\t\t\tparts = key.split( "." );\n\t\t\tkey = parts.shift();\n\t\t\tif ( parts.length ) {\n\t\t\t\tcurOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );\n\t\t\t\tfor ( i = 0; i < parts.length - 1; i++ ) {\n\t\t\t\t\tcurOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};\n\t\t\t\t\tcurOption = curOption[ parts[ i ] ];\n\t\t\t\t}\n\t\t\t\tkey = parts.pop();\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn curOption[ key ] === undefined ? null : curOption[ key ];\n\t\t\t\t}\n\t\t\t\tcurOption[ key ] = value;\n\t\t\t} else {\n\t\t\t\tif ( arguments.length === 1 ) {\n\t\t\t\t\treturn this.options[ key ] === undefined ? null : this.options[ key ];\n\t\t\t\t}\n\t\t\t\toptions[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tthis._setOptions( options );\n\n\t\treturn this;\n\t},\n\n\t_setOptions: function( options ) {\n\t\tvar key;\n\n\t\tfor ( key in options ) {\n\t\t\tthis._setOption( key, options[ key ] );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOption: function( key, value ) {\n\t\tif ( key === "classes" ) {\n\t\t\tthis._setOptionClasses( value );\n\t\t}\n\n\t\tthis.options[ key ] = value;\n\n\t\tif ( key === "disabled" ) {\n\t\t\tthis._setOptionDisabled( value );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t_setOptionClasses: function( value ) {\n\t\tvar classKey, elements, currentElements;\n\n\t\tfor ( classKey in value ) {\n\t\t\tcurrentElements = this.classesElementLookup[ classKey ];\n\t\t\tif ( value[ classKey ] === this.options.classes[ classKey ] ||\n\t\t\t\t\t!currentElements ||\n\t\t\t\t\t!currentElements.length ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// We are doing this to create a new jQuery object because the _removeClass() call\n\t\t\t// on the next line is going to destroy the reference to the current elements being\n\t\t\t// tracked. We need to save a copy of this collection so that we can add the new classes\n\t\t\t// below.\n\t\t\telements = $( currentElements.get() );\n\t\t\tthis._removeClass( currentElements, classKey );\n\n\t\t\t// We don\'t use _addClass() here, because that uses this.options.classes\n\t\t\t// for generating the string of classes. We want to use the value passed in from\n\t\t\t// _setOption(), this is the new value of the classes option which was passed to\n\t\t\t// _setOption(). We pass this value directly to _classes().\n\t\t\telements.addClass( this._classes( {\n\t\t\t\telement: elements,\n\t\t\t\tkeys: classKey,\n\t\t\t\tclasses: value,\n\t\t\t\tadd: true\n\t\t\t} ) );\n\t\t}\n\t},\n\n\t_setOptionDisabled: function( value ) {\n\t\tthis._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value );\n\n\t\t// If the widget is becoming disabled, then nothing is interactive\n\t\tif ( value ) {\n\t\t\tthis._removeClass( this.hoverable, null, "ui-state-hover" );\n\t\t\tthis._removeClass( this.focusable, null, "ui-state-focus" );\n\t\t}\n\t},\n\n\tenable: function() {\n\t\treturn this._setOptions( { disabled: false } );\n\t},\n\n\tdisable: function() {\n\t\treturn this._setOptions( { disabled: true } );\n\t},\n\n\t_classes: function( options ) {\n\t\tvar full = [];\n\t\tvar that = this;\n\n\t\toptions = $.extend( {\n\t\t\telement: this.element,\n\t\t\tclasses: this.options.classes || {}\n\t\t}, options );\n\n\t\tfunction bindRemoveEvent() {\n\t\t\tvar nodesToBind = [];\n\n\t\t\toptions.element.each( function( _, element ) {\n\t\t\t\tvar isTracked = $.map( that.classesElementLookup, function( elements ) {\n\t\t\t\t\treturn elements;\n\t\t\t\t} )\n\t\t\t\t\t.some( function( elements ) {\n\t\t\t\t\t\treturn elements.is( element );\n\t\t\t\t\t} );\n\n\t\t\t\tif ( !isTracked ) {\n\t\t\t\t\tnodesToBind.push( element );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\tthat._on( $( nodesToBind ), {\n\t\t\t\tremove: "_untrackClassesElement"\n\t\t\t} );\n\t\t}\n\n\t\tfunction processClassString( classes, checkOption ) {\n\t\t\tvar current, i;\n\t\t\tfor ( i = 0; i < classes.length; i++ ) {\n\t\t\t\tcurrent = that.classesElementLookup[ classes[ i ] ] || $();\n\t\t\t\tif ( options.add ) {\n\t\t\t\t\tbindRemoveEvent();\n\t\t\t\t\tcurrent = $( $.uniqueSort( current.get().concat( options.element.get() ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tcurrent = $( current.not( options.element ).get() );\n\t\t\t\t}\n\t\t\t\tthat.classesElementLookup[ classes[ i ] ] = current;\n\t\t\t\tfull.push( classes[ i ] );\n\t\t\t\tif ( checkOption && options.classes[ classes[ i ] ] ) {\n\t\t\t\t\tfull.push( options.classes[ classes[ i ] ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( options.keys ) {\n\t\t\tprocessClassString( options.keys.match( /\\S+/g ) || [], true );\n\t\t}\n\t\tif ( options.extra ) {\n\t\t\tprocessClassString( options.extra.match( /\\S+/g ) || [] );\n\t\t}\n\n\t\treturn full.join( " " );\n\t},\n\n\t_untrackClassesElement: function( event ) {\n\t\tvar that = this;\n\t\t$.each( that.classesElementLookup, function( key, value ) {\n\t\t\tif ( $.inArray( event.target, value ) !== -1 ) {\n\t\t\t\tthat.classesElementLookup[ key ] = $( value.not( event.target ).get() );\n\t\t\t}\n\t\t} );\n\n\t\tthis._off( $( event.target ) );\n\t},\n\n\t_removeClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, false );\n\t},\n\n\t_addClass: function( element, keys, extra ) {\n\t\treturn this._toggleClass( element, keys, extra, true );\n\t},\n\n\t_toggleClass: function( element, keys, extra, add ) {\n\t\tadd = ( typeof add === "boolean" ) ? add : extra;\n\t\tvar shift = ( typeof element === "string" || element === null ),\n\t\t\toptions = {\n\t\t\t\textra: shift ? keys : extra,\n\t\t\t\tkeys: shift ? element : keys,\n\t\t\t\telement: shift ? this.element : element,\n\t\t\t\tadd: add\n\t\t\t};\n\t\toptions.element.toggleClass( this._classes( options ), add );\n\t\treturn this;\n\t},\n\n\t_on: function( suppressDisabledCheck, element, handlers ) {\n\t\tvar delegateElement;\n\t\tvar instance = this;\n\n\t\t// No suppressDisabledCheck flag, shuffle arguments\n\t\tif ( typeof suppressDisabledCheck !== "boolean" ) {\n\t\t\thandlers = element;\n\t\t\telement = suppressDisabledCheck;\n\t\t\tsuppressDisabledCheck = false;\n\t\t}\n\n\t\t// No element argument, shuffle and use this.element\n\t\tif ( !handlers ) {\n\t\t\thandlers = element;\n\t\t\telement = this.element;\n\t\t\tdelegateElement = this.widget();\n\t\t} else {\n\t\t\telement = delegateElement = $( element );\n\t\t\tthis.bindings = this.bindings.add( element );\n\t\t}\n\n\t\t$.each( handlers, function( event, handler ) {\n\t\t\tfunction handlerProxy() {\n\n\t\t\t\t// Allow widgets to customize the disabled handling\n\t\t\t\t// - disabled as an array instead of boolean\n\t\t\t\t// - disabled class as method for disabling individual parts\n\t\t\t\tif ( !suppressDisabledCheck &&\n\t\t\t\t\t\t( instance.options.disabled === true ||\n\t\t\t\t\t\t$( this ).hasClass( "ui-state-disabled" ) ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn ( typeof handler === "string" ? instance[ handler ] : handler )\n\t\t\t\t\t.apply( instance, arguments );\n\t\t\t}\n\n\t\t\t// Copy the guid so direct unbinding works\n\t\t\tif ( typeof handler !== "string" ) {\n\t\t\t\thandlerProxy.guid = handler.guid =\n\t\t\t\t\thandler.guid || handlerProxy.guid || $.guid++;\n\t\t\t}\n\n\t\t\tvar match = event.match( /^([\\w:-]*)\\s*(.*)$/ );\n\t\t\tvar eventName = match[ 1 ] + instance.eventNamespace;\n\t\t\tvar selector = match[ 2 ];\n\n\t\t\tif ( selector ) {\n\t\t\t\tdelegateElement.on( eventName, selector, handlerProxy );\n\t\t\t} else {\n\t\t\t\telement.on( eventName, handlerProxy );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_off: function( element, eventName ) {\n\t\teventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) +\n\t\t\tthis.eventNamespace;\n\t\telement.off( eventName );\n\n\t\t// Clear the stack to avoid memory leaks (#10056)\n\t\tthis.bindings = $( this.bindings.not( element ).get() );\n\t\tthis.focusable = $( this.focusable.not( element ).get() );\n\t\tthis.hoverable = $( this.hoverable.not( element ).get() );\n\t},\n\n\t_delay: function( handler, delay ) {\n\t\tfunction handlerProxy() {\n\t\t\treturn ( typeof handler === "string" ? instance[ handler ] : handler )\n\t\t\t\t.apply( instance, arguments );\n\t\t}\n\t\tvar instance = this;\n\t\treturn setTimeout( handlerProxy, delay || 0 );\n\t},\n\n\t_hoverable: function( element ) {\n\t\tthis.hoverable = this.hoverable.add( element );\n\t\tthis._on( element, {\n\t\t\tmouseenter: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, "ui-state-hover" );\n\t\t\t},\n\t\t\tmouseleave: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, "ui-state-hover" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_focusable: function( element ) {\n\t\tthis.focusable = this.focusable.add( element );\n\t\tthis._on( element, {\n\t\t\tfocusin: function( event ) {\n\t\t\t\tthis._addClass( $( event.currentTarget ), null, "ui-state-focus" );\n\t\t\t},\n\t\t\tfocusout: function( event ) {\n\t\t\t\tthis._removeClass( $( event.currentTarget ), null, "ui-state-focus" );\n\t\t\t}\n\t\t} );\n\t},\n\n\t_trigger: function( type, event, data ) {\n\t\tvar prop, orig;\n\t\tvar callback = this.options[ type ];\n\n\t\tdata = data || {};\n\t\tevent = $.Event( event );\n\t\tevent.type = ( type === this.widgetEventPrefix ?\n\t\t\ttype :\n\t\t\tthis.widgetEventPrefix + type ).toLowerCase();\n\n\t\t// The original event may come from any element\n\t\t// so we need to reset the target on the new event\n\t\tevent.target = this.element[ 0 ];\n\n\t\t// Copy original event properties over to the new event\n\t\torig = event.originalEvent;\n\t\tif ( orig ) {\n\t\t\tfor ( prop in orig ) {\n\t\t\t\tif ( !( prop in event ) ) {\n\t\t\t\t\tevent[ prop ] = orig[ prop ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element.trigger( event, data );\n\t\treturn !( typeof callback === "function" &&\n\t\t\tcallback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false ||\n\t\t\tevent.isDefaultPrevented() );\n\t}\n};\n\n$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {\n\t$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {\n\t\tif ( typeof options === "string" ) {\n\t\t\toptions = { effect: options };\n\t\t}\n\n\t\tvar hasOptions;\n\t\tvar effectName = !options ?\n\t\t\tmethod :\n\t\t\toptions === true || typeof options === "number" ?\n\t\t\t\tdefaultEffect :\n\t\t\t\toptions.effect || defaultEffect;\n\n\t\toptions = options || {};\n\t\tif ( typeof options === "number" ) {\n\t\t\toptions = { duration: options };\n\t\t} else if ( options === true ) {\n\t\t\toptions = {};\n\t\t}\n\n\t\thasOptions = !$.isEmptyObject( options );\n\t\toptions.complete = callback;\n\n\t\tif ( options.delay ) {\n\t\t\telement.delay( options.delay );\n\t\t}\n\n\t\tif ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {\n\t\t\telement[ method ]( options );\n\t\t} else if ( effectName !== method && element[ effectName ] ) {\n\t\t\telement[ effectName ]( options.duration, options.easing, callback );\n\t\t} else {\n\t\t\telement.queue( function( next ) {\n\t\t\t\t$( this )[ method ]();\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback.call( element[ 0 ] );\n\t\t\t\t}\n\t\t\t\tnext();\n\t\t\t} );\n\t\t}\n\t};\n} );\n\nreturn $.widget;\n\n} );\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjg5MS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQSxNQUFNLElBQTBDOztBQUVoRDtBQUNBLEVBQUUsaUNBQVEsRUFBRS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dICkge1xuXHRcdFx0ZWxlbWVudFsgZWZmZWN0TmFtZSBdKCBvcHRpb25zLmR1cmF0aW9uLCBvcHRpb25zLmVhc2luZywgY2FsbGJhY2sgKTtcblx0XHR9IGVsc2Uge1xuXHRcdFx0ZWxlbWVudC5xdWV1ZSggZnVuY3Rpb24oIG5leHQgKSB7XG5cdFx0XHRcdCQoIHRoaXMgKVsgbWV0aG9kIF0oKTtcblx0XHRcdFx0aWYgKCBjYWxsYmFjayApIHtcblx0XHRcdFx0XHRjYWxsYmFjay5jYWxsKCBlbGVtZW50WyAwIF0gKTtcblx0XHRcdFx0fVxuXHRcdFx0XHRuZXh0KCk7XG5cdFx0XHR9ICk7XG5cdFx0fVxuXHR9O1xufSApO1xuXG5yZXR1cm4gJC53aWRnZXQ7XG5cbn0gKTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6891\n')},9755:function(module,exports){eval('var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n * jQuery JavaScript Library v3.6.1\n * https://jquery.com/\n *\n * Includes Sizzle.js\n * https://sizzlejs.com/\n *\n * Copyright OpenJS Foundation and other contributors\n * Released under the MIT license\n * https://jquery.org/license\n *\n * Date: 2022-08-26T17:52Z\n */\n( function( global, factory ) {\n\n\t"use strict";\n\n\tif ( true && typeof module.exports === "object" ) {\n\n\t\t// For CommonJS and CommonJS-like environments where a proper `window`\n\t\t// is present, execute the factory and get jQuery.\n\t\t// For environments that do not have a `window` with a `document`\n\t\t// (such as Node.js), expose a factory as module.exports.\n\t\t// This accentuates the need for the creation of a real `window`.\n\t\t// e.g. var jQuery = require("jquery")(window);\n\t\t// See ticket trac-14549 for more info.\n\t\tmodule.exports = global.document ?\n\t\t\tfactory( global, true ) :\n\t\t\tfunction( w ) {\n\t\t\t\tif ( !w.document ) {\n\t\t\t\t\tthrow new Error( "jQuery requires a window with a document" );\n\t\t\t\t}\n\t\t\t\treturn factory( w );\n\t\t\t};\n\t} else {\n\t\tfactory( global );\n\t}\n\n// Pass this if window is not defined yet\n} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {\n\n// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\n// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\n// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\n// enough that all such attempts are guarded in a try block.\n"use strict";\n\nvar arr = [];\n\nvar getProto = Object.getPrototypeOf;\n\nvar slice = arr.slice;\n\nvar flat = arr.flat ? function( array ) {\n\treturn arr.flat.call( array );\n} : function( array ) {\n\treturn arr.concat.apply( [], array );\n};\n\n\nvar push = arr.push;\n\nvar indexOf = arr.indexOf;\n\nvar class2type = {};\n\nvar toString = class2type.toString;\n\nvar hasOwn = class2type.hasOwnProperty;\n\nvar fnToString = hasOwn.toString;\n\nvar ObjectFunctionString = fnToString.call( Object );\n\nvar support = {};\n\nvar isFunction = function isFunction( obj ) {\n\n\t\t// Support: Chrome <=57, Firefox <=52\n\t\t// In some browsers, typeof returns "function" for HTML <object> elements\n\t\t// (i.e., `typeof document.createElement( "object" ) === "function"`).\n\t\t// We don\'t want to classify *any* DOM node as a function.\n\t\t// Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\n\t\t// Plus for old WebKit, typeof returns "function" for HTML collections\n\t\t// (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)\n\t\treturn typeof obj === "function" && typeof obj.nodeType !== "number" &&\n\t\t\ttypeof obj.item !== "function";\n\t};\n\n\nvar isWindow = function isWindow( obj ) {\n\t\treturn obj != null && obj === obj.window;\n\t};\n\n\nvar document = window.document;\n\n\n\n\tvar preservedScriptAttributes = {\n\t\ttype: true,\n\t\tsrc: true,\n\t\tnonce: true,\n\t\tnoModule: true\n\t};\n\n\tfunction DOMEval( code, node, doc ) {\n\t\tdoc = doc || document;\n\n\t\tvar i, val,\n\t\t\tscript = doc.createElement( "script" );\n\n\t\tscript.text = code;\n\t\tif ( node ) {\n\t\t\tfor ( i in preservedScriptAttributes ) {\n\n\t\t\t\t// Support: Firefox 64+, Edge 18+\n\t\t\t\t// Some browsers don\'t support the "nonce" property on scripts.\n\t\t\t\t// On the other hand, just using `getAttribute` is not enough as\n\t\t\t\t// the `nonce` attribute is reset to an empty string whenever it\n\t\t\t\t// becomes browsing-context connected.\n\t\t\t\t// See https://github.com/whatwg/html/issues/2369\n\t\t\t\t// See https://html.spec.whatwg.org/#nonce-attributes\n\t\t\t\t// The `node.getAttribute` check was added for the sake of\n\t\t\t\t// `jQuery.globalEval` so that it can fake a nonce-containing node\n\t\t\t\t// via an object.\n\t\t\t\tval = node[ i ] || node.getAttribute && node.getAttribute( i );\n\t\t\t\tif ( val ) {\n\t\t\t\t\tscript.setAttribute( i, val );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdoc.head.appendChild( script ).parentNode.removeChild( script );\n\t}\n\n\nfunction toType( obj ) {\n\tif ( obj == null ) {\n\t\treturn obj + "";\n\t}\n\n\t// Support: Android <=2.3 only (functionish RegExp)\n\treturn typeof obj === "object" || typeof obj === "function" ?\n\t\tclass2type[ toString.call( obj ) ] || "object" :\n\t\ttypeof obj;\n}\n/* global Symbol */\n// Defining this global in .eslintrc.json would create a danger of using the global\n// unguarded in another place, it seems safer to define global only for this module\n\n\n\nvar\n\tversion = "3.6.1",\n\n\t// Define a local copy of jQuery\n\tjQuery = function( selector, context ) {\n\n\t\t// The jQuery object is actually just the init constructor \'enhanced\'\n\t\t// Need init if jQuery is called (just allow error to be thrown if not included)\n\t\treturn new jQuery.fn.init( selector, context );\n\t};\n\njQuery.fn = jQuery.prototype = {\n\n\t// The current version of jQuery being used\n\tjquery: version,\n\n\tconstructor: jQuery,\n\n\t// The default length of a jQuery object is 0\n\tlength: 0,\n\n\ttoArray: function() {\n\t\treturn slice.call( this );\n\t},\n\n\t// Get the Nth element in the matched element set OR\n\t// Get the whole matched element set as a clean array\n\tget: function( num ) {\n\n\t\t// Return all the elements in a clean array\n\t\tif ( num == null ) {\n\t\t\treturn slice.call( this );\n\t\t}\n\n\t\t// Return just the one element from the set\n\t\treturn num < 0 ? this[ num + this.length ] : this[ num ];\n\t},\n\n\t// Take an array of elements and push it onto the stack\n\t// (returning the new matched element set)\n\tpushStack: function( elems ) {\n\n\t\t// Build a new jQuery matched element set\n\t\tvar ret = jQuery.merge( this.constructor(), elems );\n\n\t\t// Add the old object onto the stack (as a reference)\n\t\tret.prevObject = this;\n\n\t\t// Return the newly-formed element set\n\t\treturn ret;\n\t},\n\n\t// Execute a callback for every element in the matched set.\n\teach: function( callback ) {\n\t\treturn jQuery.each( this, callback );\n\t},\n\n\tmap: function( callback ) {\n\t\treturn this.pushStack( jQuery.map( this, function( elem, i ) {\n\t\t\treturn callback.call( elem, i, elem );\n\t\t} ) );\n\t},\n\n\tslice: function() {\n\t\treturn this.pushStack( slice.apply( this, arguments ) );\n\t},\n\n\tfirst: function() {\n\t\treturn this.eq( 0 );\n\t},\n\n\tlast: function() {\n\t\treturn this.eq( -1 );\n\t},\n\n\teven: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn ( i + 1 ) % 2;\n\t\t} ) );\n\t},\n\n\todd: function() {\n\t\treturn this.pushStack( jQuery.grep( this, function( _elem, i ) {\n\t\t\treturn i % 2;\n\t\t} ) );\n\t},\n\n\teq: function( i ) {\n\t\tvar len = this.length,\n\t\t\tj = +i + ( i < 0 ? len : 0 );\n\t\treturn this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\n\t},\n\n\tend: function() {\n\t\treturn this.prevObject || this.constructor();\n\t},\n\n\t// For internal use only.\n\t// Behaves like an Array\'s method, not like a jQuery method.\n\tpush: push,\n\tsort: arr.sort,\n\tsplice: arr.splice\n};\n\njQuery.extend = jQuery.fn.extend = function() {\n\tvar options, name, src, copy, copyIsArray, clone,\n\t\ttarget = arguments[ 0 ] || {},\n\t\ti = 1,\n\t\tlength = arguments.length,\n\t\tdeep = false;\n\n\t// Handle a deep copy situation\n\tif ( typeof target === "boolean" ) {\n\t\tdeep = target;\n\n\t\t// Skip the boolean and the target\n\t\ttarget = arguments[ i ] || {};\n\t\ti++;\n\t}\n\n\t// Handle case when target is a string or something (possible in deep copy)\n\tif ( typeof target !== "object" && !isFunction( target ) ) {\n\t\ttarget = {};\n\t}\n\n\t// Extend jQuery itself if only one argument is passed\n\tif ( i === length ) {\n\t\ttarget = this;\n\t\ti--;\n\t}\n\n\tfor ( ; i < length; i++ ) {\n\n\t\t// Only deal with non-null/undefined values\n\t\tif ( ( options = arguments[ i ] ) != null ) {\n\n\t\t\t// Extend the base object\n\t\t\tfor ( name in options ) {\n\t\t\t\tcopy = options[ name ];\n\n\t\t\t\t// Prevent Object.prototype pollution\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif ( name === "__proto__" || target === copy ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Recurse if we\'re merging plain objects or arrays\n\t\t\t\tif ( deep && copy && ( jQuery.isPlainObject( copy ) ||\n\t\t\t\t\t( copyIsArray = Array.isArray( copy ) ) ) ) {\n\t\t\t\t\tsrc = target[ name ];\n\n\t\t\t\t\t// Ensure proper type for the source value\n\t\t\t\t\tif ( copyIsArray && !Array.isArray( src ) ) {\n\t\t\t\t\t\tclone = [];\n\t\t\t\t\t} else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\n\t\t\t\t\t\tclone = {};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclone = src;\n\t\t\t\t\t}\n\t\t\t\t\tcopyIsArray = false;\n\n\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\ttarget[ name ] = jQuery.extend( deep, clone, copy );\n\n\t\t\t\t// Don\'t bring in undefined values\n\t\t\t\t} else if ( copy !== undefined ) {\n\t\t\t\t\ttarget[ name ] = copy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\njQuery.extend( {\n\n\t// Unique for each copy of jQuery on the page\n\texpando: "jQuery" + ( version + Math.random() ).replace( /\\D/g, "" ),\n\n\t// Assume jQuery is ready without the ready module\n\tisReady: true,\n\n\terror: function( msg ) {\n\t\tthrow new Error( msg );\n\t},\n\n\tnoop: function() {},\n\n\tisPlainObject: function( obj ) {\n\t\tvar proto, Ctor;\n\n\t\t// Detect obvious negatives\n\t\t// Use toString instead of jQuery.type to catch host objects\n\t\tif ( !obj || toString.call( obj ) !== "[object Object]" ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tproto = getProto( obj );\n\n\t\t// Objects with no prototype (e.g., `Object.create( null )`) are plain\n\t\tif ( !proto ) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Objects with prototype are plain iff they were constructed by a global Object function\n\t\tCtor = hasOwn.call( proto, "constructor" ) && proto.constructor;\n\t\treturn typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;\n\t},\n\n\tisEmptyObject: function( obj ) {\n\t\tvar name;\n\n\t\tfor ( name in obj ) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t},\n\n\t// Evaluates a script in a provided context; falls back to the global one\n\t// if not specified.\n\tglobalEval: function( code, options, doc ) {\n\t\tDOMEval( code, { nonce: options && options.nonce }, doc );\n\t},\n\n\teach: function( obj, callback ) {\n\t\tvar length, i = 0;\n\n\t\tif ( isArrayLike( obj ) ) {\n\t\t\tlength = obj.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor ( i in obj ) {\n\t\t\t\tif ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn obj;\n\t},\n\n\t// results is for internal usage only\n\tmakeArray: function( arr, results ) {\n\t\tvar ret = results || [];\n\n\t\tif ( arr != null ) {\n\t\t\tif ( isArrayLike( Object( arr ) ) ) {\n\t\t\t\tjQuery.merge( ret,\n\t\t\t\t\ttypeof arr === "string" ?\n\t\t\t\t\t\t[ arr ] : arr\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tpush.call( ret, arr );\n\t\t\t}\n\t\t}\n\n\t\treturn ret;\n\t},\n\n\tinArray: function( elem, arr, i ) {\n\t\treturn arr == null ? -1 : indexOf.call( arr, elem, i );\n\t},\n\n\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t// push.apply(_, arraylike) throws on ancient WebKit\n\tmerge: function( first, second ) {\n\t\tvar len = +second.length,\n\t\t\tj = 0,\n\t\t\ti = first.length;\n\n\t\tfor ( ; j < len; j++ ) {\n\t\t\tfirst[ i++ ] = second[ j ];\n\t\t}\n\n\t\tfirst.length = i;\n\n\t\treturn first;\n\t},\n\n\tgrep: function( elems, callback, invert ) {\n\t\tvar callbackInverse,\n\t\t\tmatches = [],\n\t\t\ti = 0,\n\t\t\tlength = elems.length,\n\t\t\tcallbackExpect = !invert;\n\n\t\t// Go through the array, only saving the items\n\t\t// that pass the validator function\n\t\tfor ( ; i < length; i++ ) {\n\t\t\tcallbackInverse = !callback( elems[ i ], i );\n\t\t\tif ( callbackInverse !== callbackExpect ) {\n\t\t\t\tmatches.push( elems[ i ] );\n\t\t\t}\n\t\t}\n\n\t\treturn matches;\n\t},\n\n\t// arg is for internal usage only\n\tmap: function( elems, callback, arg ) {\n\t\tvar length, value,\n\t\t\ti = 0,\n\t\t\tret = [];\n\n\t\t// Go through the array, translating each of the items to their new values\n\t\tif ( isArrayLike( elems ) ) {\n\t\t\tlength = elems.length;\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Go through every key on the object,\n\t\t} else {\n\t\t\tfor ( i in elems ) {\n\t\t\t\tvalue = callback( elems[ i ], i, arg );\n\n\t\t\t\tif ( value != null ) {\n\t\t\t\t\tret.push( value );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Flatten any nested arrays\n\t\treturn flat( ret );\n\t},\n\n\t// A global GUID counter for objects\n\tguid: 1,\n\n\t// jQuery.support is not used in Core but other projects attach their\n\t// properties to it so it needs to exist.\n\tsupport: support\n} );\n\nif ( typeof Symbol === "function" ) {\n\tjQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\n}\n\n// Populate the class2type map\njQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),\n\tfunction( _i, name ) {\n\t\tclass2type[ "[object " + name + "]" ] = name.toLowerCase();\n\t} );\n\nfunction isArrayLike( obj ) {\n\n\t// Support: real iOS 8.2 only (not reproducible in simulator)\n\t// `in` check used to prevent JIT error (gh-2145)\n\t// hasOwn isn\'t used here due to false negatives\n\t// regarding Nodelist length in IE\n\tvar length = !!obj && "length" in obj && obj.length,\n\t\ttype = toType( obj );\n\n\tif ( isFunction( obj ) || isWindow( obj ) ) {\n\t\treturn false;\n\t}\n\n\treturn type === "array" || length === 0 ||\n\t\ttypeof length === "number" && length > 0 && ( length - 1 ) in obj;\n}\nvar Sizzle =\n/*!\n * Sizzle CSS Selector Engine v2.3.6\n * https://sizzlejs.com/\n *\n * Copyright JS Foundation and other contributors\n * Released under the MIT license\n * https://js.foundation/\n *\n * Date: 2021-02-16\n */\n( function( window ) {\nvar i,\n\tsupport,\n\tExpr,\n\tgetText,\n\tisXML,\n\ttokenize,\n\tcompile,\n\tselect,\n\toutermostContext,\n\tsortInput,\n\thasDuplicate,\n\n\t// Local document vars\n\tsetDocument,\n\tdocument,\n\tdocElem,\n\tdocumentIsHTML,\n\trbuggyQSA,\n\trbuggyMatches,\n\tmatches,\n\tcontains,\n\n\t// Instance-specific data\n\texpando = "sizzle" + 1 * new Date(),\n\tpreferredDoc = window.document,\n\tdirruns = 0,\n\tdone = 0,\n\tclassCache = createCache(),\n\ttokenCache = createCache(),\n\tcompilerCache = createCache(),\n\tnonnativeSelectorCache = createCache(),\n\tsortOrder = function( a, b ) {\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t}\n\t\treturn 0;\n\t},\n\n\t// Instance methods\n\thasOwn = ( {} ).hasOwnProperty,\n\tarr = [],\n\tpop = arr.pop,\n\tpushNative = arr.push,\n\tpush = arr.push,\n\tslice = arr.slice,\n\n\t// Use a stripped-down indexOf as it\'s faster than native\n\t// https://jsperf.com/thor-indexof-vs-for/5\n\tindexOf = function( list, elem ) {\n\t\tvar i = 0,\n\t\t\tlen = list.length;\n\t\tfor ( ; i < len; i++ ) {\n\t\t\tif ( list[ i ] === elem ) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t},\n\n\tbooleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +\n\t\t"ismap|loop|multiple|open|readonly|required|scoped",\n\n\t// Regular expressions\n\n\t// http://www.w3.org/TR/css3-selectors/#whitespace\n\twhitespace = "[\\\\x20\\\\t\\\\r\\\\n\\\\f]",\n\n\t// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\n\tidentifier = "(?:\\\\\\\\[\\\\da-fA-F]{1,6}" + whitespace +\n\t\t"?|\\\\\\\\[^\\\\r\\\\n\\\\f]|[\\\\w-]|[^\\0-\\\\x7f])+",\n\n\t// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\n\tattributes = "\\\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +\n\n\t\t// Operator (capture 2)\n\t\t"*([*^$|!~]?=)" + whitespace +\n\n\t\t// "Attribute values must be CSS identifiers [capture 5]\n\t\t// or strings [capture 3 or capture 4]"\n\t\t"*(?:\'((?:\\\\\\\\.|[^\\\\\\\\\'])*)\'|\\"((?:\\\\\\\\.|[^\\\\\\\\\\"])*)\\"|(" + identifier + "))|)" +\n\t\twhitespace + "*\\\\]",\n\n\tpseudos = ":(" + identifier + ")(?:\\\\((" +\n\n\t\t// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\n\t\t// 1. quoted (capture 3; capture 4 or capture 5)\n\t\t"(\'((?:\\\\\\\\.|[^\\\\\\\\\'])*)\'|\\"((?:\\\\\\\\.|[^\\\\\\\\\\"])*)\\")|" +\n\n\t\t// 2. simple (capture 6)\n\t\t"((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|" + attributes + ")*)|" +\n\n\t\t// 3. anything else (capture 2)\n\t\t".*" +\n\t\t")\\\\)|)",\n\n\t// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\n\trwhitespace = new RegExp( whitespace + "+", "g" ),\n\trtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)" +\n\t\twhitespace + "+$", "g" ),\n\n\trcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\n\trcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +\n\t\t"*" ),\n\trdescend = new RegExp( whitespace + "|>" ),\n\n\trpseudo = new RegExp( pseudos ),\n\tridentifier = new RegExp( "^" + identifier + "$" ),\n\n\tmatchExpr = {\n\t\t"ID": new RegExp( "^#(" + identifier + ")" ),\n\t\t"CLASS": new RegExp( "^\\\\.(" + identifier + ")" ),\n\t\t"TAG": new RegExp( "^(" + identifier + "|[*])" ),\n\t\t"ATTR": new RegExp( "^" + attributes ),\n\t\t"PSEUDO": new RegExp( "^" + pseudos ),\n\t\t"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(" +\n\t\t\twhitespace + "*(even|odd|(([+-]|)(\\\\d*)n|)" + whitespace + "*(?:([+-]|)" +\n\t\t\twhitespace + "*(\\\\d+)|))" + whitespace + "*\\\\)|)", "i" ),\n\t\t"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),\n\n\t\t// For use in libraries implementing .is()\n\t\t// We use this for POS matching in `select`\n\t\t"needsContext": new RegExp( "^" + whitespace +\n\t\t\t"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(" + whitespace +\n\t\t\t"*((?:-\\\\d)?\\\\d*)" + whitespace + "*\\\\)|)(?=[^-]|$)", "i" )\n\t},\n\n\trhtml = /HTML$/i,\n\trinputs = /^(?:input|select|textarea|button)$/i,\n\trheader = /^h\\d$/i,\n\n\trnative = /^[^{]+\\{\\s*\\[native \\w/,\n\n\t// Easily-parseable/retrievable ID or TAG or CLASS selectors\n\trquickExpr = /^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,\n\n\trsibling = /[+~]/,\n\n\t// CSS escapes\n\t// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\n\trunescape = new RegExp( "\\\\\\\\[\\\\da-fA-F]{1,6}" + whitespace + "?|\\\\\\\\([^\\\\r\\\\n\\\\f])", "g" ),\n\tfunescape = function( escape, nonHex ) {\n\t\tvar high = "0x" + escape.slice( 1 ) - 0x10000;\n\n\t\treturn nonHex ?\n\n\t\t\t// Strip the backslash prefix from a non-hex escape sequence\n\t\t\tnonHex :\n\n\t\t\t// Replace a hexadecimal escape sequence with the encoded Unicode code point\n\t\t\t// Support: IE <=11+\n\t\t\t// For values outside the Basic Multilingual Plane (BMP), manually construct a\n\t\t\t// surrogate pair\n\t\t\thigh < 0 ?\n\t\t\t\tString.fromCharCode( high + 0x10000 ) :\n\t\t\t\tString.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\n\t},\n\n\t// CSS string/identifier serialization\n\t// https://drafts.csswg.org/cssom/#common-serializing-idioms\n\trcssescape = /([\\0-\\x1f\\x7f]|^-?\\d)|^-$|[^\\0-\\x1f\\x7f-\\uFFFF\\w-]/g,\n\tfcssescape = function( ch, asCodePoint ) {\n\t\tif ( asCodePoint ) {\n\n\t\t\t// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\n\t\t\tif ( ch === "\\0" ) {\n\t\t\t\treturn "\\uFFFD";\n\t\t\t}\n\n\t\t\t// Control characters and (dependent upon position) numbers get escaped as code points\n\t\t\treturn ch.slice( 0, -1 ) + "\\\\" +\n\t\t\t\tch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";\n\t\t}\n\n\t\t// Other potentially-special ASCII characters get backslash-escaped\n\t\treturn "\\\\" + ch;\n\t},\n\n\t// Used for iframes\n\t// See setDocument()\n\t// Removing the function wrapper causes a "Permission Denied"\n\t// error in IE\n\tunloadHandler = function() {\n\t\tsetDocument();\n\t},\n\n\tinDisabledFieldset = addCombinator(\n\t\tfunction( elem ) {\n\t\t\treturn elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";\n\t\t},\n\t\t{ dir: "parentNode", next: "legend" }\n\t);\n\n// Optimize for push.apply( _, NodeList )\ntry {\n\tpush.apply(\n\t\t( arr = slice.call( preferredDoc.childNodes ) ),\n\t\tpreferredDoc.childNodes\n\t);\n\n\t// Support: Android<4.0\n\t// Detect silently failing push.apply\n\t// eslint-disable-next-line no-unused-expressions\n\tarr[ preferredDoc.childNodes.length ].nodeType;\n} catch ( e ) {\n\tpush = { apply: arr.length ?\n\n\t\t// Leverage slice if possible\n\t\tfunction( target, els ) {\n\t\t\tpushNative.apply( target, slice.call( els ) );\n\t\t} :\n\n\t\t// Support: IE<9\n\t\t// Otherwise append directly\n\t\tfunction( target, els ) {\n\t\t\tvar j = target.length,\n\t\t\t\ti = 0;\n\n\t\t\t// Can\'t trust NodeList.length\n\t\t\twhile ( ( target[ j++ ] = els[ i++ ] ) ) {}\n\t\t\ttarget.length = j - 1;\n\t\t}\n\t};\n}\n\nfunction Sizzle( selector, context, results, seed ) {\n\tvar m, i, elem, nid, match, groups, newSelector,\n\t\tnewContext = context && context.ownerDocument,\n\n\t\t// nodeType defaults to 9, since context defaults to document\n\t\tnodeType = context ? context.nodeType : 9;\n\n\tresults = results || [];\n\n\t// Return early from calls with invalid selector or context\n\tif ( typeof selector !== "string" || !selector ||\n\t\tnodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\n\n\t\treturn results;\n\t}\n\n\t// Try to shortcut find operations (as opposed to filters) in HTML documents\n\tif ( !seed ) {\n\t\tsetDocument( context );\n\t\tcontext = context || document;\n\n\t\tif ( documentIsHTML ) {\n\n\t\t\t// If the selector is sufficiently simple, try using a "get*By*" DOM method\n\t\t\t// (excepting DocumentFragment context, where the methods don\'t exist)\n\t\t\tif ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\n\n\t\t\t\t// ID selector\n\t\t\t\tif ( ( m = match[ 1 ] ) ) {\n\n\t\t\t\t\t// Document context\n\t\t\t\t\tif ( nodeType === 9 ) {\n\t\t\t\t\t\tif ( ( elem = context.getElementById( m ) ) ) {\n\n\t\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\t\tif ( elem.id === m ) {\n\t\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t// Element context\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Support: IE, Opera, Webkit\n\t\t\t\t\t\t// TODO: identify versions\n\t\t\t\t\t\t// getElementById can match elements by name instead of ID\n\t\t\t\t\t\tif ( newContext && ( elem = newContext.getElementById( m ) ) &&\n\t\t\t\t\t\t\tcontains( context, elem ) &&\n\t\t\t\t\t\t\telem.id === m ) {\n\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\treturn results;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// Type selector\n\t\t\t\t} else if ( match[ 2 ] ) {\n\t\t\t\t\tpush.apply( results, context.getElementsByTagName( selector ) );\n\t\t\t\t\treturn results;\n\n\t\t\t\t// Class selector\n\t\t\t\t} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\n\t\t\t\t\tcontext.getElementsByClassName ) {\n\n\t\t\t\t\tpush.apply( results, context.getElementsByClassName( m ) );\n\t\t\t\t\treturn results;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Take advantage of querySelectorAll\n\t\t\tif ( support.qsa &&\n\t\t\t\t!nonnativeSelectorCache[ selector + " " ] &&\n\t\t\t\t( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\n\n\t\t\t\t// Support: IE 8 only\n\t\t\t\t// Exclude object elements\n\t\t\t\t( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {\n\n\t\t\t\tnewSelector = selector;\n\t\t\t\tnewContext = context;\n\n\t\t\t\t// qSA considers elements outside a scoping root when evaluating child or\n\t\t\t\t// descendant combinators, which is not what we want.\n\t\t\t\t// In such cases, we work around the behavior by prefixing every selector in the\n\t\t\t\t// list with an ID selector referencing the scope context.\n\t\t\t\t// The technique has to be used as well when a leading combinator is used\n\t\t\t\t// as such selectors are not recognized by querySelectorAll.\n\t\t\t\t// Thanks to Andrew Dupont for this technique.\n\t\t\t\tif ( nodeType === 1 &&\n\t\t\t\t\t( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\n\n\t\t\t\t\t// Expand context for sibling selectors\n\t\t\t\t\tnewContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext;\n\n\t\t\t\t\t// We can use :scope instead of the ID hack if the browser\n\t\t\t\t\t// supports it & if we\'re not changing the context.\n\t\t\t\t\tif ( newContext !== context || !support.scope ) {\n\n\t\t\t\t\t\t// Capture the context ID, setting it first if necessary\n\t\t\t\t\t\tif ( ( nid = context.getAttribute( "id" ) ) ) {\n\t\t\t\t\t\t\tnid = nid.replace( rcssescape, fcssescape );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontext.setAttribute( "id", ( nid = expando ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prefix every selector in the list\n\t\t\t\t\tgroups = tokenize( selector );\n\t\t\t\t\ti = groups.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tgroups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +\n\t\t\t\t\t\t\ttoSelector( groups[ i ] );\n\t\t\t\t\t}\n\t\t\t\t\tnewSelector = groups.join( "," );\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tpush.apply( results,\n\t\t\t\t\t\tnewContext.querySelectorAll( newSelector )\n\t\t\t\t\t);\n\t\t\t\t\treturn results;\n\t\t\t\t} catch ( qsaError ) {\n\t\t\t\t\tnonnativeSelectorCache( selector, true );\n\t\t\t\t} finally {\n\t\t\t\t\tif ( nid === expando ) {\n\t\t\t\t\t\tcontext.removeAttribute( "id" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// All others\n\treturn select( selector.replace( rtrim, "$1" ), context, results, seed );\n}\n\n/**\n * Create key-value caches of limited size\n * @returns {function(string, object)} Returns the Object data after storing it on itself with\n *\tproperty name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\n *\tdeleting the oldest entry\n */\nfunction createCache() {\n\tvar keys = [];\n\n\tfunction cache( key, value ) {\n\n\t\t// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)\n\t\tif ( keys.push( key + " " ) > Expr.cacheLength ) {\n\n\t\t\t// Only keep the most recent entries\n\t\t\tdelete cache[ keys.shift() ];\n\t\t}\n\t\treturn ( cache[ key + " " ] = value );\n\t}\n\treturn cache;\n}\n\n/**\n * Mark a function for special use by Sizzle\n * @param {Function} fn The function to mark\n */\nfunction markFunction( fn ) {\n\tfn[ expando ] = true;\n\treturn fn;\n}\n\n/**\n * Support testing using an element\n * @param {Function} fn Passed the created element and returns a boolean result\n */\nfunction assert( fn ) {\n\tvar el = document.createElement( "fieldset" );\n\n\ttry {\n\t\treturn !!fn( el );\n\t} catch ( e ) {\n\t\treturn false;\n\t} finally {\n\n\t\t// Remove from its parent by default\n\t\tif ( el.parentNode ) {\n\t\t\tel.parentNode.removeChild( el );\n\t\t}\n\n\t\t// release memory in IE\n\t\tel = null;\n\t}\n}\n\n/**\n * Adds the same handler for all of the specified attrs\n * @param {String} attrs Pipe-separated list of attributes\n * @param {Function} handler The method that will be applied\n */\nfunction addHandle( attrs, handler ) {\n\tvar arr = attrs.split( "|" ),\n\t\ti = arr.length;\n\n\twhile ( i-- ) {\n\t\tExpr.attrHandle[ arr[ i ] ] = handler;\n\t}\n}\n\n/**\n * Checks document order of two siblings\n * @param {Element} a\n * @param {Element} b\n * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\n */\nfunction siblingCheck( a, b ) {\n\tvar cur = b && a,\n\t\tdiff = cur && a.nodeType === 1 && b.nodeType === 1 &&\n\t\t\ta.sourceIndex - b.sourceIndex;\n\n\t// Use IE sourceIndex if available on both nodes\n\tif ( diff ) {\n\t\treturn diff;\n\t}\n\n\t// Check if b follows a\n\tif ( cur ) {\n\t\twhile ( ( cur = cur.nextSibling ) ) {\n\t\t\tif ( cur === b ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn a ? 1 : -1;\n}\n\n/**\n * Returns a function to use in pseudos for input types\n * @param {String} type\n */\nfunction createInputPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn name === "input" && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for buttons\n * @param {String} type\n */\nfunction createButtonPseudo( type ) {\n\treturn function( elem ) {\n\t\tvar name = elem.nodeName.toLowerCase();\n\t\treturn ( name === "input" || name === "button" ) && elem.type === type;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for :enabled/:disabled\n * @param {Boolean} disabled true for :disabled; false for :enabled\n */\nfunction createDisabledPseudo( disabled ) {\n\n\t// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\n\treturn function( elem ) {\n\n\t\t// Only certain elements can match :enabled or :disabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\n\t\t// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\n\t\tif ( "form" in elem ) {\n\n\t\t\t// Check for inherited disabledness on relevant non-disabled elements:\n\t\t\t// * listed form-associated elements in a disabled fieldset\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#category-listed\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\n\t\t\t// * option elements in a disabled optgroup\n\t\t\t// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\n\t\t\t// All such elements have a "form" property.\n\t\t\tif ( elem.parentNode && elem.disabled === false ) {\n\n\t\t\t\t// Option elements defer to a parent optgroup if present\n\t\t\t\tif ( "label" in elem ) {\n\t\t\t\t\tif ( "label" in elem.parentNode ) {\n\t\t\t\t\t\treturn elem.parentNode.disabled === disabled;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn elem.disabled === disabled;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Support: IE 6 - 11\n\t\t\t\t// Use the isDisabled shortcut property to check for disabled fieldset ancestors\n\t\t\t\treturn elem.isDisabled === disabled ||\n\n\t\t\t\t\t// Where there is no isDisabled, check manually\n\t\t\t\t\t/* jshint -W018 */\n\t\t\t\t\telem.isDisabled !== !disabled &&\n\t\t\t\t\tinDisabledFieldset( elem ) === disabled;\n\t\t\t}\n\n\t\t\treturn elem.disabled === disabled;\n\n\t\t// Try to winnow out elements that can\'t be disabled before trusting the disabled property.\n\t\t// Some victims get caught in our net (label, legend, menu, track), but it shouldn\'t\n\t\t// even exist on them, let alone have a boolean value.\n\t\t} else if ( "label" in elem ) {\n\t\t\treturn elem.disabled === disabled;\n\t\t}\n\n\t\t// Remaining elements are neither :enabled nor :disabled\n\t\treturn false;\n\t};\n}\n\n/**\n * Returns a function to use in pseudos for positionals\n * @param {Function} fn\n */\nfunction createPositionalPseudo( fn ) {\n\treturn markFunction( function( argument ) {\n\t\targument = +argument;\n\t\treturn markFunction( function( seed, matches ) {\n\t\t\tvar j,\n\t\t\t\tmatchIndexes = fn( [], seed.length, argument ),\n\t\t\t\ti = matchIndexes.length;\n\n\t\t\t// Match elements found at the specified indexes\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( seed[ ( j = matchIndexes[ i ] ) ] ) {\n\t\t\t\t\tseed[ j ] = !( matches[ j ] = seed[ j ] );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n}\n\n/**\n * Checks a node for validity as a Sizzle context\n * @param {Element|Object=} context\n * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\n */\nfunction testContext( context ) {\n\treturn context && typeof context.getElementsByTagName !== "undefined" && context;\n}\n\n// Expose support vars for convenience\nsupport = Sizzle.support = {};\n\n/**\n * Detects XML nodes\n * @param {Element|Object} elem An element or a document\n * @returns {Boolean} True iff elem is a non-HTML XML node\n */\nisXML = Sizzle.isXML = function( elem ) {\n\tvar namespace = elem && elem.namespaceURI,\n\t\tdocElem = elem && ( elem.ownerDocument || elem ).documentElement;\n\n\t// Support: IE <=8\n\t// Assume HTML when documentElement doesn\'t yet exist, such as inside loading iframes\n\t// https://bugs.jquery.com/ticket/4833\n\treturn !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );\n};\n\n/**\n * Sets document-related variables once based on the current document\n * @param {Element|Object} [doc] An element or document object to use to set the document\n * @returns {Object} Returns the current document\n */\nsetDocument = Sizzle.setDocument = function( node ) {\n\tvar hasCompare, subWindow,\n\t\tdoc = node ? node.ownerDocument || node : preferredDoc;\n\n\t// Return early if doc is invalid or already selected\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\n\t\treturn document;\n\t}\n\n\t// Update global variables\n\tdocument = doc;\n\tdocElem = document.documentElement;\n\tdocumentIsHTML = !isXML( document );\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+\n\t// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( preferredDoc != document &&\n\t\t( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\n\n\t\t// Support: IE 11, Edge\n\t\tif ( subWindow.addEventListener ) {\n\t\t\tsubWindow.addEventListener( "unload", unloadHandler, false );\n\n\t\t// Support: IE 9 - 10 only\n\t\t} else if ( subWindow.attachEvent ) {\n\t\t\tsubWindow.attachEvent( "onunload", unloadHandler );\n\t\t}\n\t}\n\n\t// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\n\t// Safari 4 - 5 only, Opera <=11.6 - 12.x only\n\t// IE/Edge & older browsers don\'t support the :scope pseudo-class.\n\t// Support: Safari 6.0 only\n\t// Safari 6.0 supports :scope but it\'s an alias of :root there.\n\tsupport.scope = assert( function( el ) {\n\t\tdocElem.appendChild( el ).appendChild( document.createElement( "div" ) );\n\t\treturn typeof el.querySelectorAll !== "undefined" &&\n\t\t\t!el.querySelectorAll( ":scope fieldset div" ).length;\n\t} );\n\n\t/* Attributes\n\t---------------------------------------------------------------------- */\n\n\t// Support: IE<8\n\t// Verify that getAttribute really returns attributes and not properties\n\t// (excepting IE8 booleans)\n\tsupport.attributes = assert( function( el ) {\n\t\tel.className = "i";\n\t\treturn !el.getAttribute( "className" );\n\t} );\n\n\t/* getElement(s)By*\n\t---------------------------------------------------------------------- */\n\n\t// Check if getElementsByTagName("*") returns only elements\n\tsupport.getElementsByTagName = assert( function( el ) {\n\t\tel.appendChild( document.createComment( "" ) );\n\t\treturn !el.getElementsByTagName( "*" ).length;\n\t} );\n\n\t// Support: IE<9\n\tsupport.getElementsByClassName = rnative.test( document.getElementsByClassName );\n\n\t// Support: IE<10\n\t// Check if getElementById returns elements by name\n\t// The broken getElementById methods don\'t pick up programmatically-set names,\n\t// so use a roundabout getElementsByName test\n\tsupport.getById = assert( function( el ) {\n\t\tdocElem.appendChild( el ).id = expando;\n\t\treturn !document.getElementsByName || !document.getElementsByName( expando ).length;\n\t} );\n\n\t// ID filter and find\n\tif ( support.getById ) {\n\t\tExpr.filter[ "ID" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn elem.getAttribute( "id" ) === attrId;\n\t\t\t};\n\t\t};\n\t\tExpr.find[ "ID" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\n\t\t\t\tvar elem = context.getElementById( id );\n\t\t\t\treturn elem ? [ elem ] : [];\n\t\t\t}\n\t\t};\n\t} else {\n\t\tExpr.filter[ "ID" ] = function( id ) {\n\t\t\tvar attrId = id.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\tvar node = typeof elem.getAttributeNode !== "undefined" &&\n\t\t\t\t\telem.getAttributeNode( "id" );\n\t\t\t\treturn node && node.value === attrId;\n\t\t\t};\n\t\t};\n\n\t\t// Support: IE 6 - 7 only\n\t\t// getElementById is not reliable as a find shortcut\n\t\tExpr.find[ "ID" ] = function( id, context ) {\n\t\t\tif ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\n\t\t\t\tvar node, i, elems,\n\t\t\t\t\telem = context.getElementById( id );\n\n\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t// Verify the id attribute\n\t\t\t\t\tnode = elem.getAttributeNode( "id" );\n\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Fall back on getElementsByName\n\t\t\t\t\telems = context.getElementsByName( id );\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile ( ( elem = elems[ i++ ] ) ) {\n\t\t\t\t\t\tnode = elem.getAttributeNode( "id" );\n\t\t\t\t\t\tif ( node && node.value === id ) {\n\t\t\t\t\t\t\treturn [ elem ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn [];\n\t\t\t}\n\t\t};\n\t}\n\n\t// Tag\n\tExpr.find[ "TAG" ] = support.getElementsByTagName ?\n\t\tfunction( tag, context ) {\n\t\t\tif ( typeof context.getElementsByTagName !== "undefined" ) {\n\t\t\t\treturn context.getElementsByTagName( tag );\n\n\t\t\t// DocumentFragment nodes don\'t have gEBTN\n\t\t\t} else if ( support.qsa ) {\n\t\t\t\treturn context.querySelectorAll( tag );\n\t\t\t}\n\t\t} :\n\n\t\tfunction( tag, context ) {\n\t\t\tvar elem,\n\t\t\t\ttmp = [],\n\t\t\t\ti = 0,\n\n\t\t\t\t// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\n\t\t\t\tresults = context.getElementsByTagName( tag );\n\n\t\t\t// Filter out possible comments\n\t\t\tif ( tag === "*" ) {\n\t\t\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\ttmp.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn tmp;\n\t\t\t}\n\t\t\treturn results;\n\t\t};\n\n\t// Class\n\tExpr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {\n\t\tif ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {\n\t\t\treturn context.getElementsByClassName( className );\n\t\t}\n\t};\n\n\t/* QSA/matchesSelector\n\t---------------------------------------------------------------------- */\n\n\t// QSA and matchesSelector support\n\n\t// matchesSelector(:active) reports false when true (IE9/Opera 11.5)\n\trbuggyMatches = [];\n\n\t// qSa(:focus) reports false when true (Chrome 21)\n\t// We allow this because of a bug in IE8/9 that throws an error\n\t// whenever `document.activeElement` is accessed on an iframe\n\t// So, we allow :focus to pass through QSA all the time to avoid the IE error\n\t// See https://bugs.jquery.com/ticket/13378\n\trbuggyQSA = [];\n\n\tif ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\n\n\t\t// Build QSA regex\n\t\t// Regex strategy adopted from Diego Perini\n\t\tassert( function( el ) {\n\n\t\t\tvar input;\n\n\t\t\t// Select is set to empty string on purpose\n\t\t\t// This is to test IE\'s treatment of not explicitly\n\t\t\t// setting a boolean content attribute,\n\t\t\t// since its presence should be enough\n\t\t\t// https://bugs.jquery.com/ticket/12359\n\t\t\tdocElem.appendChild( el ).innerHTML = "<a id=\'" + expando + "\'></a>" +\n\t\t\t\t"<select id=\'" + expando + "-\\r\\\\\' msallowcapture=\'\'>" +\n\t\t\t\t"<option selected=\'\'></option></select>";\n\n\t\t\t// Support: IE8, Opera 11-12.16\n\t\t\t// Nothing should be selected when empty strings follow ^= or $= or *=\n\t\t\t// The test attribute must be unknown in Opera but "safe" for WinRT\n\t\t\t// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\n\t\t\tif ( el.querySelectorAll( "[msallowcapture^=\'\']" ).length ) {\n\t\t\t\trbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\'\'|\\"\\")" );\n\t\t\t}\n\n\t\t\t// Support: IE8\n\t\t\t// Boolean attributes and "value" are not treated correctly\n\t\t\tif ( !el.querySelectorAll( "[selected]" ).length ) {\n\t\t\t\trbuggyQSA.push( "\\\\[" + whitespace + "*(?:value|" + booleans + ")" );\n\t\t\t}\n\n\t\t\t// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\n\t\t\tif ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {\n\t\t\t\trbuggyQSA.push( "~=" );\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 15 - 18+\n\t\t\t// IE 11/Edge don\'t find elements on a `[name=\'\']` query in some cases.\n\t\t\t// Adding a temporary attribute to the document before the selection works\n\t\t\t// around the issue.\n\t\t\t// Interestingly, IE 10 & older don\'t seem to have the issue.\n\t\t\tinput = document.createElement( "input" );\n\t\t\tinput.setAttribute( "name", "" );\n\t\t\tel.appendChild( input );\n\t\t\tif ( !el.querySelectorAll( "[name=\'\']" ).length ) {\n\t\t\t\trbuggyQSA.push( "\\\\[" + whitespace + "*name" + whitespace + "*=" +\n\t\t\t\t\twhitespace + "*(?:\'\'|\\"\\")" );\n\t\t\t}\n\n\t\t\t// Webkit/Opera - :checked should return selected option elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( !el.querySelectorAll( ":checked" ).length ) {\n\t\t\t\trbuggyQSA.push( ":checked" );\n\t\t\t}\n\n\t\t\t// Support: Safari 8+, iOS 8+\n\t\t\t// https://bugs.webkit.org/show_bug.cgi?id=136851\n\t\t\t// In-page `selector#id sibling-combinator selector` fails\n\t\t\tif ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {\n\t\t\t\trbuggyQSA.push( ".#.+[+~]" );\n\t\t\t}\n\n\t\t\t// Support: Firefox <=3.6 - 5 only\n\t\t\t// Old Firefox doesn\'t throw on a badly-escaped identifier.\n\t\t\tel.querySelectorAll( "\\\\\\f" );\n\t\t\trbuggyQSA.push( "[\\\\r\\\\n\\\\f]" );\n\t\t} );\n\n\t\tassert( function( el ) {\n\t\t\tel.innerHTML = "<a href=\'\' disabled=\'disabled\'></a>" +\n\t\t\t\t"<select disabled=\'disabled\'><option/></select>";\n\n\t\t\t// Support: Windows 8 Native Apps\n\t\t\t// The type and name attributes are restricted during .innerHTML assignment\n\t\t\tvar input = document.createElement( "input" );\n\t\t\tinput.setAttribute( "type", "hidden" );\n\t\t\tel.appendChild( input ).setAttribute( "name", "D" );\n\n\t\t\t// Support: IE8\n\t\t\t// Enforce case-sensitivity of name attribute\n\t\t\tif ( el.querySelectorAll( "[name=d]" ).length ) {\n\t\t\t\trbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );\n\t\t\t}\n\n\t\t\t// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\n\t\t\t// IE8 throws error here and will not see later tests\n\t\t\tif ( el.querySelectorAll( ":enabled" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( ":enabled", ":disabled" );\n\t\t\t}\n\n\t\t\t// Support: IE9-11+\n\t\t\t// IE\'s :disabled selector does not pick up the children of disabled fieldsets\n\t\t\tdocElem.appendChild( el ).disabled = true;\n\t\t\tif ( el.querySelectorAll( ":disabled" ).length !== 2 ) {\n\t\t\t\trbuggyQSA.push( ":enabled", ":disabled" );\n\t\t\t}\n\n\t\t\t// Support: Opera 10 - 11 only\n\t\t\t// Opera 10-11 does not throw on post-comma invalid pseudos\n\t\t\tel.querySelectorAll( "*,:x" );\n\t\t\trbuggyQSA.push( ",.*:" );\n\t\t} );\n\t}\n\n\tif ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\n\t\tdocElem.webkitMatchesSelector ||\n\t\tdocElem.mozMatchesSelector ||\n\t\tdocElem.oMatchesSelector ||\n\t\tdocElem.msMatchesSelector ) ) ) ) {\n\n\t\tassert( function( el ) {\n\n\t\t\t// Check to see if it\'s possible to do matchesSelector\n\t\t\t// on a disconnected node (IE 9)\n\t\t\tsupport.disconnectedMatch = matches.call( el, "*" );\n\n\t\t\t// This should fail with an exception\n\t\t\t// Gecko does not error, returns false instead\n\t\t\tmatches.call( el, "[s!=\'\']:x" );\n\t\t\trbuggyMatches.push( "!=", pseudos );\n\t\t} );\n\t}\n\n\trbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );\n\trbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );\n\n\t/* Contains\n\t---------------------------------------------------------------------- */\n\thasCompare = rnative.test( docElem.compareDocumentPosition );\n\n\t// Element contains another\n\t// Purposefully self-exclusive\n\t// As in, an element does not contain itself\n\tcontains = hasCompare || rnative.test( docElem.contains ) ?\n\t\tfunction( a, b ) {\n\t\t\tvar adown = a.nodeType === 9 ? a.documentElement : a,\n\t\t\t\tbup = b && b.parentNode;\n\t\t\treturn a === bup || !!( bup && bup.nodeType === 1 && (\n\t\t\t\tadown.contains ?\n\t\t\t\t\tadown.contains( bup ) :\n\t\t\t\t\ta.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\n\t\t\t) );\n\t\t} :\n\t\tfunction( a, b ) {\n\t\t\tif ( b ) {\n\t\t\t\twhile ( ( b = b.parentNode ) ) {\n\t\t\t\t\tif ( b === a ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t/* Sorting\n\t---------------------------------------------------------------------- */\n\n\t// Document order sorting\n\tsortOrder = hasCompare ?\n\tfunction( a, b ) {\n\n\t\t// Flag for duplicate removal\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\t// Sort on method existence if only one input has compareDocumentPosition\n\t\tvar compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\n\t\tif ( compare ) {\n\t\t\treturn compare;\n\t\t}\n\n\t\t// Calculate position if both inputs belong to the same document\n\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t// two documents; shallow comparisons work.\n\t\t// eslint-disable-next-line eqeqeq\n\t\tcompare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\n\t\t\ta.compareDocumentPosition( b ) :\n\n\t\t\t// Otherwise we know they are disconnected\n\t\t\t1;\n\n\t\t// Disconnected nodes\n\t\tif ( compare & 1 ||\n\t\t\t( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\n\n\t\t\t// Choose the first element that is related to our preferred document\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( a == document || a.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, a ) ) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\tif ( b == document || b.ownerDocument == preferredDoc &&\n\t\t\t\tcontains( preferredDoc, b ) ) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// Maintain original order\n\t\t\treturn sortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\t\t}\n\n\t\treturn compare & 4 ? -1 : 1;\n\t} :\n\tfunction( a, b ) {\n\n\t\t// Exit early if the nodes are identical\n\t\tif ( a === b ) {\n\t\t\thasDuplicate = true;\n\t\t\treturn 0;\n\t\t}\n\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\taup = a.parentNode,\n\t\t\tbup = b.parentNode,\n\t\t\tap = [ a ],\n\t\t\tbp = [ b ];\n\n\t\t// Parentless nodes are either documents or disconnected\n\t\tif ( !aup || !bup ) {\n\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\treturn a == document ? -1 :\n\t\t\t\tb == document ? 1 :\n\t\t\t\t/* eslint-enable eqeqeq */\n\t\t\t\taup ? -1 :\n\t\t\t\tbup ? 1 :\n\t\t\t\tsortInput ?\n\t\t\t\t( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\n\t\t\t\t0;\n\n\t\t// If the nodes are siblings, we can do a quick check\n\t\t} else if ( aup === bup ) {\n\t\t\treturn siblingCheck( a, b );\n\t\t}\n\n\t\t// Otherwise we need full lists of their ancestors for comparison\n\t\tcur = a;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tap.unshift( cur );\n\t\t}\n\t\tcur = b;\n\t\twhile ( ( cur = cur.parentNode ) ) {\n\t\t\tbp.unshift( cur );\n\t\t}\n\n\t\t// Walk down the tree looking for a discrepancy\n\t\twhile ( ap[ i ] === bp[ i ] ) {\n\t\t\ti++;\n\t\t}\n\n\t\treturn i ?\n\n\t\t\t// Do a sibling check if the nodes have a common ancestor\n\t\t\tsiblingCheck( ap[ i ], bp[ i ] ) :\n\n\t\t\t// Otherwise nodes in our document sort first\n\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t// two documents; shallow comparisons work.\n\t\t\t/* eslint-disable eqeqeq */\n\t\t\tap[ i ] == preferredDoc ? -1 :\n\t\t\tbp[ i ] == preferredDoc ? 1 :\n\t\t\t/* eslint-enable eqeqeq */\n\t\t\t0;\n\t};\n\n\treturn document;\n};\n\nSizzle.matches = function( expr, elements ) {\n\treturn Sizzle( expr, null, null, elements );\n};\n\nSizzle.matchesSelector = function( elem, expr ) {\n\tsetDocument( elem );\n\n\tif ( support.matchesSelector && documentIsHTML &&\n\t\t!nonnativeSelectorCache[ expr + " " ] &&\n\t\t( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\n\t\t( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\n\n\t\ttry {\n\t\t\tvar ret = matches.call( elem, expr );\n\n\t\t\t// IE 9\'s matchesSelector returns false on disconnected nodes\n\t\t\tif ( ret || support.disconnectedMatch ||\n\n\t\t\t\t// As well, disconnected nodes are said to be in a document\n\t\t\t\t// fragment in IE 9\n\t\t\t\telem.document && elem.document.nodeType !== 11 ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t} catch ( e ) {\n\t\t\tnonnativeSelectorCache( expr, true );\n\t\t}\n\t}\n\n\treturn Sizzle( expr, document, null, [ elem ] ).length > 0;\n};\n\nSizzle.contains = function( context, elem ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( context.ownerDocument || context ) != document ) {\n\t\tsetDocument( context );\n\t}\n\treturn contains( context, elem );\n};\n\nSizzle.attr = function( elem, name ) {\n\n\t// Set document vars if needed\n\t// Support: IE 11+, Edge 17 - 18+\n\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t// two documents; shallow comparisons work.\n\t// eslint-disable-next-line eqeqeq\n\tif ( ( elem.ownerDocument || elem ) != document ) {\n\t\tsetDocument( elem );\n\t}\n\n\tvar fn = Expr.attrHandle[ name.toLowerCase() ],\n\n\t\t// Don\'t get fooled by Object.prototype properties (jQuery #13807)\n\t\tval = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\n\t\t\tfn( elem, name, !documentIsHTML ) :\n\t\t\tundefined;\n\n\treturn val !== undefined ?\n\t\tval :\n\t\tsupport.attributes || !documentIsHTML ?\n\t\t\telem.getAttribute( name ) :\n\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\tval.value :\n\t\t\t\tnull;\n};\n\nSizzle.escape = function( sel ) {\n\treturn ( sel + "" ).replace( rcssescape, fcssescape );\n};\n\nSizzle.error = function( msg ) {\n\tthrow new Error( "Syntax error, unrecognized expression: " + msg );\n};\n\n/**\n * Document sorting and removing duplicates\n * @param {ArrayLike} results\n */\nSizzle.uniqueSort = function( results ) {\n\tvar elem,\n\t\tduplicates = [],\n\t\tj = 0,\n\t\ti = 0;\n\n\t// Unless we *know* we can detect duplicates, assume their presence\n\thasDuplicate = !support.detectDuplicates;\n\tsortInput = !support.sortStable && results.slice( 0 );\n\tresults.sort( sortOrder );\n\n\tif ( hasDuplicate ) {\n\t\twhile ( ( elem = results[ i++ ] ) ) {\n\t\t\tif ( elem === results[ i ] ) {\n\t\t\t\tj = duplicates.push( i );\n\t\t\t}\n\t\t}\n\t\twhile ( j-- ) {\n\t\t\tresults.splice( duplicates[ j ], 1 );\n\t\t}\n\t}\n\n\t// Clear input after sorting to release objects\n\t// See https://github.com/jquery/sizzle/pull/225\n\tsortInput = null;\n\n\treturn results;\n};\n\n/**\n * Utility function for retrieving the text value of an array of DOM nodes\n * @param {Array|Element} elem\n */\ngetText = Sizzle.getText = function( elem ) {\n\tvar node,\n\t\tret = "",\n\t\ti = 0,\n\t\tnodeType = elem.nodeType;\n\n\tif ( !nodeType ) {\n\n\t\t// If no nodeType, this is expected to be an array\n\t\twhile ( ( node = elem[ i++ ] ) ) {\n\n\t\t\t// Do not traverse comment nodes\n\t\t\tret += getText( node );\n\t\t}\n\t} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\n\n\t\t// Use textContent for elements\n\t\t// innerText usage removed for consistency of new lines (jQuery #11153)\n\t\tif ( typeof elem.textContent === "string" ) {\n\t\t\treturn elem.textContent;\n\t\t} else {\n\n\t\t\t// Traverse its children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tret += getText( elem );\n\t\t\t}\n\t\t}\n\t} else if ( nodeType === 3 || nodeType === 4 ) {\n\t\treturn elem.nodeValue;\n\t}\n\n\t// Do not include comment or processing instruction nodes\n\n\treturn ret;\n};\n\nExpr = Sizzle.selectors = {\n\n\t// Can be adjusted by the user\n\tcacheLength: 50,\n\n\tcreatePseudo: markFunction,\n\n\tmatch: matchExpr,\n\n\tattrHandle: {},\n\n\tfind: {},\n\n\trelative: {\n\t\t">": { dir: "parentNode", first: true },\n\t\t" ": { dir: "parentNode" },\n\t\t"+": { dir: "previousSibling", first: true },\n\t\t"~": { dir: "previousSibling" }\n\t},\n\n\tpreFilter: {\n\t\t"ATTR": function( match ) {\n\t\t\tmatch[ 1 ] = match[ 1 ].replace( runescape, funescape );\n\n\t\t\t// Move the given value to match[3] whether quoted or unquoted\n\t\t\tmatch[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\n\t\t\t\tmatch[ 5 ] || "" ).replace( runescape, funescape );\n\n\t\t\tif ( match[ 2 ] === "~=" ) {\n\t\t\t\tmatch[ 3 ] = " " + match[ 3 ] + " ";\n\t\t\t}\n\n\t\t\treturn match.slice( 0, 4 );\n\t\t},\n\n\t\t"CHILD": function( match ) {\n\n\t\t\t/* matches from matchExpr["CHILD"]\n\t\t\t\t1 type (only|nth|...)\n\t\t\t\t2 what (child|of-type)\n\t\t\t\t3 argument (even|odd|\\d*|\\d*n([+-]\\d+)?|...)\n\t\t\t\t4 xn-component of xn+y argument ([+-]?\\d*n|)\n\t\t\t\t5 sign of xn-component\n\t\t\t\t6 x of xn-component\n\t\t\t\t7 sign of y-component\n\t\t\t\t8 y of y-component\n\t\t\t*/\n\t\t\tmatch[ 1 ] = match[ 1 ].toLowerCase();\n\n\t\t\tif ( match[ 1 ].slice( 0, 3 ) === "nth" ) {\n\n\t\t\t\t// nth-* requires argument\n\t\t\t\tif ( !match[ 3 ] ) {\n\t\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t\t}\n\n\t\t\t\t// numeric x and y parameters for Expr.filter.CHILD\n\t\t\t\t// remember that false/true cast respectively to 0/1\n\t\t\t\tmatch[ 4 ] = +( match[ 4 ] ?\n\t\t\t\t\tmatch[ 5 ] + ( match[ 6 ] || 1 ) :\n\t\t\t\t\t2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );\n\t\t\t\tmatch[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );\n\n\t\t\t\t// other types prohibit arguments\n\t\t\t} else if ( match[ 3 ] ) {\n\t\t\t\tSizzle.error( match[ 0 ] );\n\t\t\t}\n\n\t\t\treturn match;\n\t\t},\n\n\t\t"PSEUDO": function( match ) {\n\t\t\tvar excess,\n\t\t\t\tunquoted = !match[ 6 ] && match[ 2 ];\n\n\t\t\tif ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t// Accept quoted arguments as-is\n\t\t\tif ( match[ 3 ] ) {\n\t\t\t\tmatch[ 2 ] = match[ 4 ] || match[ 5 ] || "";\n\n\t\t\t// Strip excess characters from unquoted arguments\n\t\t\t} else if ( unquoted && rpseudo.test( unquoted ) &&\n\n\t\t\t\t// Get excess from tokenize (recursively)\n\t\t\t\t( excess = tokenize( unquoted, true ) ) &&\n\n\t\t\t\t// advance to the next closing parenthesis\n\t\t\t\t( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {\n\n\t\t\t\t// excess is a negative index\n\t\t\t\tmatch[ 0 ] = match[ 0 ].slice( 0, excess );\n\t\t\t\tmatch[ 2 ] = unquoted.slice( 0, excess );\n\t\t\t}\n\n\t\t\t// Return only captures needed by the pseudo filter method (type and argument)\n\t\t\treturn match.slice( 0, 3 );\n\t\t}\n\t},\n\n\tfilter: {\n\n\t\t"TAG": function( nodeNameSelector ) {\n\t\t\tvar nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn nodeNameSelector === "*" ?\n\t\t\t\tfunction() {\n\t\t\t\t\treturn true;\n\t\t\t\t} :\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\n\t\t\t\t};\n\t\t},\n\n\t\t"CLASS": function( className ) {\n\t\t\tvar pattern = classCache[ className + " " ];\n\n\t\t\treturn pattern ||\n\t\t\t\t( pattern = new RegExp( "(^|" + whitespace +\n\t\t\t\t\t")" + className + "(" + whitespace + "|$)" ) ) && classCache(\n\t\t\t\t\t\tclassName, function( elem ) {\n\t\t\t\t\t\t\treturn pattern.test(\n\t\t\t\t\t\t\t\ttypeof elem.className === "string" && elem.className ||\n\t\t\t\t\t\t\t\ttypeof elem.getAttribute !== "undefined" &&\n\t\t\t\t\t\t\t\t\telem.getAttribute( "class" ) ||\n\t\t\t\t\t\t\t\t""\n\t\t\t\t\t\t\t);\n\t\t\t\t} );\n\t\t},\n\n\t\t"ATTR": function( name, operator, check ) {\n\t\t\treturn function( elem ) {\n\t\t\t\tvar result = Sizzle.attr( elem, name );\n\n\t\t\t\tif ( result == null ) {\n\t\t\t\t\treturn operator === "!=";\n\t\t\t\t}\n\t\t\t\tif ( !operator ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tresult += "";\n\n\t\t\t\t/* eslint-disable max-len */\n\n\t\t\t\treturn operator === "=" ? result === check :\n\t\t\t\t\toperator === "!=" ? result !== check :\n\t\t\t\t\toperator === "^=" ? check && result.indexOf( check ) === 0 :\n\t\t\t\t\toperator === "*=" ? check && result.indexOf( check ) > -1 :\n\t\t\t\t\toperator === "$=" ? check && result.slice( -check.length ) === check :\n\t\t\t\t\toperator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :\n\t\t\t\t\toperator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :\n\t\t\t\t\tfalse;\n\t\t\t\t/* eslint-enable max-len */\n\n\t\t\t};\n\t\t},\n\n\t\t"CHILD": function( type, what, _argument, first, last ) {\n\t\t\tvar simple = type.slice( 0, 3 ) !== "nth",\n\t\t\t\tforward = type.slice( -4 ) !== "last",\n\t\t\t\tofType = what === "of-type";\n\n\t\t\treturn first === 1 && last === 0 ?\n\n\t\t\t\t// Shortcut for :nth-*(n)\n\t\t\t\tfunction( elem ) {\n\t\t\t\t\treturn !!elem.parentNode;\n\t\t\t\t} :\n\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tvar cache, uniqueCache, outerCache, node, nodeIndex, start,\n\t\t\t\t\t\tdir = simple !== forward ? "nextSibling" : "previousSibling",\n\t\t\t\t\t\tparent = elem.parentNode,\n\t\t\t\t\t\tname = ofType && elem.nodeName.toLowerCase(),\n\t\t\t\t\t\tuseCache = !xml && !ofType,\n\t\t\t\t\t\tdiff = false;\n\n\t\t\t\t\tif ( parent ) {\n\n\t\t\t\t\t\t// :(first|last|only)-(child|of-type)\n\t\t\t\t\t\tif ( simple ) {\n\t\t\t\t\t\t\twhile ( dir ) {\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\twhile ( ( node = node[ dir ] ) ) {\n\t\t\t\t\t\t\t\t\tif ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) {\n\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Reverse direction for :only-* (if we haven\'t yet done so)\n\t\t\t\t\t\t\t\tstart = dir = type === "only" && !start && "nextSibling";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstart = [ forward ? parent.firstChild : parent.lastChild ];\n\n\t\t\t\t\t\t// non-xml :nth-child(...) stores cache data on `parent`\n\t\t\t\t\t\tif ( forward && useCache ) {\n\n\t\t\t\t\t\t\t// Seek `elem` from a previously-cached index\n\n\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\tnode = parent;\n\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\tdiff = nodeIndex && cache[ 2 ];\n\t\t\t\t\t\t\tnode = nodeIndex && parent.childNodes[ nodeIndex ];\n\n\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\n\t\t\t\t\t\t\t\t// Fallback to seeking `elem` from the start\n\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t// When found, cache indexes on `parent` and break\n\t\t\t\t\t\t\t\tif ( node.nodeType === 1 && ++diff && node === elem ) {\n\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Use previously-cached element index if available\n\t\t\t\t\t\t\tif ( useCache ) {\n\n\t\t\t\t\t\t\t\t// ...in a gzip-friendly way\n\t\t\t\t\t\t\t\tnode = elem;\n\t\t\t\t\t\t\t\touterCache = node[ expando ] || ( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\tcache = uniqueCache[ type ] || [];\n\t\t\t\t\t\t\t\tnodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\n\t\t\t\t\t\t\t\tdiff = nodeIndex;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// xml :nth-child(...)\n\t\t\t\t\t\t\t// or :nth-last-child(...) or :nth(-last)?-of-type(...)\n\t\t\t\t\t\t\tif ( diff === false ) {\n\n\t\t\t\t\t\t\t\t// Use the same loop as above to seek `elem` from the start\n\t\t\t\t\t\t\t\twhile ( ( node = ++nodeIndex && node && node[ dir ] ||\n\t\t\t\t\t\t\t\t\t( diff = nodeIndex = 0 ) || start.pop() ) ) {\n\n\t\t\t\t\t\t\t\t\tif ( ( ofType ?\n\t\t\t\t\t\t\t\t\t\tnode.nodeName.toLowerCase() === name :\n\t\t\t\t\t\t\t\t\t\tnode.nodeType === 1 ) &&\n\t\t\t\t\t\t\t\t\t\t++diff ) {\n\n\t\t\t\t\t\t\t\t\t\t// Cache the index of each encountered element\n\t\t\t\t\t\t\t\t\t\tif ( useCache ) {\n\t\t\t\t\t\t\t\t\t\t\touterCache = node[ expando ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( node[ expando ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache = outerCache[ node.uniqueID ] ||\n\t\t\t\t\t\t\t\t\t\t\t\t( outerCache[ node.uniqueID ] = {} );\n\n\t\t\t\t\t\t\t\t\t\t\tuniqueCache[ type ] = [ dirruns, diff ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tif ( node === elem ) {\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Incorporate the offset, then check against cycle size\n\t\t\t\t\t\tdiff -= last;\n\t\t\t\t\t\treturn diff === first || ( diff % first === 0 && diff / first >= 0 );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t},\n\n\t\t"PSEUDO": function( pseudo, argument ) {\n\n\t\t\t// pseudo-class names are case-insensitive\n\t\t\t// http://www.w3.org/TR/selectors/#pseudo-classes\n\t\t\t// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\n\t\t\t// Remember that setFilters inherits from pseudos\n\t\t\tvar args,\n\t\t\t\tfn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\n\t\t\t\t\tSizzle.error( "unsupported pseudo: " + pseudo );\n\n\t\t\t// The user may use createPseudo to indicate that\n\t\t\t// arguments are needed to create the filter function\n\t\t\t// just as Sizzle does\n\t\t\tif ( fn[ expando ] ) {\n\t\t\t\treturn fn( argument );\n\t\t\t}\n\n\t\t\t// But maintain support for old signatures\n\t\t\tif ( fn.length > 1 ) {\n\t\t\t\targs = [ pseudo, pseudo, "", argument ];\n\t\t\t\treturn Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\n\t\t\t\t\tmarkFunction( function( seed, matches ) {\n\t\t\t\t\t\tvar idx,\n\t\t\t\t\t\t\tmatched = fn( seed, argument ),\n\t\t\t\t\t\t\ti = matched.length;\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tidx = indexOf( seed, matched[ i ] );\n\t\t\t\t\t\t\tseed[ idx ] = !( matches[ idx ] = matched[ i ] );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ) :\n\t\t\t\t\tfunction( elem ) {\n\t\t\t\t\t\treturn fn( elem, 0, args );\n\t\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn fn;\n\t\t}\n\t},\n\n\tpseudos: {\n\n\t\t// Potentially complex pseudos\n\t\t"not": markFunction( function( selector ) {\n\n\t\t\t// Trim the selector passed to compile\n\t\t\t// to avoid treating leading and trailing\n\t\t\t// spaces as combinators\n\t\t\tvar input = [],\n\t\t\t\tresults = [],\n\t\t\t\tmatcher = compile( selector.replace( rtrim, "$1" ) );\n\n\t\t\treturn matcher[ expando ] ?\n\t\t\t\tmarkFunction( function( seed, matches, _context, xml ) {\n\t\t\t\t\tvar elem,\n\t\t\t\t\t\tunmatched = matcher( seed, null, xml, [] ),\n\t\t\t\t\t\ti = seed.length;\n\n\t\t\t\t\t// Match elements unmatched by `matcher`\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\t\t\t\t\tseed[ i ] = !( matches[ i ] = elem );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} ) :\n\t\t\t\tfunction( elem, _context, xml ) {\n\t\t\t\t\tinput[ 0 ] = elem;\n\t\t\t\t\tmatcher( input, null, xml, results );\n\n\t\t\t\t\t// Don\'t keep the element (issue #299)\n\t\t\t\t\tinput[ 0 ] = null;\n\t\t\t\t\treturn !results.pop();\n\t\t\t\t};\n\t\t} ),\n\n\t\t"has": markFunction( function( selector ) {\n\t\t\treturn function( elem ) {\n\t\t\t\treturn Sizzle( selector, elem ).length > 0;\n\t\t\t};\n\t\t} ),\n\n\t\t"contains": markFunction( function( text ) {\n\t\t\ttext = text.replace( runescape, funescape );\n\t\t\treturn function( elem ) {\n\t\t\t\treturn ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\n\t\t\t};\n\t\t} ),\n\n\t\t// "Whether an element is represented by a :lang() selector\n\t\t// is based solely on the element\'s language value\n\t\t// being equal to the identifier C,\n\t\t// or beginning with the identifier C immediately followed by "-".\n\t\t// The matching of C against the element\'s language value is performed case-insensitively.\n\t\t// The identifier C does not have to be a valid language name."\n\t\t// http://www.w3.org/TR/selectors/#lang-pseudo\n\t\t"lang": markFunction( function( lang ) {\n\n\t\t\t// lang value must be a valid identifier\n\t\t\tif ( !ridentifier.test( lang || "" ) ) {\n\t\t\t\tSizzle.error( "unsupported lang: " + lang );\n\t\t\t}\n\t\t\tlang = lang.replace( runescape, funescape ).toLowerCase();\n\t\t\treturn function( elem ) {\n\t\t\t\tvar elemLang;\n\t\t\t\tdo {\n\t\t\t\t\tif ( ( elemLang = documentIsHTML ?\n\t\t\t\t\t\telem.lang :\n\t\t\t\t\t\telem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {\n\n\t\t\t\t\t\telemLang = elemLang.toLowerCase();\n\t\t\t\t\t\treturn elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;\n\t\t\t\t\t}\n\t\t\t\t} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\n\t\t\t\treturn false;\n\t\t\t};\n\t\t} ),\n\n\t\t// Miscellaneous\n\t\t"target": function( elem ) {\n\t\t\tvar hash = window.location && window.location.hash;\n\t\t\treturn hash && hash.slice( 1 ) === elem.id;\n\t\t},\n\n\t\t"root": function( elem ) {\n\t\t\treturn elem === docElem;\n\t\t},\n\n\t\t"focus": function( elem ) {\n\t\t\treturn elem === document.activeElement &&\n\t\t\t\t( !document.hasFocus || document.hasFocus() ) &&\n\t\t\t\t!!( elem.type || elem.href || ~elem.tabIndex );\n\t\t},\n\n\t\t// Boolean properties\n\t\t"enabled": createDisabledPseudo( false ),\n\t\t"disabled": createDisabledPseudo( true ),\n\n\t\t"checked": function( elem ) {\n\n\t\t\t// In CSS3, :checked should return both checked and selected elements\n\t\t\t// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\n\t\t\tvar nodeName = elem.nodeName.toLowerCase();\n\t\t\treturn ( nodeName === "input" && !!elem.checked ) ||\n\t\t\t\t( nodeName === "option" && !!elem.selected );\n\t\t},\n\n\t\t"selected": function( elem ) {\n\n\t\t\t// Accessing this property makes selected-by-default\n\t\t\t// options in Safari work properly\n\t\t\tif ( elem.parentNode ) {\n\t\t\t\t// eslint-disable-next-line no-unused-expressions\n\t\t\t\telem.parentNode.selectedIndex;\n\t\t\t}\n\n\t\t\treturn elem.selected === true;\n\t\t},\n\n\t\t// Contents\n\t\t"empty": function( elem ) {\n\n\t\t\t// http://www.w3.org/TR/selectors/#empty-pseudo\n\t\t\t// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\n\t\t\t// but not by others (comment: 8; processing instruction: 7; etc.)\n\t\t\t// nodeType < 6 works because attributes (2) do not appear as children\n\t\t\tfor ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\n\t\t\t\tif ( elem.nodeType < 6 ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t"parent": function( elem ) {\n\t\t\treturn !Expr.pseudos[ "empty" ]( elem );\n\t\t},\n\n\t\t// Element/input types\n\t\t"header": function( elem ) {\n\t\t\treturn rheader.test( elem.nodeName );\n\t\t},\n\n\t\t"input": function( elem ) {\n\t\t\treturn rinputs.test( elem.nodeName );\n\t\t},\n\n\t\t"button": function( elem ) {\n\t\t\tvar name = elem.nodeName.toLowerCase();\n\t\t\treturn name === "input" && elem.type === "button" || name === "button";\n\t\t},\n\n\t\t"text": function( elem ) {\n\t\t\tvar attr;\n\t\t\treturn elem.nodeName.toLowerCase() === "input" &&\n\t\t\t\telem.type === "text" &&\n\n\t\t\t\t// Support: IE<8\n\t\t\t\t// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"\n\t\t\t\t( ( attr = elem.getAttribute( "type" ) ) == null ||\n\t\t\t\t\tattr.toLowerCase() === "text" );\n\t\t},\n\n\t\t// Position-in-collection\n\t\t"first": createPositionalPseudo( function() {\n\t\t\treturn [ 0 ];\n\t\t} ),\n\n\t\t"last": createPositionalPseudo( function( _matchIndexes, length ) {\n\t\t\treturn [ length - 1 ];\n\t\t} ),\n\n\t\t"eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {\n\t\t\treturn [ argument < 0 ? argument + length : argument ];\n\t\t} ),\n\n\t\t"even": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t"odd": createPositionalPseudo( function( matchIndexes, length ) {\n\t\t\tvar i = 1;\n\t\t\tfor ( ; i < length; i += 2 ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t"lt": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ?\n\t\t\t\targument + length :\n\t\t\t\targument > length ?\n\t\t\t\t\tlength :\n\t\t\t\t\targument;\n\t\t\tfor ( ; --i >= 0; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} ),\n\n\t\t"gt": createPositionalPseudo( function( matchIndexes, length, argument ) {\n\t\t\tvar i = argument < 0 ? argument + length : argument;\n\t\t\tfor ( ; ++i < length; ) {\n\t\t\t\tmatchIndexes.push( i );\n\t\t\t}\n\t\t\treturn matchIndexes;\n\t\t} )\n\t}\n};\n\nExpr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];\n\n// Add button/input type pseudos\nfor ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\n\tExpr.pseudos[ i ] = createInputPseudo( i );\n}\nfor ( i in { submit: true, reset: true } ) {\n\tExpr.pseudos[ i ] = createButtonPseudo( i );\n}\n\n// Easy API for creating new setFilters\nfunction setFilters() {}\nsetFilters.prototype = Expr.filters = Expr.pseudos;\nExpr.setFilters = new setFilters();\n\ntokenize = Sizzle.tokenize = function( selector, parseOnly ) {\n\tvar matched, match, tokens, type,\n\t\tsoFar, groups, preFilters,\n\t\tcached = tokenCache[ selector + " " ];\n\n\tif ( cached ) {\n\t\treturn parseOnly ? 0 : cached.slice( 0 );\n\t}\n\n\tsoFar = selector;\n\tgroups = [];\n\tpreFilters = Expr.preFilter;\n\n\twhile ( soFar ) {\n\n\t\t// Comma and first run\n\t\tif ( !matched || ( match = rcomma.exec( soFar ) ) ) {\n\t\t\tif ( match ) {\n\n\t\t\t\t// Don\'t consume trailing commas as valid\n\t\t\t\tsoFar = soFar.slice( match[ 0 ].length ) || soFar;\n\t\t\t}\n\t\t\tgroups.push( ( tokens = [] ) );\n\t\t}\n\n\t\tmatched = false;\n\n\t\t// Combinators\n\t\tif ( ( match = rcombinators.exec( soFar ) ) ) {\n\t\t\tmatched = match.shift();\n\t\t\ttokens.push( {\n\t\t\t\tvalue: matched,\n\n\t\t\t\t// Cast descendant combinators to space\n\t\t\t\ttype: match[ 0 ].replace( rtrim, " " )\n\t\t\t} );\n\t\t\tsoFar = soFar.slice( matched.length );\n\t\t}\n\n\t\t// Filters\n\t\tfor ( type in Expr.filter ) {\n\t\t\tif ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\n\t\t\t\t( match = preFilters[ type ]( match ) ) ) ) {\n\t\t\t\tmatched = match.shift();\n\t\t\t\ttokens.push( {\n\t\t\t\t\tvalue: matched,\n\t\t\t\t\ttype: type,\n\t\t\t\t\tmatches: match\n\t\t\t\t} );\n\t\t\t\tsoFar = soFar.slice( matched.length );\n\t\t\t}\n\t\t}\n\n\t\tif ( !matched ) {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return the length of the invalid excess\n\t// if we\'re just parsing\n\t// Otherwise, throw an error or return tokens\n\treturn parseOnly ?\n\t\tsoFar.length :\n\t\tsoFar ?\n\t\t\tSizzle.error( selector ) :\n\n\t\t\t// Cache the tokens\n\t\t\ttokenCache( selector, groups ).slice( 0 );\n};\n\nfunction toSelector( tokens ) {\n\tvar i = 0,\n\t\tlen = tokens.length,\n\t\tselector = "";\n\tfor ( ; i < len; i++ ) {\n\t\tselector += tokens[ i ].value;\n\t}\n\treturn selector;\n}\n\nfunction addCombinator( matcher, combinator, base ) {\n\tvar dir = combinator.dir,\n\t\tskip = combinator.next,\n\t\tkey = skip || dir,\n\t\tcheckNonElements = base && key === "parentNode",\n\t\tdoneName = done++;\n\n\treturn combinator.first ?\n\n\t\t// Check against closest ancestor/preceding element\n\t\tfunction( elem, context, xml ) {\n\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\treturn matcher( elem, context, xml );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} :\n\n\t\t// Check against all ancestor/preceding elements\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar oldCache, uniqueCache, outerCache,\n\t\t\t\tnewCache = [ dirruns, doneName ];\n\n\t\t\t// We can\'t set arbitrary data on XML nodes, so they don\'t benefit from combinator caching\n\t\t\tif ( xml ) {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\tif ( matcher( elem, context, xml ) ) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile ( ( elem = elem[ dir ] ) ) {\n\t\t\t\t\tif ( elem.nodeType === 1 || checkNonElements ) {\n\t\t\t\t\t\touterCache = elem[ expando ] || ( elem[ expando ] = {} );\n\n\t\t\t\t\t\t// Support: IE <9 only\n\t\t\t\t\t\t// Defend against cloned attroperties (jQuery gh-1709)\n\t\t\t\t\t\tuniqueCache = outerCache[ elem.uniqueID ] ||\n\t\t\t\t\t\t\t( outerCache[ elem.uniqueID ] = {} );\n\n\t\t\t\t\t\tif ( skip && skip === elem.nodeName.toLowerCase() ) {\n\t\t\t\t\t\t\telem = elem[ dir ] || elem;\n\t\t\t\t\t\t} else if ( ( oldCache = uniqueCache[ key ] ) &&\n\t\t\t\t\t\t\toldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\n\n\t\t\t\t\t\t\t// Assign to newCache so results back-propagate to previous elements\n\t\t\t\t\t\t\treturn ( newCache[ 2 ] = oldCache[ 2 ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Reuse newcache so results back-propagate to previous elements\n\t\t\t\t\t\t\tuniqueCache[ key ] = newCache;\n\n\t\t\t\t\t\t\t// A match means we\'re done; a fail means we have to keep checking\n\t\t\t\t\t\t\tif ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\n\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n}\n\nfunction elementMatcher( matchers ) {\n\treturn matchers.length > 1 ?\n\t\tfunction( elem, context, xml ) {\n\t\t\tvar i = matchers.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( !matchers[ i ]( elem, context, xml ) ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} :\n\t\tmatchers[ 0 ];\n}\n\nfunction multipleContexts( selector, contexts, results ) {\n\tvar i = 0,\n\t\tlen = contexts.length;\n\tfor ( ; i < len; i++ ) {\n\t\tSizzle( selector, contexts[ i ], results );\n\t}\n\treturn results;\n}\n\nfunction condense( unmatched, map, filter, context, xml ) {\n\tvar elem,\n\t\tnewUnmatched = [],\n\t\ti = 0,\n\t\tlen = unmatched.length,\n\t\tmapped = map != null;\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( elem = unmatched[ i ] ) ) {\n\t\t\tif ( !filter || filter( elem, context, xml ) ) {\n\t\t\t\tnewUnmatched.push( elem );\n\t\t\t\tif ( mapped ) {\n\t\t\t\t\tmap.push( i );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn newUnmatched;\n}\n\nfunction setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\n\tif ( postFilter && !postFilter[ expando ] ) {\n\t\tpostFilter = setMatcher( postFilter );\n\t}\n\tif ( postFinder && !postFinder[ expando ] ) {\n\t\tpostFinder = setMatcher( postFinder, postSelector );\n\t}\n\treturn markFunction( function( seed, results, context, xml ) {\n\t\tvar temp, i, elem,\n\t\t\tpreMap = [],\n\t\t\tpostMap = [],\n\t\t\tpreexisting = results.length,\n\n\t\t\t// Get initial elements from seed or context\n\t\t\telems = seed || multipleContexts(\n\t\t\t\tselector || "*",\n\t\t\t\tcontext.nodeType ? [ context ] : context,\n\t\t\t\t[]\n\t\t\t),\n\n\t\t\t// Prefilter to get matcher input, preserving a map for seed-results synchronization\n\t\t\tmatcherIn = preFilter && ( seed || !selector ) ?\n\t\t\t\tcondense( elems, preMap, preFilter, context, xml ) :\n\t\t\t\telems,\n\n\t\t\tmatcherOut = matcher ?\n\n\t\t\t\t// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\n\t\t\t\tpostFinder || ( seed ? preFilter : preexisting || postFilter ) ?\n\n\t\t\t\t\t// ...intermediate processing is necessary\n\t\t\t\t\t[] :\n\n\t\t\t\t\t// ...otherwise use results directly\n\t\t\t\t\tresults :\n\t\t\t\tmatcherIn;\n\n\t\t// Find primary matches\n\t\tif ( matcher ) {\n\t\t\tmatcher( matcherIn, matcherOut, context, xml );\n\t\t}\n\n\t\t// Apply postFilter\n\t\tif ( postFilter ) {\n\t\t\ttemp = condense( matcherOut, postMap );\n\t\t\tpostFilter( temp, [], context, xml );\n\n\t\t\t// Un-match failing elements by moving them back to matcherIn\n\t\t\ti = temp.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\tif ( ( elem = temp[ i ] ) ) {\n\t\t\t\t\tmatcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( seed ) {\n\t\t\tif ( postFinder || preFilter ) {\n\t\t\t\tif ( postFinder ) {\n\n\t\t\t\t\t// Get the final matcherOut by condensing this intermediate into postFinder contexts\n\t\t\t\t\ttemp = [];\n\t\t\t\t\ti = matcherOut.length;\n\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) ) {\n\n\t\t\t\t\t\t\t// Restore matcherIn since elem is not yet a final match\n\t\t\t\t\t\t\ttemp.push( ( matcherIn[ i ] = elem ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tpostFinder( null, ( matcherOut = [] ), temp, xml );\n\t\t\t\t}\n\n\t\t\t\t// Move matched elements from seed to results to keep them synchronized\n\t\t\t\ti = matcherOut.length;\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\tif ( ( elem = matcherOut[ i ] ) &&\n\t\t\t\t\t\t( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\n\n\t\t\t\t\t\tseed[ temp ] = !( results[ temp ] = elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Add elements to results, through postFinder if defined\n\t\t} else {\n\t\t\tmatcherOut = condense(\n\t\t\t\tmatcherOut === results ?\n\t\t\t\t\tmatcherOut.splice( preexisting, matcherOut.length ) :\n\t\t\t\t\tmatcherOut\n\t\t\t);\n\t\t\tif ( postFinder ) {\n\t\t\t\tpostFinder( null, results, matcherOut, xml );\n\t\t\t} else {\n\t\t\t\tpush.apply( results, matcherOut );\n\t\t\t}\n\t\t}\n\t} );\n}\n\nfunction matcherFromTokens( tokens ) {\n\tvar checkContext, matcher, j,\n\t\tlen = tokens.length,\n\t\tleadingRelative = Expr.relative[ tokens[ 0 ].type ],\n\t\timplicitRelative = leadingRelative || Expr.relative[ " " ],\n\t\ti = leadingRelative ? 1 : 0,\n\n\t\t// The foundational matcher ensures that elements are reachable from top-level context(s)\n\t\tmatchContext = addCombinator( function( elem ) {\n\t\t\treturn elem === checkContext;\n\t\t}, implicitRelative, true ),\n\t\tmatchAnyContext = addCombinator( function( elem ) {\n\t\t\treturn indexOf( checkContext, elem ) > -1;\n\t\t}, implicitRelative, true ),\n\t\tmatchers = [ function( elem, context, xml ) {\n\t\t\tvar ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\n\t\t\t\t( checkContext = context ).nodeType ?\n\t\t\t\t\tmatchContext( elem, context, xml ) :\n\t\t\t\t\tmatchAnyContext( elem, context, xml ) );\n\n\t\t\t// Avoid hanging onto element (issue #299)\n\t\t\tcheckContext = null;\n\t\t\treturn ret;\n\t\t} ];\n\n\tfor ( ; i < len; i++ ) {\n\t\tif ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\n\t\t\tmatchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\n\t\t} else {\n\t\t\tmatcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\n\n\t\t\t// Return special upon seeing a positional matcher\n\t\t\tif ( matcher[ expando ] ) {\n\n\t\t\t\t// Find the next relative operator (if any) for proper handling\n\t\t\t\tj = ++i;\n\t\t\t\tfor ( ; j < len; j++ ) {\n\t\t\t\t\tif ( Expr.relative[ tokens[ j ].type ] ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn setMatcher(\n\t\t\t\t\ti > 1 && elementMatcher( matchers ),\n\t\t\t\t\ti > 1 && toSelector(\n\n\t\t\t\t\t// If the preceding token was a descendant combinator, insert an implicit any-element `*`\n\t\t\t\t\ttokens\n\t\t\t\t\t\t.slice( 0, i - 1 )\n\t\t\t\t\t\t.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )\n\t\t\t\t\t).replace( rtrim, "$1" ),\n\t\t\t\t\tmatcher,\n\t\t\t\t\ti < j && matcherFromTokens( tokens.slice( i, j ) ),\n\t\t\t\t\tj < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\n\t\t\t\t\tj < len && toSelector( tokens )\n\t\t\t\t);\n\t\t\t}\n\t\t\tmatchers.push( matcher );\n\t\t}\n\t}\n\n\treturn elementMatcher( matchers );\n}\n\nfunction matcherFromGroupMatchers( elementMatchers, setMatchers ) {\n\tvar bySet = setMatchers.length > 0,\n\t\tbyElement = elementMatchers.length > 0,\n\t\tsuperMatcher = function( seed, context, xml, results, outermost ) {\n\t\t\tvar elem, j, matcher,\n\t\t\t\tmatchedCount = 0,\n\t\t\t\ti = "0",\n\t\t\t\tunmatched = seed && [],\n\t\t\t\tsetMatched = [],\n\t\t\t\tcontextBackup = outermostContext,\n\n\t\t\t\t// We must always have either seed elements or outermost context\n\t\t\t\telems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),\n\n\t\t\t\t// Use integer dirruns iff this is the outermost matcher\n\t\t\t\tdirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\n\t\t\t\tlen = elems.length;\n\n\t\t\tif ( outermost ) {\n\n\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\toutermostContext = context == document || context || outermost;\n\t\t\t}\n\n\t\t\t// Add elements passing elementMatchers directly to results\n\t\t\t// Support: IE<9, Safari\n\t\t\t// Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id\n\t\t\tfor ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\n\t\t\t\tif ( byElement && elem ) {\n\t\t\t\t\tj = 0;\n\n\t\t\t\t\t// Support: IE 11+, Edge 17 - 18+\n\t\t\t\t\t// IE/Edge sometimes throw a "Permission denied" error when strict-comparing\n\t\t\t\t\t// two documents; shallow comparisons work.\n\t\t\t\t\t// eslint-disable-next-line eqeqeq\n\t\t\t\t\tif ( !context && elem.ownerDocument != document ) {\n\t\t\t\t\t\tsetDocument( elem );\n\t\t\t\t\t\txml = !documentIsHTML;\n\t\t\t\t\t}\n\t\t\t\t\twhile ( ( matcher = elementMatchers[ j++ ] ) ) {\n\t\t\t\t\t\tif ( matcher( elem, context || document, xml ) ) {\n\t\t\t\t\t\t\tresults.push( elem );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( outermost ) {\n\t\t\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Track unmatched elements for set filters\n\t\t\t\tif ( bySet ) {\n\n\t\t\t\t\t// They will have gone through all possible matchers\n\t\t\t\t\tif ( ( elem = !matcher && elem ) ) {\n\t\t\t\t\t\tmatchedCount--;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Lengthen the array for every element, matched or not\n\t\t\t\t\tif ( seed ) {\n\t\t\t\t\t\tunmatched.push( elem );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// `i` is now the count of elements visited above, and adding it to `matchedCount`\n\t\t\t// makes the latter nonnegative.\n\t\t\tmatchedCount += i;\n\n\t\t\t// Apply set filters to unmatched elements\n\t\t\t// NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\n\t\t\t// equals `i`), unless we didn\'t visit _any_ elements in the above loop because we have\n\t\t\t// no element matchers and no seed.\n\t\t\t// Incrementing an initially-string "0" `i` allows `i` to remain a string only in that\n\t\t\t// case, which will result in a "00" `matchedCount` that differs from `i` but is also\n\t\t\t// numerically zero.\n\t\t\tif ( bySet && i !== matchedCount ) {\n\t\t\t\tj = 0;\n\t\t\t\twhile ( ( matcher = setMatchers[ j++ ] ) ) {\n\t\t\t\t\tmatcher( unmatched, setMatched, context, xml );\n\t\t\t\t}\n\n\t\t\t\tif ( seed ) {\n\n\t\t\t\t\t// Reintegrate element matches to eliminate the need for sorting\n\t\t\t\t\tif ( matchedCount > 0 ) {\n\t\t\t\t\t\twhile ( i-- ) {\n\t\t\t\t\t\t\tif ( !( unmatched[ i ] || setMatched[ i ] ) ) {\n\t\t\t\t\t\t\t\tsetMatched[ i ] = pop.call( results );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Discard index placeholder values to get only actual matches\n\t\t\t\t\tsetMatched = condense( setMatched );\n\t\t\t\t}\n\n\t\t\t\t// Add matches to results\n\t\t\t\tpush.apply( results, setMatched );\n\n\t\t\t\t// Seedless set matches succeeding multiple successful matchers stipulate sorting\n\t\t\t\tif ( outermost && !seed && setMatched.length > 0 &&\n\t\t\t\t\t( matchedCount + setMatchers.length ) > 1 ) {\n\n\t\t\t\t\tSizzle.uniqueSort( results );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Override manipulation of globals by nested matchers\n\t\t\tif ( outermost ) {\n\t\t\t\tdirruns = dirrunsUnique;\n\t\t\t\toutermostContext = contextBackup;\n\t\t\t}\n\n\t\t\treturn unmatched;\n\t\t};\n\n\treturn bySet ?\n\t\tmarkFunction( superMatcher ) :\n\t\tsuperMatcher;\n}\n\ncompile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\n\tvar i,\n\t\tsetMatchers = [],\n\t\telementMatchers = [],\n\t\tcached = compilerCache[ selector + " " ];\n\n\tif ( !cached ) {\n\n\t\t// Generate a function of recursive functions that can be used to check each element\n\t\tif ( !match ) {\n\t\t\tmatch = tokenize( selector );\n\t\t}\n\t\ti = match.length;\n\t\twhile ( i-- ) {\n\t\t\tcached = matcherFromTokens( match[ i ] );\n\t\t\tif ( cached[ expando ] ) {\n\t\t\t\tsetMatchers.push( cached );\n\t\t\t} else {\n\t\t\t\telementMatchers.push( cached );\n\t\t\t}\n\t\t}\n\n\t\t// Cache the compiled function\n\t\tcached = compilerCache(\n\t\t\tselector,\n\t\t\tmatcherFromGroupMatchers( elementMatchers, setMatchers )\n\t\t);\n\n\t\t// Save selector and tokenization\n\t\tcached.selector = selector;\n\t}\n\treturn cached;\n};\n\n/**\n * A low-level selection function that works with Sizzle\'s compiled\n * selector functions\n * @param {String|Function} selector A selector or a pre-compiled\n * selector function built with Sizzle.compile\n * @param {Element} context\n * @param {Array} [results]\n * @param {Array} [seed] A set of elements to match against\n */\nselect = Sizzle.select = function( selector, context, results, seed ) {\n\tvar i, tokens, token, type, find,\n\t\tcompiled = typeof selector === "function" && selector,\n\t\tmatch = !seed && tokenize( ( selector = compiled.selector || selector ) );\n\n\tresults = results || [];\n\n\t// Try to minimize operations if there is only one selector in the list and no seed\n\t// (the latter of which guarantees us context)\n\tif ( match.length === 1 ) {\n\n\t\t// Reduce context if the leading compound selector is an ID\n\t\ttokens = match[ 0 ] = match[ 0 ].slice( 0 );\n\t\tif ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&\n\t\t\tcontext.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\n\n\t\t\tcontext = ( Expr.find[ "ID" ]( token.matches[ 0 ]\n\t\t\t\t.replace( runescape, funescape ), context ) || [] )[ 0 ];\n\t\t\tif ( !context ) {\n\t\t\t\treturn results;\n\n\t\t\t// Precompiled matchers will still verify ancestry, so step up a level\n\t\t\t} else if ( compiled ) {\n\t\t\t\tcontext = context.parentNode;\n\t\t\t}\n\n\t\t\tselector = selector.slice( tokens.shift().value.length );\n\t\t}\n\n\t\t// Fetch a seed set for right-to-left matching\n\t\ti = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;\n\t\twhile ( i-- ) {\n\t\t\ttoken = tokens[ i ];\n\n\t\t\t// Abort if we hit a combinator\n\t\t\tif ( Expr.relative[ ( type = token.type ) ] ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( ( find = Expr.find[ type ] ) ) {\n\n\t\t\t\t// Search, expanding context for leading sibling combinators\n\t\t\t\tif ( ( seed = find(\n\t\t\t\t\ttoken.matches[ 0 ].replace( runescape, funescape ),\n\t\t\t\t\trsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\n\t\t\t\t\t\tcontext\n\t\t\t\t) ) ) {\n\n\t\t\t\t\t// If seed is empty or no tokens remain, we can return early\n\t\t\t\t\ttokens.splice( i, 1 );\n\t\t\t\t\tselector = seed.length && toSelector( tokens );\n\t\t\t\t\tif ( !selector ) {\n\t\t\t\t\t\tpush.apply( results, seed );\n\t\t\t\t\t\treturn results;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Compile and execute a filtering function if one is not provided\n\t// Provide `match` to avoid retokenization if we modified the selector above\n\t( compiled || compile( selector, match ) )(\n\t\tseed,\n\t\tcontext,\n\t\t!documentIsHTML,\n\t\tresults,\n\t\t!context || rsibling.test( selector ) && testContext( context.parentNode ) || context\n\t);\n\treturn results;\n};\n\n// One-time assignments\n\n// Sort stability\nsupport.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;\n\n// Support: Chrome 14-35+\n// Always assume duplicates if they aren\'t passed to the comparison function\nsupport.detectDuplicates = !!hasDuplicate;\n\n// Initialize against the default document\nsetDocument();\n\n// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\n// Detached nodes confoundingly follow *each other*\nsupport.sortDetached = assert( function( el ) {\n\n\t// Should return 1, but returns 4 (following)\n\treturn el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;\n} );\n\n// Support: IE<8\n// Prevent attribute/property "interpolation"\n// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\nif ( !assert( function( el ) {\n\tel.innerHTML = "<a href=\'#\'></a>";\n\treturn el.firstChild.getAttribute( "href" ) === "#";\n} ) ) {\n\taddHandle( "type|href|height|width", function( elem, name, isXML ) {\n\t\tif ( !isXML ) {\n\t\t\treturn elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use defaultValue in place of getAttribute("value")\nif ( !support.attributes || !assert( function( el ) {\n\tel.innerHTML = "<input/>";\n\tel.firstChild.setAttribute( "value", "" );\n\treturn el.firstChild.getAttribute( "value" ) === "";\n} ) ) {\n\taddHandle( "value", function( elem, _name, isXML ) {\n\t\tif ( !isXML && elem.nodeName.toLowerCase() === "input" ) {\n\t\t\treturn elem.defaultValue;\n\t\t}\n\t} );\n}\n\n// Support: IE<9\n// Use getAttributeNode to fetch booleans when getAttribute lies\nif ( !assert( function( el ) {\n\treturn el.getAttribute( "disabled" ) == null;\n} ) ) {\n\taddHandle( booleans, function( elem, name, isXML ) {\n\t\tvar val;\n\t\tif ( !isXML ) {\n\t\t\treturn elem[ name ] === true ? name.toLowerCase() :\n\t\t\t\t( val = elem.getAttributeNode( name ) ) && val.specified ?\n\t\t\t\t\tval.value :\n\t\t\t\t\tnull;\n\t\t}\n\t} );\n}\n\nreturn Sizzle;\n\n} )( window );\n\n\n\njQuery.find = Sizzle;\njQuery.expr = Sizzle.selectors;\n\n// Deprecated\njQuery.expr[ ":" ] = jQuery.expr.pseudos;\njQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\njQuery.text = Sizzle.getText;\njQuery.isXMLDoc = Sizzle.isXML;\njQuery.contains = Sizzle.contains;\njQuery.escapeSelector = Sizzle.escape;\n\n\n\n\nvar dir = function( elem, dir, until ) {\n\tvar matched = [],\n\t\ttruncate = until !== undefined;\n\n\twhile ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\n\t\tif ( elem.nodeType === 1 ) {\n\t\t\tif ( truncate && jQuery( elem ).is( until ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tmatched.push( elem );\n\t\t}\n\t}\n\treturn matched;\n};\n\n\nvar siblings = function( n, elem ) {\n\tvar matched = [];\n\n\tfor ( ; n; n = n.nextSibling ) {\n\t\tif ( n.nodeType === 1 && n !== elem ) {\n\t\t\tmatched.push( n );\n\t\t}\n\t}\n\n\treturn matched;\n};\n\n\nvar rneedsContext = jQuery.expr.match.needsContext;\n\n\n\nfunction nodeName( elem, name ) {\n\n\treturn elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\n\n}\nvar rsingleTag = ( /^<([a-z][^\\/\\0>:\\x20\\t\\r\\n\\f]*)[\\x20\\t\\r\\n\\f]*\\/?>(?:<\\/\\1>|)$/i );\n\n\n\n// Implement the identical functionality for filter and not\nfunction winnow( elements, qualifier, not ) {\n\tif ( isFunction( qualifier ) ) {\n\t\treturn jQuery.grep( elements, function( elem, i ) {\n\t\t\treturn !!qualifier.call( elem, i, elem ) !== not;\n\t\t} );\n\t}\n\n\t// Single element\n\tif ( qualifier.nodeType ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( elem === qualifier ) !== not;\n\t\t} );\n\t}\n\n\t// Arraylike of elements (jQuery, arguments, Array)\n\tif ( typeof qualifier !== "string" ) {\n\t\treturn jQuery.grep( elements, function( elem ) {\n\t\t\treturn ( indexOf.call( qualifier, elem ) > -1 ) !== not;\n\t\t} );\n\t}\n\n\t// Filtered directly for both simple and complex selectors\n\treturn jQuery.filter( qualifier, elements, not );\n}\n\njQuery.filter = function( expr, elems, not ) {\n\tvar elem = elems[ 0 ];\n\n\tif ( not ) {\n\t\texpr = ":not(" + expr + ")";\n\t}\n\n\tif ( elems.length === 1 && elem.nodeType === 1 ) {\n\t\treturn jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\n\t}\n\n\treturn jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\n\t\treturn elem.nodeType === 1;\n\t} ) );\n};\n\njQuery.fn.extend( {\n\tfind: function( selector ) {\n\t\tvar i, ret,\n\t\t\tlen = this.length,\n\t\t\tself = this;\n\n\t\tif ( typeof selector !== "string" ) {\n\t\t\treturn this.pushStack( jQuery( selector ).filter( function() {\n\t\t\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\t\t\tif ( jQuery.contains( self[ i ], this ) ) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} ) );\n\t\t}\n\n\t\tret = this.pushStack( [] );\n\n\t\tfor ( i = 0; i < len; i++ ) {\n\t\t\tjQuery.find( selector, self[ i ], ret );\n\t\t}\n\n\t\treturn len > 1 ? jQuery.uniqueSort( ret ) : ret;\n\t},\n\tfilter: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], false ) );\n\t},\n\tnot: function( selector ) {\n\t\treturn this.pushStack( winnow( this, selector || [], true ) );\n\t},\n\tis: function( selector ) {\n\t\treturn !!winnow(\n\t\t\tthis,\n\n\t\t\t// If this is a positional/relative selector, check membership in the returned set\n\t\t\t// so $("p:first").is("p:last") won\'t return true for a doc with two "p".\n\t\t\ttypeof selector === "string" && rneedsContext.test( selector ) ?\n\t\t\t\tjQuery( selector ) :\n\t\t\t\tselector || [],\n\t\t\tfalse\n\t\t).length;\n\t}\n} );\n\n\n// Initialize a jQuery object\n\n\n// A central reference to the root jQuery(document)\nvar rootjQuery,\n\n\t// A simple way to check for HTML strings\n\t// Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521)\n\t// Strict HTML recognition (trac-11290: must start with <)\n\t// Shortcut simple #id case for speed\n\trquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]+))$/,\n\n\tinit = jQuery.fn.init = function( selector, context, root ) {\n\t\tvar match, elem;\n\n\t\t// HANDLE: $(""), $(null), $(undefined), $(false)\n\t\tif ( !selector ) {\n\t\t\treturn this;\n\t\t}\n\n\t\t// Method init() accepts an alternate rootjQuery\n\t\t// so migrate can support jQuery.sub (gh-2101)\n\t\troot = root || rootjQuery;\n\n\t\t// Handle HTML strings\n\t\tif ( typeof selector === "string" ) {\n\t\t\tif ( selector[ 0 ] === "<" &&\n\t\t\t\tselector[ selector.length - 1 ] === ">" &&\n\t\t\t\tselector.length >= 3 ) {\n\n\t\t\t\t// Assume that strings that start and end with <> are HTML and skip the regex check\n\t\t\t\tmatch = [ null, selector, null ];\n\n\t\t\t} else {\n\t\t\t\tmatch = rquickExpr.exec( selector );\n\t\t\t}\n\n\t\t\t// Match html or make sure no context is specified for #id\n\t\t\tif ( match && ( match[ 1 ] || !context ) ) {\n\n\t\t\t\t// HANDLE: $(html) -> $(array)\n\t\t\t\tif ( match[ 1 ] ) {\n\t\t\t\t\tcontext = context instanceof jQuery ? context[ 0 ] : context;\n\n\t\t\t\t\t// Option to run scripts is true for back-compat\n\t\t\t\t\t// Intentionally let the error be thrown if parseHTML is not present\n\t\t\t\t\tjQuery.merge( this, jQuery.parseHTML(\n\t\t\t\t\t\tmatch[ 1 ],\n\t\t\t\t\t\tcontext && context.nodeType ? context.ownerDocument || context : document,\n\t\t\t\t\t\ttrue\n\t\t\t\t\t) );\n\n\t\t\t\t\t// HANDLE: $(html, props)\n\t\t\t\t\tif ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\n\t\t\t\t\t\tfor ( match in context ) {\n\n\t\t\t\t\t\t\t// Properties of context are called as methods if possible\n\t\t\t\t\t\t\tif ( isFunction( this[ match ] ) ) {\n\t\t\t\t\t\t\t\tthis[ match ]( context[ match ] );\n\n\t\t\t\t\t\t\t// ...and otherwise set as attributes\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthis.attr( match, context[ match ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this;\n\n\t\t\t\t// HANDLE: $(#id)\n\t\t\t\t} else {\n\t\t\t\t\telem = document.getElementById( match[ 2 ] );\n\n\t\t\t\t\tif ( elem ) {\n\n\t\t\t\t\t\t// Inject the element directly into the jQuery object\n\t\t\t\t\t\tthis[ 0 ] = elem;\n\t\t\t\t\t\tthis.length = 1;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\n\t\t\t// HANDLE: $(expr, $(...))\n\t\t\t} else if ( !context || context.jquery ) {\n\t\t\t\treturn ( context || root ).find( selector );\n\n\t\t\t// HANDLE: $(expr, context)\n\t\t\t// (which is just equivalent to: $(context).find(expr)\n\t\t\t} else {\n\t\t\t\treturn this.constructor( context ).find( selector );\n\t\t\t}\n\n\t\t// HANDLE: $(DOMElement)\n\t\t} else if ( selector.nodeType ) {\n\t\t\tthis[ 0 ] = selector;\n\t\t\tthis.length = 1;\n\t\t\treturn this;\n\n\t\t// HANDLE: $(function)\n\t\t// Shortcut for document ready\n\t\t} else if ( isFunction( selector ) ) {\n\t\t\treturn root.ready !== undefined ?\n\t\t\t\troot.ready( selector ) :\n\n\t\t\t\t// Execute immediately if ready is not present\n\t\t\t\tselector( jQuery );\n\t\t}\n\n\t\treturn jQuery.makeArray( selector, this );\n\t};\n\n// Give the init function the jQuery prototype for later instantiation\ninit.prototype = jQuery.fn;\n\n// Initialize central reference\nrootjQuery = jQuery( document );\n\n\nvar rparentsprev = /^(?:parents|prev(?:Until|All))/,\n\n\t// Methods guaranteed to produce a unique set when starting from a unique set\n\tguaranteedUnique = {\n\t\tchildren: true,\n\t\tcontents: true,\n\t\tnext: true,\n\t\tprev: true\n\t};\n\njQuery.fn.extend( {\n\thas: function( target ) {\n\t\tvar targets = jQuery( target, this ),\n\t\t\tl = targets.length;\n\n\t\treturn this.filter( function() {\n\t\t\tvar i = 0;\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tif ( jQuery.contains( this, targets[ i ] ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\tclosest: function( selectors, context ) {\n\t\tvar cur,\n\t\t\ti = 0,\n\t\t\tl = this.length,\n\t\t\tmatched = [],\n\t\t\ttargets = typeof selectors !== "string" && jQuery( selectors );\n\n\t\t// Positional selectors never match, since there\'s no _selection_ context\n\t\tif ( !rneedsContext.test( selectors ) ) {\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tfor ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\n\n\t\t\t\t\t// Always skip document fragments\n\t\t\t\t\tif ( cur.nodeType < 11 && ( targets ?\n\t\t\t\t\t\ttargets.index( cur ) > -1 :\n\n\t\t\t\t\t\t// Don\'t pass non-elements to Sizzle\n\t\t\t\t\t\tcur.nodeType === 1 &&\n\t\t\t\t\t\t\tjQuery.find.matchesSelector( cur, selectors ) ) ) {\n\n\t\t\t\t\t\tmatched.push( cur );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\n\t},\n\n\t// Determine the position of an element within the set\n\tindex: function( elem ) {\n\n\t\t// No argument, return index in parent\n\t\tif ( !elem ) {\n\t\t\treturn ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\n\t\t}\n\n\t\t// Index in selector\n\t\tif ( typeof elem === "string" ) {\n\t\t\treturn indexOf.call( jQuery( elem ), this[ 0 ] );\n\t\t}\n\n\t\t// Locate the position of the desired element\n\t\treturn indexOf.call( this,\n\n\t\t\t// If it receives a jQuery object, the first element is used\n\t\t\telem.jquery ? elem[ 0 ] : elem\n\t\t);\n\t},\n\n\tadd: function( selector, context ) {\n\t\treturn this.pushStack(\n\t\t\tjQuery.uniqueSort(\n\t\t\t\tjQuery.merge( this.get(), jQuery( selector, context ) )\n\t\t\t)\n\t\t);\n\t},\n\n\taddBack: function( selector ) {\n\t\treturn this.add( selector == null ?\n\t\t\tthis.prevObject : this.prevObject.filter( selector )\n\t\t);\n\t}\n} );\n\nfunction sibling( cur, dir ) {\n\twhile ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\n\treturn cur;\n}\n\njQuery.each( {\n\tparent: function( elem ) {\n\t\tvar parent = elem.parentNode;\n\t\treturn parent && parent.nodeType !== 11 ? parent : null;\n\t},\n\tparents: function( elem ) {\n\t\treturn dir( elem, "parentNode" );\n\t},\n\tparentsUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, "parentNode", until );\n\t},\n\tnext: function( elem ) {\n\t\treturn sibling( elem, "nextSibling" );\n\t},\n\tprev: function( elem ) {\n\t\treturn sibling( elem, "previousSibling" );\n\t},\n\tnextAll: function( elem ) {\n\t\treturn dir( elem, "nextSibling" );\n\t},\n\tprevAll: function( elem ) {\n\t\treturn dir( elem, "previousSibling" );\n\t},\n\tnextUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, "nextSibling", until );\n\t},\n\tprevUntil: function( elem, _i, until ) {\n\t\treturn dir( elem, "previousSibling", until );\n\t},\n\tsiblings: function( elem ) {\n\t\treturn siblings( ( elem.parentNode || {} ).firstChild, elem );\n\t},\n\tchildren: function( elem ) {\n\t\treturn siblings( elem.firstChild );\n\t},\n\tcontents: function( elem ) {\n\t\tif ( elem.contentDocument != null &&\n\n\t\t\t// Support: IE 11+\n\t\t\t// <object> elements with no `data` attribute has an object\n\t\t\t// `contentDocument` with a `null` prototype.\n\t\t\tgetProto( elem.contentDocument ) ) {\n\n\t\t\treturn elem.contentDocument;\n\t\t}\n\n\t\t// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\n\t\t// Treat the template element as a regular one in browsers that\n\t\t// don\'t support it.\n\t\tif ( nodeName( elem, "template" ) ) {\n\t\t\telem = elem.content || elem;\n\t\t}\n\n\t\treturn jQuery.merge( [], elem.childNodes );\n\t}\n}, function( name, fn ) {\n\tjQuery.fn[ name ] = function( until, selector ) {\n\t\tvar matched = jQuery.map( this, fn, until );\n\n\t\tif ( name.slice( -5 ) !== "Until" ) {\n\t\t\tselector = until;\n\t\t}\n\n\t\tif ( selector && typeof selector === "string" ) {\n\t\t\tmatched = jQuery.filter( selector, matched );\n\t\t}\n\n\t\tif ( this.length > 1 ) {\n\n\t\t\t// Remove duplicates\n\t\t\tif ( !guaranteedUnique[ name ] ) {\n\t\t\t\tjQuery.uniqueSort( matched );\n\t\t\t}\n\n\t\t\t// Reverse order for parents* and prev-derivatives\n\t\t\tif ( rparentsprev.test( name ) ) {\n\t\t\t\tmatched.reverse();\n\t\t\t}\n\t\t}\n\n\t\treturn this.pushStack( matched );\n\t};\n} );\nvar rnothtmlwhite = ( /[^\\x20\\t\\r\\n\\f]+/g );\n\n\n\n// Convert String-formatted options into Object-formatted ones\nfunction createOptions( options ) {\n\tvar object = {};\n\tjQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t} );\n\treturn object;\n}\n\n/*\n * Create a callback list using the following parameters:\n *\n *\toptions: an optional list of space-separated options that will change how\n *\t\t\tthe callback list behaves or a more traditional option object\n *\n * By default a callback list will act like an event callback list and can be\n * "fired" multiple times.\n *\n * Possible options:\n *\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\n *\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\n *\t\t\t\t\tafter the list has been fired right away with the latest "memorized"\n *\t\t\t\t\tvalues (like a Deferred)\n *\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\n *\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\n *\n */\njQuery.Callbacks = function( options ) {\n\n\t// Convert options from String-formatted to Object-formatted if needed\n\t// (we check in cache first)\n\toptions = typeof options === "string" ?\n\t\tcreateOptions( options ) :\n\t\tjQuery.extend( {}, options );\n\n\tvar // Flag to know if list is currently firing\n\t\tfiring,\n\n\t\t// Last fire value for non-forgettable lists\n\t\tmemory,\n\n\t\t// Flag to know if list was already fired\n\t\tfired,\n\n\t\t// Flag to prevent firing\n\t\tlocked,\n\n\t\t// Actual callback list\n\t\tlist = [],\n\n\t\t// Queue of execution data for repeatable lists\n\t\tqueue = [],\n\n\t\t// Index of currently firing callback (modified by add/remove as needed)\n\t\tfiringIndex = -1,\n\n\t\t// Fire callbacks\n\t\tfire = function() {\n\n\t\t\t// Enforce single-firing\n\t\t\tlocked = locked || options.once;\n\n\t\t\t// Execute callbacks for all pending executions,\n\t\t\t// respecting firingIndex overrides and runtime changes\n\t\t\tfired = firing = true;\n\t\t\tfor ( ; queue.length; firingIndex = -1 ) {\n\t\t\t\tmemory = queue.shift();\n\t\t\t\twhile ( ++firingIndex < list.length ) {\n\n\t\t\t\t\t// Run callback and check for early termination\n\t\t\t\t\tif ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\n\t\t\t\t\t\toptions.stopOnFalse ) {\n\n\t\t\t\t\t\t// Jump to end and forget the data so .add doesn\'t re-fire\n\t\t\t\t\t\tfiringIndex = list.length;\n\t\t\t\t\t\tmemory = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Forget the data if we\'re done with it\n\t\t\tif ( !options.memory ) {\n\t\t\t\tmemory = false;\n\t\t\t}\n\n\t\t\tfiring = false;\n\n\t\t\t// Clean up if we\'re done firing for good\n\t\t\tif ( locked ) {\n\n\t\t\t\t// Keep an empty list if we have data for future add calls\n\t\t\t\tif ( memory ) {\n\t\t\t\t\tlist = [];\n\n\t\t\t\t// Otherwise, this object is spent\n\t\t\t\t} else {\n\t\t\t\t\tlist = "";\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t// Actual Callbacks object\n\t\tself = {\n\n\t\t\t// Add a callback or a collection of callbacks to the list\n\t\t\tadd: function() {\n\t\t\t\tif ( list ) {\n\n\t\t\t\t\t// If we have memory from a past run, we should fire after adding\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfiringIndex = list.length - 1;\n\t\t\t\t\t\tqueue.push( memory );\n\t\t\t\t\t}\n\n\t\t\t\t\t( function add( args ) {\n\t\t\t\t\t\tjQuery.each( args, function( _, arg ) {\n\t\t\t\t\t\t\tif ( isFunction( arg ) ) {\n\t\t\t\t\t\t\t\tif ( !options.unique || !self.has( arg ) ) {\n\t\t\t\t\t\t\t\t\tlist.push( arg );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if ( arg && arg.length && toType( arg ) !== "string" ) {\n\n\t\t\t\t\t\t\t\t// Inspect recursively\n\t\t\t\t\t\t\t\tadd( arg );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )( arguments );\n\n\t\t\t\t\tif ( memory && !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Remove a callback from the list\n\t\t\tremove: function() {\n\t\t\t\tjQuery.each( arguments, function( _, arg ) {\n\t\t\t\t\tvar index;\n\t\t\t\t\twhile ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\n\t\t\t\t\t\tlist.splice( index, 1 );\n\n\t\t\t\t\t\t// Handle firing indexes\n\t\t\t\t\t\tif ( index <= firingIndex ) {\n\t\t\t\t\t\t\tfiringIndex--;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Check if a given callback is in the list.\n\t\t\t// If no argument is given, return whether or not list has callbacks attached.\n\t\t\thas: function( fn ) {\n\t\t\t\treturn fn ?\n\t\t\t\t\tjQuery.inArray( fn, list ) > -1 :\n\t\t\t\t\tlist.length > 0;\n\t\t\t},\n\n\t\t\t// Remove all callbacks from the list\n\t\t\tempty: function() {\n\t\t\t\tif ( list ) {\n\t\t\t\t\tlist = [];\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Disable .fire and .add\n\t\t\t// Abort any current/pending executions\n\t\t\t// Clear all callbacks and values\n\t\t\tdisable: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tlist = memory = "";\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tdisabled: function() {\n\t\t\t\treturn !list;\n\t\t\t},\n\n\t\t\t// Disable .fire\n\t\t\t// Also disable .add unless we have memory (since it would have no effect)\n\t\t\t// Abort any pending executions\n\t\t\tlock: function() {\n\t\t\t\tlocked = queue = [];\n\t\t\t\tif ( !memory && !firing ) {\n\t\t\t\t\tlist = memory = "";\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\t\t\tlocked: function() {\n\t\t\t\treturn !!locked;\n\t\t\t},\n\n\t\t\t// Call all callbacks with the given context and arguments\n\t\t\tfireWith: function( context, args ) {\n\t\t\t\tif ( !locked ) {\n\t\t\t\t\targs = args || [];\n\t\t\t\t\targs = [ context, args.slice ? args.slice() : args ];\n\t\t\t\t\tqueue.push( args );\n\t\t\t\t\tif ( !firing ) {\n\t\t\t\t\t\tfire();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// Call all the callbacks with the given arguments\n\t\t\tfire: function() {\n\t\t\t\tself.fireWith( this, arguments );\n\t\t\t\treturn this;\n\t\t\t},\n\n\t\t\t// To know if the callbacks have already been called at least once\n\t\t\tfired: function() {\n\t\t\t\treturn !!fired;\n\t\t\t}\n\t\t};\n\n\treturn self;\n};\n\n\nfunction Identity( v ) {\n\treturn v;\n}\nfunction Thrower( ex ) {\n\tthrow ex;\n}\n\nfunction adoptValue( value, resolve, reject, noValue ) {\n\tvar method;\n\n\ttry {\n\n\t\t// Check for promise aspect first to privilege synchronous behavior\n\t\tif ( value && isFunction( ( method = value.promise ) ) ) {\n\t\t\tmethod.call( value ).done( resolve ).fail( reject );\n\n\t\t// Other thenables\n\t\t} else if ( value && isFunction( ( method = value.then ) ) ) {\n\t\t\tmethod.call( value, resolve, reject );\n\n\t\t// Other non-thenables\n\t\t} else {\n\n\t\t\t// Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\n\t\t\t// * false: [ value ].slice( 0 ) => resolve( value )\n\t\t\t// * true: [ value ].slice( 1 ) => resolve()\n\t\t\tresolve.apply( undefined, [ value ].slice( noValue ) );\n\t\t}\n\n\t// For Promises/A+, convert exceptions into rejections\n\t// Since jQuery.when doesn\'t unwrap thenables, we can skip the extra checks appearing in\n\t// Deferred#then to conditionally suppress rejection.\n\t} catch ( value ) {\n\n\t\t// Support: Android 4.0 only\n\t\t// Strict mode functions invoked without .call/.apply get global-object context\n\t\treject.apply( undefined, [ value ] );\n\t}\n}\n\njQuery.extend( {\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\n\t\t\t\t// action, add listener, callbacks,\n\t\t\t\t// ... .then handlers, argument index, [final state]\n\t\t\t\t[ "notify", "progress", jQuery.Callbacks( "memory" ),\n\t\t\t\t\tjQuery.Callbacks( "memory" ), 2 ],\n\t\t\t\t[ "resolve", "done", jQuery.Callbacks( "once memory" ),\n\t\t\t\t\tjQuery.Callbacks( "once memory" ), 0, "resolved" ],\n\t\t\t\t[ "reject", "fail", jQuery.Callbacks( "once memory" ),\n\t\t\t\t\tjQuery.Callbacks( "once memory" ), 1, "rejected" ]\n\t\t\t],\n\t\t\tstate = "pending",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\t"catch": function( fn ) {\n\t\t\t\t\treturn promise.then( null, fn );\n\t\t\t\t},\n\n\t\t\t\t// Keep pipe for back-compat\n\t\t\t\tpipe: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( _i, tuple ) {\n\n\t\t\t\t\t\t\t// Map tuples (progress, done, fail) to arguments (done, fail, progress)\n\t\t\t\t\t\t\tvar fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\n\n\t\t\t\t\t\t\t// deferred.progress(function() { bind to newDefer or newDefer.notify })\n\t\t\t\t\t\t\t// deferred.done(function() { bind to newDefer or newDefer.resolve })\n\t\t\t\t\t\t\t// deferred.fail(function() { bind to newDefer or newDefer.reject })\n\t\t\t\t\t\t\tdeferred[ tuple[ 1 ] ]( function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify )\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + "With" ](\n\t\t\t\t\t\t\t\t\t\tthis,\n\t\t\t\t\t\t\t\t\t\tfn ? [ returned ] : arguments\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\t\t\t\tthen: function( onFulfilled, onRejected, onProgress ) {\n\t\t\t\t\tvar maxDepth = 0;\n\t\t\t\t\tfunction resolve( depth, deferred, handler, special ) {\n\t\t\t\t\t\treturn function() {\n\t\t\t\t\t\t\tvar that = this,\n\t\t\t\t\t\t\t\targs = arguments,\n\t\t\t\t\t\t\t\tmightThrow = function() {\n\t\t\t\t\t\t\t\t\tvar returned, then;\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.3\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-59\n\t\t\t\t\t\t\t\t\t// Ignore double-resolution attempts\n\t\t\t\t\t\t\t\t\tif ( depth < maxDepth ) {\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturned = handler.apply( that, args );\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.1\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-48\n\t\t\t\t\t\t\t\t\tif ( returned === deferred.promise() ) {\n\t\t\t\t\t\t\t\t\t\tthrow new TypeError( "Thenable self-resolution" );\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Support: Promises/A+ sections 2.3.3.1, 3.5\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-54\n\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-75\n\t\t\t\t\t\t\t\t\t// Retrieve `then` only once\n\t\t\t\t\t\t\t\t\tthen = returned &&\n\n\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.4\n\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-64\n\t\t\t\t\t\t\t\t\t\t// Only check objects and functions for thenability\n\t\t\t\t\t\t\t\t\t\t( typeof returned === "object" ||\n\t\t\t\t\t\t\t\t\t\t\ttypeof returned === "function" ) &&\n\t\t\t\t\t\t\t\t\t\treturned.then;\n\n\t\t\t\t\t\t\t\t\t// Handle a returned thenable\n\t\t\t\t\t\t\t\t\tif ( isFunction( then ) ) {\n\n\t\t\t\t\t\t\t\t\t\t// Special processors (notify) just wait for resolution\n\t\t\t\t\t\t\t\t\t\tif ( special ) {\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special )\n\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\t// Normal processors (resolve) also hook into progress\n\t\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t\t// ...and disregard older resolution values\n\t\t\t\t\t\t\t\t\t\t\tmaxDepth++;\n\n\t\t\t\t\t\t\t\t\t\t\tthen.call(\n\t\t\t\t\t\t\t\t\t\t\t\treturned,\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Thrower, special ),\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( maxDepth, deferred, Identity,\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeferred.notifyWith )\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Handle all other returned values\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\tif ( handler !== Identity ) {\n\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\targs = [ returned ];\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t// Process the value(s)\n\t\t\t\t\t\t\t\t\t\t// Default process is resolve\n\t\t\t\t\t\t\t\t\t\t( special || deferred.resolveWith )( that, args );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t// Only normal processors (resolve) catch and reject exceptions\n\t\t\t\t\t\t\t\tprocess = special ?\n\t\t\t\t\t\t\t\t\tmightThrow :\n\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tmightThrow();\n\t\t\t\t\t\t\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t\t\t\t\t\t\tif ( jQuery.Deferred.exceptionHook ) {\n\t\t\t\t\t\t\t\t\t\t\t\tjQuery.Deferred.exceptionHook( e,\n\t\t\t\t\t\t\t\t\t\t\t\t\tprocess.stackTrace );\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.4.1\n\t\t\t\t\t\t\t\t\t\t\t// https://promisesaplus.com/#point-61\n\t\t\t\t\t\t\t\t\t\t\t// Ignore post-resolution exceptions\n\t\t\t\t\t\t\t\t\t\t\tif ( depth + 1 >= maxDepth ) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t// Only substitute handlers pass on context\n\t\t\t\t\t\t\t\t\t\t\t\t// and multiple values (non-spec behavior)\n\t\t\t\t\t\t\t\t\t\t\t\tif ( handler !== Thrower ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthat = undefined;\n\t\t\t\t\t\t\t\t\t\t\t\t\targs = [ e ];\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.rejectWith( that, args );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t// Support: Promises/A+ section 2.3.3.3.1\n\t\t\t\t\t\t\t// https://promisesaplus.com/#point-57\n\t\t\t\t\t\t\t// Re-resolve promises immediately to dodge false rejection from\n\t\t\t\t\t\t\t// subsequent errors\n\t\t\t\t\t\t\tif ( depth ) {\n\t\t\t\t\t\t\t\tprocess();\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// Call an optional hook to record the stack, in case of exception\n\t\t\t\t\t\t\t\t// since it\'s otherwise lost when execution goes async\n\t\t\t\t\t\t\t\tif ( jQuery.Deferred.getStackHook ) {\n\t\t\t\t\t\t\t\t\tprocess.stackTrace = jQuery.Deferred.getStackHook();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\twindow.setTimeout( process );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn jQuery.Deferred( function( newDefer ) {\n\n\t\t\t\t\t\t// progress_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 0 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onProgress ) ?\n\t\t\t\t\t\t\t\t\tonProgress :\n\t\t\t\t\t\t\t\t\tIdentity,\n\t\t\t\t\t\t\t\tnewDefer.notifyWith\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// fulfilled_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 1 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onFulfilled ) ?\n\t\t\t\t\t\t\t\t\tonFulfilled :\n\t\t\t\t\t\t\t\t\tIdentity\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// rejected_handlers.add( ... )\n\t\t\t\t\t\ttuples[ 2 ][ 3 ].add(\n\t\t\t\t\t\t\tresolve(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tnewDefer,\n\t\t\t\t\t\t\t\tisFunction( onRejected ) ?\n\t\t\t\t\t\t\t\t\tonRejected :\n\t\t\t\t\t\t\t\t\tThrower\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t} ).promise();\n\t\t\t\t},\n\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 5 ];\n\n\t\t\t// promise.progress = list.add\n\t\t\t// promise.done = list.add\n\t\t\t// promise.fail = list.add\n\t\t\tpromise[ tuple[ 1 ] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(\n\t\t\t\t\tfunction() {\n\n\t\t\t\t\t\t// state = "resolved" (i.e., fulfilled)\n\t\t\t\t\t\t// state = "rejected"\n\t\t\t\t\t\tstate = stateString;\n\t\t\t\t\t},\n\n\t\t\t\t\t// rejected_callbacks.disable\n\t\t\t\t\t// fulfilled_callbacks.disable\n\t\t\t\t\ttuples[ 3 - i ][ 2 ].disable,\n\n\t\t\t\t\t// rejected_handlers.disable\n\t\t\t\t\t// fulfilled_handlers.disable\n\t\t\t\t\ttuples[ 3 - i ][ 3 ].disable,\n\n\t\t\t\t\t// progress_callbacks.lock\n\t\t\t\t\ttuples[ 0 ][ 2 ].lock,\n\n\t\t\t\t\t// progress_handlers.lock\n\t\t\t\t\ttuples[ 0 ][ 3 ].lock\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// progress_handlers.fire\n\t\t\t// fulfilled_handlers.fire\n\t\t\t// rejected_handlers.fire\n\t\t\tlist.add( tuple[ 3 ].fire );\n\n\t\t\t// deferred.notify = function() { deferred.notifyWith(...) }\n\t\t\t// deferred.resolve = function() { deferred.resolveWith(...) }\n\t\t\t// deferred.reject = function() { deferred.rejectWith(...) }\n\t\t\tdeferred[ tuple[ 0 ] ] = function() {\n\t\t\t\tdeferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\t// deferred.notifyWith = list.fireWith\n\t\t\t// deferred.resolveWith = list.fireWith\n\t\t\t// deferred.rejectWith = list.fireWith\n\t\t\tdeferred[ tuple[ 0 ] + "With" ] = list.fireWith;\n\t\t} );\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( singleValue ) {\n\t\tvar\n\n\t\t\t// count of uncompleted subordinates\n\t\t\tremaining = arguments.length,\n\n\t\t\t// count of unprocessed arguments\n\t\t\ti = remaining,\n\n\t\t\t// subordinate fulfillment data\n\t\t\tresolveContexts = Array( i ),\n\t\t\tresolveValues = slice.call( arguments ),\n\n\t\t\t// the primary Deferred\n\t\t\tprimary = jQuery.Deferred(),\n\n\t\t\t// subordinate callback factory\n\t\t\tupdateFunc = function( i ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tresolveContexts[ i ] = this;\n\t\t\t\t\tresolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( !( --remaining ) ) {\n\t\t\t\t\t\tprimary.resolveWith( resolveContexts, resolveValues );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t// Single- and empty arguments are adopted like Promise.resolve\n\t\tif ( remaining <= 1 ) {\n\t\t\tadoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\n\t\t\t\t!remaining );\n\n\t\t\t// Use .then() to unwrap secondary thenables (cf. gh-3000)\n\t\t\tif ( primary.state() === "pending" ||\n\t\t\t\tisFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\n\n\t\t\t\treturn primary.then();\n\t\t\t}\n\t\t}\n\n\t\t// Multiple arguments are aggregated like Promise.all array elements\n\t\twhile ( i-- ) {\n\t\t\tadoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\n\t\t}\n\n\t\treturn primary.promise();\n\t}\n} );\n\n\n// These usually indicate a programmer mistake during development,\n// warn about them ASAP rather than swallowing them by default.\nvar rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\n\njQuery.Deferred.exceptionHook = function( error, stack ) {\n\n\t// Support: IE 8 - 9 only\n\t// Console exists when dev tools are open, which can happen at any time\n\tif ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\n\t\twindow.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );\n\t}\n};\n\n\n\n\njQuery.readyException = function( error ) {\n\twindow.setTimeout( function() {\n\t\tthrow error;\n\t} );\n};\n\n\n\n\n// The deferred used on DOM ready\nvar readyList = jQuery.Deferred();\n\njQuery.fn.ready = function( fn ) {\n\n\treadyList\n\t\t.then( fn )\n\n\t\t// Wrap jQuery.readyException in a function so that the lookup\n\t\t// happens at the time of error handling instead of callback\n\t\t// registration.\n\t\t.catch( function( error ) {\n\t\t\tjQuery.readyException( error );\n\t\t} );\n\n\treturn this;\n};\n\njQuery.extend( {\n\n\t// Is the DOM ready to be used? Set to true once it occurs.\n\tisReady: false,\n\n\t// A counter to track how many items to wait for before\n\t// the ready event fires. See trac-6781\n\treadyWait: 1,\n\n\t// Handle when the DOM is ready\n\tready: function( wait ) {\n\n\t\t// Abort if there are pending holds or we\'re already ready\n\t\tif ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Remember that the DOM is ready\n\t\tjQuery.isReady = true;\n\n\t\t// If a normal DOM Ready event fired, decrement, and wait if need be\n\t\tif ( wait !== true && --jQuery.readyWait > 0 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there are functions bound, to execute\n\t\treadyList.resolveWith( document, [ jQuery ] );\n\t}\n} );\n\njQuery.ready.then = readyList.then;\n\n// The ready event handler and self cleanup method\nfunction completed() {\n\tdocument.removeEventListener( "DOMContentLoaded", completed );\n\twindow.removeEventListener( "load", completed );\n\tjQuery.ready();\n}\n\n// Catch cases where $(document).ready() is called\n// after the browser event has already occurred.\n// Support: IE <=9 - 10 only\n// Older IE sometimes signals "interactive" too soon\nif ( document.readyState === "complete" ||\n\t( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {\n\n\t// Handle it asynchronously to allow scripts the opportunity to delay ready\n\twindow.setTimeout( jQuery.ready );\n\n} else {\n\n\t// Use the handy event callback\n\tdocument.addEventListener( "DOMContentLoaded", completed );\n\n\t// A fallback to window.onload, that will always work\n\twindow.addEventListener( "load", completed );\n}\n\n\n\n\n// Multifunctional method to get and set values of a collection\n// The value/s can optionally be executed if it\'s a function\nvar access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\n\tvar i = 0,\n\t\tlen = elems.length,\n\t\tbulk = key == null;\n\n\t// Sets many values\n\tif ( toType( key ) === "object" ) {\n\t\tchainable = true;\n\t\tfor ( i in key ) {\n\t\t\taccess( elems, fn, i, key[ i ], true, emptyGet, raw );\n\t\t}\n\n\t// Sets one value\n\t} else if ( value !== undefined ) {\n\t\tchainable = true;\n\n\t\tif ( !isFunction( value ) ) {\n\t\t\traw = true;\n\t\t}\n\n\t\tif ( bulk ) {\n\n\t\t\t// Bulk operations run against the entire set\n\t\t\tif ( raw ) {\n\t\t\t\tfn.call( elems, value );\n\t\t\t\tfn = null;\n\n\t\t\t// ...except when executing function values\n\t\t\t} else {\n\t\t\t\tbulk = fn;\n\t\t\t\tfn = function( elem, _key, value ) {\n\t\t\t\t\treturn bulk.call( jQuery( elem ), value );\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( fn ) {\n\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\tfn(\n\t\t\t\t\telems[ i ], key, raw ?\n\t\t\t\t\t\tvalue :\n\t\t\t\t\t\tvalue.call( elems[ i ], i, fn( elems[ i ], key ) )\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( chainable ) {\n\t\treturn elems;\n\t}\n\n\t// Gets\n\tif ( bulk ) {\n\t\treturn fn.call( elems );\n\t}\n\n\treturn len ? fn( elems[ 0 ], key ) : emptyGet;\n};\n\n\n// Matches dashed string for camelizing\nvar rmsPrefix = /^-ms-/,\n\trdashAlpha = /-([a-z])/g;\n\n// Used by camelCase as callback to replace()\nfunction fcamelCase( _all, letter ) {\n\treturn letter.toUpperCase();\n}\n\n// Convert dashed to camelCase; used by the css and data modules\n// Support: IE <=9 - 11, Edge 12 - 15\n// Microsoft forgot to hump their vendor prefix (trac-9572)\nfunction camelCase( string ) {\n\treturn string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );\n}\nvar acceptData = function( owner ) {\n\n\t// Accepts only:\n\t// - Node\n\t// - Node.ELEMENT_NODE\n\t// - Node.DOCUMENT_NODE\n\t// - Object\n\t// - Any\n\treturn owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\n};\n\n\n\n\nfunction Data() {\n\tthis.expando = jQuery.expando + Data.uid++;\n}\n\nData.uid = 1;\n\nData.prototype = {\n\n\tcache: function( owner ) {\n\n\t\t// Check if the owner object already has a cache\n\t\tvar value = owner[ this.expando ];\n\n\t\t// If not, create one\n\t\tif ( !value ) {\n\t\t\tvalue = {};\n\n\t\t\t// We can accept data for non-element nodes in modern browsers,\n\t\t\t// but we should not, see trac-8335.\n\t\t\t// Always return an empty object.\n\t\t\tif ( acceptData( owner ) ) {\n\n\t\t\t\t// If it is a node unlikely to be stringify-ed or looped over\n\t\t\t\t// use plain assignment\n\t\t\t\tif ( owner.nodeType ) {\n\t\t\t\t\towner[ this.expando ] = value;\n\n\t\t\t\t// Otherwise secure it in a non-enumerable property\n\t\t\t\t// configurable must be true to allow the property to be\n\t\t\t\t// deleted when data is removed\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty( owner, this.expando, {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tconfigurable: true\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t},\n\tset: function( owner, data, value ) {\n\t\tvar prop,\n\t\t\tcache = this.cache( owner );\n\n\t\t// Handle: [ owner, key, value ] args\n\t\t// Always use camelCase key (gh-2257)\n\t\tif ( typeof data === "string" ) {\n\t\t\tcache[ camelCase( data ) ] = value;\n\n\t\t// Handle: [ owner, { properties } ] args\n\t\t} else {\n\n\t\t\t// Copy the properties one-by-one to the cache object\n\t\t\tfor ( prop in data ) {\n\t\t\t\tcache[ camelCase( prop ) ] = data[ prop ];\n\t\t\t}\n\t\t}\n\t\treturn cache;\n\t},\n\tget: function( owner, key ) {\n\t\treturn key === undefined ?\n\t\t\tthis.cache( owner ) :\n\n\t\t\t// Always use camelCase key (gh-2257)\n\t\t\towner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\n\t},\n\taccess: function( owner, key, value ) {\n\n\t\t// In cases where either:\n\t\t//\n\t\t// 1. No key was specified\n\t\t// 2. A string key was specified, but no value provided\n\t\t//\n\t\t// Take the "read" path and allow the get method to determine\n\t\t// which value to return, respectively either:\n\t\t//\n\t\t// 1. The entire cache object\n\t\t// 2. The data stored at the key\n\t\t//\n\t\tif ( key === undefined ||\n\t\t\t\t( ( key && typeof key === "string" ) && value === undefined ) ) {\n\n\t\t\treturn this.get( owner, key );\n\t\t}\n\n\t\t// When the key is not a string, or both a key and value\n\t\t// are specified, set or extend (existing objects) with either:\n\t\t//\n\t\t// 1. An object of properties\n\t\t// 2. A key and value\n\t\t//\n\t\tthis.set( owner, key, value );\n\n\t\t// Since the "set" path can have two possible entry points\n\t\t// return the expected data based on which path was taken[*]\n\t\treturn value !== undefined ? value : key;\n\t},\n\tremove: function( owner, key ) {\n\t\tvar i,\n\t\t\tcache = owner[ this.expando ];\n\n\t\tif ( cache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( key !== undefined ) {\n\n\t\t\t// Support array or space separated string of keys\n\t\t\tif ( Array.isArray( key ) ) {\n\n\t\t\t\t// If key is an array of keys...\n\t\t\t\t// We always set camelCase keys, so remove that.\n\t\t\t\tkey = key.map( camelCase );\n\t\t\t} else {\n\t\t\t\tkey = camelCase( key );\n\n\t\t\t\t// If a key with the spaces exists, use it.\n\t\t\t\t// Otherwise, create an array by matching non-whitespace\n\t\t\t\tkey = key in cache ?\n\t\t\t\t\t[ key ] :\n\t\t\t\t\t( key.match( rnothtmlwhite ) || [] );\n\t\t\t}\n\n\t\t\ti = key.length;\n\n\t\t\twhile ( i-- ) {\n\t\t\t\tdelete cache[ key[ i ] ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove the expando if there\'s no more data\n\t\tif ( key === undefined || jQuery.isEmptyObject( cache ) ) {\n\n\t\t\t// Support: Chrome <=35 - 45\n\t\t\t// Webkit & Blink performance suffers when deleting properties\n\t\t\t// from DOM nodes, so set to undefined instead\n\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\n\t\t\tif ( owner.nodeType ) {\n\t\t\t\towner[ this.expando ] = undefined;\n\t\t\t} else {\n\t\t\t\tdelete owner[ this.expando ];\n\t\t\t}\n\t\t}\n\t},\n\thasData: function( owner ) {\n\t\tvar cache = owner[ this.expando ];\n\t\treturn cache !== undefined && !jQuery.isEmptyObject( cache );\n\t}\n};\nvar dataPriv = new Data();\n\nvar dataUser = new Data();\n\n\n\n//\tImplementation Summary\n//\n//\t1. Enforce API surface and semantic compatibility with 1.9.x branch\n//\t2. Improve the module\'s maintainability by reducing the storage\n//\t\tpaths to a single mechanism.\n//\t3. Use the same single mechanism to support "private" and "user" data.\n//\t4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)\n//\t5. Avoid exposing implementation details on user objects (eg. expando properties)\n//\t6. Provide a clear path for implementation upgrade to WeakMap in 2014\n\nvar rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\n\trmultiDash = /[A-Z]/g;\n\nfunction getData( data ) {\n\tif ( data === "true" ) {\n\t\treturn true;\n\t}\n\n\tif ( data === "false" ) {\n\t\treturn false;\n\t}\n\n\tif ( data === "null" ) {\n\t\treturn null;\n\t}\n\n\t// Only convert to a number if it doesn\'t change the string\n\tif ( data === +data + "" ) {\n\t\treturn +data;\n\t}\n\n\tif ( rbrace.test( data ) ) {\n\t\treturn JSON.parse( data );\n\t}\n\n\treturn data;\n}\n\nfunction dataAttr( elem, key, data ) {\n\tvar name;\n\n\t// If nothing was found internally, try to fetch any\n\t// data from the HTML5 data-* attribute\n\tif ( data === undefined && elem.nodeType === 1 ) {\n\t\tname = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();\n\t\tdata = elem.getAttribute( name );\n\n\t\tif ( typeof data === "string" ) {\n\t\t\ttry {\n\t\t\t\tdata = getData( data );\n\t\t\t} catch ( e ) {}\n\n\t\t\t// Make sure we set the data so it isn\'t changed later\n\t\t\tdataUser.set( elem, key, data );\n\t\t} else {\n\t\t\tdata = undefined;\n\t\t}\n\t}\n\treturn data;\n}\n\njQuery.extend( {\n\thasData: function( elem ) {\n\t\treturn dataUser.hasData( elem ) || dataPriv.hasData( elem );\n\t},\n\n\tdata: function( elem, name, data ) {\n\t\treturn dataUser.access( elem, name, data );\n\t},\n\n\tremoveData: function( elem, name ) {\n\t\tdataUser.remove( elem, name );\n\t},\n\n\t// TODO: Now that all calls to _data and _removeData have been replaced\n\t// with direct calls to dataPriv methods, these can be deprecated.\n\t_data: function( elem, name, data ) {\n\t\treturn dataPriv.access( elem, name, data );\n\t},\n\n\t_removeData: function( elem, name ) {\n\t\tdataPriv.remove( elem, name );\n\t}\n} );\n\njQuery.fn.extend( {\n\tdata: function( key, value ) {\n\t\tvar i, name, data,\n\t\t\telem = this[ 0 ],\n\t\t\tattrs = elem && elem.attributes;\n\n\t\t// Gets all values\n\t\tif ( key === undefined ) {\n\t\t\tif ( this.length ) {\n\t\t\t\tdata = dataUser.get( elem );\n\n\t\t\t\tif ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {\n\t\t\t\t\ti = attrs.length;\n\t\t\t\t\twhile ( i-- ) {\n\n\t\t\t\t\t\t// Support: IE 11 only\n\t\t\t\t\t\t// The attrs elements can be null (trac-14894)\n\t\t\t\t\t\tif ( attrs[ i ] ) {\n\t\t\t\t\t\t\tname = attrs[ i ].name;\n\t\t\t\t\t\t\tif ( name.indexOf( "data-" ) === 0 ) {\n\t\t\t\t\t\t\t\tname = camelCase( name.slice( 5 ) );\n\t\t\t\t\t\t\t\tdataAttr( elem, name, data[ name ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdataPriv.set( elem, "hasDataAttrs", true );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\t// Sets multiple values\n\t\tif ( typeof key === "object" ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tdataUser.set( this, key );\n\t\t\t} );\n\t\t}\n\n\t\treturn access( this, function( value ) {\n\t\t\tvar data;\n\n\t\t\t// The calling jQuery object (element matches) is not empty\n\t\t\t// (and therefore has an element appears at this[ 0 ]) and the\n\t\t\t// `value` parameter was not undefined. An empty jQuery object\n\t\t\t// will result in `undefined` for elem = this[ 0 ] which will\n\t\t\t// throw an exception if an attempt to read a data cache is made.\n\t\t\tif ( elem && value === undefined ) {\n\n\t\t\t\t// Attempt to get data from the cache\n\t\t\t\t// The key will always be camelCased in Data\n\t\t\t\tdata = dataUser.get( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// Attempt to "discover" the data in\n\t\t\t\t// HTML5 custom data-* attrs\n\t\t\t\tdata = dataAttr( elem, key );\n\t\t\t\tif ( data !== undefined ) {\n\t\t\t\t\treturn data;\n\t\t\t\t}\n\n\t\t\t\t// We tried really hard, but the data doesn\'t exist.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Set the data...\n\t\t\tthis.each( function() {\n\n\t\t\t\t// We always store the camelCased key\n\t\t\t\tdataUser.set( this, key, value );\n\t\t\t} );\n\t\t}, null, value, arguments.length > 1, null, true );\n\t},\n\n\tremoveData: function( key ) {\n\t\treturn this.each( function() {\n\t\t\tdataUser.remove( this, key );\n\t\t} );\n\t}\n} );\n\n\njQuery.extend( {\n\tqueue: function( elem, type, data ) {\n\t\tvar queue;\n\n\t\tif ( elem ) {\n\t\t\ttype = ( type || "fx" ) + "queue";\n\t\t\tqueue = dataPriv.get( elem, type );\n\n\t\t\t// Speed up dequeue by getting out quickly if this is just a lookup\n\t\t\tif ( data ) {\n\t\t\t\tif ( !queue || Array.isArray( data ) ) {\n\t\t\t\t\tqueue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push( data );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn queue || [];\n\t\t}\n\t},\n\n\tdequeue: function( elem, type ) {\n\t\ttype = type || "fx";\n\n\t\tvar queue = jQuery.queue( elem, type ),\n\t\t\tstartLength = queue.length,\n\t\t\tfn = queue.shift(),\n\t\t\thooks = jQuery._queueHooks( elem, type ),\n\t\t\tnext = function() {\n\t\t\t\tjQuery.dequeue( elem, type );\n\t\t\t};\n\n\t\t// If the fx queue is dequeued, always remove the progress sentinel\n\t\tif ( fn === "inprogress" ) {\n\t\t\tfn = queue.shift();\n\t\t\tstartLength--;\n\t\t}\n\n\t\tif ( fn ) {\n\n\t\t\t// Add a progress sentinel to prevent the fx queue from being\n\t\t\t// automatically dequeued\n\t\t\tif ( type === "fx" ) {\n\t\t\t\tqueue.unshift( "inprogress" );\n\t\t\t}\n\n\t\t\t// Clear up the last queue stop function\n\t\t\tdelete hooks.stop;\n\t\t\tfn.call( elem, next, hooks );\n\t\t}\n\n\t\tif ( !startLength && hooks ) {\n\t\t\thooks.empty.fire();\n\t\t}\n\t},\n\n\t// Not public - generate a queueHooks object, or return the current one\n\t_queueHooks: function( elem, type ) {\n\t\tvar key = type + "queueHooks";\n\t\treturn dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\n\t\t\tempty: jQuery.Callbacks( "once memory" ).add( function() {\n\t\t\t\tdataPriv.remove( elem, [ type + "queue", key ] );\n\t\t\t} )\n\t\t} );\n\t}\n} );\n\njQuery.fn.extend( {\n\tqueue: function( type, data ) {\n\t\tvar setter = 2;\n\n\t\tif ( typeof type !== "string" ) {\n\t\t\tdata = type;\n\t\t\ttype = "fx";\n\t\t\tsetter--;\n\t\t}\n\n\t\tif ( arguments.length < setter ) {\n\t\t\treturn jQuery.queue( this[ 0 ], type );\n\t\t}\n\n\t\treturn data === undefined ?\n\t\t\tthis :\n\t\t\tthis.each( function() {\n\t\t\t\tvar queue = jQuery.queue( this, type, data );\n\n\t\t\t\t// Ensure a hooks for this queue\n\t\t\t\tjQuery._queueHooks( this, type );\n\n\t\t\t\tif ( type === "fx" && queue[ 0 ] !== "inprogress" ) {\n\t\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t\t}\n\t\t\t} );\n\t},\n\tdequeue: function( type ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.dequeue( this, type );\n\t\t} );\n\t},\n\tclearQueue: function( type ) {\n\t\treturn this.queue( type || "fx", [] );\n\t},\n\n\t// Get a promise resolved when queues of a certain type\n\t// are emptied (fx is the type by default)\n\tpromise: function( type, obj ) {\n\t\tvar tmp,\n\t\t\tcount = 1,\n\t\t\tdefer = jQuery.Deferred(),\n\t\t\telements = this,\n\t\t\ti = this.length,\n\t\t\tresolve = function() {\n\t\t\t\tif ( !( --count ) ) {\n\t\t\t\t\tdefer.resolveWith( elements, [ elements ] );\n\t\t\t\t}\n\t\t\t};\n\n\t\tif ( typeof type !== "string" ) {\n\t\t\tobj = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\ttype = type || "fx";\n\n\t\twhile ( i-- ) {\n\t\t\ttmp = dataPriv.get( elements[ i ], type + "queueHooks" );\n\t\t\tif ( tmp && tmp.empty ) {\n\t\t\t\tcount++;\n\t\t\t\ttmp.empty.add( resolve );\n\t\t\t}\n\t\t}\n\t\tresolve();\n\t\treturn defer.promise( obj );\n\t}\n} );\nvar pnum = ( /[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/ ).source;\n\nvar rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );\n\n\nvar cssExpand = [ "Top", "Right", "Bottom", "Left" ];\n\nvar documentElement = document.documentElement;\n\n\n\n\tvar isAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem );\n\t\t},\n\t\tcomposed = { composed: true };\n\n\t// Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\n\t// Check attachment across shadow DOM boundaries when possible (gh-3504)\n\t// Support: iOS 10.0-10.2 only\n\t// Early iOS 10 versions support `attachShadow` but not `getRootNode`,\n\t// leading to errors. We need to check for `getRootNode`.\n\tif ( documentElement.getRootNode ) {\n\t\tisAttached = function( elem ) {\n\t\t\treturn jQuery.contains( elem.ownerDocument, elem ) ||\n\t\t\t\telem.getRootNode( composed ) === elem.ownerDocument;\n\t\t};\n\t}\nvar isHiddenWithinTree = function( elem, el ) {\n\n\t\t// isHiddenWithinTree might be called from jQuery#filter function;\n\t\t// in that case, element will be second argument\n\t\telem = el || elem;\n\n\t\t// Inline style trumps all\n\t\treturn elem.style.display === "none" ||\n\t\t\telem.style.display === "" &&\n\n\t\t\t// Otherwise, check computed style\n\t\t\t// Support: Firefox <=43 - 45\n\t\t\t// Disconnected elements can have computed display: none, so first confirm that elem is\n\t\t\t// in the document.\n\t\t\tisAttached( elem ) &&\n\n\t\t\tjQuery.css( elem, "display" ) === "none";\n\t};\n\n\n\nfunction adjustCSS( elem, prop, valueParts, tween ) {\n\tvar adjusted, scale,\n\t\tmaxIterations = 20,\n\t\tcurrentValue = tween ?\n\t\t\tfunction() {\n\t\t\t\treturn tween.cur();\n\t\t\t} :\n\t\t\tfunction() {\n\t\t\t\treturn jQuery.css( elem, prop, "" );\n\t\t\t},\n\t\tinitial = currentValue(),\n\t\tunit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),\n\n\t\t// Starting value computation is required for potential unit mismatches\n\t\tinitialInUnit = elem.nodeType &&\n\t\t\t( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&\n\t\t\trcssNum.exec( jQuery.css( elem, prop ) );\n\n\tif ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\n\n\t\t// Support: Firefox <=54\n\t\t// Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\n\t\tinitial = initial / 2;\n\n\t\t// Trust units reported by jQuery.css\n\t\tunit = unit || initialInUnit[ 3 ];\n\n\t\t// Iteratively approximate from a nonzero starting point\n\t\tinitialInUnit = +initial || 1;\n\n\t\twhile ( maxIterations-- ) {\n\n\t\t\t// Evaluate and update our best guess (doubling guesses that zero out).\n\t\t\t// Finish if the scale equals or crosses 1 (making the old*new product non-positive).\n\t\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\t\t\tif ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\n\t\t\t\tmaxIterations = 0;\n\t\t\t}\n\t\t\tinitialInUnit = initialInUnit / scale;\n\n\t\t}\n\n\t\tinitialInUnit = initialInUnit * 2;\n\t\tjQuery.style( elem, prop, initialInUnit + unit );\n\n\t\t// Make sure we update the tween properties later on\n\t\tvalueParts = valueParts || [];\n\t}\n\n\tif ( valueParts ) {\n\t\tinitialInUnit = +initialInUnit || +initial || 0;\n\n\t\t// Apply relative offset (+=/-=) if specified\n\t\tadjusted = valueParts[ 1 ] ?\n\t\t\tinitialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\n\t\t\t+valueParts[ 2 ];\n\t\tif ( tween ) {\n\t\t\ttween.unit = unit;\n\t\t\ttween.start = initialInUnit;\n\t\t\ttween.end = adjusted;\n\t\t}\n\t}\n\treturn adjusted;\n}\n\n\nvar defaultDisplayMap = {};\n\nfunction getDefaultDisplay( elem ) {\n\tvar temp,\n\t\tdoc = elem.ownerDocument,\n\t\tnodeName = elem.nodeName,\n\t\tdisplay = defaultDisplayMap[ nodeName ];\n\n\tif ( display ) {\n\t\treturn display;\n\t}\n\n\ttemp = doc.body.appendChild( doc.createElement( nodeName ) );\n\tdisplay = jQuery.css( temp, "display" );\n\n\ttemp.parentNode.removeChild( temp );\n\n\tif ( display === "none" ) {\n\t\tdisplay = "block";\n\t}\n\tdefaultDisplayMap[ nodeName ] = display;\n\n\treturn display;\n}\n\nfunction showHide( elements, show ) {\n\tvar display, elem,\n\t\tvalues = [],\n\t\tindex = 0,\n\t\tlength = elements.length;\n\n\t// Determine new display value for elements that need to change\n\tfor ( ; index < length; index++ ) {\n\t\telem = elements[ index ];\n\t\tif ( !elem.style ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tdisplay = elem.style.display;\n\t\tif ( show ) {\n\n\t\t\t// Since we force visibility upon cascade-hidden elements, an immediate (and slow)\n\t\t\t// check is required in this first loop unless we have a nonempty display value (either\n\t\t\t// inline or about-to-be-restored)\n\t\t\tif ( display === "none" ) {\n\t\t\t\tvalues[ index ] = dataPriv.get( elem, "display" ) || null;\n\t\t\t\tif ( !values[ index ] ) {\n\t\t\t\t\telem.style.display = "";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {\n\t\t\t\tvalues[ index ] = getDefaultDisplay( elem );\n\t\t\t}\n\t\t} else {\n\t\t\tif ( display !== "none" ) {\n\t\t\t\tvalues[ index ] = "none";\n\n\t\t\t\t// Remember what we\'re overwriting\n\t\t\t\tdataPriv.set( elem, "display", display );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Set the display of the elements in a second loop to avoid constant reflow\n\tfor ( index = 0; index < length; index++ ) {\n\t\tif ( values[ index ] != null ) {\n\t\t\telements[ index ].style.display = values[ index ];\n\t\t}\n\t}\n\n\treturn elements;\n}\n\njQuery.fn.extend( {\n\tshow: function() {\n\t\treturn showHide( this, true );\n\t},\n\thide: function() {\n\t\treturn showHide( this );\n\t},\n\ttoggle: function( state ) {\n\t\tif ( typeof state === "boolean" ) {\n\t\t\treturn state ? this.show() : this.hide();\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tif ( isHiddenWithinTree( this ) ) {\n\t\t\t\tjQuery( this ).show();\n\t\t\t} else {\n\t\t\t\tjQuery( this ).hide();\n\t\t\t}\n\t\t} );\n\t}\n} );\nvar rcheckableType = ( /^(?:checkbox|radio)$/i );\n\nvar rtagName = ( /<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i );\n\nvar rscriptType = ( /^$|^module$|\\/(?:java|ecma)script/i );\n\n\n\n( function() {\n\tvar fragment = document.createDocumentFragment(),\n\t\tdiv = fragment.appendChild( document.createElement( "div" ) ),\n\t\tinput = document.createElement( "input" );\n\n\t// Support: Android 4.0 - 4.3 only\n\t// Check state lost if the name is set (trac-11217)\n\t// Support: Windows Web Apps (WWA)\n\t// `name` and `type` must use .setAttribute for WWA (trac-14901)\n\tinput.setAttribute( "type", "radio" );\n\tinput.setAttribute( "checked", "checked" );\n\tinput.setAttribute( "name", "t" );\n\n\tdiv.appendChild( input );\n\n\t// Support: Android <=4.1 only\n\t// Older WebKit doesn\'t clone checked state correctly in fragments\n\tsupport.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\n\n\t// Support: IE <=11 only\n\t// Make sure textarea (and checkbox) defaultValue is properly cloned\n\tdiv.innerHTML = "<textarea>x</textarea>";\n\tsupport.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\n\n\t// Support: IE <=9 only\n\t// IE <=9 replaces <option> tags with their contents when inserted outside of\n\t// the select element.\n\tdiv.innerHTML = "<option></option>";\n\tsupport.option = !!div.lastChild;\n} )();\n\n\n// We have to close these tags to support XHTML (trac-13200)\nvar wrapMap = {\n\n\t// XHTML parsers do not magically insert elements in the\n\t// same way that tag soup parsers do. So we cannot shorten\n\t// this by omitting <tbody> or other required elements.\n\tthead: [ 1, "<table>", "</table>" ],\n\tcol: [ 2, "<table><colgroup>", "</colgroup></table>" ],\n\ttr: [ 2, "<table><tbody>", "</tbody></table>" ],\n\ttd: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],\n\n\t_default: [ 0, "", "" ]\n};\n\nwrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\nwrapMap.th = wrapMap.td;\n\n// Support: IE <=9 only\nif ( !support.option ) {\n\twrapMap.optgroup = wrapMap.option = [ 1, "<select multiple=\'multiple\'>", "</select>" ];\n}\n\n\nfunction getAll( context, tag ) {\n\n\t// Support: IE <=9 - 11 only\n\t// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)\n\tvar ret;\n\n\tif ( typeof context.getElementsByTagName !== "undefined" ) {\n\t\tret = context.getElementsByTagName( tag || "*" );\n\n\t} else if ( typeof context.querySelectorAll !== "undefined" ) {\n\t\tret = context.querySelectorAll( tag || "*" );\n\n\t} else {\n\t\tret = [];\n\t}\n\n\tif ( tag === undefined || tag && nodeName( context, tag ) ) {\n\t\treturn jQuery.merge( [ context ], ret );\n\t}\n\n\treturn ret;\n}\n\n\n// Mark scripts as having already been evaluated\nfunction setGlobalEval( elems, refElements ) {\n\tvar i = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\tdataPriv.set(\n\t\t\telems[ i ],\n\t\t\t"globalEval",\n\t\t\t!refElements || dataPriv.get( refElements[ i ], "globalEval" )\n\t\t);\n\t}\n}\n\n\nvar rhtml = /<|&#?\\w+;/;\n\nfunction buildFragment( elems, context, scripts, selection, ignored ) {\n\tvar elem, tmp, tag, wrap, attached, j,\n\t\tfragment = context.createDocumentFragment(),\n\t\tnodes = [],\n\t\ti = 0,\n\t\tl = elems.length;\n\n\tfor ( ; i < l; i++ ) {\n\t\telem = elems[ i ];\n\n\t\tif ( elem || elem === 0 ) {\n\n\t\t\t// Add nodes directly\n\t\t\tif ( toType( elem ) === "object" ) {\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\n\n\t\t\t// Convert non-html into a text node\n\t\t\t} else if ( !rhtml.test( elem ) ) {\n\t\t\t\tnodes.push( context.createTextNode( elem ) );\n\n\t\t\t// Convert html into DOM nodes\n\t\t\t} else {\n\t\t\t\ttmp = tmp || fragment.appendChild( context.createElement( "div" ) );\n\n\t\t\t\t// Deserialize a standard representation\n\t\t\t\ttag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();\n\t\t\t\twrap = wrapMap[ tag ] || wrapMap._default;\n\t\t\t\ttmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\n\n\t\t\t\t// Descend through wrappers to the right content\n\t\t\t\tj = wrap[ 0 ];\n\t\t\t\twhile ( j-- ) {\n\t\t\t\t\ttmp = tmp.lastChild;\n\t\t\t\t}\n\n\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\tjQuery.merge( nodes, tmp.childNodes );\n\n\t\t\t\t// Remember the top-level container\n\t\t\t\ttmp = fragment.firstChild;\n\n\t\t\t\t// Ensure the created nodes are orphaned (trac-12392)\n\t\t\t\ttmp.textContent = "";\n\t\t\t}\n\t\t}\n\t}\n\n\t// Remove wrapper from fragment\n\tfragment.textContent = "";\n\n\ti = 0;\n\twhile ( ( elem = nodes[ i++ ] ) ) {\n\n\t\t// Skip elements already in the context collection (trac-4087)\n\t\tif ( selection && jQuery.inArray( elem, selection ) > -1 ) {\n\t\t\tif ( ignored ) {\n\t\t\t\tignored.push( elem );\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tattached = isAttached( elem );\n\n\t\t// Append to fragment\n\t\ttmp = getAll( fragment.appendChild( elem ), "script" );\n\n\t\t// Preserve script evaluation history\n\t\tif ( attached ) {\n\t\t\tsetGlobalEval( tmp );\n\t\t}\n\n\t\t// Capture executables\n\t\tif ( scripts ) {\n\t\t\tj = 0;\n\t\t\twhile ( ( elem = tmp[ j++ ] ) ) {\n\t\t\t\tif ( rscriptType.test( elem.type || "" ) ) {\n\t\t\t\t\tscripts.push( elem );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn fragment;\n}\n\n\nvar rtypenamespace = /^([^.]*)(?:\\.(.+)|)/;\n\nfunction returnTrue() {\n\treturn true;\n}\n\nfunction returnFalse() {\n\treturn false;\n}\n\n// Support: IE <=9 - 11+\n// focus() and blur() are asynchronous, except when they are no-op.\n// So expect focus to be synchronous when the element is already active,\n// and blur to be synchronous when the element is not already active.\n// (focus and blur are always synchronous in other supported browsers,\n// this just defines when we can count on it).\nfunction expectSync( elem, type ) {\n\treturn ( elem === safeActiveElement() ) === ( type === "focus" );\n}\n\n// Support: IE <=9 only\n// Accessing document.activeElement can throw unexpectedly\n// https://bugs.jquery.com/ticket/13393\nfunction safeActiveElement() {\n\ttry {\n\t\treturn document.activeElement;\n\t} catch ( err ) { }\n}\n\nfunction on( elem, types, selector, data, fn, one ) {\n\tvar origFn, type;\n\n\t// Types can be a map of types/handlers\n\tif ( typeof types === "object" ) {\n\n\t\t// ( types-Object, selector, data )\n\t\tif ( typeof selector !== "string" ) {\n\n\t\t\t// ( types-Object, data )\n\t\t\tdata = data || selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tfor ( type in types ) {\n\t\t\ton( elem, type, selector, data, types[ type ], one );\n\t\t}\n\t\treturn elem;\n\t}\n\n\tif ( data == null && fn == null ) {\n\n\t\t// ( types, fn )\n\t\tfn = selector;\n\t\tdata = selector = undefined;\n\t} else if ( fn == null ) {\n\t\tif ( typeof selector === "string" ) {\n\n\t\t\t// ( types, selector, fn )\n\t\t\tfn = data;\n\t\t\tdata = undefined;\n\t\t} else {\n\n\t\t\t// ( types, data, fn )\n\t\t\tfn = data;\n\t\t\tdata = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t}\n\tif ( fn === false ) {\n\t\tfn = returnFalse;\n\t} else if ( !fn ) {\n\t\treturn elem;\n\t}\n\n\tif ( one === 1 ) {\n\t\torigFn = fn;\n\t\tfn = function( event ) {\n\n\t\t\t// Can use an empty set, since event contains the info\n\t\t\tjQuery().off( event );\n\t\t\treturn origFn.apply( this, arguments );\n\t\t};\n\n\t\t// Use same guid so caller can remove using origFn\n\t\tfn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\n\t}\n\treturn elem.each( function() {\n\t\tjQuery.event.add( this, types, fn, data, selector );\n\t} );\n}\n\n/*\n * Helper functions for managing events -- not part of the public interface.\n * Props to Dean Edwards\' addEvent library for many of the ideas.\n */\njQuery.event = {\n\n\tglobal: {},\n\n\tadd: function( elem, types, handler, data, selector ) {\n\n\t\tvar handleObjIn, eventHandle, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.get( elem );\n\n\t\t// Only attach events to objects that accept data\n\t\tif ( !acceptData( elem ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Caller can pass in an object of custom data in lieu of the handler\n\t\tif ( handler.handler ) {\n\t\t\thandleObjIn = handler;\n\t\t\thandler = handleObjIn.handler;\n\t\t\tselector = handleObjIn.selector;\n\t\t}\n\n\t\t// Ensure that invalid selectors throw exceptions at attach time\n\t\t// Evaluate against documentElement in case elem is a non-element node (e.g., document)\n\t\tif ( selector ) {\n\t\t\tjQuery.find.matchesSelector( documentElement, selector );\n\t\t}\n\n\t\t// Make sure that the handler has a unique ID, used to find/remove it later\n\t\tif ( !handler.guid ) {\n\t\t\thandler.guid = jQuery.guid++;\n\t\t}\n\n\t\t// Init the element\'s event structure and main handler, if this is the first\n\t\tif ( !( events = elemData.events ) ) {\n\t\t\tevents = elemData.events = Object.create( null );\n\t\t}\n\t\tif ( !( eventHandle = elemData.handle ) ) {\n\t\t\teventHandle = elemData.handle = function( e ) {\n\n\t\t\t\t// Discard the second event of a jQuery.event.trigger() and\n\t\t\t\t// when an event is called after a page has unloaded\n\t\t\t\treturn typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?\n\t\t\t\t\tjQuery.event.dispatch.apply( elem, arguments ) : undefined;\n\t\t\t};\n\t\t}\n\n\t\t// Handle multiple events separated by a space\n\t\ttypes = ( types || "" ).match( rnothtmlwhite ) || [ "" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();\n\n\t\t\t// There *must* be a type, no attaching namespace-only handlers\n\t\t\tif ( !type ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// If event changes its type, use the special event handlers for the changed type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// If selector defined, determine special event api type, otherwise given type\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\n\t\t\t// Update special based on newly reset type\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\n\t\t\t// handleObj is passed to all event handlers\n\t\t\thandleObj = jQuery.extend( {\n\t\t\t\ttype: type,\n\t\t\t\torigType: origType,\n\t\t\t\tdata: data,\n\t\t\t\thandler: handler,\n\t\t\t\tguid: handler.guid,\n\t\t\t\tselector: selector,\n\t\t\t\tneedsContext: selector && jQuery.expr.match.needsContext.test( selector ),\n\t\t\t\tnamespace: namespaces.join( "." )\n\t\t\t}, handleObjIn );\n\n\t\t\t// Init the event handler queue if we\'re the first\n\t\t\tif ( !( handlers = events[ type ] ) ) {\n\t\t\t\thandlers = events[ type ] = [];\n\t\t\t\thandlers.delegateCount = 0;\n\n\t\t\t\t// Only use addEventListener if the special events handler returns false\n\t\t\t\tif ( !special.setup ||\n\t\t\t\t\tspecial.setup.call( elem, data, namespaces, eventHandle ) === false ) {\n\n\t\t\t\t\tif ( elem.addEventListener ) {\n\t\t\t\t\t\telem.addEventListener( type, eventHandle );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( special.add ) {\n\t\t\t\tspecial.add.call( elem, handleObj );\n\n\t\t\t\tif ( !handleObj.handler.guid ) {\n\t\t\t\t\thandleObj.handler.guid = handler.guid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add to the element\'s handler list, delegates in front\n\t\t\tif ( selector ) {\n\t\t\t\thandlers.splice( handlers.delegateCount++, 0, handleObj );\n\t\t\t} else {\n\t\t\t\thandlers.push( handleObj );\n\t\t\t}\n\n\t\t\t// Keep track of which events have ever been used, for event optimization\n\t\t\tjQuery.event.global[ type ] = true;\n\t\t}\n\n\t},\n\n\t// Detach an event or set of events from an element\n\tremove: function( elem, types, handler, selector, mappedTypes ) {\n\n\t\tvar j, origCount, tmp,\n\t\t\tevents, t, handleObj,\n\t\t\tspecial, handlers, type, namespaces, origType,\n\t\t\telemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\n\n\t\tif ( !elemData || !( events = elemData.events ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Once for each type.namespace in types; type may be omitted\n\t\ttypes = ( types || "" ).match( rnothtmlwhite ) || [ "" ];\n\t\tt = types.length;\n\t\twhile ( t-- ) {\n\t\t\ttmp = rtypenamespace.exec( types[ t ] ) || [];\n\t\t\ttype = origType = tmp[ 1 ];\n\t\t\tnamespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();\n\n\t\t\t// Unbind all events (on this namespace, if provided) for the element\n\t\t\tif ( !type ) {\n\t\t\t\tfor ( type in events ) {\n\t\t\t\t\tjQuery.event.remove( elem, type + types[ t ], handler, selector, true );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tspecial = jQuery.event.special[ type ] || {};\n\t\t\ttype = ( selector ? special.delegateType : special.bindType ) || type;\n\t\t\thandlers = events[ type ] || [];\n\t\t\ttmp = tmp[ 2 ] &&\n\t\t\t\tnew RegExp( "(^|\\\\.)" + namespaces.join( "\\\\.(?:.*\\\\.|)" ) + "(\\\\.|$)" );\n\n\t\t\t// Remove matching events\n\t\t\torigCount = j = handlers.length;\n\t\t\twhile ( j-- ) {\n\t\t\t\thandleObj = handlers[ j ];\n\n\t\t\t\tif ( ( mappedTypes || origType === handleObj.origType ) &&\n\t\t\t\t\t( !handler || handler.guid === handleObj.guid ) &&\n\t\t\t\t\t( !tmp || tmp.test( handleObj.namespace ) ) &&\n\t\t\t\t\t( !selector || selector === handleObj.selector ||\n\t\t\t\t\t\tselector === "**" && handleObj.selector ) ) {\n\t\t\t\t\thandlers.splice( j, 1 );\n\n\t\t\t\t\tif ( handleObj.selector ) {\n\t\t\t\t\t\thandlers.delegateCount--;\n\t\t\t\t\t}\n\t\t\t\t\tif ( special.remove ) {\n\t\t\t\t\t\tspecial.remove.call( elem, handleObj );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Remove generic event handler if we removed something and no more handlers exist\n\t\t\t// (avoids potential for endless recursion during removal of special event handlers)\n\t\t\tif ( origCount && !handlers.length ) {\n\t\t\t\tif ( !special.teardown ||\n\t\t\t\t\tspecial.teardown.call( elem, namespaces, elemData.handle ) === false ) {\n\n\t\t\t\t\tjQuery.removeEvent( elem, type, elemData.handle );\n\t\t\t\t}\n\n\t\t\t\tdelete events[ type ];\n\t\t\t}\n\t\t}\n\n\t\t// Remove data and the expando if it\'s no longer used\n\t\tif ( jQuery.isEmptyObject( events ) ) {\n\t\t\tdataPriv.remove( elem, "handle events" );\n\t\t}\n\t},\n\n\tdispatch: function( nativeEvent ) {\n\n\t\tvar i, j, ret, matched, handleObj, handlerQueue,\n\t\t\targs = new Array( arguments.length ),\n\n\t\t\t// Make a writable jQuery.Event from the native event object\n\t\t\tevent = jQuery.event.fix( nativeEvent ),\n\n\t\t\thandlers = (\n\t\t\t\tdataPriv.get( this, "events" ) || Object.create( null )\n\t\t\t)[ event.type ] || [],\n\t\t\tspecial = jQuery.event.special[ event.type ] || {};\n\n\t\t// Use the fix-ed jQuery.Event rather than the (read-only) native event\n\t\targs[ 0 ] = event;\n\n\t\tfor ( i = 1; i < arguments.length; i++ ) {\n\t\t\targs[ i ] = arguments[ i ];\n\t\t}\n\n\t\tevent.delegateTarget = this;\n\n\t\t// Call the preDispatch hook for the mapped type, and let it bail if desired\n\t\tif ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine handlers\n\t\thandlerQueue = jQuery.event.handlers.call( this, event, handlers );\n\n\t\t// Run delegates first; they may want to stop propagation beneath us\n\t\ti = 0;\n\t\twhile ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tevent.currentTarget = matched.elem;\n\n\t\t\tj = 0;\n\t\t\twhile ( ( handleObj = matched.handlers[ j++ ] ) &&\n\t\t\t\t!event.isImmediatePropagationStopped() ) {\n\n\t\t\t\t// If the event is namespaced, then each handler is only invoked if it is\n\t\t\t\t// specially universal or its namespaces are a superset of the event\'s.\n\t\t\t\tif ( !event.rnamespace || handleObj.namespace === false ||\n\t\t\t\t\tevent.rnamespace.test( handleObj.namespace ) ) {\n\n\t\t\t\t\tevent.handleObj = handleObj;\n\t\t\t\t\tevent.data = handleObj.data;\n\n\t\t\t\t\tret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\n\t\t\t\t\t\thandleObj.handler ).apply( matched.elem, args );\n\n\t\t\t\t\tif ( ret !== undefined ) {\n\t\t\t\t\t\tif ( ( event.result = ret ) === false ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Call the postDispatch hook for the mapped type\n\t\tif ( special.postDispatch ) {\n\t\t\tspecial.postDispatch.call( this, event );\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\thandlers: function( event, handlers ) {\n\t\tvar i, handleObj, sel, matchedHandlers, matchedSelectors,\n\t\t\thandlerQueue = [],\n\t\t\tdelegateCount = handlers.delegateCount,\n\t\t\tcur = event.target;\n\n\t\t// Find delegate handlers\n\t\tif ( delegateCount &&\n\n\t\t\t// Support: IE <=9\n\t\t\t// Black-hole SVG <use> instance trees (trac-13180)\n\t\t\tcur.nodeType &&\n\n\t\t\t// Support: Firefox <=42\n\t\t\t// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\n\t\t\t// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\n\t\t\t// Support: IE 11 only\n\t\t\t// ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)\n\t\t\t!( event.type === "click" && event.button >= 1 ) ) {\n\n\t\t\tfor ( ; cur !== this; cur = cur.parentNode || this ) {\n\n\t\t\t\t// Don\'t check non-elements (trac-13208)\n\t\t\t\t// Don\'t process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764)\n\t\t\t\tif ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {\n\t\t\t\t\tmatchedHandlers = [];\n\t\t\t\t\tmatchedSelectors = {};\n\t\t\t\t\tfor ( i = 0; i < delegateCount; i++ ) {\n\t\t\t\t\t\thandleObj = handlers[ i ];\n\n\t\t\t\t\t\t// Don\'t conflict with Object.prototype properties (trac-13203)\n\t\t\t\t\t\tsel = handleObj.selector + " ";\n\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] === undefined ) {\n\t\t\t\t\t\t\tmatchedSelectors[ sel ] = handleObj.needsContext ?\n\t\t\t\t\t\t\t\tjQuery( sel, this ).index( cur ) > -1 :\n\t\t\t\t\t\t\t\tjQuery.find( sel, this, null, [ cur ] ).length;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( matchedSelectors[ sel ] ) {\n\t\t\t\t\t\t\tmatchedHandlers.push( handleObj );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ( matchedHandlers.length ) {\n\t\t\t\t\t\thandlerQueue.push( { elem: cur, handlers: matchedHandlers } );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Add the remaining (directly-bound) handlers\n\t\tcur = this;\n\t\tif ( delegateCount < handlers.length ) {\n\t\t\thandlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\n\t\t}\n\n\t\treturn handlerQueue;\n\t},\n\n\taddProp: function( name, hook ) {\n\t\tObject.defineProperty( jQuery.Event.prototype, name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\n\t\t\tget: isFunction( hook ) ?\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn hook( this.originalEvent );\n\t\t\t\t\t}\n\t\t\t\t} :\n\t\t\t\tfunction() {\n\t\t\t\t\tif ( this.originalEvent ) {\n\t\t\t\t\t\treturn this.originalEvent[ name ];\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\tset: function( value ) {\n\t\t\t\tObject.defineProperty( this, name, {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\twritable: true,\n\t\t\t\t\tvalue: value\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t},\n\n\tfix: function( originalEvent ) {\n\t\treturn originalEvent[ jQuery.expando ] ?\n\t\t\toriginalEvent :\n\t\t\tnew jQuery.Event( originalEvent );\n\t},\n\n\tspecial: {\n\t\tload: {\n\n\t\t\t// Prevent triggered image.load events from bubbling to window.load\n\t\t\tnoBubble: true\n\t\t},\n\t\tclick: {\n\n\t\t\t// Utilize native event to ensure correct state for checkable inputs\n\t\t\tsetup: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Claim the first handler\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, "input" ) ) {\n\n\t\t\t\t\t// dataPriv.set( el, "click", ... )\n\t\t\t\t\tleverageNative( el, "click", returnTrue );\n\t\t\t\t}\n\n\t\t\t\t// Return false to allow normal processing in the caller\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\ttrigger: function( data ) {\n\n\t\t\t\t// For mutual compressibility with _default, replace `this` access with a local var.\n\t\t\t\t// `|| data` is dead code meant only to preserve the variable through minification.\n\t\t\t\tvar el = this || data;\n\n\t\t\t\t// Force setup before triggering a click\n\t\t\t\tif ( rcheckableType.test( el.type ) &&\n\t\t\t\t\tel.click && nodeName( el, "input" ) ) {\n\n\t\t\t\t\tleverageNative( el, "click" );\n\t\t\t\t}\n\n\t\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\t// For cross-browser consistency, suppress native .click() on links\n\t\t\t// Also prevent it if we\'re currently inside a leveraged native-event stack\n\t\t\t_default: function( event ) {\n\t\t\t\tvar target = event.target;\n\t\t\t\treturn rcheckableType.test( target.type ) &&\n\t\t\t\t\ttarget.click && nodeName( target, "input" ) &&\n\t\t\t\t\tdataPriv.get( target, "click" ) ||\n\t\t\t\t\tnodeName( target, "a" );\n\t\t\t}\n\t\t},\n\n\t\tbeforeunload: {\n\t\t\tpostDispatch: function( event ) {\n\n\t\t\t\t// Support: Firefox 20+\n\t\t\t\t// Firefox doesn\'t alert if the returnValue field is not set.\n\t\t\t\tif ( event.result !== undefined && event.originalEvent ) {\n\t\t\t\t\tevent.originalEvent.returnValue = event.result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Ensure the presence of an event listener that handles manually-triggered\n// synthetic events by interrupting progress until reinvoked in response to\n// *native* events that it fires directly, ensuring that state changes have\n// already occurred before other listeners are invoked.\nfunction leverageNative( el, type, expectSync ) {\n\n\t// Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\n\tif ( !expectSync ) {\n\t\tif ( dataPriv.get( el, type ) === undefined ) {\n\t\t\tjQuery.event.add( el, type, returnTrue );\n\t\t}\n\t\treturn;\n\t}\n\n\t// Register the controller as a special universal handler for all event namespaces\n\tdataPriv.set( el, type, false );\n\tjQuery.event.add( el, type, {\n\t\tnamespace: false,\n\t\thandler: function( event ) {\n\t\t\tvar notAsync, result,\n\t\t\t\tsaved = dataPriv.get( this, type );\n\n\t\t\tif ( ( event.isTrigger & 1 ) && this[ type ] ) {\n\n\t\t\t\t// Interrupt processing of the outer synthetic .trigger()ed event\n\t\t\t\t// Saved data should be false in such cases, but might be a leftover capture object\n\t\t\t\t// from an async native handler (gh-4350)\n\t\t\t\tif ( !saved.length ) {\n\n\t\t\t\t\t// Store arguments for use when handling the inner native event\n\t\t\t\t\t// There will always be at least one argument (an event object), so this array\n\t\t\t\t\t// will not be confused with a leftover capture object.\n\t\t\t\t\tsaved = slice.call( arguments );\n\t\t\t\t\tdataPriv.set( this, type, saved );\n\n\t\t\t\t\t// Trigger the native event and capture its result\n\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t// focus() and blur() are asynchronous\n\t\t\t\t\tnotAsync = expectSync( this, type );\n\t\t\t\t\tthis[ type ]();\n\t\t\t\t\tresult = dataPriv.get( this, type );\n\t\t\t\t\tif ( saved !== result || notAsync ) {\n\t\t\t\t\t\tdataPriv.set( this, type, false );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult = {};\n\t\t\t\t\t}\n\t\t\t\t\tif ( saved !== result ) {\n\n\t\t\t\t\t\t// Cancel the outer synthetic event\n\t\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Support: Chrome 86+\n\t\t\t\t\t\t// In Chrome, if an element having a focusout handler is blurred by\n\t\t\t\t\t\t// clicking outside of it, it invokes the handler synchronously. If\n\t\t\t\t\t\t// that handler calls `.remove()` on the element, the data is cleared,\n\t\t\t\t\t\t// leaving `result` undefined. We need to guard against this.\n\t\t\t\t\t\treturn result && result.value;\n\t\t\t\t\t}\n\n\t\t\t\t// If this is an inner synthetic event for an event with a bubbling surrogate\n\t\t\t\t// (focus or blur), assume that the surrogate already propagated from triggering the\n\t\t\t\t// native event and prevent that from happening again here.\n\t\t\t\t// This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\n\t\t\t\t// bubbling surrogate propagates *after* the non-bubbling base), but that seems\n\t\t\t\t// less bad than duplication.\n\t\t\t\t} else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t}\n\n\t\t\t// If this is a native event triggered above, everything is now in order\n\t\t\t// Fire an inner synthetic event with the original arguments\n\t\t\t} else if ( saved.length ) {\n\n\t\t\t\t// ...and capture the result\n\t\t\t\tdataPriv.set( this, type, {\n\t\t\t\t\tvalue: jQuery.event.trigger(\n\n\t\t\t\t\t\t// Support: IE <=9 - 11+\n\t\t\t\t\t\t// Extend with the prototype to reset the above stopImmediatePropagation()\n\t\t\t\t\t\tjQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\n\t\t\t\t\t\tsaved.slice( 1 ),\n\t\t\t\t\t\tthis\n\t\t\t\t\t)\n\t\t\t\t} );\n\n\t\t\t\t// Abort handling of the native event\n\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t}\n\t\t}\n\t} );\n}\n\njQuery.removeEvent = function( elem, type, handle ) {\n\n\t// This "if" is needed for plain objects\n\tif ( elem.removeEventListener ) {\n\t\telem.removeEventListener( type, handle );\n\t}\n};\n\njQuery.Event = function( src, props ) {\n\n\t// Allow instantiation without the \'new\' keyword\n\tif ( !( this instanceof jQuery.Event ) ) {\n\t\treturn new jQuery.Event( src, props );\n\t}\n\n\t// Event object\n\tif ( src && src.type ) {\n\t\tthis.originalEvent = src;\n\t\tthis.type = src.type;\n\n\t\t// Events bubbling up the document may have been marked as prevented\n\t\t// by a handler lower down the tree; reflect the correct value.\n\t\tthis.isDefaultPrevented = src.defaultPrevented ||\n\t\t\t\tsrc.defaultPrevented === undefined &&\n\n\t\t\t\t// Support: Android <=2.3 only\n\t\t\t\tsrc.returnValue === false ?\n\t\t\treturnTrue :\n\t\t\treturnFalse;\n\n\t\t// Create target properties\n\t\t// Support: Safari <=6 - 7 only\n\t\t// Target should not be a text node (trac-504, trac-13143)\n\t\tthis.target = ( src.target && src.target.nodeType === 3 ) ?\n\t\t\tsrc.target.parentNode :\n\t\t\tsrc.target;\n\n\t\tthis.currentTarget = src.currentTarget;\n\t\tthis.relatedTarget = src.relatedTarget;\n\n\t// Event type\n\t} else {\n\t\tthis.type = src;\n\t}\n\n\t// Put explicitly provided properties onto the event object\n\tif ( props ) {\n\t\tjQuery.extend( this, props );\n\t}\n\n\t// Create a timestamp if incoming event doesn\'t have one\n\tthis.timeStamp = src && src.timeStamp || Date.now();\n\n\t// Mark it as fixed\n\tthis[ jQuery.expando ] = true;\n};\n\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\n// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\njQuery.Event.prototype = {\n\tconstructor: jQuery.Event,\n\tisDefaultPrevented: returnFalse,\n\tisPropagationStopped: returnFalse,\n\tisImmediatePropagationStopped: returnFalse,\n\tisSimulated: false,\n\n\tpreventDefault: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isDefaultPrevented = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.preventDefault();\n\t\t}\n\t},\n\tstopPropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isPropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopPropagation();\n\t\t}\n\t},\n\tstopImmediatePropagation: function() {\n\t\tvar e = this.originalEvent;\n\n\t\tthis.isImmediatePropagationStopped = returnTrue;\n\n\t\tif ( e && !this.isSimulated ) {\n\t\t\te.stopImmediatePropagation();\n\t\t}\n\n\t\tthis.stopPropagation();\n\t}\n};\n\n// Includes all common event props including KeyEvent and MouseEvent specific props\njQuery.each( {\n\taltKey: true,\n\tbubbles: true,\n\tcancelable: true,\n\tchangedTouches: true,\n\tctrlKey: true,\n\tdetail: true,\n\teventPhase: true,\n\tmetaKey: true,\n\tpageX: true,\n\tpageY: true,\n\tshiftKey: true,\n\tview: true,\n\t"char": true,\n\tcode: true,\n\tcharCode: true,\n\tkey: true,\n\tkeyCode: true,\n\tbutton: true,\n\tbuttons: true,\n\tclientX: true,\n\tclientY: true,\n\toffsetX: true,\n\toffsetY: true,\n\tpointerId: true,\n\tpointerType: true,\n\tscreenX: true,\n\tscreenY: true,\n\ttargetTouches: true,\n\ttoElement: true,\n\ttouches: true,\n\twhich: true\n}, jQuery.event.addProp );\n\njQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {\n\tjQuery.event.special[ type ] = {\n\n\t\t// Utilize native event if possible so blur/focus sequence is correct\n\t\tsetup: function() {\n\n\t\t\t// Claim the first handler\n\t\t\t// dataPriv.set( this, "focus", ... )\n\t\t\t// dataPriv.set( this, "blur", ... )\n\t\t\tleverageNative( this, type, expectSync );\n\n\t\t\t// Return false to allow normal processing in the caller\n\t\t\treturn false;\n\t\t},\n\t\ttrigger: function() {\n\n\t\t\t// Force setup before trigger\n\t\t\tleverageNative( this, type );\n\n\t\t\t// Return non-false to allow normal event-path propagation\n\t\t\treturn true;\n\t\t},\n\n\t\t// Suppress native focus or blur if we\'re currently inside\n\t\t// a leveraged native-event stack\n\t\t_default: function( event ) {\n\t\t\treturn dataPriv.get( event.target, type );\n\t\t},\n\n\t\tdelegateType: delegateType\n\t};\n} );\n\n// Create mouseenter/leave events using mouseover/out and event-time checks\n// so that event delegation works in jQuery.\n// Do the same for pointerenter/pointerleave and pointerover/pointerout\n//\n// Support: Safari 7 only\n// Safari sends mouseenter too often; see:\n// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\n// for the description of the bug (it existed in older Chrome versions as well).\njQuery.each( {\n\tmouseenter: "mouseover",\n\tmouseleave: "mouseout",\n\tpointerenter: "pointerover",\n\tpointerleave: "pointerout"\n}, function( orig, fix ) {\n\tjQuery.event.special[ orig ] = {\n\t\tdelegateType: fix,\n\t\tbindType: fix,\n\n\t\thandle: function( event ) {\n\t\t\tvar ret,\n\t\t\t\ttarget = this,\n\t\t\t\trelated = event.relatedTarget,\n\t\t\t\thandleObj = event.handleObj;\n\n\t\t\t// For mouseenter/leave call the handler if related is outside the target.\n\t\t\t// NB: No relatedTarget if the mouse left/entered the browser window\n\t\t\tif ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\n\t\t\t\tevent.type = handleObj.origType;\n\t\t\t\tret = handleObj.handler.apply( this, arguments );\n\t\t\t\tevent.type = fix;\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\t};\n} );\n\njQuery.fn.extend( {\n\n\ton: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn );\n\t},\n\tone: function( types, selector, data, fn ) {\n\t\treturn on( this, types, selector, data, fn, 1 );\n\t},\n\toff: function( types, selector, fn ) {\n\t\tvar handleObj, type;\n\t\tif ( types && types.preventDefault && types.handleObj ) {\n\n\t\t\t// ( event ) dispatched jQuery.Event\n\t\t\thandleObj = types.handleObj;\n\t\t\tjQuery( types.delegateTarget ).off(\n\t\t\t\thandleObj.namespace ?\n\t\t\t\t\thandleObj.origType + "." + handleObj.namespace :\n\t\t\t\t\thandleObj.origType,\n\t\t\t\thandleObj.selector,\n\t\t\t\thandleObj.handler\n\t\t\t);\n\t\t\treturn this;\n\t\t}\n\t\tif ( typeof types === "object" ) {\n\n\t\t\t// ( types-object [, selector] )\n\t\t\tfor ( type in types ) {\n\t\t\t\tthis.off( type, selector, types[ type ] );\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\tif ( selector === false || typeof selector === "function" ) {\n\n\t\t\t// ( types [, fn] )\n\t\t\tfn = selector;\n\t\t\tselector = undefined;\n\t\t}\n\t\tif ( fn === false ) {\n\t\t\tfn = returnFalse;\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.remove( this, types, fn, selector );\n\t\t} );\n\t}\n} );\n\n\nvar\n\n\t// Support: IE <=10 - 11, Edge 12 - 13 only\n\t// In IE/Edge using regex groups here causes severe slowdowns.\n\t// See https://connect.microsoft.com/IE/feedback/details/1736512/\n\trnoInnerhtml = /<script|<style|<link/i,\n\n\t// checked="checked" or checked\n\trchecked = /checked\\s*(?:[^=]|=\\s*.checked.)/i,\n\n\trcleanScript = /^\\s*<!\\[CDATA\\[|\\]\\]>\\s*$/g;\n\n// Prefer a tbody over its parent table for containing new rows\nfunction manipulationTarget( elem, content ) {\n\tif ( nodeName( elem, "table" ) &&\n\t\tnodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {\n\n\t\treturn jQuery( elem ).children( "tbody" )[ 0 ] || elem;\n\t}\n\n\treturn elem;\n}\n\n// Replace/restore the type attribute of script elements for safe DOM manipulation\nfunction disableScript( elem ) {\n\telem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;\n\treturn elem;\n}\nfunction restoreScript( elem ) {\n\tif ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {\n\t\telem.type = elem.type.slice( 5 );\n\t} else {\n\t\telem.removeAttribute( "type" );\n\t}\n\n\treturn elem;\n}\n\nfunction cloneCopyEvent( src, dest ) {\n\tvar i, l, type, pdataOld, udataOld, udataCur, events;\n\n\tif ( dest.nodeType !== 1 ) {\n\t\treturn;\n\t}\n\n\t// 1. Copy private data: events, handlers, etc.\n\tif ( dataPriv.hasData( src ) ) {\n\t\tpdataOld = dataPriv.get( src );\n\t\tevents = pdataOld.events;\n\n\t\tif ( events ) {\n\t\t\tdataPriv.remove( dest, "handle events" );\n\n\t\t\tfor ( type in events ) {\n\t\t\t\tfor ( i = 0, l = events[ type ].length; i < l; i++ ) {\n\t\t\t\t\tjQuery.event.add( dest, type, events[ type ][ i ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// 2. Copy user data\n\tif ( dataUser.hasData( src ) ) {\n\t\tudataOld = dataUser.access( src );\n\t\tudataCur = jQuery.extend( {}, udataOld );\n\n\t\tdataUser.set( dest, udataCur );\n\t}\n}\n\n// Fix IE bugs, see support tests\nfunction fixInput( src, dest ) {\n\tvar nodeName = dest.nodeName.toLowerCase();\n\n\t// Fails to persist the checked state of a cloned checkbox or radio button.\n\tif ( nodeName === "input" && rcheckableType.test( src.type ) ) {\n\t\tdest.checked = src.checked;\n\n\t// Fails to return the selected option to the default selected state when cloning options\n\t} else if ( nodeName === "input" || nodeName === "textarea" ) {\n\t\tdest.defaultValue = src.defaultValue;\n\t}\n}\n\nfunction domManip( collection, args, callback, ignored ) {\n\n\t// Flatten any nested arrays\n\targs = flat( args );\n\n\tvar fragment, first, scripts, hasScripts, node, doc,\n\t\ti = 0,\n\t\tl = collection.length,\n\t\tiNoClone = l - 1,\n\t\tvalue = args[ 0 ],\n\t\tvalueIsFunction = isFunction( value );\n\n\t// We can\'t cloneNode fragments that contain checked, in WebKit\n\tif ( valueIsFunction ||\n\t\t\t( l > 1 && typeof value === "string" &&\n\t\t\t\t!support.checkClone && rchecked.test( value ) ) ) {\n\t\treturn collection.each( function( index ) {\n\t\t\tvar self = collection.eq( index );\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\targs[ 0 ] = value.call( this, index, self.html() );\n\t\t\t}\n\t\t\tdomManip( self, args, callback, ignored );\n\t\t} );\n\t}\n\n\tif ( l ) {\n\t\tfragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\n\t\tfirst = fragment.firstChild;\n\n\t\tif ( fragment.childNodes.length === 1 ) {\n\t\t\tfragment = first;\n\t\t}\n\n\t\t// Require either new content or an interest in ignored elements to invoke the callback\n\t\tif ( first || ignored ) {\n\t\t\tscripts = jQuery.map( getAll( fragment, "script" ), disableScript );\n\t\t\thasScripts = scripts.length;\n\n\t\t\t// Use the original fragment for the last item\n\t\t\t// instead of the first because it can end up\n\t\t\t// being emptied incorrectly in certain situations (trac-8070).\n\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\tnode = fragment;\n\n\t\t\t\tif ( i !== iNoClone ) {\n\t\t\t\t\tnode = jQuery.clone( node, true, true );\n\n\t\t\t\t\t// Keep references to cloned scripts for later restoration\n\t\t\t\t\tif ( hasScripts ) {\n\n\t\t\t\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t\t\t\t// push.apply(_, arraylike) throws on ancient WebKit\n\t\t\t\t\t\tjQuery.merge( scripts, getAll( node, "script" ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcallback.call( collection[ i ], node, i );\n\t\t\t}\n\n\t\t\tif ( hasScripts ) {\n\t\t\t\tdoc = scripts[ scripts.length - 1 ].ownerDocument;\n\n\t\t\t\t// Reenable scripts\n\t\t\t\tjQuery.map( scripts, restoreScript );\n\n\t\t\t\t// Evaluate executable scripts on first document insertion\n\t\t\t\tfor ( i = 0; i < hasScripts; i++ ) {\n\t\t\t\t\tnode = scripts[ i ];\n\t\t\t\t\tif ( rscriptType.test( node.type || "" ) &&\n\t\t\t\t\t\t!dataPriv.access( node, "globalEval" ) &&\n\t\t\t\t\t\tjQuery.contains( doc, node ) ) {\n\n\t\t\t\t\t\tif ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {\n\n\t\t\t\t\t\t\t// Optional AJAX dependency, but won\'t run scripts if not present\n\t\t\t\t\t\t\tif ( jQuery._evalUrl && !node.noModule ) {\n\t\t\t\t\t\t\t\tjQuery._evalUrl( node.src, {\n\t\t\t\t\t\t\t\t\tnonce: node.nonce || node.getAttribute( "nonce" )\n\t\t\t\t\t\t\t\t}, doc );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Unwrap a CDATA section containing script contents. This shouldn\'t be\n\t\t\t\t\t\t\t// needed as in XML documents they\'re already not visible when\n\t\t\t\t\t\t\t// inspecting element contents and in HTML documents they have no\n\t\t\t\t\t\t\t// meaning but we\'re preserving that logic for backwards compatibility.\n\t\t\t\t\t\t\t// This will be removed completely in 4.0. See gh-4904.\n\t\t\t\t\t\t\tDOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn collection;\n}\n\nfunction remove( elem, selector, keepData ) {\n\tvar node,\n\t\tnodes = selector ? jQuery.filter( selector, elem ) : elem,\n\t\ti = 0;\n\n\tfor ( ; ( node = nodes[ i ] ) != null; i++ ) {\n\t\tif ( !keepData && node.nodeType === 1 ) {\n\t\t\tjQuery.cleanData( getAll( node ) );\n\t\t}\n\n\t\tif ( node.parentNode ) {\n\t\t\tif ( keepData && isAttached( node ) ) {\n\t\t\t\tsetGlobalEval( getAll( node, "script" ) );\n\t\t\t}\n\t\t\tnode.parentNode.removeChild( node );\n\t\t}\n\t}\n\n\treturn elem;\n}\n\njQuery.extend( {\n\thtmlPrefilter: function( html ) {\n\t\treturn html;\n\t},\n\n\tclone: function( elem, dataAndEvents, deepDataAndEvents ) {\n\t\tvar i, l, srcElements, destElements,\n\t\t\tclone = elem.cloneNode( true ),\n\t\t\tinPage = isAttached( elem );\n\n\t\t// Fix IE cloning issues\n\t\tif ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\n\t\t\t\t!jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\n\t\t\tdestElements = getAll( clone );\n\t\t\tsrcElements = getAll( elem );\n\n\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\tfixInput( srcElements[ i ], destElements[ i ] );\n\t\t\t}\n\t\t}\n\n\t\t// Copy the events from the original to the clone\n\t\tif ( dataAndEvents ) {\n\t\t\tif ( deepDataAndEvents ) {\n\t\t\t\tsrcElements = srcElements || getAll( elem );\n\t\t\t\tdestElements = destElements || getAll( clone );\n\n\t\t\t\tfor ( i = 0, l = srcElements.length; i < l; i++ ) {\n\t\t\t\t\tcloneCopyEvent( srcElements[ i ], destElements[ i ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcloneCopyEvent( elem, clone );\n\t\t\t}\n\t\t}\n\n\t\t// Preserve script evaluation history\n\t\tdestElements = getAll( clone, "script" );\n\t\tif ( destElements.length > 0 ) {\n\t\t\tsetGlobalEval( destElements, !inPage && getAll( elem, "script" ) );\n\t\t}\n\n\t\t// Return the cloned set\n\t\treturn clone;\n\t},\n\n\tcleanData: function( elems ) {\n\t\tvar data, elem, type,\n\t\t\tspecial = jQuery.event.special,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\n\t\t\tif ( acceptData( elem ) ) {\n\t\t\t\tif ( ( data = elem[ dataPriv.expando ] ) ) {\n\t\t\t\t\tif ( data.events ) {\n\t\t\t\t\t\tfor ( type in data.events ) {\n\t\t\t\t\t\t\tif ( special[ type ] ) {\n\t\t\t\t\t\t\t\tjQuery.event.remove( elem, type );\n\n\t\t\t\t\t\t\t// This is a shortcut to avoid jQuery.event.remove\'s overhead\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tjQuery.removeEvent( elem, type, data.handle );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataPriv.expando ] = undefined;\n\t\t\t\t}\n\t\t\t\tif ( elem[ dataUser.expando ] ) {\n\n\t\t\t\t\t// Support: Chrome <=35 - 45+\n\t\t\t\t\t// Assign undefined instead of using delete, see Data#remove\n\t\t\t\t\telem[ dataUser.expando ] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n} );\n\njQuery.fn.extend( {\n\tdetach: function( selector ) {\n\t\treturn remove( this, selector, true );\n\t},\n\n\tremove: function( selector ) {\n\t\treturn remove( this, selector );\n\t},\n\n\ttext: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\treturn value === undefined ?\n\t\t\t\tjQuery.text( this ) :\n\t\t\t\tthis.empty().each( function() {\n\t\t\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\t\t\tthis.textContent = value;\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t}, null, value, arguments.length );\n\t},\n\n\tappend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.appendChild( elem );\n\t\t\t}\n\t\t} );\n\t},\n\n\tprepend: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\n\t\t\t\tvar target = manipulationTarget( this, elem );\n\t\t\t\ttarget.insertBefore( elem, target.firstChild );\n\t\t\t}\n\t\t} );\n\t},\n\n\tbefore: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this );\n\t\t\t}\n\t\t} );\n\t},\n\n\tafter: function() {\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tif ( this.parentNode ) {\n\t\t\t\tthis.parentNode.insertBefore( elem, this.nextSibling );\n\t\t\t}\n\t\t} );\n\t},\n\n\tempty: function() {\n\t\tvar elem,\n\t\t\ti = 0;\n\n\t\tfor ( ; ( elem = this[ i ] ) != null; i++ ) {\n\t\t\tif ( elem.nodeType === 1 ) {\n\n\t\t\t\t// Prevent memory leaks\n\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\n\t\t\t\t// Remove any remaining nodes\n\t\t\t\telem.textContent = "";\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tclone: function( dataAndEvents, deepDataAndEvents ) {\n\t\tdataAndEvents = dataAndEvents == null ? false : dataAndEvents;\n\t\tdeepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\n\n\t\treturn this.map( function() {\n\t\t\treturn jQuery.clone( this, dataAndEvents, deepDataAndEvents );\n\t\t} );\n\t},\n\n\thtml: function( value ) {\n\t\treturn access( this, function( value ) {\n\t\t\tvar elem = this[ 0 ] || {},\n\t\t\t\ti = 0,\n\t\t\t\tl = this.length;\n\n\t\t\tif ( value === undefined && elem.nodeType === 1 ) {\n\t\t\t\treturn elem.innerHTML;\n\t\t\t}\n\n\t\t\t// See if we can take a shortcut and just use innerHTML\n\t\t\tif ( typeof value === "string" && !rnoInnerhtml.test( value ) &&\n\t\t\t\t!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {\n\n\t\t\t\tvalue = jQuery.htmlPrefilter( value );\n\n\t\t\t\ttry {\n\t\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\t\telem = this[ i ] || {};\n\n\t\t\t\t\t\t// Remove element nodes and prevent memory leaks\n\t\t\t\t\t\tif ( elem.nodeType === 1 ) {\n\t\t\t\t\t\t\tjQuery.cleanData( getAll( elem, false ) );\n\t\t\t\t\t\t\telem.innerHTML = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\telem = 0;\n\n\t\t\t\t// If using innerHTML throws an exception, use the fallback method\n\t\t\t\t} catch ( e ) {}\n\t\t\t}\n\n\t\t\tif ( elem ) {\n\t\t\t\tthis.empty().append( value );\n\t\t\t}\n\t\t}, null, value, arguments.length );\n\t},\n\n\treplaceWith: function() {\n\t\tvar ignored = [];\n\n\t\t// Make the changes, replacing each non-ignored context element with the new content\n\t\treturn domManip( this, arguments, function( elem ) {\n\t\t\tvar parent = this.parentNode;\n\n\t\t\tif ( jQuery.inArray( this, ignored ) < 0 ) {\n\t\t\t\tjQuery.cleanData( getAll( this ) );\n\t\t\t\tif ( parent ) {\n\t\t\t\t\tparent.replaceChild( elem, this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Force callback invocation\n\t\t}, ignored );\n\t}\n} );\n\njQuery.each( {\n\tappendTo: "append",\n\tprependTo: "prepend",\n\tinsertBefore: "before",\n\tinsertAfter: "after",\n\treplaceAll: "replaceWith"\n}, function( name, original ) {\n\tjQuery.fn[ name ] = function( selector ) {\n\t\tvar elems,\n\t\t\tret = [],\n\t\t\tinsert = jQuery( selector ),\n\t\t\tlast = insert.length - 1,\n\t\t\ti = 0;\n\n\t\tfor ( ; i <= last; i++ ) {\n\t\t\telems = i === last ? this : this.clone( true );\n\t\t\tjQuery( insert[ i ] )[ original ]( elems );\n\n\t\t\t// Support: Android <=4.0 only, PhantomJS 1 only\n\t\t\t// .get() because push.apply(_, arraylike) throws on ancient WebKit\n\t\t\tpush.apply( ret, elems.get() );\n\t\t}\n\n\t\treturn this.pushStack( ret );\n\t};\n} );\nvar rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );\n\nvar rcustomProp = /^--/;\n\n\nvar getStyles = function( elem ) {\n\n\t\t// Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150)\n\t\t// IE throws on elements created in popups\n\t\t// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"\n\t\tvar view = elem.ownerDocument.defaultView;\n\n\t\tif ( !view || !view.opener ) {\n\t\t\tview = window;\n\t\t}\n\n\t\treturn view.getComputedStyle( elem );\n\t};\n\nvar swap = function( elem, options, callback ) {\n\tvar ret, name,\n\t\told = {};\n\n\t// Remember the old values, and insert the new ones\n\tfor ( name in options ) {\n\t\told[ name ] = elem.style[ name ];\n\t\telem.style[ name ] = options[ name ];\n\t}\n\n\tret = callback.call( elem );\n\n\t// Revert the old values\n\tfor ( name in options ) {\n\t\telem.style[ name ] = old[ name ];\n\t}\n\n\treturn ret;\n};\n\n\nvar rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );\n\nvar whitespace = "[\\\\x20\\\\t\\\\r\\\\n\\\\f]";\n\n\nvar rtrimCSS = new RegExp(\n\t"^" + whitespace + "+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)" + whitespace + "+$",\n\t"g"\n);\n\n\n\n\n( function() {\n\n\t// Executing both pixelPosition & boxSizingReliable tests require only one layout\n\t// so they\'re executed at the same time to save the second computation.\n\tfunction computeStyleTests() {\n\n\t\t// This is a singleton, we need to execute it only once\n\t\tif ( !div ) {\n\t\t\treturn;\n\t\t}\n\n\t\tcontainer.style.cssText = "position:absolute;left:-11111px;width:60px;" +\n\t\t\t"margin-top:1px;padding:0;border:0";\n\t\tdiv.style.cssText =\n\t\t\t"position:relative;display:block;box-sizing:border-box;overflow:scroll;" +\n\t\t\t"margin:auto;border:1px;padding:1px;" +\n\t\t\t"width:60%;top:1%";\n\t\tdocumentElement.appendChild( container ).appendChild( div );\n\n\t\tvar divStyle = window.getComputedStyle( div );\n\t\tpixelPositionVal = divStyle.top !== "1%";\n\n\t\t// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\n\t\treliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\n\n\t\t// Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\n\t\t// Some styles come back with percentage values, even though they shouldn\'t\n\t\tdiv.style.right = "60%";\n\t\tpixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\n\n\t\t// Support: IE 9 - 11 only\n\t\t// Detect misreporting of content dimensions for box-sizing:border-box elements\n\t\tboxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\n\n\t\t// Support: IE 9 only\n\t\t// Detect overflow:scroll screwiness (gh-3699)\n\t\t// Support: Chrome <=64\n\t\t// Don\'t get tricked when zoom affects offsetWidth (gh-4029)\n\t\tdiv.style.position = "absolute";\n\t\tscrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\n\n\t\tdocumentElement.removeChild( container );\n\n\t\t// Nullify the div so it wouldn\'t be stored in the memory and\n\t\t// it will also be a sign that checks already performed\n\t\tdiv = null;\n\t}\n\n\tfunction roundPixelMeasures( measure ) {\n\t\treturn Math.round( parseFloat( measure ) );\n\t}\n\n\tvar pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\n\t\treliableTrDimensionsVal, reliableMarginLeftVal,\n\t\tcontainer = document.createElement( "div" ),\n\t\tdiv = document.createElement( "div" );\n\n\t// Finish early in limited (non-browser) environments\n\tif ( !div.style ) {\n\t\treturn;\n\t}\n\n\t// Support: IE <=9 - 11 only\n\t// Style of cloned element affects source element cloned (trac-8908)\n\tdiv.style.backgroundClip = "content-box";\n\tdiv.cloneNode( true ).style.backgroundClip = "";\n\tsupport.clearCloneStyle = div.style.backgroundClip === "content-box";\n\n\tjQuery.extend( support, {\n\t\tboxSizingReliable: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn boxSizingReliableVal;\n\t\t},\n\t\tpixelBoxStyles: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelBoxStylesVal;\n\t\t},\n\t\tpixelPosition: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn pixelPositionVal;\n\t\t},\n\t\treliableMarginLeft: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn reliableMarginLeftVal;\n\t\t},\n\t\tscrollboxSize: function() {\n\t\t\tcomputeStyleTests();\n\t\t\treturn scrollboxSizeVal;\n\t\t},\n\n\t\t// Support: IE 9 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Behavior in IE 9 is more subtle than in newer versions & it passes\n\t\t// some versions of this test; make sure not to make it pass there!\n\t\t//\n\t\t// Support: Firefox 70+\n\t\t// Only Firefox includes border widths\n\t\t// in computed dimensions. (gh-4529)\n\t\treliableTrDimensions: function() {\n\t\t\tvar table, tr, trChild, trStyle;\n\t\t\tif ( reliableTrDimensionsVal == null ) {\n\t\t\t\ttable = document.createElement( "table" );\n\t\t\t\ttr = document.createElement( "tr" );\n\t\t\t\ttrChild = document.createElement( "div" );\n\n\t\t\t\ttable.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";\n\t\t\t\ttr.style.cssText = "border:1px solid";\n\n\t\t\t\t// Support: Chrome 86+\n\t\t\t\t// Height set through cssText does not get applied.\n\t\t\t\t// Computed height then comes back as 0.\n\t\t\t\ttr.style.height = "1px";\n\t\t\t\ttrChild.style.height = "9px";\n\n\t\t\t\t// Support: Android 8 Chrome 86+\n\t\t\t\t// In our bodyBackground.html iframe,\n\t\t\t\t// display for all div elements is set to "inline",\n\t\t\t\t// which causes a problem only in Android 8 Chrome 86.\n\t\t\t\t// Ensuring the div is display: block\n\t\t\t\t// gets around this issue.\n\t\t\t\ttrChild.style.display = "block";\n\n\t\t\t\tdocumentElement\n\t\t\t\t\t.appendChild( table )\n\t\t\t\t\t.appendChild( tr )\n\t\t\t\t\t.appendChild( trChild );\n\n\t\t\t\ttrStyle = window.getComputedStyle( tr );\n\t\t\t\treliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderTopWidth, 10 ) +\n\t\t\t\t\tparseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\n\n\t\t\t\tdocumentElement.removeChild( table );\n\t\t\t}\n\t\t\treturn reliableTrDimensionsVal;\n\t\t}\n\t} );\n} )();\n\n\nfunction curCSS( elem, name, computed ) {\n\tvar width, minWidth, maxWidth, ret,\n\t\tisCustomProp = rcustomProp.test( name ),\n\n\t\t// Support: Firefox 51+\n\t\t// Retrieving style before computed somehow\n\t\t// fixes an issue with getting wrong values\n\t\t// on detached elements\n\t\tstyle = elem.style;\n\n\tcomputed = computed || getStyles( elem );\n\n\t// getPropertyValue is needed for:\n\t// .css(\'filter\') (IE 9 only, trac-12537)\n\t// .css(\'--customProperty) (gh-3144)\n\tif ( computed ) {\n\t\tret = computed.getPropertyValue( name ) || computed[ name ];\n\n\t\t// trim whitespace for custom property (issue gh-4926)\n\t\tif ( isCustomProp ) {\n\n\t\t\t// rtrim treats U+000D CARRIAGE RETURN and U+000C FORM FEED\n\t\t\t// as whitespace while CSS does not, but this is not a problem\n\t\t\t// because CSS preprocessing replaces them with U+000A LINE FEED\n\t\t\t// (which *is* CSS whitespace)\n\t\t\t// https://www.w3.org/TR/css-syntax-3/#input-preprocessing\n\t\t\tret = ret.replace( rtrimCSS, "$1" );\n\t\t}\n\n\t\tif ( ret === "" && !isAttached( elem ) ) {\n\t\t\tret = jQuery.style( elem, name );\n\t\t}\n\n\t\t// A tribute to the "awesome hack by Dean Edwards"\n\t\t// Android Browser returns percentage for some values,\n\t\t// but width seems to be reliably pixels.\n\t\t// This is against the CSSOM draft spec:\n\t\t// https://drafts.csswg.org/cssom/#resolved-values\n\t\tif ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\n\n\t\t\t// Remember the original values\n\t\t\twidth = style.width;\n\t\t\tminWidth = style.minWidth;\n\t\t\tmaxWidth = style.maxWidth;\n\n\t\t\t// Put in the new values to get a computed value out\n\t\t\tstyle.minWidth = style.maxWidth = style.width = ret;\n\t\t\tret = computed.width;\n\n\t\t\t// Revert the changed values\n\t\t\tstyle.width = width;\n\t\t\tstyle.minWidth = minWidth;\n\t\t\tstyle.maxWidth = maxWidth;\n\t\t}\n\t}\n\n\treturn ret !== undefined ?\n\n\t\t// Support: IE <=9 - 11 only\n\t\t// IE returns zIndex value as an integer.\n\t\tret + "" :\n\t\tret;\n}\n\n\nfunction addGetHookIf( conditionFn, hookFn ) {\n\n\t// Define the hook, we\'ll check on the first run if it\'s really needed.\n\treturn {\n\t\tget: function() {\n\t\t\tif ( conditionFn() ) {\n\n\t\t\t\t// Hook not needed (or it\'s not possible to use it due\n\t\t\t\t// to missing dependency), remove it.\n\t\t\t\tdelete this.get;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Hook needed; redefine it so that the support test is not executed again.\n\t\t\treturn ( this.get = hookFn ).apply( this, arguments );\n\t\t}\n\t};\n}\n\n\nvar cssPrefixes = [ "Webkit", "Moz", "ms" ],\n\temptyStyle = document.createElement( "div" ).style,\n\tvendorProps = {};\n\n// Return a vendor-prefixed property or undefined\nfunction vendorPropName( name ) {\n\n\t// Check for vendor prefixed names\n\tvar capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\n\t\ti = cssPrefixes.length;\n\n\twhile ( i-- ) {\n\t\tname = cssPrefixes[ i ] + capName;\n\t\tif ( name in emptyStyle ) {\n\t\t\treturn name;\n\t\t}\n\t}\n}\n\n// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\nfunction finalPropName( name ) {\n\tvar final = jQuery.cssProps[ name ] || vendorProps[ name ];\n\n\tif ( final ) {\n\t\treturn final;\n\t}\n\tif ( name in emptyStyle ) {\n\t\treturn name;\n\t}\n\treturn vendorProps[ name ] = vendorPropName( name ) || name;\n}\n\n\nvar\n\n\t// Swappable if display is none or starts with table\n\t// except "table", "table-cell", or "table-caption"\n\t// See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\n\trdisplayswap = /^(none|table(?!-c[ea]).+)/,\n\tcssShow = { position: "absolute", visibility: "hidden", display: "block" },\n\tcssNormalTransform = {\n\t\tletterSpacing: "0",\n\t\tfontWeight: "400"\n\t};\n\nfunction setPositiveNumber( _elem, value, subtract ) {\n\n\t// Any relative (+/-) values have already been\n\t// normalized at this point\n\tvar matches = rcssNum.exec( value );\n\treturn matches ?\n\n\t\t// Guard against undefined "subtract", e.g., when used as in cssHooks\n\t\tMath.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :\n\t\tvalue;\n}\n\nfunction boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\n\tvar i = dimension === "width" ? 1 : 0,\n\t\textra = 0,\n\t\tdelta = 0;\n\n\t// Adjustment may not be necessary\n\tif ( box === ( isBorderBox ? "border" : "content" ) ) {\n\t\treturn 0;\n\t}\n\n\tfor ( ; i < 4; i += 2 ) {\n\n\t\t// Both box models exclude margin\n\t\tif ( box === "margin" ) {\n\t\t\tdelta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\n\t\t}\n\n\t\t// If we get here with a content-box, we\'re seeking "padding" or "border" or "margin"\n\t\tif ( !isBorderBox ) {\n\n\t\t\t// Add padding\n\t\t\tdelta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\n\n\t\t\t// For "border" or "margin", add border\n\t\t\tif ( box !== "padding" ) {\n\t\t\t\tdelta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\n\n\t\t\t// But still keep track of it otherwise\n\t\t\t} else {\n\t\t\t\textra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\n\t\t\t}\n\n\t\t// If we get here with a border-box (content + padding + border), we\'re seeking "content" or\n\t\t// "padding" or "margin"\n\t\t} else {\n\n\t\t\t// For "content", subtract padding\n\t\t\tif ( box === "content" ) {\n\t\t\t\tdelta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\n\t\t\t}\n\n\t\t\t// For "content" or "padding", subtract border\n\t\t\tif ( box !== "margin" ) {\n\t\t\t\tdelta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Account for positive content-box scroll gutter when requested by providing computedVal\n\tif ( !isBorderBox && computedVal >= 0 ) {\n\n\t\t// offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\n\t\t// Assuming integer scroll gutter, subtract the rest and round down\n\t\tdelta += Math.max( 0, Math.ceil(\n\t\t\telem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\tcomputedVal -\n\t\t\tdelta -\n\t\t\textra -\n\t\t\t0.5\n\n\t\t// If offsetWidth/offsetHeight is unknown, then we can\'t determine content-box scroll gutter\n\t\t// Use an explicit zero to avoid NaN (gh-3964)\n\t\t) ) || 0;\n\t}\n\n\treturn delta;\n}\n\nfunction getWidthOrHeight( elem, dimension, extra ) {\n\n\t// Start with computed style\n\tvar styles = getStyles( elem ),\n\n\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\n\t\t// Fake content-box until we know it\'s needed to know the true value.\n\t\tboxSizingNeeded = !support.boxSizingReliable() || extra,\n\t\tisBorderBox = boxSizingNeeded &&\n\t\t\tjQuery.css( elem, "boxSizing", false, styles ) === "border-box",\n\t\tvalueIsBorderBox = isBorderBox,\n\n\t\tval = curCSS( elem, dimension, styles ),\n\t\toffsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\n\n\t// Support: Firefox <=54\n\t// Return a confounding non-pixel value or feign ignorance, as appropriate.\n\tif ( rnumnonpx.test( val ) ) {\n\t\tif ( !extra ) {\n\t\t\treturn val;\n\t\t}\n\t\tval = "auto";\n\t}\n\n\n\t// Support: IE 9 - 11 only\n\t// Use offsetWidth/offsetHeight for when box sizing is unreliable.\n\t// In those cases, the computed value can be trusted to be border-box.\n\tif ( ( !support.boxSizingReliable() && isBorderBox ||\n\n\t\t// Support: IE 10 - 11+, Edge 15 - 18+\n\t\t// IE/Edge misreport `getComputedStyle` of table rows with width/height\n\t\t// set in CSS while `offset*` properties report correct values.\n\t\t// Interestingly, in some cases IE 9 doesn\'t suffer from this issue.\n\t\t!support.reliableTrDimensions() && nodeName( elem, "tr" ) ||\n\n\t\t// Fall back to offsetWidth/offsetHeight when value is "auto"\n\t\t// This happens for inline elements with no explicit setting (gh-3571)\n\t\tval === "auto" ||\n\n\t\t// Support: Android <=4.1 - 4.3 only\n\t\t// Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\n\t\t!parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&\n\n\t\t// Make sure the element is visible & connected\n\t\telem.getClientRects().length ) {\n\n\t\tisBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";\n\n\t\t// Where available, offsetWidth/offsetHeight approximate border box dimensions.\n\t\t// Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\n\t\t// retrieved value as a content box dimension.\n\t\tvalueIsBorderBox = offsetProp in elem;\n\t\tif ( valueIsBorderBox ) {\n\t\t\tval = elem[ offsetProp ];\n\t\t}\n\t}\n\n\t// Normalize "" and auto\n\tval = parseFloat( val ) || 0;\n\n\t// Adjust for the element\'s box model\n\treturn ( val +\n\t\tboxModelAdjustment(\n\t\t\telem,\n\t\t\tdimension,\n\t\t\textra || ( isBorderBox ? "border" : "content" ),\n\t\t\tvalueIsBorderBox,\n\t\t\tstyles,\n\n\t\t\t// Provide the current computed size to request scroll gutter calculation (gh-3589)\n\t\t\tval\n\t\t)\n\t) + "px";\n}\n\njQuery.extend( {\n\n\t// Add in style property hooks for overriding the default\n\t// behavior of getting and setting a style property\n\tcssHooks: {\n\t\topacity: {\n\t\t\tget: function( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\n\t\t\t\t\t// We should always get a number back from opacity\n\t\t\t\t\tvar ret = curCSS( elem, "opacity" );\n\t\t\t\t\treturn ret === "" ? "1" : ret;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Don\'t automatically add "px" to these possibly-unitless properties\n\tcssNumber: {\n\t\t"animationIterationCount": true,\n\t\t"columnCount": true,\n\t\t"fillOpacity": true,\n\t\t"flexGrow": true,\n\t\t"flexShrink": true,\n\t\t"fontWeight": true,\n\t\t"gridArea": true,\n\t\t"gridColumn": true,\n\t\t"gridColumnEnd": true,\n\t\t"gridColumnStart": true,\n\t\t"gridRow": true,\n\t\t"gridRowEnd": true,\n\t\t"gridRowStart": true,\n\t\t"lineHeight": true,\n\t\t"opacity": true,\n\t\t"order": true,\n\t\t"orphans": true,\n\t\t"widows": true,\n\t\t"zIndex": true,\n\t\t"zoom": true\n\t},\n\n\t// Add in properties whose names you wish to fix before\n\t// setting or getting the value\n\tcssProps: {},\n\n\t// Get and set the style property on a DOM Node\n\tstyle: function( elem, name, value, extra ) {\n\n\t\t// Don\'t set styles on text and comment nodes\n\t\tif ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure that we\'re working with the right name\n\t\tvar ret, type, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name ),\n\t\t\tstyle = elem.style;\n\n\t\t// Make sure that we\'re working with the right name. We don\'t\n\t\t// want to query the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Gets hook for the prefixed version, then unprefixed version\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// Check if we\'re setting a value\n\t\tif ( value !== undefined ) {\n\t\t\ttype = typeof value;\n\n\t\t\t// Convert "+=" or "-=" to relative numbers (trac-7345)\n\t\t\tif ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\n\t\t\t\tvalue = adjustCSS( elem, name, ret );\n\n\t\t\t\t// Fixes bug trac-9237\n\t\t\t\ttype = "number";\n\t\t\t}\n\n\t\t\t// Make sure that null and NaN values aren\'t set (trac-7116)\n\t\t\tif ( value == null || value !== value ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If a number was passed in, add the unit (except for certain CSS properties)\n\t\t\t// The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\n\t\t\t// "px" to a few hardcoded values.\n\t\t\tif ( type === "number" && !isCustomProp ) {\n\t\t\t\tvalue += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );\n\t\t\t}\n\n\t\t\t// background-* props affect original clone\'s values\n\t\t\tif ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {\n\t\t\t\tstyle[ name ] = "inherit";\n\t\t\t}\n\n\t\t\t// If a hook was provided, use that value, otherwise just set the specified value\n\t\t\tif ( !hooks || !( "set" in hooks ) ||\n\t\t\t\t( value = hooks.set( elem, value, extra ) ) !== undefined ) {\n\n\t\t\t\tif ( isCustomProp ) {\n\t\t\t\t\tstyle.setProperty( name, value );\n\t\t\t\t} else {\n\t\t\t\t\tstyle[ name ] = value;\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// If a hook was provided get the non-computed value from there\n\t\t\tif ( hooks && "get" in hooks &&\n\t\t\t\t( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\n\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\t// Otherwise just get the value from the style object\n\t\t\treturn style[ name ];\n\t\t}\n\t},\n\n\tcss: function( elem, name, extra, styles ) {\n\t\tvar val, num, hooks,\n\t\t\torigName = camelCase( name ),\n\t\t\tisCustomProp = rcustomProp.test( name );\n\n\t\t// Make sure that we\'re working with the right name. We don\'t\n\t\t// want to modify the value if it is a CSS custom property\n\t\t// since they are user-defined.\n\t\tif ( !isCustomProp ) {\n\t\t\tname = finalPropName( origName );\n\t\t}\n\n\t\t// Try prefixed name followed by the unprefixed name\n\t\thooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\n\n\t\t// If a hook was provided get the computed value from there\n\t\tif ( hooks && "get" in hooks ) {\n\t\t\tval = hooks.get( elem, true, extra );\n\t\t}\n\n\t\t// Otherwise, if a way to get the computed value exists, use that\n\t\tif ( val === undefined ) {\n\t\t\tval = curCSS( elem, name, styles );\n\t\t}\n\n\t\t// Convert "normal" to computed value\n\t\tif ( val === "normal" && name in cssNormalTransform ) {\n\t\t\tval = cssNormalTransform[ name ];\n\t\t}\n\n\t\t// Make numeric if forced or a qualifier was provided and val looks numeric\n\t\tif ( extra === "" || extra ) {\n\t\t\tnum = parseFloat( val );\n\t\t\treturn extra === true || isFinite( num ) ? num || 0 : val;\n\t\t}\n\n\t\treturn val;\n\t}\n} );\n\njQuery.each( [ "height", "width" ], function( _i, dimension ) {\n\tjQuery.cssHooks[ dimension ] = {\n\t\tget: function( elem, computed, extra ) {\n\t\t\tif ( computed ) {\n\n\t\t\t\t// Certain elements can have dimension info if we invisibly show them\n\t\t\t\t// but it must have a current display style that would benefit\n\t\t\t\treturn rdisplayswap.test( jQuery.css( elem, "display" ) ) &&\n\n\t\t\t\t\t// Support: Safari 8+\n\t\t\t\t\t// Table columns in Safari have non-zero offsetWidth & zero\n\t\t\t\t\t// getBoundingClientRect().width unless display is changed.\n\t\t\t\t\t// Support: IE <=11 only\n\t\t\t\t\t// Running getBoundingClientRect on a disconnected node\n\t\t\t\t\t// in IE throws an error.\n\t\t\t\t\t( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\n\t\t\t\t\tswap( elem, cssShow, function() {\n\t\t\t\t\t\treturn getWidthOrHeight( elem, dimension, extra );\n\t\t\t\t\t} ) :\n\t\t\t\t\tgetWidthOrHeight( elem, dimension, extra );\n\t\t\t}\n\t\t},\n\n\t\tset: function( elem, value, extra ) {\n\t\t\tvar matches,\n\t\t\t\tstyles = getStyles( elem ),\n\n\t\t\t\t// Only read styles.position if the test has a chance to fail\n\t\t\t\t// to avoid forcing a reflow.\n\t\t\t\tscrollboxSizeBuggy = !support.scrollboxSize() &&\n\t\t\t\t\tstyles.position === "absolute",\n\n\t\t\t\t// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\n\t\t\t\tboxSizingNeeded = scrollboxSizeBuggy || extra,\n\t\t\t\tisBorderBox = boxSizingNeeded &&\n\t\t\t\t\tjQuery.css( elem, "boxSizing", false, styles ) === "border-box",\n\t\t\t\tsubtract = extra ?\n\t\t\t\t\tboxModelAdjustment(\n\t\t\t\t\t\telem,\n\t\t\t\t\t\tdimension,\n\t\t\t\t\t\textra,\n\t\t\t\t\t\tisBorderBox,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t) :\n\t\t\t\t\t0;\n\n\t\t\t// Account for unreliable border-box dimensions by comparing offset* to computed and\n\t\t\t// faking a content-box to get border and padding (gh-3699)\n\t\t\tif ( isBorderBox && scrollboxSizeBuggy ) {\n\t\t\t\tsubtract -= Math.ceil(\n\t\t\t\t\telem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\n\t\t\t\t\tparseFloat( styles[ dimension ] ) -\n\t\t\t\t\tboxModelAdjustment( elem, dimension, "border", false, styles ) -\n\t\t\t\t\t0.5\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Convert to pixels if value adjustment is needed\n\t\t\tif ( subtract && ( matches = rcssNum.exec( value ) ) &&\n\t\t\t\t( matches[ 3 ] || "px" ) !== "px" ) {\n\n\t\t\t\telem.style[ dimension ] = value;\n\t\t\t\tvalue = jQuery.css( elem, dimension );\n\t\t\t}\n\n\t\t\treturn setPositiveNumber( elem, value, subtract );\n\t\t}\n\t};\n} );\n\njQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\n\tfunction( elem, computed ) {\n\t\tif ( computed ) {\n\t\t\treturn ( parseFloat( curCSS( elem, "marginLeft" ) ) ||\n\t\t\t\telem.getBoundingClientRect().left -\n\t\t\t\t\tswap( elem, { marginLeft: 0 }, function() {\n\t\t\t\t\t\treturn elem.getBoundingClientRect().left;\n\t\t\t\t\t} )\n\t\t\t) + "px";\n\t\t}\n\t}\n);\n\n// These hooks are used by animate to expand properties\njQuery.each( {\n\tmargin: "",\n\tpadding: "",\n\tborder: "Width"\n}, function( prefix, suffix ) {\n\tjQuery.cssHooks[ prefix + suffix ] = {\n\t\texpand: function( value ) {\n\t\t\tvar i = 0,\n\t\t\t\texpanded = {},\n\n\t\t\t\t// Assumes a single number if not a string\n\t\t\t\tparts = typeof value === "string" ? value.split( " " ) : [ value ];\n\n\t\t\tfor ( ; i < 4; i++ ) {\n\t\t\t\texpanded[ prefix + cssExpand[ i ] + suffix ] =\n\t\t\t\t\tparts[ i ] || parts[ i - 2 ] || parts[ 0 ];\n\t\t\t}\n\n\t\t\treturn expanded;\n\t\t}\n\t};\n\n\tif ( prefix !== "margin" ) {\n\t\tjQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\n\t}\n} );\n\njQuery.fn.extend( {\n\tcss: function( name, value ) {\n\t\treturn access( this, function( elem, name, value ) {\n\t\t\tvar styles, len,\n\t\t\t\tmap = {},\n\t\t\t\ti = 0;\n\n\t\t\tif ( Array.isArray( name ) ) {\n\t\t\t\tstyles = getStyles( elem );\n\t\t\t\tlen = name.length;\n\n\t\t\t\tfor ( ; i < len; i++ ) {\n\t\t\t\t\tmap[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\n\t\t\t\t}\n\n\t\t\t\treturn map;\n\t\t\t}\n\n\t\t\treturn value !== undefined ?\n\t\t\t\tjQuery.style( elem, name, value ) :\n\t\t\t\tjQuery.css( elem, name );\n\t\t}, name, value, arguments.length > 1 );\n\t}\n} );\n\n\nfunction Tween( elem, options, prop, end, easing ) {\n\treturn new Tween.prototype.init( elem, options, prop, end, easing );\n}\njQuery.Tween = Tween;\n\nTween.prototype = {\n\tconstructor: Tween,\n\tinit: function( elem, options, prop, end, easing, unit ) {\n\t\tthis.elem = elem;\n\t\tthis.prop = prop;\n\t\tthis.easing = easing || jQuery.easing._default;\n\t\tthis.options = options;\n\t\tthis.start = this.now = this.cur();\n\t\tthis.end = end;\n\t\tthis.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );\n\t},\n\tcur: function() {\n\t\tvar hooks = Tween.propHooks[ this.prop ];\n\n\t\treturn hooks && hooks.get ?\n\t\t\thooks.get( this ) :\n\t\t\tTween.propHooks._default.get( this );\n\t},\n\trun: function( percent ) {\n\t\tvar eased,\n\t\t\thooks = Tween.propHooks[ this.prop ];\n\n\t\tif ( this.options.duration ) {\n\t\t\tthis.pos = eased = jQuery.easing[ this.easing ](\n\t\t\t\tpercent, this.options.duration * percent, 0, 1, this.options.duration\n\t\t\t);\n\t\t} else {\n\t\t\tthis.pos = eased = percent;\n\t\t}\n\t\tthis.now = ( this.end - this.start ) * eased + this.start;\n\n\t\tif ( this.options.step ) {\n\t\t\tthis.options.step.call( this.elem, this.now, this );\n\t\t}\n\n\t\tif ( hooks && hooks.set ) {\n\t\t\thooks.set( this );\n\t\t} else {\n\t\t\tTween.propHooks._default.set( this );\n\t\t}\n\t\treturn this;\n\t}\n};\n\nTween.prototype.init.prototype = Tween.prototype;\n\nTween.propHooks = {\n\t_default: {\n\t\tget: function( tween ) {\n\t\t\tvar result;\n\n\t\t\t// Use a property on the element directly when it is not a DOM element,\n\t\t\t// or when there is no matching style property that exists.\n\t\t\tif ( tween.elem.nodeType !== 1 ||\n\t\t\t\ttween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\n\t\t\t\treturn tween.elem[ tween.prop ];\n\t\t\t}\n\n\t\t\t// Passing an empty string as a 3rd parameter to .css will automatically\n\t\t\t// attempt a parseFloat and fallback to a string if the parse fails.\n\t\t\t// Simple values such as "10px" are parsed to Float;\n\t\t\t// complex values such as "rotate(1rad)" are returned as-is.\n\t\t\tresult = jQuery.css( tween.elem, tween.prop, "" );\n\n\t\t\t// Empty strings, null, undefined and "auto" are converted to 0.\n\t\t\treturn !result || result === "auto" ? 0 : result;\n\t\t},\n\t\tset: function( tween ) {\n\n\t\t\t// Use step hook for back compat.\n\t\t\t// Use cssHook if its there.\n\t\t\t// Use .style if available and use plain properties where available.\n\t\t\tif ( jQuery.fx.step[ tween.prop ] ) {\n\t\t\t\tjQuery.fx.step[ tween.prop ]( tween );\n\t\t\t} else if ( tween.elem.nodeType === 1 && (\n\t\t\t\tjQuery.cssHooks[ tween.prop ] ||\n\t\t\t\t\ttween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\n\t\t\t\tjQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\n\t\t\t} else {\n\t\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t\t}\n\t\t}\n\t}\n};\n\n// Support: IE <=9 only\n// Panic based approach to setting things on disconnected nodes\nTween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\n\tset: function( tween ) {\n\t\tif ( tween.elem.nodeType && tween.elem.parentNode ) {\n\t\t\ttween.elem[ tween.prop ] = tween.now;\n\t\t}\n\t}\n};\n\njQuery.easing = {\n\tlinear: function( p ) {\n\t\treturn p;\n\t},\n\tswing: function( p ) {\n\t\treturn 0.5 - Math.cos( p * Math.PI ) / 2;\n\t},\n\t_default: "swing"\n};\n\njQuery.fx = Tween.prototype.init;\n\n// Back compat <1.8 extension point\njQuery.fx.step = {};\n\n\n\n\nvar\n\tfxNow, inProgress,\n\trfxtypes = /^(?:toggle|show|hide)$/,\n\trrun = /queueHooks$/;\n\nfunction schedule() {\n\tif ( inProgress ) {\n\t\tif ( document.hidden === false && window.requestAnimationFrame ) {\n\t\t\twindow.requestAnimationFrame( schedule );\n\t\t} else {\n\t\t\twindow.setTimeout( schedule, jQuery.fx.interval );\n\t\t}\n\n\t\tjQuery.fx.tick();\n\t}\n}\n\n// Animations created synchronously will run synchronously\nfunction createFxNow() {\n\twindow.setTimeout( function() {\n\t\tfxNow = undefined;\n\t} );\n\treturn ( fxNow = Date.now() );\n}\n\n// Generate parameters to create a standard animation\nfunction genFx( type, includeWidth ) {\n\tvar which,\n\t\ti = 0,\n\t\tattrs = { height: type };\n\n\t// If we include width, step value is 1 to do all cssExpand values,\n\t// otherwise step value is 2 to skip over Left and Right\n\tincludeWidth = includeWidth ? 1 : 0;\n\tfor ( ; i < 4; i += 2 - includeWidth ) {\n\t\twhich = cssExpand[ i ];\n\t\tattrs[ "margin" + which ] = attrs[ "padding" + which ] = type;\n\t}\n\n\tif ( includeWidth ) {\n\t\tattrs.opacity = attrs.width = type;\n\t}\n\n\treturn attrs;\n}\n\nfunction createTween( value, prop, animation ) {\n\tvar tween,\n\t\tcollection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),\n\t\tindex = 0,\n\t\tlength = collection.length;\n\tfor ( ; index < length; index++ ) {\n\t\tif ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\n\n\t\t\t// We\'re done with this property\n\t\t\treturn tween;\n\t\t}\n\t}\n}\n\nfunction defaultPrefilter( elem, props, opts ) {\n\tvar prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\n\t\tisBox = "width" in props || "height" in props,\n\t\tanim = this,\n\t\torig = {},\n\t\tstyle = elem.style,\n\t\thidden = elem.nodeType && isHiddenWithinTree( elem ),\n\t\tdataShow = dataPriv.get( elem, "fxshow" );\n\n\t// Queue-skipping animations hijack the fx hooks\n\tif ( !opts.queue ) {\n\t\thooks = jQuery._queueHooks( elem, "fx" );\n\t\tif ( hooks.unqueued == null ) {\n\t\t\thooks.unqueued = 0;\n\t\t\toldfire = hooks.empty.fire;\n\t\t\thooks.empty.fire = function() {\n\t\t\t\tif ( !hooks.unqueued ) {\n\t\t\t\t\toldfire();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\thooks.unqueued++;\n\n\t\tanim.always( function() {\n\n\t\t\t// Ensure the complete handler is called before this completes\n\t\t\tanim.always( function() {\n\t\t\t\thooks.unqueued--;\n\t\t\t\tif ( !jQuery.queue( elem, "fx" ).length ) {\n\t\t\t\t\thooks.empty.fire();\n\t\t\t\t}\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// Detect show/hide animations\n\tfor ( prop in props ) {\n\t\tvalue = props[ prop ];\n\t\tif ( rfxtypes.test( value ) ) {\n\t\t\tdelete props[ prop ];\n\t\t\ttoggle = toggle || value === "toggle";\n\t\t\tif ( value === ( hidden ? "hide" : "show" ) ) {\n\n\t\t\t\t// Pretend to be hidden if this is a "show" and\n\t\t\t\t// there is still data from a stopped show/hide\n\t\t\t\tif ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {\n\t\t\t\t\thidden = true;\n\n\t\t\t\t// Ignore all other no-op show/hide data\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\torig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\n\t\t}\n\t}\n\n\t// Bail out if this is a no-op like .hide().hide()\n\tpropTween = !jQuery.isEmptyObject( props );\n\tif ( !propTween && jQuery.isEmptyObject( orig ) ) {\n\t\treturn;\n\t}\n\n\t// Restrict "overflow" and "display" styles during box animations\n\tif ( isBox && elem.nodeType === 1 ) {\n\n\t\t// Support: IE <=9 - 11, Edge 12 - 15\n\t\t// Record all 3 overflow attributes because IE does not infer the shorthand\n\t\t// from identically-valued overflowX and overflowY and Edge just mirrors\n\t\t// the overflowX value there.\n\t\topts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\n\n\t\t// Identify a display type, preferring old show/hide data over the CSS cascade\n\t\trestoreDisplay = dataShow && dataShow.display;\n\t\tif ( restoreDisplay == null ) {\n\t\t\trestoreDisplay = dataPriv.get( elem, "display" );\n\t\t}\n\t\tdisplay = jQuery.css( elem, "display" );\n\t\tif ( display === "none" ) {\n\t\t\tif ( restoreDisplay ) {\n\t\t\t\tdisplay = restoreDisplay;\n\t\t\t} else {\n\n\t\t\t\t// Get nonempty value(s) by temporarily forcing visibility\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t\trestoreDisplay = elem.style.display || restoreDisplay;\n\t\t\t\tdisplay = jQuery.css( elem, "display" );\n\t\t\t\tshowHide( [ elem ] );\n\t\t\t}\n\t\t}\n\n\t\t// Animate inline elements as inline-block\n\t\tif ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {\n\t\t\tif ( jQuery.css( elem, "float" ) === "none" ) {\n\n\t\t\t\t// Restore the original display value at the end of pure show/hide animations\n\t\t\t\tif ( !propTween ) {\n\t\t\t\t\tanim.done( function() {\n\t\t\t\t\t\tstyle.display = restoreDisplay;\n\t\t\t\t\t} );\n\t\t\t\t\tif ( restoreDisplay == null ) {\n\t\t\t\t\t\tdisplay = style.display;\n\t\t\t\t\t\trestoreDisplay = display === "none" ? "" : display;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstyle.display = "inline-block";\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( opts.overflow ) {\n\t\tstyle.overflow = "hidden";\n\t\tanim.always( function() {\n\t\t\tstyle.overflow = opts.overflow[ 0 ];\n\t\t\tstyle.overflowX = opts.overflow[ 1 ];\n\t\t\tstyle.overflowY = opts.overflow[ 2 ];\n\t\t} );\n\t}\n\n\t// Implement show/hide animations\n\tpropTween = false;\n\tfor ( prop in orig ) {\n\n\t\t// General show/hide setup for this element animation\n\t\tif ( !propTween ) {\n\t\t\tif ( dataShow ) {\n\t\t\t\tif ( "hidden" in dataShow ) {\n\t\t\t\t\thidden = dataShow.hidden;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );\n\t\t\t}\n\n\t\t\t// Store hidden/visible for toggle so `.stop().toggle()` "reverses"\n\t\t\tif ( toggle ) {\n\t\t\t\tdataShow.hidden = !hidden;\n\t\t\t}\n\n\t\t\t// Show elements before animating them\n\t\t\tif ( hidden ) {\n\t\t\t\tshowHide( [ elem ], true );\n\t\t\t}\n\n\t\t\t/* eslint-disable no-loop-func */\n\n\t\t\tanim.done( function() {\n\n\t\t\t\t/* eslint-enable no-loop-func */\n\n\t\t\t\t// The final step of a "hide" animation is actually hiding the element\n\t\t\t\tif ( !hidden ) {\n\t\t\t\t\tshowHide( [ elem ] );\n\t\t\t\t}\n\t\t\t\tdataPriv.remove( elem, "fxshow" );\n\t\t\t\tfor ( prop in orig ) {\n\t\t\t\t\tjQuery.style( elem, prop, orig[ prop ] );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Per-property setup\n\t\tpropTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\n\t\tif ( !( prop in dataShow ) ) {\n\t\t\tdataShow[ prop ] = propTween.start;\n\t\t\tif ( hidden ) {\n\t\t\t\tpropTween.end = propTween.start;\n\t\t\t\tpropTween.start = 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction propFilter( props, specialEasing ) {\n\tvar index, name, easing, value, hooks;\n\n\t// camelCase, specialEasing and expand cssHook pass\n\tfor ( index in props ) {\n\t\tname = camelCase( index );\n\t\teasing = specialEasing[ name ];\n\t\tvalue = props[ index ];\n\t\tif ( Array.isArray( value ) ) {\n\t\t\teasing = value[ 1 ];\n\t\t\tvalue = props[ index ] = value[ 0 ];\n\t\t}\n\n\t\tif ( index !== name ) {\n\t\t\tprops[ name ] = value;\n\t\t\tdelete props[ index ];\n\t\t}\n\n\t\thooks = jQuery.cssHooks[ name ];\n\t\tif ( hooks && "expand" in hooks ) {\n\t\t\tvalue = hooks.expand( value );\n\t\t\tdelete props[ name ];\n\n\t\t\t// Not quite $.extend, this won\'t overwrite existing keys.\n\t\t\t// Reusing \'index\' because we have the correct "name"\n\t\t\tfor ( index in value ) {\n\t\t\t\tif ( !( index in props ) ) {\n\t\t\t\t\tprops[ index ] = value[ index ];\n\t\t\t\t\tspecialEasing[ index ] = easing;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tspecialEasing[ name ] = easing;\n\t\t}\n\t}\n}\n\nfunction Animation( elem, properties, options ) {\n\tvar result,\n\t\tstopped,\n\t\tindex = 0,\n\t\tlength = Animation.prefilters.length,\n\t\tdeferred = jQuery.Deferred().always( function() {\n\n\t\t\t// Don\'t match elem in the :animated selector\n\t\t\tdelete tick.elem;\n\t\t} ),\n\t\ttick = function() {\n\t\t\tif ( stopped ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar currentTime = fxNow || createFxNow(),\n\t\t\t\tremaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\n\n\t\t\t\t// Support: Android 2.3 only\n\t\t\t\t// Archaic crash bug won\'t allow us to use `1 - ( 0.5 || 0 )` (trac-12497)\n\t\t\t\ttemp = remaining / animation.duration || 0,\n\t\t\t\tpercent = 1 - temp,\n\t\t\t\tindex = 0,\n\t\t\t\tlength = animation.tweens.length;\n\n\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\tanimation.tweens[ index ].run( percent );\n\t\t\t}\n\n\t\t\tdeferred.notifyWith( elem, [ animation, percent, remaining ] );\n\n\t\t\t// If there\'s more to do, yield\n\t\t\tif ( percent < 1 && length ) {\n\t\t\t\treturn remaining;\n\t\t\t}\n\n\t\t\t// If this was an empty animation, synthesize a final progress notification\n\t\t\tif ( !length ) {\n\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t}\n\n\t\t\t// Resolve the animation and report its conclusion\n\t\t\tdeferred.resolveWith( elem, [ animation ] );\n\t\t\treturn false;\n\t\t},\n\t\tanimation = deferred.promise( {\n\t\t\telem: elem,\n\t\t\tprops: jQuery.extend( {}, properties ),\n\t\t\topts: jQuery.extend( true, {\n\t\t\t\tspecialEasing: {},\n\t\t\t\teasing: jQuery.easing._default\n\t\t\t}, options ),\n\t\t\toriginalProperties: properties,\n\t\t\toriginalOptions: options,\n\t\t\tstartTime: fxNow || createFxNow(),\n\t\t\tduration: options.duration,\n\t\t\ttweens: [],\n\t\t\tcreateTween: function( prop, end ) {\n\t\t\t\tvar tween = jQuery.Tween( elem, animation.opts, prop, end,\n\t\t\t\t\tanimation.opts.specialEasing[ prop ] || animation.opts.easing );\n\t\t\t\tanimation.tweens.push( tween );\n\t\t\t\treturn tween;\n\t\t\t},\n\t\t\tstop: function( gotoEnd ) {\n\t\t\t\tvar index = 0,\n\n\t\t\t\t\t// If we are going to the end, we want to run all the tweens\n\t\t\t\t\t// otherwise we skip this part\n\t\t\t\t\tlength = gotoEnd ? animation.tweens.length : 0;\n\t\t\t\tif ( stopped ) {\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t\tstopped = true;\n\t\t\t\tfor ( ; index < length; index++ ) {\n\t\t\t\t\tanimation.tweens[ index ].run( 1 );\n\t\t\t\t}\n\n\t\t\t\t// Resolve when we played the last frame; otherwise, reject\n\t\t\t\tif ( gotoEnd ) {\n\t\t\t\t\tdeferred.notifyWith( elem, [ animation, 1, 0 ] );\n\t\t\t\t\tdeferred.resolveWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t} else {\n\t\t\t\t\tdeferred.rejectWith( elem, [ animation, gotoEnd ] );\n\t\t\t\t}\n\t\t\t\treturn this;\n\t\t\t}\n\t\t} ),\n\t\tprops = animation.props;\n\n\tpropFilter( props, animation.opts.specialEasing );\n\n\tfor ( ; index < length; index++ ) {\n\t\tresult = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\n\t\tif ( result ) {\n\t\t\tif ( isFunction( result.stop ) ) {\n\t\t\t\tjQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\n\t\t\t\t\tresult.stop.bind( result );\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n\n\tjQuery.map( props, createTween, animation );\n\n\tif ( isFunction( animation.opts.start ) ) {\n\t\tanimation.opts.start.call( elem, animation );\n\t}\n\n\t// Attach callbacks from options\n\tanimation\n\t\t.progress( animation.opts.progress )\n\t\t.done( animation.opts.done, animation.opts.complete )\n\t\t.fail( animation.opts.fail )\n\t\t.always( animation.opts.always );\n\n\tjQuery.fx.timer(\n\t\tjQuery.extend( tick, {\n\t\t\telem: elem,\n\t\t\tanim: animation,\n\t\t\tqueue: animation.opts.queue\n\t\t} )\n\t);\n\n\treturn animation;\n}\n\njQuery.Animation = jQuery.extend( Animation, {\n\n\ttweeners: {\n\t\t"*": [ function( prop, value ) {\n\t\t\tvar tween = this.createTween( prop, value );\n\t\t\tadjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\n\t\t\treturn tween;\n\t\t} ]\n\t},\n\n\ttweener: function( props, callback ) {\n\t\tif ( isFunction( props ) ) {\n\t\t\tcallback = props;\n\t\t\tprops = [ "*" ];\n\t\t} else {\n\t\t\tprops = props.match( rnothtmlwhite );\n\t\t}\n\n\t\tvar prop,\n\t\t\tindex = 0,\n\t\t\tlength = props.length;\n\n\t\tfor ( ; index < length; index++ ) {\n\t\t\tprop = props[ index ];\n\t\t\tAnimation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\n\t\t\tAnimation.tweeners[ prop ].unshift( callback );\n\t\t}\n\t},\n\n\tprefilters: [ defaultPrefilter ],\n\n\tprefilter: function( callback, prepend ) {\n\t\tif ( prepend ) {\n\t\t\tAnimation.prefilters.unshift( callback );\n\t\t} else {\n\t\t\tAnimation.prefilters.push( callback );\n\t\t}\n\t}\n} );\n\njQuery.speed = function( speed, easing, fn ) {\n\tvar opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {\n\t\tcomplete: fn || !fn && easing ||\n\t\t\tisFunction( speed ) && speed,\n\t\tduration: speed,\n\t\teasing: fn && easing || easing && !isFunction( easing ) && easing\n\t};\n\n\t// Go to the end state if fx are off\n\tif ( jQuery.fx.off ) {\n\t\topt.duration = 0;\n\n\t} else {\n\t\tif ( typeof opt.duration !== "number" ) {\n\t\t\tif ( opt.duration in jQuery.fx.speeds ) {\n\t\t\t\topt.duration = jQuery.fx.speeds[ opt.duration ];\n\n\t\t\t} else {\n\t\t\t\topt.duration = jQuery.fx.speeds._default;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Normalize opt.queue - true/undefined/null -> "fx"\n\tif ( opt.queue == null || opt.queue === true ) {\n\t\topt.queue = "fx";\n\t}\n\n\t// Queueing\n\topt.old = opt.complete;\n\n\topt.complete = function() {\n\t\tif ( isFunction( opt.old ) ) {\n\t\t\topt.old.call( this );\n\t\t}\n\n\t\tif ( opt.queue ) {\n\t\t\tjQuery.dequeue( this, opt.queue );\n\t\t}\n\t};\n\n\treturn opt;\n};\n\njQuery.fn.extend( {\n\tfadeTo: function( speed, to, easing, callback ) {\n\n\t\t// Show any hidden elements after setting opacity to 0\n\t\treturn this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()\n\n\t\t\t// Animate to the value specified\n\t\t\t.end().animate( { opacity: to }, speed, easing, callback );\n\t},\n\tanimate: function( prop, speed, easing, callback ) {\n\t\tvar empty = jQuery.isEmptyObject( prop ),\n\t\t\toptall = jQuery.speed( speed, easing, callback ),\n\t\t\tdoAnimation = function() {\n\n\t\t\t\t// Operate on a copy of prop so per-property easing won\'t be lost\n\t\t\t\tvar anim = Animation( this, jQuery.extend( {}, prop ), optall );\n\n\t\t\t\t// Empty animations, or finishing resolves immediately\n\t\t\t\tif ( empty || dataPriv.get( this, "finish" ) ) {\n\t\t\t\t\tanim.stop( true );\n\t\t\t\t}\n\t\t\t};\n\n\t\tdoAnimation.finish = doAnimation;\n\n\t\treturn empty || optall.queue === false ?\n\t\t\tthis.each( doAnimation ) :\n\t\t\tthis.queue( optall.queue, doAnimation );\n\t},\n\tstop: function( type, clearQueue, gotoEnd ) {\n\t\tvar stopQueue = function( hooks ) {\n\t\t\tvar stop = hooks.stop;\n\t\t\tdelete hooks.stop;\n\t\t\tstop( gotoEnd );\n\t\t};\n\n\t\tif ( typeof type !== "string" ) {\n\t\t\tgotoEnd = clearQueue;\n\t\t\tclearQueue = type;\n\t\t\ttype = undefined;\n\t\t}\n\t\tif ( clearQueue ) {\n\t\t\tthis.queue( type || "fx", [] );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar dequeue = true,\n\t\t\t\tindex = type != null && type + "queueHooks",\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tdata = dataPriv.get( this );\n\n\t\t\tif ( index ) {\n\t\t\t\tif ( data[ index ] && data[ index ].stop ) {\n\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor ( index in data ) {\n\t\t\t\t\tif ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\n\t\t\t\t\t\tstopQueue( data[ index ] );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this &&\n\t\t\t\t\t( type == null || timers[ index ].queue === type ) ) {\n\n\t\t\t\t\ttimers[ index ].anim.stop( gotoEnd );\n\t\t\t\t\tdequeue = false;\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start the next in the queue if the last step wasn\'t forced.\n\t\t\t// Timers currently will call their complete callbacks, which\n\t\t\t// will dequeue but only if they were gotoEnd.\n\t\t\tif ( dequeue || !gotoEnd ) {\n\t\t\t\tjQuery.dequeue( this, type );\n\t\t\t}\n\t\t} );\n\t},\n\tfinish: function( type ) {\n\t\tif ( type !== false ) {\n\t\t\ttype = type || "fx";\n\t\t}\n\t\treturn this.each( function() {\n\t\t\tvar index,\n\t\t\t\tdata = dataPriv.get( this ),\n\t\t\t\tqueue = data[ type + "queue" ],\n\t\t\t\thooks = data[ type + "queueHooks" ],\n\t\t\t\ttimers = jQuery.timers,\n\t\t\t\tlength = queue ? queue.length : 0;\n\n\t\t\t// Enable finishing flag on private data\n\t\t\tdata.finish = true;\n\n\t\t\t// Empty the queue first\n\t\t\tjQuery.queue( this, type, [] );\n\n\t\t\tif ( hooks && hooks.stop ) {\n\t\t\t\thooks.stop.call( this, true );\n\t\t\t}\n\n\t\t\t// Look for any active animations, and finish them\n\t\t\tfor ( index = timers.length; index--; ) {\n\t\t\t\tif ( timers[ index ].elem === this && timers[ index ].queue === type ) {\n\t\t\t\t\ttimers[ index ].anim.stop( true );\n\t\t\t\t\ttimers.splice( index, 1 );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Look for any animations in the old queue and finish them\n\t\t\tfor ( index = 0; index < length; index++ ) {\n\t\t\t\tif ( queue[ index ] && queue[ index ].finish ) {\n\t\t\t\t\tqueue[ index ].finish.call( this );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Turn off finishing flag\n\t\t\tdelete data.finish;\n\t\t} );\n\t}\n} );\n\njQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {\n\tvar cssFn = jQuery.fn[ name ];\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn speed == null || typeof speed === "boolean" ?\n\t\t\tcssFn.apply( this, arguments ) :\n\t\t\tthis.animate( genFx( name, true ), speed, easing, callback );\n\t};\n} );\n\n// Generate shortcuts for custom animations\njQuery.each( {\n\tslideDown: genFx( "show" ),\n\tslideUp: genFx( "hide" ),\n\tslideToggle: genFx( "toggle" ),\n\tfadeIn: { opacity: "show" },\n\tfadeOut: { opacity: "hide" },\n\tfadeToggle: { opacity: "toggle" }\n}, function( name, props ) {\n\tjQuery.fn[ name ] = function( speed, easing, callback ) {\n\t\treturn this.animate( props, speed, easing, callback );\n\t};\n} );\n\njQuery.timers = [];\njQuery.fx.tick = function() {\n\tvar timer,\n\t\ti = 0,\n\t\ttimers = jQuery.timers;\n\n\tfxNow = Date.now();\n\n\tfor ( ; i < timers.length; i++ ) {\n\t\ttimer = timers[ i ];\n\n\t\t// Run the timer and safely remove it when done (allowing for external removal)\n\t\tif ( !timer() && timers[ i ] === timer ) {\n\t\t\ttimers.splice( i--, 1 );\n\t\t}\n\t}\n\n\tif ( !timers.length ) {\n\t\tjQuery.fx.stop();\n\t}\n\tfxNow = undefined;\n};\n\njQuery.fx.timer = function( timer ) {\n\tjQuery.timers.push( timer );\n\tjQuery.fx.start();\n};\n\njQuery.fx.interval = 13;\njQuery.fx.start = function() {\n\tif ( inProgress ) {\n\t\treturn;\n\t}\n\n\tinProgress = true;\n\tschedule();\n};\n\njQuery.fx.stop = function() {\n\tinProgress = null;\n};\n\njQuery.fx.speeds = {\n\tslow: 600,\n\tfast: 200,\n\n\t// Default speed\n\t_default: 400\n};\n\n\n// Based off of the plugin by Clint Helfers, with permission.\njQuery.fn.delay = function( time, type ) {\n\ttime = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\n\ttype = type || "fx";\n\n\treturn this.queue( type, function( next, hooks ) {\n\t\tvar timeout = window.setTimeout( next, time );\n\t\thooks.stop = function() {\n\t\t\twindow.clearTimeout( timeout );\n\t\t};\n\t} );\n};\n\n\n( function() {\n\tvar input = document.createElement( "input" ),\n\t\tselect = document.createElement( "select" ),\n\t\topt = select.appendChild( document.createElement( "option" ) );\n\n\tinput.type = "checkbox";\n\n\t// Support: Android <=4.3 only\n\t// Default value for a checkbox should be "on"\n\tsupport.checkOn = input.value !== "";\n\n\t// Support: IE <=11 only\n\t// Must access selectedIndex to make default options select\n\tsupport.optSelected = opt.selected;\n\n\t// Support: IE <=11 only\n\t// An input loses its value after becoming a radio\n\tinput = document.createElement( "input" );\n\tinput.value = "t";\n\tinput.type = "radio";\n\tsupport.radioValue = input.value === "t";\n} )();\n\n\nvar boolHook,\n\tattrHandle = jQuery.expr.attrHandle;\n\njQuery.fn.extend( {\n\tattr: function( name, value ) {\n\t\treturn access( this, jQuery.attr, name, value, arguments.length > 1 );\n\t},\n\n\tremoveAttr: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.removeAttr( this, name );\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tattr: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don\'t get/set attributes on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback to prop when attributes are not supported\n\t\tif ( typeof elem.getAttribute === "undefined" ) {\n\t\t\treturn jQuery.prop( elem, name, value );\n\t\t}\n\n\t\t// Attribute hooks are determined by the lowercase version\n\t\t// Grab necessary hook if one is defined\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\t\t\thooks = jQuery.attrHooks[ name.toLowerCase() ] ||\n\t\t\t\t( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( value === null ) {\n\t\t\t\tjQuery.removeAttr( elem, name );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( hooks && "set" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\telem.setAttribute( name, value + "" );\n\t\t\treturn value;\n\t\t}\n\n\t\tif ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\tret = jQuery.find.attr( elem, name );\n\n\t\t// Non-existent attributes return null, we normalize to undefined\n\t\treturn ret == null ? undefined : ret;\n\t},\n\n\tattrHooks: {\n\t\ttype: {\n\t\t\tset: function( elem, value ) {\n\t\t\t\tif ( !support.radioValue && value === "radio" &&\n\t\t\t\t\tnodeName( elem, "input" ) ) {\n\t\t\t\t\tvar val = elem.value;\n\t\t\t\t\telem.setAttribute( "type", value );\n\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\telem.value = val;\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tremoveAttr: function( elem, value ) {\n\t\tvar name,\n\t\t\ti = 0,\n\n\t\t\t// Attribute names can contain non-HTML whitespace characters\n\t\t\t// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n\t\t\tattrNames = value && value.match( rnothtmlwhite );\n\n\t\tif ( attrNames && elem.nodeType === 1 ) {\n\t\t\twhile ( ( name = attrNames[ i++ ] ) ) {\n\t\t\t\telem.removeAttribute( name );\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Hooks for boolean attributes\nboolHook = {\n\tset: function( elem, value, name ) {\n\t\tif ( value === false ) {\n\n\t\t\t// Remove boolean attributes when set to false\n\t\t\tjQuery.removeAttr( elem, name );\n\t\t} else {\n\t\t\telem.setAttribute( name, name );\n\t\t}\n\t\treturn name;\n\t}\n};\n\njQuery.each( jQuery.expr.match.bool.source.match( /\\w+/g ), function( _i, name ) {\n\tvar getter = attrHandle[ name ] || jQuery.find.attr;\n\n\tattrHandle[ name ] = function( elem, name, isXML ) {\n\t\tvar ret, handle,\n\t\t\tlowercaseName = name.toLowerCase();\n\n\t\tif ( !isXML ) {\n\n\t\t\t// Avoid an infinite loop by temporarily removing this function from the getter\n\t\t\thandle = attrHandle[ lowercaseName ];\n\t\t\tattrHandle[ lowercaseName ] = ret;\n\t\t\tret = getter( elem, name, isXML ) != null ?\n\t\t\t\tlowercaseName :\n\t\t\t\tnull;\n\t\t\tattrHandle[ lowercaseName ] = handle;\n\t\t}\n\t\treturn ret;\n\t};\n} );\n\n\n\n\nvar rfocusable = /^(?:input|select|textarea|button)$/i,\n\trclickable = /^(?:a|area)$/i;\n\njQuery.fn.extend( {\n\tprop: function( name, value ) {\n\t\treturn access( this, jQuery.prop, name, value, arguments.length > 1 );\n\t},\n\n\tremoveProp: function( name ) {\n\t\treturn this.each( function() {\n\t\t\tdelete this[ jQuery.propFix[ name ] || name ];\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tprop: function( elem, name, value ) {\n\t\tvar ret, hooks,\n\t\t\tnType = elem.nodeType;\n\n\t\t// Don\'t get/set properties on text, comment and attribute nodes\n\t\tif ( nType === 3 || nType === 8 || nType === 2 ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\n\n\t\t\t// Fix name and attach hooks\n\t\t\tname = jQuery.propFix[ name ] || name;\n\t\t\thooks = jQuery.propHooks[ name ];\n\t\t}\n\n\t\tif ( value !== undefined ) {\n\t\t\tif ( hooks && "set" in hooks &&\n\t\t\t\t( ret = hooks.set( elem, value, name ) ) !== undefined ) {\n\t\t\t\treturn ret;\n\t\t\t}\n\n\t\t\treturn ( elem[ name ] = value );\n\t\t}\n\n\t\tif ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\treturn elem[ name ];\n\t},\n\n\tpropHooks: {\n\t\ttabIndex: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\t// Support: IE <=9 - 11 only\n\t\t\t\t// elem.tabIndex doesn\'t always return the\n\t\t\t\t// correct value when it hasn\'t been explicitly set\n\t\t\t\t// Use proper attribute retrieval (trac-12072)\n\t\t\t\tvar tabindex = jQuery.find.attr( elem, "tabindex" );\n\n\t\t\t\tif ( tabindex ) {\n\t\t\t\t\treturn parseInt( tabindex, 10 );\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\trfocusable.test( elem.nodeName ) ||\n\t\t\t\t\trclickable.test( elem.nodeName ) &&\n\t\t\t\t\telem.href\n\t\t\t\t) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}\n\t},\n\n\tpropFix: {\n\t\t"for": "htmlFor",\n\t\t"class": "className"\n\t}\n} );\n\n// Support: IE <=11 only\n// Accessing the selectedIndex property\n// forces the browser to respect setting selected\n// on the option\n// The getter ensures a default option is selected\n// when in an optgroup\n// eslint rule "no-unused-expressions" is disabled for this code\n// since it considers such accessions noop\nif ( !support.optSelected ) {\n\tjQuery.propHooks.selected = {\n\t\tget: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: "off" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent && parent.parentNode ) {\n\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\tset: function( elem ) {\n\n\t\t\t/* eslint no-unused-expressions: "off" */\n\n\t\t\tvar parent = elem.parentNode;\n\t\t\tif ( parent ) {\n\t\t\t\tparent.selectedIndex;\n\n\t\t\t\tif ( parent.parentNode ) {\n\t\t\t\t\tparent.parentNode.selectedIndex;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\njQuery.each( [\n\t"tabIndex",\n\t"readOnly",\n\t"maxLength",\n\t"cellSpacing",\n\t"cellPadding",\n\t"rowSpan",\n\t"colSpan",\n\t"useMap",\n\t"frameBorder",\n\t"contentEditable"\n], function() {\n\tjQuery.propFix[ this.toLowerCase() ] = this;\n} );\n\n\n\n\n\t// Strip and collapse whitespace according to HTML spec\n\t// https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\n\tfunction stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( " " );\n\t}\n\n\nfunction getClass( elem ) {\n\treturn elem.getAttribute && elem.getAttribute( "class" ) || "";\n}\n\nfunction classesToArray( value ) {\n\tif ( Array.isArray( value ) ) {\n\t\treturn value;\n\t}\n\tif ( typeof value === "string" ) {\n\t\treturn value.match( rnothtmlwhite ) || [];\n\t}\n\treturn [];\n}\n\njQuery.fn.extend( {\n\taddClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\t\t\t\tcur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\t\t\t\t\t\tif ( cur.indexOf( " " + className + " " ) < 0 ) {\n\t\t\t\t\t\t\tcur += className + " ";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( "class", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\tremoveClass: function( value ) {\n\t\tvar classNames, cur, curValue, className, i, finalValue;\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( j ) {\n\t\t\t\tjQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\n\t\t\t} );\n\t\t}\n\n\t\tif ( !arguments.length ) {\n\t\t\treturn this.attr( "class", "" );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\tif ( classNames.length ) {\n\t\t\treturn this.each( function() {\n\t\t\t\tcurValue = getClass( this );\n\n\t\t\t\t// This expression is here for better compressibility (see addClass)\n\t\t\t\tcur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );\n\n\t\t\t\tif ( cur ) {\n\t\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t\t// Remove *all* instances\n\t\t\t\t\t\twhile ( cur.indexOf( " " + className + " " ) > -1 ) {\n\t\t\t\t\t\t\tcur = cur.replace( " " + className + " ", " " );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Only assign if different to avoid unneeded rendering.\n\t\t\t\t\tfinalValue = stripAndCollapse( cur );\n\t\t\t\t\tif ( curValue !== finalValue ) {\n\t\t\t\t\t\tthis.setAttribute( "class", finalValue );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\ttoggleClass: function( value, stateVal ) {\n\t\tvar classNames, className, i, self,\n\t\t\ttype = typeof value,\n\t\t\tisValidValue = type === "string" || Array.isArray( value );\n\n\t\tif ( isFunction( value ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).toggleClass(\n\t\t\t\t\tvalue.call( this, i, getClass( this ), stateVal ),\n\t\t\t\t\tstateVal\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\tif ( typeof stateVal === "boolean" && isValidValue ) {\n\t\t\treturn stateVal ? this.addClass( value ) : this.removeClass( value );\n\t\t}\n\n\t\tclassNames = classesToArray( value );\n\n\t\treturn this.each( function() {\n\t\t\tif ( isValidValue ) {\n\n\t\t\t\t// Toggle individual class names\n\t\t\t\tself = jQuery( this );\n\n\t\t\t\tfor ( i = 0; i < classNames.length; i++ ) {\n\t\t\t\t\tclassName = classNames[ i ];\n\n\t\t\t\t\t// Check each className given, space separated list\n\t\t\t\t\tif ( self.hasClass( className ) ) {\n\t\t\t\t\t\tself.removeClass( className );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.addClass( className );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// Toggle whole class name\n\t\t\t} else if ( value === undefined || type === "boolean" ) {\n\t\t\t\tclassName = getClass( this );\n\t\t\t\tif ( className ) {\n\n\t\t\t\t\t// Store className if set\n\t\t\t\t\tdataPriv.set( this, "__className__", className );\n\t\t\t\t}\n\n\t\t\t\t// If the element has a class name or if we\'re passed `false`,\n\t\t\t\t// then remove the whole classname (if there was one, the above saved it).\n\t\t\t\t// Otherwise bring back whatever was previously saved (if anything),\n\t\t\t\t// falling back to the empty string if nothing was stored.\n\t\t\t\tif ( this.setAttribute ) {\n\t\t\t\t\tthis.setAttribute( "class",\n\t\t\t\t\t\tclassName || value === false ?\n\t\t\t\t\t\t\t"" :\n\t\t\t\t\t\t\tdataPriv.get( this, "__className__" ) || ""\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t},\n\n\thasClass: function( selector ) {\n\t\tvar className, elem,\n\t\t\ti = 0;\n\n\t\tclassName = " " + selector + " ";\n\t\twhile ( ( elem = this[ i++ ] ) ) {\n\t\t\tif ( elem.nodeType === 1 &&\n\t\t\t\t( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n} );\n\n\n\n\nvar rreturn = /\\r/g;\n\njQuery.fn.extend( {\n\tval: function( value ) {\n\t\tvar hooks, ret, valueIsFunction,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !arguments.length ) {\n\t\t\tif ( elem ) {\n\t\t\t\thooks = jQuery.valHooks[ elem.type ] ||\n\t\t\t\t\tjQuery.valHooks[ elem.nodeName.toLowerCase() ];\n\n\t\t\t\tif ( hooks &&\n\t\t\t\t\t"get" in hooks &&\n\t\t\t\t\t( ret = hooks.get( elem, "value" ) ) !== undefined\n\t\t\t\t) {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\n\t\t\t\tret = elem.value;\n\n\t\t\t\t// Handle most common string cases\n\t\t\t\tif ( typeof ret === "string" ) {\n\t\t\t\t\treturn ret.replace( rreturn, "" );\n\t\t\t\t}\n\n\t\t\t\t// Handle cases where value is null/undef or number\n\t\t\t\treturn ret == null ? "" : ret;\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tvalueIsFunction = isFunction( value );\n\n\t\treturn this.each( function( i ) {\n\t\t\tvar val;\n\n\t\t\tif ( this.nodeType !== 1 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( valueIsFunction ) {\n\t\t\t\tval = value.call( this, i, jQuery( this ).val() );\n\t\t\t} else {\n\t\t\t\tval = value;\n\t\t\t}\n\n\t\t\t// Treat null/undefined as ""; convert numbers to string\n\t\t\tif ( val == null ) {\n\t\t\t\tval = "";\n\n\t\t\t} else if ( typeof val === "number" ) {\n\t\t\t\tval += "";\n\n\t\t\t} else if ( Array.isArray( val ) ) {\n\t\t\t\tval = jQuery.map( val, function( value ) {\n\t\t\t\t\treturn value == null ? "" : value + "";\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\thooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\n\n\t\t\t// If set returns undefined, fall back to normal setting\n\t\t\tif ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {\n\t\t\t\tthis.value = val;\n\t\t\t}\n\t\t} );\n\t}\n} );\n\njQuery.extend( {\n\tvalHooks: {\n\t\toption: {\n\t\t\tget: function( elem ) {\n\n\t\t\t\tvar val = jQuery.find.attr( elem, "value" );\n\t\t\t\treturn val != null ?\n\t\t\t\t\tval :\n\n\t\t\t\t\t// Support: IE <=10 - 11 only\n\t\t\t\t\t// option.text throws exceptions (trac-14686, trac-14858)\n\t\t\t\t\t// Strip and collapse whitespace\n\t\t\t\t\t// https://html.spec.whatwg.org/#strip-and-collapse-whitespace\n\t\t\t\t\tstripAndCollapse( jQuery.text( elem ) );\n\t\t\t}\n\t\t},\n\t\tselect: {\n\t\t\tget: function( elem ) {\n\t\t\t\tvar value, option, i,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tindex = elem.selectedIndex,\n\t\t\t\t\tone = elem.type === "select-one",\n\t\t\t\t\tvalues = one ? null : [],\n\t\t\t\t\tmax = one ? index + 1 : options.length;\n\n\t\t\t\tif ( index < 0 ) {\n\t\t\t\t\ti = max;\n\n\t\t\t\t} else {\n\t\t\t\t\ti = one ? index : 0;\n\t\t\t\t}\n\n\t\t\t\t// Loop through all the selected options\n\t\t\t\tfor ( ; i < max; i++ ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t// IE8-9 doesn\'t update selected after form reset (trac-2551)\n\t\t\t\t\tif ( ( option.selected || i === index ) &&\n\n\t\t\t\t\t\t\t// Don\'t return options that are disabled or in a disabled optgroup\n\t\t\t\t\t\t\t!option.disabled &&\n\t\t\t\t\t\t\t( !option.parentNode.disabled ||\n\t\t\t\t\t\t\t\t!nodeName( option.parentNode, "optgroup" ) ) ) {\n\n\t\t\t\t\t\t// Get the specific value for the option\n\t\t\t\t\t\tvalue = jQuery( option ).val();\n\n\t\t\t\t\t\t// We don\'t need an array for one selects\n\t\t\t\t\t\tif ( one ) {\n\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Multi-Selects return an array\n\t\t\t\t\t\tvalues.push( value );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t},\n\n\t\t\tset: function( elem, value ) {\n\t\t\t\tvar optionSet, option,\n\t\t\t\t\toptions = elem.options,\n\t\t\t\t\tvalues = jQuery.makeArray( value ),\n\t\t\t\t\ti = options.length;\n\n\t\t\t\twhile ( i-- ) {\n\t\t\t\t\toption = options[ i ];\n\n\t\t\t\t\t/* eslint-disable no-cond-assign */\n\n\t\t\t\t\tif ( option.selected =\n\t\t\t\t\t\tjQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\n\t\t\t\t\t) {\n\t\t\t\t\t\toptionSet = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* eslint-enable no-cond-assign */\n\t\t\t\t}\n\n\t\t\t\t// Force browsers to behave consistently when non-matching value is set\n\t\t\t\tif ( !optionSet ) {\n\t\t\t\t\telem.selectedIndex = -1;\n\t\t\t\t}\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\t}\n} );\n\n// Radios and checkboxes getter/setter\njQuery.each( [ "radio", "checkbox" ], function() {\n\tjQuery.valHooks[ this ] = {\n\t\tset: function( elem, value ) {\n\t\t\tif ( Array.isArray( value ) ) {\n\t\t\t\treturn ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\n\t\t\t}\n\t\t}\n\t};\n\tif ( !support.checkOn ) {\n\t\tjQuery.valHooks[ this ].get = function( elem ) {\n\t\t\treturn elem.getAttribute( "value" ) === null ? "on" : elem.value;\n\t\t};\n\t}\n} );\n\n\n\n\n// Return jQuery for attributes-only inclusion\n\n\nsupport.focusin = "onfocusin" in window;\n\n\nvar rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\n\tstopPropagationCallback = function( e ) {\n\t\te.stopPropagation();\n\t};\n\njQuery.extend( jQuery.event, {\n\n\ttrigger: function( event, data, elem, onlyHandlers ) {\n\n\t\tvar i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\n\t\t\teventPath = [ elem || document ],\n\t\t\ttype = hasOwn.call( event, "type" ) ? event.type : event,\n\t\t\tnamespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];\n\n\t\tcur = lastElement = tmp = elem = elem || document;\n\n\t\t// Don\'t do events on text and comment nodes\n\t\tif ( elem.nodeType === 3 || elem.nodeType === 8 ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus/blur morphs to focusin/out; ensure we\'re not firing them right now\n\t\tif ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( type.indexOf( "." ) > -1 ) {\n\n\t\t\t// Namespaced trigger; create a regexp to match event type in handle()\n\t\t\tnamespaces = type.split( "." );\n\t\t\ttype = namespaces.shift();\n\t\t\tnamespaces.sort();\n\t\t}\n\t\tontype = type.indexOf( ":" ) < 0 && "on" + type;\n\n\t\t// Caller can pass in a jQuery.Event object, Object, or just an event type string\n\t\tevent = event[ jQuery.expando ] ?\n\t\t\tevent :\n\t\t\tnew jQuery.Event( type, typeof event === "object" && event );\n\n\t\t// Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\n\t\tevent.isTrigger = onlyHandlers ? 2 : 3;\n\t\tevent.namespace = namespaces.join( "." );\n\t\tevent.rnamespace = event.namespace ?\n\t\t\tnew RegExp( "(^|\\\\.)" + namespaces.join( "\\\\.(?:.*\\\\.|)" ) + "(\\\\.|$)" ) :\n\t\t\tnull;\n\n\t\t// Clean up the event in case it is being reused\n\t\tevent.result = undefined;\n\t\tif ( !event.target ) {\n\t\t\tevent.target = elem;\n\t\t}\n\n\t\t// Clone any incoming data and prepend the event, creating the handler arg list\n\t\tdata = data == null ?\n\t\t\t[ event ] :\n\t\t\tjQuery.makeArray( data, [ event ] );\n\n\t\t// Allow special events to draw outside the lines\n\t\tspecial = jQuery.event.special[ type ] || {};\n\t\tif ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Determine event propagation path in advance, per W3C events spec (trac-9951)\n\t\t// Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724)\n\t\tif ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\n\n\t\t\tbubbleType = special.delegateType || type;\n\t\t\tif ( !rfocusMorph.test( bubbleType + type ) ) {\n\t\t\t\tcur = cur.parentNode;\n\t\t\t}\n\t\t\tfor ( ; cur; cur = cur.parentNode ) {\n\t\t\t\teventPath.push( cur );\n\t\t\t\ttmp = cur;\n\t\t\t}\n\n\t\t\t// Only add window if we got to document (e.g., not plain obj or detached DOM)\n\t\t\tif ( tmp === ( elem.ownerDocument || document ) ) {\n\t\t\t\teventPath.push( tmp.defaultView || tmp.parentWindow || window );\n\t\t\t}\n\t\t}\n\n\t\t// Fire handlers on the event path\n\t\ti = 0;\n\t\twhile ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\n\t\t\tlastElement = cur;\n\t\t\tevent.type = i > 1 ?\n\t\t\t\tbubbleType :\n\t\t\t\tspecial.bindType || type;\n\n\t\t\t// jQuery handler\n\t\t\thandle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&\n\t\t\t\tdataPriv.get( cur, "handle" );\n\t\t\tif ( handle ) {\n\t\t\t\thandle.apply( cur, data );\n\t\t\t}\n\n\t\t\t// Native handler\n\t\t\thandle = ontype && cur[ ontype ];\n\t\t\tif ( handle && handle.apply && acceptData( cur ) ) {\n\t\t\t\tevent.result = handle.apply( cur, data );\n\t\t\t\tif ( event.result === false ) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tevent.type = type;\n\n\t\t// If nobody prevented the default action, do it now\n\t\tif ( !onlyHandlers && !event.isDefaultPrevented() ) {\n\n\t\t\tif ( ( !special._default ||\n\t\t\t\tspecial._default.apply( eventPath.pop(), data ) === false ) &&\n\t\t\t\tacceptData( elem ) ) {\n\n\t\t\t\t// Call a native DOM method on the target with the same name as the event.\n\t\t\t\t// Don\'t do default actions on window, that\'s where global variables be (trac-6170)\n\t\t\t\tif ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\n\n\t\t\t\t\t// Don\'t re-trigger an onFOO event when we call its FOO() method\n\t\t\t\t\ttmp = elem[ ontype ];\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = null;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prevent re-triggering of the same event, since we already bubbled it above\n\t\t\t\t\tjQuery.event.triggered = type;\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.addEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\telem[ type ]();\n\n\t\t\t\t\tif ( event.isPropagationStopped() ) {\n\t\t\t\t\t\tlastElement.removeEventListener( type, stopPropagationCallback );\n\t\t\t\t\t}\n\n\t\t\t\t\tjQuery.event.triggered = undefined;\n\n\t\t\t\t\tif ( tmp ) {\n\t\t\t\t\t\telem[ ontype ] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn event.result;\n\t},\n\n\t// Piggyback on a donor event to simulate a different one\n\t// Used only for `focus(in | out)` events\n\tsimulate: function( type, elem, event ) {\n\t\tvar e = jQuery.extend(\n\t\t\tnew jQuery.Event(),\n\t\t\tevent,\n\t\t\t{\n\t\t\t\ttype: type,\n\t\t\t\tisSimulated: true\n\t\t\t}\n\t\t);\n\n\t\tjQuery.event.trigger( e, null, elem );\n\t}\n\n} );\n\njQuery.fn.extend( {\n\n\ttrigger: function( type, data ) {\n\t\treturn this.each( function() {\n\t\t\tjQuery.event.trigger( type, data, this );\n\t\t} );\n\t},\n\ttriggerHandler: function( type, data ) {\n\t\tvar elem = this[ 0 ];\n\t\tif ( elem ) {\n\t\t\treturn jQuery.event.trigger( type, data, elem, true );\n\t\t}\n\t}\n} );\n\n\n// Support: Firefox <=44\n// Firefox doesn\'t have focus(in | out) events\n// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\n//\n// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\n// focus(in | out) events fire after focus & blur events,\n// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\n// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\nif ( !support.focusin ) {\n\tjQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {\n\n\t\t// Attach a single capturing handler on the document while someone wants focusin/focusout\n\t\tvar handler = function( event ) {\n\t\t\tjQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\n\t\t};\n\n\t\tjQuery.event.special[ fix ] = {\n\t\t\tsetup: function() {\n\n\t\t\t\t// Handle: regular nodes (via `this.ownerDocument`), window\n\t\t\t\t// (via `this.document`) & document (via `this`).\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix );\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.addEventListener( orig, handler, true );\n\t\t\t\t}\n\t\t\t\tdataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\n\t\t\t},\n\t\t\tteardown: function() {\n\t\t\t\tvar doc = this.ownerDocument || this.document || this,\n\t\t\t\t\tattaches = dataPriv.access( doc, fix ) - 1;\n\n\t\t\t\tif ( !attaches ) {\n\t\t\t\t\tdoc.removeEventListener( orig, handler, true );\n\t\t\t\t\tdataPriv.remove( doc, fix );\n\n\t\t\t\t} else {\n\t\t\t\t\tdataPriv.access( doc, fix, attaches );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t} );\n}\nvar location = window.location;\n\nvar nonce = { guid: Date.now() };\n\nvar rquery = ( /\\?/ );\n\n\n\n// Cross-browser xml parsing\njQuery.parseXML = function( data ) {\n\tvar xml, parserErrorElem;\n\tif ( !data || typeof data !== "string" ) {\n\t\treturn null;\n\t}\n\n\t// Support: IE 9 - 11 only\n\t// IE throws on parseFromString with invalid input.\n\ttry {\n\t\txml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );\n\t} catch ( e ) {}\n\n\tparserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];\n\tif ( !xml || parserErrorElem ) {\n\t\tjQuery.error( "Invalid XML: " + (\n\t\t\tparserErrorElem ?\n\t\t\t\tjQuery.map( parserErrorElem.childNodes, function( el ) {\n\t\t\t\t\treturn el.textContent;\n\t\t\t\t} ).join( "\\n" ) :\n\t\t\t\tdata\n\t\t) );\n\t}\n\treturn xml;\n};\n\n\nvar\n\trbracket = /\\[\\]$/,\n\trCRLF = /\\r?\\n/g,\n\trsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\n\trsubmittable = /^(?:input|select|textarea|keygen)/i;\n\nfunction buildParams( prefix, obj, traditional, add ) {\n\tvar name;\n\n\tif ( Array.isArray( obj ) ) {\n\n\t\t// Serialize array item.\n\t\tjQuery.each( obj, function( i, v ) {\n\t\t\tif ( traditional || rbracket.test( prefix ) ) {\n\n\t\t\t\t// Treat each array item as a scalar.\n\t\t\t\tadd( prefix, v );\n\n\t\t\t} else {\n\n\t\t\t\t// Item is non-scalar (array or object), encode its numeric index.\n\t\t\t\tbuildParams(\n\t\t\t\t\tprefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",\n\t\t\t\t\tv,\n\t\t\t\t\ttraditional,\n\t\t\t\t\tadd\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\n\t} else if ( !traditional && toType( obj ) === "object" ) {\n\n\t\t// Serialize object item.\n\t\tfor ( name in obj ) {\n\t\t\tbuildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );\n\t\t}\n\n\t} else {\n\n\t\t// Serialize scalar item.\n\t\tadd( prefix, obj );\n\t}\n}\n\n// Serialize an array of form elements or a set of\n// key/values into a query string\njQuery.param = function( a, traditional ) {\n\tvar prefix,\n\t\ts = [],\n\t\tadd = function( key, valueOrFunction ) {\n\n\t\t\t// If value is a function, invoke it and use its return value\n\t\t\tvar value = isFunction( valueOrFunction ) ?\n\t\t\t\tvalueOrFunction() :\n\t\t\t\tvalueOrFunction;\n\n\t\t\ts[ s.length ] = encodeURIComponent( key ) + "=" +\n\t\t\t\tencodeURIComponent( value == null ? "" : value );\n\t\t};\n\n\tif ( a == null ) {\n\t\treturn "";\n\t}\n\n\t// If an array was passed in, assume that it is an array of form elements.\n\tif ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\n\n\t\t// Serialize the form elements\n\t\tjQuery.each( a, function() {\n\t\t\tadd( this.name, this.value );\n\t\t} );\n\n\t} else {\n\n\t\t// If traditional, encode the "old" way (the way 1.3.2 or older\n\t\t// did it), otherwise encode params recursively.\n\t\tfor ( prefix in a ) {\n\t\t\tbuildParams( prefix, a[ prefix ], traditional, add );\n\t\t}\n\t}\n\n\t// Return the resulting serialization\n\treturn s.join( "&" );\n};\n\njQuery.fn.extend( {\n\tserialize: function() {\n\t\treturn jQuery.param( this.serializeArray() );\n\t},\n\tserializeArray: function() {\n\t\treturn this.map( function() {\n\n\t\t\t// Can add propHook for "elements" to filter or add form elements\n\t\t\tvar elements = jQuery.prop( this, "elements" );\n\t\t\treturn elements ? jQuery.makeArray( elements ) : this;\n\t\t} ).filter( function() {\n\t\t\tvar type = this.type;\n\n\t\t\t// Use .is( ":disabled" ) so that fieldset[disabled] works\n\t\t\treturn this.name && !jQuery( this ).is( ":disabled" ) &&\n\t\t\t\trsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\n\t\t\t\t( this.checked || !rcheckableType.test( type ) );\n\t\t} ).map( function( _i, elem ) {\n\t\t\tvar val = jQuery( this ).val();\n\n\t\t\tif ( val == null ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tif ( Array.isArray( val ) ) {\n\t\t\t\treturn jQuery.map( val, function( val ) {\n\t\t\t\t\treturn { name: elem.name, value: val.replace( rCRLF, "\\r\\n" ) };\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\treturn { name: elem.name, value: val.replace( rCRLF, "\\r\\n" ) };\n\t\t} ).get();\n\t}\n} );\n\n\nvar\n\tr20 = /%20/g,\n\trhash = /#.*$/,\n\trantiCache = /([?&])_=[^&]*/,\n\trheaders = /^(.*?):[ \\t]*([^\\r\\n]*)$/mg,\n\n\t// trac-7653, trac-8125, trac-8152: local protocol detection\n\trlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\n\trnoContent = /^(?:GET|HEAD)$/,\n\trprotocol = /^\\/\\//,\n\n\t/* Prefilters\n\t * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\n\t * 2) These are called:\n\t * - BEFORE asking for a transport\n\t * - AFTER param serialization (s.data is a string if s.processData is true)\n\t * 3) key is the dataType\n\t * 4) the catchall symbol "*" can be used\n\t * 5) execution will start with transport dataType and THEN continue down to "*" if needed\n\t */\n\tprefilters = {},\n\n\t/* Transports bindings\n\t * 1) key is the dataType\n\t * 2) the catchall symbol "*" can be used\n\t * 3) selection will start with transport dataType and THEN go to "*" if needed\n\t */\n\ttransports = {},\n\n\t// Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression\n\tallTypes = "*/".concat( "*" ),\n\n\t// Anchor tag for parsing the document origin\n\toriginAnchor = document.createElement( "a" );\n\noriginAnchor.href = location.href;\n\n// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\nfunction addToPrefiltersOrTransports( structure ) {\n\n\t// dataTypeExpression is optional and defaults to "*"\n\treturn function( dataTypeExpression, func ) {\n\n\t\tif ( typeof dataTypeExpression !== "string" ) {\n\t\t\tfunc = dataTypeExpression;\n\t\t\tdataTypeExpression = "*";\n\t\t}\n\n\t\tvar dataType,\n\t\t\ti = 0,\n\t\t\tdataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\n\n\t\tif ( isFunction( func ) ) {\n\n\t\t\t// For each dataType in the dataTypeExpression\n\t\t\twhile ( ( dataType = dataTypes[ i++ ] ) ) {\n\n\t\t\t\t// Prepend if requested\n\t\t\t\tif ( dataType[ 0 ] === "+" ) {\n\t\t\t\t\tdataType = dataType.slice( 1 ) || "*";\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\n\n\t\t\t\t// Otherwise append\n\t\t\t\t} else {\n\t\t\t\t\t( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Base inspection function for prefilters and transports\nfunction inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\n\n\tvar inspected = {},\n\t\tseekingTransport = ( structure === transports );\n\n\tfunction inspect( dataType ) {\n\t\tvar selected;\n\t\tinspected[ dataType ] = true;\n\t\tjQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\n\t\t\tvar dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\n\t\t\tif ( typeof dataTypeOrTransport === "string" &&\n\t\t\t\t!seekingTransport && !inspected[ dataTypeOrTransport ] ) {\n\n\t\t\t\toptions.dataTypes.unshift( dataTypeOrTransport );\n\t\t\t\tinspect( dataTypeOrTransport );\n\t\t\t\treturn false;\n\t\t\t} else if ( seekingTransport ) {\n\t\t\t\treturn !( selected = dataTypeOrTransport );\n\t\t\t}\n\t\t} );\n\t\treturn selected;\n\t}\n\n\treturn inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );\n}\n\n// A special extend for ajax options\n// that takes "flat" options (not to be deep extended)\n// Fixes trac-9887\nfunction ajaxExtend( target, src ) {\n\tvar key, deep,\n\t\tflatOptions = jQuery.ajaxSettings.flatOptions || {};\n\n\tfor ( key in src ) {\n\t\tif ( src[ key ] !== undefined ) {\n\t\t\t( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\n\t\t}\n\t}\n\tif ( deep ) {\n\t\tjQuery.extend( true, target, deep );\n\t}\n\n\treturn target;\n}\n\n/* Handles responses to an ajax request:\n * - finds the right dataType (mediates between content-type and expected dataType)\n * - returns the corresponding response\n */\nfunction ajaxHandleResponses( s, jqXHR, responses ) {\n\n\tvar ct, type, finalDataType, firstDataType,\n\t\tcontents = s.contents,\n\t\tdataTypes = s.dataTypes;\n\n\t// Remove auto dataType and get content-type in the process\n\twhile ( dataTypes[ 0 ] === "*" ) {\n\t\tdataTypes.shift();\n\t\tif ( ct === undefined ) {\n\t\t\tct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );\n\t\t}\n\t}\n\n\t// Check if we\'re dealing with a known content-type\n\tif ( ct ) {\n\t\tfor ( type in contents ) {\n\t\t\tif ( contents[ type ] && contents[ type ].test( ct ) ) {\n\t\t\t\tdataTypes.unshift( type );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Check to see if we have a response for the expected dataType\n\tif ( dataTypes[ 0 ] in responses ) {\n\t\tfinalDataType = dataTypes[ 0 ];\n\t} else {\n\n\t\t// Try convertible dataTypes\n\t\tfor ( type in responses ) {\n\t\t\tif ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {\n\t\t\t\tfinalDataType = type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ( !firstDataType ) {\n\t\t\t\tfirstDataType = type;\n\t\t\t}\n\t\t}\n\n\t\t// Or just use first one\n\t\tfinalDataType = finalDataType || firstDataType;\n\t}\n\n\t// If we found a dataType\n\t// We add the dataType to the list if needed\n\t// and return the corresponding response\n\tif ( finalDataType ) {\n\t\tif ( finalDataType !== dataTypes[ 0 ] ) {\n\t\t\tdataTypes.unshift( finalDataType );\n\t\t}\n\t\treturn responses[ finalDataType ];\n\t}\n}\n\n/* Chain conversions given the request and the original response\n * Also sets the responseXXX fields on the jqXHR instance\n */\nfunction ajaxConvert( s, response, jqXHR, isSuccess ) {\n\tvar conv2, current, conv, tmp, prev,\n\t\tconverters = {},\n\n\t\t// Work with a copy of dataTypes in case we need to modify it for conversion\n\t\tdataTypes = s.dataTypes.slice();\n\n\t// Create converters map with lowercased keys\n\tif ( dataTypes[ 1 ] ) {\n\t\tfor ( conv in s.converters ) {\n\t\t\tconverters[ conv.toLowerCase() ] = s.converters[ conv ];\n\t\t}\n\t}\n\n\tcurrent = dataTypes.shift();\n\n\t// Convert to each sequential dataType\n\twhile ( current ) {\n\n\t\tif ( s.responseFields[ current ] ) {\n\t\t\tjqXHR[ s.responseFields[ current ] ] = response;\n\t\t}\n\n\t\t// Apply the dataFilter if provided\n\t\tif ( !prev && isSuccess && s.dataFilter ) {\n\t\t\tresponse = s.dataFilter( response, s.dataType );\n\t\t}\n\n\t\tprev = current;\n\t\tcurrent = dataTypes.shift();\n\n\t\tif ( current ) {\n\n\t\t\t// There\'s only work to do if current dataType is non-auto\n\t\t\tif ( current === "*" ) {\n\n\t\t\t\tcurrent = prev;\n\n\t\t\t// Convert response if prev dataType is non-auto and differs from current\n\t\t\t} else if ( prev !== "*" && prev !== current ) {\n\n\t\t\t\t// Seek a direct converter\n\t\t\t\tconv = converters[ prev + " " + current ] || converters[ "* " + current ];\n\n\t\t\t\t// If none found, seek a pair\n\t\t\t\tif ( !conv ) {\n\t\t\t\t\tfor ( conv2 in converters ) {\n\n\t\t\t\t\t\t// If conv2 outputs current\n\t\t\t\t\t\ttmp = conv2.split( " " );\n\t\t\t\t\t\tif ( tmp[ 1 ] === current ) {\n\n\t\t\t\t\t\t\t// If prev can be converted to accepted input\n\t\t\t\t\t\t\tconv = converters[ prev + " " + tmp[ 0 ] ] ||\n\t\t\t\t\t\t\t\tconverters[ "* " + tmp[ 0 ] ];\n\t\t\t\t\t\t\tif ( conv ) {\n\n\t\t\t\t\t\t\t\t// Condense equivalence converters\n\t\t\t\t\t\t\t\tif ( conv === true ) {\n\t\t\t\t\t\t\t\t\tconv = converters[ conv2 ];\n\n\t\t\t\t\t\t\t\t// Otherwise, insert the intermediate dataType\n\t\t\t\t\t\t\t\t} else if ( converters[ conv2 ] !== true ) {\n\t\t\t\t\t\t\t\t\tcurrent = tmp[ 0 ];\n\t\t\t\t\t\t\t\t\tdataTypes.unshift( tmp[ 1 ] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Apply converter (if not an equivalence)\n\t\t\t\tif ( conv !== true ) {\n\n\t\t\t\t\t// Unless errors are allowed to bubble, catch and return them\n\t\t\t\t\tif ( conv && s.throws ) {\n\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresponse = conv( response );\n\t\t\t\t\t\t} catch ( e ) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tstate: "parsererror",\n\t\t\t\t\t\t\t\terror: conv ? e : "No conversion from " + prev + " to " + current\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { state: "success", data: response };\n}\n\njQuery.extend( {\n\n\t// Counter for holding the number of active queries\n\tactive: 0,\n\n\t// Last-Modified header cache for next request\n\tlastModified: {},\n\tetag: {},\n\n\tajaxSettings: {\n\t\turl: location.href,\n\t\ttype: "GET",\n\t\tisLocal: rlocalProtocol.test( location.protocol ),\n\t\tglobal: true,\n\t\tprocessData: true,\n\t\tasync: true,\n\t\tcontentType: "application/x-www-form-urlencoded; charset=UTF-8",\n\n\t\t/*\n\t\ttimeout: 0,\n\t\tdata: null,\n\t\tdataType: null,\n\t\tusername: null,\n\t\tpassword: null,\n\t\tcache: null,\n\t\tthrows: false,\n\t\ttraditional: false,\n\t\theaders: {},\n\t\t*/\n\n\t\taccepts: {\n\t\t\t"*": allTypes,\n\t\t\ttext: "text/plain",\n\t\t\thtml: "text/html",\n\t\t\txml: "application/xml, text/xml",\n\t\t\tjson: "application/json, text/javascript"\n\t\t},\n\n\t\tcontents: {\n\t\t\txml: /\\bxml\\b/,\n\t\t\thtml: /\\bhtml/,\n\t\t\tjson: /\\bjson\\b/\n\t\t},\n\n\t\tresponseFields: {\n\t\t\txml: "responseXML",\n\t\t\ttext: "responseText",\n\t\t\tjson: "responseJSON"\n\t\t},\n\n\t\t// Data converters\n\t\t// Keys separate source (or catchall "*") and destination types with a single space\n\t\tconverters: {\n\n\t\t\t// Convert anything to text\n\t\t\t"* text": String,\n\n\t\t\t// Text to html (true = no transformation)\n\t\t\t"text html": true,\n\n\t\t\t// Evaluate text as a json expression\n\t\t\t"text json": JSON.parse,\n\n\t\t\t// Parse text as xml\n\t\t\t"text xml": jQuery.parseXML\n\t\t},\n\n\t\t// For options that shouldn\'t be deep extended:\n\t\t// you can add your own custom options here if\n\t\t// and when you create one that shouldn\'t be\n\t\t// deep extended (see ajaxExtend)\n\t\tflatOptions: {\n\t\t\turl: true,\n\t\t\tcontext: true\n\t\t}\n\t},\n\n\t// Creates a full fledged settings object into target\n\t// with both ajaxSettings and settings fields.\n\t// If target is omitted, writes into ajaxSettings.\n\tajaxSetup: function( target, settings ) {\n\t\treturn settings ?\n\n\t\t\t// Building a settings object\n\t\t\tajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\n\n\t\t\t// Extending ajaxSettings\n\t\t\tajaxExtend( jQuery.ajaxSettings, target );\n\t},\n\n\tajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\n\tajaxTransport: addToPrefiltersOrTransports( transports ),\n\n\t// Main method\n\tajax: function( url, options ) {\n\n\t\t// If url is an object, simulate pre-1.5 signature\n\t\tif ( typeof url === "object" ) {\n\t\t\toptions = url;\n\t\t\turl = undefined;\n\t\t}\n\n\t\t// Force options to be an object\n\t\toptions = options || {};\n\n\t\tvar transport,\n\n\t\t\t// URL without anti-cache param\n\t\t\tcacheURL,\n\n\t\t\t// Response headers\n\t\t\tresponseHeadersString,\n\t\t\tresponseHeaders,\n\n\t\t\t// timeout handle\n\t\t\ttimeoutTimer,\n\n\t\t\t// Url cleanup var\n\t\t\turlAnchor,\n\n\t\t\t// Request state (becomes false upon send and true upon completion)\n\t\t\tcompleted,\n\n\t\t\t// To know if global events are to be dispatched\n\t\t\tfireGlobals,\n\n\t\t\t// Loop variable\n\t\t\ti,\n\n\t\t\t// uncached part of the url\n\t\t\tuncached,\n\n\t\t\t// Create the final options object\n\t\t\ts = jQuery.ajaxSetup( {}, options ),\n\n\t\t\t// Callbacks context\n\t\t\tcallbackContext = s.context || s,\n\n\t\t\t// Context for global events is callbackContext if it is a DOM node or jQuery collection\n\t\t\tglobalEventContext = s.context &&\n\t\t\t\t( callbackContext.nodeType || callbackContext.jquery ) ?\n\t\t\t\tjQuery( callbackContext ) :\n\t\t\t\tjQuery.event,\n\n\t\t\t// Deferreds\n\t\t\tdeferred = jQuery.Deferred(),\n\t\t\tcompleteDeferred = jQuery.Callbacks( "once memory" ),\n\n\t\t\t// Status-dependent callbacks\n\t\t\tstatusCode = s.statusCode || {},\n\n\t\t\t// Headers (they are sent all at once)\n\t\t\trequestHeaders = {},\n\t\t\trequestHeadersNames = {},\n\n\t\t\t// Default abort message\n\t\t\tstrAbort = "canceled",\n\n\t\t\t// Fake xhr\n\t\t\tjqXHR = {\n\t\t\t\treadyState: 0,\n\n\t\t\t\t// Builds headers hashtable if needed\n\t\t\t\tgetResponseHeader: function( key ) {\n\t\t\t\t\tvar match;\n\t\t\t\t\tif ( completed ) {\n\t\t\t\t\t\tif ( !responseHeaders ) {\n\t\t\t\t\t\t\tresponseHeaders = {};\n\t\t\t\t\t\t\twhile ( ( match = rheaders.exec( responseHeadersString ) ) ) {\n\t\t\t\t\t\t\t\tresponseHeaders[ match[ 1 ].toLowerCase() + " " ] =\n\t\t\t\t\t\t\t\t\t( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )\n\t\t\t\t\t\t\t\t\t\t.concat( match[ 2 ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmatch = responseHeaders[ key.toLowerCase() + " " ];\n\t\t\t\t\t}\n\t\t\t\t\treturn match == null ? null : match.join( ", " );\n\t\t\t\t},\n\n\t\t\t\t// Raw string\n\t\t\t\tgetAllResponseHeaders: function() {\n\t\t\t\t\treturn completed ? responseHeadersString : null;\n\t\t\t\t},\n\n\t\t\t\t// Caches the header\n\t\t\t\tsetRequestHeader: function( name, value ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\tname = requestHeadersNames[ name.toLowerCase() ] =\n\t\t\t\t\t\t\trequestHeadersNames[ name.toLowerCase() ] || name;\n\t\t\t\t\t\trequestHeaders[ name ] = value;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Overrides response content-type header\n\t\t\t\toverrideMimeType: function( type ) {\n\t\t\t\t\tif ( completed == null ) {\n\t\t\t\t\t\ts.mimeType = type;\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Status-dependent callbacks\n\t\t\t\tstatusCode: function( map ) {\n\t\t\t\t\tvar code;\n\t\t\t\t\tif ( map ) {\n\t\t\t\t\t\tif ( completed ) {\n\n\t\t\t\t\t\t\t// Execute the appropriate callbacks\n\t\t\t\t\t\t\tjqXHR.always( map[ jqXHR.status ] );\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t// Lazy-add the new callbacks in a way that preserves old ones\n\t\t\t\t\t\t\tfor ( code in map ) {\n\t\t\t\t\t\t\t\tstatusCode[ code ] = [ statusCode[ code ], map[ code ] ];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\n\t\t\t\t// Cancel the request\n\t\t\t\tabort: function( statusText ) {\n\t\t\t\t\tvar finalText = statusText || strAbort;\n\t\t\t\t\tif ( transport ) {\n\t\t\t\t\t\ttransport.abort( finalText );\n\t\t\t\t\t}\n\t\t\t\t\tdone( 0, finalText );\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t};\n\n\t\t// Attach deferreds\n\t\tdeferred.promise( jqXHR );\n\n\t\t// Add protocol if not provided (prefilters might expect it)\n\t\t// Handle falsy url in the settings object (trac-10093: consistency with old signature)\n\t\t// We also use the url parameter if available\n\t\ts.url = ( ( url || s.url || location.href ) + "" )\n\t\t\t.replace( rprotocol, location.protocol + "//" );\n\n\t\t// Alias method option to type as per ticket trac-12004\n\t\ts.type = options.method || options.type || s.method || s.type;\n\n\t\t// Extract dataTypes list\n\t\ts.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];\n\n\t\t// A cross-domain request is in order when the origin doesn\'t match the current origin.\n\t\tif ( s.crossDomain == null ) {\n\t\t\turlAnchor = document.createElement( "a" );\n\n\t\t\t// Support: IE <=8 - 11, Edge 12 - 15\n\t\t\t// IE throws exception on accessing the href property if url is malformed,\n\t\t\t// e.g. http://example.com:80x/\n\t\t\ttry {\n\t\t\t\turlAnchor.href = s.url;\n\n\t\t\t\t// Support: IE <=8 - 11 only\n\t\t\t\t// Anchor\'s host property isn\'t correctly set when s.url is relative\n\t\t\t\turlAnchor.href = urlAnchor.href;\n\t\t\t\ts.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==\n\t\t\t\t\turlAnchor.protocol + "//" + urlAnchor.host;\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// If there is an error parsing the URL, assume it is crossDomain,\n\t\t\t\t// it can be rejected by the transport if it is invalid\n\t\t\t\ts.crossDomain = true;\n\t\t\t}\n\t\t}\n\n\t\t// Convert data if not already a string\n\t\tif ( s.data && s.processData && typeof s.data !== "string" ) {\n\t\t\ts.data = jQuery.param( s.data, s.traditional );\n\t\t}\n\n\t\t// Apply prefilters\n\t\tinspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\n\n\t\t// If request was aborted inside a prefilter, stop there\n\t\tif ( completed ) {\n\t\t\treturn jqXHR;\n\t\t}\n\n\t\t// We can fire global events as of now if asked to\n\t\t// Don\'t fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118)\n\t\tfireGlobals = jQuery.event && s.global;\n\n\t\t// Watch for a new set of requests\n\t\tif ( fireGlobals && jQuery.active++ === 0 ) {\n\t\t\tjQuery.event.trigger( "ajaxStart" );\n\t\t}\n\n\t\t// Uppercase the type\n\t\ts.type = s.type.toUpperCase();\n\n\t\t// Determine if request has content\n\t\ts.hasContent = !rnoContent.test( s.type );\n\n\t\t// Save the URL in case we\'re toying with the If-Modified-Since\n\t\t// and/or If-None-Match header later on\n\t\t// Remove hash to simplify url manipulation\n\t\tcacheURL = s.url.replace( rhash, "" );\n\n\t\t// More options handling for requests with no content\n\t\tif ( !s.hasContent ) {\n\n\t\t\t// Remember the hash so we can put it back\n\t\t\tuncached = s.url.slice( cacheURL.length );\n\n\t\t\t// If data is available and should be processed, append data to url\n\t\t\tif ( s.data && ( s.processData || typeof s.data === "string" ) ) {\n\t\t\t\tcacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;\n\n\t\t\t\t// trac-9682: remove data so that it\'s not used in an eventual retry\n\t\t\t\tdelete s.data;\n\t\t\t}\n\n\t\t\t// Add or update anti-cache param if needed\n\t\t\tif ( s.cache === false ) {\n\t\t\t\tcacheURL = cacheURL.replace( rantiCache, "$1" );\n\t\t\t\tuncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +\n\t\t\t\t\tuncached;\n\t\t\t}\n\n\t\t\t// Put hash and anti-cache on the URL that will be requested (gh-1732)\n\t\t\ts.url = cacheURL + uncached;\n\n\t\t// Change \'%20\' to \'+\' if this is encoded form body content (gh-2658)\n\t\t} else if ( s.data && s.processData &&\n\t\t\t( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {\n\t\t\ts.data = s.data.replace( r20, "+" );\n\t\t}\n\n\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\tif ( s.ifModified ) {\n\t\t\tif ( jQuery.lastModified[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );\n\t\t\t}\n\t\t\tif ( jQuery.etag[ cacheURL ] ) {\n\t\t\t\tjqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );\n\t\t\t}\n\t\t}\n\n\t\t// Set the correct header, if data is being sent\n\t\tif ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\n\t\t\tjqXHR.setRequestHeader( "Content-Type", s.contentType );\n\t\t}\n\n\t\t// Set the Accepts header for the server, depending on the dataType\n\t\tjqXHR.setRequestHeader(\n\t\t\t"Accept",\n\t\t\ts.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\n\t\t\t\ts.accepts[ s.dataTypes[ 0 ] ] +\n\t\t\t\t\t( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :\n\t\t\t\ts.accepts[ "*" ]\n\t\t);\n\n\t\t// Check for headers option\n\t\tfor ( i in s.headers ) {\n\t\t\tjqXHR.setRequestHeader( i, s.headers[ i ] );\n\t\t}\n\n\t\t// Allow custom headers/mimetypes and early abort\n\t\tif ( s.beforeSend &&\n\t\t\t( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\n\n\t\t\t// Abort if not done already and return\n\t\t\treturn jqXHR.abort();\n\t\t}\n\n\t\t// Aborting is no longer a cancellation\n\t\tstrAbort = "abort";\n\n\t\t// Install callbacks on deferreds\n\t\tcompleteDeferred.add( s.complete );\n\t\tjqXHR.done( s.success );\n\t\tjqXHR.fail( s.error );\n\n\t\t// Get transport\n\t\ttransport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\n\n\t\t// If no transport, we auto-abort\n\t\tif ( !transport ) {\n\t\t\tdone( -1, "No Transport" );\n\t\t} else {\n\t\t\tjqXHR.readyState = 1;\n\n\t\t\t// Send global event\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );\n\t\t\t}\n\n\t\t\t// If request was aborted inside ajaxSend, stop there\n\t\t\tif ( completed ) {\n\t\t\t\treturn jqXHR;\n\t\t\t}\n\n\t\t\t// Timeout\n\t\t\tif ( s.async && s.timeout > 0 ) {\n\t\t\t\ttimeoutTimer = window.setTimeout( function() {\n\t\t\t\t\tjqXHR.abort( "timeout" );\n\t\t\t\t}, s.timeout );\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tcompleted = false;\n\t\t\t\ttransport.send( requestHeaders, done );\n\t\t\t} catch ( e ) {\n\n\t\t\t\t// Rethrow post-completion exceptions\n\t\t\t\tif ( completed ) {\n\t\t\t\t\tthrow e;\n\t\t\t\t}\n\n\t\t\t\t// Propagate others as results\n\t\t\t\tdone( -1, e );\n\t\t\t}\n\t\t}\n\n\t\t// Callback for when everything is done\n\t\tfunction done( status, nativeStatusText, responses, headers ) {\n\t\t\tvar isSuccess, success, error, response, modified,\n\t\t\t\tstatusText = nativeStatusText;\n\n\t\t\t// Ignore repeat invocations\n\t\t\tif ( completed ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcompleted = true;\n\n\t\t\t// Clear timeout if it exists\n\t\t\tif ( timeoutTimer ) {\n\t\t\t\twindow.clearTimeout( timeoutTimer );\n\t\t\t}\n\n\t\t\t// Dereference transport for early garbage collection\n\t\t\t// (no matter how long the jqXHR object will be used)\n\t\t\ttransport = undefined;\n\n\t\t\t// Cache response headers\n\t\t\tresponseHeadersString = headers || "";\n\n\t\t\t// Set readyState\n\t\t\tjqXHR.readyState = status > 0 ? 4 : 0;\n\n\t\t\t// Determine if successful\n\t\t\tisSuccess = status >= 200 && status < 300 || status === 304;\n\n\t\t\t// Get response data\n\t\t\tif ( responses ) {\n\t\t\t\tresponse = ajaxHandleResponses( s, jqXHR, responses );\n\t\t\t}\n\n\t\t\t// Use a noop converter for missing script but not if jsonp\n\t\t\tif ( !isSuccess &&\n\t\t\t\tjQuery.inArray( "script", s.dataTypes ) > -1 &&\n\t\t\t\tjQuery.inArray( "json", s.dataTypes ) < 0 ) {\n\t\t\t\ts.converters[ "text script" ] = function() {};\n\t\t\t}\n\n\t\t\t// Convert no matter what (that way responseXXX fields are always set)\n\t\t\tresponse = ajaxConvert( s, response, jqXHR, isSuccess );\n\n\t\t\t// If successful, handle type chaining\n\t\t\tif ( isSuccess ) {\n\n\t\t\t\t// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\n\t\t\t\tif ( s.ifModified ) {\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( "Last-Modified" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.lastModified[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t\tmodified = jqXHR.getResponseHeader( "etag" );\n\t\t\t\t\tif ( modified ) {\n\t\t\t\t\t\tjQuery.etag[ cacheURL ] = modified;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// if no content\n\t\t\t\tif ( status === 204 || s.type === "HEAD" ) {\n\t\t\t\t\tstatusText = "nocontent";\n\n\t\t\t\t// if not modified\n\t\t\t\t} else if ( status === 304 ) {\n\t\t\t\t\tstatusText = "notmodified";\n\n\t\t\t\t// If we have data, let\'s convert it\n\t\t\t\t} else {\n\t\t\t\t\tstatusText = response.state;\n\t\t\t\t\tsuccess = response.data;\n\t\t\t\t\terror = response.error;\n\t\t\t\t\tisSuccess = !error;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t// Extract error from statusText and normalize for non-aborts\n\t\t\t\terror = statusText;\n\t\t\t\tif ( status || !statusText ) {\n\t\t\t\t\tstatusText = "error";\n\t\t\t\t\tif ( status < 0 ) {\n\t\t\t\t\t\tstatus = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Set data for the fake xhr object\n\t\t\tjqXHR.status = status;\n\t\t\tjqXHR.statusText = ( nativeStatusText || statusText ) + "";\n\n\t\t\t// Success/Error\n\t\t\tif ( isSuccess ) {\n\t\t\t\tdeferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\n\t\t\t} else {\n\t\t\t\tdeferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\n\t\t\t}\n\n\t\t\t// Status-dependent callbacks\n\t\t\tjqXHR.statusCode( statusCode );\n\t\t\tstatusCode = undefined;\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",\n\t\t\t\t\t[ jqXHR, s, isSuccess ? success : error ] );\n\t\t\t}\n\n\t\t\t// Complete\n\t\t\tcompleteDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\n\n\t\t\tif ( fireGlobals ) {\n\t\t\t\tglobalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );\n\n\t\t\t\t// Handle the global AJAX counter\n\t\t\t\tif ( !( --jQuery.active ) ) {\n\t\t\t\t\tjQuery.event.trigger( "ajaxStop" );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn jqXHR;\n\t},\n\n\tgetJSON: function( url, data, callback ) {\n\t\treturn jQuery.get( url, data, callback, "json" );\n\t},\n\n\tgetScript: function( url, callback ) {\n\t\treturn jQuery.get( url, undefined, callback, "script" );\n\t}\n} );\n\njQuery.each( [ "get", "post" ], function( _i, method ) {\n\tjQuery[ method ] = function( url, data, callback, type ) {\n\n\t\t// Shift arguments if data argument was omitted\n\t\tif ( isFunction( data ) ) {\n\t\t\ttype = type || callback;\n\t\t\tcallback = data;\n\t\t\tdata = undefined;\n\t\t}\n\n\t\t// The url can be an options object (which then must have .url)\n\t\treturn jQuery.ajax( jQuery.extend( {\n\t\t\turl: url,\n\t\t\ttype: method,\n\t\t\tdataType: type,\n\t\t\tdata: data,\n\t\t\tsuccess: callback\n\t\t}, jQuery.isPlainObject( url ) && url ) );\n\t};\n} );\n\njQuery.ajaxPrefilter( function( s ) {\n\tvar i;\n\tfor ( i in s.headers ) {\n\t\tif ( i.toLowerCase() === "content-type" ) {\n\t\t\ts.contentType = s.headers[ i ] || "";\n\t\t}\n\t}\n} );\n\n\njQuery._evalUrl = function( url, options, doc ) {\n\treturn jQuery.ajax( {\n\t\turl: url,\n\n\t\t// Make this explicit, since user can override this through ajaxSetup (trac-11264)\n\t\ttype: "GET",\n\t\tdataType: "script",\n\t\tcache: true,\n\t\tasync: false,\n\t\tglobal: false,\n\n\t\t// Only evaluate the response if it is successful (gh-4126)\n\t\t// dataFilter is not invoked for failure responses, so using it instead\n\t\t// of the default converter is kludgy but it works.\n\t\tconverters: {\n\t\t\t"text script": function() {}\n\t\t},\n\t\tdataFilter: function( response ) {\n\t\t\tjQuery.globalEval( response, options, doc );\n\t\t}\n\t} );\n};\n\n\njQuery.fn.extend( {\n\twrapAll: function( html ) {\n\t\tvar wrap;\n\n\t\tif ( this[ 0 ] ) {\n\t\t\tif ( isFunction( html ) ) {\n\t\t\t\thtml = html.call( this[ 0 ] );\n\t\t\t}\n\n\t\t\t// The elements to wrap the target around\n\t\t\twrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\n\n\t\t\tif ( this[ 0 ].parentNode ) {\n\t\t\t\twrap.insertBefore( this[ 0 ] );\n\t\t\t}\n\n\t\t\twrap.map( function() {\n\t\t\t\tvar elem = this;\n\n\t\t\t\twhile ( elem.firstElementChild ) {\n\t\t\t\t\telem = elem.firstElementChild;\n\t\t\t\t}\n\n\t\t\t\treturn elem;\n\t\t\t} ).append( this );\n\t\t}\n\n\t\treturn this;\n\t},\n\n\twrapInner: function( html ) {\n\t\tif ( isFunction( html ) ) {\n\t\t\treturn this.each( function( i ) {\n\t\t\t\tjQuery( this ).wrapInner( html.call( this, i ) );\n\t\t\t} );\n\t\t}\n\n\t\treturn this.each( function() {\n\t\t\tvar self = jQuery( this ),\n\t\t\t\tcontents = self.contents();\n\n\t\t\tif ( contents.length ) {\n\t\t\t\tcontents.wrapAll( html );\n\n\t\t\t} else {\n\t\t\t\tself.append( html );\n\t\t\t}\n\t\t} );\n\t},\n\n\twrap: function( html ) {\n\t\tvar htmlIsFunction = isFunction( html );\n\n\t\treturn this.each( function( i ) {\n\t\t\tjQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\n\t\t} );\n\t},\n\n\tunwrap: function( selector ) {\n\t\tthis.parent( selector ).not( "body" ).each( function() {\n\t\t\tjQuery( this ).replaceWith( this.childNodes );\n\t\t} );\n\t\treturn this;\n\t}\n} );\n\n\njQuery.expr.pseudos.hidden = function( elem ) {\n\treturn !jQuery.expr.pseudos.visible( elem );\n};\njQuery.expr.pseudos.visible = function( elem ) {\n\treturn !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\n};\n\n\n\n\njQuery.ajaxSettings.xhr = function() {\n\ttry {\n\t\treturn new window.XMLHttpRequest();\n\t} catch ( e ) {}\n};\n\nvar xhrSuccessStatus = {\n\n\t\t// File protocol always yields status code 0, assume 200\n\t\t0: 200,\n\n\t\t// Support: IE <=9 only\n\t\t// trac-1450: sometimes IE returns 1223 when it should be 204\n\t\t1223: 204\n\t},\n\txhrSupported = jQuery.ajaxSettings.xhr();\n\nsupport.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );\nsupport.ajax = xhrSupported = !!xhrSupported;\n\njQuery.ajaxTransport( function( options ) {\n\tvar callback, errorCallback;\n\n\t// Cross domain only allowed if supported through XMLHttpRequest\n\tif ( support.cors || xhrSupported && !options.crossDomain ) {\n\t\treturn {\n\t\t\tsend: function( headers, complete ) {\n\t\t\t\tvar i,\n\t\t\t\t\txhr = options.xhr();\n\n\t\t\t\txhr.open(\n\t\t\t\t\toptions.type,\n\t\t\t\t\toptions.url,\n\t\t\t\t\toptions.async,\n\t\t\t\t\toptions.username,\n\t\t\t\t\toptions.password\n\t\t\t\t);\n\n\t\t\t\t// Apply custom fields if provided\n\t\t\t\tif ( options.xhrFields ) {\n\t\t\t\t\tfor ( i in options.xhrFields ) {\n\t\t\t\t\t\txhr[ i ] = options.xhrFields[ i ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Override mime type if needed\n\t\t\t\tif ( options.mimeType && xhr.overrideMimeType ) {\n\t\t\t\t\txhr.overrideMimeType( options.mimeType );\n\t\t\t\t}\n\n\t\t\t\t// X-Requested-With header\n\t\t\t\t// For cross-domain requests, seeing as conditions for a preflight are\n\t\t\t\t// akin to a jigsaw puzzle, we simply never set it to be sure.\n\t\t\t\t// (it can always be set on a per-request basis or even using ajaxSetup)\n\t\t\t\t// For same-domain requests, won\'t change header if already provided.\n\t\t\t\tif ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {\n\t\t\t\t\theaders[ "X-Requested-With" ] = "XMLHttpRequest";\n\t\t\t\t}\n\n\t\t\t\t// Set headers\n\t\t\t\tfor ( i in headers ) {\n\t\t\t\t\txhr.setRequestHeader( i, headers[ i ] );\n\t\t\t\t}\n\n\t\t\t\t// Callback\n\t\t\t\tcallback = function( type ) {\n\t\t\t\t\treturn function() {\n\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\tcallback = errorCallback = xhr.onload =\n\t\t\t\t\t\t\t\txhr.onerror = xhr.onabort = xhr.ontimeout =\n\t\t\t\t\t\t\t\t\txhr.onreadystatechange = null;\n\n\t\t\t\t\t\t\tif ( type === "abort" ) {\n\t\t\t\t\t\t\t\txhr.abort();\n\t\t\t\t\t\t\t} else if ( type === "error" ) {\n\n\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t// On a manual native abort, IE9 throws\n\t\t\t\t\t\t\t\t// errors on any property access that is not readyState\n\t\t\t\t\t\t\t\tif ( typeof xhr.status !== "number" ) {\n\t\t\t\t\t\t\t\t\tcomplete( 0, "error" );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tcomplete(\n\n\t\t\t\t\t\t\t\t\t\t// File: protocol always yields status 0; see trac-8605, trac-14207\n\t\t\t\t\t\t\t\t\t\txhr.status,\n\t\t\t\t\t\t\t\t\t\txhr.statusText\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcomplete(\n\t\t\t\t\t\t\t\t\txhrSuccessStatus[ xhr.status ] || xhr.status,\n\t\t\t\t\t\t\t\t\txhr.statusText,\n\n\t\t\t\t\t\t\t\t\t// Support: IE <=9 only\n\t\t\t\t\t\t\t\t\t// IE9 has no XHR2 but throws on binary (trac-11426)\n\t\t\t\t\t\t\t\t\t// For XHR2 non-text, let the caller handle it (gh-2498)\n\t\t\t\t\t\t\t\t\t( xhr.responseType || "text" ) !== "text" ||\n\t\t\t\t\t\t\t\t\ttypeof xhr.responseText !== "string" ?\n\t\t\t\t\t\t\t\t\t\t{ binary: xhr.response } :\n\t\t\t\t\t\t\t\t\t\t{ text: xhr.responseText },\n\t\t\t\t\t\t\t\t\txhr.getAllResponseHeaders()\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t};\n\n\t\t\t\t// Listen to events\n\t\t\t\txhr.onload = callback();\n\t\t\t\terrorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );\n\n\t\t\t\t// Support: IE 9 only\n\t\t\t\t// Use onreadystatechange to replace onabort\n\t\t\t\t// to handle uncaught aborts\n\t\t\t\tif ( xhr.onabort !== undefined ) {\n\t\t\t\t\txhr.onabort = errorCallback;\n\t\t\t\t} else {\n\t\t\t\t\txhr.onreadystatechange = function() {\n\n\t\t\t\t\t\t// Check readyState before timeout as it changes\n\t\t\t\t\t\tif ( xhr.readyState === 4 ) {\n\n\t\t\t\t\t\t\t// Allow onerror to be called first,\n\t\t\t\t\t\t\t// but that will not handle a native abort\n\t\t\t\t\t\t\t// Also, save errorCallback to a variable\n\t\t\t\t\t\t\t// as xhr.onerror cannot be accessed\n\t\t\t\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\t\t\t\terrorCallback();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\t// Create the abort callback\n\t\t\t\tcallback = callback( "abort" );\n\n\t\t\t\ttry {\n\n\t\t\t\t\t// Do send the request (this may raise an exception)\n\t\t\t\t\txhr.send( options.hasContent && options.data || null );\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t// trac-14683: Only rethrow if this hasn\'t been notified as an error yet\n\t\t\t\t\tif ( callback ) {\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\n// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\njQuery.ajaxPrefilter( function( s ) {\n\tif ( s.crossDomain ) {\n\t\ts.contents.script = false;\n\t}\n} );\n\n// Install script dataType\njQuery.ajaxSetup( {\n\taccepts: {\n\t\tscript: "text/javascript, application/javascript, " +\n\t\t\t"application/ecmascript, application/x-ecmascript"\n\t},\n\tcontents: {\n\t\tscript: /\\b(?:java|ecma)script\\b/\n\t},\n\tconverters: {\n\t\t"text script": function( text ) {\n\t\t\tjQuery.globalEval( text );\n\t\t\treturn text;\n\t\t}\n\t}\n} );\n\n// Handle cache\'s special case and crossDomain\njQuery.ajaxPrefilter( "script", function( s ) {\n\tif ( s.cache === undefined ) {\n\t\ts.cache = false;\n\t}\n\tif ( s.crossDomain ) {\n\t\ts.type = "GET";\n\t}\n} );\n\n// Bind script tag hack transport\njQuery.ajaxTransport( "script", function( s ) {\n\n\t// This transport only deals with cross domain or forced-by-attrs requests\n\tif ( s.crossDomain || s.scriptAttrs ) {\n\t\tvar script, callback;\n\t\treturn {\n\t\t\tsend: function( _, complete ) {\n\t\t\t\tscript = jQuery( "<script>" )\n\t\t\t\t\t.attr( s.scriptAttrs || {} )\n\t\t\t\t\t.prop( { charset: s.scriptCharset, src: s.url } )\n\t\t\t\t\t.on( "load error", callback = function( evt ) {\n\t\t\t\t\t\tscript.remove();\n\t\t\t\t\t\tcallback = null;\n\t\t\t\t\t\tif ( evt ) {\n\t\t\t\t\t\t\tcomplete( evt.type === "error" ? 404 : 200, evt.type );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t// Use native DOM manipulation to avoid our domManip AJAX trickery\n\t\t\t\tdocument.head.appendChild( script[ 0 ] );\n\t\t\t},\n\t\t\tabort: function() {\n\t\t\t\tif ( callback ) {\n\t\t\t\t\tcallback();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n} );\n\n\n\n\nvar oldCallbacks = [],\n\trjsonp = /(=)\\?(?=&|$)|\\?\\?/;\n\n// Default jsonp settings\njQuery.ajaxSetup( {\n\tjsonp: "callback",\n\tjsonpCallback: function() {\n\t\tvar callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );\n\t\tthis[ callback ] = true;\n\t\treturn callback;\n\t}\n} );\n\n// Detect, normalize options and install callbacks for jsonp requests\njQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {\n\n\tvar callbackName, overwritten, responseContainer,\n\t\tjsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\n\t\t\t"url" :\n\t\t\ttypeof s.data === "string" &&\n\t\t\t\t( s.contentType || "" )\n\t\t\t\t\t.indexOf( "application/x-www-form-urlencoded" ) === 0 &&\n\t\t\t\trjsonp.test( s.data ) && "data"\n\t\t);\n\n\t// Handle iff the expected data type is "jsonp" or we have a parameter to set\n\tif ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {\n\n\t\t// Get callback name, remembering preexisting value associated with it\n\t\tcallbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\n\t\t\ts.jsonpCallback() :\n\t\t\ts.jsonpCallback;\n\n\t\t// Insert callback into url or form data\n\t\tif ( jsonProp ) {\n\t\t\ts[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );\n\t\t} else if ( s.jsonp !== false ) {\n\t\t\ts.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;\n\t\t}\n\n\t\t// Use data converter to retrieve json after script execution\n\t\ts.converters[ "script json" ] = function() {\n\t\t\tif ( !responseContainer ) {\n\t\t\t\tjQuery.error( callbackName + " was not called" );\n\t\t\t}\n\t\t\treturn responseContainer[ 0 ];\n\t\t};\n\n\t\t// Force json dataType\n\t\ts.dataTypes[ 0 ] = "json";\n\n\t\t// Install callback\n\t\toverwritten = window[ callbackName ];\n\t\twindow[ callbackName ] = function() {\n\t\t\tresponseContainer = arguments;\n\t\t};\n\n\t\t// Clean-up function (fires after converters)\n\t\tjqXHR.always( function() {\n\n\t\t\t// If previous value didn\'t exist - remove it\n\t\t\tif ( overwritten === undefined ) {\n\t\t\t\tjQuery( window ).removeProp( callbackName );\n\n\t\t\t// Otherwise restore preexisting value\n\t\t\t} else {\n\t\t\t\twindow[ callbackName ] = overwritten;\n\t\t\t}\n\n\t\t\t// Save back as free\n\t\t\tif ( s[ callbackName ] ) {\n\n\t\t\t\t// Make sure that re-using the options doesn\'t screw things around\n\t\t\t\ts.jsonpCallback = originalSettings.jsonpCallback;\n\n\t\t\t\t// Save the callback name for future use\n\t\t\t\toldCallbacks.push( callbackName );\n\t\t\t}\n\n\t\t\t// Call if it was a function and we have a response\n\t\t\tif ( responseContainer && isFunction( overwritten ) ) {\n\t\t\t\toverwritten( responseContainer[ 0 ] );\n\t\t\t}\n\n\t\t\tresponseContainer = overwritten = undefined;\n\t\t} );\n\n\t\t// Delegate to script\n\t\treturn "script";\n\t}\n} );\n\n\n\n\n// Support: Safari 8 only\n// In Safari 8 documents created via document.implementation.createHTMLDocument\n// collapse sibling forms: the second one becomes a child of the first one.\n// Because of that, this security measure has to be disabled in Safari 8.\n// https://bugs.webkit.org/show_bug.cgi?id=137337\nsupport.createHTMLDocument = ( function() {\n\tvar body = document.implementation.createHTMLDocument( "" ).body;\n\tbody.innerHTML = "<form></form><form></form>";\n\treturn body.childNodes.length === 2;\n} )();\n\n\n// Argument "data" should be string of html\n// context (optional): If specified, the fragment will be created in this context,\n// defaults to document\n// keepScripts (optional): If true, will include scripts passed in the html string\njQuery.parseHTML = function( data, context, keepScripts ) {\n\tif ( typeof data !== "string" ) {\n\t\treturn [];\n\t}\n\tif ( typeof context === "boolean" ) {\n\t\tkeepScripts = context;\n\t\tcontext = false;\n\t}\n\n\tvar base, parsed, scripts;\n\n\tif ( !context ) {\n\n\t\t// Stop scripts or inline event handlers from being executed immediately\n\t\t// by using document.implementation\n\t\tif ( support.createHTMLDocument ) {\n\t\t\tcontext = document.implementation.createHTMLDocument( "" );\n\n\t\t\t// Set the base href for the created document\n\t\t\t// so any parsed elements with URLs\n\t\t\t// are based on the document\'s URL (gh-2965)\n\t\t\tbase = context.createElement( "base" );\n\t\t\tbase.href = document.location.href;\n\t\t\tcontext.head.appendChild( base );\n\t\t} else {\n\t\t\tcontext = document;\n\t\t}\n\t}\n\n\tparsed = rsingleTag.exec( data );\n\tscripts = !keepScripts && [];\n\n\t// Single tag\n\tif ( parsed ) {\n\t\treturn [ context.createElement( parsed[ 1 ] ) ];\n\t}\n\n\tparsed = buildFragment( [ data ], context, scripts );\n\n\tif ( scripts && scripts.length ) {\n\t\tjQuery( scripts ).remove();\n\t}\n\n\treturn jQuery.merge( [], parsed.childNodes );\n};\n\n\n/**\n * Load a url into a page\n */\njQuery.fn.load = function( url, params, callback ) {\n\tvar selector, type, response,\n\t\tself = this,\n\t\toff = url.indexOf( " " );\n\n\tif ( off > -1 ) {\n\t\tselector = stripAndCollapse( url.slice( off ) );\n\t\turl = url.slice( 0, off );\n\t}\n\n\t// If it\'s a function\n\tif ( isFunction( params ) ) {\n\n\t\t// We assume that it\'s the callback\n\t\tcallback = params;\n\t\tparams = undefined;\n\n\t// Otherwise, build a param string\n\t} else if ( params && typeof params === "object" ) {\n\t\ttype = "POST";\n\t}\n\n\t// If we have elements to modify, make the request\n\tif ( self.length > 0 ) {\n\t\tjQuery.ajax( {\n\t\t\turl: url,\n\n\t\t\t// If "type" variable is undefined, then "GET" method will be used.\n\t\t\t// Make value of this field explicit since\n\t\t\t// user can override it through ajaxSetup method\n\t\t\ttype: type || "GET",\n\t\t\tdataType: "html",\n\t\t\tdata: params\n\t\t} ).done( function( responseText ) {\n\n\t\t\t// Save response for use in complete callback\n\t\t\tresponse = arguments;\n\n\t\t\tself.html( selector ?\n\n\t\t\t\t// If a selector was specified, locate the right elements in a dummy div\n\t\t\t\t// Exclude scripts to avoid IE \'Permission Denied\' errors\n\t\t\t\tjQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\n\t\t\t\t// Otherwise use the full result\n\t\t\t\tresponseText );\n\n\t\t// If the request succeeds, this function gets "data", "status", "jqXHR"\n\t\t// but they are ignored because response was set above.\n\t\t// If it fails, this function gets "jqXHR", "status", "error"\n\t\t} ).always( callback && function( jqXHR, status ) {\n\t\t\tself.each( function() {\n\t\t\t\tcallback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t} );\n\t\t} );\n\t}\n\n\treturn this;\n};\n\n\n\n\njQuery.expr.pseudos.animated = function( elem ) {\n\treturn jQuery.grep( jQuery.timers, function( fn ) {\n\t\treturn elem === fn.elem;\n\t} ).length;\n};\n\n\n\n\njQuery.offset = {\n\tsetOffset: function( elem, options, i ) {\n\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\tposition = jQuery.css( elem, "position" ),\n\t\t\tcurElem = jQuery( elem ),\n\t\t\tprops = {};\n\n\t\t// Set position first, in-case top/left are set even on static elem\n\t\tif ( position === "static" ) {\n\t\t\telem.style.position = "relative";\n\t\t}\n\n\t\tcurOffset = curElem.offset();\n\t\tcurCSSTop = jQuery.css( elem, "top" );\n\t\tcurCSSLeft = jQuery.css( elem, "left" );\n\t\tcalculatePosition = ( position === "absolute" || position === "fixed" ) &&\n\t\t\t( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;\n\n\t\t// Need to be able to calculate position if either\n\t\t// top or left is auto and position is either absolute or fixed\n\t\tif ( calculatePosition ) {\n\t\t\tcurPosition = curElem.position();\n\t\t\tcurTop = curPosition.top;\n\t\t\tcurLeft = curPosition.left;\n\n\t\t} else {\n\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t}\n\n\t\tif ( isFunction( options ) ) {\n\n\t\t\t// Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\n\t\t\toptions = options.call( elem, i, jQuery.extend( {}, curOffset ) );\n\t\t}\n\n\t\tif ( options.top != null ) {\n\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t}\n\t\tif ( options.left != null ) {\n\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t}\n\n\t\tif ( "using" in options ) {\n\t\t\toptions.using.call( elem, props );\n\n\t\t} else {\n\t\t\tcurElem.css( props );\n\t\t}\n\t}\n};\n\njQuery.fn.extend( {\n\n\t// offset() relates an element\'s border box to the document origin\n\toffset: function( options ) {\n\n\t\t// Preserve chaining for setter\n\t\tif ( arguments.length ) {\n\t\t\treturn options === undefined ?\n\t\t\t\tthis :\n\t\t\t\tthis.each( function( i ) {\n\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t} );\n\t\t}\n\n\t\tvar rect, win,\n\t\t\telem = this[ 0 ];\n\n\t\tif ( !elem ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Return zeros for disconnected and hidden (display: none) elements (gh-2310)\n\t\t// Support: IE <=11 only\n\t\t// Running getBoundingClientRect on a\n\t\t// disconnected node in IE throws an error\n\t\tif ( !elem.getClientRects().length ) {\n\t\t\treturn { top: 0, left: 0 };\n\t\t}\n\n\t\t// Get document-relative position by adding viewport scroll to viewport-relative gBCR\n\t\trect = elem.getBoundingClientRect();\n\t\twin = elem.ownerDocument.defaultView;\n\t\treturn {\n\t\t\ttop: rect.top + win.pageYOffset,\n\t\t\tleft: rect.left + win.pageXOffset\n\t\t};\n\t},\n\n\t// position() relates an element\'s margin box to its offset parent\'s padding box\n\t// This corresponds to the behavior of CSS absolute positioning\n\tposition: function() {\n\t\tif ( !this[ 0 ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar offsetParent, offset, doc,\n\t\t\telem = this[ 0 ],\n\t\t\tparentOffset = { top: 0, left: 0 };\n\n\t\t// position:fixed elements are offset from the viewport, which itself always has zero offset\n\t\tif ( jQuery.css( elem, "position" ) === "fixed" ) {\n\n\t\t\t// Assume position:fixed implies availability of getBoundingClientRect\n\t\t\toffset = elem.getBoundingClientRect();\n\n\t\t} else {\n\t\t\toffset = this.offset();\n\n\t\t\t// Account for the *real* offset parent, which can be the document or its root element\n\t\t\t// when a statically positioned element is identified\n\t\t\tdoc = elem.ownerDocument;\n\t\t\toffsetParent = elem.offsetParent || doc.documentElement;\n\t\t\twhile ( offsetParent &&\n\t\t\t\t( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\n\t\t\t\tjQuery.css( offsetParent, "position" ) === "static" ) {\n\n\t\t\t\toffsetParent = offsetParent.parentNode;\n\t\t\t}\n\t\t\tif ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\n\n\t\t\t\t// Incorporate borders into its offset, since they are outside its content origin\n\t\t\t\tparentOffset = jQuery( offsetParent ).offset();\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );\n\t\t\t}\n\t\t}\n\n\t\t// Subtract parent offsets and element margins\n\t\treturn {\n\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),\n\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )\n\t\t};\n\t},\n\n\t// This method will return documentElement in the following cases:\n\t// 1) For the element inside the iframe without offsetParent, this method will return\n\t// documentElement of the parent window\n\t// 2) For the hidden or detached element\n\t// 3) For body or html element, i.e. in case of the html node - it will return itself\n\t//\n\t// but those exceptions were never presented as a real life use-cases\n\t// and might be considered as more preferable results.\n\t//\n\t// This logic, however, is not guaranteed and can change at any point in the future\n\toffsetParent: function() {\n\t\treturn this.map( function() {\n\t\t\tvar offsetParent = this.offsetParent;\n\n\t\t\twhile ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {\n\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t}\n\n\t\t\treturn offsetParent || documentElement;\n\t\t} );\n\t}\n} );\n\n// Create scrollLeft and scrollTop methods\njQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {\n\tvar top = "pageYOffset" === prop;\n\n\tjQuery.fn[ method ] = function( val ) {\n\t\treturn access( this, function( elem, method, val ) {\n\n\t\t\t// Coalesce documents and windows\n\t\t\tvar win;\n\t\t\tif ( isWindow( elem ) ) {\n\t\t\t\twin = elem;\n\t\t\t} else if ( elem.nodeType === 9 ) {\n\t\t\t\twin = elem.defaultView;\n\t\t\t}\n\n\t\t\tif ( val === undefined ) {\n\t\t\t\treturn win ? win[ prop ] : elem[ method ];\n\t\t\t}\n\n\t\t\tif ( win ) {\n\t\t\t\twin.scrollTo(\n\t\t\t\t\t!top ? val : win.pageXOffset,\n\t\t\t\t\ttop ? val : win.pageYOffset\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\telem[ method ] = val;\n\t\t\t}\n\t\t}, method, val, arguments.length );\n\t};\n} );\n\n// Support: Safari <=7 - 9.1, Chrome <=37 - 49\n// Add the top/left cssHooks using jQuery.fn.position\n// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\n// getComputedStyle returns percent when specified for top/left/bottom/right;\n// rather than make the css module depend on the offset module, just check for it here\njQuery.each( [ "top", "left" ], function( _i, prop ) {\n\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\tfunction( elem, computed ) {\n\t\t\tif ( computed ) {\n\t\t\t\tcomputed = curCSS( elem, prop );\n\n\t\t\t\t// If curCSS returns percentage, fallback to offset\n\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\tjQuery( elem ).position()[ prop ] + "px" :\n\t\t\t\t\tcomputed;\n\t\t\t}\n\t\t}\n\t);\n} );\n\n\n// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\njQuery.each( { Height: "height", Width: "width" }, function( name, type ) {\n\tjQuery.each( {\n\t\tpadding: "inner" + name,\n\t\tcontent: type,\n\t\t"": "outer" + name\n\t}, function( defaultExtra, funcName ) {\n\n\t\t// Margin is only for outerHeight, outerWidth\n\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),\n\t\t\t\textra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );\n\n\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\tvar doc;\n\n\t\t\t\tif ( isWindow( elem ) ) {\n\n\t\t\t\t\t// $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\n\t\t\t\t\treturn funcName.indexOf( "outer" ) === 0 ?\n\t\t\t\t\t\telem[ "inner" + name ] :\n\t\t\t\t\t\telem.document.documentElement[ "client" + name ];\n\t\t\t\t}\n\n\t\t\t\t// Get document width or height\n\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\tdoc = elem.documentElement;\n\n\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\n\t\t\t\t\t// whichever is greatest\n\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\telem.body[ "scroll" + name ], doc[ "scroll" + name ],\n\t\t\t\t\t\telem.body[ "offset" + name ], doc[ "offset" + name ],\n\t\t\t\t\t\tdoc[ "client" + name ]\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn value === undefined ?\n\n\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\n\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t}, type, chainable ? margin : undefined, chainable );\n\t\t};\n\t} );\n} );\n\n\njQuery.each( [\n\t"ajaxStart",\n\t"ajaxStop",\n\t"ajaxComplete",\n\t"ajaxError",\n\t"ajaxSuccess",\n\t"ajaxSend"\n], function( _i, type ) {\n\tjQuery.fn[ type ] = function( fn ) {\n\t\treturn this.on( type, fn );\n\t};\n} );\n\n\n\n\njQuery.fn.extend( {\n\n\tbind: function( types, data, fn ) {\n\t\treturn this.on( types, null, data, fn );\n\t},\n\tunbind: function( types, fn ) {\n\t\treturn this.off( types, null, fn );\n\t},\n\n\tdelegate: function( selector, types, data, fn ) {\n\t\treturn this.on( types, selector, data, fn );\n\t},\n\tundelegate: function( selector, types, fn ) {\n\n\t\t// ( namespace ) or ( selector, types [, fn] )\n\t\treturn arguments.length === 1 ?\n\t\t\tthis.off( selector, "**" ) :\n\t\t\tthis.off( types, selector || "**", fn );\n\t},\n\n\thover: function( fnOver, fnOut ) {\n\t\treturn this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\n\t}\n} );\n\njQuery.each(\n\t( "blur focus focusin focusout resize scroll click dblclick " +\n\t"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +\n\t"change select submit keydown keypress keyup contextmenu" ).split( " " ),\n\tfunction( _i, name ) {\n\n\t\t// Handle event binding\n\t\tjQuery.fn[ name ] = function( data, fn ) {\n\t\t\treturn arguments.length > 0 ?\n\t\t\t\tthis.on( name, null, data, fn ) :\n\t\t\t\tthis.trigger( name );\n\t\t};\n\t}\n);\n\n\n\n\n// Support: Android <=4.0 only\n// Make sure we trim BOM and NBSP\n// Require that the "whitespace run" starts from a non-whitespace\n// to avoid O(N^2) behavior when the engine would try matching "\\s+$" at each space position.\nvar rtrim = /^[\\s\\uFEFF\\xA0]+|([^\\s\\uFEFF\\xA0])[\\s\\uFEFF\\xA0]+$/g;\n\n// Bind a function to a context, optionally partially applying any\n// arguments.\n// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\n// However, it is not slated for removal any time soon\njQuery.proxy = function( fn, context ) {\n\tvar tmp, args, proxy;\n\n\tif ( typeof context === "string" ) {\n\t\ttmp = fn[ context ];\n\t\tcontext = fn;\n\t\tfn = tmp;\n\t}\n\n\t// Quick check to determine if target is callable, in the spec\n\t// this throws a TypeError, but we will just return undefined.\n\tif ( !isFunction( fn ) ) {\n\t\treturn undefined;\n\t}\n\n\t// Simulated bind\n\targs = slice.call( arguments, 2 );\n\tproxy = function() {\n\t\treturn fn.apply( context || this, args.concat( slice.call( arguments ) ) );\n\t};\n\n\t// Set the guid of unique handler to the same of original handler, so it can be removed\n\tproxy.guid = fn.guid = fn.guid || jQuery.guid++;\n\n\treturn proxy;\n};\n\njQuery.holdReady = function( hold ) {\n\tif ( hold ) {\n\t\tjQuery.readyWait++;\n\t} else {\n\t\tjQuery.ready( true );\n\t}\n};\njQuery.isArray = Array.isArray;\njQuery.parseJSON = JSON.parse;\njQuery.nodeName = nodeName;\njQuery.isFunction = isFunction;\njQuery.isWindow = isWindow;\njQuery.camelCase = camelCase;\njQuery.type = toType;\n\njQuery.now = Date.now;\n\njQuery.isNumeric = function( obj ) {\n\n\t// As of jQuery 3.0, isNumeric is limited to\n\t// strings and numbers (primitives or objects)\n\t// that can be coerced to finite numbers (gh-2662)\n\tvar type = jQuery.type( obj );\n\treturn ( type === "number" || type === "string" ) &&\n\n\t\t// parseFloat NaNs numeric-cast false positives ("")\n\t\t// ...but misinterprets leading-number strings, particularly hex literals ("0x...")\n\t\t// subtraction forces infinities to NaN\n\t\t!isNaN( obj - parseFloat( obj ) );\n};\n\njQuery.trim = function( text ) {\n\treturn text == null ?\n\t\t"" :\n\t\t( text + "" ).replace( rtrim, "$1" );\n};\n\n\n\n// Register as a named AMD module, since jQuery can be concatenated with other\n// files that may use define, but not via a proper concatenation script that\n// understands anonymous AMD modules. A named AMD is safest and most robust\n// way to register. Lowercase jquery is used because AMD module names are\n// derived from file names, and jQuery is normally delivered in a lowercase\n// file name. Do this after creating the global so that if an AMD module wants\n// to call noConflict to hide this version of jQuery, it will work.\n\n// Note that for maximum portability, libraries that are not jQuery should\n// declare themselves as anonymous modules, and avoid setting a global if an\n// AMD loader is present. jQuery is a special case. For more information, see\n// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\nif ( true ) {\n\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n\t\treturn jQuery;\n\t}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n\n\n\n\nvar\n\n\t// Map over jQuery in case of overwrite\n\t_jQuery = window.jQuery,\n\n\t// Map over the $ in case of overwrite\n\t_$ = window.$;\n\njQuery.noConflict = function( deep ) {\n\tif ( window.$ === jQuery ) {\n\t\twindow.$ = _$;\n\t}\n\n\tif ( deep && window.jQuery === jQuery ) {\n\t\twindow.jQuery = _jQuery;\n\t}\n\n\treturn jQuery;\n};\n\n// Expose jQuery and $ identifiers, even in AMD\n// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557)\n// and CommonJS for browser emulators (trac-13566)\nif ( typeof noGlobal === "undefined" ) {\n\twindow.jQuery = window.$ = jQuery;\n}\n\n\n\n\nreturn jQuery;\n} );\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTc1NS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBLE1BQU0sS0FBMEI7O0FBRWhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTt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d2luZG93LiQ7XG5cbmpRdWVyeS5ub0NvbmZsaWN0ID0gZnVuY3Rpb24oIGRlZXAgKSB7XG5cdGlmICggd2luZG93LiQgPT09IGpRdWVyeSApIHtcblx0XHR3aW5kb3cuJCA9IF8kO1xuXHR9XG5cblx0aWYgKCBkZWVwICYmIHdpbmRvdy5qUXVlcnkgPT09IGpRdWVyeSApIHtcblx0XHR3aW5kb3cualF1ZXJ5ID0gX2pRdWVyeTtcblx0fVxuXG5cdHJldHVybiBqUXVlcnk7XG59O1xuXG4vLyBFeHBvc2UgalF1ZXJ5IGFuZCAkIGlkZW50aWZpZXJzLCBldmVuIGluIEFNRFxuLy8gKHRyYWMtNzEwMiNjb21tZW50OjEwLCBodHRwczovL2dpdGh1Yi5jb20vanF1ZXJ5L2pxdWVyeS9wdWxsLzU1Nylcbi8vIGFuZCBDb21tb25KUyBmb3IgYnJvd3NlciBlbXVsYXRvcnMgKHRyYWMtMTM1NjYpXG5pZiAoIHR5cGVvZiBub0dsb2JhbCA9PT0gXCJ1bmRlZmluZWRcIiApIHtcblx0d2luZG93LmpRdWVyeSA9IHdpbmRvdy4kID0galF1ZXJ5O1xufVxuXG5cblxuXG5yZXR1cm4galF1ZXJ5O1xufSApO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9755\n')},4893:function(module){eval("/* http://nanobar.micronube.com/ || https://github.com/jacoborus/nanobar/ MIT LICENSE */\n(function (root) {\n 'use strict'\n // container styles\n var css = '.nanobar{width:100%;height:4px;z-index:9999;top:0}.bar{width:0;height:100%;transition:height .3s;background:#000}'\n\n // add required css in head div\n function addCss () {\n var s = document.getElementById('nanobarcss')\n\n // check whether style tag is already inserted\n if (s === null) {\n s = document.createElement('style')\n s.type = 'text/css'\n s.id = 'nanobarcss'\n document.head.insertBefore(s, document.head.firstChild)\n // the world\n if (!s.styleSheet) return s.appendChild(document.createTextNode(css))\n // IE\n s.styleSheet.cssText = css\n }\n }\n\n function addClass (el, cls) {\n if (el.classList) el.classList.add(cls)\n else el.className += ' ' + cls\n }\n\n // create a progress bar\n // this will be destroyed after reaching 100% progress\n function createBar (rm) {\n // create progress element\n var el = document.createElement('div'),\n width = 0,\n here = 0,\n on = 0,\n bar = {\n el: el,\n go: go\n }\n\n addClass(el, 'bar')\n\n // animation loop\n function move () {\n var dist = width - here\n\n if (dist < 0.1 && dist > -0.1) {\n place(here)\n on = 0\n if (width === 100) {\n el.style.height = 0\n setTimeout(function () {\n rm(el)\n }, 300)\n }\n } else {\n place(width - dist / 4)\n setTimeout(go, 16)\n }\n }\n\n // set bar width\n function place (num) {\n width = num\n el.style.width = width + '%'\n }\n\n function go (num) {\n if (num >= 0) {\n here = num\n if (!on) {\n on = 1\n move()\n }\n } else if (on) {\n move()\n }\n }\n return bar\n }\n\n function Nanobar (opts) {\n opts = opts || {}\n // set options\n var el = document.createElement('div'),\n applyGo,\n nanobar = {\n el: el,\n go: function (p) {\n // expand bar\n applyGo(p)\n // create new bar when progress reaches 100%\n if (p === 100) {\n init()\n }\n }\n }\n\n // remove element from nanobar container\n function rm (child) {\n el.removeChild(child)\n }\n\n // create and insert progress var in nanobar container\n function init () {\n var bar = createBar(rm)\n el.appendChild(bar.el)\n applyGo = bar.go\n }\n\n addCss()\n\n addClass(el, 'nanobar')\n if (opts.id) el.id = opts.id\n if (opts.classname) addClass(el, opts.classname)\n\n // insert container\n if (opts.target) {\n // inside a div\n el.style.position = 'relative'\n opts.target.insertBefore(el, opts.target.firstChild)\n } else {\n // on top of the page\n el.style.position = 'fixed'\n document.getElementsByTagName('body')[0].appendChild(el)\n }\n\n init()\n return nanobar\n }\n\n if (true) {\n // CommonJS\n module.exports = Nanobar\n } else {}\n}(this))\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg5My5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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2V0VGltZW91dChnbywgMTYpXG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gc2V0IGJhciB3aWR0aFxuICAgIGZ1bmN0aW9uIHBsYWNlIChudW0pIHtcbiAgICAgIHdpZHRoID0gbnVtXG4gICAgICBlbC5zdHlsZS53aWR0aCA9IHdpZHRoICsgJyUnXG4gICAgfVxuXG4gICAgZnVuY3Rpb24gZ28gKG51bSkge1xuICAgICAgaWYgKG51bSA+PSAwKSB7XG4gICAgICAgIGhlcmUgPSBudW1cbiAgICAgICAgaWYgKCFvbikge1xuICAgICAgICAgIG9uID0gMVxuICAgICAgICAgIG1vdmUoKVxuICAgICAgICB9XG4gICAgICB9IGVsc2UgaWYgKG9uKSB7XG4gICAgICAgIG1vdmUoKVxuICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gYmFyXG4gIH1cblxuICBmdW5jdGlvbiBOYW5vYmFyIChvcHRzKSB7XG4gICAgb3B0cyA9IG9wdHMgfHwge31cbiAgICAvLyBzZXQgb3B0aW9uc1xuICAgIHZhciBlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpLFxuICAgICAgICBhcHBseUdvLFxuICAgICAgICBuYW5vYmFyID0ge1xuICAgICAgICAgIGVsOiBlbCxcbiAgICAgICAgICBnbzogZnVuY3Rpb24gKHApIHtcbiAgICAgICAgICAgIC8vIGV4cGFuZCBiYXJcbiAgICAgICAgICAgIGFwcGx5R28ocClcbiAgICAgICAgICAgIC8vIGNyZWF0ZSBuZXcgYmFyIHdoZW4gcHJvZ3Jlc3MgcmVhY2hlcyAxMDAlXG4gICAgICAgICAgICBpZiAocCA9PT0gMTAwKSB7XG4gICAgICAgICAgICAgIGluaXQoKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgLy8gcmVtb3ZlIGVsZW1lbnQgZnJvbSBuYW5vYmFyIGNvbnRhaW5lclxuICAgIGZ1bmN0aW9uIHJtIChjaGlsZCkge1xuICA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PSAnZnVuY3Rpb24nICYmIGRlZmluZS5hbWQpIHtcbiAgICAvLyBBTUQuIFJlZ2lzdGVyIGFzIGFuIGFub255bW91cyBtb2R1bGUuXG4gICAgZGVmaW5lKFtdLCBmdW5jdGlvbiAoKSB7IHJldHVybiBOYW5vYmFyIH0pXG4gIH0gZWxzZSB7XG4gICAgLy8gQnJvd3NlciBnbG9iYWxzXG4gICAgcm9vdC5OYW5vYmFyID0gTmFub2JhclxuICB9XG59KHRoaXMpKVxuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4893\n")},4575:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**!\n * @fileOverview Kickass library to create and place poppers near their reference elements.\n * @version 1.16.1\n * @license\n * Copyright (c) 2016 Federico Zivolo and contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';\n\nvar timeoutDuration = function () {\n var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];\n for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {\n if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {\n return 1;\n }\n }\n return 0;\n}();\n\nfunction microtaskDebounce(fn) {\n var called = false;\n return function () {\n if (called) {\n return;\n }\n called = true;\n window.Promise.resolve().then(function () {\n called = false;\n fn();\n });\n };\n}\n\nfunction taskDebounce(fn) {\n var scheduled = false;\n return function () {\n if (!scheduled) {\n scheduled = true;\n setTimeout(function () {\n scheduled = false;\n fn();\n }, timeoutDuration);\n }\n };\n}\n\nvar supportsMicroTasks = isBrowser && window.Promise;\n\n/**\n* Create a debounced version of a method, that's asynchronously deferred\n* but called in the minimum time possible.\n*\n* @method\n* @memberof Popper.Utils\n* @argument {Function} fn\n* @returns {Function}\n*/\nvar debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;\n\n/**\n * Check if the given variable is a function\n * @method\n * @memberof Popper.Utils\n * @argument {Any} functionToCheck - variable to check\n * @returns {Boolean} answer to: is a function?\n */\nfunction isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}\n\n/**\n * Get CSS computed property of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Eement} element\n * @argument {String} property\n */\nfunction getStyleComputedProperty(element, property) {\n if (element.nodeType !== 1) {\n return [];\n }\n // NOTE: 1 DOM access here\n var window = element.ownerDocument.defaultView;\n var css = window.getComputedStyle(element, null);\n return property ? css[property] : css;\n}\n\n/**\n * Returns the parentNode or the host of the element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} parent\n */\nfunction getParentNode(element) {\n if (element.nodeName === 'HTML') {\n return element;\n }\n return element.parentNode || element.host;\n}\n\n/**\n * Returns the scrolling parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} scroll parent\n */\nfunction getScrollParent(element) {\n // Return body, `getScroll` will take care to get the correct `scrollTop` from it\n if (!element) {\n return document.body;\n }\n\n switch (element.nodeName) {\n case 'HTML':\n case 'BODY':\n return element.ownerDocument.body;\n case '#document':\n return element.body;\n }\n\n // Firefox want us to check `-x` and `-y` variations as well\n\n var _getStyleComputedProp = getStyleComputedProperty(element),\n overflow = _getStyleComputedProp.overflow,\n overflowX = _getStyleComputedProp.overflowX,\n overflowY = _getStyleComputedProp.overflowY;\n\n if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {\n return element;\n }\n\n return getScrollParent(getParentNode(element));\n}\n\n/**\n * Returns the reference node of the reference object, or the reference object itself.\n * @method\n * @memberof Popper.Utils\n * @param {Element|Object} reference - the reference element (the popper will be relative to this)\n * @returns {Element} parent\n */\nfunction getReferenceNode(reference) {\n return reference && reference.referenceNode ? reference.referenceNode : reference;\n}\n\nvar isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);\nvar isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);\n\n/**\n * Determines if the browser is Internet Explorer\n * @method\n * @memberof Popper.Utils\n * @param {Number} version to check\n * @returns {Boolean} isIE\n */\nfunction isIE(version) {\n if (version === 11) {\n return isIE11;\n }\n if (version === 10) {\n return isIE10;\n }\n return isIE11 || isIE10;\n}\n\n/**\n * Returns the offset parent of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} offset parent\n */\nfunction getOffsetParent(element) {\n if (!element) {\n return document.documentElement;\n }\n\n var noOffsetParent = isIE(10) ? document.body : null;\n\n // NOTE: 1 DOM access here\n var offsetParent = element.offsetParent || null;\n // Skip hidden elements which don't have an offsetParent\n while (offsetParent === noOffsetParent && element.nextElementSibling) {\n offsetParent = (element = element.nextElementSibling).offsetParent;\n }\n\n var nodeName = offsetParent && offsetParent.nodeName;\n\n if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {\n return element ? element.ownerDocument.documentElement : document.documentElement;\n }\n\n // .offsetParent will return the closest TH, TD or TABLE in case\n // no offsetParent is present, I hate this job...\n if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {\n return getOffsetParent(offsetParent);\n }\n\n return offsetParent;\n}\n\nfunction isOffsetContainer(element) {\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY') {\n return false;\n }\n return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;\n}\n\n/**\n * Finds the root node (document, shadowDOM root) of the given element\n * @method\n * @memberof Popper.Utils\n * @argument {Element} node\n * @returns {Element} root node\n */\nfunction getRoot(node) {\n if (node.parentNode !== null) {\n return getRoot(node.parentNode);\n }\n\n return node;\n}\n\n/**\n * Finds the offset parent common to the two provided nodes\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element1\n * @argument {Element} element2\n * @returns {Element} common offset parent\n */\nfunction findCommonOffsetParent(element1, element2) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {\n return document.documentElement;\n }\n\n // Here we make sure to give as \"start\" the element that comes first in the DOM\n var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;\n var start = order ? element1 : element2;\n var end = order ? element2 : element1;\n\n // Get common ancestor container\n var range = document.createRange();\n range.setStart(start, 0);\n range.setEnd(end, 0);\n var commonAncestorContainer = range.commonAncestorContainer;\n\n // Both nodes are inside #document\n\n if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {\n if (isOffsetContainer(commonAncestorContainer)) {\n return commonAncestorContainer;\n }\n\n return getOffsetParent(commonAncestorContainer);\n }\n\n // one of the nodes is inside shadowDOM, find which one\n var element1root = getRoot(element1);\n if (element1root.host) {\n return findCommonOffsetParent(element1root.host, element2);\n } else {\n return findCommonOffsetParent(element1, getRoot(element2).host);\n }\n}\n\n/**\n * Gets the scroll value of the given element in the given side (top and left)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {String} side `top` or `left`\n * @returns {number} amount of scrolled pixels\n */\nfunction getScroll(element) {\n var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';\n\n var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';\n var nodeName = element.nodeName;\n\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n var html = element.ownerDocument.documentElement;\n var scrollingElement = element.ownerDocument.scrollingElement || html;\n return scrollingElement[upperSide];\n }\n\n return element[upperSide];\n}\n\n/*\n * Sum or subtract the element scroll values (left and top) from a given rect object\n * @method\n * @memberof Popper.Utils\n * @param {Object} rect - Rect object you want to change\n * @param {HTMLElement} element - The element from the function reads the scroll values\n * @param {Boolean} subtract - set to true if you want to subtract the scroll values\n * @return {Object} rect - The modifier rect object\n */\nfunction includeScroll(rect, element) {\n var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n var modifier = subtract ? -1 : 1;\n rect.top += scrollTop * modifier;\n rect.bottom += scrollTop * modifier;\n rect.left += scrollLeft * modifier;\n rect.right += scrollLeft * modifier;\n return rect;\n}\n\n/*\n * Helper to detect borders of a given element\n * @method\n * @memberof Popper.Utils\n * @param {CSSStyleDeclaration} styles\n * Result of `getStyleComputedProperty` on the given element\n * @param {String} axis - `x` or `y`\n * @return {number} borders - The borders size of the given axis\n */\n\nfunction getBordersSize(styles, axis) {\n var sideA = axis === 'x' ? 'Left' : 'Top';\n var sideB = sideA === 'Left' ? 'Right' : 'Bottom';\n\n return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);\n}\n\nfunction getSize(axis, body, html, computedStyle) {\n return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);\n}\n\nfunction getWindowSizes(document) {\n var body = document.body;\n var html = document.documentElement;\n var computedStyle = isIE(10) && getComputedStyle(html);\n\n return {\n height: getSize('Height', body, html, computedStyle),\n width: getSize('Width', body, html, computedStyle)\n };\n}\n\nvar classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\n\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\n\n\n\n\nvar defineProperty = function (obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};\n\nvar _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n};\n\n/**\n * Given element offsets, generate an output similar to getBoundingClientRect\n * @method\n * @memberof Popper.Utils\n * @argument {Object} offsets\n * @returns {Object} ClientRect like output\n */\nfunction getClientRect(offsets) {\n return _extends({}, offsets, {\n right: offsets.left + offsets.width,\n bottom: offsets.top + offsets.height\n });\n}\n\n/**\n * Get bounding client rect of given element\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} element\n * @return {Object} client rect\n */\nfunction getBoundingClientRect(element) {\n var rect = {};\n\n // IE10 10 FIX: Please, don't ask, the element isn't\n // considered in DOM in some circumstances...\n // This isn't reproducible in IE10 compatibility mode of IE11\n try {\n if (isIE(10)) {\n rect = element.getBoundingClientRect();\n var scrollTop = getScroll(element, 'top');\n var scrollLeft = getScroll(element, 'left');\n rect.top += scrollTop;\n rect.left += scrollLeft;\n rect.bottom += scrollTop;\n rect.right += scrollLeft;\n } else {\n rect = element.getBoundingClientRect();\n }\n } catch (e) {}\n\n var result = {\n left: rect.left,\n top: rect.top,\n width: rect.right - rect.left,\n height: rect.bottom - rect.top\n };\n\n // subtract scrollbar size from sizes\n var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};\n var width = sizes.width || element.clientWidth || result.width;\n var height = sizes.height || element.clientHeight || result.height;\n\n var horizScrollbar = element.offsetWidth - width;\n var vertScrollbar = element.offsetHeight - height;\n\n // if an hypothetical scrollbar is detected, we must be sure it's not a `border`\n // we make this check conditional for performance reasons\n if (horizScrollbar || vertScrollbar) {\n var styles = getStyleComputedProperty(element);\n horizScrollbar -= getBordersSize(styles, 'x');\n vertScrollbar -= getBordersSize(styles, 'y');\n\n result.width -= horizScrollbar;\n result.height -= vertScrollbar;\n }\n\n return getClientRect(result);\n}\n\nfunction getOffsetRectRelativeToArbitraryNode(children, parent) {\n var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n var isIE10 = isIE(10);\n var isHTML = parent.nodeName === 'HTML';\n var childrenRect = getBoundingClientRect(children);\n var parentRect = getBoundingClientRect(parent);\n var scrollParent = getScrollParent(children);\n\n var styles = getStyleComputedProperty(parent);\n var borderTopWidth = parseFloat(styles.borderTopWidth);\n var borderLeftWidth = parseFloat(styles.borderLeftWidth);\n\n // In cases where the parent is fixed, we must ignore negative scroll in offset calc\n if (fixedPosition && isHTML) {\n parentRect.top = Math.max(parentRect.top, 0);\n parentRect.left = Math.max(parentRect.left, 0);\n }\n var offsets = getClientRect({\n top: childrenRect.top - parentRect.top - borderTopWidth,\n left: childrenRect.left - parentRect.left - borderLeftWidth,\n width: childrenRect.width,\n height: childrenRect.height\n });\n offsets.marginTop = 0;\n offsets.marginLeft = 0;\n\n // Subtract margins of documentElement in case it's being used as parent\n // we do this only on HTML because it's the only element that behaves\n // differently when margins are applied to it. The margins are included in\n // the box of the documentElement, in the other cases not.\n if (!isIE10 && isHTML) {\n var marginTop = parseFloat(styles.marginTop);\n var marginLeft = parseFloat(styles.marginLeft);\n\n offsets.top -= borderTopWidth - marginTop;\n offsets.bottom -= borderTopWidth - marginTop;\n offsets.left -= borderLeftWidth - marginLeft;\n offsets.right -= borderLeftWidth - marginLeft;\n\n // Attach marginTop and marginLeft because in some circumstances we may need them\n offsets.marginTop = marginTop;\n offsets.marginLeft = marginLeft;\n }\n\n if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {\n offsets = includeScroll(offsets, parent);\n }\n\n return offsets;\n}\n\nfunction getViewportOffsetRectRelativeToArtbitraryNode(element) {\n var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var html = element.ownerDocument.documentElement;\n var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);\n var width = Math.max(html.clientWidth, window.innerWidth || 0);\n var height = Math.max(html.clientHeight, window.innerHeight || 0);\n\n var scrollTop = !excludeScroll ? getScroll(html) : 0;\n var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;\n\n var offset = {\n top: scrollTop - relativeOffset.top + relativeOffset.marginTop,\n left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,\n width: width,\n height: height\n };\n\n return getClientRect(offset);\n}\n\n/**\n * Check if the given element is fixed or is inside a fixed parent\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @argument {Element} customContainer\n * @returns {Boolean} answer to \"isFixed?\"\n */\nfunction isFixed(element) {\n var nodeName = element.nodeName;\n if (nodeName === 'BODY' || nodeName === 'HTML') {\n return false;\n }\n if (getStyleComputedProperty(element, 'position') === 'fixed') {\n return true;\n }\n var parentNode = getParentNode(element);\n if (!parentNode) {\n return false;\n }\n return isFixed(parentNode);\n}\n\n/**\n * Finds the first parent of an element that has a transformed property defined\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Element} first transformed parent or documentElement\n */\n\nfunction getFixedPositionOffsetParent(element) {\n // This check is needed to avoid errors in case one of the elements isn't defined for any reason\n if (!element || !element.parentElement || isIE()) {\n return document.documentElement;\n }\n var el = element.parentElement;\n while (el && getStyleComputedProperty(el, 'transform') === 'none') {\n el = el.parentElement;\n }\n return el || document.documentElement;\n}\n\n/**\n * Computed the boundaries limits and return them\n * @method\n * @memberof Popper.Utils\n * @param {HTMLElement} popper\n * @param {HTMLElement} reference\n * @param {number} padding\n * @param {HTMLElement} boundariesElement - Element used to define the boundaries\n * @param {Boolean} fixedPosition - Is in fixed position mode\n * @returns {Object} Coordinates of the boundaries\n */\nfunction getBoundaries(popper, reference, padding, boundariesElement) {\n var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n // NOTE: 1 DOM access here\n\n var boundaries = { top: 0, left: 0 };\n var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n\n // Handle viewport case\n if (boundariesElement === 'viewport') {\n boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);\n } else {\n // Handle other cases based on DOM element used as boundaries\n var boundariesNode = void 0;\n if (boundariesElement === 'scrollParent') {\n boundariesNode = getScrollParent(getParentNode(reference));\n if (boundariesNode.nodeName === 'BODY') {\n boundariesNode = popper.ownerDocument.documentElement;\n }\n } else if (boundariesElement === 'window') {\n boundariesNode = popper.ownerDocument.documentElement;\n } else {\n boundariesNode = boundariesElement;\n }\n\n var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);\n\n // In case of HTML, we need a different computation\n if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {\n var _getWindowSizes = getWindowSizes(popper.ownerDocument),\n height = _getWindowSizes.height,\n width = _getWindowSizes.width;\n\n boundaries.top += offsets.top - offsets.marginTop;\n boundaries.bottom = height + offsets.top;\n boundaries.left += offsets.left - offsets.marginLeft;\n boundaries.right = width + offsets.left;\n } else {\n // for all the other DOM elements, this one is good\n boundaries = offsets;\n }\n }\n\n // Add paddings\n padding = padding || 0;\n var isPaddingNumber = typeof padding === 'number';\n boundaries.left += isPaddingNumber ? padding : padding.left || 0;\n boundaries.top += isPaddingNumber ? padding : padding.top || 0;\n boundaries.right -= isPaddingNumber ? padding : padding.right || 0;\n boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;\n\n return boundaries;\n}\n\nfunction getArea(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n return width * height;\n}\n\n/**\n * Utility used to transform the `auto` placement to the placement with more\n * available space.\n * @method\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {\n var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n\n if (placement.indexOf('auto') === -1) {\n return placement;\n }\n\n var boundaries = getBoundaries(popper, reference, padding, boundariesElement);\n\n var rects = {\n top: {\n width: boundaries.width,\n height: refRect.top - boundaries.top\n },\n right: {\n width: boundaries.right - refRect.right,\n height: boundaries.height\n },\n bottom: {\n width: boundaries.width,\n height: boundaries.bottom - refRect.bottom\n },\n left: {\n width: refRect.left - boundaries.left,\n height: boundaries.height\n }\n };\n\n var sortedAreas = Object.keys(rects).map(function (key) {\n return _extends({\n key: key\n }, rects[key], {\n area: getArea(rects[key])\n });\n }).sort(function (a, b) {\n return b.area - a.area;\n });\n\n var filteredAreas = sortedAreas.filter(function (_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n return width >= popper.clientWidth && height >= popper.clientHeight;\n });\n\n var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;\n\n var variation = placement.split('-')[1];\n\n return computedPlacement + (variation ? '-' + variation : '');\n}\n\n/**\n * Get offsets to the reference element\n * @method\n * @memberof Popper.Utils\n * @param {Object} state\n * @param {Element} popper - the popper element\n * @param {Element} reference - the reference element (the popper will be relative to this)\n * @param {Element} fixedPosition - is in fixed position mode\n * @returns {Object} An object containing the offsets which will be applied to the popper\n */\nfunction getReferenceOffsets(state, popper, reference) {\n var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));\n return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);\n}\n\n/**\n * Get the outer sizes of the given element (offset size + margins)\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element\n * @returns {Object} object containing width and height properties\n */\nfunction getOuterSizes(element) {\n var window = element.ownerDocument.defaultView;\n var styles = window.getComputedStyle(element);\n var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);\n var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);\n var result = {\n width: element.offsetWidth + y,\n height: element.offsetHeight + x\n };\n return result;\n}\n\n/**\n * Get the opposite placement of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement\n * @returns {String} flipped placement\n */\nfunction getOppositePlacement(placement) {\n var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\n/**\n * Get offsets to the popper\n * @method\n * @memberof Popper.Utils\n * @param {Object} position - CSS position the Popper will get applied\n * @param {HTMLElement} popper - the popper element\n * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)\n * @param {String} placement - one of the valid placement options\n * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper\n */\nfunction getPopperOffsets(popper, referenceOffsets, placement) {\n placement = placement.split('-')[0];\n\n // Get popper node sizes\n var popperRect = getOuterSizes(popper);\n\n // Add position, width and height to our offsets object\n var popperOffsets = {\n width: popperRect.width,\n height: popperRect.height\n };\n\n // depending by the popper placement we have to compute its offsets slightly differently\n var isHoriz = ['right', 'left'].indexOf(placement) !== -1;\n var mainSide = isHoriz ? 'top' : 'left';\n var secondarySide = isHoriz ? 'left' : 'top';\n var measurement = isHoriz ? 'height' : 'width';\n var secondaryMeasurement = !isHoriz ? 'height' : 'width';\n\n popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;\n if (placement === secondarySide) {\n popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];\n } else {\n popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];\n }\n\n return popperOffsets;\n}\n\n/**\n * Mimics the `find` method of Array\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction find(arr, check) {\n // use native find if supported\n if (Array.prototype.find) {\n return arr.find(check);\n }\n\n // use `filter` to obtain the same behavior of `find`\n return arr.filter(check)[0];\n}\n\n/**\n * Return the index of the matching object\n * @method\n * @memberof Popper.Utils\n * @argument {Array} arr\n * @argument prop\n * @argument value\n * @returns index or -1\n */\nfunction findIndex(arr, prop, value) {\n // use native findIndex if supported\n if (Array.prototype.findIndex) {\n return arr.findIndex(function (cur) {\n return cur[prop] === value;\n });\n }\n\n // use `find` + `indexOf` if `findIndex` isn't supported\n var match = find(arr, function (obj) {\n return obj[prop] === value;\n });\n return arr.indexOf(match);\n}\n\n/**\n * Loop trough the list of modifiers and run them in order,\n * each of them will then edit the data object.\n * @method\n * @memberof Popper.Utils\n * @param {dataObject} data\n * @param {Array} modifiers\n * @param {String} ends - Optional modifier name used as stopper\n * @returns {dataObject}\n */\nfunction runModifiers(modifiers, data, ends) {\n var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));\n\n modifiersToRun.forEach(function (modifier) {\n if (modifier['function']) {\n // eslint-disable-line dot-notation\n console.warn('`modifier.function` is deprecated, use `modifier.fn`!');\n }\n var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation\n if (modifier.enabled && isFunction(fn)) {\n // Add properties to offsets to make them a complete clientRect object\n // we do this before each modifier to make sure the previous one doesn't\n // mess with these values\n data.offsets.popper = getClientRect(data.offsets.popper);\n data.offsets.reference = getClientRect(data.offsets.reference);\n\n data = fn(data, modifier);\n }\n });\n\n return data;\n}\n\n/**\n * Updates the position of the popper, computing the new offsets and applying\n * the new style.<br />\n * Prefer `scheduleUpdate` over `update` because of performance reasons.\n * @method\n * @memberof Popper\n */\nfunction update() {\n // if popper is destroyed, don't perform any further update\n if (this.state.isDestroyed) {\n return;\n }\n\n var data = {\n instance: this,\n styles: {},\n arrowStyles: {},\n attributes: {},\n flipped: false,\n offsets: {}\n };\n\n // compute reference element offsets\n data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);\n\n // store the computed placement inside `originalPlacement`\n data.originalPlacement = data.placement;\n\n data.positionFixed = this.options.positionFixed;\n\n // compute the popper offsets\n data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);\n\n data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';\n\n // run the modifiers\n data = runModifiers(this.modifiers, data);\n\n // the first `update` will call `onCreate` callback\n // the other ones will call `onUpdate` callback\n if (!this.state.isCreated) {\n this.state.isCreated = true;\n this.options.onCreate(data);\n } else {\n this.options.onUpdate(data);\n }\n}\n\n/**\n * Helper used to know if the given modifier is enabled.\n * @method\n * @memberof Popper.Utils\n * @returns {Boolean}\n */\nfunction isModifierEnabled(modifiers, modifierName) {\n return modifiers.some(function (_ref) {\n var name = _ref.name,\n enabled = _ref.enabled;\n return enabled && name === modifierName;\n });\n}\n\n/**\n * Get the prefixed supported property name\n * @method\n * @memberof Popper.Utils\n * @argument {String} property (camelCase)\n * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)\n */\nfunction getSupportedPropertyName(property) {\n var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];\n var upperProp = property.charAt(0).toUpperCase() + property.slice(1);\n\n for (var i = 0; i < prefixes.length; i++) {\n var prefix = prefixes[i];\n var toCheck = prefix ? '' + prefix + upperProp : property;\n if (typeof document.body.style[toCheck] !== 'undefined') {\n return toCheck;\n }\n }\n return null;\n}\n\n/**\n * Destroys the popper.\n * @method\n * @memberof Popper\n */\nfunction destroy() {\n this.state.isDestroyed = true;\n\n // touch DOM only if `applyStyle` modifier is enabled\n if (isModifierEnabled(this.modifiers, 'applyStyle')) {\n this.popper.removeAttribute('x-placement');\n this.popper.style.position = '';\n this.popper.style.top = '';\n this.popper.style.left = '';\n this.popper.style.right = '';\n this.popper.style.bottom = '';\n this.popper.style.willChange = '';\n this.popper.style[getSupportedPropertyName('transform')] = '';\n }\n\n this.disableEventListeners();\n\n // remove the popper if user explicitly asked for the deletion on destroy\n // do not use `remove` because IE11 doesn't support it\n if (this.options.removeOnDestroy) {\n this.popper.parentNode.removeChild(this.popper);\n }\n return this;\n}\n\n/**\n * Get the window associated with the element\n * @argument {Element} element\n * @returns {Window}\n */\nfunction getWindow(element) {\n var ownerDocument = element.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView : window;\n}\n\nfunction attachToScrollParents(scrollParent, event, callback, scrollParents) {\n var isBody = scrollParent.nodeName === 'BODY';\n var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;\n target.addEventListener(event, callback, { passive: true });\n\n if (!isBody) {\n attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);\n }\n scrollParents.push(target);\n}\n\n/**\n * Setup needed event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction setupEventListeners(reference, options, state, updateBound) {\n // Resize event listener on window\n state.updateBound = updateBound;\n getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });\n\n // Scroll event listener on scroll parents\n var scrollElement = getScrollParent(reference);\n attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);\n state.scrollElement = scrollElement;\n state.eventsEnabled = true;\n\n return state;\n}\n\n/**\n * It will add resize/scroll events and start recalculating\n * position of the popper element when they are triggered.\n * @method\n * @memberof Popper\n */\nfunction enableEventListeners() {\n if (!this.state.eventsEnabled) {\n this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);\n }\n}\n\n/**\n * Remove event listeners used to update the popper position\n * @method\n * @memberof Popper.Utils\n * @private\n */\nfunction removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}\n\n/**\n * It will remove resize/scroll events and won't recalculate popper position\n * when they are triggered. It also won't trigger `onUpdate` callback anymore,\n * unless you call `update` method manually.\n * @method\n * @memberof Popper\n */\nfunction disableEventListeners() {\n if (this.state.eventsEnabled) {\n cancelAnimationFrame(this.scheduleUpdate);\n this.state = removeEventListeners(this.reference, this.state);\n }\n}\n\n/**\n * Tells if a given input is a number\n * @method\n * @memberof Popper.Utils\n * @param {*} input to check\n * @return {Boolean}\n */\nfunction isNumeric(n) {\n return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);\n}\n\n/**\n * Set the style to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the style to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setStyles(element, styles) {\n Object.keys(styles).forEach(function (prop) {\n var unit = '';\n // add unit if the value is numeric and is one of the following\n if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {\n unit = 'px';\n }\n element.style[prop] = styles[prop] + unit;\n });\n}\n\n/**\n * Set the attributes to the given popper\n * @method\n * @memberof Popper.Utils\n * @argument {Element} element - Element to apply the attributes to\n * @argument {Object} styles\n * Object with a list of properties and values which will be applied to the element\n */\nfunction setAttributes(element, attributes) {\n Object.keys(attributes).forEach(function (prop) {\n var value = attributes[prop];\n if (value !== false) {\n element.setAttribute(prop, attributes[prop]);\n } else {\n element.removeAttribute(prop);\n }\n });\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} data.styles - List of style properties - values to apply to popper element\n * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The same data object\n */\nfunction applyStyle(data) {\n // any property present in `data.styles` will be applied to the popper,\n // in this way we can make the 3rd party modifiers add custom styles to it\n // Be aware, modifiers could override the properties defined in the previous\n // lines of this modifier!\n setStyles(data.instance.popper, data.styles);\n\n // any property present in `data.attributes` will be applied to the popper,\n // they will be set as HTML attributes of the element\n setAttributes(data.instance.popper, data.attributes);\n\n // if arrowElement is defined and arrowStyles has some properties\n if (data.arrowElement && Object.keys(data.arrowStyles).length) {\n setStyles(data.arrowElement, data.arrowStyles);\n }\n\n return data;\n}\n\n/**\n * Set the x-placement attribute before everything else because it could be used\n * to add margins to the popper margins needs to be calculated to get the\n * correct popper offsets.\n * @method\n * @memberof Popper.modifiers\n * @param {HTMLElement} reference - The reference element used to position the popper\n * @param {HTMLElement} popper - The HTML element used as popper\n * @param {Object} options - Popper.js options\n */\nfunction applyStyleOnLoad(reference, popper, options, modifierOptions, state) {\n // compute reference element offsets\n var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);\n\n // compute auto placement, store placement inside the data object,\n // modifiers will be able to edit `placement` if needed\n // and refer to originalPlacement to know the original value\n var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);\n\n popper.setAttribute('x-placement', placement);\n\n // Apply `position` to popper before anything else because\n // without the position applied we can't guarantee correct computations\n setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });\n\n return options;\n}\n\n/**\n * @function\n * @memberof Popper.Utils\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Boolean} shouldRound - If the offsets should be rounded at all\n * @returns {Object} The popper's position offsets rounded\n *\n * The tale of pixel-perfect positioning. It's still not 100% perfect, but as\n * good as it can be within reason.\n * Discussion here: https://github.com/FezVrasta/popper.js/pull/715\n *\n * Low DPI screens cause a popper to be blurry if not using full pixels (Safari\n * as well on High DPI screens).\n *\n * Firefox prefers no rounding for positioning and does not have blurriness on\n * high DPI screens.\n *\n * Only horizontal placement and left/right values need to be considered.\n */\nfunction getRoundedOffsets(data, shouldRound) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n var round = Math.round,\n floor = Math.floor;\n\n var noRound = function noRound(v) {\n return v;\n };\n\n var referenceWidth = round(reference.width);\n var popperWidth = round(popper.width);\n\n var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;\n var isVariation = data.placement.indexOf('-') !== -1;\n var sameWidthParity = referenceWidth % 2 === popperWidth % 2;\n var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;\n\n var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;\n var verticalToInteger = !shouldRound ? noRound : round;\n\n return {\n left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),\n top: verticalToInteger(popper.top),\n bottom: verticalToInteger(popper.bottom),\n right: horizontalToInteger(popper.right)\n };\n}\n\nvar isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction computeStyle(data, options) {\n var x = options.x,\n y = options.y;\n var popper = data.offsets.popper;\n\n // Remove this legacy support in Popper.js v2\n\n var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'applyStyle';\n }).gpuAcceleration;\n if (legacyGpuAccelerationOption !== undefined) {\n console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');\n }\n var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;\n\n var offsetParent = getOffsetParent(data.instance.popper);\n var offsetParentRect = getBoundingClientRect(offsetParent);\n\n // Styles\n var styles = {\n position: popper.position\n };\n\n var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);\n\n var sideA = x === 'bottom' ? 'top' : 'bottom';\n var sideB = y === 'right' ? 'left' : 'right';\n\n // if gpuAcceleration is set to `true` and transform is supported,\n // we use `translate3d` to apply the position to the popper we\n // automatically use the supported prefixed version if needed\n var prefixedProperty = getSupportedPropertyName('transform');\n\n // now, let's make a step back and look at this code closely (wtf?)\n // If the content of the popper grows once it's been positioned, it\n // may happen that the popper gets misplaced because of the new content\n // overflowing its reference element\n // To avoid this problem, we provide two options (x and y), which allow\n // the consumer to define the offset origin.\n // If we position a popper on top of a reference element, we can set\n // `x` to `top` to make the popper grow towards its top instead of\n // its bottom.\n var left = void 0,\n top = void 0;\n if (sideA === 'bottom') {\n // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)\n // and not the bottom of the html element\n if (offsetParent.nodeName === 'HTML') {\n top = -offsetParent.clientHeight + offsets.bottom;\n } else {\n top = -offsetParentRect.height + offsets.bottom;\n }\n } else {\n top = offsets.top;\n }\n if (sideB === 'right') {\n if (offsetParent.nodeName === 'HTML') {\n left = -offsetParent.clientWidth + offsets.right;\n } else {\n left = -offsetParentRect.width + offsets.right;\n }\n } else {\n left = offsets.left;\n }\n if (gpuAcceleration && prefixedProperty) {\n styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';\n styles[sideA] = 0;\n styles[sideB] = 0;\n styles.willChange = 'transform';\n } else {\n // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties\n var invertTop = sideA === 'bottom' ? -1 : 1;\n var invertLeft = sideB === 'right' ? -1 : 1;\n styles[sideA] = top * invertTop;\n styles[sideB] = left * invertLeft;\n styles.willChange = sideA + ', ' + sideB;\n }\n\n // Attributes\n var attributes = {\n 'x-placement': data.placement\n };\n\n // Update `data` attributes, styles and arrowStyles\n data.attributes = _extends({}, attributes, data.attributes);\n data.styles = _extends({}, styles, data.styles);\n data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);\n\n return data;\n}\n\n/**\n * Helper used to know if the given modifier depends from another one.<br />\n * It checks if the needed modifier is listed and enabled.\n * @method\n * @memberof Popper.Utils\n * @param {Array} modifiers - list of modifiers\n * @param {String} requestingName - name of requesting modifier\n * @param {String} requestedName - name of requested modifier\n * @returns {Boolean}\n */\nfunction isModifierRequired(modifiers, requestingName, requestedName) {\n var requesting = find(modifiers, function (_ref) {\n var name = _ref.name;\n return name === requestingName;\n });\n\n var isRequired = !!requesting && modifiers.some(function (modifier) {\n return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;\n });\n\n if (!isRequired) {\n var _requesting = '`' + requestingName + '`';\n var requested = '`' + requestedName + '`';\n console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');\n }\n return isRequired;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction arrow(data, options) {\n var _data$offsets$arrow;\n\n // arrow depends on keepTogether in order to work\n if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {\n return data;\n }\n\n var arrowElement = options.element;\n\n // if arrowElement is a string, suppose it's a CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = data.instance.popper.querySelector(arrowElement);\n\n // if arrowElement is not found, don't run the modifier\n if (!arrowElement) {\n return data;\n }\n } else {\n // if the arrowElement isn't a query selector we must check that the\n // provided DOM node is child of its popper node\n if (!data.instance.popper.contains(arrowElement)) {\n console.warn('WARNING: `arrow.element` must be child of its popper element!');\n return data;\n }\n }\n\n var placement = data.placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isVertical = ['left', 'right'].indexOf(placement) !== -1;\n\n var len = isVertical ? 'height' : 'width';\n var sideCapitalized = isVertical ? 'Top' : 'Left';\n var side = sideCapitalized.toLowerCase();\n var altSide = isVertical ? 'left' : 'top';\n var opSide = isVertical ? 'bottom' : 'right';\n var arrowElementSize = getOuterSizes(arrowElement)[len];\n\n //\n // extends keepTogether behavior making sure the popper and its\n // reference have enough pixels in conjunction\n //\n\n // top/left side\n if (reference[opSide] - arrowElementSize < popper[side]) {\n data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);\n }\n // bottom/right side\n if (reference[side] + arrowElementSize > popper[opSide]) {\n data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];\n }\n data.offsets.popper = getClientRect(data.offsets.popper);\n\n // compute center of the popper\n var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;\n\n // Compute the sideValue using the updated popper offsets\n // take popper margin in account because we don't have this info available\n var css = getStyleComputedProperty(data.instance.popper);\n var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);\n var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);\n var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;\n\n // prevent arrowElement from being placed not contiguously to its popper\n sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);\n\n data.arrowElement = arrowElement;\n data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);\n\n return data;\n}\n\n/**\n * Get the opposite placement variation of the given one\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement variation\n * @returns {String} flipped placement variation\n */\nfunction getOppositeVariation(variation) {\n if (variation === 'end') {\n return 'start';\n } else if (variation === 'start') {\n return 'end';\n }\n return variation;\n}\n\n/**\n * List of accepted placements to use as values of the `placement` option.<br />\n * Valid placements are:\n * - `auto`\n * - `top`\n * - `right`\n * - `bottom`\n * - `left`\n *\n * Each placement can have a variation from this list:\n * - `-start`\n * - `-end`\n *\n * Variations are interpreted easily if you think of them as the left to right\n * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`\n * is right.<br />\n * Vertically (`left` and `right`), `start` is top and `end` is bottom.\n *\n * Some valid examples are:\n * - `top-end` (on top of reference, right aligned)\n * - `right-start` (on right of reference, top aligned)\n * - `bottom` (on bottom, centered)\n * - `auto-end` (on the side with more space available, alignment depends by placement)\n *\n * @static\n * @type {Array}\n * @enum {String}\n * @readonly\n * @method placements\n * @memberof Popper\n */\nvar placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];\n\n// Get rid of `auto` `auto-start` and `auto-end`\nvar validPlacements = placements.slice(3);\n\n/**\n * Given an initial placement, returns all the subsequent placements\n * clockwise (or counter-clockwise).\n *\n * @method\n * @memberof Popper.Utils\n * @argument {String} placement - A valid placement (it accepts variations)\n * @argument {Boolean} counter - Set to true to walk the placements counterclockwise\n * @returns {Array} placements including their variations\n */\nfunction clockwise(placement) {\n var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var index = validPlacements.indexOf(placement);\n var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));\n return counter ? arr.reverse() : arr;\n}\n\nvar BEHAVIORS = {\n FLIP: 'flip',\n CLOCKWISE: 'clockwise',\n COUNTERCLOCKWISE: 'counterclockwise'\n};\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction flip(data, options) {\n // if `inner` modifier is enabled, we can't use the `flip` modifier\n if (isModifierEnabled(data.instance.modifiers, 'inner')) {\n return data;\n }\n\n if (data.flipped && data.placement === data.originalPlacement) {\n // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides\n return data;\n }\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);\n\n var placement = data.placement.split('-')[0];\n var placementOpposite = getOppositePlacement(placement);\n var variation = data.placement.split('-')[1] || '';\n\n var flipOrder = [];\n\n switch (options.behavior) {\n case BEHAVIORS.FLIP:\n flipOrder = [placement, placementOpposite];\n break;\n case BEHAVIORS.CLOCKWISE:\n flipOrder = clockwise(placement);\n break;\n case BEHAVIORS.COUNTERCLOCKWISE:\n flipOrder = clockwise(placement, true);\n break;\n default:\n flipOrder = options.behavior;\n }\n\n flipOrder.forEach(function (step, index) {\n if (placement !== step || flipOrder.length === index + 1) {\n return data;\n }\n\n placement = data.placement.split('-')[0];\n placementOpposite = getOppositePlacement(placement);\n\n var popperOffsets = data.offsets.popper;\n var refOffsets = data.offsets.reference;\n\n // using floor because the reference offsets may contain decimals we are not going to consider here\n var floor = Math.floor;\n var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);\n\n var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);\n var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);\n var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);\n var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);\n\n var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;\n\n // flip the variation if required\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n\n // flips variation if reference element overflows boundaries\n var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);\n\n // flips variation if popper content overflows boundaries\n var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);\n\n var flippedVariation = flippedVariationByRef || flippedVariationByContent;\n\n if (overlapsRef || overflowsBoundaries || flippedVariation) {\n // this boolean to detect any flip loop\n data.flipped = true;\n\n if (overlapsRef || overflowsBoundaries) {\n placement = flipOrder[index + 1];\n }\n\n if (flippedVariation) {\n variation = getOppositeVariation(variation);\n }\n\n data.placement = placement + (variation ? '-' + variation : '');\n\n // this object contains `position`, we want to preserve it along with\n // any additional property we may add in the future\n data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));\n\n data = runModifiers(data.instance.modifiers, data, 'flip');\n }\n });\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction keepTogether(data) {\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var placement = data.placement.split('-')[0];\n var floor = Math.floor;\n var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;\n var side = isVertical ? 'right' : 'bottom';\n var opSide = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n if (popper[side] < floor(reference[opSide])) {\n data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];\n }\n if (popper[opSide] > floor(reference[side])) {\n data.offsets.popper[opSide] = floor(reference[side]);\n }\n\n return data;\n}\n\n/**\n * Converts a string containing value + unit into a px value number\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} str - Value + unit string\n * @argument {String} measurement - `height` or `width`\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @returns {Number|String}\n * Value in pixels, or original string if no values were extracted\n */\nfunction toValue(str, measurement, popperOffsets, referenceOffsets) {\n // separate value from unit\n var split = str.match(/((?:\\-|\\+)?\\d*\\.?\\d*)(.*)/);\n var value = +split[1];\n var unit = split[2];\n\n // If it's not a number it's an operator, I guess\n if (!value) {\n return str;\n }\n\n if (unit.indexOf('%') === 0) {\n var element = void 0;\n switch (unit) {\n case '%p':\n element = popperOffsets;\n break;\n case '%':\n case '%r':\n default:\n element = referenceOffsets;\n }\n\n var rect = getClientRect(element);\n return rect[measurement] / 100 * value;\n } else if (unit === 'vh' || unit === 'vw') {\n // if is a vh or vw, we calculate the size based on the viewport\n var size = void 0;\n if (unit === 'vh') {\n size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n } else {\n size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n }\n return size / 100 * value;\n } else {\n // if is an explicit pixel unit, we get rid of the unit and keep the value\n // if is an implicit unit, it's px, and we return just the value\n return value;\n }\n}\n\n/**\n * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.\n * @function\n * @memberof {modifiers~offset}\n * @private\n * @argument {String} offset\n * @argument {Object} popperOffsets\n * @argument {Object} referenceOffsets\n * @argument {String} basePlacement\n * @returns {Array} a two cells array with x and y offsets in numbers\n */\nfunction parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {\n var offsets = [0, 0];\n\n // Use height if placement is left or right and index is 0 otherwise use width\n // in this way the first offset will use an axis and the second one\n // will use the other one\n var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;\n\n // Split the offset string to obtain a list of values and operands\n // The regex addresses values with the plus or minus sign in front (+10, -20, etc)\n var fragments = offset.split(/(\\+|\\-)/).map(function (frag) {\n return frag.trim();\n });\n\n // Detect if the offset string contains a pair of values or a single one\n // they could be separated by comma or space\n var divider = fragments.indexOf(find(fragments, function (frag) {\n return frag.search(/,|\\s/) !== -1;\n }));\n\n if (fragments[divider] && fragments[divider].indexOf(',') === -1) {\n console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');\n }\n\n // If divider is found, we divide the list of values and operands to divide\n // them by ofset X and Y.\n var splitRegex = /\\s*,\\s*|\\s+/;\n var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];\n\n // Convert the values with units to absolute pixels to allow our computations\n ops = ops.map(function (op, index) {\n // Most of the units rely on the orientation of the popper\n var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';\n var mergeWithPrevious = false;\n return op\n // This aggregates any `+` or `-` sign that aren't considered operators\n // e.g.: 10 + +5 => [10, +, +5]\n .reduce(function (a, b) {\n if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {\n a[a.length - 1] = b;\n mergeWithPrevious = true;\n return a;\n } else if (mergeWithPrevious) {\n a[a.length - 1] += b;\n mergeWithPrevious = false;\n return a;\n } else {\n return a.concat(b);\n }\n }, [])\n // Here we convert the string values into number values (in px)\n .map(function (str) {\n return toValue(str, measurement, popperOffsets, referenceOffsets);\n });\n });\n\n // Loop trough the offsets arrays and execute the operations\n ops.forEach(function (op, index) {\n op.forEach(function (frag, index2) {\n if (isNumeric(frag)) {\n offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);\n }\n });\n });\n return offsets;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @argument {Number|String} options.offset=0\n * The offset value as described in the modifier description\n * @returns {Object} The data object, properly modified\n */\nfunction offset(data, _ref) {\n var offset = _ref.offset;\n var placement = data.placement,\n _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var basePlacement = placement.split('-')[0];\n\n var offsets = void 0;\n if (isNumeric(+offset)) {\n offsets = [+offset, 0];\n } else {\n offsets = parseOffset(offset, popper, reference, basePlacement);\n }\n\n if (basePlacement === 'left') {\n popper.top += offsets[0];\n popper.left -= offsets[1];\n } else if (basePlacement === 'right') {\n popper.top += offsets[0];\n popper.left += offsets[1];\n } else if (basePlacement === 'top') {\n popper.left += offsets[0];\n popper.top -= offsets[1];\n } else if (basePlacement === 'bottom') {\n popper.left += offsets[0];\n popper.top += offsets[1];\n }\n\n data.popper = popper;\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction preventOverflow(data, options) {\n var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);\n\n // If offsetParent is the reference element, we really want to\n // go one step up and use the next offsetParent as reference to\n // avoid to make this modifier completely useless and look like broken\n if (data.instance.reference === boundariesElement) {\n boundariesElement = getOffsetParent(boundariesElement);\n }\n\n // NOTE: DOM access here\n // resets the popper's position so that the document size can be calculated excluding\n // the size of the popper element itself\n var transformProp = getSupportedPropertyName('transform');\n var popperStyles = data.instance.popper.style; // assignment to help minification\n var top = popperStyles.top,\n left = popperStyles.left,\n transform = popperStyles[transformProp];\n\n popperStyles.top = '';\n popperStyles.left = '';\n popperStyles[transformProp] = '';\n\n var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);\n\n // NOTE: DOM access here\n // restores the original style properties after the offsets have been computed\n popperStyles.top = top;\n popperStyles.left = left;\n popperStyles[transformProp] = transform;\n\n options.boundaries = boundaries;\n\n var order = options.priority;\n var popper = data.offsets.popper;\n\n var check = {\n primary: function primary(placement) {\n var value = popper[placement];\n if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {\n value = Math.max(popper[placement], boundaries[placement]);\n }\n return defineProperty({}, placement, value);\n },\n secondary: function secondary(placement) {\n var mainSide = placement === 'right' ? 'left' : 'top';\n var value = popper[mainSide];\n if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {\n value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));\n }\n return defineProperty({}, mainSide, value);\n }\n };\n\n order.forEach(function (placement) {\n var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';\n popper = _extends({}, popper, check[side](placement));\n });\n\n data.offsets.popper = popper;\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction shift(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var shiftvariation = placement.split('-')[1];\n\n // if shift shiftvariation is specified, run the modifier\n if (shiftvariation) {\n var _data$offsets = data.offsets,\n reference = _data$offsets.reference,\n popper = _data$offsets.popper;\n\n var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;\n var side = isVertical ? 'left' : 'top';\n var measurement = isVertical ? 'width' : 'height';\n\n var shiftOffsets = {\n start: defineProperty({}, side, reference[side]),\n end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])\n };\n\n data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by update method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction hide(data) {\n if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {\n return data;\n }\n\n var refRect = data.offsets.reference;\n var bound = find(data.instance.modifiers, function (modifier) {\n return modifier.name === 'preventOverflow';\n }).boundaries;\n\n if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === true) {\n return data;\n }\n\n data.hide = true;\n data.attributes['x-out-of-boundaries'] = '';\n } else {\n // Avoid unnecessary DOM access if visibility hasn't changed\n if (data.hide === false) {\n return data;\n }\n\n data.hide = false;\n data.attributes['x-out-of-boundaries'] = false;\n }\n\n return data;\n}\n\n/**\n * @function\n * @memberof Modifiers\n * @argument {Object} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {Object} The data object, properly modified\n */\nfunction inner(data) {\n var placement = data.placement;\n var basePlacement = placement.split('-')[0];\n var _data$offsets = data.offsets,\n popper = _data$offsets.popper,\n reference = _data$offsets.reference;\n\n var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;\n\n var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;\n\n popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);\n\n data.placement = getOppositePlacement(placement);\n data.offsets.popper = getClientRect(popper);\n\n return data;\n}\n\n/**\n * Modifier function, each modifier can have a function of this type assigned\n * to its `fn` property.<br />\n * These functions will be called on each update, this means that you must\n * make sure they are performant enough to avoid performance bottlenecks.\n *\n * @function ModifierFn\n * @argument {dataObject} data - The data object generated by `update` method\n * @argument {Object} options - Modifiers configuration and options\n * @returns {dataObject} The data object, properly modified\n */\n\n/**\n * Modifiers are plugins used to alter the behavior of your poppers.<br />\n * Popper.js uses a set of 9 modifiers to provide all the basic functionalities\n * needed by the library.\n *\n * Usually you don't want to override the `order`, `fn` and `onLoad` props.\n * All the other properties are configurations that could be tweaked.\n * @namespace modifiers\n */\nvar modifiers = {\n /**\n * Modifier used to shift the popper on the start or end of its reference\n * element.<br />\n * It will read the variation of the `placement` property.<br />\n * It can be one either `-end` or `-start`.\n * @memberof modifiers\n * @inner\n */\n shift: {\n /** @prop {number} order=100 - Index used to define the order of execution */\n order: 100,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: shift\n },\n\n /**\n * The `offset` modifier can shift your popper on both its axis.\n *\n * It accepts the following units:\n * - `px` or unit-less, interpreted as pixels\n * - `%` or `%r`, percentage relative to the length of the reference element\n * - `%p`, percentage relative to the length of the popper element\n * - `vw`, CSS viewport width unit\n * - `vh`, CSS viewport height unit\n *\n * For length is intended the main axis relative to the placement of the popper.<br />\n * This means that if the placement is `top` or `bottom`, the length will be the\n * `width`. In case of `left` or `right`, it will be the `height`.\n *\n * You can provide a single value (as `Number` or `String`), or a pair of values\n * as `String` divided by a comma or one (or more) white spaces.<br />\n * The latter is a deprecated method because it leads to confusion and will be\n * removed in v2.<br />\n * Additionally, it accepts additions and subtractions between different units.\n * Note that multiplications and divisions aren't supported.\n *\n * Valid examples are:\n * ```\n * 10\n * '10%'\n * '10, 10'\n * '10%, 10'\n * '10 + 10%'\n * '10 - 5vh + 3%'\n * '-10px + 5vh, 5px - 6%'\n * ```\n * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap\n * > with their reference element, unfortunately, you will have to disable the `flip` modifier.\n * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).\n *\n * @memberof modifiers\n * @inner\n */\n offset: {\n /** @prop {number} order=200 - Index used to define the order of execution */\n order: 200,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: offset,\n /** @prop {Number|String} offset=0\n * The offset value as described in the modifier description\n */\n offset: 0\n },\n\n /**\n * Modifier used to prevent the popper from being positioned outside the boundary.\n *\n * A scenario exists where the reference itself is not within the boundaries.<br />\n * We can say it has \"escaped the boundaries\" — or just \"escaped\".<br />\n * In this case we need to decide whether the popper should either:\n *\n * - detach from the reference and remain \"trapped\" in the boundaries, or\n * - if it should ignore the boundary and \"escape with its reference\"\n *\n * When `escapeWithReference` is set to`true` and reference is completely\n * outside its boundaries, the popper will overflow (or completely leave)\n * the boundaries in order to remain attached to the edge of the reference.\n *\n * @memberof modifiers\n * @inner\n */\n preventOverflow: {\n /** @prop {number} order=300 - Index used to define the order of execution */\n order: 300,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: preventOverflow,\n /**\n * @prop {Array} [priority=['left','right','top','bottom']]\n * Popper will try to prevent overflow following these priorities by default,\n * then, it could overflow on the left and on top of the `boundariesElement`\n */\n priority: ['left', 'right', 'top', 'bottom'],\n /**\n * @prop {number} padding=5\n * Amount of pixel used to define a minimum distance between the boundaries\n * and the popper. This makes sure the popper always has a little padding\n * between the edges of its container\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='scrollParent'\n * Boundaries used by the modifier. Can be `scrollParent`, `window`,\n * `viewport` or any DOM element.\n */\n boundariesElement: 'scrollParent'\n },\n\n /**\n * Modifier used to make sure the reference and its popper stay near each other\n * without leaving any gap between the two. Especially useful when the arrow is\n * enabled and you want to ensure that it points to its reference element.\n * It cares only about the first axis. You can still have poppers with margin\n * between the popper and its reference element.\n * @memberof modifiers\n * @inner\n */\n keepTogether: {\n /** @prop {number} order=400 - Index used to define the order of execution */\n order: 400,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: keepTogether\n },\n\n /**\n * This modifier is used to move the `arrowElement` of the popper to make\n * sure it is positioned between the reference element and its popper element.\n * It will read the outer size of the `arrowElement` node to detect how many\n * pixels of conjunction are needed.\n *\n * It has no effect if no `arrowElement` is provided.\n * @memberof modifiers\n * @inner\n */\n arrow: {\n /** @prop {number} order=500 - Index used to define the order of execution */\n order: 500,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: arrow,\n /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */\n element: '[x-arrow]'\n },\n\n /**\n * Modifier used to flip the popper's placement when it starts to overlap its\n * reference element.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n *\n * **NOTE:** this modifier will interrupt the current update cycle and will\n * restart it if it detects the need to flip the placement.\n * @memberof modifiers\n * @inner\n */\n flip: {\n /** @prop {number} order=600 - Index used to define the order of execution */\n order: 600,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: flip,\n /**\n * @prop {String|Array} behavior='flip'\n * The behavior used to change the popper's placement. It can be one of\n * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid\n * placements (with optional variations)\n */\n behavior: 'flip',\n /**\n * @prop {number} padding=5\n * The popper will flip if it hits the edges of the `boundariesElement`\n */\n padding: 5,\n /**\n * @prop {String|HTMLElement} boundariesElement='viewport'\n * The element which will define the boundaries of the popper position.\n * The popper will never be placed outside of the defined boundaries\n * (except if `keepTogether` is enabled)\n */\n boundariesElement: 'viewport',\n /**\n * @prop {Boolean} flipVariations=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the reference element overlaps its boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariations: false,\n /**\n * @prop {Boolean} flipVariationsByContent=false\n * The popper will switch placement variation between `-start` and `-end` when\n * the popper element overlaps its reference boundaries.\n *\n * The original placement should have a set variation.\n */\n flipVariationsByContent: false\n },\n\n /**\n * Modifier used to make the popper flow toward the inner of the reference element.\n * By default, when this modifier is disabled, the popper will be placed outside\n * the reference element.\n * @memberof modifiers\n * @inner\n */\n inner: {\n /** @prop {number} order=700 - Index used to define the order of execution */\n order: 700,\n /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */\n enabled: false,\n /** @prop {ModifierFn} */\n fn: inner\n },\n\n /**\n * Modifier used to hide the popper when its reference element is outside of the\n * popper boundaries. It will set a `x-out-of-boundaries` attribute which can\n * be used to hide with a CSS selector the popper when its reference is\n * out of boundaries.\n *\n * Requires the `preventOverflow` modifier before it in order to work.\n * @memberof modifiers\n * @inner\n */\n hide: {\n /** @prop {number} order=800 - Index used to define the order of execution */\n order: 800,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: hide\n },\n\n /**\n * Computes the style that will be applied to the popper element to gets\n * properly positioned.\n *\n * Note that this modifier will not touch the DOM, it just prepares the styles\n * so that `applyStyle` modifier can apply it. This separation is useful\n * in case you need to replace `applyStyle` with a custom implementation.\n *\n * This modifier has `850` as `order` value to maintain backward compatibility\n * with previous versions of Popper.js. Expect the modifiers ordering method\n * to change in future major versions of the library.\n *\n * @memberof modifiers\n * @inner\n */\n computeStyle: {\n /** @prop {number} order=850 - Index used to define the order of execution */\n order: 850,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: computeStyle,\n /**\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: true,\n /**\n * @prop {string} [x='bottom']\n * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.\n * Change this if your popper should grow in a direction different from `bottom`\n */\n x: 'bottom',\n /**\n * @prop {string} [x='left']\n * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.\n * Change this if your popper should grow in a direction different from `right`\n */\n y: 'right'\n },\n\n /**\n * Applies the computed styles to the popper element.\n *\n * All the DOM manipulations are limited to this modifier. This is useful in case\n * you want to integrate Popper.js inside a framework or view library and you\n * want to delegate all the DOM manipulations to it.\n *\n * Note that if you disable this modifier, you must make sure the popper element\n * has its position set to `absolute` before Popper.js can do its work!\n *\n * Just disable this modifier and define your own to achieve the desired effect.\n *\n * @memberof modifiers\n * @inner\n */\n applyStyle: {\n /** @prop {number} order=900 - Index used to define the order of execution */\n order: 900,\n /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */\n enabled: true,\n /** @prop {ModifierFn} */\n fn: applyStyle,\n /** @prop {Function} */\n onLoad: applyStyleOnLoad,\n /**\n * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier\n * @prop {Boolean} gpuAcceleration=true\n * If true, it uses the CSS 3D transformation to position the popper.\n * Otherwise, it will use the `top` and `left` properties\n */\n gpuAcceleration: undefined\n }\n};\n\n/**\n * The `dataObject` is an object containing all the information used by Popper.js.\n * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.\n * @name dataObject\n * @property {Object} data.instance The Popper.js instance\n * @property {String} data.placement Placement applied to popper\n * @property {String} data.originalPlacement Placement originally defined on init\n * @property {Boolean} data.flipped True if popper has been flipped by flip modifier\n * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper\n * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier\n * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)\n * @property {Object} data.boundaries Offsets of the popper boundaries\n * @property {Object} data.offsets The measurements of popper, reference and arrow elements\n * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values\n * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0\n */\n\n/**\n * Default options provided to Popper.js constructor.<br />\n * These can be overridden using the `options` argument of Popper.js.<br />\n * To override an option, simply pass an object with the same\n * structure of the `options` object, as the 3rd argument. For example:\n * ```\n * new Popper(ref, pop, {\n * modifiers: {\n * preventOverflow: { enabled: false }\n * }\n * })\n * ```\n * @type {Object}\n * @static\n * @memberof Popper\n */\nvar Defaults = {\n /**\n * Popper's placement.\n * @prop {Popper.placements} placement='bottom'\n */\n placement: 'bottom',\n\n /**\n * Set this to true if you want popper to position it self in 'fixed' mode\n * @prop {Boolean} positionFixed=false\n */\n positionFixed: false,\n\n /**\n * Whether events (resize, scroll) are initially enabled.\n * @prop {Boolean} eventsEnabled=true\n */\n eventsEnabled: true,\n\n /**\n * Set to true if you want to automatically remove the popper when\n * you call the `destroy` method.\n * @prop {Boolean} removeOnDestroy=false\n */\n removeOnDestroy: false,\n\n /**\n * Callback called when the popper is created.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onCreate}\n */\n onCreate: function onCreate() {},\n\n /**\n * Callback called when the popper is updated. This callback is not called\n * on the initialization/creation of the popper, but only on subsequent\n * updates.<br />\n * By default, it is set to no-op.<br />\n * Access Popper.js instance with `data.instance`.\n * @prop {onUpdate}\n */\n onUpdate: function onUpdate() {},\n\n /**\n * List of modifiers used to modify the offsets before they are applied to the popper.\n * They provide most of the functionalities of Popper.js.\n * @prop {modifiers}\n */\n modifiers: modifiers\n};\n\n/**\n * @callback onCreate\n * @param {dataObject} data\n */\n\n/**\n * @callback onUpdate\n * @param {dataObject} data\n */\n\n// Utils\n// Methods\nvar Popper = function () {\n /**\n * Creates a new Popper.js instance.\n * @class Popper\n * @param {Element|referenceObject} reference - The reference element used to position the popper\n * @param {Element} popper - The HTML / XML element used as the popper\n * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)\n * @return {Object} instance - The generated Popper.js instance\n */\n function Popper(reference, popper) {\n var _this = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n classCallCheck(this, Popper);\n\n this.scheduleUpdate = function () {\n return requestAnimationFrame(_this.update);\n };\n\n // make update() debounced, so that it only runs at most once-per-tick\n this.update = debounce(this.update.bind(this));\n\n // with {} we create a new object with the options inside it\n this.options = _extends({}, Popper.Defaults, options);\n\n // init state\n this.state = {\n isDestroyed: false,\n isCreated: false,\n scrollParents: []\n };\n\n // get reference and popper elements (allow jQuery wrappers)\n this.reference = reference && reference.jquery ? reference[0] : reference;\n this.popper = popper && popper.jquery ? popper[0] : popper;\n\n // Deep merge modifiers options\n this.options.modifiers = {};\n Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {\n _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});\n });\n\n // Refactoring modifiers' list (Object => Array)\n this.modifiers = Object.keys(this.options.modifiers).map(function (name) {\n return _extends({\n name: name\n }, _this.options.modifiers[name]);\n })\n // sort the modifiers by order\n .sort(function (a, b) {\n return a.order - b.order;\n });\n\n // modifiers have the ability to execute arbitrary code when Popper.js get inited\n // such code is executed in the same order of its modifier\n // they could add new properties to their options configuration\n // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!\n this.modifiers.forEach(function (modifierOptions) {\n if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {\n modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);\n }\n });\n\n // fire the first update to position the popper in the right place\n this.update();\n\n var eventsEnabled = this.options.eventsEnabled;\n if (eventsEnabled) {\n // setup event listeners, they will take care of update the position in specific situations\n this.enableEventListeners();\n }\n\n this.state.eventsEnabled = eventsEnabled;\n }\n\n // We can't use class properties because they don't get listed in the\n // class prototype and break stuff like Sinon stubs\n\n\n createClass(Popper, [{\n key: 'update',\n value: function update$$1() {\n return update.call(this);\n }\n }, {\n key: 'destroy',\n value: function destroy$$1() {\n return destroy.call(this);\n }\n }, {\n key: 'enableEventListeners',\n value: function enableEventListeners$$1() {\n return enableEventListeners.call(this);\n }\n }, {\n key: 'disableEventListeners',\n value: function disableEventListeners$$1() {\n return disableEventListeners.call(this);\n }\n\n /**\n * Schedules an update. It will run on the next UI update available.\n * @method scheduleUpdate\n * @memberof Popper\n */\n\n\n /**\n * Collection of utilities useful when writing custom modifiers.\n * Starting from version 1.7, this method is available only if you\n * include `popper-utils.js` before `popper.js`.\n *\n * **DEPRECATION**: This way to access PopperUtils is deprecated\n * and will be removed in v2! Use the PopperUtils module directly instead.\n * Due to the high instability of the methods contained in Utils, we can't\n * guarantee them to follow semver. Use them at your own risk!\n * @static\n * @private\n * @type {Object}\n * @deprecated since version 1.8\n * @member Utils\n * @memberof Popper\n */\n\n }]);\n return Popper;\n}();\n\n/**\n * The `referenceObject` is an object that provides an interface compatible with Popper.js\n * and lets you use it as replacement of a real DOM node.<br />\n * You can use this method to position a popper relatively to a set of coordinates\n * in case you don't have a DOM node to use as reference.\n *\n * ```\n * new Popper(referenceObject, popperNode);\n * ```\n *\n * NB: This feature isn't supported in Internet Explorer 10.\n * @name referenceObject\n * @property {Function} data.getBoundingClientRect\n * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.\n * @property {number} data.clientWidth\n * An ES6 getter that will return the width of the virtual reference element.\n * @property {number} data.clientHeight\n * An ES6 getter that will return the height of the virtual reference element.\n */\n\n\nPopper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils;\nPopper.placements = placements;\nPopper.Defaults = Defaults;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popper);\n//# sourceMappingURL=popper.js.map\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU3NS5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLGtCQUFrQixrQ0FBa0M7QUFDcEQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLENBQUM7O0FBRUQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtB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jbGllbnRXaWR0aFxuICogQW4gRVM2IGdldHRlciB0aGF0IHdpbGwgcmV0dXJuIHRoZSB3aWR0aCBvZiB0aGUgdmlydHVhbCByZWZlcmVuY2UgZWxlbWVudC5cbiAqIEBwcm9wZXJ0eSB7bnVtYmVyfSBkYXRhLmNsaWVudEhlaWdodFxuICogQW4gRVM2IGdldHRlciB0aGF0IHdpbGwgcmV0dXJuIHRoZSBoZWlnaHQgb2YgdGhlIHZpcnR1YWwgcmVmZXJlbmNlIGVsZW1lbnQuXG4gKi9cblxuXG5Qb3BwZXIuVXRpbHMgPSAodHlwZW9mIHdpbmRvdyAhPT0gJ3VuZGVmaW5lZCcgPyB3aW5kb3cgOiBnbG9iYWwpLlBvcHBlclV0aWxzO1xuUG9wcGVyLnBsYWNlbWVudHMgPSBwbGFjZW1lbnRzO1xuUG9wcGVyLkRlZmF1bHRzID0gRGVmYXVsdHM7XG5cbmV4cG9ydCBkZWZhdWx0IFBvcHBlcjtcbi8vIyBzb3VyY2VNYXBwaW5nVVJMPXBvcHBlci5qcy5tYXBcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4575\n")},6358:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"a6\": () => (/* binding */ FilterMatchMode),\n/* harmony export */ \"iZ\": () => (/* binding */ FilterService)\n/* harmony export */ });\n/* unused harmony exports FilterOperator, PrimeIcons, ToastSeverity */\n/* harmony import */ var primevue_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6954);\n\n\nconst FilterMatchMode = {\n STARTS_WITH : 'startsWith',\n CONTAINS : 'contains',\n NOT_CONTAINS : 'notContains',\n ENDS_WITH : 'endsWith',\n EQUALS : 'equals',\n NOT_EQUALS : 'notEquals',\n IN : 'in',\n LESS_THAN : 'lt',\n LESS_THAN_OR_EQUAL_TO : 'lte',\n GREATER_THAN : 'gt',\n GREATER_THAN_OR_EQUAL_TO : 'gte',\n BETWEEN : 'between',\n DATE_IS : 'dateIs',\n DATE_IS_NOT : 'dateIsNot',\n DATE_BEFORE : 'dateBefore',\n DATE_AFTER : 'dateAfter'\n};\n\nconst FilterOperator = {\n AND: 'and',\n OR: 'or'\n};\n\nconst FilterService = {\n filter(value, fields, filterValue, filterMatchMode, filterLocale) {\n let filteredItems = [];\n\n if (value) {\n for (let item of value) {\n for (let field of fields) {\n let fieldValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(item, field);\n\n if (this.filters[filterMatchMode](fieldValue, filterValue, filterLocale)) {\n filteredItems.push(item);\n break;\n }\n }\n }\n }\n\n return filteredItems;\n },\n filters: {\n startsWith(value, filter, filterLocale) {\n if (filter === undefined || filter === null || filter.trim() === '') {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n let filterValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n let stringValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\n \n return stringValue.slice(0, filterValue.length) === filterValue;\n },\n contains(value, filter, filterLocale) {\n if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n let filterValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n let stringValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\n \n return stringValue.indexOf(filterValue) !== -1;\n },\n notContains(value, filter, filterLocale) {\n if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n let filterValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n let stringValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\n \n return stringValue.indexOf(filterValue) === -1;\n },\n endsWith(value, filter, filterLocale) {\n if (filter === undefined || filter === null || filter.trim() === '') {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n let filterValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n let stringValue = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale);\n \n return stringValue.indexOf(filterValue, stringValue.length - filterValue.length) !== -1;\n },\n equals(value, filter, filterLocale) {\n if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() === filter.getTime();\n else\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale) == primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n },\n notEquals(value, filter, filterLocale) {\n if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) {\n return false;\n }\n \n if (value === undefined || value === null) {\n return true;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() !== filter.getTime();\n else\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(value.toString()).toLocaleLowerCase(filterLocale) != primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.removeAccents */ .gb.removeAccents(filter.toString()).toLocaleLowerCase(filterLocale);\n },\n in(value, filter) {\n if (filter === undefined || filter === null || filter.length === 0) {\n return true;\n }\n \n for (let i = 0; i < filter.length; i++) {\n if (primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.equals */ .gb.equals(value, filter[i])) {\n return true;\n }\n }\n \n return false;\n },\n between(value, filter) {\n if (filter == null || filter[0] == null || filter[1] == null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime)\n return filter[0].getTime() <= value.getTime() && value.getTime() <= filter[1].getTime();\n else\n return filter[0] <= value && value <= filter[1];\n },\n lt(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() < filter.getTime();\n else\n return value < filter;\n },\n lte(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() <= filter.getTime();\n else\n return value <= filter;\n },\n gt(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() > filter.getTime();\n else\n return value > filter;\n },\n gte(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n \n if (value.getTime && filter.getTime)\n return value.getTime() >= filter.getTime();\n else\n return value >= filter;\n },\n dateIs(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n\n return value.toDateString() === filter.toDateString();\n },\n dateIsNot(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n\n return value.toDateString() !== filter.toDateString();\n },\n dateBefore(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n\n return value.getTime() < filter.getTime();\n },\n dateAfter(value, filter) {\n if (filter === undefined || filter === null) {\n return true;\n }\n \n if (value === undefined || value === null) {\n return false;\n }\n\n return value.getTime() > filter.getTime();\n }\n },\n register(rule, fn) {\n this.filters[rule] = fn;\n }\n};\n\nconst PrimeIcons = {\n ALIGN_CENTER:'pi pi-align-center',\n ALIGN_JUSTIFY:'pi pi-align-justify',\n ALIGN_LEFT:'pi pi-align-left',\n ALIGN_RIGHT:'pi pi-align-right',\n AMAZON:'pi pi-amazon',\n ANDROID:'pi pi-android',\n ANGLE_DOUBLE_DOWN:'pi pi-angle-double-down',\n ANGLE_DOUBLE_LEFT:'pi pi-angle-double-left',\n ANGLE_DOUBLE_RIGHT:'pi pi-angle-double-right',\n ANGLE_DOUBLE_UP:'pi pi-angle-double-up',\n ANGLE_DOWN:'pi pi-angle-down',\n ANGLE_LEFT:'pi pi-angle-left',\n ANGLE_RIGHT:'pi pi-angle-right',\n ANGLE_UP:'pi pi-angle-up',\n APPLE:'pi pi-apple',\n ARROW_CIRCLE_DOWN:'pi pi-arrow-circle-down',\n ARROW_CIRCLE_LEFT:'pi pi-arrow-circle-left',\n ARROW_CIRCLE_RIGHT:'pi pi-arrow-circle-right',\n ARROW_CIRCLE_UP:'pi pi-arrow-circle-up',\n ARROW_DOWN:'pi pi-arrow-down',\n ARROW_DOWN_LEFT:'pi pi-arrow-down-left',\n ARROW_DOWN_RIGHT:'pi pi-arrow-down-right',\n ARROW_LEFT:'pi pi-arrow-left',\n ARROW_RIGHT:'pi pi-arrow-right',\n ARROW_UP:'pi pi-arrow-up',\n ARROW_UP_LEFT:'pi pi-arrow-up-left',\n ARROW_UP_RIGHT:'pi pi-arrow-up-right',\n ARROW_H:'pi pi-arrow-h',\n ARROW_V:'pi pi-arrow-v',\n AT:'pi pi-at',\n BACKWARD:'pi pi-backward',\n BAN:'pi pi-ban',\n BARS:'pi pi-bars',\n BELL:'pi pi-bell',\n BOLT:'pi pi-bolt',\n BOOK:'pi pi-book',\n BOOKMARK:'pi pi-bookmark',\n BOOKMARK_FILL:'pi pi-bookmark-fill',\n BOX:'pi pi-box',\n BRIEFCASE:'pi pi-briefcase',\n BUILDING:'pi pi-building',\n CALENDAR:'pi pi-calendar',\n CALENDAR_MINUS:'pi pi-calendar-minus',\n CALENDAR_PLUS:'pi pi-calendar-plus',\n CALENDAR_TIMES:'pi pi-calendar-times',\n CAMERA:'pi pi-camera',\n CAR:'pi pi-car',\n CARET_DOWN:'pi pi-caret-down',\n CARET_LEFT:'pi pi-caret-left',\n CARET_RIGHT:'pi pi-caret-right',\n CARET_UP:'pi pi-caret-up',\n CHART_BAR:'pi pi-chart-bar',\n CHART_LINE:'pi pi-chart-line',\n CHART_PIE:'pi pi-chart-pie',\n CHECK:'pi pi-check',\n CHECK_CIRCLE:'pi pi-check-circle',\n CHECK_SQUARE:'pi pi-check-square',\n CHEVRON_CIRCLE_DOWN:'pi pi-chevron-circle-down',\n CHEVRON_CIRCLE_LEFT:'pi pi-chevron-circle-left',\n CHEVRON_CIRCLE_RIGHT:'pi pi-chevron-circle-right',\n CHEVRON_CIRCLE_UP:'pi pi-chevron-circle-up',\n CHEVRON_DOWN:'pi pi-chevron-down',\n CHEVRON_LEFT:'pi pi-chevron-left',\n CHEVRON_RIGHT:'pi pi-chevron-right',\n CHEVRON_UP:'pi pi-chevron-up',\n CIRCLE:'pi pi-circle',\n CIRCLE_FILL:'pi pi-circle-fill',\n CLOCK:'pi pi-clock',\n CLONE:'pi pi-clone',\n CLOUD:'pi pi-cloud',\n CLOUD_DOWNLOAD:'pi pi-cloud-download',\n CLOUD_UPLOAD:'pi pi-cloud-upload',\n CODE:'pi pi-code',\n COG:'pi pi-cog',\n COMMENT:'pi pi-comment',\n COMMENTS:'pi pi-comments',\n COMPASS:'pi pi-compass',\n COPY:'pi pi-copy',\n CREDIT_CARD:'pi pi-credit-card',\n DATABASE:'pi pi-database',\n DESKTOP:'pi pi-desktop',\n DIRECTIONS:'pi pi-directions',\n DIRECTIONS_ALT:'pi pi-directions-alt',\n DISCORD:'pi pi-discord',\n DOLLAR:'pi pi-dollar',\n DOWNLOAD:'pi pi-download',\n EJECT:'pi pi-eject',\n ELLIPSIS_H:'pi pi-ellipsis-h',\n ELLIPSIS_V:'pi pi-ellipsis-v',\n ENVELOPE:'pi pi-envelope',\n EURO:'pi pi-euro',\n EXCLAMATION_CIRCLE:'pi pi-exclamation-circle',\n EXCLAMATION_TRIANGLE :'pi pi-exclamation-triangle',\n EXTERNAL_LINK:'pi pi-external-link',\n EYE:'pi pi-eye',\n EYE_SLASH:'pi pi-eye-slash',\n FACEBOOK:'pi pi-facebook',\n FAST_BACKWARD:'pi pi-fast-backward',\n FAST_FORWARD:'pi pi-fast-forward',\n FILE:'pi pi-file',\n FILE_EXCEL:'pi pi-file-excel',\n FILE_PDF:'pi pi-file-pdf',\n FILTER:'pi pi-filter',\n FILTER_FILL:'pi pi-filter-fill',\n FILTER_SLASH:'pi pi-filter-slash',\n FLAG:'pi pi-flag',\n FLAG_FILL:'pi pi-flag-fill',\n FOLDER:'pi pi-folder',\n FOLDER_OPEN:'pi pi-folder-open',\n FORWARD:'pi pi-forward',\n GITHUB:'pi pi-github',\n GLOBE:'pi pi-globe',\n GOOGLE:'pi pi-google',\n HASHTAG:'pi pi-hashtag',\n HEART:'pi pi-heart',\n HEART_FILL:'pi pi-heart-fill',\n HISTORY:'pi pi-history',\n HOME:'pi pi-home',\n ID_CARD:'pi pi-id-card',\n IMAGE:'pi pi-image',\n IMAGES:'pi pi-images',\n INBOX:'pi pi-inbox',\n INFO:'pi pi-info',\n INFO_CIRCLE:'pi pi-info-circle',\n INSTAGRAM:'pi pi-instagram',\n KEY:'pi pi-key',\n LINK:'pi pi-link',\n LINKEDIN:'pi pi-linkedin',\n LIST:'pi pi-list',\n LOCK:'pi pi-lock',\n LOCK_OPEN:'pi pi-lock-open',\n MAP:'pi pi-map',\n MAP_MARKER:'pi pi-map-marker',\n MICROSOFT:'pi pi-microsoft',\n MINUS:'pi pi-minus',\n MINUS_CIRCLE:'pi pi-minus-circle',\n MOBILE:'pi pi-mobile',\n MONEY_BILL:'pi pi-money-bill',\n MOON:'pi pi-moon',\n PALETTE:'pi pi-palette',\n PAPERCLIP:'pi pi-paperclip',\n PAUSE:'pi pi-pause',\n PAYPAL:'pi pi-paypal',\n PENCIL:'pi pi-pencil',\n PERCENTAGE:'pi pi-percentage',\n PHONE:'pi pi-phone',\n PLAY:'pi pi-play',\n PLUS:'pi pi-plus',\n PLUS_CIRCLE:'pi pi-plus-circle',\n POUND:'pi pi-pound',\n POWER_OFF:'pi pi-power-off',\n PRIME:'pi pi-prime',\n PRINT:'pi pi-print',\n QRCODE:'pi pi-qrcode',\n QUESTION:'pi pi-question',\n QUESTION_CIRCLE:'pi pi-question-circle',\n REDDIT:'pi pi-reddit',\n REFRESH:'pi pi-refresh',\n REPLAY:'pi pi-replay',\n REPLY:'pi pi-reply',\n SAVE:'pi pi-save',\n SEARCH:'pi pi-search',\n SEARCH_MINUS:'pi pi-search-minus',\n SEARCH_PLUS:'pi pi-search-plus',\n SEND:'pi pi-send',\n SERVER:'pi pi-server',\n SHARE_ALT:'pi pi-share-alt',\n SHIELD:'pi pi-shield',\n SHOPPING_BAG:'pi pi-shopping-bag',\n SHOPPING_CART:'pi pi-shopping-cart',\n SIGN_IN:'pi pi-sign-in',\n SIGN_OUT:'pi pi-sign-out',\n SITEMAP:'pi pi-sitemap',\n SLACK:'pi pi-slack',\n SLIDERS_H:'pi pi-sliders-h',\n SLIDERS_V:'pi pi-sliders-v',\n SORT:'pi pi-sort',\n SORT_ALPHA_DOWN:'pi pi-sort-alpha-down',\n SORT_ALPHA_ALT_DOWN:'pi pi-sort-alpha-alt-down',\n SORT_ALPHA_UP:'pi pi-sort-alpha-up',\n SORT_ALPHA_ALT_UP:'pi pi-sort-alpha-alt-up',\n SORT_ALT:'pi pi-sort-alt',\n SORT_ALT_SLASH:'pi pi-sort-slash',\n SORT_AMOUNT_DOWN:'pi pi-sort-amount-down',\n SORT_AMOUNT_DOWN_ALT:'pi pi-sort-amount-down-alt',\n SORT_AMOUNT_UP:'pi pi-sort-amount-up',\n SORT_AMOUNT_UP_ALT:'pi pi-sort-amount-up-alt',\n SORT_DOWN:'pi pi-sort-down',\n SORT_NUMERIC_DOWN:'pi pi-sort-numeric-down',\n SORT_NUMERIC_ALT_DOWN:'pi pi-sort-numeric-alt-down',\n SORT_NUMERIC_UP:'pi pi-sort-numeric-up',\n SORT_NUMERIC_ALT_UP:'pi pi-sort-numeric-alt-up',\n SORT_UP:'pi pi-sort-up',\n SPINNER:'pi pi-spinner',\n STAR:'pi pi-star',\n STAR_FILL:'pi pi-star-fill',\n STEP_BACKWARD:'pi pi-step-backward',\n STEP_BACKWARD_ALT:'pi pi-step-backward-alt',\n STEP_FORWARD:'pi pi-step-forward',\n STEP_FORWARD_ALT:'pi pi-step-forward-alt',\n STOP:'pi pi-stop',\n STOP_CIRCLE:'pi pi-stop-circle',\n SUN:'pi pi-sun',\n SYNC:'pi pi-sync',\n TABLE:'pi pi-table',\n TABLET:'pi pi-tablet',\n TAG:'pi pi-tag',\n TAGS:'pi pi-tags',\n TELEGRAM:'pi pi-telegram',\n TH_LARGE:'pi pi-th-large',\n THUMBS_DOWN:'pi pi-thumbs-down',\n THUMBS_UP:'pi pi-thumbs-up',\n TICKET:'pi pi-ticket',\n TIMES:'pi pi-times',\n TIMES_CIRCLE:'pi pi-times-circle',\n TRASH:'pi pi-trash',\n TWITTER:'pi pi-twitter',\n UNDO:'pi pi-undo',\n UNLOCK:'pi pi-unlock',\n UPLOAD:'pi pi-upload',\n USER:'pi pi-user',\n USER_EDIT:'pi pi-user-edit',\n USER_MINUS:'pi pi-user-minus',\n USER_PLUS:'pi pi-user-plus',\n USERS:'pi pi-users',\n VIDEO:'pi pi-video',\n VIMEO:'pi pi-vimeo',\n VOLUME_DOWN:'pi pi-volume-down',\n VOLUME_OFF:'pi pi-volume-off',\n VOLUME_UP:'pi pi-volume-up',\n WALLET:'pi pi-wallet',\n WHATSAPP:'pi pi-whatsapp',\n WIFI:'pi pi-wifi',\n WINDOW_MAXIMIZE:'pi pi-window-maximize',\n WINDOW_MINIMIZE:'pi pi-window-minimize',\n YOUTUBE:'pi pi-youtube'\n};\n\nconst ToastSeverities = {\n INFO: 'info',\n WARN: 'warn',\n ERROR: 'error',\n SUCCESS: 'success'\n};\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjM1OC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBNkM7O0FBRTdDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EscUNBQXFDLG1HQUE0Qjs7QUFFakU7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw4QkFBOEIsNkZBQXlCO0FBQ3ZELDhCQUE4Qiw2RkFBeUI7QUFDdkQ7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSw4QkFBOEIsNkZBQXlCO0FBQ3ZELDhCQUE4Qiw2RkFBeUI7QUFDdkQ7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7Q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uICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBsZXQgZmlsdGVyVmFsdWUgPSBPYmplY3RVdGlscy5yZW1vdmVBY2NlbnRzKGZpbHRlci50b1N0cmluZygpKS50b0xvY2FsZUxvd2VyQ2FzZShmaWx0ZXJMb2NhbGUpO1xuICAgICAgICAgICAgbGV0IHN0cmluZ1ZhbHVlID0gT2JqZWN0VXRpbHMucmVtb3ZlQWNjZW50cyh2YWx1ZS50b1N0cmluZygpKS50b0xvY2FsZUxvd2VyQ2FzZShmaWx0ZXJMb2NhbGUpO1xuICAgIFxuICAgICAgICAgICAgcmV0dXJuIHN0cmluZ1ZhbHVlLnNsaWNlKDAsIGZpbHRlclZhbHVlLmxlbmd0aCkgPT09IGZpbHRlclZhbHVlO1xuICAgICAgICB9LFxuICAgICAgICBjb250YWlucyh2YWx1ZSwgZmlsdGVyLCBmaWx0ZXJMb2NhbGUpIHtcbiAgICAgICAgICAgIGlmIChmaWx0ZXIgPT09IHVuZGVmaW5lZCB8fCBmaWx0ZXIgPT09IG51bGwgfHwgKHR5cGVvZiBmaWx0ZXIgPT09ICdzdHJpbmcnICYmIGZpbHRlci50cmltKCkgPT09ICcnKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBsZXQgZmlsdGVyVmFsdWUgPSBPYmplY3RVdGlscy5yZW1vdmVBY2NlbnRzKGZpbHRlci50b1N0cmluZygpKS50b0xvY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m4gdmFsdWUuZ2V0VGltZSgpICE9PSBmaWx0ZXIuZ2V0VGltZSgpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybiBPYmplY3RVdGlscy5yZW1vdmVBY2NlbnRzKHZhbHVlLnRvU3RyaW5nKCkpLnRvTG9jYWxlTG93ZXJDYXNlKGZpbHRlckxvY2FsZSkgIT0gT2JqZWN0VXRpbHMucmVtb3ZlQWNjZW50cyhmaWx0ZXIudG9TdHJpbmcoKSkudG9Mb2NhbGVMb3dlckNhc2UoZmlsdGVyTG9jYWxlKTtcbiAgICAgICAgfSxcbiAgICAgICAgaW4odmFsdWUsIGZpbHRlcikge1xuICAgICAgICAgICAgaWYgKGZpbHRlciA9PT0gdW5kZWZpbmVkIHx8IGZpbHRlciA9PT0gbnVsbCB8fCBmaWx0ZXIubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGZpbHRlci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3RVdGlscy5lcXVhbHModmFsdWUsIGZpbHRlcltpXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9LFxuICAgICAgICBiZXR3ZWVuKHZhbHVlLCBmaWx0ZXIpIHtcbiAgICAgICAgICAgIGlmIChmaWx0ZXIgPT0gbnVsbCB8fCBmaWx0ZXJbMF0gPT0gbnVsbCB8fCBmaWx0ZXJbMV0gPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUuZ2V0VGltZSlcbiAgICAgICAgICAgIHJldHVybiBmaWx0ZXJbMF0uZ2V0VGltZSgpIDw9IHZhbHVlLmdldFRpbWUoKSAmJiB2YWx1ZS5nZXRUaW1lKCkgPD0gZmlsdGVyWzFdLmdldFRpbWUoKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXR1cm4gZmlsdGVyWzBdIDw9IHZhbHVlICYmIHZhbHVlIDw9IGZpbHRlclsxXTtcbiAgICAgICAgfSxcbiAgICAgICAgbHQodmFsdWUsIGZpbHRlcikge1xuICAgICAgICAgICAgaWYgKGZpbHRlciA9PT0gdW5kZWZpbmVkIHx8IGZpbHRlciA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUuZ2V0VGltZSAmJiBmaWx0ZXIuZ2V0VGltZSlcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUuZ2V0VGltZSgpIDwgZmlsdGVyLmdldFRpbWUoKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUgPCBmaWx0ZXI7XG4gICAgICAgIH0sXG4gICAgICAgIGx0ZSh2YWx1ZSwgZmlsdGVyKSB7XG4gICAgICAgICAgICBpZiAoZmlsdGVyID09PSB1bmRlZmluZWQgfHwgZmlsdGVyID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCB8fCB2YWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICBcbiAgICAgICAgICAgIGlmICh2YWx1ZS5nZXRUaW1lICYmIGZpbHRlci5nZXRUaW1lKVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5nZXRUaW1lKCkgPD0gZmlsdGVyLmdldFRpbWUoKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWUgPD0gZmlsdGVyO1xuICAgICAgICB9LFxuICAgICAgICBndCh2YWx1ZSwgZmlsdGVyKSB7XG4gICAgICAgICAgICBpZiAoZmlsdGVyID09PSB1bmRlZmluZWQgfHwgZmlsdGVyID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCB8fCB2YWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICBcbiAgICAgICAgICAgIGlmICh2YWx1ZS5nZXRUaW1lICYmIGZpbHRlci5nZXRUaW1lKVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZS5nZXRUaW1lKCkgPiBmaWx0ZXIuZ2V0VGltZSgpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZSA+IGZpbHRlcjtcbiAgICAgICAgfSxcbiAgICAgICAgZ3RlKHZhbHVlLCBmaWx0ZXIpIHtcbiAgICAgICAgICAgIGlmIChmaWx0ZXIgPT09IHVuZGVmaW5lZCB8fCBmaWx0ZXIgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICBcbiAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdW5kZWZpbmVkIHx8IHZhbHVlID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlLmdldFRpbWUgJiYgZmlsdGVyLmdldFRpbWUpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlLmdldFRpbWUoKSA+PSBmaWx0ZXIuZ2V0VGltZSgpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZSA+PSBmaWx0ZXI7XG4gICAgICAgIH0sXG4gICAgICAgIGRhdGVJcyh2YWx1ZSwgZmlsdGVyKSB7XG4gICAgICAgICAgICBpZiAoZmlsdGVyID09PSB1bmRlZmluZWQgfHwgZmlsdGVyID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCB8fCB2YWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlLnRvRGF0ZVN0cmluZygpID09PSBmaWx0ZXIudG9EYXRlU3RyaW5nKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGRhdGVJc05vdCh2YWx1ZSwgZmlsdGVyKSB7XG4gICAgICAgICAgICBpZiAoZmlsdGVyID09PSB1bmRlZmluZWQgfHwgZmlsdGVyID09PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICB9XG4gICAgXG4gICAgICAgICAgICBpZiAodmFsdWUgPT09IHVuZGVmaW5lZCB8fCB2YWx1ZSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHZhbHVlLnRvRGF0ZVN0cmluZygpICE9PSBmaWx0ZXIudG9EYXRlU3RyaW5nKCk7XG4gICAgICAgIH0sXG4gICAgICAgIGRhdGVCZWZvcmUodmFsdWUsIGZpbHRlcikge1xuICAgICAgICAgICAgaWYgKGZpbHRlciA9PT0gdW5kZWZpbmVkIHx8IGZpbHRlciA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB2YWx1ZS5nZXRUaW1lKCkgPCBmaWx0ZXIuZ2V0VGltZSgpO1xuICAgICAgICB9LFxuICAgICAgICBkYXRlQWZ0ZXIodmFsdWUsIGZpbHRlcikge1xuICAgICAgICAgICAgaWYgKGZpbHRlciA9PT0gdW5kZWZpbmVkIHx8IGZpbHRlciA9PT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuICAgIFxuICAgICAgICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQgfHwgdmFsdWUgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB2YWx1ZS5nZXRUaW1lKCkgPiBmaWx0ZXIuZ2V0VGltZSgpO1xuICAgICAgICB9XG4gICAgfSxcbiAgICByZWdpc3RlcihydWxlLCBmbikge1xuICAgICAgICB0aGlzLmZpbHRlcnNbcnVsZV0gPSBmbjtcbiAgICB9XG59O1xuXG5jb25zdCBQcmltZUljb25zID0ge1xuICAgIEFM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XSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6358\n")},5475:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* unused harmony export usePrimeVue */\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5166);\n/* harmony import */ var primevue_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6358);\n\n\n\nconst defaultOptions = {\n ripple: false,\n inputStyle: \'outlined\',\n locale: {\n startsWith: \'Starts with\',\n contains: \'Contains\',\n notContains: \'Not contains\',\n endsWith: \'Ends with\',\n equals: \'Equals\',\n notEquals: \'Not equals\',\n noFilter: \'No Filter\',\n lt: \'Less than\',\n lte: \'Less than or equal to\',\n gt: \'Greater than\',\n gte: \'Greater than or equal to\',\n dateIs: \'Date is\',\n dateIsNot: \'Date is not\',\n dateBefore: \'Date is before\',\n dateAfter: \'Date is after\',\n clear: \'Clear\',\n apply: \'Apply\',\n matchAll: \'Match All\',\n matchAny: \'Match Any\',\n addRule: \'Add Rule\',\n removeRule: \'Remove Rule\',\n accept: \'Yes\',\n reject: \'No\',\n choose: \'Choose\',\n upload: \'Upload\',\n cancel: \'Cancel\',\n dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],\n dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],\n dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"],\n monthNames: ["January","February","March","April","May","June","July","August","September","October","November","December"],\n monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],\n today: \'Today\',\n weekHeader: \'Wk\',\n firstDayOfWeek: 0,\n dateFormat: \'mm/dd/yy\',\n weak: \'Weak\',\n medium: \'Medium\',\n strong: \'Strong\',\n passwordPrompt: \'Enter a password\',\n emptyFilterMessage: \'No results found\',\n emptyMessage: \'No available options\'\n },\n filterMatchModeOptions: {\n text: [\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.STARTS_WITH */ .a6.STARTS_WITH,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.CONTAINS */ .a6.CONTAINS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.NOT_CONTAINS */ .a6.NOT_CONTAINS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.ENDS_WITH */ .a6.ENDS_WITH,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.EQUALS */ .a6.EQUALS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.NOT_EQUALS */ .a6.NOT_EQUALS\n ],\n numeric: [\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.EQUALS */ .a6.EQUALS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.NOT_EQUALS */ .a6.NOT_EQUALS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.LESS_THAN */ .a6.LESS_THAN,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.LESS_THAN_OR_EQUAL_TO */ .a6.LESS_THAN_OR_EQUAL_TO,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.GREATER_THAN */ .a6.GREATER_THAN,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.GREATER_THAN_OR_EQUAL_TO */ .a6.GREATER_THAN_OR_EQUAL_TO\n ],\n date: [\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.DATE_IS */ .a6.DATE_IS,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.DATE_IS_NOT */ .a6.DATE_IS_NOT,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.DATE_BEFORE */ .a6.DATE_BEFORE,\n primevue_api__WEBPACK_IMPORTED_MODULE_1__/* .FilterMatchMode.DATE_AFTER */ .a6.DATE_AFTER\n ]\n },\n zIndex: {\n modal: 1100,\n overlay: 1000,\n menu: 1000,\n tooltip: 1100\n }\n};\n\nconst PrimeVueSymbol = Symbol();\n\nfunction usePrimeVue() {\n const PrimeVue = inject(PrimeVueSymbol);\n if (!PrimeVue) {\n throw new Error(\'PrimeVue is not installed!\');\n } \n \n return PrimeVue;\n}\n\nvar PrimeVue = {\n install: (app, options) => {\n let configOptions = options ? {...defaultOptions, ...options} : {...defaultOptions};\n const PrimeVue = {\n config: (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .reactive */ .qj)(configOptions)\n };\n app.config.globalProperties.$primevue = PrimeVue;\n app.provide(PrimeVueSymbol, PrimeVue);\n }\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PrimeVue);\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ3NS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBdUM7QUFDUTs7QUFFL0M7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSx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sourceURL=webpack-internal:///5475\n')},6076:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5166);\n\n\nvar script = {\n name: 'InputText',\n emits: ['update:modelValue'],\n props: {\n modelValue: null\n },\n methods: {\n onInput(event) {\n this.$emit('update:modelValue', event.target.value);\n }\n },\n computed: {\n filled() {\n return (this.modelValue != null && this.modelValue.toString().length > 0)\n }\n }\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(\"input\", (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .mergeProps */ .dG)({\n class: ['p-inputtext p-component', {'p-filled': $options.filled}],\n value: $props.modelValue,\n onInput: _cache[1] || (_cache[1] = (...args) => ($options.onInput && $options.onInput(...args)))\n }, _ctx.$attrs), null, 16, [\"value\"]))\n}\n\nscript.render = render;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjA3Ni5qcyIsIm1hcHBpbmdzIjoiOzs7OztBQUF5RDs7QUFFekQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7QUFDTDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxVQUFVLHdEQUFTLElBQUksMERBQVcsVUFBVSx5REFBVTtBQUN0RCx3Q0FBd0MsNEJBQTRCO0FBQ3B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gIHZhbHVlOiAkcHJvcHMubW9kZWxWYWx1ZSxcbiAgICBvbklucHV0OiBfY2FjaGVbMV0gfHwgKF9jYWNoZVsxXSA9ICguLi5hcmdzKSA9PiAoJG9wdGlvbnMub25JbnB1dCAmJiAkb3B0aW9ucy5vbklucHV0KC4uLmFyZ3MpKSlcbiAgfSwgX2N0eC4kYXR0cnMpLCBudWxsLCAxNiwgW1widmFsdWVcIl0pKVxufVxuXG5zY3JpcHQucmVuZGVyID0gcmVuZGVyO1xuXG5leHBvcnQgZGVmYXVsdCBzY3JpcHQ7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6076\n")},590:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var primevue_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6954);\n\n\nvar OverlayEventBus = (0,primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .EventBus */ .Nd)();\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OverlayEventBus);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkwLmpzIiwibWFwcGluZ3MiOiI7Ozs7QUFBMEM7O0FBRTFDLHNCQUFzQixrRUFBUTs7QUFFOUIsaUVBQWUsZUFBZSxFQUFDIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL3ByaW1ldnVlL292ZXJsYXlldmVudGJ1cy9vdmVybGF5ZXZlbnRidXMuZXNtLmpzPzA2YTUiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRXZlbnRCdXMgfSBmcm9tICdwcmltZXZ1ZS91dGlscyc7XG5cbnZhciBPdmVybGF5RXZlbnRCdXMgPSBFdmVudEJ1cygpO1xuXG5leHBvcnQgZGVmYXVsdCBPdmVybGF5RXZlbnRCdXM7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///590\n')},4902:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var primevue_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6954);\n/* harmony import */ var primevue_overlayeventbus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(590);\n/* harmony import */ var primevue_inputtext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6076);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5166);\n\n\n\n\n\nvar script = {\n name: 'Password',\n emits: ['update:modelValue'],\n inheritAttrs: false,\n props: {\n modelValue: String,\n promptLabel: {\n type: String,\n default: null\n },\n mediumRegex: {\n type: String,\n default: '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})' // eslint-disable-line\n },\n strongRegex: {\n type: String,\n default: '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})' // eslint-disable-line\n },\n weakLabel: {\n type: String,\n default: null\n },\n mediumLabel: {\n type: String,\n default: null\n },\n strongLabel: {\n type: String,\n default: null\n },\n feedback: {\n type: Boolean,\n default: true\n },\n appendTo: {\n type: String,\n default: 'body'\n },\n toggleMask: {\n type: Boolean,\n default: false\n },\n hideIcon: {\n type: String,\n default: 'pi pi-eye-slash'\n },\n showIcon: {\n type: String,\n default: 'pi pi-eye'\n },\n inputClass: String,\n inputStyle: null,\n style: null,\n class: String,\n panelClass: String\n },\n data() {\n return {\n overlayVisible: false,\n meter: null,\n infoText: null,\n focused: false,\n unmasked: false\n };\n },\n mediumCheckRegExp: null,\n strongCheckRegExp: null,\n resizeListener: null,\n scrollHandler: null,\n overlay: null,\n mounted() {\n this.infoText = this.promptText;\n this.mediumCheckRegExp = new RegExp(this.mediumRegex);\n this.strongCheckRegExp = new RegExp(this.strongRegex);\n },\n beforeUnmount() {\n this.unbindResizeListener();\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n\n if (this.overlay) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.clear */ .P9.clear(this.overlay);\n this.overlay = null;\n }\n },\n methods: {\n onOverlayEnter(el) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.set */ .P9.set('overlay', el, this.$primevue.config.zIndex.overlay);\n this.alignOverlay();\n this.bindScrollListener();\n this.bindResizeListener();\n },\n onOverlayLeave() {\n this.unbindScrollListener();\n this.unbindResizeListener();\n this.overlay = null;\n },\n onOverlayAfterLeave(el) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.clear */ .P9.clear(el);\n },\n alignOverlay() {\n if (this.appendDisabled) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.relativePosition */ .p7.relativePosition(this.overlay, this.$refs.input.$el);\n }\n else {\n this.overlay.style.minWidth = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getOuterWidth */ .p7.getOuterWidth(this.$refs.input.$el) + 'px';\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.absolutePosition */ .p7.absolutePosition(this.overlay, this.$refs.input.$el);\n }\n },\n testStrength(str) {\n let level = 0;\n\n if (this.strongCheckRegExp.test(str))\n level = 3;\n else if (this.mediumCheckRegExp.test(str))\n level = 2;\n else if (str.length)\n level = 1;\n\n return level;\n },\n onInput(event) {\n this.$emit('update:modelValue', event.target.value);\n },\n onFocus() {\n this.focused = true;\n if (this.feedback) {\n this.overlayVisible = true;\n }\n },\n onBlur() {\n this.focused = false;\n if (this.feedback) {\n this.overlayVisible = false;\n }\n },\n onKeyUp(event) {\n if (this.feedback) {\n const value = event.target.value;\n let label = null;\n let meter = null;\n\n switch (this.testStrength(value)) {\n case 1:\n label = this.weakText;\n meter = {\n strength: 'weak',\n width: '33.33%'\n };\n break;\n\n case 2:\n label = this.mediumText;\n meter = {\n strength: 'medium',\n width: '66.66%'\n };\n break;\n\n case 3:\n label = this.strongText;\n meter = {\n strength: 'strong',\n width: '100%'\n };\n break;\n\n default:\n label = this.promptText;\n meter = null;\n break;\n }\n\n this.meter = meter;\n this.infoText = label;\n\n if (!this.overlayVisible) {\n this.overlayVisible = true;\n }\n }\n },\n bindScrollListener() {\n if (!this.scrollHandler) {\n this.scrollHandler = new primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ConnectedOverlayScrollHandler */ .Vr(this.$refs.input.$el, () => {\n if (this.overlayVisible) {\n this.overlayVisible = false;\n }\n });\n }\n\n this.scrollHandler.bindScrollListener();\n },\n unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n },\n bindResizeListener() {\n if (!this.resizeListener) {\n this.resizeListener = () => {\n if (this.overlayVisible) {\n this.overlayVisible = false;\n }\n };\n window.addEventListener('resize', this.resizeListener);\n }\n },\n unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener('resize', this.resizeListener);\n this.resizeListener = null;\n }\n },\n overlayRef(el) {\n this.overlay = el;\n },\n onMaskToggle() {\n this.unmasked = !this.unmasked;\n },\n onOverlayClick(event) {\n primevue_overlayeventbus__WEBPACK_IMPORTED_MODULE_1__/* [\"default\"].emit */ .Z.emit('overlay-click', {\n originalEvent: event,\n target: this.$el\n });\n }\n },\n computed: {\n containerClass() {\n return ['p-password p-component p-inputwrapper', this.class, {\n 'p-inputwrapper-filled': this.filled,\n 'p-inputwrapper-focus': this.focused,\n 'p-input-icon-right': this.toggleMask\n }];\n },\n inputFieldClass() {\n return ['p-password-input', this.inputClass, {\n 'p-disabled': this.$attrs.disabled\n }];\n },\n panelStyleClass() {\n return ['p-password-panel p-component', this.panelClass, {\n 'p-input-filled': this.$primevue.config.inputStyle === 'filled',\n 'p-ripple-disabled': this.$primevue.config.ripple === false\n }];\n },\n toggleIconClass() {\n return this.unmasked ? this.hideIcon : this.showIcon;\n },\n strengthClass() {\n return `p-password-strength ${this.meter ? this.meter.strength : ''}`;\n },\n inputType() {\n return this.unmasked ? 'text' : 'password';\n },\n filled() {\n return (this.modelValue != null && this.modelValue.toString().length > 0)\n },\n weakText() {\n return this.weakLabel || this.$primevue.config.locale.weak;\n },\n mediumText() {\n return this.mediumLabel || this.$primevue.config.locale.medium;\n },\n strongText() {\n return this.strongLabel || this.$primevue.config.locale.strong;\n },\n promptText() {\n return this.promptLabel || this.$primevue.config.locale.passwordPrompt;\n },\n appendDisabled() {\n return this.appendTo === 'self';\n },\n appendTarget() {\n return this.appendDisabled ? null : this.appendTo;\n }\n },\n components: {\n 'PInputText': primevue_inputtext__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n }\n};\n\nconst _hoisted_1 = { class: \"p-password-meter\" };\nconst _hoisted_2 = { class: \"p-password-info\" };\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_PInputText = (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .resolveComponent */ .up)(\"PInputText\");\n\n return ((0,vue__WEBPACK_IMPORTED_MODULE_3__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createBlock */ .j4)(\"div\", {\n class: $options.containerClass,\n style: $props.style\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createVNode */ .Wm)(_component_PInputText, (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .mergeProps */ .dG)({\n ref: \"input\",\n class: $options.inputFieldClass,\n style: $props.inputStyle,\n type: $options.inputType,\n value: $props.modelValue,\n onInput: $options.onInput,\n onFocus: $options.onFocus,\n onBlur: $options.onBlur,\n onKeyup: $options.onKeyUp\n }, _ctx.$attrs), null, 16, [\"class\", \"style\", \"type\", \"value\", \"onInput\", \"onFocus\", \"onBlur\", \"onKeyup\"]),\n ($props.toggleMask)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_3__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createBlock */ .j4)(\"i\", {\n key: 0,\n class: $options.toggleIconClass,\n onClick: _cache[1] || (_cache[1] = (...args) => ($options.onMaskToggle && $options.onMaskToggle(...args)))\n }, null, 2))\n : (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createCommentVNode */ .kq)(\"\", true),\n ((0,vue__WEBPACK_IMPORTED_MODULE_3__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_3__/* .Teleport */ .lR, {\n to: $options.appendTarget,\n disabled: $options.appendDisabled\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createVNode */ .Wm)(vue__WEBPACK_IMPORTED_MODULE_3__/* .Transition */ .uT, {\n name: \"p-connected-overlay\",\n onEnter: $options.onOverlayEnter,\n onLeave: $options.onOverlayLeave,\n onAfterLeave: $options.onOverlayAfterLeave\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .withCtx */ .w5)(() => [\n ($data.overlayVisible)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_3__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createBlock */ .j4)(\"div\", {\n key: 0,\n ref: $options.overlayRef,\n class: $options.panelStyleClass,\n onClick: _cache[2] || (_cache[2] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .renderSlot */ .WI)(_ctx.$slots, \"header\"),\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .renderSlot */ .WI)(_ctx.$slots, \"content\", {}, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createVNode */ .Wm)(\"div\", _hoisted_1, [\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createVNode */ .Wm)(\"div\", {\n class: $options.strengthClass,\n style: {'width': $data.meter ? $data.meter.width : ''}\n }, null, 6)\n ]),\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createVNode */ .Wm)(\"div\", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .toDisplayString */ .zw)($data.infoText), 1)\n ]),\n (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .renderSlot */ .WI)(_ctx.$slots, \"footer\")\n ], 2))\n : (0,vue__WEBPACK_IMPORTED_MODULE_3__/* .createCommentVNode */ .kq)(\"\", true)\n ]),\n _: 3\n }, 8, [\"onEnter\", \"onLeave\", \"onAfterLeave\"])\n ], 8, [\"to\", \"disabled\"]))\n ], 6))\n}\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css_248z = \"\\n.p-password {\\n position: relative;\\n display: -webkit-inline-box;\\n display: -ms-inline-flexbox;\\n display: inline-flex;\\n}\\n.p-password-panel {\\n position: absolute;\\n top: 0;\\n left: 0;\\n}\\n.p-password .p-password-panel {\\n min-width: 100%;\\n}\\n.p-password-meter {\\n height: 10px;\\n}\\n.p-password-strength {\\n height: 100%;\\n width: 0;\\n -webkit-transition: width 1s ease-in-out;\\n transition: width 1s ease-in-out;\\n}\\n.p-fluid .p-password {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n}\\n\";\nstyleInject(css_248z);\n\nscript.render = render;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkwMi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQXdGO0FBQ2pDO0FBQ1o7QUFDNkg7O0FBRXhLO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0Esd0dBQXdHLEdBQUc7QUFDM0csU0FBUztBQUNUO0FBQ0E7QUFDQSw2REFBNkQsR0FBRztBQUNoRSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLFlBQVksNkVBQWlCO0FBQzdCO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBLFlBQVkseUVBQW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ipbQS1aXSkoPz0uKlswLTldKSkpKD89Lns2LH0pJyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lXG4gICAgICAgIH0sXG4gICAgICAgIHN0cm9uZ1JlZ2V4OiB7XG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICAgICAgICBkZWZhdWx0OiAnXig/PS4qW2Etel0pKD89LipbQS1aXSkoPz0uKlswLTldKSg/PS57OCx9KScgLy8gZXNsaW50LWRpc2FibGUtbGluZVxuICAgICAgICB9LFxuICAgICAgICB3ZWFrTGFiZWw6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IG51bGxcbiAgICAgICAgfSxcbiAgICAgICAgbWVkaXVtTGFiZWw6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IG51bGxcbiAgICAgICAgfSxcbiAgICAgICAgc3Ryb25nTGFiZWw6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IG51bGxcbiAgICAgICAgfSxcbiAgICAgICAgZmVlZGJhY2s6IHtcbiAgICAgICAgICAgIHR5cGU6IEJvb2xlYW4sXG4gICAgICAgICAgICBkZWZhdWx0OiB0cnVlXG4gICAgICAgIH0sXG4gICAgICAgIGFwcGVuZFRvOiB7XG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICAgICAgICBkZWZhdWx0OiAnYm9keSdcbiAgICAgICAgfSxcbiAgICAgICAgdG9nZ2xlTWFzazoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIGhpZGVJY29uOiB7XG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICAgICAgICBkZWZhdWx0OiAncGkgcGktZXllLXNsYXNoJ1xuICAgICAgICB9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y5zY3JvbGxIYW5kbGVyKSB7XG4gICAgICAgICAgICB0aGlzLnNjcm9sbEhhbmRsZXIuZGVzdHJveSgpO1xuICAgICAgICAgICAgdGhpcy5zY3JvbGxIYW5kbGVyID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLm92ZXJsYXkpIHtcbiAgICAgICAgICAgIFpJbmRleFV0aWxzLmNsZWFyKHRoaXMub3ZlcmxheSk7XG4gICAgICAgICAgICB0aGlzLm92ZXJsYXkgPSBudWxsO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBtZXRob2RzOiB7XG4gICAgICAgIG9uT3ZlcmxheUVudGVyKGVsKSB7XG4gICAgICAgICAgICBaSW5kZXhVdGlscy5zZXQoJ292ZXJsYXknLCBlbCwgdGhpcy4kcHJpbWV2dWUuY29uZmlnLnpJbmRleC5vdmVybGF5KTtcbiAgICAgICAgICAgIHRoaXMuYWxpZ25PdmVybGF5KCk7XG4gICAgICAgICAgICB0aGlzLmJpbmRTY3JvbGxMaXN0ZW5lcigpO1xuICAgICAgICAgICAgdGhpcy5iaW5kUmVzaXplTGlzdGVuZXIoKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25PdmVybGF5TGVhdmUoKSB7XG4gICAgICAgICAgICB0aGlzLnVuYmluZFNjcm9sbExpc3RlbmVyKCk7XG4gICAgICAgICAgICB0aGlzLnVuYmluZFJlc2l6ZUxpc3RlbmVyKCk7XG4gICAgICAgICAgICB0aGlzLm92ZXJsYXkgPSBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBvbk92ZXJsYXlBZnRlckxlYXZlKGVsKSB7XG4gICAgICAgICAgICBaSW5kZXhVdGlscy5jbGVhcihlbCk7XG4gICAgICAgIH0sXG4gICAgICAgIGFsaWduT3ZlcmxheSgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFwcGVuZERpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgRG9tSGFuZGxlci5yZWxhdGl2ZVBvc2l0aW9uKHRoaXMub3ZlcmxheSwgdGhpcy4kcmVmcy5pbnB1dC4kZWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5vdmVybGF5LnN0eWxlLm1pbldpZHRoID0gRG9tSGFuZGxlci5nZXRPdXRlcldpZHRoKHRoaXMuJHJlZnMuaW5wdXQuJGVsKSArICdweCc7XG4gICAgICAgICAgICAgICAgRG9tSGFuZGxlci5hYnNvbHV0ZVBvc2l0aW9uKHRoaXMub3ZlcmxheSwgdGhpcy4kcmVmcy5pbnB1dC4kZWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB0ZXN0U3RyZW5ndGgoc3RyKSB7XG4gICAgICAgICAgICBsZXQgbGV2ZWwgPSAwO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5zdHJvbmdDaGVja1JlZ0V4cC50ZXN0KHN0cikpXG4gICAgICAgICAgICAgICAgbGV2ZWwgPSAzO1xuICAgICAgICAgICAgZWxzZSBpZiAodGhpcy5tZWRpdW1DaGVja1JlZ0V4cC50ZXN0KHN0cikpXG4gICAgICAgICAgICAgICAgbGV2ZWwgPSAyO1xuICAgICAgICAgICAgZWxzZSBpZiAoc3RyLmxlbmd0aClcbiAgICAgICAgICAgICAgICBsZXZlbCA9IDE7XG5cbiAgICAgICAgICAgIHJldHVybiBsZXZlbDtcbiAgICAgICAgfSxcbiAgICAgICAgb25JbnB1dChldmVudCkgIHtcbiAgICAgICAgICAgICB0aGlzLiRlbWl0KCd1cGRhdGU6bW9kZWxWYWx1ZScsIGV2ZW50LnRhcmdldC52YWx1ZSk7XG4gICAgICAgIH0sXG4gICAgICAgIG9uRm9jdXMoKSB7XG4gICAgICAgICAgICB0aGlzLmZvY3VzZWQgPSB0cnVlO1xuICAgICAgICAgICAgaWYgKHRoaXMuZmVlZGJhY2spIHtcbiAgICAgICAgICAgICAgICB0aGlzLm92ZXJsYXlWaXNpYmxlID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25CbHVyKCkge1xuICAgICAgICAgICAgdGhpcy5mb2N1c2VkID0gZmFsc2U7XG4gICAgICAgICAgICBpZiAodGhpcy5mZWVkYmFjaykge1xuICAgICAgICAgICAgICAgIHRoaXMub3ZlcmxheVZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25LZXlVcChldmVudCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuZmVlZGJhY2spIHtcbiAgICAgICAgICAgICAgICBjb25zdCB2YWx1ZSA9IGV2ZW50LnRhcmdldC52YWx1ZTtcbiAgICAgICAgICAgICAgICBsZXQgbGFiZWwgPSBudWxsO1xuICAgICAgICAgICAgICAgIGxldCBtZXRlciA9IG51bGw7XG5cbiAgICAgICAgICAgICAgICBzd2l0Y2ggKHRoaXMudGVzdFN0cmVuZ3RoKHZhbHVlKSkge1xuICAgICAgICAgICAgICAgICAgICBjYXNlIDE6XG4gICAgICAgICAgICAgICAgICAgICAgICBsYWJlbCA9IHRoaXMud2Vha1RleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRlciA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlbmd0aDogJ3dlYWsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMzMuMzMlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMjpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdGhpcy5tZWRpdW1UZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0ZXIgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZW5ndGg6ICdtZWRpdW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnNjYuNjYlJ1xuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgMzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsID0gdGhpcy5zdHJvbmdUZXh0O1xuICAgICAgICAgICAgICAgICAgICAgICAgbWV0ZXIgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZW5ndGg6ICdzdHJvbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAnMTAwJSdcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwgPSB0aGlzLnByb21wdFRleHQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBtZXRlciA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLm1ldGVyID0gbWV0ZXI7XG4gICAgICAgICAgICAgICAgdGhpcy5pbmZvVGV4dCA9IGxhYmVsO1xuXG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLm92ZXJsYXlWaXNpYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3ZlcmxheVZpc2libGUgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgYmluZFNjcm9sbExpc3RlbmVyKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLnNjcm9sbEhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNjcm9sbEhhbmRsZXIgPSBuZXcgQ29ubmVjdGVkT3ZlcmxheVNjcm9sbEhhbmRsZXIodGhpcy4kcmVmcy5pbnB1dC4kZWwsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3ZlcmxheVZpc2libGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3ZlcmxheVZpc2libGUgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnNjcm9sbEhhbmRsZXIuYmluZFNjcm9sbExpc3RlbmVyKCk7XG4gICAgICAgIH0sXG4gICAgICAgIHVuYmluZFNjcm9sbExpc3RlbmVyKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuc2Nyb2xsSGFuZGxlcikge1xuICAgICAgICAgICAgICAgIHRoaXMuc2Nyb2xsSGFuZGxlci51bmJpbmRTY3JvbGxMaXN0ZW5lcigpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBiaW5kUmVzaXplTGlzdGVuZXIoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMucmVzaXplTGlzdGVuZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc2l6ZUxpc3RlbmVyID0gKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5vdmVybGF5VmlzaWJsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdmVybGF5VmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgdGhpcy5yZXNpemVMaXN0ZW5lcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHVuYmluZFJlc2l6ZUxpc3RlbmVyKCkge1xuICAgICAgICAgICAgaWYgKHRoaXMucmVzaXplTGlzdGVuZXIpIHtcbiAgICAgICAgICAgICAgICB3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcigncmVzaXplJywgdGhpcy5yZXNpemVMaXN0ZW5lcik7XG4gICAgICAgICAgICAgICAgdGhpcy5yZXNpemVMaXN0ZW5lciA9IG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG92ZXJsYXlSZWYoZWwpIHtcbiAgICAgICAgICAgIHRoaXMub3ZlcmxheSA9IGVsO1xuICAgICAgICB9LFxuICAgICAgICBvbk1hc2tUb2dnbGUoKSB7XG4gICAgICAgICAgICB0aGlzLnVubWFza2VkID0gIXRoaXMudW5tYXNrZWQ7XG4gICAgICAgIH0sXG4gICAgICAgIG9uT3ZlcmxheUNsaWNrKGV2ZW50KSB7XG4gICAgICAgICAgICBPdmVybGF5RXZlbnRCdXMuZW1pdCgnb3ZlcmxheS1jbGljaycsIHtcbiAgICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBldmVudCxcbiAgICAgICAgICAgICAgICB0YXJnZXQ6IHRoaXMuJGVsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0sXG4gICAgY29tcHV0ZWQ6IHtcbiAgICAgICAgY29udGFpbmVyQ2xhc3MoKSB7XG4gICAgICAgICAgICByZXR1cm4gWydwLXBhc3N3b3JkIHAtY29tcG9uZW50IHAtaW5wdXR3cmFwcGVyJywgdGhpcy5jbGFzcywge1xuICAgICAgICAgICAgICAgICdwLWlucHV0d3JhcHBlci1maWxsZWQnOiB0aGlzLmZpbGxlZCxcbiAgICAgICAgICAgICAgICAncC1pbnB1dHdyYXBwZXItZm9jdXMnOiB0aGlzLmZvY3VzZWQsXG4gICAgICAgICAgICAgICAgJ3AtaW5wdXQtaWNvbi1yaWdodCc6IHRoaXMudG9nZ2xlTWFza1xuICAgICAgICAgICAgfV07XG4gICAgICAgIH0sXG4gICAgICAgIGlucHV0RmllbGRDbGFzcygpIHtcbiAgICAgICAgICAgIHJldHVybiBbJ3AtcGFzc3dvcmQtaW5wdXQnLCB0aGlzLmlucHV0Q2xhc3MsIHtcbiAgICAgICAgICAgICAgICAncC1kaXNhYmxlZCc6IHRoaXMuJGF0dHJzLmRpc2FibGVkXG4gICAgICAgICAgICB9XTtcbiAgICAgICAgfSxcbiAgICAgICAgcGFuZWxTdHlsZUNsYXNzKCkge1xuICAgICAgICAgICAgcmV0dXJuIFsncC1wYXNzd29yZC1wYW5lbCBwLWNvbXBvbmVudCcsIHRoaXMucGFuZWxDbGFzcywge1xuICAgICAgICAgICAgICAgICdwLWlucHV0LWZpbGxlZCc6IHRoaXMuJHByaW1ldnVlLmNvbmZpZy5pbnB1dFN0eWxlID09PSAnZmlsbGVkJyxcbiAgICAgICAgICAgICAgICAncC1yaXBwbGUtZGlzYWJsZWQnOiB0aGlzLiRwcmltZXZ1ZS5jb25maWcucmlwcGxlID09PSBmYWxzZVxuICAgICAgICAgICAgfV07XG4gICAgICAgIH0sXG4gICAgICAgIHRvZ2dsZUljb25DbGFzcygpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnVubWFza2VkID8gdGhpcy5oaWRlSWNvbiA6IHRoaXMuc2hvd0ljb247XG4gICAgICAgIH0sXG4gICAgICAgIHN0cmVuZ3RoQ2xhc3MoKSB7XG4gICAgICAgICAgICByZXR1cm4gYHAtcGFzc3dvcmQtc3RyZW5ndGggJHt0aGlzLm1ldGVyID8gdGhpcy5tZXRlci5zdHJlbmd0aCA6ICcnfWA7XG4gICAgICAgIH0sXG4gICAgICAgIGlucHV0VHlwZSgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnVubWFza2VkID8gJ3RleHQnIDogJ3Bhc3N3b3JkJztcbiAgICAgICAgfSxcbiAgICAgICAgZmlsbGVkKCkge1xuICAgICAgICAgICAgcmV0dXJuICh0aGlzLm1vZGVsVmFsdWUgIT0gbnVsbCAmJiB0aGlzLm1vZGVsVmFsdWUudG9TdHJpbmcoKS5sZW5ndGggPiAwKVxuICAgICAgICB9LFxuICAgICAgICB3ZWFrVGV4dCgpIHtcbiAg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AoJG9wdGlvbnMub25PdmVybGF5Q2xpY2sgJiYgJG9wdGlvbnMub25PdmVybGF5Q2xpY2soLi4uYXJncykpKVxuICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJoZWFkZXJcIiksXG4gICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJjb250ZW50XCIsIHt9LCAoKSA9PiBbXG4gICAgICAgICAgICAgICAgICBjcmVhdGVWTm9kZShcImRpdlwiLCBfaG9pc3RlZF8xLCBbXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZVZOb2RlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICBjbGFzczogJG9wdGlvbnMuc3RyZW5ndGhDbGFzcyxcbiAgICAgICAgICAgICAgICAgICAgICBzdHlsZTogeyd3aWR0aCc6ICRkYXRhLm1ldGVyID8gJGRhdGEubWV0ZXIud2lkdGggOiAnJ31cbiAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgNilcbiAgICAgICAgICAgICAgICAgIF0pLFxuICAgICAgICAgICAgICAgICAgY3JlYXRlVk5vZGUoXCJkaXZcIiwgX2hvaXN0ZWRfMiwgdG9EaXNwbGF5U3RyaW5nKCRkYXRhLmluZm9UZXh0KSwgMSlcbiAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICByZW5kZXJTbG90KF9jdHguJHNsb3RzLCBcImZvb3RlclwiKVxuICAgICAgICAgICAgICBdLCAyKSlcbiAgICAgICAgICAgIDogY3JlYXRlQ29tbWVudFZOb2RlKFwiXCIsIHRydWUpXG4gICAgICAgIF0pLFxuICAgICAgICBfOiAzXG4gICAgICB9LCA4LCBbXCJvbkVudGVyXCIsIFwib25MZWF2ZVwiLCBcIm9uQWZ0ZXJMZWF2ZVwiXSlcbiAgICBdLCA4LCBbXCJ0b1wiLCBcImRpc2FibGVkXCJdKSlcbiAgXSwgNikpXG59XG5c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3BsYXk6IGlubGluZS1mbGV4O1xcbn1cXG4ucC1wYXNzd29yZC1wYW5lbCB7XFxuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcXG4gICAgdG9wOiAwO1xcbiAgICBsZWZ0OiAwO1xcbn1cXG4ucC1wYXNzd29yZCAucC1wYXNzd29yZC1wYW5lbCB7XFxuICAgIG1pbi13aWR0aDogMTAwJTtcXG59XFxuLnAtcGFzc3dvcmQtbWV0ZXIge1xcbiAgICBoZWlnaHQ6IDEwcHg7XFxufVxcbi5wLXBhc3N3b3JkLXN0cmVuZ3RoIHtcXG4gICAgaGVpZ2h0OiAxMDAlO1xcbiAgICB3aWR0aDogMDtcXG4gICAgLXdlYmtpdC10cmFuc2l0aW9uOiB3aWR0aCAxcyBlYXNlLWluLW91dDtcXG4gICAgdHJhbnNpdGlvbjogd2lkdGggMXMgZWFzZS1pbi1vdXQ7XFxufVxcbi5wLWZsdWlkIC5wLXBhc3N3b3JkIHtcXG4gICAgZGlzcGxheTogLXdlYmtpdC1ib3g7XFxuICAgIGRpc3BsYXk6IC1tcy1mbGV4Ym94O1xcbiAgICBkaXNwbGF5OiBmbGV4O1xcbn1cXG5cIjtcbnN0eWxlSW5qZWN0KGNzc18yNDh6KTtcblxuc2NyaXB0LnJlbmRlciA9IHJlbmRlcjtcblxuZXhwb3J0IGRlZmF1bHQgc2NyaXB0O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4902\n")},1895:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "Z": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5166);\n\n\nvar script = {\n name: \'ProgressSpinner\',\n props: {\n strokeWidth: {\n type: String,\n default: \'2\'\n },\n fill: {\n type: String,\n default: \'none\'\n },\n animationDuration: {\n type: String,\n default: \'2s\'\n }\n },\n computed: {\n svgStyle() {\n return {\n \'animation-duration\': this.animationDuration\n };\n }\n }\n};\n\nconst _hoisted_1 = {\n class: "p-progress-spinner",\n role: "alert",\n "aria-busy": "true"\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)("div", _hoisted_1, [\n ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)("svg", {\n class: "p-progress-spinner-svg",\n viewBox: "25 25 50 50",\n style: $options.svgStyle\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createVNode */ .Wm)("circle", {\n class: "p-progress-spinner-circle",\n cx: "50",\n cy: "50",\n r: "20",\n fill: $props.fill,\n "stroke-width": $props.strokeWidth,\n strokeMiterlimit: "10"\n }, null, 8, ["fill", "stroke-width"])\n ], 4))\n ]))\n}\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === \'undefined\') { return; }\n\n var head = document.head || document.getElementsByTagName(\'head\')[0];\n var style = document.createElement(\'style\');\n style.type = \'text/css\';\n\n if (insertAt === \'top\') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css_248z = "\\n.p-progress-spinner {\\n position: relative;\\n margin: 0 auto;\\n width: 100px;\\n height: 100px;\\n display: inline-block;\\n}\\n.p-progress-spinner::before {\\n content: \'\';\\n display: block;\\n padding-top: 100%;\\n}\\n.p-progress-spinner-svg {\\n -webkit-animation: p-progress-spinner-rotate 2s linear infinite;\\n animation: p-progress-spinner-rotate 2s linear infinite;\\n height: 100%;\\n -webkit-transform-origin: center center;\\n transform-origin: center center;\\n width: 100%;\\n position: absolute;\\n top: 0;\\n bottom: 0;\\n left: 0;\\n right: 0;\\n margin: auto;\\n}\\n.p-progress-spinner-circle {\\n stroke-dasharray: 89, 200;\\n stroke-dashoffset: 0;\\n stroke: #d62d20;\\n -webkit-animation: p-progress-spinner-dash 1.5s ease-in-out infinite, p-progress-spinner-color 6s ease-in-out infinite;\\n animation: p-progress-spinner-dash 1.5s ease-in-out infinite, p-progress-spinner-color 6s ease-in-out infinite;\\n stroke-linecap: round;\\n}\\n@-webkit-keyframes p-progress-spinner-rotate {\\n100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n}\\n}\\n@keyframes p-progress-spinner-rotate {\\n100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n}\\n}\\n@-webkit-keyframes p-progress-spinner-dash {\\n0% {\\n stroke-dasharray: 1, 200;\\n stroke-dashoffset: 0;\\n}\\n50% {\\n stroke-dasharray: 89, 200;\\n stroke-dashoffset: -35px;\\n}\\n100% {\\n stroke-dasharray: 89, 200;\\n stroke-dashoffset: -124px;\\n}\\n}\\n@keyframes p-progress-spinner-dash {\\n0% {\\n stroke-dasharray: 1, 200;\\n stroke-dashoffset: 0;\\n}\\n50% {\\n stroke-dasharray: 89, 200;\\n stroke-dashoffset: -35px;\\n}\\n100% {\\n stroke-dasharray: 89, 200;\\n stroke-dashoffset: -124px;\\n}\\n}\\n@-webkit-keyframes p-progress-spinner-color {\\n100%,\\n 0% {\\n stroke: #d62d20;\\n}\\n40% {\\n stroke: #0057e7;\\n}\\n66% {\\n stroke: #008744;\\n}\\n80%,\\n 90% {\\n stroke: #ffa700;\\n}\\n}\\n@keyframes p-progress-spinner-color {\\n100%,\\n 0% {\\n stroke: #d62d20;\\n}\\n40% {\\n stroke: #0057e7;\\n}\\n66% {\\n stroke: #008744;\\n}\\n80%,\\n 90% {\\n stroke: #ffa700;\\n}\\n}\\n";\nstyleInject(css_248z);\n\nscript.render = render;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg5NS5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQTBEOztBQUUxRDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLFVBQVUsd0RBQVMsSUFBSSwwREFBVztBQUNsQyxLQUFLLHdEQUFTLElBQUksMERBQVc7QUFDN0I7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMLE1BQU0sMERBQVc7QUFDakI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxPQUFPO0FBQ1A7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQSxpREFBaUQ7O0FBRWpEO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxNQUFNO0FBQ047QUFDQTtBQUNBLElBQUk7QUFDSjtBQUNBOztBQUVBO0FBQ0E7QUFDQSxJQUFJO0FBQ0o7QUFDQTtBQUNBOztBQUVBLHVDQUF1Qyx5QkFBeUIscUJBQXFCLG1CQUFtQixvQkFBb0IsNEJBQTRCLEdBQUcsK0JBQStCLG1CQUFtQixzQkFBc0IseUJBQXlCLEdBQUcsMkJBQTJCLHNFQUFzRSxzRUFBc0UsbUJBQW1CLDhDQUE4Qyw4Q0FBOEMsa0JBQWtCLHlCQUF5QixhQUFh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wZTogU3RyaW5nLFxuICAgICAgICAgICAgZGVmYXVsdDogJzInXG4gICAgICAgIH0sXG4gICAgICAgIGZpbGw6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIGRlZmF1bHQ6ICdub25lJ1xuICAgICAgICB9LFxuICAgICAgICBhbmltYXRpb25EdXJhdGlvbjoge1xuICAgICAgICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgICAgICAgZGVmYXVsdDogJzJzJ1xuICAgICAgICB9XG4gICAgfSxcbiAgICBjb21wdXRlZDoge1xuICAgICAgICBzdmdTdHlsZSgpIHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgJ2FuaW1hdGlvbi1kdXJhdGlvbic6IHRoaXMuYW5pbWF0aW9uRHVyYXRpb25cbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICB9XG59O1xuXG5jb25zdCBfaG9pc3RlZF8xID0ge1xuICBjbGFzczogXCJwLXByb2dyZXNzLXNwaW5uZXJcIixcbiAgcm9sZTogXCJhbGVydFwiLFxuICBcImFyaWEtYnVzeVwiOiBcInRydWVcIlxufTtcblxuZnVuY3Rpb24gcmVuZGVyKF9jdHgsIF9jYWNoZSwgJHByb3BzLCAkc2V0dXAsICRkYXRhLCAkb3B0aW9ucykge1xuICByZXR1cm4gKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayhcImRpdlwiLCBfaG9pc3RlZF8xLCBbXG4gICAgKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayhcInN2Z1wiLCB7XG4gICAgICBjbGFzczogXCJwLXByb2dyZXNzLXNwaW5uZXItc3ZnXCIsXG4gICAgICB2aWV3Qm94OiBcIjI1IDI1IDUwIDUwXCIsXG4gICAgICBzdHlsZTogJG9wdGlvbnMuc3ZnU3R5bGVcbiAgICB9LCBbXG4gICAgICBjcmVhdGVWTm9kZShcImNpcmNsZVwiLCB7XG4gICAgICAgIGNsYXNzOiBcInAtcHJv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HtcXG4gICAgICAgIHN0cm9rZTogIzAwODc0NDtcXG59XFxuODAlLFxcbiAgICA5MCUge1xcbiAgICAgICAgc3Ryb2tlOiAjZmZhNzAwO1xcbn1cXG59XFxuXCI7XG5zdHlsZUluamVjdChjc3NfMjQ4eik7XG5cbnNjcmlwdC5yZW5kZXIgPSByZW5kZXI7XG5cbmV4cG9ydCBkZWZhdWx0IHNjcmlwdDtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///1895\n')},6954:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Nd\": () => (/* binding */ primebus),\n/* harmony export */ \"P9\": () => (/* binding */ ZIndexUtils),\n/* harmony export */ \"Th\": () => (/* binding */ UniqueComponentId),\n/* harmony export */ \"Vr\": () => (/* binding */ ConnectedOverlayScrollHandler),\n/* harmony export */ \"gb\": () => (/* binding */ ObjectUtils),\n/* harmony export */ \"p7\": () => (/* binding */ DomHandler)\n/* harmony export */ });\nvar DomHandler = {\n\n innerWidth(el) {\n let width = el.offsetWidth;\n let style = getComputedStyle(el);\n\n width += parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n return width;\n },\n\n width(el) {\n let width = el.offsetWidth;\n let style = getComputedStyle(el);\n\n width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n return width;\n },\n\n getWindowScrollTop() {\n let doc = document.documentElement;\n return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\n },\n\n getWindowScrollLeft() {\n let doc = document.documentElement;\n return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\n },\n\n getOuterWidth(el, margin) {\n if (el) {\n let width = el.offsetWidth;\n\n if (margin) {\n let style = getComputedStyle(el);\n width += parseFloat(style.marginLeft) + parseFloat(style.marginRight);\n }\n\n return width;\n }\n else {\n return 0;\n }\n },\n\n getOuterHeight(el, margin) {\n if (el) {\n let height = el.offsetHeight;\n\n if (margin) {\n let style = getComputedStyle(el);\n height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);\n }\n\n return height;\n }\n else {\n return 0;\n }\n },\n\n getClientHeight(el, margin) {\n if (el) {\n let height = el.clientHeight;\n\n if (margin) {\n let style = getComputedStyle(el);\n height += parseFloat(style.marginTop) + parseFloat(style.marginBottom);\n }\n\n return height;\n } else {\n return 0;\n }\n },\n\n getViewport() {\n let win = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n w = win.innerWidth || e.clientWidth || g.clientWidth,\n h = win.innerHeight || e.clientHeight || g.clientHeight;\n\n return {width: w, height: h};\n },\n\n getOffset(el) {\n var rect = el.getBoundingClientRect();\n\n return {\n top: rect.top + (window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0),\n left: rect.left + (window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0),\n };\n },\n\n index(element) {\n let children = element.parentNode.childNodes;\n let num = 0;\n for (var i = 0; i < children.length; i++) {\n if (children[i] === element) return num;\n if (children[i].nodeType === 1) num++;\n }\n return -1;\n },\n\n addMultipleClasses(element, className) {\n if (element.classList) {\n let styles = className.split(' ');\n for (let i = 0; i < styles.length; i++) {\n element.classList.add(styles[i]);\n }\n\n }\n else {\n let styles = className.split(' ');\n for (let i = 0; i < styles.length; i++) {\n element.className += ' ' + styles[i];\n }\n }\n },\n\n addClass(element, className) {\n if (element.classList)\n element.classList.add(className);\n else\n element.className += ' ' + className;\n },\n\n removeClass(element, className) {\n if (element.classList)\n element.classList.remove(className);\n else\n element.className = element.className.replace(new RegExp('(^|\\\\b)' + className.split(' ').join('|') + '(\\\\b|$)', 'gi'), ' ');\n },\n\n hasClass(element, className) {\n if (element) {\n if (element.classList)\n return element.classList.contains(className);\n else\n return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);\n }\n\n return false;\n },\n\n find(element, selector) {\n return element.querySelectorAll(selector);\n },\n\n findSingle(element, selector) {\n return element.querySelector(selector);\n },\n\n getHeight(el) {\n let height = el.offsetHeight;\n let style = getComputedStyle(el);\n\n height -= parseFloat(style.paddingTop) + parseFloat(style.paddingBottom) + parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n\n return height;\n },\n\n getWidth(el) {\n let width = el.offsetWidth;\n let style = getComputedStyle(el);\n\n width -= parseFloat(style.paddingLeft) + parseFloat(style.paddingRight) + parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n\n return width;\n },\n\n absolutePosition(element, target) {\n let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);\n let elementOuterHeight = elementDimensions.height;\n let elementOuterWidth = elementDimensions.width;\n let targetOuterHeight = target.offsetHeight;\n let targetOuterWidth = target.offsetWidth;\n let targetOffset = target.getBoundingClientRect();\n let windowScrollTop = this.getWindowScrollTop();\n let windowScrollLeft = this.getWindowScrollLeft();\n let viewport = this.getViewport();\n let top, left;\n\n if (targetOffset.top + targetOuterHeight + elementOuterHeight > viewport.height) {\n top = targetOffset.top + windowScrollTop - elementOuterHeight;\n element.style.transformOrigin = 'bottom';\n\n if (top < 0) {\n top = windowScrollTop;\n }\n }\n else {\n top = targetOuterHeight + targetOffset.top + windowScrollTop;\n element.style.transformOrigin = 'top';\n }\n\n if (targetOffset.left + elementOuterWidth > viewport.width)\n left = Math.max(0, targetOffset.left + windowScrollLeft + targetOuterWidth - elementOuterWidth);\n else\n left = targetOffset.left + windowScrollLeft;\n\n element.style.top = top + 'px';\n element.style.left = left + 'px';\n },\n\n relativePosition(element, target) {\n let elementDimensions = element.offsetParent ? { width: element.offsetWidth, height: element.offsetHeight } : this.getHiddenElementDimensions(element);\n const targetHeight = target.offsetHeight;\n const targetOffset = target.getBoundingClientRect();\n const viewport = this.getViewport();\n let top, left;\n\n if ((targetOffset.top + targetHeight + elementDimensions.height) > viewport.height) {\n top = -1 * (elementDimensions.height);\n element.style.transformOrigin = 'bottom';\n if (targetOffset.top + top < 0) {\n top = -1 * targetOffset.top;\n }\n }\n else {\n top = targetHeight;\n element.style.transformOrigin = 'top';\n }\n\n if (elementDimensions.width > viewport.width) {\n // element wider then viewport and cannot fit on screen (align at left side of viewport)\n left = targetOffset.left * -1;\n }\n else if ((targetOffset.left + elementDimensions.width) > viewport.width) {\n // element wider then viewport but can be fit on screen (align at right side of viewport)\n left = (targetOffset.left + elementDimensions.width - viewport.width) * -1;\n }\n else {\n // element fits on screen (align with target)\n left = 0;\n }\n\n element.style.top = top + 'px';\n element.style.left = left + 'px';\n },\n\n getParents(element, parents = []) {\n return element['parentNode'] === null ? parents : this.getParents(element.parentNode, parents.concat([element.parentNode]));\n },\n\n getScrollableParents(element) {\n let scrollableParents = [];\n\n if (element) {\n let parents = this.getParents(element);\n const overflowRegex = /(auto|scroll)/;\n const overflowCheck = (node) => {\n let styleDeclaration = window['getComputedStyle'](node, null);\n return overflowRegex.test(styleDeclaration.getPropertyValue('overflow')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowX')) || overflowRegex.test(styleDeclaration.getPropertyValue('overflowY'));\n };\n\n for (let parent of parents) {\n let scrollSelectors = parent.nodeType === 1 && parent.dataset['scrollselectors'];\n if (scrollSelectors) {\n let selectors = scrollSelectors.split(',');\n for (let selector of selectors) {\n let el = this.findSingle(parent, selector);\n if (el && overflowCheck(el)) {\n scrollableParents.push(el);\n }\n }\n }\n\n if (parent.nodeType !== 9 && overflowCheck(parent)) {\n scrollableParents.push(parent);\n }\n }\n }\n\n return scrollableParents;\n },\n\n getHiddenElementOuterHeight(element) {\n element.style.visibility = 'hidden';\n element.style.display = 'block';\n let elementHeight = element.offsetHeight;\n element.style.display = 'none';\n element.style.visibility = 'visible';\n\n return elementHeight;\n },\n\n getHiddenElementOuterWidth(element) {\n element.style.visibility = 'hidden';\n element.style.display = 'block';\n let elementWidth = element.offsetWidth;\n element.style.display = 'none';\n element.style.visibility = 'visible';\n\n return elementWidth;\n },\n\n getHiddenElementDimensions(element) {\n var dimensions = {};\n element.style.visibility = 'hidden';\n element.style.display = 'block';\n dimensions.width = element.offsetWidth;\n dimensions.height = element.offsetHeight;\n element.style.display = 'none';\n element.style.visibility = 'visible';\n\n return dimensions;\n },\n\n fadeIn(element, duration) {\n element.style.opacity = 0;\n\n var last = +new Date();\n var opacity = 0;\n var tick = function () {\n opacity = +element.style.opacity + (new Date().getTime() - last) / duration;\n element.style.opacity = opacity;\n last = +new Date();\n\n if (+opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n },\n\n fadeOut(element, ms) {\n var opacity = 1,\n interval = 50,\n duration = ms,\n gap = interval / duration;\n\n let fading = setInterval(() => {\n opacity -= gap;\n\n if (opacity <= 0) {\n opacity = 0;\n clearInterval(fading);\n }\n\n element.style.opacity = opacity;\n }, interval);\n },\n\n getUserAgent() {\n return navigator.userAgent;\n },\n\n appendChild(element, target) {\n if(this.isElement(target))\n target.appendChild(element);\n else if(target.el && target.elElement)\n target.elElement.appendChild(element);\n else\n throw new Error('Cannot append ' + target + ' to ' + element);\n },\n\n scrollInView(container, item) {\n let borderTopValue = getComputedStyle(container).getPropertyValue('borderTopWidth');\n let borderTop = borderTopValue ? parseFloat(borderTopValue) : 0;\n let paddingTopValue = getComputedStyle(container).getPropertyValue('paddingTop');\n let paddingTop = paddingTopValue ? parseFloat(paddingTopValue) : 0;\n let containerRect = container.getBoundingClientRect();\n let itemRect = item.getBoundingClientRect();\n let offset = (itemRect.top + document.body.scrollTop) - (containerRect.top + document.body.scrollTop) - borderTop - paddingTop;\n let scroll = container.scrollTop;\n let elementHeight = container.clientHeight;\n let itemHeight = this.getOuterHeight(item);\n\n if (offset < 0) {\n container.scrollTop = scroll + offset;\n }\n else if ((offset + itemHeight) > elementHeight) {\n container.scrollTop = scroll + offset - elementHeight + itemHeight;\n }\n },\n\n clearSelection() {\n if(window.getSelection) {\n if(window.getSelection().empty) {\n window.getSelection().empty();\n } else if(window.getSelection().removeAllRanges && window.getSelection().rangeCount > 0 && window.getSelection().getRangeAt(0).getClientRects().length > 0) {\n window.getSelection().removeAllRanges();\n }\n }\n else if(document['selection'] && document['selection'].empty) {\n try {\n document['selection'].empty();\n } catch(error) {\n //ignore IE bug\n }\n }\n },\n\n calculateScrollbarWidth() {\n if(this.calculatedScrollbarWidth != null)\n return this.calculatedScrollbarWidth;\n\n let scrollDiv = document.createElement(\"div\");\n scrollDiv.className = \"p-scrollbar-measure\";\n document.body.appendChild(scrollDiv);\n\n let scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n\n this.calculatedScrollbarWidth = scrollbarWidth;\n\n return scrollbarWidth;\n },\n\n getBrowser() {\n if(!this.browser) {\n let matched = this.resolveUserAgent();\n this.browser = {};\n\n if (matched.browser) {\n this.browser[matched.browser] = true;\n this.browser['version'] = matched.version;\n }\n\n if (this.browser['chrome']) {\n this.browser['webkit'] = true;\n } else if (this.browser['webkit']) {\n this.browser['safari'] = true;\n }\n }\n\n return this.browser;\n },\n\n resolveUserAgent() {\n let ua = navigator.userAgent.toLowerCase();\n let match = /(chrome)[ ]([\\w.]+)/.exec(ua) ||\n /(webkit)[ ]([\\w.]+)/.exec(ua) ||\n /(opera)(?:.*version|)[ ]([\\w.]+)/.exec(ua) ||\n /(msie) ([\\w.]+)/.exec(ua) ||\n (ua.indexOf(\"compatible\") < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua)) ||\n [];\n\n return {\n browser: match[1] || \"\",\n version: match[2] || \"0\"\n };\n },\n\n isVisible(element) {\n return element.offsetParent != null;\n },\n\n invokeElementMethod(element, methodName, args) {\n (element)[methodName].apply(element, args);\n },\n\n getFocusableElements(element) {\n let focusableElements = this.find(element, `button:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]),\n [href][clientHeight][clientWidth]:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]),\n input:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]), select:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]),\n textarea:not([tabindex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]), [tabIndex]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden]),\n [contenteditable]:not([tabIndex = \"-1\"]):not([disabled]):not([style*=\"display:none\"]):not([hidden])`\n );\n\n let visibleFocusableElements = [];\n for (let focusableElement of focusableElements) {\n if (getComputedStyle(focusableElement).display != \"none\" && getComputedStyle(focusableElement).visibility != \"hidden\")\n visibleFocusableElements.push(focusableElement);\n }\n\n return visibleFocusableElements;\n },\n\n getFirstFocusableElement(element) {\n const focusableElements = this.getFocusableElements(element);\n return focusableElements.length > 0 ? focusableElements[0] : null;\n },\n\n isClickable(element) {\n const targetNode = element.nodeName;\n const parentNode = element.parentElement && element.parentElement.nodeName;\n\n return (targetNode == 'INPUT' || targetNode == 'BUTTON' || targetNode == 'A' ||\n parentNode == 'INPUT' || parentNode == 'BUTTON' || parentNode == 'A' ||\n this.hasClass(element, 'p-button') || this.hasClass(element.parentElement, 'p-button') ||\n this.hasClass(element.parentElement, 'p-checkbox') || this.hasClass(element.parentElement, 'p-radiobutton')\n );\n },\n\n applyStyle(element, style) {\n if (typeof style === 'string') {\n element.style.cssText = this.style;\n }\n else {\n for (let prop in this.style) {\n element.style[prop] = style[prop];\n }\n }\n },\n\n isIOS() {\n return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window['MSStream'];\n },\n\n isAndroid() {\n return /(android)/i.test(navigator.userAgent);\n },\n\n isTouchDevice() {\n return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));\n }\n};\n\nclass ConnectedOverlayScrollHandler {\n\n constructor(element, listener = () => {}) {\n this.element = element;\n this.listener = listener;\n }\n\n bindScrollListener() {\n this.scrollableParents = DomHandler.getScrollableParents(this.element);\n for (let i = 0; i < this.scrollableParents.length; i++) {\n this.scrollableParents[i].addEventListener('scroll', this.listener);\n }\n }\n\n unbindScrollListener() {\n if (this.scrollableParents) {\n for (let i = 0; i < this.scrollableParents.length; i++) {\n this.scrollableParents[i].removeEventListener('scroll', this.listener);\n }\n }\n }\n\n destroy() {\n this.unbindScrollListener();\n this.element = null;\n this.listener = null;\n this.scrollableParents = null;\n }\n}\n\nvar ObjectUtils = {\n\n equals(obj1, obj2, field) {\n if (field)\n return (this.resolveFieldData(obj1, field) === this.resolveFieldData(obj2, field));\n else\n return this.deepEquals(obj1, obj2);\n },\n\n deepEquals(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a)\n , arrB = Array.isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!this.deepEquals(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = Object.keys(a);\n length = keys.length;\n\n if (length !== Object.keys(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!this.deepEquals(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n return a !== a && b !== b;\n },\n\n resolveFieldData(data, field) {\n if (data && Object.keys(data).length && field) {\n if (this.isFunction(field)) {\n return field(data);\n }\n else if(field.indexOf('.') === -1) {\n return data[field];\n }\n else {\n let fields = field.split('.');\n let value = data;\n for(var i = 0, len = fields.length; i < len; ++i) {\n if (value == null) {\n return null;\n }\n value = value[fields[i]];\n }\n return value;\n }\n }\n else {\n return null;\n }\n },\n\n isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n },\n\n filter(value, fields, filterValue) {\n var filteredItems = [];\n\n if (value) {\n for (let item of value) {\n for (let field of fields) {\n if (String(this.resolveFieldData(item, field)).toLowerCase().indexOf(filterValue.toLowerCase()) > -1) {\n filteredItems.push(item);\n break;\n }\n }\n }\n }\n\n return filteredItems;\n },\n\n reorderArray(value, from, to) {\n let target;\n if (value && (from !== to)) {\n if (to >= value.length) {\n target = to - value.length;\n while ((target--) + 1) {\n value.push(undefined);\n }\n }\n value.splice(to, 0, value.splice(from, 1)[0]);\n }\n },\n\n findIndexInList(value, list) {\n let index = -1;\n\n if (list) {\n for (let i = 0; i < list.length; i++) {\n if (list[i] === value) {\n index = i;\n break;\n }\n }\n }\n\n return index;\n },\n\n contains(value, list) {\n if (value != null && list && list.length) {\n for (let val of list) {\n if (this.equals(value, val))\n return true;\n }\n }\n\n return false;\n },\n\n insertIntoOrderedArray(item, index, arr, sourceArr) {\n if (arr.length > 0) {\n let injected = false;\n for (let i = 0; i < arr.length; i++) {\n let currentItemIndex = this.findIndexInList(arr[i], sourceArr);\n if (currentItemIndex > index) {\n arr.splice(i, 0, item);\n injected = true;\n break;\n }\n }\n\n if (!injected) {\n arr.push(item);\n }\n }\n else {\n arr.push(item);\n }\n },\n\n removeAccents(str) {\n if (str && str.search(/[\\xC0-\\xFF]/g) > -1) {\n str = str\n .replace(/[\\xC0-\\xC5]/g, \"A\")\n .replace(/[\\xC6]/g, \"AE\")\n .replace(/[\\xC7]/g, \"C\")\n .replace(/[\\xC8-\\xCB]/g, \"E\")\n .replace(/[\\xCC-\\xCF]/g, \"I\")\n .replace(/[\\xD0]/g, \"D\")\n .replace(/[\\xD1]/g, \"N\")\n .replace(/[\\xD2-\\xD6\\xD8]/g, \"O\")\n .replace(/[\\xD9-\\xDC]/g, \"U\")\n .replace(/[\\xDD]/g, \"Y\")\n .replace(/[\\xDE]/g, \"P\")\n .replace(/[\\xE0-\\xE5]/g, \"a\")\n .replace(/[\\xE6]/g, \"ae\")\n .replace(/[\\xE7]/g, \"c\")\n .replace(/[\\xE8-\\xEB]/g, \"e\")\n .replace(/[\\xEC-\\xEF]/g, \"i\")\n .replace(/[\\xF1]/g, \"n\")\n .replace(/[\\xF2-\\xF6\\xF8]/g, \"o\")\n .replace(/[\\xF9-\\xFC]/g, \"u\")\n .replace(/[\\xFE]/g, \"p\")\n .replace(/[\\xFD\\xFF]/g, \"y\");\n }\n\n return str;\n },\n\n getVNodeProp(vnode, prop) {\n let props = vnode.props;\n if (props) {\n let kebapProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n let propName = Object.prototype.hasOwnProperty.call(props, kebapProp) ? kebapProp : prop;\n\n return ((vnode.type.props[prop].type === Boolean && props[propName] === '') ? true : props[propName]); \n }\n\n return null;\n } \n\n};\n\nfunction handler() {\n let zIndexes = [];\n\n const generateZIndex = (key, baseZIndex) => {\n let lastZIndex = zIndexes.length > 0 ? zIndexes[zIndexes.length - 1] : { key, value: baseZIndex };\n let newZIndex = lastZIndex.value + (lastZIndex.key === key ? 0 : baseZIndex) + 1;\n\n zIndexes.push({ key, value: newZIndex });\n return newZIndex;\n };\n\n const revertZIndex = (zIndex) => {\n zIndexes = zIndexes.filter(obj => obj.value !== zIndex);\n };\n\n const getCurrentZIndex = () => {\n return zIndexes.length > 0 ? zIndexes[zIndexes.length - 1].value : 0;\n };\n\n const getZIndex = (el) => {\n return el ? parseInt(el.style.zIndex, 10) || 0 : 0\n };\n\n return {\n get: getZIndex,\n set: (key, el, baseZIndex) => {\n if (el) {\n el.style.zIndex = String(generateZIndex(key, baseZIndex));\n }\n },\n clear: (el) => {\n if (el) {\n revertZIndex(getZIndex(el));\n el.style.zIndex = '';\n }\n },\n getCurrent: () => getCurrentZIndex()\n };\n}\n\nvar ZIndexUtils = handler();\n\nvar lastId = 0;\n\nfunction UniqueComponentId (prefix = 'pv_id_') {\n lastId++;\n return `${prefix}${lastId}`;\n}\n\nfunction primebus() {\n\tconst allHandlers = new Map();\n\n\treturn {\n\t\ton(type, handler) {\n\t\t\tlet handlers = allHandlers.get(type);\n if (!handlers)\n handlers = [handler];\n else\n handlers.push(handler);\n\n allHandlers.set(type, handlers);\n\t\t},\n\n\t\toff(type, handler) {\n\t\t\tlet handlers = allHandlers.get(type);\n\t\t\tif (handlers) {\n\t\t\t\thandlers.splice(handlers.indexOf(handler) >>> 0, 1);\n\t\t\t}\n\t\t},\n\n\t\temit(type, evt) {\n let handlers = allHandlers.get(type);\n if (handlers) {\n handlers.slice().map((handler) => { handler(evt);});\n }\n\t\t}\n\t};\n}\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjk1NC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7OztBQUFBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBLEtBQUs7O0FBRUw7QUFDQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0E7QUFDQSxLQUFLOztBQUVMO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSzs7QUFFTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEtBQUs7O0FBRUw7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsVUFBVTtBQUNWO0FBQ0E7QUFDQSxLQUFLOztBQUVMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLGdCQUFnQjtB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ICBsZXQgaGVpZ2h0ID0gZWwuY2xpZW50SGVpZ2h0O1xuXG4gICAgICAgICAgICBpZiAobWFyZ2luKSB7XG4gICAgICAgICAgICAgICAgbGV0IHN0eWxlID0gZ2V0Q29tcHV0ZWRTdHlsZShlbCk7XG4gICAgICAgICAgICAgICAgaGVpZ2h0ICs9IHBhcnNlRmxvYXQoc3R5bGUubWFyZ2luVG9wKSArIHBhcnNlRmxvYXQoc3R5bGUubWFyZ2luQm90dG9tKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIGhlaWdodDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiAwO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGdldFZpZXdwb3J0KCkge1xuICAgICAgICBsZXQgd2luID0gd2luZG93LFxuICAgICAgICAgICAgZCA9IGRvY3VtZW50LFxuICAgICAgICAgICAgZSA9IGQuZG9jdW1lbnRFbGVtZW50LFxuICAgICAgICAgICAgZyA9IGQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2JvZHknKVswXSxcbiAgICAgICAgICAgIHcgPSB3aW4uaW5uZXJXaWR0aCB8fCBlLmNsaWVudFdpZHRoIHx8IGcuY2xpZW50V2lkdGgsXG4gICAgICAgICAgICBoID0gd2luLmlubmVySGVpZ2h0IHx8IGUuY2xpZW50SGVpZ2h0IHx8IGcuY2xpZW50SGVpZ2h0O1xuXG4gICAgICAgIHJldHVybiB7d2lkdGg6IHcsIGhlaWdodDogaH07XG4gICAgfSxcblxuICAgIGdldE9mZnNldChlbCkge1xuICAgICAgICB2YXIgcmVjdCA9IGVsLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO1xuXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICB0b3A6IHJlY3QudG9wICsgKHdpbmRvdy5wYWdlWU9mZnNldCB8fCBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wIHx8IGRvY3VtZW50LmJ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gaSsrKSB7XG4gICAgICAgICAgICAgICAgZWxlbWVudC5jbGFzc05hbWUgKz0gJyAnICsgc3R5bGVzW2ldO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfSxcblxuICAgIGFkZENsYXNzKGVsZW1lbnQsIGNsYXNzTmFtZSkge1xuICAgICAgICBpZiAoZWxlbWVudC5jbGFzc0xpc3QpXG4gICAgICAgICAgICBlbGVtZW50LmNsYXNzTGlzdC5hZGQoY2xhc3NOYW1lKTtcbiAgICAgICAgZWxzZVxuICAgICAgICAgICAgZWxlbWVudC5jbGFzc05hbWUgKz0gJyAnICsgY2xhc3NOYW1lO1xuICAgIH0sXG5cbiAgICByZW1vdmVDbGFzcyhlbGVtZW50LCBjbGFzc05hbWUpIHtcbiAgICAgICAgaWYgKGVsZW1lbnQuY2xhc3NMaXN0KVxuICAgICAgICAgICAgZWxlbWVudC5jbGFzc0xpc3QucmVtb3ZlKGNsYXNzTmFtZSk7XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIGVsZW1lbnQuY2xhc3NOYW1lID0gZWxlbWVudC5jbGFzc05hbWUucmVwbGFjZShuZXcgUmVnRXhwKCcoXnxcXFxcYiknICsgY2xhc3NOYW1lLnNwbGl0KCcgJykuam9pbignfCcpICsgJyhcXFxcYnwkKScsICdnaScpLCAnICcpO1xuICAgIH0sXG5cbiAgICBoYXNDbGFzcyhlbGVtZW50LCBjbGFzc05hbWUpIHtcbiAgICAgICAgaWYgKGVsZW1lbnQpIHtcbiAgICAgICAgICAgIGlmIChlbGVtZW50LmNsYXNzTGlzdClcbiAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudC5jbGFzc0xpc3QuY29udGFpbnMoY2xhc3NOYW1lKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFJlZ0V4cCgnKF58ICknICsgY2xhc3NOYW1lICsgJyggfCQpJywgJ2dpJykudGVzdChlbGVtZW50LmNsYXNzTmFtZSk7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IHNlbGVjdG9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbCAmJiBvdmVyZmxvd0NoZWNrKGVsKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbGFibGVQYXJlbnRzLnB1c2goZWwpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKHBhcmVudC5ub2RlVHlwZSAhPT0gOSAmJiBvdmVyZmxvd0NoZWNrKHBhcmVudCkpIHtcbiAgICAgICAgICAgICAgICAgICAgc2Nyb2xsYWJsZVBhcmVudHMucHVzaChwYXJlbnQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBzY3JvbGxhYmxlUGFyZW50cztcbiAgICB9LFxuXG4gICAgZ2V0SGlkZGVuRWxlbWVudE91dGVySGVpZ2h0KGVsZW1lbnQpIHtcbiAgICAgICAgZWxlbWVudC5zdHlsZS52aXNpYmlsaXR5ID0gJ2hpZGRlbic7XG4gICAgICAgIGVsZW1lbnQuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7XG4gICAgICAgIGxldCBlbGVtZW50SGVpZ2h0ID0gZWxlbWVudC5vZmZzZXRIZWlnaHQ7XG4gICAgICAgIGVsZW1lbnQuc3R5bGUuZGlzcGxheSA9ICdub25lJztcbiAgICAgICAgZWxlbWVudC5zdHlsZS52aXNpYmlsaXR5ID0gJ3Zpc2libGUnO1xuXG4gICAgICAgIHJldHVybiBlbGVtZW50SGVpZ2h0O1xuICAgIH0sXG5cbiAgICBnZXRIaWRkZW5FbGVtZW50T3V0ZXJXaWR0aChlbGVtZW50KSB7XG4gICAgICAgIGVsZW1lbnQuc3R5bGUudmlzaWJpbGl0eSA9ICdoaWRkZW4nO1xuICAgICAgICBlbGVtZW50LnN0eWxlLmRpc3BsYXkgPSAnYmx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uICAgICAgICAgICAgZWxlbWVudC5zdHlsZS5vcGFjaXR5ID0gb3BhY2l0eTtcbiAgICAgICAgICAgIGxhc3QgPSArbmV3IERhdGUoKTtcblxuICAgICAgICAgICAgaWYgKCtvcGFjaXR5IDwgMSkge1xuICAgICAgICAgICAgICAgICh3aW5kb3cucmVxdWVzdEFuaW1hdGlvbkZyYW1lICYmIHJlcXVlc3RBbmltYXRpb25GcmFtZSh0aWNrKSkgfHwgc2V0VGltZW91dCh0aWNrLCAxNik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH07XG5cbiAgICAgICAgdGljaygpO1xuICAgIH0sXG5cbiAgICBmYWRlT3V0KGVsZW1lbnQsIG1zKSB7XG4gICAgICAgIHZhciBvcGFjaXR5ID0gMSxcbiAgICAgICAgICAgIGludGVydmFsID0gNTAsXG4gICAgICAgICAgICBkdXJhdGlvbiA9IG1zLFxuICAgICAgICAgICAgZ2FwID0gaW50ZXJ2YWwgLyBkdXJhdGlvbjtcblxuICAgICAgICBsZXQgZmFkaW5nID0gc2V0SW50ZXJ2YWwoKCkgPT4ge1xuICAgICAgICAgICAgb3BhY2l0eSAtPSBnYXA7XG5cbiAgICAgICAgICAgIGlmIChvcGFjaXR5IDw9IDApIHtcbiAgICAgICAgICAgICAgICBvcGFjaXR5ID0gMDtcbiAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGZhZGluZyk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGVsZW1lbnQuc3R5bGUub3BhY2l0eSA9IG9wYWNpdHk7XG4gICAgICAgIH0sIGludGVydmFsKTtcbiAgICB9LFxuXG4gICAgZ2V0VXNlckFnZW50KCkge1xuICAgICAgICByZXR1cm4gbmF2aWdhdG9yLnVzZXJBZ2VudDtcbiAgICB9LFxuXG4gICAgYXBwZW5kQ2hpbGQoZWxlbWVudCwgdGFyZ2V0KSB7XG4gICAgICAgIGlmKHRoaXMuaXNFbGVtZW50KHRhcmdldCkpXG4gICAgICAgICAgICB0YXJn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SB7XG4gICAgICAgICAgICBsZXQgbWF0Y2hlZCA9IHRoaXMucmVzb2x2ZVVzZXJBZ2VudCgpO1xuICAgICAgICAgICAgdGhpcy5icm93c2VyID0ge307XG5cbiAgICAgICAgICAgIGlmIChtYXRjaGVkLmJyb3dzZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmJyb3dzZXJbbWF0Y2hlZC5icm93c2VyXSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdGhpcy5icm93c2VyWyd2ZXJzaW9uJ10gPSBtYXRjaGVkLnZlcnNpb247XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLmJyb3dzZXJbJ2Nocm9tZSddKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5icm93c2VyWyd3ZWJraXQnXSA9IHRydWU7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuYnJvd3Nlclsnd2Via2l0J10pIHtcbiAgICAgICAgICAgICAgICB0aGlzLmJyb3dzZXJbJ3NhZmFyaSddID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLmJyb3dzZXI7XG4gICAgfSxcblxuICAgIHJlc29sdmVVc2VyQWdlbnQoKSB7XG4gICAgICAgIGxldCB1YSA9IG5hdmlnYXRvci51c2VyQWdlbnQudG9Mb3dlckNhc2UoKTtcbiAgICAgICAgbGV0IG1hdGNoID0gLyhjaHJvbWUpWyBdKFtcXHcuXSspLy5leGVjKHVhKSB8fFxuICAgICAgICAgICAgLyh3ZWJraXQpWyBdKFtcXHcuXSspLy5leGVjKHVhKSB8fFxuICAgICAgICAgICAgLyhvcGVyYSkoPzouKnZlcnNpb258KVsgXShbXFx3Ll0rKS8uZXhlYyh1YSkgfHxcbiAgICAgICAgICAgIC8obXNpZSkgKFtcXHcuXSspLy5leGVjKHVhKSB8fFxuICAgICAgICAgICAgKHVhLmluZGV4T2YoXCJjb21wYXRpYmxlXCIpIDwgMCA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ik7XG4gICAgfSxcblxuICAgIGRlZXBFcXVhbHMoYSwgYikge1xuICAgICAgICBpZiAoYSA9PT0gYikgcmV0dXJuIHRydWU7XG5cbiAgICAgICAgaWYgKGEgJiYgYiAmJiB0eXBlb2YgYSA9PSAnb2JqZWN0JyAmJiB0eXBlb2YgYiA9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdmFyIGFyckEgPSBBcnJheS5pc0FycmF5KGEpXG4gICAgICAgICAgICAgICAgLCBhcnJCID0gQXJyYXkuaXNBcnJheShiKVxuICAgICAgICAgICAgICAgICwgaVxuICAgICAgICAgICAgICAgICwgbGVuZ3RoXG4gICAgICAgICAgICAgICAgLCBrZXk7XG5cbiAgICAgICAgICAgIGlmIChhcnJBICYmIGFyckIpIHtcbiAgICAgICAgICAgICAgICBsZW5ndGggPSBhLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAobGVuZ3RoICE9IGIubGVuZ3RoKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gbGVuZ3RoOyBpLS0gIT09IDA7KVxuICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuZGVlcEVxdWFscyhhW2ldLCBiW2ldKSkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoYXJyQSAhPSBhcnJCKSByZXR1cm4gZmFsc2U7XG5cbiAgICAgICAgICAgIHZhciBkYXRlQSA9IGEgaW5zdGFuY2VvZiBEYXRlXG4gICAgICAgICAgICAgICAgLCBkYXRlQiA9IGIgaW5zdGFuY2VvZiBEYXRlO1xuICAgICAgICAgICAgaWYgKGRhdGVBICE9IGRhdGVCKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICBpZiAoZGF0ZUEgJiYgZGF0ZUIpIHJldHVybiBhLmdldFRpbWUoKSA9PSBiLmdldFRpbWUoKTtcblxuICAgICAgICAgICAgdmFyIHJlZ2V4cEEgPSBhIGluc3RhbmNlb2YgUmVnRXhwXG4gICAgICAgICAgICAgICAgLCByZWdleHBCID0gYiBpbnN0YW5jZW9mIFJlZ0V4cDtcbiAgICAgICAgICAgIGlmIChyZWdleHBBICE9IHJlZ2V4cEIpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIGlmIChyZWdleHBBICYmIHJlZ2V4cEIpIHJldHVybiBhLnRvU3RyaW5nKCkgPT0gYi50b1N0cmluZygpO1xuXG4gICAgICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKGEpO1xuICAgICAgICAgICAgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG5cbiAgICAgICAgICAgIGlmIChsZW5ndGggIT09IE9iamVjdC5rZXlzKGIpLmxlbmd0aClcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cbiAgICAgICAgICAgIGZvciAoaSA9IGxlbmd0aDsgaS0tICE9PSAwOylcbiAgICAgICAgICAgICAgICBpZiAoIU9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbChiLCBrZXlzW2ldKSkgcmV0dXJuIGZhbHNlO1xuXG4gICAgICAgICAgICBmb3IgKGkgPSBsZW5ndGg7IGktLSAhPT0gMDspIHtcbiAgICAgICAgICAgICAgICBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIGlmICghdGhpcy5kZWVwRXF1YWxzKGFba2V5XSwgYltrZXldKSkgcmV0dXJuIGZhbHNlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBhICE9PSBhICYmIGIgIT09IGI7XG4gICAgfSxcblxuICAgIHJlc29sdmVGaWVsZERhdGEoZGF0YSwgZmllbGQpIHtcbiAgICAgICAgaWYgKGRhdGEgJiYgT2JqZWN0LmtleXMoZGF0YSkubGVuZ3RoICYmIGZpZWxkKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5pc0Z1bmN0aW9uKGZpZWxkKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmaWVsZChkYXRhKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYoZmllbGQuaW5kZXhPZignLicpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBkYXRhW2ZpZWxkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBmaWVsZHMgPSBmaWVsZC5zcGxpdCgnLicpO1xuICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IGRhdGE7XG4gICAgICAgICAgICAgICAgZm9yKHZhciBpID0gMCwgbGVuID0gZmllbGRzLmxlbmd0aDsgaSA8IGxlbjsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlW2ZpZWxkc1tpXV07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9XG4gICAgfSxcblxuICAgIGlzRnVuY3Rpb24ob2JqKSB7XG4gICAgICAgIHJldHVybiAhIShvYmogJiYgb2JqLmNvbnN0cnVjdG9yICYmIG9iai5jYWxsICYmIG9iai5hcHBseSk7XG4gICAgfSxcblxuICAgIGZpbHRlcih2YWx1ZSwgZmllbGRzLCBmaWx0ZXJWYWx1ZSkge1xuICAgICAgICB2YXIgZmlsdGVyZWRJdGVtcyA9IFtdO1xuXG4gICAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiB2YWx1ZSkge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGZpZWxkIG9mIGZpZWxkcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoU3RyaW5nKHRoaXMucmVzb2x2ZUZpZWxkRGF0YShpdGVtLCBmaWVsZCkpLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihmaWx0ZXJWYWx1ZS50b0xvd2VyQ2FzZSgpKSA+IC0xKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXJlZEl0ZW1zLnB1c2goaXRlbSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmaWx0ZXJlZEl0ZW1zO1xuICAgIH0sXG5cbiAgICByZW9yZGVyQXJyYXkodmFsdWUsIGZyb20sIHRvKSB7XG4gICAgICAgIGxldCB0YXJnZXQ7XG4gICAgICAgIGlmICh2YWx1ZSAmJiAoZnJvbSAhPT0gdG8pKSB7XG4gICAgICAgICAgICBpZiAodG8gPj0gdmFsdWUubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdGFyZ2V0ID0gdG8gLSB2YWx1ZS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgd2hpbGUgKCh0YXJnZXQtLSkgKyAxKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlLnB1c2godW5kZWZpbmVkKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YWx1ZS5zcGxpY2UodG8sIDAsIHZhbHVlLnNwbGljZShmcm9tLCAxKVswXSk7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgZmluZEluZGV4SW5MaXN0KHZhbHVlLCBsaXN0KSB7XG4gICAgICAgIGxldCBpbmRleCA9IC0xO1xuXG4gICAgICAgIGlmIChsaXN0KSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAobGlzdFtpXSA9PT0gdmFsdWUpIHtcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gaW5kZXg7XG4gICAgfSxcblxuICAgIGNvbnRhaW5zKHZhbHVlLCBsaXN0KSB7XG4gICAgICAgIGlmICh2YWx1ZSAhPSBudWxsICYmIGxpc3QgJiYgbGlzdC5sZW5ndGgpIHtcbiAgICAgICAgICAgIGZvciAobGV0IHZhbCBvZiBsaXN0KSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZXF1YWxzKHZhbHVlLCB2YWwpKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9LFxuXG4gICAgaW5zZXJ0SW50b09yZGVyZWRBcnJheShpdGVtLCBpbmRleCwgYXJyLCBzb3VyY2VBcnIpIHtcbiAgICAgICAgaWYgKGFyci5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgaW5qZWN0ZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbnRJdGVtSW5kZXggPSB0aGlzLmZpbmRJbmRleEluTGlzdChhcnJbaV0sIHNvdXJjZUFycik7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRJdGVtSW5kZXggPiBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBhcnIuc3BsaWNlKGksIDAsIGl0ZW0pO1xuICAgICAgICAgICAgICAgICAgICBpbmplY3RlZCA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFpbmplY3RlZCkge1xuICAgICAgICAgICAgICAgIGFyci5wdXNoKGl0ZW0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgYXJyLnB1c2goaXRlbSk7XG4gICAgICAgIH1cbiAgICB9LFxuXG4gICAgcmVtb3ZlQWNjZW50cyhzdHIpIHtcbiAgICAgICAgaWYgKHN0ciAmJiBzdHIuc2VhcmNoKC9bXFx4QzAtXFx4RkZdL2cpID4gLTEpIHtcbiAgICAgICAgICAgIHN0ciA9IHN0clxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEMwLVxceEM1XS9nLCBcIkFcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhDNl0vZywgXCJBRVwiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEM3XS9nLCBcIkNcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhDOC1cXHhDQl0vZywgXCJFXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4Q0MtXFx4Q0ZdL2csIFwiSVwiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEQwXS9nLCBcIkRcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhEMV0vZywgXCJOXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RDItXFx4RDZcXHhEOF0vZywgXCJPXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RDktXFx4RENdL2csIFwiVVwiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEREXS9nLCBcIllcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhERV0vZywgXCJQXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RTAtXFx4RTVdL2csIFwiYVwiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEU2XS9nLCBcImFlXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RTddL2csIFwiY1wiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEU4LVxceEVCXS9nLCBcImVcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhFQy1cXHhFRl0vZywgXCJpXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RjFdL2csIFwiblwiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEYyLVxceEY2XFx4RjhdL2csIFwib1wiKVxuICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvW1xceEY5LVxceEZDXS9nLCBcInVcIilcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1tcXHhGRV0vZywgXCJwXCIpXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9bXFx4RkRcXHhGRl0vZywgXCJ5XCIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHN0cjtcbiAgICB9LFxuXG4gICAgZ2V0Vk5vZGVQcm9wKHZub2RlLCBwcm9wKSB7XG4gICAgICAgIGxldCBwcm9wcyA9IHZub2RlLnByb3BzO1xuICAgICAgICBpZiAocHJvcHMpIHtcbiAgICAgICAgICAgIGxldCBrZWJhcFByb3AgPSBwcm9wLnJlcGxhY2UoLyhbYS16XSkoW0EtWl0pL2csICckMS0kMicpLnRvTG93ZXJDYXNlKCk7XG4gICAgICAgICAgICBsZXQgcHJvcE5hbWUgPSBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwocHJvcHMsIGtlYmFwUHJ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blxuICAgIGNvbnN0IGdldFpJbmRleCA9IChlbCkgPT4ge1xuICAgICAgICByZXR1cm4gZWwgPyBwYXJzZUludChlbC5zdHlsZS56SW5kZXgsIDEwKSB8fCAwIDogMFxuICAgIH07XG5cbiAgICByZXR1cm4ge1xuICAgICAgICBnZXQ6IGdldFpJbmRleCxcbiAgICAgICAgc2V0OiAoa2V5LCBlbCwgYmFzZVpJbmRleCkgPT4ge1xuICAgICAgICAgICAgaWYgKGVsKSB7XG4gICAgICAgICAgICAgICAgZWwuc3R5bGUuekluZGV4ID0gU3RyaW5nKGdlbmVyYXRlWkluZGV4KGtleSwgYmFzZVpJbmRleCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjbGVhcjogKGVsKSA9PiB7XG4gICAgICAgICAgICBpZiAoZWwpIHtcbiAgICAgICAgICAgICAgICByZXZlcnRaSW5kZXgoZ2V0WkluZGV4KGVsKSk7XG4gICAgICAgICAgICAgICAgZWwuc3R5bGUuekluZGV4ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldEN1cnJlbnQ6ICgpID0+IGdldEN1cnJlbnRaSW5kZXgoKVxuICAgIH07XG59XG5cbnZhciBaSW5kZXhVdGlscyA9IGhhbmRsZXIoKTtcblxudmFyIGxhc3RJZCA9IDA7XG5cbmZ1bmN0aW9uIFVuaXF1ZUNvbXBvbmVudElkIChwcmVmaXggPSAncHZfaWRfJykge1xuICAgIGxhc3RJZCsrO1xuICAgIHJldHVybiBgJHtwcmVmaXh9JHtsYXN0SWR9YDtcbn1cblxuZnVuY3Rpb24gcHJpbWVidXMoKSB7XG5cdGNvbnN0IGFsbEhhbmRsZXJzID0gbmV3IE1hcCgpO1xuXG5cdHJldHVybiB7XG5cdFx0b24odHlwZSwgaGFuZGxlcikge1xuXHRcdFx0bGV0IGhhbmRsZXJzID0gYWxsSGFuZGxlcnMuZ2V0KHR5cGUpO1xuICAgICAgICAgICAgaWYgKCFoYW5kbGVycylcbiAgICAgICAgICAgICAgICBoYW5kbGVycyA9IFtoYW5kbGVyXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBoYW5kbGVycy5wdXNoKGhhbmRsZXIpO1xuXG4gICAgICAgICAgICBhbGxIYW5kbGVycy5zZXQodHlwZSwgaGFuZGxlcnMpO1xuXHRcdH0sXG5cblx0XHRvZmYodHlwZSwgaGFuZGxlcikge1xuXHRcdFx0bGV0IGhhbmRsZXJzID0gYWxsSGFuZGxlcnMuZ2V0KHR5cGUpO1xuXHRcdFx0aWYgKGhhbmRsZXJzKSB7XG5cdFx0XHRcdGhhbmRsZXJzLnNwbGljZShoYW5kbGVycy5pbmRleE9mKGhhbmRsZXIpID4+PiAwLCAxKTtcblx0XHRcdH1cblx0XHR9LFxuXG5cdFx0ZW1pdCh0eXBlLCBldnQpIHtcbiAgICAgICAgICAgIGxldCBoYW5kbGVycyA9IGFsbEhhbmRsZXJzLmdldCh0eXBlKTtcbiAgICAgICAgICAgIGlmIChoYW5kbGVycykge1xuICAgICAgICAgICAgICAgIGhhbmRsZXJzLnNsaWNlKCkubWFwKChoYW5kbGVyKSA9PiB7IGhhbmRsZXIoZXZ0KTt9KTtcbiAgICAgICAgICAgIH1cblx0XHR9XG5cdH07XG59XG5cbmV4cG9ydCB7IENvbm5lY3RlZE92ZXJsYXlTY3JvbGxIYW5kbGVyLCBEb21IYW5kbGVyLCBwcmltZWJ1cyBhcyBFdmVudEJ1cywgT2JqZWN0VXRpbHMsIFVuaXF1ZUNvbXBvbmVudElkLCBaSW5kZXhVdGlscyB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///6954\n")},8213:(__unused_webpack_module,exports,__webpack_require__)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = __webpack_require__(2728);\nvar has = Object.prototype.hasOwnProperty;\nvar hasNativeMap = typeof Map !== \"undefined\";\n\n/**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\nfunction ArraySet() {\n this._array = [];\n this._set = hasNativeMap ? new Map() : Object.create(null);\n}\n\n/**\n * Static method for creating ArraySet instances from an existing array.\n */\nArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n};\n\n/**\n * Return how many unique items are in this ArraySet. If duplicates have been\n * added, than those do not count towards the size.\n *\n * @returns Number\n */\nArraySet.prototype.size = function ArraySet_size() {\n return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;\n};\n\n/**\n * Add the given string to this set.\n *\n * @param String aStr\n */\nArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var sStr = hasNativeMap ? aStr : util.toSetString(aStr);\n var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n if (hasNativeMap) {\n this._set.set(aStr, idx);\n } else {\n this._set[sStr] = idx;\n }\n }\n};\n\n/**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\nArraySet.prototype.has = function ArraySet_has(aStr) {\n if (hasNativeMap) {\n return this._set.has(aStr);\n } else {\n var sStr = util.toSetString(aStr);\n return has.call(this._set, sStr);\n }\n};\n\n/**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\nArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (hasNativeMap) {\n var idx = this._set.get(aStr);\n if (idx >= 0) {\n return idx;\n }\n } else {\n var sStr = util.toSetString(aStr);\n if (has.call(this._set, sStr)) {\n return this._set[sStr];\n }\n }\n\n throw new Error('\"' + aStr + '\" is not in the set.');\n};\n\n/**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\nArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n};\n\n/**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\nArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n};\n\nexports.I = ArraySet;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIxMy5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsV0FBVyxtQkFBTyxDQUFDLElBQVE7QUFDM0I7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsdUNBQXVDLFNBQVM7QUFDaEQ7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQU07QUFDTjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ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hSWR4KTtcbn07XG5cbi8qKlxuICogUmV0dXJucyB0aGUgYXJyYXkgcmVwcmVzZW50YXRpb24gb2YgdGhpcyBzZXQgKHdoaWNoIGhhcyB0aGUgcHJvcGVyIGluZGljZXNcbiAqIGluZGljYXRlZCBieSBpbmRleE9mKS4gTm90ZSB0aGF0IHRoaXMgaXMgYSBjb3B5IG9mIHRoZSBpbnRlcm5hbCBhcnJheSB1c2VkXG4gKiBmb3Igc3RvcmluZyB0aGUgbWVtYmVycyBzbyB0aGF0IG5vIG9uZSBjYW4gbWVzcyB3aXRoIGludGVybmFsIHN0YXRlLlxuICovXG5BcnJheVNldC5wcm90b3R5cGUudG9BcnJheSA9IGZ1bmN0aW9uIEFycmF5U2V0X3RvQXJyYXkoKSB7XG4gIHJldHVybiB0aGlzLl9hcnJheS5zbGljZSgpO1xufTtcblxuZXhwb3J0cy5BcnJheVNldCA9IEFycmF5U2V0O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8213\n")},6400:(__unused_webpack_module,exports,__webpack_require__)=>{eval('/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nvar base64 = __webpack_require__(7923);\n\n// A single base 64 digit can contain 6 bits of data. For the base 64 variable\n// length quantities we use in the source map spec, the first bit is the sign,\n// the next four bits are the actual value, and the 6th bit is the\n// continuation bit. The continuation bit tells us whether there are more\n// digits in this value following this digit.\n//\n// Continuation\n// | Sign\n// | |\n// V V\n// 101011\n\nvar VLQ_BASE_SHIFT = 5;\n\n// binary: 100000\nvar VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n// binary: 011111\nvar VLQ_BASE_MASK = VLQ_BASE - 1;\n\n// binary: 100000\nvar VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n/**\n * Converts from a two-complement value to a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\nfunction toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n}\n\n/**\n * Converts to a two-complement value from a value where the sign bit is\n * placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\nfunction fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n}\n\n/**\n * Returns the base 64 VLQ encoded value.\n */\nexports.encode = function base64VLQ_encode(aValue) {\n var encoded = "";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n};\n\n/**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string via the out parameter.\n */\nexports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (aIndex >= strLen) {\n throw new Error("Expected more digits in base 64 VLQ value.");\n }\n\n digit = base64.decode(aStr.charCodeAt(aIndex++));\n if (digit === -1) {\n throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));\n }\n\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n aOutParam.value = fromVLQSigned(result);\n aOutParam.rest = aIndex;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQwMC5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNB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hcmFtLnJlc3QgPSBhSW5kZXg7XG59O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///6400\n')},7923:(__unused_webpack_module,exports)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');\n\n/**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\nexports.encode = function (number) {\n if (0 <= number && number < intToCharMap.length) {\n return intToCharMap[number];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + number);\n};\n\n/**\n * Decode a single base 64 character code digit to an integer. Returns -1 on\n * failure.\n */\nexports.decode = function (charCode) {\n var bigA = 65; // 'A'\n var bigZ = 90; // 'Z'\n\n var littleA = 97; // 'a'\n var littleZ = 122; // 'z'\n\n var zero = 48; // '0'\n var nine = 57; // '9'\n\n var plus = 43; // '+'\n var slash = 47; // '/'\n\n var littleOffset = 26;\n var numberOffset = 52;\n\n // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ\n if (bigA <= charCode && charCode <= bigZ) {\n return (charCode - bigA);\n }\n\n // 26 - 51: abcdefghijklmnopqrstuvwxyz\n if (littleA <= charCode && charCode <= littleZ) {\n return (charCode - littleA + littleOffset);\n }\n\n // 52 - 61: 0123456789\n if (zero <= charCode && charCode <= nine) {\n return (charCode - zero + numberOffset);\n }\n\n // 62: +\n if (charCode == plus) {\n return 62;\n }\n\n // 63: /\n if (charCode == slash) {\n return 63;\n }\n\n // Invalid base64 digit.\n return -1;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkyMy5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFB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XJDb2RlIC0gYmlnQSk7XG4gIH1cblxuICAvLyAyNiAtIDUxOiBhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5elxuICBpZiAobGl0dGxlQSA8PSBjaGFyQ29kZSAmJiBjaGFyQ29kZSA8PSBsaXR0bGVaKSB7XG4gICAgcmV0dXJuIChjaGFyQ29kZSAtIGxpdHRsZUEgKyBsaXR0bGVPZmZzZXQpO1xuICB9XG5cbiAgLy8gNTIgLSA2MTogMDEyMzQ1Njc4OVxuICBpZiAoemVybyA8PSBjaGFyQ29kZSAmJiBjaGFyQ29kZSA8PSBuaW5lKSB7XG4gICAgcmV0dXJuIChjaGFyQ29kZSAtIHplcm8gKyBudW1iZXJPZmZzZXQpO1xuICB9XG5cbiAgLy8gNjI6ICtcbiAgaWYgKGNoYXJDb2RlID09IHBsdXMpIHtcbiAgICByZXR1cm4gNjI7XG4gIH1cblxuICAvLyA2MzogL1xuICBpZiAoY2hhckNvZGUgPT0gc2xhc2gpIHtcbiAgICByZXR1cm4gNjM7XG4gIH1cblxuICAvLyBJbnZhbGlkIGJhc2U2NCBkaWdpdC5cbiAgcmV0dXJuIC0xO1xufTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7923\n")},9216:(__unused_webpack_module,exports)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nexports.GREATEST_LOWER_BOUND = 1;\nexports.LEAST_UPPER_BOUND = 2;\n\n/**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n */\nfunction recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the index of\n // the next-closest element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element than the one we are searching for, so we return -1.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return mid;\n }\n else if (cmp > 0) {\n // Our needle is greater than aHaystack[mid].\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return aHigh < aHaystack.length ? aHigh : -1;\n } else {\n return mid;\n }\n }\n else {\n // Our needle is less than aHaystack[mid].\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);\n }\n\n // we are in termination case (3) or (2) and return the appropriate thing.\n if (aBias == exports.LEAST_UPPER_BOUND) {\n return mid;\n } else {\n return aLow < 0 ? -1 : aLow;\n }\n }\n}\n\n/**\n * This is an implementation of binary search which will always try and return\n * the index of the closest element if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or\n * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.\n */\nexports.search = function search(aNeedle, aHaystack, aCompare, aBias) {\n if (aHaystack.length === 0) {\n return -1;\n }\n\n var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,\n aCompare, aBias || exports.GREATEST_LOWER_BOUND);\n if (index < 0) {\n return -1;\n }\n\n // We have found either the exact element, or the next-closest element than\n // the one we are searching for. However, there may be more than one such\n // element. Make sure we always return the smallest of these.\n while (index - 1 >= 0) {\n if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {\n break;\n }\n --index;\n }\n\n return index;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIxNi5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsNEJBQTRCO0FBQzVCLHlCQUF5Qjs7QUFFekI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLE1BQU07QUFDTjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFD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AwKSB7XG4gICAgcmV0dXJuIC0xO1xuICB9XG5cbiAgdmFyIGluZGV4ID0gcmVjdXJzaXZlU2VhcmNoKC0xLCBhSGF5c3RhY2subGVuZ3RoLCBhTmVlZGxlLCBhSGF5c3RhY2ssXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhQ29tcGFyZSwgYUJpYXMgfHwgZXhwb3J0cy5HUkVBVEVTVF9MT1dFUl9CT1VORCk7XG4gIGlmIChpbmRleCA8IDApIHtcbiAgICByZXR1cm4gLTE7XG4gIH1cblxuICAvLyBXZSBoYXZlIGZvdW5kIGVpdGhlciB0aGUgZXhhY3QgZWxlbWVudCwgb3IgdGhlIG5leHQtY2xvc2VzdCBlbGVtZW50IHRoYW5cbiAgLy8gdGhlIG9uZSB3ZSBhcmUgc2VhcmNoaW5nIGZvci4gSG93ZXZlciwgdGhlcmUgbWF5IGJlIG1vcmUgdGhhbiBvbmUgc3VjaFxuICAvLyBlbGVtZW50LiBNYWtlIHN1cmUgd2UgYWx3YXlzIHJldHVybiB0aGUgc21hbGxlc3Qgb2YgdGhlc2UuXG4gIHdoaWxlIChpbmRleCAtIDEgPj0gMCkge1xuICAgIGlmIChhQ29tcGFyZShhSGF5c3RhY2tbaW5kZXhdLCBhSGF5c3RhY2tbaW5kZXggLSAxXSwgdHJ1ZSkgIT09IDApIHtcbiAgICAgIGJyZWFrO1xuICAgIH1cbiAgICAtLWluZGV4O1xuICB9XG5cbiAgcmV0dXJuIGluZGV4O1xufTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///9216\n")},1188:(__unused_webpack_module,exports,__webpack_require__)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2014 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = __webpack_require__(2728);\n\n/**\n * Determine whether mappingB is after mappingA with respect to generated\n * position.\n */\nfunction generatedPositionAfter(mappingA, mappingB) {\n // Optimized for most common case\n var lineA = mappingA.generatedLine;\n var lineB = mappingB.generatedLine;\n var columnA = mappingA.generatedColumn;\n var columnB = mappingB.generatedColumn;\n return lineB > lineA || lineB == lineA && columnB >= columnA ||\n util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;\n}\n\n/**\n * A data structure to provide a sorted view of accumulated mappings in a\n * performance conscious manner. It trades a neglibable overhead in general\n * case for a large speedup in case of mappings being added in order.\n */\nfunction MappingList() {\n this._array = [];\n this._sorted = true;\n // Serves as infimum\n this._last = {generatedLine: -1, generatedColumn: 0};\n}\n\n/**\n * Iterate through internal items. This method takes the same arguments that\n * `Array.prototype.forEach` takes.\n *\n * NOTE: The order of the mappings is NOT guaranteed.\n */\nMappingList.prototype.unsortedForEach =\n function MappingList_forEach(aCallback, aThisArg) {\n this._array.forEach(aCallback, aThisArg);\n };\n\n/**\n * Add the given source mapping.\n *\n * @param Object aMapping\n */\nMappingList.prototype.add = function MappingList_add(aMapping) {\n if (generatedPositionAfter(this._last, aMapping)) {\n this._last = aMapping;\n this._array.push(aMapping);\n } else {\n this._sorted = false;\n this._array.push(aMapping);\n }\n};\n\n/**\n * Returns the flat, sorted array of mappings. The mappings are sorted by\n * generated position.\n *\n * WARNING: This method returns internal data without copying, for\n * performance. The return value must NOT be mutated, and should be treated as\n * an immutable borrow. If you want to take ownership, you must make your own\n * copy.\n */\nMappingList.prototype.toArray = function MappingList_toArray() {\n if (!this._sorted) {\n this._array.sort(util.compareByGeneratedPositionsInflated);\n this._sorted = true;\n }\n return this._array;\n};\n\nexports.H = MappingList;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE4OC5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsV0FBVyxtQkFBTy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AqIGdlbmVyYXRlZCBwb3NpdGlvbi5cbiAqXG4gKiBXQVJOSU5HOiBUaGlzIG1ldGhvZCByZXR1cm5zIGludGVybmFsIGRhdGEgd2l0aG91dCBjb3B5aW5nLCBmb3JcbiAqIHBlcmZvcm1hbmNlLiBUaGUgcmV0dXJuIHZhbHVlIG11c3QgTk9UIGJlIG11dGF0ZWQsIGFuZCBzaG91bGQgYmUgdHJlYXRlZCBhc1xuICogYW4gaW1tdXRhYmxlIGJvcnJvdy4gSWYgeW91IHdhbnQgdG8gdGFrZSBvd25lcnNoaXAsIHlvdSBtdXN0IG1ha2UgeW91ciBvd25cbiAqIGNvcHkuXG4gKi9cbk1hcHBpbmdMaXN0LnByb3RvdHlwZS50b0FycmF5ID0gZnVuY3Rpb24gTWFwcGluZ0xpc3RfdG9BcnJheSgpIHtcbiAgaWYgKCF0aGlzLl9zb3J0ZWQpIHtcbiAgICB0aGlzLl9hcnJheS5zb3J0KHV0aWwuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zSW5mbGF0ZWQpO1xuICAgIHRoaXMuX3NvcnRlZCA9IHRydWU7XG4gIH1cbiAgcmV0dXJuIHRoaXMuX2FycmF5O1xufTtcblxuZXhwb3J0cy5NYXBwaW5nTGlzdCA9IE1hcHBpbmdMaXN0O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1188\n")},2826:(__unused_webpack_module,exports)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n// It turns out that some (most?) JavaScript engines don't self-host\n// `Array.prototype.sort`. This makes sense because C++ will likely remain\n// faster than JS when doing raw CPU-intensive sorting. However, when using a\n// custom comparator function, calling back and forth between the VM's C++ and\n// JIT'd JS is rather slow *and* loses JIT type information, resulting in\n// worse generated code for the comparator function than would be optimal. In\n// fact, when sorting with a comparator, these costs outweigh the benefits of\n// sorting in C++. By using our own JS-implemented Quick Sort (below), we get\n// a ~3500ms mean speed-up in `bench/bench.html`.\n\n/**\n * Swap the elements indexed by `x` and `y` in the array `ary`.\n *\n * @param {Array} ary\n * The array.\n * @param {Number} x\n * The index of the first item.\n * @param {Number} y\n * The index of the second item.\n */\nfunction swap(ary, x, y) {\n var temp = ary[x];\n ary[x] = ary[y];\n ary[y] = temp;\n}\n\n/**\n * Returns a random integer within the range `low .. high` inclusive.\n *\n * @param {Number} low\n * The lower bound on the range.\n * @param {Number} high\n * The upper bound on the range.\n */\nfunction randomIntInRange(low, high) {\n return Math.round(low + (Math.random() * (high - low)));\n}\n\n/**\n * The Quick Sort algorithm.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n * @param {Number} p\n * Start index of the array\n * @param {Number} r\n * End index of the array\n */\nfunction doQuickSort(ary, comparator, p, r) {\n // If our lower bound is less than our upper bound, we (1) partition the\n // array into two pieces and (2) recurse on each half. If it is not, this is\n // the empty array and our base case.\n\n if (p < r) {\n // (1) Partitioning.\n //\n // The partitioning chooses a pivot between `p` and `r` and moves all\n // elements that are less than or equal to the pivot to the before it, and\n // all the elements that are greater than it after it. The effect is that\n // once partition is done, the pivot is in the exact place it will be when\n // the array is put in sorted order, and it will not need to be moved\n // again. This runs in O(n) time.\n\n // Always choose a random pivot so that an input array which is reverse\n // sorted does not cause O(n^2) running time.\n var pivotIndex = randomIntInRange(p, r);\n var i = p - 1;\n\n swap(ary, pivotIndex, r);\n var pivot = ary[r];\n\n // Immediately after `j` is incremented in this loop, the following hold\n // true:\n //\n // * Every element in `ary[p .. i]` is less than or equal to the pivot.\n //\n // * Every element in `ary[i+1 .. j-1]` is greater than the pivot.\n for (var j = p; j < r; j++) {\n if (comparator(ary[j], pivot) <= 0) {\n i += 1;\n swap(ary, i, j);\n }\n }\n\n swap(ary, i + 1, j);\n var q = i + 1;\n\n // (2) Recurse on each half.\n\n doQuickSort(ary, comparator, p, q - 1);\n doQuickSort(ary, comparator, q + 1, r);\n }\n}\n\n/**\n * Sort the given array in-place with the given comparator function.\n *\n * @param {Array} ary\n * An array to sort.\n * @param {function} comparator\n * Function to use to compare two items.\n */\nexports.U = function (ary, comparator) {\n doQuickSort(ary, comparator, 0, ary.length - 1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgyNi5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBLFdBQVcsT0FBTztBQUNsQjtBQUNBLFdBQVcsUUFBUTtBQUNuQjtBQUNBLFdBQVcsUUFBUTtBQUNuQjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxXQUFXLE9BQU87QUFDbEI7QUFDQSxXQUFXLFVBQVU7QUFDckI7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQSxXQUFXLFFBQVE7QUFDbkI7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLG9CQUFvQixPQUFPO0FBQzNCO0FBQ0E7QUFDQTtBQUNBO0F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W4gb3IgZXF1YWwgdG8gdGhlIHBpdm90LlxuICAgIC8vXG4gICAgLy8gICAqIEV2ZXJ5IGVsZW1lbnQgaW4gYGFyeVtpKzEgLi4gai0xXWAgaXMgZ3JlYXRlciB0aGFuIHRoZSBwaXZvdC5cbiAgICBmb3IgKHZhciBqID0gcDsgaiA8IHI7IGorKykge1xuICAgICAgaWYgKGNvbXBhcmF0b3IoYXJ5W2pdLCBwaXZvdCkgPD0gMCkge1xuICAgICAgICBpICs9IDE7XG4gICAgICAgIHN3YXAoYXJ5LCBpLCBqKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2FwKGFyeSwgaSArIDEsIGopO1xuICAgIHZhciBxID0gaSArIDE7XG5cbiAgICAvLyAoMikgUmVjdXJzZSBvbiBlYWNoIGhhbGYuXG5cbiAgICBkb1F1aWNrU29ydChhcnksIGNvbXBhcmF0b3IsIHAsIHEgLSAxKTtcbiAgICBkb1F1aWNrU29ydChhcnksIGNvbXBhcmF0b3IsIHEgKyAxLCByKTtcbiAgfVxufVxuXG4vKipcbiAqIFNvcnQgdGhlIGdpdmVuIGFycmF5IGluLXBsYWNlIHdpdGggdGhlIGdpdmVuIGNvbXBhcmF0b3IgZnVuY3Rpb24uXG4gKlxuICogQHBhcmFtIHtBcnJheX0gYXJ5XG4gKiAgICAgICAgQW4gYXJyYXkgdG8gc29ydC5cbiAqIEBwYXJhbSB7ZnVuY3Rpb259IGNvbXBhcmF0b3JcbiAqICAgICAgICBGdW5jdGlvbiB0byB1c2UgdG8gY29tcGFyZSB0d28gaXRlbXMuXG4gKi9cbmV4cG9ydHMucXVpY2tTb3J0ID0gZnVuY3Rpb24gKGFyeSwgY29tcGFyYXRvcikge1xuICBkb1F1aWNrU29ydChhcnksIGNvbXBhcmF0b3IsIDAsIGFyeS5sZW5ndGggLSAxKTtcbn07XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2826\n")},6771:(__unused_webpack_module,exports,__webpack_require__)=>{eval("var __webpack_unused_export__;\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar util = __webpack_require__(2728);\nvar binarySearch = __webpack_require__(9216);\nvar ArraySet = (__webpack_require__(8213)/* .ArraySet */ .I);\nvar base64VLQ = __webpack_require__(6400);\nvar quickSort = (__webpack_require__(2826)/* .quickSort */ .U);\n\nfunction SourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n return sourceMap.sections != null\n ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)\n : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);\n}\n\nSourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {\n return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);\n}\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nSourceMapConsumer.prototype._version = 3;\n\n// `__generatedMappings` and `__originalMappings` are arrays that hold the\n// parsed mapping coordinates from the source map's \"mappings\" attribute. They\n// are lazily instantiated, accessed via the `_generatedMappings` and\n// `_originalMappings` getters respectively, and we only parse the mappings\n// and create these arrays once queried for a source location. We jump through\n// these hoops because there can be many thousands of mappings, and parsing\n// them is expensive, so we only want to do it if we must.\n//\n// Each object in the arrays is of the form:\n//\n// {\n// generatedLine: The line number in the generated code,\n// generatedColumn: The column number in the generated code,\n// source: The path to the original source file that generated this\n// chunk of code,\n// originalLine: The line number in the original source that\n// corresponds to this chunk of generated code,\n// originalColumn: The column number in the original source that\n// corresponds to this chunk of generated code,\n// name: The name of the original symbol which generated this chunk of\n// code.\n// }\n//\n// All properties except for `generatedLine` and `generatedColumn` can be\n// `null`.\n//\n// `_generatedMappings` is ordered by the generated positions.\n//\n// `_originalMappings` is ordered by the original positions.\n\nSourceMapConsumer.prototype.__generatedMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__generatedMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n});\n\nSourceMapConsumer.prototype.__originalMappings = null;\nObject.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n configurable: true,\n enumerable: true,\n get: function () {\n if (!this.__originalMappings) {\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n});\n\nSourceMapConsumer.prototype._charIsMappingSeparator =\n function SourceMapConsumer_charIsMappingSeparator(aStr, index) {\n var c = aStr.charAt(index);\n return c === \";\" || c === \",\";\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n };\n\nSourceMapConsumer.GENERATED_ORDER = 1;\nSourceMapConsumer.ORIGINAL_ORDER = 2;\n\nSourceMapConsumer.GREATEST_LOWER_BOUND = 1;\nSourceMapConsumer.LEAST_UPPER_BOUND = 2;\n\n/**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\nSourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source === null ? null : this._sources.at(mapping.source);\n source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name === null ? null : this._names.at(mapping.name)\n };\n }, this).forEach(aCallback, context);\n };\n\n/**\n * Returns all generated line and column information for the original source,\n * line, and column provided. If no column is provided, returns all mappings\n * corresponding to a either the line we are searching for or the next\n * closest line that has any mappings. Otherwise, returns all mappings\n * corresponding to the given line and either the column we are searching for\n * or the next closest column that has any offsets.\n *\n * The only argument is an object with the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number is 1-based.\n * - column: Optional. the column number in the original source.\n * The column number is 0-based.\n *\n * and an array of objects is returned, each with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nSourceMapConsumer.prototype.allGeneratedPositionsFor =\n function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {\n var line = util.getArg(aArgs, 'line');\n\n // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping\n // returns the index of the closest mapping less than the needle. By\n // setting needle.originalColumn to 0, we thus find the last mapping for\n // the given line, provided such a mapping exists.\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: line,\n originalColumn: util.getArg(aArgs, 'column', 0)\n };\n\n needle.source = this._findSourceIndex(needle.source);\n if (needle.source < 0) {\n return [];\n }\n\n var mappings = [];\n\n var index = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n binarySearch.LEAST_UPPER_BOUND);\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (aArgs.column === undefined) {\n var originalLine = mapping.originalLine;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we found. Since\n // mappings are sorted, this is guaranteed to find all mappings for\n // the line we found.\n while (mapping && mapping.originalLine === originalLine) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n } else {\n var originalColumn = mapping.originalColumn;\n\n // Iterate until either we run out of mappings, or we run into\n // a mapping for a different line than the one we were searching for.\n // Since mappings are sorted, this is guaranteed to find all mappings for\n // the line we are searching for.\n while (mapping &&\n mapping.originalLine === line &&\n mapping.originalColumn == originalColumn) {\n mappings.push({\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n });\n\n mapping = this._originalMappings[++index];\n }\n }\n }\n\n return mappings;\n };\n\nexports.SourceMapConsumer = SourceMapConsumer;\n\n/**\n * A BasicSourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The first parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\nfunction BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n if (sourceRoot) {\n sourceRoot = util.normalize(sourceRoot);\n }\n\n sources = sources\n .map(String)\n // Some source maps produce relative source paths like \"./foo.js\" instead of\n // \"foo.js\". Normalize these first so that future comparisons will succeed.\n // See bugzil.la/1090768.\n .map(util.normalize)\n // Always ensure that absolute sources are internally stored relative to\n // the source root, if the source root is absolute. Not doing this would\n // be particularly problematic when the source root is a prefix of the\n // source (valid, but why??). See github issue #199 and bugzil.la/1188982.\n .map(function (source) {\n return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)\n ? util.relative(sourceRoot, source)\n : source;\n });\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names.map(String), true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this._absoluteSources = this._sources.toArray().map(function (s) {\n return util.computeSourceURL(sourceRoot, s, aSourceMapURL);\n });\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this._sourceMapURL = aSourceMapURL;\n this.file = file;\n}\n\nBasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nBasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;\n\n/**\n * Utility function to find the index of a source. Returns -1 if not\n * found.\n */\nBasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n if (this._sources.has(relativeSource)) {\n return this._sources.indexOf(relativeSource);\n }\n\n // Maybe aSource is an absolute URL as returned by |sources|. In\n // this case we can't simply undo the transform.\n var i;\n for (i = 0; i < this._absoluteSources.length; ++i) {\n if (this._absoluteSources[i] == aSource) {\n return i;\n }\n }\n\n return -1;\n};\n\n/**\n * Create a BasicSourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @param String aSourceMapURL\n * The URL at which the source map can be found (optional)\n * @returns BasicSourceMapConsumer\n */\nBasicSourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {\n var smc = Object.create(BasicSourceMapConsumer.prototype);\n\n var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n smc._sourceMapURL = aSourceMapURL;\n smc._absoluteSources = smc._sources.toArray().map(function (s) {\n return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);\n });\n\n // Because we are modifying the entries (by converting string sources and\n // names to indices into the sources and names ArraySets), we have to make\n // a copy of the entry or else bad things happen. Shared mutable state\n // strikes again! See github issue #191.\n\n var generatedMappings = aSourceMap._mappings.toArray().slice();\n var destGeneratedMappings = smc.__generatedMappings = [];\n var destOriginalMappings = smc.__originalMappings = [];\n\n for (var i = 0, length = generatedMappings.length; i < length; i++) {\n var srcMapping = generatedMappings[i];\n var destMapping = new Mapping;\n destMapping.generatedLine = srcMapping.generatedLine;\n destMapping.generatedColumn = srcMapping.generatedColumn;\n\n if (srcMapping.source) {\n destMapping.source = sources.indexOf(srcMapping.source);\n destMapping.originalLine = srcMapping.originalLine;\n destMapping.originalColumn = srcMapping.originalColumn;\n\n if (srcMapping.name) {\n destMapping.name = names.indexOf(srcMapping.name);\n }\n\n destOriginalMappings.push(destMapping);\n }\n\n destGeneratedMappings.push(destMapping);\n }\n\n quickSort(smc.__originalMappings, util.compareByOriginalPositions);\n\n return smc;\n };\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nBasicSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._absoluteSources.slice();\n }\n});\n\n/**\n * Provide the JIT with a nice shape / hidden class.\n */\nfunction Mapping() {\n this.generatedLine = 0;\n this.generatedColumn = 0;\n this.source = null;\n this.originalLine = null;\n this.originalColumn = null;\n this.name = null;\n}\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nBasicSourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var length = aStr.length;\n var index = 0;\n var cachedSegments = {};\n var temp = {};\n var originalMappings = [];\n var generatedMappings = [];\n var mapping, str, segment, end, value;\n\n while (index < length) {\n if (aStr.charAt(index) === ';') {\n generatedLine++;\n index++;\n previousGeneratedColumn = 0;\n }\n else if (aStr.charAt(index) === ',') {\n index++;\n }\n else {\n mapping = new Mapping();\n mapping.generatedLine = generatedLine;\n\n // Because each offset is encoded relative to the previous one,\n // many segments often have the same encoding. We can exploit this\n // fact by caching the parsed variable length fields of each segment,\n // allowing us to avoid a second parse if we encounter the same\n // segment again.\n for (end = index; end < length; end++) {\n if (this._charIsMappingSeparator(aStr, end)) {\n break;\n }\n }\n str = aStr.slice(index, end);\n\n segment = cachedSegments[str];\n if (segment) {\n index += str.length;\n } else {\n segment = [];\n while (index < end) {\n base64VLQ.decode(aStr, index, temp);\n value = temp.value;\n index = temp.rest;\n segment.push(value);\n }\n\n if (segment.length === 2) {\n throw new Error('Found a source, but no line and column');\n }\n\n if (segment.length === 3) {\n throw new Error('Found a source and line, but no column');\n }\n\n cachedSegments[str] = segment;\n }\n\n // Generated column.\n mapping.generatedColumn = previousGeneratedColumn + segment[0];\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (segment.length > 1) {\n // Original source.\n mapping.source = previousSource + segment[1];\n previousSource += segment[1];\n\n // Original line.\n mapping.originalLine = previousOriginalLine + segment[2];\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n\n // Original column.\n mapping.originalColumn = previousOriginalColumn + segment[3];\n previousOriginalColumn = mapping.originalColumn;\n\n if (segment.length > 4) {\n // Original name.\n mapping.name = previousName + segment[4];\n previousName += segment[4];\n }\n }\n\n generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n originalMappings.push(mapping);\n }\n }\n }\n\n quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);\n this.__generatedMappings = generatedMappings;\n\n quickSort(originalMappings, util.compareByOriginalPositions);\n this.__originalMappings = originalMappings;\n };\n\n/**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\nBasicSourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator, aBias) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator, aBias);\n };\n\n/**\n * Compute the last column for each generated mapping. The last column is\n * inclusive.\n */\nBasicSourceMapConsumer.prototype.computeColumnSpans =\n function SourceMapConsumer_computeColumnSpans() {\n for (var index = 0; index < this._generatedMappings.length; ++index) {\n var mapping = this._generatedMappings[index];\n\n // Mappings do not contain a field for the last generated columnt. We\n // can come up with an optimistic estimate, however, by assuming that\n // mappings are contiguous (i.e. given two consecutive mappings, the\n // first mapping ends where the second one starts).\n if (index + 1 < this._generatedMappings.length) {\n var nextMapping = this._generatedMappings[index + 1];\n\n if (mapping.generatedLine === nextMapping.generatedLine) {\n mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;\n continue;\n }\n }\n\n // The last mapping for each line spans the entire line.\n mapping.lastGeneratedColumn = Infinity;\n }\n };\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nBasicSourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositionsDeflated,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._generatedMappings[index];\n\n if (mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source !== null) {\n source = this._sources.at(source);\n source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);\n }\n var name = util.getArg(mapping, 'name', null);\n if (name !== null) {\n name = this._names.at(name);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: name\n };\n }\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nBasicSourceMapConsumer.prototype.hasContentsOfAllSources =\n function BasicSourceMapConsumer_hasContentsOfAllSources() {\n if (!this.sourcesContent) {\n return false;\n }\n return this.sourcesContent.length >= this._sources.size() &&\n !this.sourcesContent.some(function (sc) { return sc == null; });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nBasicSourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n if (!this.sourcesContent) {\n return null;\n }\n\n var index = this._findSourceIndex(aSource);\n if (index >= 0) {\n return this.sourcesContent[index];\n }\n\n var relativeSource = aSource;\n if (this.sourceRoot != null) {\n relativeSource = util.relative(this.sourceRoot, relativeSource);\n }\n\n var url;\n if (this.sourceRoot != null\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = relativeSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + relativeSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + relativeSource)];\n }\n }\n\n // This function is used recursively from\n // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we\n // don't want to throw if we can't find the source - we just want to\n // return null, so we provide a flag to exit gracefully.\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + relativeSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n * closest element that is smaller than or greater than the one we are\n * searching for, respectively, if the exact element cannot be found.\n * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based.\n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nBasicSourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var source = util.getArg(aArgs, 'source');\n source = this._findSourceIndex(source);\n if (source < 0) {\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }\n\n var needle = {\n source: source,\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n var index = this._findMapping(\n needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions,\n util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)\n );\n\n if (index >= 0) {\n var mapping = this._originalMappings[index];\n\n if (mapping.source === needle.source) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null),\n lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)\n };\n }\n }\n\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n };\n\n__webpack_unused_export__ = BasicSourceMapConsumer;\n\n/**\n * An IndexedSourceMapConsumer instance represents a parsed source map which\n * we can query for information. It differs from BasicSourceMapConsumer in\n * that it takes \"indexed\" source maps (i.e. ones with a \"sections\" field) as\n * input.\n *\n * The first parameter is a raw source map (either as a JSON string, or already\n * parsed to an object). According to the spec for indexed source maps, they\n * have the following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - file: Optional. The generated file this source map is associated with.\n * - sections: A list of section definitions.\n *\n * Each value under the \"sections\" field has two fields:\n * - offset: The offset into the original specified at which this section\n * begins to apply, defined as an object with a \"line\" and \"column\"\n * field.\n * - map: A source map definition. This source map could also be indexed,\n * but doesn't have to be.\n *\n * Instead of the \"map\" field, it's also possible to have a \"url\" field\n * specifying a URL to retrieve a source map from, but that's currently\n * unsupported.\n *\n * Here's an example source map, taken from the source map spec[0], but\n * modified to omit a section which uses the \"url\" field.\n *\n * {\n * version : 3,\n * file: \"app.js\",\n * sections: [{\n * offset: {line:100, column:10},\n * map: {\n * version : 3,\n * file: \"section.js\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AAAA,E;;ABCDE;\"\n * }\n * }],\n * }\n *\n * The second parameter, if given, is a string whose value is the URL\n * at which the source map was found. This URL is used to compute the\n * sources array.\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt\n */\nfunction IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = util.parseSourceMapInput(aSourceMap);\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sections = util.getArg(sourceMap, 'sections');\n\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n this._sources = new ArraySet();\n this._names = new ArraySet();\n\n var lastOffset = {\n line: -1,\n column: 0\n };\n this._sections = sections.map(function (s) {\n if (s.url) {\n // The url field will require support for asynchronicity.\n // See https://github.com/mozilla/source-map/issues/16\n throw new Error('Support for url field in sections not implemented.');\n }\n var offset = util.getArg(s, 'offset');\n var offsetLine = util.getArg(offset, 'line');\n var offsetColumn = util.getArg(offset, 'column');\n\n if (offsetLine < lastOffset.line ||\n (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {\n throw new Error('Section offsets must be ordered and non-overlapping.');\n }\n lastOffset = offset;\n\n return {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: offsetLine + 1,\n generatedColumn: offsetColumn + 1\n },\n consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)\n }\n });\n}\n\nIndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);\nIndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;\n\n/**\n * The version of the source mapping spec that we are consuming.\n */\nIndexedSourceMapConsumer.prototype._version = 3;\n\n/**\n * The list of original sources.\n */\nObject.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {\n get: function () {\n var sources = [];\n for (var i = 0; i < this._sections.length; i++) {\n for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {\n sources.push(this._sections[i].consumer.sources[j]);\n }\n }\n return sources;\n }\n});\n\n/**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source. The line number\n * is 1-based.\n * - column: The column number in the generated source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null. The\n * line number is 1-based.\n * - column: The column number in the original source, or null. The\n * column number is 0-based.\n * - name: The original identifier, or null.\n */\nIndexedSourceMapConsumer.prototype.originalPositionFor =\n function IndexedSourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n // Find the section containing the generated position we're trying to map\n // to an original position.\n var sectionIndex = binarySearch.search(needle, this._sections,\n function(needle, section) {\n var cmp = needle.generatedLine - section.generatedOffset.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return (needle.generatedColumn -\n section.generatedOffset.generatedColumn);\n });\n var section = this._sections[sectionIndex];\n\n if (!section) {\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }\n\n return section.consumer.originalPositionFor({\n line: needle.generatedLine -\n (section.generatedOffset.generatedLine - 1),\n column: needle.generatedColumn -\n (section.generatedOffset.generatedLine === needle.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n bias: aArgs.bias\n });\n };\n\n/**\n * Return true if we have the source content for every source in the source\n * map, false otherwise.\n */\nIndexedSourceMapConsumer.prototype.hasContentsOfAllSources =\n function IndexedSourceMapConsumer_hasContentsOfAllSources() {\n return this._sections.every(function (s) {\n return s.consumer.hasContentsOfAllSources();\n });\n };\n\n/**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * available.\n */\nIndexedSourceMapConsumer.prototype.sourceContentFor =\n function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n var content = section.consumer.sourceContentFor(aSource, true);\n if (content) {\n return content;\n }\n }\n if (nullOnMissing) {\n return null;\n }\n else {\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n }\n };\n\n/**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source. The line number\n * is 1-based.\n * - column: The column number in the original source. The column\n * number is 0-based.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null. The\n * line number is 1-based. \n * - column: The column number in the generated source, or null.\n * The column number is 0-based.\n */\nIndexedSourceMapConsumer.prototype.generatedPositionFor =\n function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n\n // Only consider this section if the requested source is in the list of\n // sources of the consumer.\n if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {\n continue;\n }\n var generatedPosition = section.consumer.generatedPositionFor(aArgs);\n if (generatedPosition) {\n var ret = {\n line: generatedPosition.line +\n (section.generatedOffset.generatedLine - 1),\n column: generatedPosition.column +\n (section.generatedOffset.generatedLine === generatedPosition.line\n ? section.generatedOffset.generatedColumn - 1\n : 0)\n };\n return ret;\n }\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n/**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\nIndexedSourceMapConsumer.prototype._parseMappings =\n function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n for (var i = 0; i < this._sections.length; i++) {\n var section = this._sections[i];\n var sectionMappings = section.consumer._generatedMappings;\n for (var j = 0; j < sectionMappings.length; j++) {\n var mapping = sectionMappings[j];\n\n var source = section.consumer._sources.at(mapping.source);\n source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);\n this._sources.add(source);\n source = this._sources.indexOf(source);\n\n var name = null;\n if (mapping.name) {\n name = section.consumer._names.at(mapping.name);\n this._names.add(name);\n name = this._names.indexOf(name);\n }\n\n // The mappings coming from the consumer for the section have\n // generated positions relative to the start of the section, so we\n // need to offset them to be relative to the start of the concatenated\n // generated file.\n var adjustedMapping = {\n source: source,\n generatedLine: mapping.generatedLine +\n (section.generatedOffset.generatedLine - 1),\n generatedColumn: mapping.generatedColumn +\n (section.generatedOffset.generatedLine === mapping.generatedLine\n ? section.generatedOffset.generatedColumn - 1\n : 0),\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: name\n };\n\n this.__generatedMappings.push(adjustedMapping);\n if (typeof adjustedMapping.originalLine === 'number') {\n this.__originalMappings.push(adjustedMapping);\n }\n }\n }\n\n quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);\n quickSort(this.__originalMappings, util.compareByOriginalPositions);\n };\n\n__webpack_unused_export__ = IndexedSourceMapConsumer;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjc3MS5qcyIsIm1hcHBpbmdzIjoiO0FBQUEsaUJBQWlCLG9CQUFvQjtBQUNyQztBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLFdBQVcsbUJBQU8sQ0FBQyxJQUFRO0FBQzNCLG1CQUFtQixtQkFBTyxDQUFDLElBQWlCO0FBQzVDLGVBQWUsNkNBQStCO0FBQzlDLGdCQUFnQixtQkFBTyxDQUFDLElBQWM7QUFDdEMsZ0JBQWdCLDhDQUFpQzs7QUFFakQ7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ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2luYWxMaW5lID09PSAnbnVtYmVyJykge1xuICAgICAgICAgIHRoaXMuX19vcmlnaW5hbE1hcHBpbmdzLnB1c2goYWRqdXN0ZWRNYXBwaW5nKTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHF1aWNrU29ydCh0aGlzLl9fZ2VuZXJhdGVkTWFwcGluZ3MsIHV0aWwuY29tcGFyZUJ5R2VuZXJhdGVkUG9zaXRpb25zRGVmbGF0ZWQpO1xuICAgIHF1aWNrU29ydCh0aGlzLl9fb3JpZ2luYWxNYXBwaW5ncywgdXRpbC5jb21wYXJlQnlPcmlnaW5hbFBvc2l0aW9ucyk7XG4gIH07XG5cbmV4cG9ydHMuSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyID0gSW5kZXhlZFNvdXJjZU1hcENvbnN1bWVyO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///6771\n")},4433:(__unused_webpack_module,exports,__webpack_require__)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar base64VLQ = __webpack_require__(6400);\nvar util = __webpack_require__(2728);\nvar ArraySet = (__webpack_require__(8213)/* .ArraySet */ .I);\nvar MappingList = (__webpack_require__(1188)/* .MappingList */ .H);\n\n/**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\nfunction SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._skipValidation = util.getArg(aArgs, 'skipValidation', false);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = new MappingList();\n this._sourcesContents = null;\n}\n\nSourceMapGenerator.prototype._version = 3;\n\n/**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\nSourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source != null) {\n newMapping.source = mapping.source;\n if (sourceRoot != null) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name != null) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var sourceRelative = sourceFile;\n if (sourceRoot !== null) {\n sourceRelative = util.relative(sourceRoot, sourceFile);\n }\n\n if (!generator._sources.has(sourceRelative)) {\n generator._sources.add(sourceRelative);\n }\n\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n/**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\nSourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n if (!this._skipValidation) {\n this._validateMapping(generated, original, source, name);\n }\n\n if (source != null) {\n source = String(source);\n if (!this._sources.has(source)) {\n this._sources.add(source);\n }\n }\n\n if (name != null) {\n name = String(name);\n if (!this._names.has(name)) {\n this._names.add(name);\n }\n }\n\n this._mappings.add({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n/**\n * Set the source content for a source file.\n */\nSourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot != null) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent != null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = Object.create(null);\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else if (this._sourcesContents) {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n/**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\nSourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n var sourceFile = aSourceFile;\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (aSourceFile == null) {\n if (aSourceMapConsumer.file == null) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n sourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"sourceFile\" relative if an absolute Url is passed.\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"sourceFile\"\n this._mappings.unsortedForEach(function (mapping) {\n if (mapping.source === sourceFile && mapping.originalLine != null) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source != null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath != null) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot != null) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name != null) {\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source != null && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name != null && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aSourceMapPath != null) {\n sourceFile = util.join(aSourceMapPath, sourceFile);\n }\n if (sourceRoot != null) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n/**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\nSourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n // When aOriginal is truthy but has empty values for .line and .column,\n // it is most likely a programmer error. In this case we throw a very\n // specific error message to try to guide them the right way.\n // For example: https://github.com/Polymer/polymer-bundler/pull/519\n if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {\n throw new Error(\n 'original.line and original.column are not numbers -- you probably meant to omit ' +\n 'the original mapping entirely and only map the generated position. If so, pass ' +\n 'null for the original mapping instead of an object with empty or null values.'\n );\n }\n\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n/**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\nSourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var next;\n var mapping;\n var nameIdx;\n var sourceIdx;\n\n var mappings = this._mappings.toArray();\n for (var i = 0, len = mappings.length; i < len; i++) {\n mapping = mappings[i];\n next = ''\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n next += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {\n continue;\n }\n next += ',';\n }\n }\n\n next += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source != null) {\n sourceIdx = this._sources.indexOf(mapping.source);\n next += base64VLQ.encode(sourceIdx - previousSource);\n previousSource = sourceIdx;\n\n // lines are stored 0-based in SourceMap spec version 3\n next += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n next += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name != null) {\n nameIdx = this._names.indexOf(mapping.name);\n next += base64VLQ.encode(nameIdx - previousName);\n previousName = nameIdx;\n }\n }\n\n result += next;\n }\n\n return result;\n };\n\nSourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot != null) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n/**\n * Externalize the source map.\n */\nSourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._file != null) {\n map.file = this._file;\n }\n if (this._sourceRoot != null) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n/**\n * Render the source map being generated to a string.\n */\nSourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this.toJSON());\n };\n\nexports.SourceMapGenerator = SourceMapGenerator;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9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gICAgICAgIH1cbiAgICAgICAgICBuZXh0ICs9ICcsJztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5nZW5lcmF0ZWRDb2x1bW5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4pO1xuICAgICAgcHJldmlvdXNHZW5lcmF0ZWRDb2x1bW4gPSBtYXBwaW5nLmdlbmVyYXRlZENvbHVtbjtcblxuICAgICAgaWYgKG1hcHBpbmcuc291cmNlICE9IG51bGwpIHtcbiAgICAgICAgc291cmNlSWR4ID0gdGhpcy5fc291cmNlcy5pbmRleE9mKG1hcHBpbmcuc291cmNlKTtcbiAgICAgICAgbmV4dCArPSBiYXNlNjRWTFEuZW5jb2RlKHNvdXJjZUlkeCAtIHByZXZpb3VzU291cmNlKTtcbiAgICAgICAgcHJldmlvdXNTb3VyY2UgPSBzb3VyY2VJZHg7XG5cbiAgICAgICAgLy8gbGluZXMgYXJlIHN0b3JlZCAwLWJhc2VkIGluIFNvdXJjZU1hcCBzcGVjIHZlcnNpb24gM1xuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbExpbmUgLSAxXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gcHJldmlvdXNPcmlnaW5hbExpbmUpO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsTGluZSA9IG1hcHBpbmcub3JpZ2luYWxMaW5lIC0gMTtcblxuICAgICAgICBuZXh0ICs9IGJhc2U2NFZMUS5lbmNvZGUobWFwcGluZy5vcmlnaW5hbENvbHVtblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIHByZXZpb3VzT3JpZ2luYWxDb2x1bW4pO1xuICAgICAgICBwcmV2aW91c09yaWdpbmFsQ29sdW1uID0gbWFwcGluZy5vcmlnaW5hbENvbH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VyY2VNYXBHZW5lcmF0b3I7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4433\n")},7085:(__unused_webpack_module,exports,__webpack_require__)=>{eval('/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\nvar SourceMapGenerator = (__webpack_require__(4433).SourceMapGenerator);\nvar util = __webpack_require__(2728);\n\n// Matches a Windows-style `\\r\\n` newline or a `\\n` newline used by all other\n// operating systems these days (capturing the result).\nvar REGEX_NEWLINE = /(\\r?\\n)/;\n\n// Newline character code for charCodeAt() comparisons\nvar NEWLINE_CODE = 10;\n\n// Private symbol for identifying `SourceNode`s when multiple versions of\n// the source-map library are loaded. This MUST NOT CHANGE across\n// versions!\nvar isSourceNode = "$$$isSourceNode$$$";\n\n/**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source\'s filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\nfunction SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine == null ? null : aLine;\n this.column = aColumn == null ? null : aColumn;\n this.source = aSource == null ? null : aSource;\n this.name = aName == null ? null : aName;\n this[isSourceNode] = true;\n if (aChunks != null) this.add(aChunks);\n}\n\n/**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n * @param aRelativePath Optional. The path that relative sources in the\n * SourceMapConsumer should be relative to.\n */\nSourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // All even indices of this array are one line of the generated code,\n // while all odd indices are the newlines between two adjacent lines\n // (since `REGEX_NEWLINE` captures its match).\n // Processed fragments are accessed by calling `shiftNextLine`.\n var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);\n var remainingLinesIndex = 0;\n var shiftNextLine = function() {\n var lineContents = getNextLine();\n // The last line of a file might not have a newline.\n var newLine = getNextLine() || "";\n return lineContents + newLine;\n\n function getNextLine() {\n return remainingLinesIndex < remainingLines.length ?\n remainingLines[remainingLinesIndex++] : undefined;\n }\n };\n\n // We need to remember the position of "remainingLines"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from "lastMapping" to "mapping":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n // Associate first line with "lastMapping"\n addMappingWithCode(lastMapping, shiftNextLine());\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between "lastGeneratedColumn" and\n // "mapping.generatedColumn" with "lastMapping"\n var nextLine = remainingLines[remainingLinesIndex] || \'\';\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(shiftNextLine());\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[remainingLinesIndex] || \'\';\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLinesIndex < remainingLines.length) {\n if (lastMapping) {\n // Associate the remaining code in the current line with "lastMapping"\n addMappingWithCode(lastMapping, shiftNextLine());\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.splice(remainingLinesIndex).join(""));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content != null) {\n if (aRelativePath != null) {\n sourceFile = util.join(aRelativePath, sourceFile);\n }\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n var source = aRelativePath\n ? util.join(aRelativePath, mapping.source)\n : mapping.source;\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n source,\n code,\n mapping.name));\n }\n }\n };\n\n/**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk[isSourceNode] || typeof aChunk === "string") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk\n );\n }\n return this;\n};\n\n/**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\nSourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk[isSourceNode] || typeof aChunk === "string") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk\n );\n }\n return this;\n};\n\n/**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source\'s line/column location.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk[isSourceNode]) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== \'\') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n};\n\n/**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\nSourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n};\n\n/**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\nSourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild[isSourceNode]) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === \'string\') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(\'\'.replace(aPattern, aReplacement));\n }\n return this;\n};\n\n/**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\nSourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n/**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\nSourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i][isSourceNode]) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n/**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\nSourceNode.prototype.toString = function SourceNode_toString() {\n var str = "";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n};\n\n/**\n * Returns the string representation of this source node along with a source\n * map.\n */\nSourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: "",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n for (var idx = 0, length = chunk.length; idx < length; idx++) {\n if (chunk.charCodeAt(idx) === NEWLINE_CODE) {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n }\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n};\n\nexports.SourceNode = SourceNode;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzA4NS5qcyIsIm1hcHBpbmdzIjoiQUFBQSxpQkFBaUIsb0JBQW9CO0FBQ3JDO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEseUJBQXlCLDhDQUFvRDtBQUM3RSxXQUFXLG1CQUFPLENBQUMsSUFBUTs7QUFFM0I7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FB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2VDb250ZW50KHNvdXJjZUZpbGUsIGNvbnRlbnQpO1xuICAgICAgfVxuICAgIH0pO1xuXG4gICAgcmV0dXJuIG5vZGU7XG5cbiAgICBmdW5jdGlvbiBhZGRNYXBwaW5nV2l0aENvZGUobWFwcGluZywgY29kZSkge1xuICAgICAgaWYgKG1hcHBpbmcgPT09IG51bGwgfHwgbWFwcGluZy5zb3VyY2UgPT09IHVuZGVmaW5lZCkge1xuICAgICAgICBub2RlLmFkZChjb2RlKTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBzb3VyY2UgPSBhUmVsYXRpdmVQYXRoXG4gICAgICAgICAgPyB1dGlsLmpvaW4oYVJlbGF0aXZlUGF0aCwgbWFwcGluZy5zb3VyY2UpXG4gICAgICAgICAgOiBtYXBwaW5nLnNvdXJjZTtcbiAgICAgICAgbm9kZS5hZGQobmV3IFNvdXJjZU5vZGUobWFwcGluZy5vcmlnaW5hbExpbmUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcHBpbmcub3JpZ2luYWxDb2x1bW4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwcGluZy5uYW1lKSk7XG4gICAgICB9XG4gICAgfVxuICB9O1xuXG4vKipcbiAqIEFkZCBhIGNodW5rIG9mIGdlbmVyYXRlZCBKUyB0byB0aGlzIHNvdXJjZSBub2RlLlxuICpcbiAqIEBwYXJhbSBhQ2h1bmsgQSBzdHJpbmcgc25pcHBldCBvZiBnZW5lcmF0ZWQgSlMgY29kZSwgYW5vdGhlciBpbnN0YW5jZSBvZlxuICogICAgICAgIFNvdXJjZU5vZGUsIG9yIGFuIGFycmF5IHdoZXJlIGVhY2ggbWVtYmVyIGlzIG9uZSBvZiB0aG9zZSB0aGluZ3MuXG4gKi9cblNvdXJjZU5vZGUucHJv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ICsgMSA9PT0gbGVuZ3RoKSB7XG4gICAgICAgICAgbGFzdE9yaWdpbmFsU291cmNlID0gbnVsbDtcbiAgICAgICAgICBzb3VyY2VNYXBwaW5nQWN0aXZlID0gZmFsc2U7XG4gICAgICAgIH0gZWxzZSBpZiAoc291cmNlTWFwcGluZ0FjdGl2ZSkge1xuICAgICAgICAgIG1hcC5hZGRNYXBwaW5nKHtcbiAgICAgICAgICAgIHNvdXJjZTogb3JpZ2luYWwuc291cmNlLFxuICAgICAgICAgICAgb3JpZ2luYWw6IHtcbiAgICAgICAgICAgICAgbGluZTogb3JpZ2luYWwubGluZSxcbiAgICAgICAgICAgICAgY29sdW1uOiBvcmlnaW5hbC5jb2x1bW5cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZW5lcmF0ZWQ6IHtcbiAgICAgICAgICAgICAgbGluZTogZ2VuZXJhdGVkLmxpbmUsXG4gICAgICAgICAgICAgIGNvbHVtbjogZ2VuZXJhdGVkLmNvbHVtblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5hbWU6IG9yaWdpbmFsLm5hbWVcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgZ2VuZXJhdGVkLmNvbHVtbisrO1xuICAgICAgfVxuICAgIH1cbiAgfSk7XG4gIHRoaXMud2Fsa1NvdXJjZUNvbnRlbnRzKGZ1bmN0aW9uIChzb3VyY2VGaWxlLCBzb3VyY2VDb250ZW50KSB7XG4gICAgbWFwLnNldFNvdXJjZUNvbnRlbnQoc291cmNlRmlsZSwgc291cmNlQ29udGVudCk7XG4gIH0pO1xuXG4gIHJldHVybiB7IGNvZGU6IGdlbmVyYXRlZC5jb2RlLCBtYXA6IG1hcCB9O1xufTtcblxuZXhwb3J0cy5Tb3VyY2VOb2RlID0gU291cmNlTm9kZTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7085\n')},2728:(__unused_webpack_module,exports)=>{eval("/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\n/**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\nfunction getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n}\nexports.getArg = getArg;\n\nvar urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.-]*)(?::(\\d+))?(.*)$/;\nvar dataUrlRegexp = /^data:.+\\,.+$/;\n\nfunction urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n}\nexports.urlParse = urlParse;\n\nfunction urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n}\nexports.urlGenerate = urlGenerate;\n\n/**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consecutive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\nfunction normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = exports.isAbsolute(path);\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n}\nexports.normalize = normalize;\n\n/**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\nfunction join(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n if (aPath === \"\") {\n aPath = \".\";\n }\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n}\nexports.join = join;\n\nexports.isAbsolute = function (aPath) {\n return aPath.charAt(0) === '/' || urlRegexp.test(aPath);\n};\n\n/**\n * Make a path relative to a URL or another path.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be made relative to aRoot.\n */\nfunction relative(aRoot, aPath) {\n if (aRoot === \"\") {\n aRoot = \".\";\n }\n\n aRoot = aRoot.replace(/\\/$/, '');\n\n // It is possible for the path to be above the root. In this case, simply\n // checking whether the root is a prefix of the path won't work. Instead, we\n // need to remove components from the root one by one, until either we find\n // a prefix that fits, or we run out of components to remove.\n var level = 0;\n while (aPath.indexOf(aRoot + '/') !== 0) {\n var index = aRoot.lastIndexOf(\"/\");\n if (index < 0) {\n return aPath;\n }\n\n // If the only part of the root that is left is the scheme (i.e. http://,\n // file:///, etc.), one or more slashes (/), or simply nothing at all, we\n // have exhausted all components, so the path is not relative to the root.\n aRoot = aRoot.slice(0, index);\n if (aRoot.match(/^([^\\/]+:\\/)?\\/*$/)) {\n return aPath;\n }\n\n ++level;\n }\n\n // Make sure we add a \"../\" for each component we removed from the root.\n return Array(level + 1).join(\"../\") + aPath.substr(aRoot.length + 1);\n}\nexports.relative = relative;\n\nvar supportsNullProto = (function () {\n var obj = Object.create(null);\n return !('__proto__' in obj);\n}());\n\nfunction identity (s) {\n return s;\n}\n\n/**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\nfunction toSetString(aStr) {\n if (isProtoString(aStr)) {\n return '$' + aStr;\n }\n\n return aStr;\n}\nexports.toSetString = supportsNullProto ? identity : toSetString;\n\nfunction fromSetString(aStr) {\n if (isProtoString(aStr)) {\n return aStr.slice(1);\n }\n\n return aStr;\n}\nexports.fromSetString = supportsNullProto ? identity : fromSetString;\n\nfunction isProtoString(s) {\n if (!s) {\n return false;\n }\n\n var length = s.length;\n\n if (length < 9 /* \"__proto__\".length */) {\n return false;\n }\n\n if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||\n s.charCodeAt(length - 2) !== 95 /* '_' */ ||\n s.charCodeAt(length - 3) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 4) !== 116 /* 't' */ ||\n s.charCodeAt(length - 5) !== 111 /* 'o' */ ||\n s.charCodeAt(length - 6) !== 114 /* 'r' */ ||\n s.charCodeAt(length - 7) !== 112 /* 'p' */ ||\n s.charCodeAt(length - 8) !== 95 /* '_' */ ||\n s.charCodeAt(length - 9) !== 95 /* '_' */) {\n return false;\n }\n\n for (var i = length - 10; i >= 0; i--) {\n if (s.charCodeAt(i) !== 36 /* '$' */) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\nfunction compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0 || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByOriginalPositions = compareByOriginalPositions;\n\n/**\n * Comparator between two mappings with deflated source and name indices where\n * the generated positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\nfunction compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0 || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;\n\nfunction strcmp(aStr1, aStr2) {\n if (aStr1 === aStr2) {\n return 0;\n }\n\n if (aStr1 === null) {\n return 1; // aStr2 !== null\n }\n\n if (aStr2 === null) {\n return -1; // aStr1 !== null\n }\n\n if (aStr1 > aStr2) {\n return 1;\n }\n\n return -1;\n}\n\n/**\n * Comparator between two mappings with inflated source and name strings where\n * the generated positions are compared.\n */\nfunction compareByGeneratedPositionsInflated(mappingA, mappingB) {\n var cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp !== 0) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp !== 0) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n}\nexports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;\n\n/**\n * Strip any JSON XSSI avoidance prefix from the string (as documented\n * in the source maps specification), and then parse the string as\n * JSON.\n */\nfunction parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}\nexports.parseSourceMapInput = parseSourceMapInput;\n\n/**\n * Compute the URL of a source given the the source root, the source's\n * URL, and the source map's URL.\n */\nfunction computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {\n sourceURL = sourceURL || '';\n\n if (sourceRoot) {\n // This follows what Chrome does.\n if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {\n sourceRoot += '/';\n }\n // The spec says:\n // Line 4: An optional source root, useful for relocating source\n // files on a server or removing repeated values in the\n // “sources” entry. This value is prepended to the individual\n // entries in the “source” field.\n sourceURL = sourceRoot + sourceURL;\n }\n\n // Historically, SourceMapConsumer did not take the sourceMapURL as\n // a parameter. This mode is still somewhat supported, which is why\n // this code block is conditional. However, it's preferable to pass\n // the source map URL to SourceMapConsumer, so that this function\n // can implement the source URL resolution algorithm as outlined in\n // the spec. This block is basically the equivalent of:\n // new URL(sourceURL, sourceMapURL).toString()\n // ... except it avoids using URL, which wasn't available in the\n // older releases of node still supported by this library.\n //\n // The spec says:\n // If the sources are not absolute URLs after prepending of the\n // “sourceRoot”, the sources are resolved relative to the\n // SourceMap (like resolving script src in a html document).\n if (sourceMapURL) {\n var parsed = urlParse(sourceMapURL);\n if (!parsed) {\n throw new Error(\"sourceMapURL could not be parsed\");\n }\n if (parsed.path) {\n // Strip the last path component, but keep the \"/\".\n var index = parsed.path.lastIndexOf('/');\n if (index >= 0) {\n parsed.path = parsed.path.substring(0, index + 1);\n }\n }\n sourceURL = join(urlGenerate(parsed), sourceURL);\n }\n\n return normalize(sourceURL);\n}\nexports.computeSourceURL = computeSourceURL;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcyOC5qcyIsIm1hcHBpbm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In0=\n//# sourceURL=webpack-internal:///2728\n")},9125:(__unused_webpack_module,exports,__webpack_require__)=>{eval("/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = __webpack_require__(4433).SourceMapGenerator;\nexports.SourceMapConsumer = __webpack_require__(6771).SourceMapConsumer;\nexports.SourceNode = __webpack_require__(7085).SourceNode;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTEyNS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EseUVBQXFGO0FBQ3JGLHVFQUFrRjtBQUNsRix5REFBNEQiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvc291cmNlLW1hcC9zb3VyY2UtbWFwLmpzP2RjNzQiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiAqIENvcHlyaWdodCAyMDA5LTIwMTEgTW96aWxsYSBGb3VuZGF0aW9uIGFuZCBjb250cmlidXRvcnNcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBOZXcgQlNEIGxpY2Vuc2UuIFNlZSBMSUNFTlNFLnR4dCBvcjpcbiAqIGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9CU0QtMy1DbGF1c2VcbiAqL1xuZXhwb3J0cy5Tb3VyY2VNYXBHZW5lcmF0b3IgPSByZXF1aXJlKCcuL2xpYi9zb3VyY2UtbWFwLWdlbmVyYXRvcicpLlNvdXJjZU1hcEdlbmVyYXRvcjtcbmV4cG9ydHMuU291cmNlTWFwQ29uc3VtZXIgPSByZXF1aXJlKCcuL2xpYi9zb3VyY2UtbWFwLWNvbnN1bWVyJykuU291cmNlTWFwQ29uc3VtZXI7XG5leHBvcnRzLlNvdXJjZU5vZGUgPSByZXF1aXJlKCcuL2xpYi9zb3VyY2Utbm9kZScpLlNvdXJjZU5vZGU7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9125\n")},4595:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(9829)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base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2FyZ3VtZW50cyddW2ldO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoL2Z1bmN0aW9uKD86XFxzKyhbXFx3JF0rKSkrXFxzKlxcKC8udGVzdChjdXJyLnRvU3RyaW5nKCkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0YWNrLnB1c2gobmV3IFN0YWNrRnJhbWUoe2Z1bmN0aW9uTmFtZTogUmVnRXhwLiQxIHx8IHVuZGVmaW5lZCwgYXJnczogYXJnc30pKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBzdGFjay5wdXNoKG5ldyBTdGFja0ZyYW1lKHthcmdzOiBhcmdzfSkpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIGN1cnIgPSBjdXJyLmNhbGxlcjtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBzdGFjaztcbiAgICAgICAgfVxuICAgIH07XG59KSk7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4595\n")},9829:function(module,exports){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\n }\n\n var booleanProps = ['isConstructor', 'isEval', 'isNative', 'isToplevel'];\n var numericProps = ['columnNumber', 'lineNumber'];\n var stringProps = ['fileName', 'functionName', 'source'];\n var arrayProps = ['args'];\n var objectProps = ['evalOrigin'];\n\n var props = booleanProps.concat(numericProps, stringProps, arrayProps, objectProps);\n\n function StackFrame(obj) {\n if (!obj) return;\n for (var i = 0; i < props.length; i++) {\n if (obj[props[i]] !== undefined) {\n this['set' + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n\n StackFrame.prototype = {\n getArgs: function() {\n return this.args;\n },\n setArgs: function(v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n getEvalOrigin: function() {\n return this.evalOrigin;\n },\n setEvalOrigin: function(v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError('Eval Origin must be an Object or StackFrame');\n }\n },\n\n toString: function() {\n var fileName = this.getFileName() || '';\n var lineNumber = this.getLineNumber() || '';\n var columnNumber = this.getColumnNumber() || '';\n var functionName = this.getFunctionName() || '';\n if (this.getIsEval()) {\n if (fileName) {\n return '[eval] (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return '[eval]:' + lineNumber + ':' + columnNumber;\n }\n if (functionName) {\n return functionName + ' (' + fileName + ':' + lineNumber + ':' + columnNumber + ')';\n }\n return fileName + ':' + lineNumber + ':' + columnNumber;\n }\n };\n\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf('(');\n var argsEndIndex = str.lastIndexOf(')');\n\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(',');\n var locationString = str.substring(argsEndIndex + 1);\n\n if (locationString.indexOf('@') === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, '');\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype['get' + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype['set' + _capitalize(booleanProps[i])] = (function(p) {\n return function(v) {\n this[p] = Boolean(v);\n };\n })(booleanProps[i]);\n }\n\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype['get' + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype['set' + _capitalize(numericProps[j])] = (function(p) {\n return function(v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + ' must be a Number');\n }\n this[p] = Number(v);\n };\n })(numericProps[j]);\n }\n\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype['get' + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype['set' + _capitalize(stringProps[k])] = (function(p) {\n return function(v) {\n this[p] = String(v);\n };\n })(stringProps[k]);\n }\n\n return StackFrame;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTgyOS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxRQUFRLElBQTBDO0FBQ2xELFFBQVEsaUNBQXFCLE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nVuY3Rpb24ocCkge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICAgICAgICB0aGlzW3BdID0gQm9vbGVhbih2KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0pKGJvb2xlYW5Qcm9wc1tpXSk7XG4gICAgfVxuXG4gICAgZm9yICh2YXIgaiA9IDA7IGogPCBudW1lcmljUHJvcHMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgU3RhY2tGcmFtZS5wcm90b3R5cGVbJ2dldCcgKyBfY2FwaXRhbGl6ZShudW1lcmljUHJvcHNbal0pXSA9IF9nZXR0ZXIobnVtZXJpY1Byb3BzW2pdKTtcbiAgICAgICAgU3RhY2tGcmFtZS5wcm90b3R5cGVbJ3NldCcgKyBfY2FwaXRhbGl6ZShudW1lcmljUHJvcHNbal0pXSA9IChmdW5jdGlvbihwKSB7XG4gICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odikge1xuICAgICAgICAgICAgICAgIGlmICghX2lzTnVtYmVyKHYpKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBUeXBlRXJyb3IocCArICcgbXVzdCBiZSBhIE51bWJlcicpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzW3BdID0gTnVtYmVyKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSkobnVtZXJpY1Byb3BzW2pdKTtcbiAgICB9XG5cbiAgICBmb3IgKHZhciBrID0gMDsgayA8IHN0cmluZ1Byb3BzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgIFN0YWNrRnJhbWUucHJvdG90eXBlWydnZXQnICsgX2NhcGl0YWxpemUoc3RyaW5nUHJvcHNba10pXSA9IF9nZXR0ZXIoc3RyaW5nUHJvcHNba10pO1xuICAgICAgICBTdGFja0ZyYW1lLnByb3RvdHlwZVsnc2V0JyArIF9jYXBpdGFsaXplKHN0cmluZ1Byb3BzW2tdKV0gPSAoZnVuY3Rpb24ocCkge1xuICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHYpIHtcbiAgICAgICAgICAgICAgICB0aGlzW3BdID0gU3RyaW5nKHYpO1xuICAgICAgICAgICAgfTtcbiAgICAgICAgfSkoc3RyaW5nUHJvcHNba10pO1xuICAgIH1cblxuICAgIHJldHVybiBTdGFja0ZyYW1lO1xufSkpO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9829\n")},4358:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(9125), __webpack_require__(9829)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function(SourceMap, StackFrame) {\n 'use strict';\n\n /**\n * Make a X-Domain request to url and callback.\n *\n * @param {String} url\n * @returns {Promise} with response text if fulfilled\n */\n function _xdr(url) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.open('get', url);\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if ((req.status >= 200 && req.status < 300) ||\n (url.substr(0, 7) === 'file://' && req.responseText)) {\n resolve(req.responseText);\n } else {\n reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));\n }\n }\n };\n req.send();\n });\n\n }\n\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== 'undefined' && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error('You must supply a polyfill for window.atob in this environment');\n }\n }\n\n function _parseJson(string) {\n if (typeof JSON !== 'undefined' && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error('You must supply a polyfill for JSON.parse in this environment');\n }\n }\n\n function _findFunctionName(source, lineNumber/*, columnNumber*/) {\n var syntaxes = [\n // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/,\n // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/,\n // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/,\n // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/,\n // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/\n ];\n var lines = source.split('\\n');\n\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = '';\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf('//');\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== 'function' || typeof Object.create !== 'function') {\n throw new Error('Unable to consume source maps in older browsers');\n }\n }\n\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== 'object') {\n throw new TypeError('Given StackFrame is not an object');\n } else if (typeof stackframe.fileName !== 'string') {\n throw new TypeError('Given file name is not a String');\n } else if (typeof stackframe.lineNumber !== 'number' ||\n stackframe.lineNumber % 1 !== 0 ||\n stackframe.lineNumber < 1) {\n throw new TypeError('Given line number must be a positive integer');\n } else if (typeof stackframe.columnNumber !== 'number' ||\n stackframe.columnNumber % 1 !== 0 ||\n stackframe.columnNumber < 0) {\n throw new TypeError('Given column number must be a non-negative integer');\n }\n return true;\n }\n\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/mg;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n // eslint-disable-next-line no-cond-assign\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error('sourceMappingURL not found');\n }\n }\n\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function(resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n\n resolve(\n // given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error('Could not get original source for given stackframe and source map'));\n }\n });\n }\n\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n\n this.ajax = opts.ajax || _xdr;\n\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function(resolve, reject) {\n var isDataUrl = location.substr(0, 5) === 'data:';\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error('Cannot make network requests in offline mode'));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp =\n /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error('The encoding of the inline sourcemap is not supported'));\n }\n } else {\n var xhrPromise = this.ajax(location, {method: 'get'});\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function(resolve) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function(resolve, reject) {\n return this._get(sourceMappingURL).then(function(sourceMapSource) {\n if (typeof sourceMapSource === 'string') {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, ''));\n }\n if (typeof sourceMapSource.sourceRoot === 'undefined') {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function(resolve, reject) {\n this.getMappedLocation(stackframe).then(function(mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n\n this.findFunctionName(mappedStackFrame)\n .then(resolve, resolveMappedStackFrame)\n // eslint-disable-next-line no-unexpected-multiline\n ['catch'](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)['catch'](reject);\n }.bind(this));\n };\n\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function(resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function(source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === 'data:';\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf('/') + 1);\n\n if (sourceMappingURL[0] !== '/' && !isDataUrl && !(/^https?:\\/\\/|^\\/\\//i).test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)\n .then(function(sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)\n .then(resolve)['catch'](function() {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)['catch'](reject);\n }.bind(this));\n };\n };\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM1OC5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQSxRQUFRLElBQTBDO0FBQ2xELFFBQVEsaUNBQXlCLENBQUMseUJBQVksRUFBRSx5QkFBWSxDQUFDLG9DQUFFLE9BQU87QUFBQTtBQUFBO0FBQUEsa0dBQUM7QUFDdkUsTUFBTSxLQUFLLEVBSU47QUFDTCxDQUFDO0FBQ0Q7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsZUFBZSxRQUFRO0FBQ3ZCLGlCQUFpQixTQUFTO0FBQzFCO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Q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gcmVxLm9ucmVhZHlzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uIG9ucmVhZHlzdGF0ZWNoYW5nZSgpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVxLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChyZXEuc3RhdHVzID49IDIwMCAmJiByZXEuc3RhdHVzIDwgMzAwKSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgKHVybC5zdWJzdHIoMCwgNykgPT09ICdmaWxlOi8vJyAmJiByZXEucmVzcG9uc2VUZXh0KSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXEucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChuZXcgRXJyb3IoJ0hUVFAgc3RhdHVzOiAnICsgcmVxLnN0YXR1cyArICcgcmV0cmlldmluZyAnICsgdXJsKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVxLnNlbmQoKTtcbiAgICAgICAgfSk7XG5cbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBDb252ZXJ0IGEgQmFzZTY0LWVuY29kZWQgc3RyaW5nIGludG8gaXRzIG9yaWdpbmFsIHJlcHJlc2VudGF0aW9uLlxuICAgICAqIFVzZWQgZm9yIGlubGluZSBzb3VyY2VtYXBzLlxuICAgICAqXG4gICAgICogQHBhcmFtIHtTdHJpbmd9IGI2NHN0ciBCYXNlLTY0IGVuY29kZWQgc3RyaW5nXG4gICAgICogQHJldHVybnMge1N0cmluZ30gb3JpZ2luYWwgcmVwcmVzZW50YXRpb24gb2YgdGhlIGJhc2U2NC1lbmNvZGVkIHN0cmluZy5cbiAgICAgKi9cbiAgICBmdW5jdGlvbiBfYXRvYihiNjRzdHIpIHtcbiAgICAgICAgaWYgKH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b3MgPj0gMCkge1xuICAgICAgICAgICAgICAgIGxpbmUgPSBsaW5lLnN1YnN0cigwLCBjb21tZW50UG9zKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKGxpbmUpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gbGluZSArIGNvZGU7XG4gICAgICAgICAgICAgICAgdmFyIGxlbiA9IHN5bnRheGVzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBmb3IgKHZhciBpbmRleCA9IDA7IGluZGV4IDwgbGVuOyBpbmRleCsrKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtID0gc3ludGF4ZXNbaW5kZXhdLmV4ZWMoY29kZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtICYmIG1bMV0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtWzFdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2Vuc3VyZVN1cHBvcnRlZEVudmlyb25tZW50KCkge1xuICAgICAgICBpZiAodHlwZW9mIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSAhPT0gJ2Z1bmN0aW9uJyB8fCB0eXBlb2YgT2JqZWN0LmNyZWF0ZSAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdVbmFibGUgdG8gY29uc3VtZSBzb3VyY2UgbWFwcyBpbiBvbGRlciBicm93c2VycycpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2Vuc3VyZVN0YWNrRnJhbWVJc0xlZ2l0KHN0YWNrZnJhbWUpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBzdGFja2ZyYW1lICE9PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgdGhyb3cgbmV3IFR5c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lxccydcIl0rKVxccyokL21nO1xuICAgICAgICB2YXIgbGFzdFNvdXJjZU1hcHBpbmdVcmw7XG4gICAgICAgIHZhciBtYXRjaFNvdXJjZU1hcHBpbmdVcmw7XG4gICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1jb25kLWFzc2lnblxuICAgICAgICB3aGlsZSAobWF0Y2hTb3VyY2VNYXBwaW5nVXJsID0gc291cmNlTWFwcGluZ1VybFJlZ0V4cC5leGVjKHNvdXJjZSkpIHtcbiAgICAgICAgICAgIGxhc3RTb3VyY2VNYXBwaW5nVXJsID0gbWF0Y2hTb3VyY2VNYXBwaW5nVXJsWzFdO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsYXN0U291cmNlTWFwcGluZ1VybCkge1xuICAgICAgICAgICAgcmV0dXJuIGxhc3RTb3VyY2VNYXBwaW5nVXJsO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdzb3VyY2VNYXBwaW5nVVJMIG5vdCBmb3VuZCcpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgZnVuY3Rpb24gX2V4dHJhY3RMb2NhdGlvbkluZm9Gcm9tU291cmNlTWFwU291cmNlKHN0YWNrZnJhbWUsIHNvdXJjZU1hcENvbnN1bWVyLCBzb3VyY2VDYWNoZSkge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgbG9jID0gc291cmNlTWFwQ29uc3VtZXIub3JpZ2luYWxQb3NpdGlvbkZvcih7XG4gICAgICAgICAgICAgICAgbGluZTogc3RhY2tmcmFtZS5saW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgIGNvbHVtbjogc3RhY2tmcmFtZS5jb2x1bW5OdW1iZXJcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBpZiAobG9jLnNvdXJjZSkge1xuICAgICAgICAgICAgICAgIC8vIGNhY2hlIG1hcHBlZCBzb3VyY2VzXG4gICAgICAgICAgICAgICAgdmFyIG1hcHBlZFNvdXJjZSA9IHNvdXJjZU1hcENvbnN1bWVyLnNvdXJjZUNvbnRlbnRGb3IobG9jLnNvdXJjZSk7XG4gICAgICAgICAgICAgICAgaWYgKG1hcHBlZFNvdXJjZSkge1xuICAgICAgICAgICAgICAgICAgICBzb3VyY2VDYWNoZVtsb2Muc291cmNlXSA9IG1hcHBlZFNvdXJjZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXNvbHZlKFxuICAgICAgICAgICAgICAgICAgICAvLyBnaXZlbiBzdGFja2ZyYW1lIGFuZCBzb3VyY2UgbG9jYXRpb24sIHVwZGF0ZSBzdGFja2ZyYW1lXG4gICAgICAgICAgICAgICAgICAgIG5ldyBTdGFja0ZyYW1lKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uTmFtZTogbG9jLm5hbWUgfHwgc3RhY2tmcmFtZS5mdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmdzOiBzdGFja2ZyYW1lLmFyZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogbG9jLnNvdXJjZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVOdW1iZXI6IGxvYy5saW5lLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sdW1uTnVtYmVyOiBsb2MuY29sdW1uXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignQ291bGQgbm90IGdldCBvcmlnaW5hbCBzb3VyY2UgZm9yIGdpdmVuIHN0YWNrZnJhbWUgYW5kIHNvdXJjZSBtYXAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIEBjb25z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QgPSBmdW5jdGlvbiBfZ2V0KGxvY2F0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgICAgdmFyIGlzRGF0YVVybCA9IGxvY2F0aW9uLnN1YnN0cigwLCA1KSA9PT0gJ2RhdGE6JztcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5zb3VyY2VDYWNoZVtsb2NhdGlvbl0pIHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh0aGlzLnNvdXJjZUNhY2hlW2xvY2F0aW9uXSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvcHRzLm9mZmxpbmUgJiYgIWlzRGF0YVVybCkge1xuICAgICAgICAgICAgICAgICAgICByZWplY3QobmV3IEVycm9yKCdDYW5ub3QgbWFrZSBuZXR3b3JrIHJlcXVlc3RzIGluIG9mZmxpbmUgbW9kZScpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNEYXRhVXJsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBkYXRhIFVSTHMgY2FuIGhhdmUgcGFyYW1ldGVycy5cbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNlZSBodHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9yZmMyMzk3XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3VwcG9ydGVkRW5jb2RpbmdSZWdleHAgPVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9eZGF0YTphcHBsaWNhdGlvblxcL2pzb247KFtcXHc9OlwiLV0rOykqYmFzZTY0LC87XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF0Y2ggPSBsb2NhdGlvbi5tYXRjaChzdXBwb3J0ZWRFbmNvZGluZ1JlZ2V4cCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2gpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc291cmNlTWFwU3RhcnQgPSBtYXRjaFswXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVuY29kZWRTb3VyY2UgPSBsb2NhdGlvbi5zdWJzdHIoc291cmNlTWFwU3RhcnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzb3VyY2UgPSB0aGlzLl9hdG9iKGVuY29kZWRTb3VyY2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc291cmNlQ2FjaGVbbG9jYXRpb25dID0gc291cmNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc291cmNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignVGhlIGVuY29kaW5nIG9mIHRoZSBpbmxpbmUgc291cmNlbWFwIGlzIG5vdCBzdXBwb3J0ZWQnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgeGhyUHJvbWlzZSA9IHRoaXMuYWpheChsb2NhdGlvbiwge21ldGhvZDogJ2dldCd9KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENhY2hlIHRoZSBQcm9taXNlIHRvIHByZXZlbnQgZHVwbGljYXRlIGluLWZsaWdodCByZXF1ZXN0c1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zb3VyY2VDYWNoZVtsb2NhdGlvbl0gPSB4aHJQcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgeGhyUHJvbWlzZS50aGVuKHJlc29sdmUsIHJlamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LmJpbmQodGhpc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aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX2dldChzb3VyY2VNYXBwaW5nVVJMKS50aGVuKGZ1bmN0aW9uKHNvdXJjZU1hcFNvdXJjZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc291cmNlTWFwU291cmNlID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VNYXBTb3VyY2UgPSBfcGFyc2VKc29uKHNvdXJjZU1hcFNvdXJjZS5yZXBsYWNlKC9eXFwpXFxdXFx9Jy8sICcnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc291cmNlTWFwU291cmNlLnNvdXJjZVJvb3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZU1hcFNvdXJjZS5zb3VyY2VSb290ID0gZGVmYXVsdFNvdXJjZVJvb3Q7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgU291cmNlTWFwLlNvdXJjZU1hcENvbnN1bWVyKHNvdXJjZU1hcFNvdXJjZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcmVqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgfS5iaW5kKHRoaXMpKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zb3VyY2VNYXBDb25zdW1lckNhY2hlW3NvdXJjZU1hcHBpbmdVUkxdID0gc291cmNlTWFwQ29uc3VtZXJQcm9taXNlO1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHNvdXJjZU1hcENvbnN1bWVyUHJvbWlzZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfS5iaW5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Vzc2VkRnVuY3Rpb25OYW1lID0gX2ZpbmRGdW5jdGlvbk5hbWUoc291cmNlLCBsaW5lTnVtYmVyLCBjb2x1bW5OdW1iZXIpO1xuICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IHJlcGxhY2UgZnVuY3Rpb25OYW1lIGlmIHdlIGZvdW5kIHNvbWV0aGluZ1xuICAgICAgICAgICAgICAgICAgICBpZiAoZ3Vlc3NlZEZ1bmN0aW9uTmFtZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShuZXcgU3RhY2tGcmFtZSh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb25OYW1lOiBndWVzc2VkRnVuY3Rpb25OYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3M6IHN0YWNrZnJhbWUuYXJncyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZTogc3RhY2tmcmFtZS5maWxlTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lTnVtYmVyOiBsaW5lTnVtYmVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbHVtbk51bWJlcjogY29sdW1uTnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHN0YWNrZnJhbWUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgcmVqZWN0KVsnY2F0Y2gnXShyZWplY3QpO1xuICAgICAgICAgICAgfS5iaW5kKHRoaXMpKTtcbiAgICAgICAgfTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogR2l2ZW4gYSBTdGFja0ZyYW1lLCBzZWVrIHNvdXJjZS1tYXBwZWQgbG9jYXRpb24gYW5kIHJldHVybiBuZXcgZW5oYW5jZWQgU3RhY2tGcmFtZS5cbiAgICAgICAgICp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NYXBwaW5nVVJMWzBdICE9PSAnLycgJiYgIWlzRGF0YVVybCAmJiAhKC9eaHR0cHM/OlxcL1xcL3xeXFwvXFwvL2kpLnRlc3Qoc291cmNlTWFwcGluZ1VSTCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZU1hcHBpbmdVUkwgPSBkZWZhdWx0U291cmNlUm9vdCArIHNvdXJjZU1hcHBpbmdVUkw7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5fZ2V0U291cmNlTWFwQ29uc3VtZXIoc291cmNlTWFwcGluZ1VSTCwgZGVmYXVsdFNvdXJjZVJvb3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbihzb3VyY2VNYXBDb25zdW1lcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfZXh0cmFjdExvY2F0aW9uSW5mb0Zyb21Tb3VyY2VNYXBTb3VyY2Uoc3RhY2tmcmFtZSwgc291cmNlTWFwQ29uc3VtZXIsIHNvdXJjZUNhY2hlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihyZXNvbHZlKVsnY2F0Y2gnXShmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoc3RhY2tmcmFtZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfS5iaW5kKHRoaXMpLCByZWplY3QpWydjYXRjaCddKHJlamVjdCk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICB9O1xuICAgIH07XG59KSk7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///4358\n")},401:function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(9180), __webpack_require__(4595), __webpack_require__(4358)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n}(this, function StackTrace(ErrorStackParser, StackGenerator, StackTraceGPS) {\n var _options = {\n filter: function(stackframe) {\n // Filter out stackframes for this library by default\n return (stackframe.functionName || '').indexOf('StackTrace$$') === -1 &&\n (stackframe.functionName || '').indexOf('ErrorStackParser$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackTraceGPS$$') === -1 &&\n (stackframe.functionName || '').indexOf('StackGenerator$$') === -1;\n },\n sourceCache: {}\n };\n\n var _generateError = function StackTrace$$GenerateError() {\n try {\n // Error must be thrown to get stack in IE\n throw new Error();\n } catch (err) {\n return err;\n }\n };\n\n /**\n * Merge 2 given Objects. If a conflict occurs the second object wins.\n * Does not do deep merges.\n *\n * @param {Object} first base object\n * @param {Object} second overrides\n * @returns {Object} merged first and second\n * @private\n */\n function _merge(first, second) {\n var target = {};\n\n [first, second].forEach(function(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n target[prop] = obj[prop];\n }\n }\n return target;\n });\n\n return target;\n }\n\n function _isShapedLikeParsableError(err) {\n return err.stack || err['opera#sourceloc'];\n }\n\n function _filtered(stackframes, filter) {\n if (typeof filter === 'function') {\n return stackframes.filter(filter);\n }\n return stackframes;\n }\n\n return {\n /**\n * Get a backtrace from invocation point.\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n get: function StackTrace$$get(opts) {\n var err = _generateError();\n return _isShapedLikeParsableError(err) ? this.fromError(err, opts) : this.generateArtificially(opts);\n },\n\n /**\n * Get a backtrace from invocation point.\n * IMPORTANT: Does not handle source maps or guess function names!\n *\n * @param {Object} opts\n * @returns {Array} of StackFrame\n */\n getSync: function StackTrace$$getSync(opts) {\n opts = _merge(_options, opts);\n var err = _generateError();\n var stack = _isShapedLikeParsableError(err) ? ErrorStackParser.parse(err) : StackGenerator.backtrace(opts);\n return _filtered(stack, opts.filter);\n },\n\n /**\n * Given an error object, parse it.\n *\n * @param {Error} error object\n * @param {Object} opts\n * @returns {Promise} for Array[StackFrame}\n */\n fromError: function StackTrace$$fromError(error, opts) {\n opts = _merge(_options, opts);\n var gps = new StackTraceGPS(opts);\n return new Promise(function(resolve) {\n var stackframes = _filtered(ErrorStackParser.parse(error), opts.filter);\n resolve(Promise.all(stackframes.map(function(sf) {\n return new Promise(function(resolve) {\n function resolveOriginal() {\n resolve(sf);\n }\n\n gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n });\n })));\n }.bind(this));\n },\n\n /**\n * Use StackGenerator to generate a backtrace.\n *\n * @param {Object} opts\n * @returns {Promise} of Array[StackFrame]\n */\n generateArtificially: function StackTrace$$generateArtificially(opts) {\n opts = _merge(_options, opts);\n var stackFrames = StackGenerator.backtrace(opts);\n if (typeof opts.filter === 'function') {\n stackFrames = stackFrames.filter(opts.filter);\n }\n return Promise.resolve(stackFrames);\n },\n\n /**\n * Given a function, wrap it such that invocations trigger a callback that\n * is called with a stack trace.\n *\n * @param {Function} fn to be instrumented\n * @param {Function} callback function to call with a stack trace on invocation\n * @param {Function} errback optional function to call with error if unable to get stack trace.\n * @param {Object} thisArg optional context object (e.g. window)\n */\n instrument: function StackTrace$$instrument(fn, callback, errback, thisArg) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n // Already instrumented, return given Function\n return fn;\n }\n\n var instrumented = function StackTrace$$instrumented() {\n try {\n this.get().then(callback, errback)['catch'](errback);\n return fn.apply(thisArg || this, arguments);\n } catch (e) {\n if (_isShapedLikeParsableError(e)) {\n this.fromError(e).then(callback, errback)['catch'](errback);\n }\n throw e;\n }\n }.bind(this);\n instrumented.__stacktraceOriginalFn = fn;\n\n return instrumented;\n },\n\n /**\n * Given a function that has been instrumented,\n * revert the function to it's original (non-instrumented) state.\n *\n * @param {Function} fn to de-instrument\n */\n deinstrument: function StackTrace$$deinstrument(fn) {\n if (typeof fn !== 'function') {\n throw new Error('Cannot de-instrument non-function object');\n } else if (typeof fn.__stacktraceOriginalFn === 'function') {\n return fn.__stacktraceOriginalFn;\n } else {\n // Function not instrumented, return original\n return fn;\n }\n },\n\n /**\n * Given an error message and Array of StackFrames, serialize and POST to given URL.\n *\n * @param {Array} stackframes\n * @param {String} url\n * @param {String} errorMsg\n * @param {Object} requestOptions\n */\n report: function StackTrace$$report(stackframes, url, errorMsg, requestOptions) {\n return new Promise(function(resolve, reject) {\n var req = new XMLHttpRequest();\n req.onerror = reject;\n req.onreadystatechange = function onreadystatechange() {\n if (req.readyState === 4) {\n if (req.status >= 200 && req.status < 400) {\n resolve(req.responseText);\n } else {\n reject(new Error('POST to ' + url + ' failed with status: ' + req.status));\n }\n }\n };\n req.open('post', url);\n\n // Set request headers\n req.setRequestHeader('Content-Type', 'application/json');\n if (requestOptions && typeof requestOptions.headers === 'object') {\n var headers = requestOptions.headers;\n for (var header in headers) {\n if (Object.prototype.hasOwnProperty.call(headers, header)) {\n req.setRequestHeader(header, headers[header]);\n }\n }\n }\n\n var reportPayload = {stack: stackframes};\n if (errorMsg !== undefined && errorMsg !== null) {\n reportPayload.message = errorMsg;\n }\n\n req.send(J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lvbiBfZmlsdGVyZWQoc3RhY2tmcmFtZXMsIGZpbHRlcikge1xuICAgICAgICBpZiAodHlwZW9mIGZpbHRlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgcmV0dXJuIHN0YWNrZnJhbWVzLmZpbHRlcihmaWx0ZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGFja2ZyYW1lcztcbiAgICB9XG5cbiAgICByZXR1cm4ge1xuICAgICAgICAvKipcbiAgICAgICAgICogR2V0IGEgYmFja3RyYWNlIGZyb20gaW52b2NhdGlvbiBwb2ludC5cbiAgICAgICAgICpcbiAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG9wdHNcbiAgICAgICAgICogQHJldHVybnMge0FycmF5fSBvZiBTdGFja0ZyYW1lXG4gICAgICAgICAqL1xuICAgICAgICBnZXQ6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGdldChvcHRzKSB7XG4gICAgICAgICAgICB2YXIgZXJyID0gX2dlbmVyYXRlRXJyb3IoKTtcbiAgICAgICAgICAgIHJldHVybiBfaXNTaGFwZWRMaWtlUGFyc2FibGVFcnJvcihlcnIpID8gdGhpcy5mcm9tRXJyb3IoZXJyLCBvcHRzKSA6IHRoaXMuZ2VuZXJhdGVBcnRpZmljaWFsbHkob3B0cyk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEdldCBhIGJhY2t0cmFjZSBmcm9tIGludm9jYXRpb24gcG9pbnQuXG4gICAgICAgICAqIElNUE9SVEFOVDogRG9lcyBub3QgaGFuZGxlIHNvdXJjZSBtYXBzIG9yIGd1ZXNzIGZ1bmN0aW9uIG5hbWVzIVxuICAgICAgICAgKlxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0c1xuICAgICAgICAgKiBAcmV0dXJucyB7QXJyYXl9IG9mIFN0YWNrRnJhbWVcbiAgICAgICAgICovXG4gICAgICAgIGdldFN5bmM6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGdldFN5bmMob3B0cykge1xuICAgICAgICAgICAgb3B0cyA9IF9tZXJnZShfb3B0aW9ucywgb3B0cyk7XG4gICAgICAgICAgICB2YXIgZXJyID0gX2dlbmVyYXRlRXJyb3IoKTtcbiAgICAgICAgICAgIHZhciBzdGFjayA9IF9pc1NoYXBlZExpa2VQYXJzYWJsZUVycm9yKGVycikgPyBFcnJvclN0YWNrUGFyc2VyLnBhcnNlKGVycikgOiBTdGFja0dlbmVyYXRvci5iYWNrdHJhY2Uob3B0cyk7XG4gICAgICAgICAgICByZXR1cm4gX2ZpbHRlcmVkKHN0YWNrLCBvcHRzLmZpbHRlcik7XG4gICAgICAgIH0sXG5cbiAgICAgICAgLyoqXG4gICAgICAgICAqIEdpdmVuIGFuIGVycm9yIG9iamVjdCwgcGFyc2UgaXQuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7RXJyb3J9IGVycm9yIG9iamVjdFxuICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gb3B0c1xuICAgICAgICAgKiBAcmV0dXJucyB7UHJvbWlzZX0gZm9yIEFycmF5W1N0YWNrRnJhbWV9XG4gICAgICAgICAqL1xuICAgICAgICBmcm9tRXJyb3I6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGZyb21FcnJvcihlcnJvciwgb3B0cykge1xuICAgICAgICAgICAgb3B0cyA9IF9tZXJnZShfb3B0aW9ucywgb3B0cyk7XG4gICAgICAgICAgICB2YXIgZ3BzID0gbmV3IFN0YWNrVHJhY2VHUFMob3B0cyk7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSkge1xuICAgICAgICAgICAgICAgIHZhciBzdGFja2ZyYW1lcyA9IF9maWx0ZXJlZChFcnJvclN0YWNrUGFyc2VyLnBhcnNlKGVycm9yKSwgb3B0cy5maWx0ZXIpO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoUHJvbWlzZS5hbGwoc3RhY2tmcmFtZXMubWFwKGZ1bmN0aW9uKHNmKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiByZXNvbHZlT3JpZ2luYWwoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShzZik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGdwcy5waW5wb2ludChzZikudGhlbihyZXNvbHZlLCByZXNvbHZlT3JpZ2luYWwpWydjYXRjaCddKHJlc29sdmVPcmlnaW5hbCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH0pKSk7XG4gICAgICAgICAgICB9LmJpbmQodGhpcykpO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBVc2UgU3RhY2tHZW5lcmF0b3IgdG8gZ2VuZXJhdGUgYSBiYWNrdHJhY2UuXG4gICAgICAgICAqXG4gICAgICAgICAqIEBwYXJhbSB7T2JqZWN0fSBvcHRzXG4gICAgICAgICAqIEByZXR1cm5zIHtQcm9taXNlfSBvZiBBcnJheVtTdGFja0ZyYW1lXVxuICAgICAgICAgKi9cbiAgICAgICAgZ2VuZXJhdGVBcnRpZmljaWFsbHk6IGZ1bmN0aW9uIFN0YWNrVHJhY2UkJGdlbmVyYXRlQXJ0aWZpY2lhbGx5KG9wdHMpIHtcbiAgICAgICAgICAgIG9wdHMgPSBfbWVyZ2UoX29wdGlvbnMsIG9wdHMpO1xuICAgICAgICAgICAgdmFyIHN0YWNrRnJhbWVzID0gU3RhY2tHZW5lcmF0b3IuYmFja3RyYWNlKG9wdHMpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBvcHRzLmZpbHRlciA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIHN0YWNrRnJhbWVzID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NlIGlmICh0eXBlb2YgZm4uX19zdGFja3RyYWNlT3JpZ2luYWxGbiA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgIC8vIEFscmVhZHkgaW5zdHJ1bWVudGVkLCByZXR1cm4gZ2l2ZW4gRnVuY3Rpb25cbiAgICAgICAgICAgICAgICByZXR1cm4gZm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHZhciBpbnN0cnVtZW50ZWQgPSBmdW5jdGlvbiBTdGFja1RyYWNlJCRpbnN0cnVtZW50ZWQoKSB7XG4gICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXQoKS50aGVuKGNhbGxiYWNrLCBlcnJiYWNrKVsnY2F0Y2gnXShlcnJiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZuLmFwcGx5KHRoaXNBcmcgfHwgdGhpcywgYXJndW1lbnRzKTtcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChfaXNTaGFwZWRMaWtlUGFyc2FibGVFcnJvcihlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5mcm9tRXJyb3IoZSkudGhlbihjYWxsYmFjaywgZXJyYmFjaylbJ2NhdGNoJ10oZXJyYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LmJpbmQodGhpcyk7XG4gICAgICAgICAgICBpbnN0cnVtZW50ZWQuX19zdGFja3RyYWNlT3JpZ2luYWxGbiA9IGZuO1xuXG4gICAgICAgICAgICByZXR1cm4gaW5zdHJ1bWVudGVkO1xuICAgICAgICB9LFxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBHaXZlbiBhIGZ1bmN0aW9uIHRoYXQgaGFzIGJlZW4gaW5zdHJ1bWVudGVkLFxuIC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AgKiBAcGFyYW0ge09iamVjdH0gcmVxdWVzdE9wdGlvbnNcbiAgICAgICAgICovXG4gICAgICAgIHJlcG9ydDogZnVuY3Rpb24gU3RhY2tUcmFjZSQkcmVwb3J0KHN0YWNrZnJhbWVzLCB1cmwsIGVycm9yTXNnLCByZXF1ZXN0T3B0aW9ucykge1xuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgICAgICAgICAgIHZhciByZXEgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICByZXEub25lcnJvciA9IHJlamVjdDtcbiAgICAgICAgICAgICAgICByZXEub25yZWFkeXN0YXRlY2hhbmdlID0gZnVuY3Rpb24gb25yZWFkeXN0YXRlY2hhbmdlKCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVxLnJlYWR5U3RhdGUgPT09IDQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXEuc3RhdHVzID49IDIwMCAmJiByZXEuc3RhdHVzIDwgNDAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXEucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcignUE9TVCB0byAnICsgdXJsICsgJyBmYWlsZWQgd2l0aCBzdGF0dXM6ICcgKyByZXEuc3RhdHVzKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHJlcS5vcGVuKCdwb3N0JywgdXJsKTtcblxuICAgICAgICAgICAgICAgIC8vIFNldCByZXF1ZXN0IGhlYWRlcnNcbiAgICAgICAgICAgICAgICByZXEuc2V0UmVxdWVzdEhlYWRlcignQ29udGVudC1UeXBlJywgJ2FwcGxpY2F0aW9uL2pzb24nKTtcbiAgICAgICAgICAgICAgICBpZiAocmVxdWVzdE9wdGlvbnMgJiYgdHlwZW9mIHJlcXVlc3RPcHRpb25zLmhlYWRlcnMgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBoZWFkZXJzID0gcmVxdWVzdE9wdGlvbnMuaGVhZGVycztcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaGVhZGVyIGluIGhlYWRlcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoaGVhZGVycywgaGVhZGVyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcS5zZXRSZXF1ZXN0SGVhZGVyKGhlYWRlciwgaGVhZGVyc1toZWFkZXJdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciByZXBvcnRQYXlsb2FkID0ge3N0YWNrOiBzdGFja2ZyYW1lc307XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yTXNnICE9PSB1bmRlZmluZWQgJiYgZXJyb3JNc2cgIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVwb3J0UGF5bG9hZC5tZXNzYWdlID0gZXJyb3JNc2c7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmVxLnNlbmQoSlNPTi5zdHJpbmdpZnkocmVwb3J0UGF5bG9hZCkpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9O1xufSkpO1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///401\n")},3744:(__unused_webpack_module,exports)=>{"use strict";eval("var __webpack_unused_export__;\n\n__webpack_unused_export__ = ({ value: true });\n// runtime helper for setting properties on components\n// in a tree-shakable way\nexports.Z = (sfc, props) => {\n const target = sfc.__vccOpts || sfc;\n for (const [key, val] of props) {\n target[key] = val;\n }\n return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc0NC5qcyIsIm1hcHBpbmdzIjoiO0FBQWE7QUFDYiw2QkFBNkMsRUFBRSxhQUFhLENBQUM7QUFDN0Q7QUFDQTtBQUNBLFNBQWU7QUFDZjtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvdnVlLWxvYWRlci9kaXN0L2V4cG9ydEhlbHBlci5qcz9iOWE2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuT2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFwiX19lc01vZHVsZVwiLCB7IHZhbHVlOiB0cnVlIH0pO1xuLy8gcnVudGltZSBoZWxwZXIgZm9yIHNldHRpbmcgcHJvcGVydGllcyBvbiBjb21wb25lbnRzXG4vLyBpbiBhIHRyZWUtc2hha2FibGUgd2F5XG5leHBvcnRzLmRlZmF1bHQgPSAoc2ZjLCBwcm9wcykgPT4ge1xuICAgIGNvbnN0IHRhcmdldCA9IHNmYy5fX3ZjY09wdHMgfHwgc2ZjO1xuICAgIGZvciAoY29uc3QgW2tleSwgdmFsXSBvZiBwcm9wcykge1xuICAgICAgICB0YXJnZXRba2V5XSA9IHZhbDtcbiAgICB9XG4gICAgcmV0dXJuIHRhcmdldDtcbn07XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///3744\n")},7024:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n "Z": () => (/* binding */ TTMultiFactorAuthentication)\n});\n\n// EXTERNAL MODULE: ./node_modules/vue/dist/vue.esm-bundler.js + 6 modules\nvar vue_esm_bundler = __webpack_require__(5166);\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[1]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[6].use[0]!./interface/html5/components/login/TTMultiFactorAuthentication.vue?vue&type=template&id=0595b328&scoped=true\n\n\nconst _withScopeId = n => ((0,vue_esm_bundler/* pushScopeId */.dD)("data-v-0595b328"),n=n(),(0,vue_esm_bundler/* popScopeId */.Cn)(),n)\nconst _hoisted_1 = { class: "mfa-modal" }\nconst _hoisted_2 = { class: "mfa-modal-content" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/(0,vue_esm_bundler/* createElementVNode */._)("img", {\n class: "mfa-modal-image",\n src: "theme/default/images/bell_permissions.svg"\n}, null, -1 /* HOISTED */))\nconst _hoisted_4 = { class: "mfa-modal-title" }\nconst _hoisted_5 = { class: "p-float-label password-container" }\nconst _hoisted_6 = { class: "password-label" }\nconst _hoisted_7 = { class: "checkbox-container" }\nconst _hoisted_8 = {\n class: "checkbox-center",\n for: "remember-me"\n}\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_ProgressSpinner = (0,vue_esm_bundler/* resolveComponent */.up)("ProgressSpinner")\n const _component_Password = (0,vue_esm_bundler/* resolveComponent */.up)("Password")\n const _component_Checkbox = (0,vue_esm_bundler/* resolveComponent */.up)("Checkbox")\n\n return ((0,vue_esm_bundler/* openBlock */.wg)(), (0,vue_esm_bundler/* createElementBlock */.iD)("div", _hoisted_1, [\n (0,vue_esm_bundler/* createElementVNode */._)("div", _hoisted_2, [\n (0,vue_esm_bundler/* createElementVNode */._)("span", {\n onClick: _cache[0] || (_cache[0] = (...args) => ($options.closeModal && $options.closeModal(...args))),\n class: "mfa-modal-close"\n }, "×"),\n _hoisted_3,\n (0,vue_esm_bundler/* createElementVNode */._)("h2", _hoisted_4, (0,vue_esm_bundler/* toDisplayString */.zw)($data.labels.title), 1 /* TEXT */),\n (0,vue_esm_bundler/* withDirectives */.wy)((0,vue_esm_bundler/* createElementVNode */._)("p", { class: "mfa-modal-body" }, (0,vue_esm_bundler/* toDisplayString */.zw)($data.labels.body), 513 /* TEXT, NEED_PATCH */), [\n [vue_esm_bundler/* vShow */.F8, this.step != \'password\']\n ]),\n ($data.show_spinner)\n ? ((0,vue_esm_bundler/* openBlock */.wg)(), (0,vue_esm_bundler/* createBlock */.j4)(_component_ProgressSpinner, {\n key: 0,\n style: {"width":"50px","height":"50px"},\n strokeWidth: "5",\n animationDuration: "2s"\n }))\n : (0,vue_esm_bundler/* createCommentVNode */.kq)("v-if", true),\n (0,vue_esm_bundler/* createElementVNode */._)("form", {\n onSubmit: _cache[4] || (_cache[4] = (...args) => ($options.onFormSubmit && $options.onFormSubmit(...args))),\n class: "form-container",\n id: "login-form"\n }, [\n (0,vue_esm_bundler/* withDirectives */.wy)((0,vue_esm_bundler/* createElementVNode */._)("div", _hoisted_5, [\n (0,vue_esm_bundler/* createElementVNode */._)("h5", _hoisted_6, (0,vue_esm_bundler/* toDisplayString */.zw)($data.labels.current_password), 1 /* TEXT */),\n (0,vue_esm_bundler/* createVNode */.Wm)(_component_Password, {\n id: "password-input",\n modelValue: $data.user_password,\n "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (($data.user_password) = $event)),\n ref: "password_input",\n feedback: false,\n toggleMask: ""\n }, null, 8 /* PROPS */, ["modelValue"])\n ], 512 /* NEED_PATCH */), [\n [vue_esm_bundler/* vShow */.F8, this.step === \'password\']\n ]),\n (0,vue_esm_bundler/* withDirectives */.wy)((0,vue_esm_bundler/* createElementVNode */._)("div", _hoisted_7, [\n (0,vue_esm_bundler/* createVNode */.Wm)(_component_Checkbox, {\n inputId: "remember-me",\n onChange: $options.toggleTrustedDevice,\n modelValue: $data.enable_trusted_device,\n "onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (($data.enable_trusted_device) = $event)),\n binary: true\n }, null, 8 /* PROPS */, ["onChange", "modelValue"]),\n (0,vue_esm_bundler/* createElementVNode */._)("label", _hoisted_8, (0,vue_esm_bundler/* toDisplayString */.zw)($data.labels.remember_me), 1 /* TEXT */)\n ], 512 /* NEED_PATCH */), [\n [vue_esm_bundler/* vShow */.F8, $options.show_trusted_device_checkbox]\n ]),\n (0,vue_esm_bundler/* createElementVNode */._)("button", {\n type: "submit",\n id: "mfa-submit-button",\n class: (0,vue_esm_bundler/* normalizeClass */.C_)(["mfa-modal-button", { \'resend-button\': this.step === \'start_listen\' }]),\n onClick: _cache[3] || (_cache[3] = (...args) => ($options.onFormSubmit && $options.onFormSubmit(...args)))\n }, (0,vue_esm_bundler/* toDisplayString */.zw)($options.button_text), 3 /* TEXT, CLASS */)\n ], 32 /* HYDRATE_EVENTS */)\n ])\n ]))\n}\n;// CONCATENATED MODULE: ./interface/html5/components/login/TTMultiFactorAuthentication.vue?vue&type=template&id=0595b328&scoped=true\n\n// EXTERNAL MODULE: ./node_modules/primevue/inputtext/inputtext.esm.js\nvar inputtext_esm = __webpack_require__(6076);\n// EXTERNAL MODULE: ./node_modules/primevue/utils/utils.esm.js\nvar utils_esm = __webpack_require__(6954);\n;// CONCATENATED MODULE: ./node_modules/primevue/checkbox/checkbox.esm.js\n\n\n\nvar script = {\n name: \'Checkbox\',\n inheritAttrs: false,\n emits: [\'click\', \'update:modelValue\', \'change\', \'input\'],\n props: {\n value: null,\n modelValue: null,\n binary: Boolean,\n class: null,\n style: null,\n trueValue: {\n type: null,\n default: true\n },\n falseValue: {\n type: null,\n default: false\n }\n },\n data() {\n return {\n focused: false\n };\n },\n methods: {\n onClick(event) {\n if (!this.$attrs.disabled) {\n let newModelValue;\n\n if (this.binary) {\n newModelValue = this.checked ? this.falseValue : this.trueValue;\n }\n else {\n if (this.checked)\n newModelValue = this.modelValue.filter(val => !utils_esm/* ObjectUtils.equals */.gb.equals(val, this.value));\n else\n newModelValue = this.modelValue ? [...this.modelValue, this.value] : [this.value];\n }\n\n this.$emit(\'click\', event);\n this.$emit(\'update:modelValue\', newModelValue);\n this.$emit(\'change\', event);\n this.$emit(\'input\', newModelValue);\n this.$refs.input.focus();\n }\n },\n onFocus() {\n this.focused = true;\n },\n onBlur() {\n this.focused = false;\n }\n },\n computed: {\n checked() {\n return this.binary ? this.modelValue === this.trueValue : utils_esm/* ObjectUtils.contains */.gb.contains(this.value, this.modelValue);\n },\n containerClass() {\n return [\'p-checkbox p-component\', this.class, {\'p-checkbox-checked\': this.checked, \'p-checkbox-disabled\': this.$attrs.disabled, \'p-checkbox-focused\': this.focused}];\n }\n }\n};\n\nconst checkbox_esm_hoisted_1 = { class: "p-hidden-accessible" };\n\nfunction checkbox_esm_render(_ctx, _cache, $props, $setup, $data, $options) {\n return ((0,vue_esm_bundler/* openBlock */.wg)(), (0,vue_esm_bundler/* createBlock */.j4)("div", {\n class: $options.containerClass,\n onClick: _cache[3] || (_cache[3] = $event => ($options.onClick($event))),\n style: $props.style\n }, [\n (0,vue_esm_bundler/* createVNode */.Wm)("div", checkbox_esm_hoisted_1, [\n (0,vue_esm_bundler/* createVNode */.Wm)("input", (0,vue_esm_bundler/* mergeProps */.dG)({\n ref: "input",\n type: "checkbox",\n checked: $options.checked,\n value: $props.value\n }, _ctx.$attrs, {\n onFocus: _cache[1] || (_cache[1] = (...args) => ($options.onFocus && $options.onFocus(...args))),\n onBlur: _cache[2] || (_cache[2] = (...args) => ($options.onBlur && $options.onBlur(...args)))\n }), null, 16, ["checked", "value"])\n ]),\n (0,vue_esm_bundler/* createVNode */.Wm)("div", {\n ref: "box",\n class: [\'p-checkbox-box\', {\'p-highlight\': $options.checked, \'p-disabled\': _ctx.$attrs.disabled, \'p-focus\': $data.focused}],\n role: "checkbox",\n "aria-checked": $options.checked\n }, [\n (0,vue_esm_bundler/* createVNode */.Wm)("span", {\n class: [\'p-checkbox-icon\', {\'pi pi-check\': $options.checked}]\n }, null, 2)\n ], 10, ["aria-checked"])\n ], 6))\n}\n\nscript.render = checkbox_esm_render;\n\n/* harmony default export */ const checkbox_esm = (script);\n\n// EXTERNAL MODULE: ./interface/html5/global/Global.js\nvar Global = __webpack_require__(9490);\n// EXTERNAL MODULE: ./interface/html5/services/TTVueUtils.js\nvar TTVueUtils = __webpack_require__(4966);\n// EXTERNAL MODULE: ./node_modules/primevue/progressspinner/progressspinner.esm.js\nvar progressspinner_esm = __webpack_require__(1895);\n// EXTERNAL MODULE: ./node_modules/primevue/password/password.esm.js\nvar password_esm = __webpack_require__(4902);\n;// CONCATENATED MODULE: ./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[6].use[0]!./interface/html5/components/login/TTMultiFactorAuthentication.vue?vue&type=script&lang=js\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\n\n\n\n\n\n/* harmony default export */ const TTMultiFactorAuthenticationvue_type_script_lang_js = ({\n created() {\n this.event_bus = new TTEventBus( {\n component_id: this.component_id,\n } );\n },\n mounted() {\n this.onMFAStepChange();\n },\n props: { // passed in via root props when component is mounted\n view_id: {\n type: String,\n default: null\n },\n component_id: { /* Note: This is passed in via TTVueUtils.mountComponent param, and auto added to root_props. */\n type: String,\n default: null\n },\n session_type: {\n type: String,\n default: \'user_name\'\n },\n user_name: {\n type: String,\n default: \'\'\n },\n mfa_data: {\n type: Object,\n default: {}\n },\n authenticate_callback: {\n type: Function,\n default: null\n },\n is_reauthentication: {\n type: Boolean,\n default: false\n },\n },\n data() {\n return {\n doing_login: false,\n show_spinner: false,\n resending_notification: false,\n step: this.mfa_data.step,\n type_id: this.mfa_data.type_id,\n user_password: \'\',\n authentication_api: TTAPI.APIAuthentication,\n enable_trusted_device: getCookie( \'TrustedDevice\' ) !== \'\', //If cookie is set, default checkbox to true.\n labels: {\n title: $.i18n._( \'Authentication Required\' ),\n body: this.mfa_data.user_action_message,\n password: $.i18n._( \'Password\' ),\n current_password: $.i18n._( \'Current Password\' ),\n remember_me: $.i18n._( \'This is a trusted device. Remember Me\' ),\n }\n };\n },\n computed: {\n button_text() {\n if ( this.resending_notification === true ) {\n return $.i18n._( \'Resending...\' );\n } else if ( this.step === \'password\' ) {\n return $.i18n._( \'Confirm Password\' );\n } else if ( this.step === \'start_listen\' ) {\n return $.i18n._( \'Resend\' );\n }\n },\n show_trusted_device_checkbox() {\n //If cookie is set, don\'t show checkbox. Also only show during login and not re-authentication.\n return getCookie( \'TrustedDevice\' ) === \'\' && ( this.step === \'password\' || this.step === \'start_listen\' ) && this.is_reauthentication === false;\n }\n },\n methods: {\n onMFAStepChange() {\n switch ( this.step ) {\n case \'password\':\n break;\n case \'start_listen\':\n this.doMultiFactorAuthentication();\n break;\n case \'login\':\n this.login();\n break;\n }\n },\n setMFAStep( step ) {\n this.step = step;\n setTimeout( () => {\n //Timeout so that Vue triggers and udates form layout before we interact with the form.\n this.onMFAStepChange();\n }, 100 );\n },\n onFormSubmit( event ) {\n event.preventDefault();\n\n switch ( this.step ) {\n case \'password\':\n this.login();\n break;\n case \'start_listen\': //Resend\n this.sendMultiFactorNotification();\n let submit_button = document.querySelector( \'#mfa-submit-button\' );\n submit_button.disabled = true;\n this.resending_notification = true;\n setTimeout( () => {\n submit_button.disabled = false;\n this.resending_notification = false;\n }, 3000 );\n break;\n }\n },\n toggleTrustedDevice() {\n //Cancels the server listen loop and immediately restarts with $enable_trusted_device set to the users choice.\n //This simplifies the process of notifying the server that the user wants to use a trusted device during an otherwise long running loop.\n this.authentication_api.validateMultiFactor( false, LocalCacheData.getSessionID(), \'\', { restart_listen: true }, {\n onResult: ( res ) => {\n //We are not doing anything with this result.\n }\n } );\n },\n sendMultiFactorNotification() {\n this.authentication_api.sendMultiFactorNotification( {\n onResult: ( res ) => {\n //We are not doing anything with this result.\n }\n } );\n },\n startMultiFactorListen( repeat_count ) {\n this.authentication_api.listenForMultiFactorAuthentication( this.enable_trusted_device, {\n onResult: ( response ) => {\n if ( response.isValid() ) {\n let result = response.getResult();\n if ( result.status === \'completed\' ) {\n this.closeModal();\n this.authenticate_callback( true );\n } else if ( result.status === \'restart_listen\' ) {\n this.restartListen( repeat_count );\n } else if ( result.status === \'cancelled\' ) {\n this.closeModal();\n TAlertManager.showAlert( $.i18n._( \'Multifactor authentication has been cancelled. Please try again.\', $.i18n._( \'Multifactor Authentication Cancelled\' ) ) );\n }\n } else {\n this.closeModal();\n }\n },\n onError: ( err ) => {\n this.closeModal();\n }\n } );\n },\n restartListen( repeat_count ) {\n if ( repeat_count < 12 ) {\n this.startMultiFactorListen( repeat_count + 1 );\n } else {\n this.closeModal();\n TAlertManager.showAlert( $.i18n._( \'Multifactor authentication timed out. Please try again.\', $.i18n._( \'Multifactor Authentication Timed Out\' ) ) );\n }\n },\n doMultiFactorAuthentication() {\n this.show_spinner = true;\n this.sendMultiFactorNotification();\n this.startMultiFactorListen( 1 );\n\n ProgressBar.removeProgressBar();\n },\n cancelMultiFactorListen() {\n if ( Array.isArray( $.xhrPool ) ) {\n for ( let i = 0; i < $.xhrPool.length; i++ ) {\n if ( $.xhrPool[i].url.includes( \'listenForMultiFactorAuthentication\' ) ) {\n $.xhrPool[i].jqXHR.abort();\n }\n }\n }\n },\n closeModal() {\n this.event_bus.emit( \'tt_login\', \'user_closed_mfa_modal\', {\n status: true\n } );\n this.show_spinner = false;\n this.cancelMultiFactorListen();\n TTVueUtils/* default.unmountComponent */.Z.unmountComponent( this.component_id );\n },\n login() {\n if ( this.doing_login == true ) {\n return;\n }\n\n this.doing_login = true;\n\n let login_session_type = this.session_type;\n //Force session type MFA. This is required for initial MFA setup and upgrading normal sessions to MFA sessions.\n if ( this.session_type != \'user_name_multi_factor\' && this.type_id > 0 ) {\n login_session_type = \'user_name_multi_factor\';\n }\n\n Global/* Global.login */.x.login( this.user_name, this.user_password, login_session_type, this.is_reauthentication, ( res ) => {\n this.doing_login = false;\n\n if ( res.isValid() ) {\n let result = res.getResult();\n\n if ( this.type_id == 0 ) { //0 = Password (Not MFA)\n this.doing_login = false;\n this.authenticate_callback( true );\n } else if ( this.type_id == 10 && result.mfa.step == \'start_listen\' ) { // 10 = MFA App\n this.setMFAStep( \'start_listen\' );\n }\n }\n } );\n },\n },\n components: {\n InputText: inputtext_esm["default"],\n Checkbox: checkbox_esm,\n ProgressSpinner: progressspinner_esm/* default */.Z,\n Password: password_esm/* default */.Z\n }\n});\n\n;// CONCATENATED MODULE: ./interface/html5/components/login/TTMultiFactorAuthentication.vue?vue&type=script&lang=js\n \n// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js\nvar exportHelper = __webpack_require__(3744);\n;// CONCATENATED MODULE: ./interface/html5/components/login/TTMultiFactorAuthentication.vue\n\n\n\n\n;\n\n\nconst __exports__ = /*#__PURE__*/(0,exportHelper/* default */.Z)(TTMultiFactorAuthenticationvue_type_script_lang_js, [[\'render\',render],[\'__scopeId\',"data-v-0595b328"]])\n\n/* harmony default export */ const TTMultiFactorAuthentication = (__exports__);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAyNC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7cUJBQ1MsS0FBSyxFQUFDLFdBQVc7cUJBQ2IsS0FBSyxFQUFDLG1CQUFtQjtpRUFDZ0MsOENBQTZFO0VBQXhFLEtBQUssRUFBQyxpQkFBaUI7RUFBQyxHQUFHLEVBQUMsMkNBQTJDOztxQkFDbEksS0FBSyxFQUFDLGlCQUFpQjtxQkFJZ0IsS0FBSyxFQUFDLGtDQUFrQztxQkFDdkUsS0FBSyxFQUFDLGdCQUFnQjtxQkFHYSxLQUFLLEVBQUMsb0JBQW9COztFQUUxRCxLQUFLLEVBQUMsaUJBQWlCO0VBQUMsR0FBRyxFQUFDLGFBQWE7Ozs7Ozs7O21EQWJoRSwrQ0FrQk0sT0FsQk4sVUFrQk07SUFqQkYsOENBZ0JNLE9BaEJOLFVBZ0JNO01BZkYsOENBQTBEO1FBQW5ELE9BQUssMENBQUUsbURBQVU7UUFBRSxL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gICAgICAgICAgIGRlZmF1bHQ6IHt9XG4gICAgICAgIH0sXG4gICAgICAgIGF1dGhlbnRpY2F0ZV9jYWxsYmFjazoge1xuICAgICAgICAgICAgdHlwZTogRnVuY3Rpb24sXG4gICAgICAgICAgICBkZWZhdWx0OiBudWxsXG4gICAgICAgIH0sXG4gICAgICAgIGlzX3JlYXV0aGVudGljYXRpb246IHtcbiAgICAgICAgICAgIHR5cGU6IEJvb2xlYW4sXG4gICAgICAgICAgICBkZWZhdWx0OiBmYWxzZVxuICAgICAgICB9LFxuICAgIH0sXG4gICAgZGF0YSgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIGRvaW5nX2xvZ2luOiBmYWxzZSxcbiAgICAgICAgICAgIHNob3dfc3Bpbm5lcjogZmFsc2UsXG4gICAgICAgICAgICByZXNlbmRpbmdfbm90aWZpY2F0aW9uOiBmYWxzZSxcbiAgICAgICAgICAgIHN0ZXA6IHRoaXMubWZhX2RhdGEuc3RlcCxcbiAgICAgICAgICAgIHR5cGVfaWQ6IHRoaXMubWZhX2RhdGEudHlwZV9pZCxcbiAgICAgICAgICAgIHVzZXJfcGFzc3dvcmQ6ICcnLFxuICAgICAgICAgICAgYXV0aGVudGljYXRpb25fYXBpOiBUVEFQSS5BUElBdXRoZW50aWNhdGlvbixcbiAgICAgICAgICAgIGVuYWJsZV90cnVzdGVkX2RldmljZTogZ2V0Q29va2llKCAnVHJ1c3RlZERldmljZScgKSAhPT0gJycsIC8vSWYgY29va2llIGlzIHNldCwgZGVmYXVsdCBjaGVja2JveCB0byB0cnVlLlxuICAgICAgICAgICAgbGFiZWxzOiB7XG4gICAgICAgICAgICAgICAgdGl0bGU6ICQuaTE4bi5fKCAnQXV0aGVudGljYXRpb24gUmVxdWlyZWQnICksXG4gICAgICAgICAgICAgICAgYm9keTogdGhpcy5tZmFfZGF0YS51c2VyX2FjdGlvbl9tZXNzYWdlLFxuICAgICAgICAgICAgICAgIHBhc3N3b3JkOiAkLmkx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aGlzLnN0ZXAgPT09ICdzdGFydF9saXN0ZW4nICkgJiYgdGhpcy5pc19yZWF1dGhlbnRpY2F0aW9uID09PSBmYWxzZTtcbiAgICAgICAgfVxuICAgIH0sXG4gICAgbWV0aG9kczoge1xuICAgICAgICBvbk1GQVN0ZXBDaGFuZ2UoKSB7XG4gICAgICAgICAgICBzd2l0Y2ggKCB0aGlzLnN0ZXAgKSB7XG4gICAgICAgICAgICAgICAgY2FzZSAncGFzc3dvcmQnOlxuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdzdGFydF9saXN0ZW4nOlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRvTXVsdGlGYWN0b3JBdXRoZW50aWNhdGlvbigpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICBjYXNlICdsb2dpbic6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9naW4oKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHNldE1GQVN0ZXAoIHN0ZXAgKSB7XG4gICAgICAgICAgICB0aGlzLnN0ZXAgPSBzdGVwO1xuICAgICAgICAgICAgc2V0VGltZW91dCggKCkgPT4ge1xuICAgICAgICAgICAgICAgIC8vVGltZW91dCBzbyB0aGF0IFZ1ZSB0cmlnZ2VycyBhbmQgdWRhdGVzIGZvcm0gbGF5b3V0IGJlZm9yZSB3ZSBpbnRlcmFjdCB3aXRoIHRoZSBmb3JtLlxuICAgICAgICAgICAgICAgIHRoaXMub25NRkFTdGVwQ2hhbmdlKCk7XG4gICAgICAgICAgICB9LCAxMDAgKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25Gb3JtU3VibWl0KCBldmVudCApIHtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG5cbiAgICAgICAgICAgIHN3aXRjaCAoIHRoaXMuc3RlcCApIHtcbiAgICAgICAgICAgICAgICBjYXNlICdwYXNzd29yZCc6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMubG9naW4oKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgY2FzZSAnc3RhcnRfbGlzdGVuJzogLy9SZXNlbmRcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZW5kTXVsdGlGYWN0b3JOb3RpZmljYXRpb24oKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Ym1pdF9idXR0b24gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCAnI21mYS1zdWJtaXQtYnV0dG9uJyApO1xuICAgICAgICAgICAgICAgICAgICBzdWJtaXRfYnV0dG9uLmRpc2FibGVkID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNlbmRpbmdfbm90aWZpY2F0aW9uID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCggKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgc3VibWl0X2J1dHRvbi5kaXNhYmxlZCA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNlbmRpbmdfbm90aWZpY2F0aW9uID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgIH0sIDMwMDAgKTtcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHRvZ2dsZVRydXN0ZWREZXZpY2UoKSB7XG4gICAgICAgICAgICAvL0NhbmNlbHMgdGhlIHNlcnZlciBsaXN0ZW4gbG9vcCBhbmQgaW1tZWRpYXRlbHkgcmVzdGFydHMgd2l0aCAkZW5hYmxlX3RydXN0ZWRfZGV2aWNlIHNldCB0byB0aGUgdXNlcnMgY2hvaWNlLlxuICAgICAgICAgICAgLy9UaGlzIHNpbXBsaWZpZXMgdGhlIHByb2Nlc3Mgb2Ygbm90aWZ5aW5nIHRoZSBzZXJ2ZXIgdGhhdCB0aGUgdXNlciB3YW50cyB0byB1c2UgYSB0cnVzdGVkIGRldmljZSBkdXJpbmcgYW4gb3RoZXJ3aXNlIGxvbmcgcnVubmluZyBsb29wLlxuICAgICAgICAgICAgdGhpcy5hdXRoZW50aWNhdGlvbl9hcGkudmFsaWRhdGVNdWx0aUZhY3RvciggZmFsc2UsIExvY2FsQ2FjaGVEYXRhLmdldFNlc3Npb25JRCgpLCAnJywgeyByZXN0YXJ0X2xpc3RlbjogdHJ1ZSB9LCB7XG4gICAgICAgICAgICAgICAgb25SZXN1bHQ6ICggcmVzICkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAvL1dlIGFyZSBub3QgZG9pbmcgYW55dGhpbmcgd2l0aCB0aGlzIHJlc3VsdC5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9ICk7XG4gICAgICAgIH0sXG4gICAgICAgIHNlbmRNdWx0aUZhY3Rvck5vdGlmaWNhdGlvbigpIHtcbiAgICAgICAgICAgIHRoaXMuYXV0aGVudGljYXRpb25fYXBpLnNlbmRNdWx0aUZhY3Rvck5vdGlmaWNhdGlvbigge1xuICAgICAgICAgICAgICAgIG9uUmVzdWx0OiAoIHJlcyApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgLy9XZSBhcmUgbm90IGRvaW5nIGFueXRoaW5nIHdpdGggdGhpcyByZXN1bHQuXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSApO1xuICAgICAgICB9LFxuICAgICAgICBzdGFydE11bHRpRmFjdG9yTGlzdGVuKCByZXBlYXRfY291bnQgKSB7XG4gICAgICAgICAgICB0aGlzLmF1dGhlbnRpY2F0aW9uX2FwaS5saXN0ZW5Gb3JNdWx0aUZhY3RvckF1dGhlbnRpY2F0aW9uKCB0aGlzLmVuYWJsZV90cnVzdGVkX2RldmljZSwge1xuICAgICAgICAgICAgICAgIG9uUmVzdWx0OiAoIHJlc3BvbnNlICkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHJlc3BvbnNlLmlzVmFsaWQoKSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXNwb25zZS5nZXRSZXN1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcmVzdWx0LnN0YXR1cyA9PT0gJ2NvbXBsZXRlZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jbG9zZU1vZGFsKCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5hdXRoZW50aWNhdGVfY2FsbGJhY2soIHRydWUgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIHJlc3VsdC5zdGF0dXMgPT09ICdyZXN0YXJ0X2xpc3RlbicgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXN0YXJ0TGlzdGVuKCByZXBlYXRfY291bnQgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIHJlc3VsdC5zdGF0dXMgPT09ICdjYW5jZWxsZWQnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2xvc2VNb2RhbCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRBbGVydE1hbmFnZXIuc2hvd0FsZXJ0KCAkLmkxOG4uXyggJ011bHRpZmFjdG9yIGF1dGhlbnRpY2F0aW9uIGhhcyBiZWVuIGNhbmNlbGxlZC4gUGxlYXNlIHRyeSBhZ2Fpbi4nLCAkLmkxOG4uXyggJ011bHRpZmFjdG9yIEF1dGhlbnRpY2F0aW9uIENhbmNlbGxlZCcgKSApICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNsb3NlTW9kYWwoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgb25FcnJvcjogKCBlcnIgKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2xvc2VNb2RhbCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gKTtcbiAgICAgICAgfSxcbiAgICAgICAgcmVzdGFydExpc3RlbiggcmVwZWF0X2NvdW50ICkge1xuICAgICAgICAgICAgaWYgKCByZXBlYXRfY291bnQgPCAxMiApIHtcbiAgICAgICAgICAgICAgICB0aGlzLnN0YXJ0TXVsdGlGYWN0b3JMaXN0ZW4oIHJlcGVhdF9jb3VudCArIDEgKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jbG9zZU1vZGFsKCk7XG4gICAgICAgICAgICAgICAgVEFsZXJ0TWFuYWdlci5zaG93QWxlcnQoICQuaTE4bi5fKCAnTXVsdGlmYWN0b3IgYXV0aGVudGljYXRpb24gdGltZWQgb3V0LiBQbGVhc2UgdHJ5IGFnYWluLicsICQuaTE4bi5fKCAnTXVsdGlmYWN0b3IgQXV0aGVudGljYXRpb24gVGltZWQgT3V0JyApICkgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZG9NdWx0aUZhY3RvckF1dGhlbnRpY2F0aW9uKCkge1xuICAgICAgICAgICAgdGhpcy5zaG93X3NwaW5uZXIgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy5zZW5kTXVsdGlGYWN0b3JOb3RpZmljYXRpb24oKTtcbiAgICAgICAgICAgIHRoaXMuc3RhcnRNdWx0aUZhY3Rvckxpc3RlbiggMSApO1xuXG4gICAgICAgICAgICBQcm9ncmVzc0Jhci5yZW1vdmVQcm9ncmVzc0JhcigpO1xuICAgICAgICB9LFxuICAgICAgICBjYW5jZWxNdWx0aUZhY3Rvckxpc3RlbigpIHtcbiAgICAgICAgICAgIGlmICggQXJyYXkuaXNBcnJheSggJC54aHJQb29sICkgKSB7XG4gICAgICAgICAgICAgICAgZm9yICggbGV0IGkgPSAwOyBpIDwgJC54aHJQb29sLmxlbmd0aDsgaSsrICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoICQueGhyUG9vbFtpXS51cmwuaW5jbHVkZXMoICdsaXN0ZW5Gb3JNdWx0aUZhY3RvckF1dGhlbnRpY2F0aW9uJyApICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgJC54aHJQb29sW2ldLmpxWEhSLmFib3J0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGNsb3NlTW9kYWwoKSB7XG4gICAgICAgICAgICB0aGlzLmV2ZW50X2J1cy5lbWl0KCAndHRfbG9naW4nLCAndXNlcl9jbG9zZWRfbWZhX21vZGFsJywge1xuICAgICAgICAgICAgICAgIHN0YXR1czogdHJ1ZVxuICAgICAgICAgICAgfSApO1xuICAgICAgICAgICAgdGhpcy5zaG93X3NwaW5uZXIgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuY2FuY2VsTXVsdGlGYWN0b3JMaXN0ZW4oKTtcbiAgICAgICAgICAgIFRUVnVlVXRpbHMudW5tb3VudENvbXBvbmVudCggdGhpcy5jb21wb25lbnRfaWQgKTtcbiAgICAgICAgfSxcbiAgICAgICAgbG9naW4oKSB7XG4gICAgICAgICAgICBpZiAoIHRoaXMuZG9pbmdfbG9naW4gPT0gdHJ1ZSApIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuZG9pbmdfbG9naW4gPSB0cnVlO1xuXG4gICAgICAgICAgICBsZXQgbG9naW5fc2Vzc2lvbl90eXBlID0gdGhpcy5zZXNzaW9uX3R5cGU7XG4gICAgICAgICAgICAvL0ZvcmNlIHNlc3Npb24gdHlwZSBNRkEuIFRoaXMgaXMgcmVxdWlyZWQgZm9yIGluaXRpYWwgTUZ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ICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5jaGVja2VkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3TW9kZWxWYWx1ZSA9IHRoaXMubW9kZWxWYWx1ZS5maWx0ZXIodmFsID0+ICFPYmplY3RVdGlscy5lcXVhbHModmFsLCB0aGlzLnZhbHVlKSk7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld01vZGVsVmFsdWUgPSB0aGlzLm1vZGVsVmFsdWUgPyBbLi4udGhpcy5tb2RlbFZhbHVlLCB0aGlzLnZhbHVlXSA6IFt0aGlzLnZhbHVlXTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLiRlbWl0KCdjbGljaycsIGV2ZW50KTtcbiAgICAgICAgICAgICAgICB0aGlzLiRlbWl0KCd1cGRhdGU6bW9kZWxWYWx1ZScsIG5ld01vZGVsVmFsdWUpO1xuICAgICAgICAgICAgICAgIHRoaXMuJGVtaXQoJ2NoYW5nZScsIGV2ZW50KTtcbiAgICAgICAgICAgICAgICB0aGlzLiRlbWl0KCdpbnB1dCcsIG5ld01vZGVsVmFsdWUpO1xuICAgICAgICAgICAgICAgIHRoaXMuJHJlZnMuaW5wdXQuZm9jdXMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25Gb2N1cygpIHtcbiAgICAgICAgICAgIHRoaXMuZm9jdXNlZCA9IHRydWU7XG4gICAgICAgIH0sXG4gICAgICAgIG9uQmx1cigpIHtcbiAgICAgICAgICAgIHRoaXMuZm9jdXNlZCA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBjb21wdXRlZDoge1xuICAgICAgICBjaGVja2VkKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmluYXJ5ID8gdGhpcy5tb2RlbFZhbHVlID09PSB0aGlzLnRydWVWYWx1ZSA6I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JlbmRlcicscmVuZGVyXSxbJ19fc2NvcGVJZCcsXCJkYXRhLXYtMDU5NWIzMjhcIl1dKVxuXG5leHBvcnQgZGVmYXVsdCBfX2V4cG9ydHNfXyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7024\n')},5166:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n \"HY\": () => (/* reexport */ Fragment),\n \"lR\": () => (/* reexport */ Teleport),\n \"uT\": () => (/* reexport */ Transition),\n \"W3\": () => (/* reexport */ TransitionGroup),\n \"Fl\": () => (/* reexport */ computed),\n \"ri\": () => (/* reexport */ createApp),\n \"j4\": () => (/* reexport */ createBlock),\n \"kq\": () => (/* reexport */ createCommentVNode),\n \"iD\": () => (/* reexport */ createElementBlock),\n \"_\": () => (/* reexport */ createBaseVNode),\n \"Nv\": () => (/* reexport */ createSlots),\n \"uE\": () => (/* reexport */ createStaticVNode),\n \"Uk\": () => (/* reexport */ createTextVNode),\n \"Wm\": () => (/* reexport */ createVNode),\n \"RC\": () => (/* reexport */ defineAsyncComponent),\n \"aZ\": () => (/* reexport */ defineComponent),\n \"h\": () => (/* reexport */ h),\n \"f3\": () => (/* reexport */ inject),\n \"dG\": () => (/* reexport */ mergeProps),\n \"Y3\": () => (/* reexport */ nextTick),\n \"C_\": () => (/* reexport */ normalizeClass),\n \"j5\": () => (/* reexport */ normalizeStyle),\n \"wg\": () => (/* reexport */ openBlock),\n \"Cn\": () => (/* reexport */ popScopeId),\n \"JJ\": () => (/* reexport */ provide),\n \"dD\": () => (/* reexport */ pushScopeId),\n \"qj\": () => (/* reexport */ reactive),\n \"iH\": () => (/* reexport */ ref),\n \"Ko\": () => (/* reexport */ renderList),\n \"WI\": () => (/* reexport */ renderSlot),\n \"up\": () => (/* reexport */ resolveComponent),\n \"Q2\": () => (/* reexport */ resolveDirective),\n \"LL\": () => (/* reexport */ resolveDynamicComponent),\n \"XI\": () => (/* reexport */ shallowRef),\n \"zw\": () => (/* reexport */ toDisplayString),\n \"SU\": () => (/* reexport */ unref),\n \"nr\": () => (/* reexport */ vModelText),\n \"F8\": () => (/* reexport */ vShow),\n \"YP\": () => (/* reexport */ watch),\n \"w5\": () => (/* reexport */ withCtx),\n \"wy\": () => (/* reexport */ withDirectives),\n \"D2\": () => (/* reexport */ withKeys),\n \"iM\": () => (/* reexport */ withModifiers)\n});\n\n// UNUSED EXPORTS: BaseTransition, Comment, EffectScope, KeepAlive, ReactiveEffect, Static, Suspense, Text, VueElement, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compile, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, customRef, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isVNode, markRaw, mergeDefaults, normalizeProps, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, proxyRefs, queuePostFlushCb, readonly, registerRuntimeCompiler, render, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, ssrContextKey, ssrUtils, stop, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, version, warn, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withDefaults, withMemo, withScopeId\n\n// NAMESPACE OBJECT: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js\nvar runtime_dom_esm_bundler_namespaceObject = {};\n__webpack_require__.r(runtime_dom_esm_bundler_namespaceObject);\n__webpack_require__.d(runtime_dom_esm_bundler_namespaceObject, {\n \"BaseTransition\": () => (BaseTransition),\n \"Comment\": () => (Comment),\n \"EffectScope\": () => (EffectScope),\n \"Fragment\": () => (Fragment),\n \"KeepAlive\": () => (KeepAlive),\n \"ReactiveEffect\": () => (ReactiveEffect),\n \"Static\": () => (Static),\n \"Suspense\": () => (Suspense),\n \"Teleport\": () => (Teleport),\n \"Text\": () => (Text),\n \"Transition\": () => (Transition),\n \"TransitionGroup\": () => (TransitionGroup),\n \"VueElement\": () => (VueElement),\n \"callWithAsyncErrorHandling\": () => (callWithAsyncErrorHandling),\n \"callWithErrorHandling\": () => (callWithErrorHandling),\n \"camelize\": () => (camelize),\n \"capitalize\": () => (shared_esm_bundler_capitalize),\n \"cloneVNode\": () => (cloneVNode),\n \"compatUtils\": () => (compatUtils),\n \"computed\": () => (computed),\n \"createApp\": () => (createApp),\n \"createBlock\": () => (createBlock),\n \"createCommentVNode\": () => (createCommentVNode),\n \"createElementBlock\": () => (createElementBlock),\n \"createElementVNode\": () => (createBaseVNode),\n \"createHydrationRenderer\": () => (createHydrationRenderer),\n \"createPropsRestProxy\": () => (createPropsRestProxy),\n \"createRenderer\": () => (createRenderer),\n \"createSSRApp\": () => (createSSRApp),\n \"createSlots\": () => (createSlots),\n \"createStaticVNode\": () => (createStaticVNode),\n \"createTextVNode\": () => (createTextVNode),\n \"createVNode\": () => (createVNode),\n \"customRef\": () => (customRef),\n \"defineAsyncComponent\": () => (defineAsyncComponent),\n \"defineComponent\": () => (defineComponent),\n \"defineCustomElement\": () => (defineCustomElement),\n \"defineEmits\": () => (defineEmits),\n \"defineExpose\": () => (defineExpose),\n \"defineProps\": () => (defineProps),\n \"defineSSRCustomElement\": () => (defineSSRCustomElement),\n \"devtools\": () => (devtools),\n \"effect\": () => (effect),\n \"effectScope\": () => (effectScope),\n \"getCurrentInstance\": () => (getCurrentInstance),\n \"getCurrentScope\": () => (getCurrentScope),\n \"getTransitionRawChildren\": () => (getTransitionRawChildren),\n \"guardReactiveProps\": () => (guardReactiveProps),\n \"h\": () => (h),\n \"handleError\": () => (handleError),\n \"hydrate\": () => (hydrate),\n \"initCustomFormatter\": () => (runtime_core_esm_bundler_initCustomFormatter),\n \"initDirectivesForSSR\": () => (initDirectivesForSSR),\n \"inject\": () => (inject),\n \"isMemoSame\": () => (isMemoSame),\n \"isProxy\": () => (isProxy),\n \"isReactive\": () => (isReactive),\n \"isReadonly\": () => (isReadonly),\n \"isRef\": () => (isRef),\n \"isRuntimeOnly\": () => (runtime_core_esm_bundler_isRuntimeOnly),\n \"isVNode\": () => (isVNode),\n \"markRaw\": () => (markRaw),\n \"mergeDefaults\": () => (mergeDefaults),\n \"mergeProps\": () => (mergeProps),\n \"nextTick\": () => (nextTick),\n \"normalizeClass\": () => (normalizeClass),\n \"normalizeProps\": () => (normalizeProps),\n \"normalizeStyle\": () => (normalizeStyle),\n \"onActivated\": () => (onActivated),\n \"onBeforeMount\": () => (onBeforeMount),\n \"onBeforeUnmount\": () => (onBeforeUnmount),\n \"onBeforeUpdate\": () => (onBeforeUpdate),\n \"onDeactivated\": () => (onDeactivated),\n \"onErrorCaptured\": () => (onErrorCaptured),\n \"onMounted\": () => (onMounted),\n \"onRenderTracked\": () => (onRenderTracked),\n \"onRenderTriggered\": () => (onRenderTriggered),\n \"onScopeDispose\": () => (onScopeDispose),\n \"onServerPrefetch\": () => (onServerPrefetch),\n \"onUnmounted\": () => (onUnmounted),\n \"onUpdated\": () => (onUpdated),\n \"openBlock\": () => (openBlock),\n \"popScopeId\": () => (popScopeId),\n \"provide\": () => (provide),\n \"proxyRefs\": () => (proxyRefs),\n \"pushScopeId\": () => (pushScopeId),\n \"queuePostFlushCb\": () => (queuePostFlushCb),\n \"reactive\": () => (reactive),\n \"readonly\": () => (readonly),\n \"ref\": () => (ref),\n \"registerRuntimeCompiler\": () => (registerRuntimeCompiler),\n \"render\": () => (render),\n \"renderList\": () => (renderList),\n \"renderSlot\": () => (renderSlot),\n \"resolveComponent\": () => (resolveComponent),\n \"resolveDirective\": () => (resolveDirective),\n \"resolveDynamicComponent\": () => (resolveDynamicComponent),\n \"resolveFilter\": () => (resolveFilter),\n \"resolveTransitionHooks\": () => (resolveTransitionHooks),\n \"setBlockTracking\": () => (setBlockTracking),\n \"setDevtoolsHook\": () => (setDevtoolsHook),\n \"setTransitionHooks\": () => (setTransitionHooks),\n \"shallowReactive\": () => (shallowReactive),\n \"shallowReadonly\": () => (shallowReadonly),\n \"shallowRef\": () => (shallowRef),\n \"ssrContextKey\": () => (ssrContextKey),\n \"ssrUtils\": () => (ssrUtils),\n \"stop\": () => (stop),\n \"toDisplayString\": () => (toDisplayString),\n \"toHandlerKey\": () => (toHandlerKey),\n \"toHandlers\": () => (toHandlers),\n \"toRaw\": () => (reactivity_esm_bundler_toRaw),\n \"toRef\": () => (toRef),\n \"toRefs\": () => (toRefs),\n \"transformVNodeArgs\": () => (transformVNodeArgs),\n \"triggerRef\": () => (triggerRef),\n \"unref\": () => (unref),\n \"useAttrs\": () => (useAttrs),\n \"useCssModule\": () => (useCssModule),\n \"useCssVars\": () => (useCssVars),\n \"useSSRContext\": () => (useSSRContext),\n \"useSlots\": () => (useSlots),\n \"useTransitionState\": () => (useTransitionState),\n \"vModelCheckbox\": () => (vModelCheckbox),\n \"vModelDynamic\": () => (vModelDynamic),\n \"vModelRadio\": () => (vModelRadio),\n \"vModelSelect\": () => (vModelSelect),\n \"vModelText\": () => (vModelText),\n \"vShow\": () => (vShow),\n \"version\": () => (version),\n \"warn\": () => (runtime_core_esm_bundler_warn),\n \"watch\": () => (watch),\n \"watchEffect\": () => (watchEffect),\n \"watchPostEffect\": () => (watchPostEffect),\n \"watchSyncEffect\": () => (watchSyncEffect),\n \"withAsyncContext\": () => (withAsyncContext),\n \"withCtx\": () => (withCtx),\n \"withDefaults\": () => (withDefaults),\n \"withDirectives\": () => (withDirectives),\n \"withKeys\": () => (withKeys),\n \"withMemo\": () => (withMemo),\n \"withModifiers\": () => (withModifiers),\n \"withScopeId\": () => (withScopeId)\n});\n\n;// CONCATENATED MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js\n/**\r\n * Make a map and return a function for checking if a key\r\n * is in that map.\r\n * IMPORTANT: all calls of this function must be prefixed with\r\n * \\/\\*#\\_\\_PURE\\_\\_\\*\\/\r\n * So that rollup can tree-shake them if necessary.\r\n */\r\nfunction shared_esm_bundler_makeMap(str, expectsLowerCase) {\r\n const map = Object.create(null);\r\n const list = str.split(',');\r\n for (let i = 0; i < list.length; i++) {\r\n map[list[i]] = true;\r\n }\r\n return expectsLowerCase ? val => !!map[val.toLowerCase()] : val => !!map[val];\r\n}\n\n/**\r\n * dev only flag -> name mapping\r\n */\r\nconst PatchFlagNames = {\r\n [1 /* TEXT */]: `TEXT`,\r\n [2 /* CLASS */]: `CLASS`,\r\n [4 /* STYLE */]: `STYLE`,\r\n [8 /* PROPS */]: `PROPS`,\r\n [16 /* FULL_PROPS */]: `FULL_PROPS`,\r\n [32 /* HYDRATE_EVENTS */]: `HYDRATE_EVENTS`,\r\n [64 /* STABLE_FRAGMENT */]: `STABLE_FRAGMENT`,\r\n [128 /* KEYED_FRAGMENT */]: `KEYED_FRAGMENT`,\r\n [256 /* UNKEYED_FRAGMENT */]: `UNKEYED_FRAGMENT`,\r\n [512 /* NEED_PATCH */]: `NEED_PATCH`,\r\n [1024 /* DYNAMIC_SLOTS */]: `DYNAMIC_SLOTS`,\r\n [2048 /* DEV_ROOT_FRAGMENT */]: `DEV_ROOT_FRAGMENT`,\r\n [-1 /* HOISTED */]: `HOISTED`,\r\n [-2 /* BAIL */]: `BAIL`\r\n};\n\n/**\r\n * Dev only\r\n */\r\nconst slotFlagsText = {\r\n [1 /* STABLE */]: 'STABLE',\r\n [2 /* DYNAMIC */]: 'DYNAMIC',\r\n [3 /* FORWARDED */]: 'FORWARDED'\r\n};\n\nconst GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +\r\n 'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +\r\n 'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';\r\nconst isGloballyWhitelisted = /*#__PURE__*/ shared_esm_bundler_makeMap(GLOBALS_WHITE_LISTED);\n\nconst range = 2;\r\nfunction generateCodeFrame(source, start = 0, end = source.length) {\r\n // Split the content into individual lines but capture the newline sequence\r\n // that separated each line. This is important because the actual sequence is\r\n // needed to properly take into account the full line length for offset\r\n // comparison\r\n let lines = source.split(/(\\r?\\n)/);\r\n // Separate the lines and newline sequences into separate arrays for easier referencing\r\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\r\n lines = lines.filter((_, idx) => idx % 2 === 0);\r\n let count = 0;\r\n const res = [];\r\n for (let i = 0; i < lines.length; i++) {\r\n count +=\r\n lines[i].length +\r\n ((newlineSequences[i] && newlineSequences[i].length) || 0);\r\n if (count >= start) {\r\n for (let j = i - range; j <= i + range || end > count; j++) {\r\n if (j < 0 || j >= lines.length)\r\n continue;\r\n const line = j + 1;\r\n res.push(`${line}${' '.repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\r\n const lineLength = lines[j].length;\r\n const newLineSeqLength = (newlineSequences[j] && newlineSequences[j].length) || 0;\r\n if (j === i) {\r\n // push underline\r\n const pad = start - (count - (lineLength + newLineSeqLength));\r\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\r\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\r\n }\r\n else if (j > i) {\r\n if (end > count) {\r\n const length = Math.max(Math.min(end - count, lineLength), 1);\r\n res.push(` | ` + '^'.repeat(length));\r\n }\r\n count += lineLength + newLineSeqLength;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return res.join('\\n');\r\n}\n\n/**\r\n * On the client we only need to offer special cases for boolean attributes that\r\n * have different names from their corresponding dom properties:\r\n * - itemscope -> N/A\r\n * - allowfullscreen -> allowFullscreen\r\n * - formnovalidate -> formNoValidate\r\n * - ismap -> isMap\r\n * - nomodule -> noModule\r\n * - novalidate -> noValidate\r\n * - readonly -> readOnly\r\n */\r\nconst specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\r\nconst isSpecialBooleanAttr = /*#__PURE__*/ shared_esm_bundler_makeMap(specialBooleanAttrs);\r\n/**\r\n * The full list is needed during SSR to produce the correct initial markup.\r\n */\r\nconst isBooleanAttr = /*#__PURE__*/ shared_esm_bundler_makeMap(specialBooleanAttrs +\r\n `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +\r\n `loop,open,required,reversed,scoped,seamless,` +\r\n `checked,muted,multiple,selected`);\r\n/**\r\n * Boolean attributes should be included if the value is truthy or ''.\r\n * e.g. <select multiple> compiles to { multiple: '' }\r\n */\r\nfunction includeBooleanAttr(value) {\r\n return !!value || value === '';\r\n}\r\nconst unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\r\nconst attrValidationCache = {};\r\nfunction isSSRSafeAttrName(name) {\r\n if (attrValidationCache.hasOwnProperty(name)) {\r\n return attrValidationCache[name];\r\n }\r\n const isUnsafe = unsafeAttrCharRE.test(name);\r\n if (isUnsafe) {\r\n console.error(`unsafe attribute name: ${name}`);\r\n }\r\n return (attrValidationCache[name] = !isUnsafe);\r\n}\r\nconst propsToAttrMap = {\r\n acceptCharset: 'accept-charset',\r\n className: 'class',\r\n htmlFor: 'for',\r\n httpEquiv: 'http-equiv'\r\n};\r\n/**\r\n * CSS properties that accept plain numbers\r\n */\r\nconst isNoUnitNumericStyleProp = /*#__PURE__*/ (/* unused pure expression or super */ null && (shared_esm_bundler_makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +\r\n `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +\r\n `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +\r\n `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +\r\n `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +\r\n `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +\r\n // SVG\r\n `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +\r\n `stroke-miterlimit,stroke-opacity,stroke-width`)));\r\n/**\r\n * Known attributes, this is used for stringification of runtime static nodes\r\n * so that we don't stringify bindings that cannot be set from HTML.\r\n * Don't also forget to allow `data-*` and `aria-*`!\r\n * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\r\n */\r\nconst isKnownHtmlAttr = /*#__PURE__*/ (/* unused pure expression or super */ null && (shared_esm_bundler_makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +\r\n `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +\r\n `border,buffered,capture,challenge,charset,checked,cite,class,code,` +\r\n `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +\r\n `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +\r\n `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +\r\n `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +\r\n `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +\r\n `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +\r\n `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +\r\n `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +\r\n `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +\r\n `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +\r\n `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +\r\n `value,width,wrap`)));\r\n/**\r\n * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute\r\n */\r\nconst isKnownSvgAttr = /*#__PURE__*/ (/* unused pure expression or super */ null && (shared_esm_bundler_makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +\r\n `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +\r\n `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +\r\n `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +\r\n `color-interpolation-filters,color-profile,color-rendering,` +\r\n `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +\r\n `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +\r\n `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +\r\n `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +\r\n `font-family,font-size,font-size-adjust,font-stretch,font-style,` +\r\n `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +\r\n `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +\r\n `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +\r\n `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +\r\n `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +\r\n `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +\r\n `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +\r\n `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +\r\n `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +\r\n `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +\r\n `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +\r\n `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +\r\n `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +\r\n `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +\r\n `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +\r\n `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +\r\n `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +\r\n `strikethrough-position,strikethrough-thickness,string,stroke,` +\r\n `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +\r\n `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +\r\n `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +\r\n `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +\r\n `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +\r\n `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +\r\n `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +\r\n `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +\r\n `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +\r\n `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +\r\n `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`)));\n\nfunction normalizeStyle(value) {\r\n if (shared_esm_bundler_isArray(value)) {\r\n const res = {};\r\n for (let i = 0; i < value.length; i++) {\r\n const item = value[i];\r\n const normalized = shared_esm_bundler_isString(item)\r\n ? parseStringStyle(item)\r\n : normalizeStyle(item);\r\n if (normalized) {\r\n for (const key in normalized) {\r\n res[key] = normalized[key];\r\n }\r\n }\r\n }\r\n return res;\r\n }\r\n else if (shared_esm_bundler_isString(value)) {\r\n return value;\r\n }\r\n else if (shared_esm_bundler_isObject(value)) {\r\n return value;\r\n }\r\n}\r\nconst listDelimiterRE = /;(?![^(]*\\))/g;\r\nconst propertyDelimiterRE = /:(.+)/;\r\nfunction parseStringStyle(cssText) {\r\n const ret = {};\r\n cssText.split(listDelimiterRE).forEach(item => {\r\n if (item) {\r\n const tmp = item.split(propertyDelimiterRE);\r\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\r\n }\r\n });\r\n return ret;\r\n}\r\nfunction stringifyStyle(styles) {\r\n let ret = '';\r\n if (!styles || shared_esm_bundler_isString(styles)) {\r\n return ret;\r\n }\r\n for (const key in styles) {\r\n const value = styles[key];\r\n const normalizedKey = key.startsWith(`--`) ? key : shared_esm_bundler_hyphenate(key);\r\n if (shared_esm_bundler_isString(value) ||\r\n (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {\r\n // only render valid values\r\n ret += `${normalizedKey}:${value};`;\r\n }\r\n }\r\n return ret;\r\n}\r\nfunction normalizeClass(value) {\r\n let res = '';\r\n if (shared_esm_bundler_isString(value)) {\r\n res = value;\r\n }\r\n else if (shared_esm_bundler_isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n const normalized = normalizeClass(value[i]);\r\n if (normalized) {\r\n res += normalized + ' ';\r\n }\r\n }\r\n }\r\n else if (shared_esm_bundler_isObject(value)) {\r\n for (const name in value) {\r\n if (value[name]) {\r\n res += name + ' ';\r\n }\r\n }\r\n }\r\n return res.trim();\r\n}\r\nfunction normalizeProps(props) {\r\n if (!props)\r\n return null;\r\n let { class: klass, style } = props;\r\n if (klass && !shared_esm_bundler_isString(klass)) {\r\n props.class = normalizeClass(klass);\r\n }\r\n if (style) {\r\n props.style = normalizeStyle(style);\r\n }\r\n return props;\r\n}\n\n// These tag configs are shared between compiler-dom and runtime-dom, so they\r\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\r\nconst HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +\r\n 'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +\r\n 'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +\r\n 'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +\r\n 'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +\r\n 'canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,' +\r\n 'th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,' +\r\n 'option,output,progress,select,textarea,details,dialog,menu,' +\r\n 'summary,template,blockquote,iframe,tfoot';\r\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\r\nconst SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +\r\n 'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +\r\n 'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +\r\n 'feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +\r\n 'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +\r\n 'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +\r\n 'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +\r\n 'mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,' +\r\n 'polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,' +\r\n 'text,textPath,title,tspan,unknown,use,view';\r\nconst VOID_TAGS = 'area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr';\r\nconst shared_esm_bundler_isHTMLTag = /*#__PURE__*/ shared_esm_bundler_makeMap(HTML_TAGS);\r\nconst shared_esm_bundler_isSVGTag = /*#__PURE__*/ shared_esm_bundler_makeMap(SVG_TAGS);\r\nconst isVoidTag = /*#__PURE__*/ shared_esm_bundler_makeMap(VOID_TAGS);\n\nconst escapeRE = /[\"'&<>]/;\r\nfunction escapeHtml(string) {\r\n const str = '' + string;\r\n const match = escapeRE.exec(str);\r\n if (!match) {\r\n return str;\r\n }\r\n let html = '';\r\n let escaped;\r\n let index;\r\n let lastIndex = 0;\r\n for (index = match.index; index < str.length; index++) {\r\n switch (str.charCodeAt(index)) {\r\n case 34: // \"\r\n escaped = '"';\r\n break;\r\n case 38: // &\r\n escaped = '&';\r\n break;\r\n case 39: // '\r\n escaped = ''';\r\n break;\r\n case 60: // <\r\n escaped = '<';\r\n break;\r\n case 62: // >\r\n escaped = '>';\r\n break;\r\n default:\r\n continue;\r\n }\r\n if (lastIndex !== index) {\r\n html += str.slice(lastIndex, index);\r\n }\r\n lastIndex = index + 1;\r\n html += escaped;\r\n }\r\n return lastIndex !== index ? html + str.slice(lastIndex, index) : html;\r\n}\r\n// https://www.w3.org/TR/html52/syntax.html#comments\r\nconst commentStripRE = /^-?>|\x3c!--|--\x3e|--!>|<!-$/g;\r\nfunction escapeHtmlComment(src) {\r\n return src.replace(commentStripRE, '');\r\n}\n\nfunction looseCompareArrays(a, b) {\r\n if (a.length !== b.length)\r\n return false;\r\n let equal = true;\r\n for (let i = 0; equal && i < a.length; i++) {\r\n equal = looseEqual(a[i], b[i]);\r\n }\r\n return equal;\r\n}\r\nfunction looseEqual(a, b) {\r\n if (a === b)\r\n return true;\r\n let aValidType = isDate(a);\r\n let bValidType = isDate(b);\r\n if (aValidType || bValidType) {\r\n return aValidType && bValidType ? a.getTime() === b.getTime() : false;\r\n }\r\n aValidType = shared_esm_bundler_isArray(a);\r\n bValidType = shared_esm_bundler_isArray(b);\r\n if (aValidType || bValidType) {\r\n return aValidType && bValidType ? looseCompareArrays(a, b) : false;\r\n }\r\n aValidType = shared_esm_bundler_isObject(a);\r\n bValidType = shared_esm_bundler_isObject(b);\r\n if (aValidType || bValidType) {\r\n /* istanbul ignore if: this if will probably never be called */\r\n if (!aValidType || !bValidType) {\r\n return false;\r\n }\r\n const aKeysCount = Object.keys(a).length;\r\n const bKeysCount = Object.keys(b).length;\r\n if (aKeysCount !== bKeysCount) {\r\n return false;\r\n }\r\n for (const key in a) {\r\n const aHasKey = a.hasOwnProperty(key);\r\n const bHasKey = b.hasOwnProperty(key);\r\n if ((aHasKey && !bHasKey) ||\r\n (!aHasKey && bHasKey) ||\r\n !looseEqual(a[key], b[key])) {\r\n return false;\r\n }\r\n }\r\n }\r\n return String(a) === String(b);\r\n}\r\nfunction looseIndexOf(arr, val) {\r\n return arr.findIndex(item => looseEqual(item, val));\r\n}\n\n/**\r\n * For converting {{ interpolation }} values to displayed strings.\r\n * @private\r\n */\r\nconst toDisplayString = (val) => {\r\n return val == null\r\n ? ''\r\n : shared_esm_bundler_isArray(val) ||\r\n (shared_esm_bundler_isObject(val) &&\r\n (val.toString === objectToString || !isFunction(val.toString)))\r\n ? JSON.stringify(val, replacer, 2)\r\n : String(val);\r\n};\r\nconst replacer = (_key, val) => {\r\n // can't use isRef here since @vue/shared has no deps\r\n if (val && val.__v_isRef) {\r\n return replacer(_key, val.value);\r\n }\r\n else if (isMap(val)) {\r\n return {\r\n [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val]) => {\r\n entries[`${key} =>`] = val;\r\n return entries;\r\n }, {})\r\n };\r\n }\r\n else if (isSet(val)) {\r\n return {\r\n [`Set(${val.size})`]: [...val.values()]\r\n };\r\n }\r\n else if (shared_esm_bundler_isObject(val) && !shared_esm_bundler_isArray(val) && !isPlainObject(val)) {\r\n return String(val);\r\n }\r\n return val;\r\n};\n\nconst EMPTY_OBJ = ( false)\r\n ? 0\r\n : {};\r\nconst EMPTY_ARR = ( false) ? 0 : [];\r\nconst shared_esm_bundler_NOOP = () => { };\r\n/**\r\n * Always return false.\r\n */\r\nconst shared_esm_bundler_NO = () => false;\r\nconst onRE = /^on[^a-z]/;\r\nconst isOn = (key) => onRE.test(key);\r\nconst isModelListener = (key) => key.startsWith('onUpdate:');\r\nconst shared_esm_bundler_extend = Object.assign;\r\nconst remove = (arr, el) => {\r\n const i = arr.indexOf(el);\r\n if (i > -1) {\r\n arr.splice(i, 1);\r\n }\r\n};\r\nconst shared_esm_bundler_hasOwnProperty = Object.prototype.hasOwnProperty;\r\nconst shared_esm_bundler_hasOwn = (val, key) => shared_esm_bundler_hasOwnProperty.call(val, key);\r\nconst shared_esm_bundler_isArray = Array.isArray;\r\nconst isMap = (val) => toTypeString(val) === '[object Map]';\r\nconst isSet = (val) => toTypeString(val) === '[object Set]';\r\nconst isDate = (val) => val instanceof Date;\r\nconst isFunction = (val) => typeof val === 'function';\r\nconst shared_esm_bundler_isString = (val) => typeof val === 'string';\r\nconst isSymbol = (val) => typeof val === 'symbol';\r\nconst shared_esm_bundler_isObject = (val) => val !== null && typeof val === 'object';\r\nconst isPromise = (val) => {\r\n return shared_esm_bundler_isObject(val) && isFunction(val.then) && isFunction(val.catch);\r\n};\r\nconst objectToString = Object.prototype.toString;\r\nconst toTypeString = (value) => objectToString.call(value);\r\nconst shared_esm_bundler_toRawType = (value) => {\r\n // extract \"RawType\" from strings like \"[object RawType]\"\r\n return toTypeString(value).slice(8, -1);\r\n};\r\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\r\nconst isIntegerKey = (key) => shared_esm_bundler_isString(key) &&\r\n key !== 'NaN' &&\r\n key[0] !== '-' &&\r\n '' + parseInt(key, 10) === key;\r\nconst isReservedProp = /*#__PURE__*/ shared_esm_bundler_makeMap(\r\n// the leading comma is intentional so empty string \"\" is also included\r\n',key,ref,' +\r\n 'onVnodeBeforeMount,onVnodeMounted,' +\r\n 'onVnodeBeforeUpdate,onVnodeUpdated,' +\r\n 'onVnodeBeforeUnmount,onVnodeUnmounted');\r\nconst cacheStringFunction = (fn) => {\r\n const cache = Object.create(null);\r\n return ((str) => {\r\n const hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n });\r\n};\r\nconst camelizeRE = /-(\\w)/g;\r\n/**\r\n * @private\r\n */\r\nconst camelize = cacheStringFunction((str) => {\r\n return str.replace(camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\r\n});\r\nconst hyphenateRE = /\\B([A-Z])/g;\r\n/**\r\n * @private\r\n */\r\nconst shared_esm_bundler_hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, '-$1').toLowerCase());\r\n/**\r\n * @private\r\n */\r\nconst shared_esm_bundler_capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\r\n/**\r\n * @private\r\n */\r\nconst toHandlerKey = cacheStringFunction((str) => str ? `on${shared_esm_bundler_capitalize(str)}` : ``);\r\n// compare whether a value has changed, accounting for NaN.\r\nconst hasChanged = (value, oldValue) => !Object.is(value, oldValue);\r\nconst invokeArrayFns = (fns, arg) => {\r\n for (let i = 0; i < fns.length; i++) {\r\n fns[i](arg);\r\n }\r\n};\r\nconst def = (obj, key, value) => {\r\n Object.defineProperty(obj, key, {\r\n configurable: true,\r\n enumerable: false,\r\n value\r\n });\r\n};\r\nconst toNumber = (val) => {\r\n const n = parseFloat(val);\r\n return isNaN(n) ? val : n;\r\n};\r\nlet _globalThis;\r\nconst getGlobalThis = () => {\r\n return (_globalThis ||\r\n (_globalThis =\r\n typeof globalThis !== 'undefined'\r\n ? globalThis\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : typeof __webpack_require__.g !== 'undefined'\r\n ? __webpack_require__.g\r\n : {}));\r\n};\n\n\n\n;// CONCATENATED MODULE: ./node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js\n\n\nfunction reactivity_esm_bundler_warn(msg, ...args) {\r\n console.warn(`[Vue warn] ${msg}`, ...args);\r\n}\n\nlet activeEffectScope;\r\nconst effectScopeStack = [];\r\nclass EffectScope {\r\n constructor(detached = false) {\r\n this.active = true;\r\n this.effects = [];\r\n this.cleanups = [];\r\n if (!detached && activeEffectScope) {\r\n this.parent = activeEffectScope;\r\n this.index =\r\n (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;\r\n }\r\n }\r\n run(fn) {\r\n if (this.active) {\r\n try {\r\n this.on();\r\n return fn();\r\n }\r\n finally {\r\n this.off();\r\n }\r\n }\r\n else if ((false)) {}\r\n }\r\n on() {\r\n if (this.active) {\r\n effectScopeStack.push(this);\r\n activeEffectScope = this;\r\n }\r\n }\r\n off() {\r\n if (this.active) {\r\n effectScopeStack.pop();\r\n activeEffectScope = effectScopeStack[effectScopeStack.length - 1];\r\n }\r\n }\r\n stop(fromParent) {\r\n if (this.active) {\r\n this.effects.forEach(e => e.stop());\r\n this.cleanups.forEach(cleanup => cleanup());\r\n if (this.scopes) {\r\n this.scopes.forEach(e => e.stop(true));\r\n }\r\n // nested scope, dereference from parent to avoid memory leaks\r\n if (this.parent && !fromParent) {\r\n // optimized O(1) removal\r\n const last = this.parent.scopes.pop();\r\n if (last && last !== this) {\r\n this.parent.scopes[this.index] = last;\r\n last.index = this.index;\r\n }\r\n }\r\n this.active = false;\r\n }\r\n }\r\n}\r\nfunction effectScope(detached) {\r\n return new EffectScope(detached);\r\n}\r\nfunction recordEffectScope(effect, scope) {\r\n scope = scope || activeEffectScope;\r\n if (scope && scope.active) {\r\n scope.effects.push(effect);\r\n }\r\n}\r\nfunction getCurrentScope() {\r\n return activeEffectScope;\r\n}\r\nfunction onScopeDispose(fn) {\r\n if (activeEffectScope) {\r\n activeEffectScope.cleanups.push(fn);\r\n }\r\n else if ((false)) {}\r\n}\n\nconst createDep = (effects) => {\r\n const dep = new Set(effects);\r\n dep.w = 0;\r\n dep.n = 0;\r\n return dep;\r\n};\r\nconst wasTracked = (dep) => (dep.w & trackOpBit) > 0;\r\nconst newTracked = (dep) => (dep.n & trackOpBit) > 0;\r\nconst initDepMarkers = ({ deps }) => {\r\n if (deps.length) {\r\n for (let i = 0; i < deps.length; i++) {\r\n deps[i].w |= trackOpBit; // set was tracked\r\n }\r\n }\r\n};\r\nconst finalizeDepMarkers = (effect) => {\r\n const { deps } = effect;\r\n if (deps.length) {\r\n let ptr = 0;\r\n for (let i = 0; i < deps.length; i++) {\r\n const dep = deps[i];\r\n if (wasTracked(dep) && !newTracked(dep)) {\r\n dep.delete(effect);\r\n }\r\n else {\r\n deps[ptr++] = dep;\r\n }\r\n // clear bits\r\n dep.w &= ~trackOpBit;\r\n dep.n &= ~trackOpBit;\r\n }\r\n deps.length = ptr;\r\n }\r\n};\n\nconst targetMap = new WeakMap();\r\n// The number of effects currently being tracked recursively.\r\nlet effectTrackDepth = 0;\r\nlet trackOpBit = 1;\r\n/**\r\n * The bitwise track markers support at most 30 levels op recursion.\r\n * This value is chosen to enable modern JS engines to use a SMI on all platforms.\r\n * When recursion depth is greater, fall back to using a full cleanup.\r\n */\r\nconst maxMarkerBits = 30;\r\nconst effectStack = [];\r\nlet activeEffect;\r\nconst ITERATE_KEY = Symbol(( false) ? 0 : '');\r\nconst MAP_KEY_ITERATE_KEY = Symbol(( false) ? 0 : '');\r\nclass ReactiveEffect {\r\n constructor(fn, scheduler = null, scope) {\r\n this.fn = fn;\r\n this.scheduler = scheduler;\r\n this.active = true;\r\n this.deps = [];\r\n recordEffectScope(this, scope);\r\n }\r\n run() {\r\n if (!this.active) {\r\n return this.fn();\r\n }\r\n if (!effectStack.includes(this)) {\r\n try {\r\n effectStack.push((activeEffect = this));\r\n enableTracking();\r\n trackOpBit = 1 << ++effectTrackDepth;\r\n if (effectTrackDepth <= maxMarkerBits) {\r\n initDepMarkers(this);\r\n }\r\n else {\r\n cleanupEffect(this);\r\n }\r\n return this.fn();\r\n }\r\n finally {\r\n if (effectTrackDepth <= maxMarkerBits) {\r\n finalizeDepMarkers(this);\r\n }\r\n trackOpBit = 1 << --effectTrackDepth;\r\n resetTracking();\r\n effectStack.pop();\r\n const n = effectStack.length;\r\n activeEffect = n > 0 ? effectStack[n - 1] : undefined;\r\n }\r\n }\r\n }\r\n stop() {\r\n if (this.active) {\r\n cleanupEffect(this);\r\n if (this.onStop) {\r\n this.onStop();\r\n }\r\n this.active = false;\r\n }\r\n }\r\n}\r\nfunction cleanupEffect(effect) {\r\n const { deps } = effect;\r\n if (deps.length) {\r\n for (let i = 0; i < deps.length; i++) {\r\n deps[i].delete(effect);\r\n }\r\n deps.length = 0;\r\n }\r\n}\r\nfunction effect(fn, options) {\r\n if (fn.effect) {\r\n fn = fn.effect.fn;\r\n }\r\n const _effect = new ReactiveEffect(fn);\r\n if (options) {\r\n shared_esm_bundler_extend(_effect, options);\r\n if (options.scope)\r\n recordEffectScope(_effect, options.scope);\r\n }\r\n if (!options || !options.lazy) {\r\n _effect.run();\r\n }\r\n const runner = _effect.run.bind(_effect);\r\n runner.effect = _effect;\r\n return runner;\r\n}\r\nfunction stop(runner) {\r\n runner.effect.stop();\r\n}\r\nlet shouldTrack = true;\r\nconst trackStack = [];\r\nfunction pauseTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = false;\r\n}\r\nfunction enableTracking() {\r\n trackStack.push(shouldTrack);\r\n shouldTrack = true;\r\n}\r\nfunction resetTracking() {\r\n const last = trackStack.pop();\r\n shouldTrack = last === undefined ? true : last;\r\n}\r\nfunction track(target, type, key) {\r\n if (!isTracking()) {\r\n return;\r\n }\r\n let depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n targetMap.set(target, (depsMap = new Map()));\r\n }\r\n let dep = depsMap.get(key);\r\n if (!dep) {\r\n depsMap.set(key, (dep = createDep()));\r\n }\r\n const eventInfo = ( false)\r\n ? 0\r\n : undefined;\r\n trackEffects(dep, eventInfo);\r\n}\r\nfunction isTracking() {\r\n return shouldTrack && activeEffect !== undefined;\r\n}\r\nfunction trackEffects(dep, debuggerEventExtraInfo) {\r\n let shouldTrack = false;\r\n if (effectTrackDepth <= maxMarkerBits) {\r\n if (!newTracked(dep)) {\r\n dep.n |= trackOpBit; // set newly tracked\r\n shouldTrack = !wasTracked(dep);\r\n }\r\n }\r\n else {\r\n // Full cleanup mode.\r\n shouldTrack = !dep.has(activeEffect);\r\n }\r\n if (shouldTrack) {\r\n dep.add(activeEffect);\r\n activeEffect.deps.push(dep);\r\n if (false) {}\r\n }\r\n}\r\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\r\n const depsMap = targetMap.get(target);\r\n if (!depsMap) {\r\n // never been tracked\r\n return;\r\n }\r\n let deps = [];\r\n if (type === \"clear\" /* CLEAR */) {\r\n // collection being cleared\r\n // trigger all effects for target\r\n deps = [...depsMap.values()];\r\n }\r\n else if (key === 'length' && shared_esm_bundler_isArray(target)) {\r\n depsMap.forEach((dep, key) => {\r\n if (key === 'length' || key >= newValue) {\r\n deps.push(dep);\r\n }\r\n });\r\n }\r\n else {\r\n // schedule runs for SET | ADD | DELETE\r\n if (key !== void 0) {\r\n deps.push(depsMap.get(key));\r\n }\r\n // also run for iteration key on ADD | DELETE | Map.SET\r\n switch (type) {\r\n case \"add\" /* ADD */:\r\n if (!shared_esm_bundler_isArray(target)) {\r\n deps.push(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n else if (isIntegerKey(key)) {\r\n // new index added to array -> length changes\r\n deps.push(depsMap.get('length'));\r\n }\r\n break;\r\n case \"delete\" /* DELETE */:\r\n if (!shared_esm_bundler_isArray(target)) {\r\n deps.push(depsMap.get(ITERATE_KEY));\r\n if (isMap(target)) {\r\n deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));\r\n }\r\n }\r\n break;\r\n case \"set\" /* SET */:\r\n if (isMap(target)) {\r\n deps.push(depsMap.get(ITERATE_KEY));\r\n }\r\n break;\r\n }\r\n }\r\n const eventInfo = ( false)\r\n ? 0\r\n : undefined;\r\n if (deps.length === 1) {\r\n if (deps[0]) {\r\n if ((false)) {}\r\n else {\r\n triggerEffects(deps[0]);\r\n }\r\n }\r\n }\r\n else {\r\n const effects = [];\r\n for (const dep of deps) {\r\n if (dep) {\r\n effects.push(...dep);\r\n }\r\n }\r\n if ((false)) {}\r\n else {\r\n triggerEffects(createDep(effects));\r\n }\r\n }\r\n}\r\nfunction triggerEffects(dep, debuggerEventExtraInfo) {\r\n // spread into array for stabilization\r\n for (const effect of shared_esm_bundler_isArray(dep) ? dep : [...dep]) {\r\n if (effect !== activeEffect || effect.allowRecurse) {\r\n if (false) {}\r\n if (effect.scheduler) {\r\n effect.scheduler();\r\n }\r\n else {\r\n effect.run();\r\n }\r\n }\r\n }\r\n}\n\nconst isNonTrackableKeys = /*#__PURE__*/ shared_esm_bundler_makeMap(`__proto__,__v_isRef,__isVue`);\r\nconst builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol)\r\n .map(key => Symbol[key])\r\n .filter(isSymbol));\r\nconst get = /*#__PURE__*/ createGetter();\r\nconst shallowGet = /*#__PURE__*/ createGetter(false, true);\r\nconst readonlyGet = /*#__PURE__*/ createGetter(true);\r\nconst shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);\r\nconst arrayInstrumentations = /*#__PURE__*/ createArrayInstrumentations();\r\nfunction createArrayInstrumentations() {\r\n const instrumentations = {};\r\n ['includes', 'indexOf', 'lastIndexOf'].forEach(key => {\r\n instrumentations[key] = function (...args) {\r\n const arr = reactivity_esm_bundler_toRaw(this);\r\n for (let i = 0, l = this.length; i < l; i++) {\r\n track(arr, \"get\" /* GET */, i + '');\r\n }\r\n // we run the method using the original args first (which may be reactive)\r\n const res = arr[key](...args);\r\n if (res === -1 || res === false) {\r\n // if that didn't work, run it again using raw values.\r\n return arr[key](...args.map(reactivity_esm_bundler_toRaw));\r\n }\r\n else {\r\n return res;\r\n }\r\n };\r\n });\r\n ['push', 'pop', 'shift', 'unshift', 'splice'].forEach(key => {\r\n instrumentations[key] = function (...args) {\r\n pauseTracking();\r\n const res = reactivity_esm_bundler_toRaw(this)[key].apply(this, args);\r\n resetTracking();\r\n return res;\r\n };\r\n });\r\n return instrumentations;\r\n}\r\nfunction createGetter(isReadonly = false, shallow = false) {\r\n return function get(target, key, receiver) {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */ &&\r\n receiver ===\r\n (isReadonly\r\n ? shallow\r\n ? shallowReadonlyMap\r\n : readonlyMap\r\n : shallow\r\n ? shallowReactiveMap\r\n : reactiveMap).get(target)) {\r\n return target;\r\n }\r\n const targetIsArray = shared_esm_bundler_isArray(target);\r\n if (!isReadonly && targetIsArray && shared_esm_bundler_hasOwn(arrayInstrumentations, key)) {\r\n return Reflect.get(arrayInstrumentations, key, receiver);\r\n }\r\n const res = Reflect.get(target, key, receiver);\r\n if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\r\n return res;\r\n }\r\n if (!isReadonly) {\r\n track(target, \"get\" /* GET */, key);\r\n }\r\n if (shallow) {\r\n return res;\r\n }\r\n if (isRef(res)) {\r\n // ref unwrapping - does not apply for Array + integer key.\r\n const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\r\n return shouldUnwrap ? res.value : res;\r\n }\r\n if (shared_esm_bundler_isObject(res)) {\r\n // Convert returned value into a proxy as well. we do the isObject check\r\n // here to avoid invalid value warning. Also need to lazy access readonly\r\n // and reactive here to avoid circular dependency.\r\n return isReadonly ? readonly(res) : reactive(res);\r\n }\r\n return res;\r\n };\r\n}\r\nconst set = /*#__PURE__*/ createSetter();\r\nconst shallowSet = /*#__PURE__*/ createSetter(true);\r\nfunction createSetter(shallow = false) {\r\n return function set(target, key, value, receiver) {\r\n let oldValue = target[key];\r\n if (!shallow) {\r\n value = reactivity_esm_bundler_toRaw(value);\r\n oldValue = reactivity_esm_bundler_toRaw(oldValue);\r\n if (!shared_esm_bundler_isArray(target) && isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n }\r\n const hadKey = shared_esm_bundler_isArray(target) && isIntegerKey(key)\r\n ? Number(key) < target.length\r\n : shared_esm_bundler_hasOwn(target, key);\r\n const result = Reflect.set(target, key, value, receiver);\r\n // don't trigger if target is something up in the prototype chain of original\r\n if (target === reactivity_esm_bundler_toRaw(receiver)) {\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n }\r\n return result;\r\n };\r\n}\r\nfunction deleteProperty(target, key) {\r\n const hadKey = shared_esm_bundler_hasOwn(target, key);\r\n const oldValue = target[key];\r\n const result = Reflect.deleteProperty(target, key);\r\n if (result && hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction has(target, key) {\r\n const result = Reflect.has(target, key);\r\n if (!isSymbol(key) || !builtInSymbols.has(key)) {\r\n track(target, \"has\" /* HAS */, key);\r\n }\r\n return result;\r\n}\r\nfunction ownKeys(target) {\r\n track(target, \"iterate\" /* ITERATE */, shared_esm_bundler_isArray(target) ? 'length' : ITERATE_KEY);\r\n return Reflect.ownKeys(target);\r\n}\r\nconst mutableHandlers = {\r\n get,\r\n set,\r\n deleteProperty,\r\n has,\r\n ownKeys\r\n};\r\nconst readonlyHandlers = {\r\n get: readonlyGet,\r\n set(target, key) {\r\n if ((false)) {}\r\n return true;\r\n },\r\n deleteProperty(target, key) {\r\n if ((false)) {}\r\n return true;\r\n }\r\n};\r\nconst shallowReactiveHandlers = /*#__PURE__*/ shared_esm_bundler_extend({}, mutableHandlers, {\r\n get: shallowGet,\r\n set: shallowSet\r\n});\r\n// Props handlers are special in the sense that it should not unwrap top-level\r\n// refs (in order to allow refs to be explicitly passed down), but should\r\n// retain the reactivity of the normal readonly object.\r\nconst shallowReadonlyHandlers = /*#__PURE__*/ shared_esm_bundler_extend({}, readonlyHandlers, {\r\n get: shallowReadonlyGet\r\n});\n\nconst toShallow = (value) => value;\r\nconst getProto = (v) => Reflect.getPrototypeOf(v);\r\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\r\n // #1772: readonly(reactive(Map)) should return readonly + reactive version\r\n // of the value\r\n target = target[\"__v_raw\" /* RAW */];\r\n const rawTarget = reactivity_esm_bundler_toRaw(target);\r\n const rawKey = reactivity_esm_bundler_toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"get\" /* GET */, rawKey);\r\n const { has } = getProto(rawTarget);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n if (has.call(rawTarget, key)) {\r\n return wrap(target.get(key));\r\n }\r\n else if (has.call(rawTarget, rawKey)) {\r\n return wrap(target.get(rawKey));\r\n }\r\n else if (target !== rawTarget) {\r\n // #3602 readonly(reactive(Map))\r\n // ensure that the nested reactive `Map` can do tracking for itself\r\n target.get(key);\r\n }\r\n}\r\nfunction has$1(key, isReadonly = false) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = reactivity_esm_bundler_toRaw(target);\r\n const rawKey = reactivity_esm_bundler_toRaw(key);\r\n if (key !== rawKey) {\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, key);\r\n }\r\n !isReadonly && track(rawTarget, \"has\" /* HAS */, rawKey);\r\n return key === rawKey\r\n ? target.has(key)\r\n : target.has(key) || target.has(rawKey);\r\n}\r\nfunction size(target, isReadonly = false) {\r\n target = target[\"__v_raw\" /* RAW */];\r\n !isReadonly && track(reactivity_esm_bundler_toRaw(target), \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return Reflect.get(target, 'size', target);\r\n}\r\nfunction add(value) {\r\n value = reactivity_esm_bundler_toRaw(value);\r\n const target = reactivity_esm_bundler_toRaw(this);\r\n const proto = getProto(target);\r\n const hadKey = proto.has.call(target, value);\r\n if (!hadKey) {\r\n target.add(value);\r\n trigger(target, \"add\" /* ADD */, value, value);\r\n }\r\n return this;\r\n}\r\nfunction set$1(key, value) {\r\n value = reactivity_esm_bundler_toRaw(value);\r\n const target = reactivity_esm_bundler_toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = reactivity_esm_bundler_toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((false)) {}\r\n const oldValue = get.call(target, key);\r\n target.set(key, value);\r\n if (!hadKey) {\r\n trigger(target, \"add\" /* ADD */, key, value);\r\n }\r\n else if (hasChanged(value, oldValue)) {\r\n trigger(target, \"set\" /* SET */, key, value, oldValue);\r\n }\r\n return this;\r\n}\r\nfunction deleteEntry(key) {\r\n const target = reactivity_esm_bundler_toRaw(this);\r\n const { has, get } = getProto(target);\r\n let hadKey = has.call(target, key);\r\n if (!hadKey) {\r\n key = reactivity_esm_bundler_toRaw(key);\r\n hadKey = has.call(target, key);\r\n }\r\n else if ((false)) {}\r\n const oldValue = get ? get.call(target, key) : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.delete(key);\r\n if (hadKey) {\r\n trigger(target, \"delete\" /* DELETE */, key, undefined, oldValue);\r\n }\r\n return result;\r\n}\r\nfunction clear() {\r\n const target = reactivity_esm_bundler_toRaw(this);\r\n const hadItems = target.size !== 0;\r\n const oldTarget = ( false)\r\n ? 0\r\n : undefined;\r\n // forward the operation before queueing reactions\r\n const result = target.clear();\r\n if (hadItems) {\r\n trigger(target, \"clear\" /* CLEAR */, undefined, undefined, oldTarget);\r\n }\r\n return result;\r\n}\r\nfunction createForEach(isReadonly, isShallow) {\r\n return function forEach(callback, thisArg) {\r\n const observed = this;\r\n const target = observed[\"__v_raw\" /* RAW */];\r\n const rawTarget = reactivity_esm_bundler_toRaw(target);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n !isReadonly && track(rawTarget, \"iterate\" /* ITERATE */, ITERATE_KEY);\r\n return target.forEach((value, key) => {\r\n // important: make sure the callback is\r\n // 1. invoked with the reactive map as `this` and 3rd arg\r\n // 2. the value received should be a corresponding reactive/readonly.\r\n return callback.call(thisArg, wrap(value), wrap(key), observed);\r\n });\r\n };\r\n}\r\nfunction createIterableMethod(method, isReadonly, isShallow) {\r\n return function (...args) {\r\n const target = this[\"__v_raw\" /* RAW */];\r\n const rawTarget = reactivity_esm_bundler_toRaw(target);\r\n const targetIsMap = isMap(rawTarget);\r\n const isPair = method === 'entries' || (method === Symbol.iterator && targetIsMap);\r\n const isKeyOnly = method === 'keys' && targetIsMap;\r\n const innerIterator = target[method](...args);\r\n const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\r\n !isReadonly &&\r\n track(rawTarget, \"iterate\" /* ITERATE */, isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\r\n // return a wrapped iterator which returns observed versions of the\r\n // values emitted from the real iterator\r\n return {\r\n // iterator protocol\r\n next() {\r\n const { value, done } = innerIterator.next();\r\n return done\r\n ? { value, done }\r\n : {\r\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\r\n done\r\n };\r\n },\r\n // iterable protocol\r\n [Symbol.iterator]() {\r\n return this;\r\n }\r\n };\r\n };\r\n}\r\nfunction createReadonlyMethod(type) {\r\n return function (...args) {\r\n if ((false)) {}\r\n return type === \"delete\" /* DELETE */ ? false : this;\r\n };\r\n}\r\nfunction createInstrumentations() {\r\n const mutableInstrumentations = {\r\n get(key) {\r\n return get$1(this, key);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, false)\r\n };\r\n const shallowInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, false, true);\r\n },\r\n get size() {\r\n return size(this);\r\n },\r\n has: has$1,\r\n add,\r\n set: set$1,\r\n delete: deleteEntry,\r\n clear,\r\n forEach: createForEach(false, true)\r\n };\r\n const readonlyInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, true);\r\n },\r\n get size() {\r\n return size(this, true);\r\n },\r\n has(key) {\r\n return has$1.call(this, key, true);\r\n },\r\n add: createReadonlyMethod(\"add\" /* ADD */),\r\n set: createReadonlyMethod(\"set\" /* SET */),\r\n delete: createReadonlyMethod(\"delete\" /* DELETE */),\r\n clear: createReadonlyMethod(\"clear\" /* CLEAR */),\r\n forEach: createForEach(true, false)\r\n };\r\n const shallowReadonlyInstrumentations = {\r\n get(key) {\r\n return get$1(this, key, true, true);\r\n },\r\n get size() {\r\n return size(this, true);\r\n },\r\n has(key) {\r\n return has$1.call(this, key, true);\r\n },\r\n add: createReadonlyMethod(\"add\" /* ADD */),\r\n set: createReadonlyMethod(\"set\" /* SET */),\r\n delete: createReadonlyMethod(\"delete\" /* DELETE */),\r\n clear: createReadonlyMethod(\"clear\" /* CLEAR */),\r\n forEach: createForEach(true, true)\r\n };\r\n const iteratorMethods = ['keys', 'values', 'entries', Symbol.iterator];\r\n iteratorMethods.forEach(method => {\r\n mutableInstrumentations[method] = createIterableMethod(method, false, false);\r\n readonlyInstrumentations[method] = createIterableMethod(method, true, false);\r\n shallowInstrumentations[method] = createIterableMethod(method, false, true);\r\n shallowReadonlyInstrumentations[method] = createIterableMethod(method, true, true);\r\n });\r\n return [\r\n mutableInstrumentations,\r\n readonlyInstrumentations,\r\n shallowInstrumentations,\r\n shallowReadonlyInstrumentations\r\n ];\r\n}\r\nconst [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* #__PURE__*/ createInstrumentations();\r\nfunction createInstrumentationGetter(isReadonly, shallow) {\r\n const instrumentations = shallow\r\n ? isReadonly\r\n ? shallowReadonlyInstrumentations\r\n : shallowInstrumentations\r\n : isReadonly\r\n ? readonlyInstrumentations\r\n : mutableInstrumentations;\r\n return (target, key, receiver) => {\r\n if (key === \"__v_isReactive\" /* IS_REACTIVE */) {\r\n return !isReadonly;\r\n }\r\n else if (key === \"__v_isReadonly\" /* IS_READONLY */) {\r\n return isReadonly;\r\n }\r\n else if (key === \"__v_raw\" /* RAW */) {\r\n return target;\r\n }\r\n return Reflect.get(shared_esm_bundler_hasOwn(instrumentations, key) && key in target\r\n ? instrumentations\r\n : target, key, receiver);\r\n };\r\n}\r\nconst mutableCollectionHandlers = {\r\n get: /*#__PURE__*/ createInstrumentationGetter(false, false)\r\n};\r\nconst shallowCollectionHandlers = {\r\n get: /*#__PURE__*/ createInstrumentationGetter(false, true)\r\n};\r\nconst readonlyCollectionHandlers = {\r\n get: /*#__PURE__*/ createInstrumentationGetter(true, false)\r\n};\r\nconst shallowReadonlyCollectionHandlers = {\r\n get: /*#__PURE__*/ createInstrumentationGetter(true, true)\r\n};\r\nfunction checkIdentityKeys(target, has, key) {\r\n const rawKey = reactivity_esm_bundler_toRaw(key);\r\n if (rawKey !== key && has.call(target, rawKey)) {\r\n const type = toRawType(target);\r\n console.warn(`Reactive ${type} contains both the raw and reactive ` +\r\n `versions of the same object${type === `Map` ? ` as keys` : ``}, ` +\r\n `which can lead to inconsistencies. ` +\r\n `Avoid differentiating between the raw and reactive versions ` +\r\n `of an object and only use the reactive version if possible.`);\r\n }\r\n}\n\nconst reactiveMap = new WeakMap();\r\nconst shallowReactiveMap = new WeakMap();\r\nconst readonlyMap = new WeakMap();\r\nconst shallowReadonlyMap = new WeakMap();\r\nfunction targetTypeMap(rawType) {\r\n switch (rawType) {\r\n case 'Object':\r\n case 'Array':\r\n return 1 /* COMMON */;\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return 2 /* COLLECTION */;\r\n default:\r\n return 0 /* INVALID */;\r\n }\r\n}\r\nfunction getTargetType(value) {\r\n return value[\"__v_skip\" /* SKIP */] || !Object.isExtensible(value)\r\n ? 0 /* INVALID */\r\n : targetTypeMap(shared_esm_bundler_toRawType(value));\r\n}\r\nfunction reactive(target) {\r\n // if trying to observe a readonly proxy, return the readonly version.\r\n if (target && target[\"__v_isReadonly\" /* IS_READONLY */]) {\r\n return target;\r\n }\r\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\r\n}\r\n/**\r\n * Return a shallowly-reactive copy of the original object, where only the root\r\n * level properties are reactive. It also does not auto-unwrap refs (even at the\r\n * root level).\r\n */\r\nfunction shallowReactive(target) {\r\n return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\r\n}\r\n/**\r\n * Creates a readonly copy of the original object. Note the returned copy is not\r\n * made reactive, but `readonly` can be called on an already reactive object.\r\n */\r\nfunction readonly(target) {\r\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\r\n}\r\n/**\r\n * Returns a reactive-copy of the original object, where only the root level\r\n * properties are readonly, and does NOT unwrap refs nor recursively convert\r\n * returned properties.\r\n * This is used for creating the props proxy object for stateful components.\r\n */\r\nfunction shallowReadonly(target) {\r\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\r\n}\r\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\r\n if (!shared_esm_bundler_isObject(target)) {\r\n if ((false)) {}\r\n return target;\r\n }\r\n // target is already a Proxy, return it.\r\n // exception: calling readonly() on a reactive object\r\n if (target[\"__v_raw\" /* RAW */] &&\r\n !(isReadonly && target[\"__v_isReactive\" /* IS_REACTIVE */])) {\r\n return target;\r\n }\r\n // target already has corresponding Proxy\r\n const existingProxy = proxyMap.get(target);\r\n if (existingProxy) {\r\n return existingProxy;\r\n }\r\n // only a whitelist of value types can be observed.\r\n const targetType = getTargetType(target);\r\n if (targetType === 0 /* INVALID */) {\r\n return target;\r\n }\r\n const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers);\r\n proxyMap.set(target, proxy);\r\n return proxy;\r\n}\r\nfunction isReactive(value) {\r\n if (isReadonly(value)) {\r\n return isReactive(value[\"__v_raw\" /* RAW */]);\r\n }\r\n return !!(value && value[\"__v_isReactive\" /* IS_REACTIVE */]);\r\n}\r\nfunction isReadonly(value) {\r\n return !!(value && value[\"__v_isReadonly\" /* IS_READONLY */]);\r\n}\r\nfunction isProxy(value) {\r\n return isReactive(value) || isReadonly(value);\r\n}\r\nfunction reactivity_esm_bundler_toRaw(observed) {\r\n const raw = observed && observed[\"__v_raw\" /* RAW */];\r\n return raw ? reactivity_esm_bundler_toRaw(raw) : observed;\r\n}\r\nfunction markRaw(value) {\r\n def(value, \"__v_skip\" /* SKIP */, true);\r\n return value;\r\n}\r\nconst toReactive = (value) => shared_esm_bundler_isObject(value) ? reactive(value) : value;\r\nconst toReadonly = (value) => shared_esm_bundler_isObject(value) ? readonly(value) : value;\n\nfunction trackRefValue(ref) {\r\n if (isTracking()) {\r\n ref = reactivity_esm_bundler_toRaw(ref);\r\n if (!ref.dep) {\r\n ref.dep = createDep();\r\n }\r\n if ((false)) {}\r\n else {\r\n trackEffects(ref.dep);\r\n }\r\n }\r\n}\r\nfunction triggerRefValue(ref, newVal) {\r\n ref = reactivity_esm_bundler_toRaw(ref);\r\n if (ref.dep) {\r\n if ((false)) {}\r\n else {\r\n triggerEffects(ref.dep);\r\n }\r\n }\r\n}\r\nfunction isRef(r) {\r\n return Boolean(r && r.__v_isRef === true);\r\n}\r\nfunction ref(value) {\r\n return createRef(value, false);\r\n}\r\nfunction shallowRef(value) {\r\n return createRef(value, true);\r\n}\r\nfunction createRef(rawValue, shallow) {\r\n if (isRef(rawValue)) {\r\n return rawValue;\r\n }\r\n return new RefImpl(rawValue, shallow);\r\n}\r\nclass RefImpl {\r\n constructor(value, _shallow) {\r\n this._shallow = _shallow;\r\n this.dep = undefined;\r\n this.__v_isRef = true;\r\n this._rawValue = _shallow ? value : reactivity_esm_bundler_toRaw(value);\r\n this._value = _shallow ? value : toReactive(value);\r\n }\r\n get value() {\r\n trackRefValue(this);\r\n return this._value;\r\n }\r\n set value(newVal) {\r\n newVal = this._shallow ? newVal : reactivity_esm_bundler_toRaw(newVal);\r\n if (hasChanged(newVal, this._rawValue)) {\r\n this._rawValue = newVal;\r\n this._value = this._shallow ? newVal : toReactive(newVal);\r\n triggerRefValue(this, newVal);\r\n }\r\n }\r\n}\r\nfunction triggerRef(ref) {\r\n triggerRefValue(ref, ( false) ? 0 : void 0);\r\n}\r\nfunction unref(ref) {\r\n return isRef(ref) ? ref.value : ref;\r\n}\r\nconst shallowUnwrapHandlers = {\r\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\r\n set: (target, key, value, receiver) => {\r\n const oldValue = target[key];\r\n if (isRef(oldValue) && !isRef(value)) {\r\n oldValue.value = value;\r\n return true;\r\n }\r\n else {\r\n return Reflect.set(target, key, value, receiver);\r\n }\r\n }\r\n};\r\nfunction proxyRefs(objectWithRefs) {\r\n return isReactive(objectWithRefs)\r\n ? objectWithRefs\r\n : new Proxy(objectWithRefs, shallowUnwrapHandlers);\r\n}\r\nclass CustomRefImpl {\r\n constructor(factory) {\r\n this.dep = undefined;\r\n this.__v_isRef = true;\r\n const { get, set } = factory(() => trackRefValue(this), () => triggerRefValue(this));\r\n this._get = get;\r\n this._set = set;\r\n }\r\n get value() {\r\n return this._get();\r\n }\r\n set value(newVal) {\r\n this._set(newVal);\r\n }\r\n}\r\nfunction customRef(factory) {\r\n return new CustomRefImpl(factory);\r\n}\r\nfunction toRefs(object) {\r\n if (false) {}\r\n const ret = shared_esm_bundler_isArray(object) ? new Array(object.length) : {};\r\n for (const key in object) {\r\n ret[key] = toRef(object, key);\r\n }\r\n return ret;\r\n}\r\nclass ObjectRefImpl {\r\n constructor(_object, _key) {\r\n this._object = _object;\r\n this._key = _key;\r\n this.__v_isRef = true;\r\n }\r\n get value() {\r\n return this._object[this._key];\r\n }\r\n set value(newVal) {\r\n this._object[this._key] = newVal;\r\n }\r\n}\r\nfunction toRef(object, key) {\r\n const val = object[key];\r\n return isRef(val) ? val : new ObjectRefImpl(object, key);\r\n}\n\nclass ComputedRefImpl {\r\n constructor(getter, _setter, isReadonly) {\r\n this._setter = _setter;\r\n this.dep = undefined;\r\n this._dirty = true;\r\n this.__v_isRef = true;\r\n this.effect = new ReactiveEffect(getter, () => {\r\n if (!this._dirty) {\r\n this._dirty = true;\r\n triggerRefValue(this);\r\n }\r\n });\r\n this[\"__v_isReadonly\" /* IS_READONLY */] = isReadonly;\r\n }\r\n get value() {\r\n // the computed ref may get wrapped by other proxies e.g. readonly() #3376\r\n const self = reactivity_esm_bundler_toRaw(this);\r\n trackRefValue(self);\r\n if (self._dirty) {\r\n self._dirty = false;\r\n self._value = self.effect.run();\r\n }\r\n return self._value;\r\n }\r\n set value(newValue) {\r\n this._setter(newValue);\r\n }\r\n}\r\nfunction computed(getterOrOptions, debugOptions) {\r\n let getter;\r\n let setter;\r\n const onlyGetter = isFunction(getterOrOptions);\r\n if (onlyGetter) {\r\n getter = getterOrOptions;\r\n setter = ( false)\r\n ? 0\r\n : shared_esm_bundler_NOOP;\r\n }\r\n else {\r\n getter = getterOrOptions.get;\r\n setter = getterOrOptions.set;\r\n }\r\n const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter);\r\n if (false) {}\r\n return cRef;\r\n}\n\nvar _a;\r\nconst tick = Promise.resolve();\r\nconst queue = (/* unused pure expression or super */ null && ([]));\r\nlet queued = false;\r\nconst scheduler = (fn) => {\r\n queue.push(fn);\r\n if (!queued) {\r\n queued = true;\r\n tick.then(flush);\r\n }\r\n};\r\nconst flush = () => {\r\n for (let i = 0; i < queue.length; i++) {\r\n queue[i]();\r\n }\r\n queue.length = 0;\r\n queued = false;\r\n};\r\nclass DeferredComputedRefImpl {\r\n constructor(getter) {\r\n this.dep = undefined;\r\n this._dirty = true;\r\n this.__v_isRef = true;\r\n this[_a] = true;\r\n let compareTarget;\r\n let hasCompareTarget = false;\r\n let scheduled = false;\r\n this.effect = new ReactiveEffect(getter, (computedTrigger) => {\r\n if (this.dep) {\r\n if (computedTrigger) {\r\n compareTarget = this._value;\r\n hasCompareTarget = true;\r\n }\r\n else if (!scheduled) {\r\n const valueToCompare = hasCompareTarget ? compareTarget : this._value;\r\n scheduled = true;\r\n hasCompareTarget = false;\r\n scheduler(() => {\r\n if (this.effect.active && this._get() !== valueToCompare) {\r\n triggerRefValue(this);\r\n }\r\n scheduled = false;\r\n });\r\n }\r\n // chained upstream computeds are notified synchronously to ensure\r\n // value invalidation in case of sync access; normal effects are\r\n // deferred to be triggered in scheduler.\r\n for (const e of this.dep) {\r\n if (e.computed) {\r\n e.scheduler(true /* computedTrigger */);\r\n }\r\n }\r\n }\r\n this._dirty = true;\r\n });\r\n this.effect.computed = true;\r\n }\r\n _get() {\r\n if (this._dirty) {\r\n this._dirty = false;\r\n return (this._value = this.effect.run());\r\n }\r\n return this._value;\r\n }\r\n get value() {\r\n trackRefValue(this);\r\n // the computed ref may get wrapped by other proxies e.g. readonly() #3376\r\n return reactivity_esm_bundler_toRaw(this)._get();\r\n }\r\n}\r\n_a = \"__v_isReadonly\" /* IS_READONLY */;\r\nfunction deferredComputed(getter) {\r\n return new DeferredComputedRefImpl(getter);\r\n}\n\n\n\n;// CONCATENATED MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js\n\n\n\n\n\n/* eslint-disable no-restricted-globals */\r\nlet isHmrUpdating = false;\r\nconst hmrDirtyComponents = new Set();\r\n// Expose the HMR runtime on the global object\r\n// This makes it entirely tree-shakable without polluting the exports and makes\r\n// it easier to be used in toolings like vue-loader\r\n// Note: for a component to be eligible for HMR it also needs the __hmrId option\r\n// to be set so that its instances can be registered / removed.\r\nif ((false)) {}\r\nconst map = new Map();\r\nfunction registerHMR(instance) {\r\n const id = instance.type.__hmrId;\r\n let record = map.get(id);\r\n if (!record) {\r\n createRecord(id, instance.type);\r\n record = map.get(id);\r\n }\r\n record.instances.add(instance);\r\n}\r\nfunction unregisterHMR(instance) {\r\n map.get(instance.type.__hmrId).instances.delete(instance);\r\n}\r\nfunction createRecord(id, initialDef) {\r\n if (map.has(id)) {\r\n return false;\r\n }\r\n map.set(id, {\r\n initialDef: normalizeClassComponent(initialDef),\r\n instances: new Set()\r\n });\r\n return true;\r\n}\r\nfunction normalizeClassComponent(component) {\r\n return isClassComponent(component) ? component.__vccOpts : component;\r\n}\r\nfunction rerender(id, newRender) {\r\n const record = map.get(id);\r\n if (!record) {\r\n return;\r\n }\r\n // update initial record (for not-yet-rendered component)\r\n record.initialDef.render = newRender;\r\n [...record.instances].forEach(instance => {\r\n if (newRender) {\r\n instance.render = newRender;\r\n normalizeClassComponent(instance.type).render = newRender;\r\n }\r\n instance.renderCache = [];\r\n // this flag forces child components with slot content to update\r\n isHmrUpdating = true;\r\n instance.update();\r\n isHmrUpdating = false;\r\n });\r\n}\r\nfunction reload(id, newComp) {\r\n const record = map.get(id);\r\n if (!record)\r\n return;\r\n newComp = normalizeClassComponent(newComp);\r\n // update initial def (for not-yet-rendered components)\r\n updateComponentDef(record.initialDef, newComp);\r\n // create a snapshot which avoids the set being mutated during updates\r\n const instances = [...record.instances];\r\n for (const instance of instances) {\r\n const oldComp = normalizeClassComponent(instance.type);\r\n if (!hmrDirtyComponents.has(oldComp)) {\r\n // 1. Update existing comp definition to match new one\r\n if (oldComp !== record.initialDef) {\r\n updateComponentDef(oldComp, newComp);\r\n }\r\n // 2. mark definition dirty. This forces the renderer to replace the\r\n // component on patch.\r\n hmrDirtyComponents.add(oldComp);\r\n }\r\n // 3. invalidate options resolution cache\r\n instance.appContext.optionsCache.delete(instance.type);\r\n // 4. actually update\r\n if (instance.ceReload) {\r\n // custom element\r\n hmrDirtyComponents.add(oldComp);\r\n instance.ceReload(newComp.styles);\r\n hmrDirtyComponents.delete(oldComp);\r\n }\r\n else if (instance.parent) {\r\n // 4. Force the parent instance to re-render. This will cause all updated\r\n // components to be unmounted and re-mounted. Queue the update so that we\r\n // don't end up forcing the same parent to re-render multiple times.\r\n queueJob(instance.parent.update);\r\n // instance is the inner component of an async custom element\r\n // invoke to reset styles\r\n if (instance.parent.type.__asyncLoader &&\r\n instance.parent.ceReload) {\r\n instance.parent.ceReload(newComp.styles);\r\n }\r\n }\r\n else if (instance.appContext.reload) {\r\n // root instance mounted via createApp() has a reload method\r\n instance.appContext.reload();\r\n }\r\n else if (typeof window !== 'undefined') {\r\n // root instance inside tree created via raw render(). Force reload.\r\n window.location.reload();\r\n }\r\n else {\r\n console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');\r\n }\r\n }\r\n // 5. make sure to cleanup dirty hmr components after update\r\n queuePostFlushCb(() => {\r\n for (const instance of instances) {\r\n hmrDirtyComponents.delete(normalizeClassComponent(instance.type));\r\n }\r\n });\r\n}\r\nfunction updateComponentDef(oldComp, newComp) {\r\n extend(oldComp, newComp);\r\n for (const key in oldComp) {\r\n if (key !== '__file' && !(key in newComp)) {\r\n delete oldComp[key];\r\n }\r\n }\r\n}\r\nfunction tryWrap(fn) {\r\n return (id, arg) => {\r\n try {\r\n return fn(id, arg);\r\n }\r\n catch (e) {\r\n console.error(e);\r\n console.warn(`[HMR] Something went wrong during Vue component hot-reload. ` +\r\n `Full reload required.`);\r\n }\r\n };\r\n}\n\nlet devtools;\r\nlet buffer = [];\r\nlet devtoolsNotInstalled = false;\r\nfunction emit(event, ...args) {\r\n if (devtools) {\r\n devtools.emit(event, ...args);\r\n }\r\n else if (!devtoolsNotInstalled) {\r\n buffer.push({ event, args });\r\n }\r\n}\r\nfunction setDevtoolsHook(hook, target) {\r\n var _a, _b;\r\n devtools = hook;\r\n if (devtools) {\r\n devtools.enabled = true;\r\n buffer.forEach(({ event, args }) => devtools.emit(event, ...args));\r\n buffer = [];\r\n }\r\n else if (\r\n // handle late devtools injection - only do this if we are in an actual\r\n // browser environment to avoid the timer handle stalling test runner exit\r\n // (#4815)\r\n // eslint-disable-next-line no-restricted-globals\r\n typeof window !== 'undefined' &&\r\n // some envs mock window but not fully\r\n window.HTMLElement &&\r\n // also exclude jsdom\r\n !((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {\r\n const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =\r\n target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);\r\n replay.push((newHook) => {\r\n setDevtoolsHook(newHook, target);\r\n });\r\n // clear buffer after 3s - the user probably doesn't have devtools installed\r\n // at all, and keeping the buffer will cause memory leaks (#4738)\r\n setTimeout(() => {\r\n if (!devtools) {\r\n target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;\r\n devtoolsNotInstalled = true;\r\n buffer = [];\r\n }\r\n }, 3000);\r\n }\r\n else {\r\n // non-browser env, assume not installed\r\n devtoolsNotInstalled = true;\r\n buffer = [];\r\n }\r\n}\r\nfunction devtoolsInitApp(app, version) {\r\n emit(\"app:init\" /* APP_INIT */, app, version, {\r\n Fragment,\r\n Text,\r\n Comment,\r\n Static\r\n });\r\n}\r\nfunction devtoolsUnmountApp(app) {\r\n emit(\"app:unmount\" /* APP_UNMOUNT */, app);\r\n}\r\nconst devtoolsComponentAdded = /*#__PURE__*/ (/* unused pure expression or super */ null && (createDevtoolsComponentHook(\"component:added\" /* COMPONENT_ADDED */)));\r\nconst devtoolsComponentUpdated = \r\n/*#__PURE__*/ (/* unused pure expression or super */ null && (createDevtoolsComponentHook(\"component:updated\" /* COMPONENT_UPDATED */)));\r\nconst devtoolsComponentRemoved = \r\n/*#__PURE__*/ (/* unused pure expression or super */ null && (createDevtoolsComponentHook(\"component:removed\" /* COMPONENT_REMOVED */)));\r\nfunction createDevtoolsComponentHook(hook) {\r\n return (component) => {\r\n emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);\r\n };\r\n}\r\nconst devtoolsPerfStart = /*#__PURE__*/ (/* unused pure expression or super */ null && (createDevtoolsPerformanceHook(\"perf:start\" /* PERFORMANCE_START */)));\r\nconst devtoolsPerfEnd = /*#__PURE__*/ (/* unused pure expression or super */ null && (createDevtoolsPerformanceHook(\"perf:end\" /* PERFORMANCE_END */)));\r\nfunction createDevtoolsPerformanceHook(hook) {\r\n return (component, type, time) => {\r\n emit(hook, component.appContext.app, component.uid, component, type, time);\r\n };\r\n}\r\nfunction devtoolsComponentEmit(component, event, params) {\r\n emit(\"component:emit\" /* COMPONENT_EMIT */, component.appContext.app, component, event, params);\r\n}\n\nfunction emit$1(instance, event, ...rawArgs) {\r\n const props = instance.vnode.props || EMPTY_OBJ;\r\n if ((false)) {}\r\n let args = rawArgs;\r\n const isModelListener = event.startsWith('update:');\r\n // for v-model update:xxx events, apply modifiers on args\r\n const modelArg = isModelListener && event.slice(7);\r\n if (modelArg && modelArg in props) {\r\n const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;\r\n const { number, trim } = props[modifiersKey] || EMPTY_OBJ;\r\n if (trim) {\r\n args = rawArgs.map(a => a.trim());\r\n }\r\n else if (number) {\r\n args = rawArgs.map(toNumber);\r\n }\r\n }\r\n if (false) {}\r\n if ((false)) {}\r\n let handlerName;\r\n let handler = props[(handlerName = toHandlerKey(event))] ||\r\n // also try camelCase event handler (#2249)\r\n props[(handlerName = toHandlerKey(camelize(event)))];\r\n // for v-model update:xxx events, also trigger kebab-case equivalent\r\n // for props passed via kebab-case\r\n if (!handler && isModelListener) {\r\n handler = props[(handlerName = toHandlerKey(shared_esm_bundler_hyphenate(event)))];\r\n }\r\n if (handler) {\r\n callWithAsyncErrorHandling(handler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n const onceHandler = props[handlerName + `Once`];\r\n if (onceHandler) {\r\n if (!instance.emitted) {\r\n instance.emitted = {};\r\n }\r\n else if (instance.emitted[handlerName]) {\r\n return;\r\n }\r\n instance.emitted[handlerName] = true;\r\n callWithAsyncErrorHandling(onceHandler, instance, 6 /* COMPONENT_EVENT_HANDLER */, args);\r\n }\r\n}\r\nfunction normalizeEmitsOptions(comp, appContext, asMixin = false) {\r\n const cache = appContext.emitsCache;\r\n const cached = cache.get(comp);\r\n if (cached !== undefined) {\r\n return cached;\r\n }\r\n const raw = comp.emits;\r\n let normalized = {};\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if ( true && !isFunction(comp)) {\r\n const extendEmits = (raw) => {\r\n const normalizedFromExtend = normalizeEmitsOptions(raw, appContext, true);\r\n if (normalizedFromExtend) {\r\n hasExtends = true;\r\n shared_esm_bundler_extend(normalized, normalizedFromExtend);\r\n }\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendEmits);\r\n }\r\n if (comp.extends) {\r\n extendEmits(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendEmits);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n cache.set(comp, null);\r\n return null;\r\n }\r\n if (shared_esm_bundler_isArray(raw)) {\r\n raw.forEach(key => (normalized[key] = null));\r\n }\r\n else {\r\n shared_esm_bundler_extend(normalized, raw);\r\n }\r\n cache.set(comp, normalized);\r\n return normalized;\r\n}\r\n// Check if an incoming prop key is a declared emit event listener.\r\n// e.g. With `emits: { click: null }`, props named `onClick` and `onclick` are\r\n// both considered matched listeners.\r\nfunction isEmitListener(options, key) {\r\n if (!options || !isOn(key)) {\r\n return false;\r\n }\r\n key = key.slice(2).replace(/Once$/, '');\r\n return (shared_esm_bundler_hasOwn(options, key[0].toLowerCase() + key.slice(1)) ||\r\n shared_esm_bundler_hasOwn(options, shared_esm_bundler_hyphenate(key)) ||\r\n shared_esm_bundler_hasOwn(options, key));\r\n}\n\n/**\r\n * mark the current rendering instance for asset resolution (e.g.\r\n * resolveComponent, resolveDirective) during render\r\n */\r\nlet currentRenderingInstance = null;\r\nlet currentScopeId = null;\r\n/**\r\n * Note: rendering calls maybe nested. The function returns the parent rendering\r\n * instance if present, which should be restored after the render is done:\r\n *\r\n * ```js\r\n * const prev = setCurrentRenderingInstance(i)\r\n * // ...render\r\n * setCurrentRenderingInstance(prev)\r\n * ```\r\n */\r\nfunction setCurrentRenderingInstance(instance) {\r\n const prev = currentRenderingInstance;\r\n currentRenderingInstance = instance;\r\n currentScopeId = (instance && instance.type.__scopeId) || null;\r\n return prev;\r\n}\r\n/**\r\n * Set scope id when creating hoisted vnodes.\r\n * @private compiler helper\r\n */\r\nfunction pushScopeId(id) {\r\n currentScopeId = id;\r\n}\r\n/**\r\n * Technically we no longer need this after 3.0.8 but we need to keep the same\r\n * API for backwards compat w/ code generated by compilers.\r\n * @private\r\n */\r\nfunction popScopeId() {\r\n currentScopeId = null;\r\n}\r\n/**\r\n * Only for backwards compat\r\n * @private\r\n */\r\nconst withScopeId = (_id) => withCtx;\r\n/**\r\n * Wrap a slot function to memoize current rendering instance\r\n * @private compiler helper\r\n */\r\nfunction withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot // false only\r\n) {\r\n if (!ctx)\r\n return fn;\r\n // already normalized\r\n if (fn._n) {\r\n return fn;\r\n }\r\n const renderFnWithContext = (...args) => {\r\n // If a user calls a compiled slot inside a template expression (#1745), it\r\n // can mess up block tracking, so by default we disable block tracking and\r\n // force bail out when invoking a compiled slot (indicated by the ._d flag).\r\n // This isn't necessary if rendering a compiled `<slot>`, so we flip the\r\n // ._d flag off when invoking the wrapped fn inside `renderSlot`.\r\n if (renderFnWithContext._d) {\r\n setBlockTracking(-1);\r\n }\r\n const prevInstance = setCurrentRenderingInstance(ctx);\r\n const res = fn(...args);\r\n setCurrentRenderingInstance(prevInstance);\r\n if (renderFnWithContext._d) {\r\n setBlockTracking(1);\r\n }\r\n if (false) {}\r\n return res;\r\n };\r\n // mark normalized to avoid duplicated wrapping\r\n renderFnWithContext._n = true;\r\n // mark this as compiled by default\r\n // this is used in vnode.ts -> normalizeChildren() to set the slot\r\n // rendering flag.\r\n renderFnWithContext._c = true;\r\n // disable block tracking by default\r\n renderFnWithContext._d = true;\r\n return renderFnWithContext;\r\n}\n\n/**\r\n * dev only flag to track whether $attrs was used during render.\r\n * If $attrs was used during render then the warning for failed attrs\r\n * fallthrough can be suppressed.\r\n */\r\nlet accessedAttrs = false;\r\nfunction markAttrsAccessed() {\r\n accessedAttrs = true;\r\n}\r\nfunction renderComponentRoot(instance) {\r\n const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;\r\n let result;\r\n let fallthroughAttrs;\r\n const prev = setCurrentRenderingInstance(instance);\r\n if ((false)) {}\r\n try {\r\n if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {\r\n // withProxy is a proxy with a different `has` trap only for\r\n // runtime-compiled render functions using `with` block.\r\n const proxyToUse = withProxy || proxy;\r\n result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));\r\n fallthroughAttrs = attrs;\r\n }\r\n else {\r\n // functional\r\n const render = Component;\r\n // in dev, mark attrs accessed if optional props (attrs === props)\r\n if (false) {}\r\n result = normalizeVNode(render.length > 1\r\n ? render(props, ( false)\r\n ? 0\r\n : { attrs, slots, emit })\r\n : render(props, null /* we know it doesn't need it */));\r\n fallthroughAttrs = Component.props\r\n ? attrs\r\n : getFunctionalFallthrough(attrs);\r\n }\r\n }\r\n catch (err) {\r\n blockStack.length = 0;\r\n handleError(err, instance, 1 /* RENDER_FUNCTION */);\r\n result = createVNode(Comment);\r\n }\r\n // attr merging\r\n // in dev mode, comments are preserved, and it's possible for a template\r\n // to have comments along side the root element which makes it a fragment\r\n let root = result;\r\n let setRoot = undefined;\r\n if (false /* DEV_ROOT_FRAGMENT */) {}\r\n if (fallthroughAttrs && inheritAttrs !== false) {\r\n const keys = Object.keys(fallthroughAttrs);\r\n const { shapeFlag } = root;\r\n if (keys.length) {\r\n if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {\r\n if (propsOptions && keys.some(isModelListener)) {\r\n // If a v-model listener (onUpdate:xxx) has a corresponding declared\r\n // prop, it indicates this component expects to handle v-model and\r\n // it should not fallthrough.\r\n // related: #1543, #1643, #1989\r\n fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);\r\n }\r\n root = cloneVNode(root, fallthroughAttrs);\r\n }\r\n else if (false) {}\r\n }\r\n }\r\n // inherit directives\r\n if (vnode.dirs) {\r\n if (false) {}\r\n root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;\r\n }\r\n // inherit transition data\r\n if (vnode.transition) {\r\n if (false) {}\r\n root.transition = vnode.transition;\r\n }\r\n if (false) {}\r\n else {\r\n result = root;\r\n }\r\n setCurrentRenderingInstance(prev);\r\n return result;\r\n}\r\n/**\r\n * dev only\r\n * In dev mode, template root level comments are rendered, which turns the\r\n * template into a fragment root, but we need to locate the single element\r\n * root for attrs and scope id processing.\r\n */\r\nconst getChildRoot = (vnode) => {\r\n const rawChildren = vnode.children;\r\n const dynamicChildren = vnode.dynamicChildren;\r\n const childRoot = filterSingleRoot(rawChildren);\r\n if (!childRoot) {\r\n return [vnode, undefined];\r\n }\r\n const index = rawChildren.indexOf(childRoot);\r\n const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;\r\n const setRoot = (updatedRoot) => {\r\n rawChildren[index] = updatedRoot;\r\n if (dynamicChildren) {\r\n if (dynamicIndex > -1) {\r\n dynamicChildren[dynamicIndex] = updatedRoot;\r\n }\r\n else if (updatedRoot.patchFlag > 0) {\r\n vnode.dynamicChildren = [...dynamicChildren, updatedRoot];\r\n }\r\n }\r\n };\r\n return [normalizeVNode(childRoot), setRoot];\r\n};\r\nfunction filterSingleRoot(children) {\r\n let singleRoot;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (isVNode(child)) {\r\n // ignore user comment\r\n if (child.type !== Comment || child.children === 'v-if') {\r\n if (singleRoot) {\r\n // has more than 1 non-comment child, return now\r\n return;\r\n }\r\n else {\r\n singleRoot = child;\r\n }\r\n }\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n return singleRoot;\r\n}\r\nconst getFunctionalFallthrough = (attrs) => {\r\n let res;\r\n for (const key in attrs) {\r\n if (key === 'class' || key === 'style' || isOn(key)) {\r\n (res || (res = {}))[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst filterModelListeners = (attrs, props) => {\r\n const res = {};\r\n for (const key in attrs) {\r\n if (!isModelListener(key) || !(key.slice(9) in props)) {\r\n res[key] = attrs[key];\r\n }\r\n }\r\n return res;\r\n};\r\nconst isElementRoot = (vnode) => {\r\n return (vnode.shapeFlag & (6 /* COMPONENT */ | 1 /* ELEMENT */) ||\r\n vnode.type === Comment // potential v-if branch switch\r\n );\r\n};\r\nfunction shouldUpdateComponent(prevVNode, nextVNode, optimized) {\r\n const { props: prevProps, children: prevChildren, component } = prevVNode;\r\n const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;\r\n const emits = component.emitsOptions;\r\n // Parent component's render function was hot-updated. Since this may have\r\n // caused the child component's slots content to have changed, we need to\r\n // force the child to update as well.\r\n if (false) {}\r\n // force child update for runtime directive or transition on component vnode.\r\n if (nextVNode.dirs || nextVNode.transition) {\r\n return true;\r\n }\r\n if (optimized && patchFlag >= 0) {\r\n if (patchFlag & 1024 /* DYNAMIC_SLOTS */) {\r\n // slot content that references values that might have changed,\r\n // e.g. in a v-for\r\n return true;\r\n }\r\n if (patchFlag & 16 /* FULL_PROPS */) {\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n // presence of this flag indicates props are always non-null\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n else if (patchFlag & 8 /* PROPS */) {\r\n const dynamicProps = nextVNode.dynamicProps;\r\n for (let i = 0; i < dynamicProps.length; i++) {\r\n const key = dynamicProps[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emits, key)) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // this path is only taken by manually written render functions\r\n // so presence of any children leads to a forced update\r\n if (prevChildren || nextChildren) {\r\n if (!nextChildren || !nextChildren.$stable) {\r\n return true;\r\n }\r\n }\r\n if (prevProps === nextProps) {\r\n return false;\r\n }\r\n if (!prevProps) {\r\n return !!nextProps;\r\n }\r\n if (!nextProps) {\r\n return true;\r\n }\r\n return hasPropsChanged(prevProps, nextProps, emits);\r\n }\r\n return false;\r\n}\r\nfunction hasPropsChanged(prevProps, nextProps, emitsOptions) {\r\n const nextKeys = Object.keys(nextProps);\r\n if (nextKeys.length !== Object.keys(prevProps).length) {\r\n return true;\r\n }\r\n for (let i = 0; i < nextKeys.length; i++) {\r\n const key = nextKeys[i];\r\n if (nextProps[key] !== prevProps[key] &&\r\n !isEmitListener(emitsOptions, key)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction updateHOCHostEl({ vnode, parent }, el // HostNode\r\n) {\r\n while (parent && parent.subTree === vnode) {\r\n (vnode = parent.vnode).el = el;\r\n parent = parent.parent;\r\n }\r\n}\n\nconst isSuspense = (type) => type.__isSuspense;\r\n// Suspense exposes a component-like API, and is treated like a component\r\n// in the compiler, but internally it's a special built-in type that hooks\r\n// directly into the renderer.\r\nconst SuspenseImpl = {\r\n name: 'Suspense',\r\n // In order to make Suspense tree-shakable, we need to avoid importing it\r\n // directly in the renderer. The renderer checks for the __isSuspense flag\r\n // on a vnode's type and calls the `process` method, passing in renderer\r\n // internals.\r\n __isSuspense: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, \r\n // platform-specific impl passed from renderer\r\n rendererInternals) {\r\n if (n1 == null) {\r\n mountSuspense(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals);\r\n }\r\n else {\r\n patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, rendererInternals);\r\n }\r\n },\r\n hydrate: hydrateSuspense,\r\n create: createSuspenseBoundary,\r\n normalize: normalizeSuspenseChildren\r\n};\r\n// Force-casted public typing for h and TSX props inference\r\nconst Suspense = (SuspenseImpl );\r\nfunction triggerEvent(vnode, name) {\r\n const eventListener = vnode.props && vnode.props[name];\r\n if (isFunction(eventListener)) {\r\n eventListener();\r\n }\r\n}\r\nfunction mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals) {\r\n const { p: patch, o: { createElement } } = rendererInternals;\r\n const hiddenContainer = createElement('div');\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals));\r\n // start mounting the content subtree in an off-dom container\r\n patch(null, (suspense.pendingBranch = vnode.ssContent), hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds);\r\n // now check if we have encountered any async deps\r\n if (suspense.deps > 0) {\r\n // has async\r\n // invoke @fallback event\r\n triggerEvent(vnode, 'onPending');\r\n triggerEvent(vnode, 'onFallback');\r\n // mount the fallback tree\r\n patch(null, vnode.ssFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds);\r\n setActiveBranch(suspense, vnode.ssFallback);\r\n }\r\n else {\r\n // Suspense has no async deps. Just resolve.\r\n suspense.resolve();\r\n }\r\n}\r\nfunction patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {\r\n const suspense = (n2.suspense = n1.suspense);\r\n suspense.vnode = n2;\r\n n2.el = n1.el;\r\n const newBranch = n2.ssContent;\r\n const newFallback = n2.ssFallback;\r\n const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;\r\n if (pendingBranch) {\r\n suspense.pendingBranch = newBranch;\r\n if (isSameVNodeType(newBranch, pendingBranch)) {\r\n // same root type but content may have changed.\r\n patch(pendingBranch, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else if (isInFallback) {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else {\r\n // toggled before pending tree is resolved\r\n suspense.pendingId++;\r\n if (isHydrating) {\r\n // if toggled before hydration is finished, the current DOM tree is\r\n // no longer valid. set it as the active branch so it will be unmounted\r\n // when resolved\r\n suspense.isHydrating = false;\r\n suspense.activeBranch = pendingBranch;\r\n }\r\n else {\r\n unmount(pendingBranch, parentComponent, suspense);\r\n }\r\n // increment pending ID. this is used to invalidate async callbacks\r\n // reset suspense state\r\n suspense.deps = 0;\r\n // discard effects from pending branch\r\n suspense.effects.length = 0;\r\n // discard previous container\r\n suspense.hiddenContainer = createElement('div');\r\n if (isInFallback) {\r\n // already in fallback state\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n else {\r\n patch(activeBranch, newFallback, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newFallback);\r\n }\r\n }\r\n else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // toggled \"back\" to current active branch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n // force resolve\r\n suspense.resolve(true);\r\n }\r\n else {\r\n // switched to a 3rd branch\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n suspense.resolve();\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {\r\n // root did not change, just normal patch\r\n patch(activeBranch, newBranch, container, anchor, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, newBranch);\r\n }\r\n else {\r\n // root node toggled\r\n // invoke @pending event\r\n triggerEvent(n2, 'onPending');\r\n // mount pending branch in off-dom container\r\n suspense.pendingBranch = newBranch;\r\n suspense.pendingId++;\r\n patch(null, newBranch, suspense.hiddenContainer, null, parentComponent, suspense, isSVG, slotScopeIds, optimized);\r\n if (suspense.deps <= 0) {\r\n // incoming branch has no async deps, resolve now.\r\n suspense.resolve();\r\n }\r\n else {\r\n const { timeout, pendingId } = suspense;\r\n if (timeout > 0) {\r\n setTimeout(() => {\r\n if (suspense.pendingId === pendingId) {\r\n suspense.fallback(newFallback);\r\n }\r\n }, timeout);\r\n }\r\n else if (timeout === 0) {\r\n suspense.fallback(newFallback);\r\n }\r\n }\r\n }\r\n }\r\n}\r\nlet hasWarned = false;\r\nfunction createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {\r\n /* istanbul ignore if */\r\n if (false) {}\r\n const { p: patch, m: move, um: unmount, n: next, o: { parentNode, remove } } = rendererInternals;\r\n const timeout = toNumber(vnode.props && vnode.props.timeout);\r\n const suspense = {\r\n vnode,\r\n parent,\r\n parentComponent,\r\n isSVG,\r\n container,\r\n hiddenContainer,\r\n anchor,\r\n deps: 0,\r\n pendingId: 0,\r\n timeout: typeof timeout === 'number' ? timeout : -1,\r\n activeBranch: null,\r\n pendingBranch: null,\r\n isInFallback: true,\r\n isHydrating,\r\n isUnmounted: false,\r\n effects: [],\r\n resolve(resume = false) {\r\n if ((false)) {}\r\n const { vnode, activeBranch, pendingBranch, pendingId, effects, parentComponent, container } = suspense;\r\n if (suspense.isHydrating) {\r\n suspense.isHydrating = false;\r\n }\r\n else if (!resume) {\r\n const delayEnter = activeBranch &&\r\n pendingBranch.transition &&\r\n pendingBranch.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = () => {\r\n if (pendingId === suspense.pendingId) {\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n };\r\n }\r\n // this is initial anchor on mount\r\n let { anchor } = suspense;\r\n // unmount current active tree\r\n if (activeBranch) {\r\n // if the fallback tree was mounted, it may have been moved\r\n // as part of a parent suspense. get the latest anchor for insertion\r\n anchor = next(activeBranch);\r\n unmount(activeBranch, parentComponent, suspense, true);\r\n }\r\n if (!delayEnter) {\r\n // move content from off-dom container to actual container\r\n move(pendingBranch, container, anchor, 0 /* ENTER */);\r\n }\r\n }\r\n setActiveBranch(suspense, pendingBranch);\r\n suspense.pendingBranch = null;\r\n suspense.isInFallback = false;\r\n // flush buffered effects\r\n // check if there is a pending parent suspense\r\n let parent = suspense.parent;\r\n let hasUnresolvedAncestor = false;\r\n while (parent) {\r\n if (parent.pendingBranch) {\r\n // found a pending parent suspense, merge buffered post jobs\r\n // into that parent\r\n parent.effects.push(...effects);\r\n hasUnresolvedAncestor = true;\r\n break;\r\n }\r\n parent = parent.parent;\r\n }\r\n // no pending parent suspense, flush all jobs\r\n if (!hasUnresolvedAncestor) {\r\n queuePostFlushCb(effects);\r\n }\r\n suspense.effects = [];\r\n // invoke @resolve event\r\n triggerEvent(vnode, 'onResolve');\r\n },\r\n fallback(fallbackVNode) {\r\n if (!suspense.pendingBranch) {\r\n return;\r\n }\r\n const { vnode, activeBranch, parentComponent, container, isSVG } = suspense;\r\n // invoke @fallback event\r\n triggerEvent(vnode, 'onFallback');\r\n const anchor = next(activeBranch);\r\n const mountFallback = () => {\r\n if (!suspense.isInFallback) {\r\n return;\r\n }\r\n // mount the fallback tree\r\n patch(null, fallbackVNode, container, anchor, parentComponent, null, // fallback tree will not have suspense context\r\n isSVG, slotScopeIds, optimized);\r\n setActiveBranch(suspense, fallbackVNode);\r\n };\r\n const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === 'out-in';\r\n if (delayEnter) {\r\n activeBranch.transition.afterLeave = mountFallback;\r\n }\r\n suspense.isInFallback = true;\r\n // unmount current active branch\r\n unmount(activeBranch, parentComponent, null, // no suspense so unmount hooks fire now\r\n true // shouldRemove\r\n );\r\n if (!delayEnter) {\r\n mountFallback();\r\n }\r\n },\r\n move(container, anchor, type) {\r\n suspense.activeBranch &&\r\n move(suspense.activeBranch, container, anchor, type);\r\n suspense.container = container;\r\n },\r\n next() {\r\n return suspense.activeBranch && next(suspense.activeBranch);\r\n },\r\n registerDep(instance, setupRenderEffect) {\r\n const isInPendingSuspense = !!suspense.pendingBranch;\r\n if (isInPendingSuspense) {\r\n suspense.deps++;\r\n }\r\n const hydratedEl = instance.vnode.el;\r\n instance\r\n .asyncDep.catch(err => {\r\n handleError(err, instance, 0 /* SETUP_FUNCTION */);\r\n })\r\n .then(asyncSetupResult => {\r\n // retry when the setup() promise resolves.\r\n // component may have been unmounted before resolve.\r\n if (instance.isUnmounted ||\r\n suspense.isUnmounted ||\r\n suspense.pendingId !== instance.suspenseId) {\r\n return;\r\n }\r\n // retry from this component\r\n instance.asyncResolved = true;\r\n const { vnode } = instance;\r\n if ((false)) {}\r\n handleSetupResult(instance, asyncSetupResult, false);\r\n if (hydratedEl) {\r\n // vnode may have been replaced if an update happened before the\r\n // async dep is resolved.\r\n vnode.el = hydratedEl;\r\n }\r\n const placeholder = !hydratedEl && instance.subTree.el;\r\n setupRenderEffect(instance, vnode, \r\n // component may have been moved before resolve.\r\n // if this is not a hydration, instance.subTree will be the comment\r\n // placeholder.\r\n parentNode(hydratedEl || instance.subTree.el), \r\n // anchor will not be used if this is hydration, so only need to\r\n // consider the comment placeholder case.\r\n hydratedEl ? null : next(instance.subTree), suspense, isSVG, optimized);\r\n if (placeholder) {\r\n remove(placeholder);\r\n }\r\n updateHOCHostEl(instance, vnode.el);\r\n if ((false)) {}\r\n // only decrease deps count if suspense is not already resolved\r\n if (isInPendingSuspense && --suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n });\r\n },\r\n unmount(parentSuspense, doRemove) {\r\n suspense.isUnmounted = true;\r\n if (suspense.activeBranch) {\r\n unmount(suspense.activeBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n if (suspense.pendingBranch) {\r\n unmount(suspense.pendingBranch, parentComponent, parentSuspense, doRemove);\r\n }\r\n }\r\n };\r\n return suspense;\r\n}\r\nfunction hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, rendererInternals, hydrateNode) {\r\n /* eslint-disable no-restricted-globals */\r\n const suspense = (vnode.suspense = createSuspenseBoundary(vnode, parentSuspense, parentComponent, node.parentNode, document.createElement('div'), null, isSVG, slotScopeIds, optimized, rendererInternals, true /* hydrating */));\r\n // there are two possible scenarios for server-rendered suspense:\r\n // - success: ssr content should be fully resolved\r\n // - failure: ssr content should be the fallback branch.\r\n // however, on the client we don't really know if it has failed or not\r\n // attempt to hydrate the DOM assuming it has succeeded, but we still\r\n // need to construct a suspense boundary first\r\n const result = hydrateNode(node, (suspense.pendingBranch = vnode.ssContent), parentComponent, suspense, slotScopeIds, optimized);\r\n if (suspense.deps === 0) {\r\n suspense.resolve();\r\n }\r\n return result;\r\n /* eslint-enable no-restricted-globals */\r\n}\r\nfunction normalizeSuspenseChildren(vnode) {\r\n const { shapeFlag, children } = vnode;\r\n const isSlotChildren = shapeFlag & 32 /* SLOTS_CHILDREN */;\r\n vnode.ssContent = normalizeSuspenseSlot(isSlotChildren ? children.default : children);\r\n vnode.ssFallback = isSlotChildren\r\n ? normalizeSuspenseSlot(children.fallback)\r\n : createVNode(Comment);\r\n}\r\nfunction normalizeSuspenseSlot(s) {\r\n let block;\r\n if (isFunction(s)) {\r\n const trackBlock = isBlockTreeEnabled && s._c;\r\n if (trackBlock) {\r\n // disableTracking: false\r\n // allow block tracking for compiled slots\r\n // (see ./componentRenderContext.ts)\r\n s._d = false;\r\n openBlock();\r\n }\r\n s = s();\r\n if (trackBlock) {\r\n s._d = true;\r\n block = currentBlock;\r\n closeBlock();\r\n }\r\n }\r\n if (shared_esm_bundler_isArray(s)) {\r\n const singleChild = filterSingleRoot(s);\r\n if (false) {}\r\n s = singleChild;\r\n }\r\n s = normalizeVNode(s);\r\n if (block && !s.dynamicChildren) {\r\n s.dynamicChildren = block.filter(c => c !== s);\r\n }\r\n return s;\r\n}\r\nfunction queueEffectWithSuspense(fn, suspense) {\r\n if (suspense && suspense.pendingBranch) {\r\n if (shared_esm_bundler_isArray(fn)) {\r\n suspense.effects.push(...fn);\r\n }\r\n else {\r\n suspense.effects.push(fn);\r\n }\r\n }\r\n else {\r\n queuePostFlushCb(fn);\r\n }\r\n}\r\nfunction setActiveBranch(suspense, branch) {\r\n suspense.activeBranch = branch;\r\n const { vnode, parentComponent } = suspense;\r\n const el = (vnode.el = branch.el);\r\n // in case suspense is the root node of a component,\r\n // recursively update the HOC el\r\n if (parentComponent && parentComponent.subTree === vnode) {\r\n parentComponent.vnode.el = el;\r\n updateHOCHostEl(parentComponent, el);\r\n }\r\n}\n\nfunction provide(key, value) {\r\n if (!currentInstance) {\r\n if ((false)) {}\r\n }\r\n else {\r\n let provides = currentInstance.provides;\r\n // by default an instance inherits its parent's provides object\r\n // but when it needs to provide values of its own, it creates its\r\n // own provides object using parent provides object as prototype.\r\n // this way in `inject` we can simply look up injections from direct\r\n // parent and let the prototype chain do the work.\r\n const parentProvides = currentInstance.parent && currentInstance.parent.provides;\r\n if (parentProvides === provides) {\r\n provides = currentInstance.provides = Object.create(parentProvides);\r\n }\r\n // TS doesn't allow symbol as index type\r\n provides[key] = value;\r\n }\r\n}\r\nfunction inject(key, defaultValue, treatDefaultAsFactory = false) {\r\n // fallback to `currentRenderingInstance` so that this can be called in\r\n // a functional component\r\n const instance = currentInstance || currentRenderingInstance;\r\n if (instance) {\r\n // #2400\r\n // to support `app.use` plugins,\r\n // fallback to appContext's `provides` if the intance is at root\r\n const provides = instance.parent == null\r\n ? instance.vnode.appContext && instance.vnode.appContext.provides\r\n : instance.parent.provides;\r\n if (provides && key in provides) {\r\n // TS doesn't allow symbol as index type\r\n return provides[key];\r\n }\r\n else if (arguments.length > 1) {\r\n return treatDefaultAsFactory && isFunction(defaultValue)\r\n ? defaultValue.call(instance.proxy)\r\n : defaultValue;\r\n }\r\n else if ((false)) {}\r\n }\r\n else if ((false)) {}\r\n}\n\nfunction useTransitionState() {\r\n const state = {\r\n isMounted: false,\r\n isLeaving: false,\r\n isUnmounting: false,\r\n leavingVNodes: new Map()\r\n };\r\n onMounted(() => {\r\n state.isMounted = true;\r\n });\r\n onBeforeUnmount(() => {\r\n state.isUnmounting = true;\r\n });\r\n return state;\r\n}\r\nconst TransitionHookValidator = [Function, Array];\r\nconst BaseTransitionImpl = {\r\n name: `BaseTransition`,\r\n props: {\r\n mode: String,\r\n appear: Boolean,\r\n persisted: Boolean,\r\n // enter\r\n onBeforeEnter: TransitionHookValidator,\r\n onEnter: TransitionHookValidator,\r\n onAfterEnter: TransitionHookValidator,\r\n onEnterCancelled: TransitionHookValidator,\r\n // leave\r\n onBeforeLeave: TransitionHookValidator,\r\n onLeave: TransitionHookValidator,\r\n onAfterLeave: TransitionHookValidator,\r\n onLeaveCancelled: TransitionHookValidator,\r\n // appear\r\n onBeforeAppear: TransitionHookValidator,\r\n onAppear: TransitionHookValidator,\r\n onAfterAppear: TransitionHookValidator,\r\n onAppearCancelled: TransitionHookValidator\r\n },\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevTransitionKey;\r\n return () => {\r\n const children = slots.default && getTransitionRawChildren(slots.default(), true);\r\n if (!children || !children.length) {\r\n return;\r\n }\r\n // warn multiple elements\r\n if (false) {}\r\n // there's no need to track reactivity for these props so use the raw\r\n // props for a bit better perf\r\n const rawProps = reactivity_esm_bundler_toRaw(props);\r\n const { mode } = rawProps;\r\n // check mode\r\n if (false) {}\r\n // at this point children has a guaranteed length of 1.\r\n const child = children[0];\r\n if (state.isLeaving) {\r\n return emptyPlaceholder(child);\r\n }\r\n // in the case of <transition><keep-alive/></transition>, we need to\r\n // compare the type of the kept-alive children.\r\n const innerChild = getKeepAliveChild(child);\r\n if (!innerChild) {\r\n return emptyPlaceholder(child);\r\n }\r\n const enterHooks = resolveTransitionHooks(innerChild, rawProps, state, instance);\r\n setTransitionHooks(innerChild, enterHooks);\r\n const oldChild = instance.subTree;\r\n const oldInnerChild = oldChild && getKeepAliveChild(oldChild);\r\n let transitionKeyChanged = false;\r\n const { getTransitionKey } = innerChild.type;\r\n if (getTransitionKey) {\r\n const key = getTransitionKey();\r\n if (prevTransitionKey === undefined) {\r\n prevTransitionKey = key;\r\n }\r\n else if (key !== prevTransitionKey) {\r\n prevTransitionKey = key;\r\n transitionKeyChanged = true;\r\n }\r\n }\r\n // handle mode\r\n if (oldInnerChild &&\r\n oldInnerChild.type !== Comment &&\r\n (!isSameVNodeType(innerChild, oldInnerChild) || transitionKeyChanged)) {\r\n const leavingHooks = resolveTransitionHooks(oldInnerChild, rawProps, state, instance);\r\n // update old tree's hooks in case of dynamic transition\r\n setTransitionHooks(oldInnerChild, leavingHooks);\r\n // switching between different views\r\n if (mode === 'out-in') {\r\n state.isLeaving = true;\r\n // return placeholder node and queue update when leave finishes\r\n leavingHooks.afterLeave = () => {\r\n state.isLeaving = false;\r\n instance.update();\r\n };\r\n return emptyPlaceholder(child);\r\n }\r\n else if (mode === 'in-out' && innerChild.type !== Comment) {\r\n leavingHooks.delayLeave = (el, earlyRemove, delayedLeave) => {\r\n const leavingVNodesCache = getLeavingNodesForType(state, oldInnerChild);\r\n leavingVNodesCache[String(oldInnerChild.key)] = oldInnerChild;\r\n // early removal callback\r\n el._leaveCb = () => {\r\n earlyRemove();\r\n el._leaveCb = undefined;\r\n delete enterHooks.delayedLeave;\r\n };\r\n enterHooks.delayedLeave = delayedLeave;\r\n };\r\n }\r\n }\r\n return child;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst BaseTransition = BaseTransitionImpl;\r\nfunction getLeavingNodesForType(state, vnode) {\r\n const { leavingVNodes } = state;\r\n let leavingVNodesCache = leavingVNodes.get(vnode.type);\r\n if (!leavingVNodesCache) {\r\n leavingVNodesCache = Object.create(null);\r\n leavingVNodes.set(vnode.type, leavingVNodesCache);\r\n }\r\n return leavingVNodesCache;\r\n}\r\n// The transition hooks are attached to the vnode as vnode.transition\r\n// and will be called at appropriate timing in the renderer.\r\nfunction resolveTransitionHooks(vnode, props, state, instance) {\r\n const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;\r\n const key = String(vnode.key);\r\n const leavingVNodesCache = getLeavingNodesForType(state, vnode);\r\n const callHook = (hook, args) => {\r\n hook &&\r\n callWithAsyncErrorHandling(hook, instance, 9 /* TRANSITION_HOOK */, args);\r\n };\r\n const hooks = {\r\n mode,\r\n persisted,\r\n beforeEnter(el) {\r\n let hook = onBeforeEnter;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onBeforeAppear || onBeforeEnter;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n // for same element (v-show)\r\n if (el._leaveCb) {\r\n el._leaveCb(true /* cancelled */);\r\n }\r\n // for toggled element with same key (v-if)\r\n const leavingVNode = leavingVNodesCache[key];\r\n if (leavingVNode &&\r\n isSameVNodeType(vnode, leavingVNode) &&\r\n leavingVNode.el._leaveCb) {\r\n // force early removal (not cancelled)\r\n leavingVNode.el._leaveCb();\r\n }\r\n callHook(hook, [el]);\r\n },\r\n enter(el) {\r\n let hook = onEnter;\r\n let afterHook = onAfterEnter;\r\n let cancelHook = onEnterCancelled;\r\n if (!state.isMounted) {\r\n if (appear) {\r\n hook = onAppear || onEnter;\r\n afterHook = onAfterAppear || onAfterEnter;\r\n cancelHook = onAppearCancelled || onEnterCancelled;\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n let called = false;\r\n const done = (el._enterCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n if (cancelled) {\r\n callHook(cancelHook, [el]);\r\n }\r\n else {\r\n callHook(afterHook, [el]);\r\n }\r\n if (hooks.delayedLeave) {\r\n hooks.delayedLeave();\r\n }\r\n el._enterCb = undefined;\r\n });\r\n if (hook) {\r\n hook(el, done);\r\n if (hook.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n leave(el, remove) {\r\n const key = String(vnode.key);\r\n if (el._enterCb) {\r\n el._enterCb(true /* cancelled */);\r\n }\r\n if (state.isUnmounting) {\r\n return remove();\r\n }\r\n callHook(onBeforeLeave, [el]);\r\n let called = false;\r\n const done = (el._leaveCb = (cancelled) => {\r\n if (called)\r\n return;\r\n called = true;\r\n remove();\r\n if (cancelled) {\r\n callHook(onLeaveCancelled, [el]);\r\n }\r\n else {\r\n callHook(onAfterLeave, [el]);\r\n }\r\n el._leaveCb = undefined;\r\n if (leavingVNodesCache[key] === vnode) {\r\n delete leavingVNodesCache[key];\r\n }\r\n });\r\n leavingVNodesCache[key] = vnode;\r\n if (onLeave) {\r\n onLeave(el, done);\r\n if (onLeave.length <= 1) {\r\n done();\r\n }\r\n }\r\n else {\r\n done();\r\n }\r\n },\r\n clone(vnode) {\r\n return resolveTransitionHooks(vnode, props, state, instance);\r\n }\r\n };\r\n return hooks;\r\n}\r\n// the placeholder really only handles one special case: KeepAlive\r\n// in the case of a KeepAlive in a leave phase we need to return a KeepAlive\r\n// placeholder with empty content to avoid the KeepAlive instance from being\r\n// unmounted.\r\nfunction emptyPlaceholder(vnode) {\r\n if (isKeepAlive(vnode)) {\r\n vnode = cloneVNode(vnode);\r\n vnode.children = null;\r\n return vnode;\r\n }\r\n}\r\nfunction getKeepAliveChild(vnode) {\r\n return isKeepAlive(vnode)\r\n ? vnode.children\r\n ? vnode.children[0]\r\n : undefined\r\n : vnode;\r\n}\r\nfunction setTransitionHooks(vnode, hooks) {\r\n if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {\r\n setTransitionHooks(vnode.component.subTree, hooks);\r\n }\r\n else if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.ssContent.transition = hooks.clone(vnode.ssContent);\r\n vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);\r\n }\r\n else {\r\n vnode.transition = hooks;\r\n }\r\n}\r\nfunction getTransitionRawChildren(children, keepComment = false) {\r\n let ret = [];\r\n let keyedFragmentCount = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n // handle fragment children case, e.g. v-for\r\n if (child.type === Fragment) {\r\n if (child.patchFlag & 128 /* KEYED_FRAGMENT */)\r\n keyedFragmentCount++;\r\n ret = ret.concat(getTransitionRawChildren(child.children, keepComment));\r\n }\r\n // comment placeholders should be skipped, e.g. v-if\r\n else if (keepComment || child.type !== Comment) {\r\n ret.push(child);\r\n }\r\n }\r\n // #1126 if a transition children list contains multiple sub fragments, these\r\n // fragments will be merged into a flat children array. Since each v-for\r\n // fragment may contain different static bindings inside, we need to de-op\r\n // these children to force full diffs to ensure correct behavior.\r\n if (keyedFragmentCount > 1) {\r\n for (let i = 0; i < ret.length; i++) {\r\n ret[i].patchFlag = -2 /* BAIL */;\r\n }\r\n }\r\n return ret;\r\n}\n\n// implementation, close to no-op\r\nfunction defineComponent(options) {\r\n return isFunction(options) ? { setup: options, name: options.name } : options;\r\n}\n\nconst isAsyncWrapper = (i) => !!i.type.__asyncLoader;\r\nfunction defineAsyncComponent(source) {\r\n if (isFunction(source)) {\r\n source = { loader: source };\r\n }\r\n const { loader, loadingComponent, errorComponent, delay = 200, timeout, // undefined = never times out\r\n suspensible = true, onError: userOnError } = source;\r\n let pendingRequest = null;\r\n let resolvedComp;\r\n let retries = 0;\r\n const retry = () => {\r\n retries++;\r\n pendingRequest = null;\r\n return load();\r\n };\r\n const load = () => {\r\n let thisRequest;\r\n return (pendingRequest ||\r\n (thisRequest = pendingRequest =\r\n loader()\r\n .catch(err => {\r\n err = err instanceof Error ? err : new Error(String(err));\r\n if (userOnError) {\r\n return new Promise((resolve, reject) => {\r\n const userRetry = () => resolve(retry());\r\n const userFail = () => reject(err);\r\n userOnError(err, userRetry, userFail, retries + 1);\r\n });\r\n }\r\n else {\r\n throw err;\r\n }\r\n })\r\n .then((comp) => {\r\n if (thisRequest !== pendingRequest && pendingRequest) {\r\n return pendingRequest;\r\n }\r\n if (false) {}\r\n // interop module default\r\n if (comp &&\r\n (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {\r\n comp = comp.default;\r\n }\r\n if (false) {}\r\n resolvedComp = comp;\r\n return comp;\r\n })));\r\n };\r\n return defineComponent({\r\n name: 'AsyncComponentWrapper',\r\n __asyncLoader: load,\r\n get __asyncResolved() {\r\n return resolvedComp;\r\n },\r\n setup() {\r\n const instance = currentInstance;\r\n // already resolved\r\n if (resolvedComp) {\r\n return () => createInnerComp(resolvedComp, instance);\r\n }\r\n const onError = (err) => {\r\n pendingRequest = null;\r\n handleError(err, instance, 13 /* ASYNC_COMPONENT_LOADER */, !errorComponent /* do not throw in dev if user provided error component */);\r\n };\r\n // suspense-controlled or SSR.\r\n if ((suspensible && instance.suspense) ||\r\n (isInSSRComponentSetup)) {\r\n return load()\r\n .then(comp => {\r\n return () => createInnerComp(comp, instance);\r\n })\r\n .catch(err => {\r\n onError(err);\r\n return () => errorComponent\r\n ? createVNode(errorComponent, {\r\n error: err\r\n })\r\n : null;\r\n });\r\n }\r\n const loaded = ref(false);\r\n const error = ref();\r\n const delayed = ref(!!delay);\r\n if (delay) {\r\n setTimeout(() => {\r\n delayed.value = false;\r\n }, delay);\r\n }\r\n if (timeout != null) {\r\n setTimeout(() => {\r\n if (!loaded.value && !error.value) {\r\n const err = new Error(`Async component timed out after ${timeout}ms.`);\r\n onError(err);\r\n error.value = err;\r\n }\r\n }, timeout);\r\n }\r\n load()\r\n .then(() => {\r\n loaded.value = true;\r\n if (instance.parent && isKeepAlive(instance.parent.vnode)) {\r\n // parent is keep-alive, force update so the loaded component's\r\n // name is taken into account\r\n queueJob(instance.parent.update);\r\n }\r\n })\r\n .catch(err => {\r\n onError(err);\r\n error.value = err;\r\n });\r\n return () => {\r\n if (loaded.value && resolvedComp) {\r\n return createInnerComp(resolvedComp, instance);\r\n }\r\n else if (error.value && errorComponent) {\r\n return createVNode(errorComponent, {\r\n error: error.value\r\n });\r\n }\r\n else if (loadingComponent && !delayed.value) {\r\n return createVNode(loadingComponent);\r\n }\r\n };\r\n }\r\n });\r\n}\r\nfunction createInnerComp(comp, { vnode: { ref, props, children } }) {\r\n const vnode = createVNode(comp, props, children);\r\n // ensure inner component inherits the async wrapper's ref owner\r\n vnode.ref = ref;\r\n return vnode;\r\n}\n\nconst isKeepAlive = (vnode) => vnode.type.__isKeepAlive;\r\nconst KeepAliveImpl = {\r\n name: `KeepAlive`,\r\n // Marker for special handling inside the renderer. We are not using a ===\r\n // check directly on KeepAlive in the renderer, because importing it directly\r\n // would prevent it from being tree-shaken.\r\n __isKeepAlive: true,\r\n props: {\r\n include: [String, RegExp, Array],\r\n exclude: [String, RegExp, Array],\r\n max: [String, Number]\r\n },\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n // KeepAlive communicates with the instantiated renderer via the\r\n // ctx where the renderer passes in its internals,\r\n // and the KeepAlive instance exposes activate/deactivate implementations.\r\n // The whole point of this is to avoid importing KeepAlive directly in the\r\n // renderer to facilitate tree-shaking.\r\n const sharedContext = instance.ctx;\r\n // if the internal renderer is not registered, it indicates that this is server-side rendering,\r\n // for KeepAlive, we just need to render its children\r\n if (!sharedContext.renderer) {\r\n return slots.default;\r\n }\r\n const cache = new Map();\r\n const keys = new Set();\r\n let current = null;\r\n if (false) {}\r\n const parentSuspense = instance.suspense;\r\n const { renderer: { p: patch, m: move, um: _unmount, o: { createElement } } } = sharedContext;\r\n const storageContainer = createElement('div');\r\n sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {\r\n const instance = vnode.component;\r\n move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);\r\n // in case props have changed\r\n patch(instance.vnode, vnode, container, anchor, instance, parentSuspense, isSVG, vnode.slotScopeIds, optimized);\r\n queuePostRenderEffect(() => {\r\n instance.isDeactivated = false;\r\n if (instance.a) {\r\n invokeArrayFns(instance.a);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeMounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n }, parentSuspense);\r\n if (false) {}\r\n };\r\n sharedContext.deactivate = (vnode) => {\r\n const instance = vnode.component;\r\n move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);\r\n queuePostRenderEffect(() => {\r\n if (instance.da) {\r\n invokeArrayFns(instance.da);\r\n }\r\n const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;\r\n if (vnodeHook) {\r\n invokeVNodeHook(vnodeHook, instance.parent, vnode);\r\n }\r\n instance.isDeactivated = true;\r\n }, parentSuspense);\r\n if (false) {}\r\n };\r\n function unmount(vnode) {\r\n // reset the shapeFlag so it can be properly unmounted\r\n resetShapeFlag(vnode);\r\n _unmount(vnode, instance, parentSuspense);\r\n }\r\n function pruneCache(filter) {\r\n cache.forEach((vnode, key) => {\r\n const name = getComponentName(vnode.type);\r\n if (name && (!filter || !filter(name))) {\r\n pruneCacheEntry(key);\r\n }\r\n });\r\n }\r\n function pruneCacheEntry(key) {\r\n const cached = cache.get(key);\r\n if (!current || cached.type !== current.type) {\r\n unmount(cached);\r\n }\r\n else if (current) {\r\n // current active instance should no longer be kept-alive.\r\n // we can't unmount it now but it might be later, so reset its flag now.\r\n resetShapeFlag(current);\r\n }\r\n cache.delete(key);\r\n keys.delete(key);\r\n }\r\n // prune cache on include/exclude prop change\r\n watch(() => [props.include, props.exclude], ([include, exclude]) => {\r\n include && pruneCache(name => matches(include, name));\r\n exclude && pruneCache(name => !matches(exclude, name));\r\n }, \r\n // prune post-render after `current` has been updated\r\n { flush: 'post', deep: true });\r\n // cache sub tree after render\r\n let pendingCacheKey = null;\r\n const cacheSubtree = () => {\r\n // fix #1621, the pendingCacheKey could be 0\r\n if (pendingCacheKey != null) {\r\n cache.set(pendingCacheKey, getInnerChild(instance.subTree));\r\n }\r\n };\r\n onMounted(cacheSubtree);\r\n onUpdated(cacheSubtree);\r\n onBeforeUnmount(() => {\r\n cache.forEach(cached => {\r\n const { subTree, suspense } = instance;\r\n const vnode = getInnerChild(subTree);\r\n if (cached.type === vnode.type) {\r\n // current instance will be unmounted as part of keep-alive's unmount\r\n resetShapeFlag(vnode);\r\n // but invoke its deactivated hook here\r\n const da = vnode.component.da;\r\n da && queuePostRenderEffect(da, suspense);\r\n return;\r\n }\r\n unmount(cached);\r\n });\r\n });\r\n return () => {\r\n pendingCacheKey = null;\r\n if (!slots.default) {\r\n return null;\r\n }\r\n const children = slots.default();\r\n const rawVNode = children[0];\r\n if (children.length > 1) {\r\n if ((false)) {}\r\n current = null;\r\n return children;\r\n }\r\n else if (!isVNode(rawVNode) ||\r\n (!(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) &&\r\n !(rawVNode.shapeFlag & 128 /* SUSPENSE */))) {\r\n current = null;\r\n return rawVNode;\r\n }\r\n let vnode = getInnerChild(rawVNode);\r\n const comp = vnode.type;\r\n // for async components, name check should be based in its loaded\r\n // inner component if available\r\n const name = getComponentName(isAsyncWrapper(vnode)\r\n ? vnode.type.__asyncResolved || {}\r\n : comp);\r\n const { include, exclude, max } = props;\r\n if ((include && (!name || !matches(include, name))) ||\r\n (exclude && name && matches(exclude, name))) {\r\n current = vnode;\r\n return rawVNode;\r\n }\r\n const key = vnode.key == null ? comp : vnode.key;\r\n const cachedVNode = cache.get(key);\r\n // clone vnode if it's reused because we are going to mutate it\r\n if (vnode.el) {\r\n vnode = cloneVNode(vnode);\r\n if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {\r\n rawVNode.ssContent = vnode;\r\n }\r\n }\r\n // #1513 it's possible for the returned vnode to be cloned due to attr\r\n // fallthrough or scopeId, so the vnode here may not be the final vnode\r\n // that is mounted. Instead of caching it directly, we store the pending\r\n // key and cache `instance.subTree` (the normalized vnode) in\r\n // beforeMount/beforeUpdate hooks.\r\n pendingCacheKey = key;\r\n if (cachedVNode) {\r\n // copy over mounted state\r\n vnode.el = cachedVNode.el;\r\n vnode.component = cachedVNode.component;\r\n if (vnode.transition) {\r\n // recursively update transition hooks on subTree\r\n setTransitionHooks(vnode, vnode.transition);\r\n }\r\n // avoid vnode being mounted as fresh\r\n vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;\r\n // make this key the freshest\r\n keys.delete(key);\r\n keys.add(key);\r\n }\r\n else {\r\n keys.add(key);\r\n // prune oldest entry\r\n if (max && keys.size > parseInt(max, 10)) {\r\n pruneCacheEntry(keys.values().next().value);\r\n }\r\n }\r\n // avoid vnode being unmounted\r\n vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n current = vnode;\r\n return rawVNode;\r\n };\r\n }\r\n};\r\n// export the public type for h/tsx inference\r\n// also to avoid inline import() in generated d.ts files\r\nconst KeepAlive = KeepAliveImpl;\r\nfunction matches(pattern, name) {\r\n if (shared_esm_bundler_isArray(pattern)) {\r\n return pattern.some((p) => matches(p, name));\r\n }\r\n else if (shared_esm_bundler_isString(pattern)) {\r\n return pattern.split(',').indexOf(name) > -1;\r\n }\r\n else if (pattern.test) {\r\n return pattern.test(name);\r\n }\r\n /* istanbul ignore next */\r\n return false;\r\n}\r\nfunction onActivated(hook, target) {\r\n registerKeepAliveHook(hook, \"a\" /* ACTIVATED */, target);\r\n}\r\nfunction onDeactivated(hook, target) {\r\n registerKeepAliveHook(hook, \"da\" /* DEACTIVATED */, target);\r\n}\r\nfunction registerKeepAliveHook(hook, type, target = currentInstance) {\r\n // cache the deactivate branch check wrapper for injected hooks so the same\r\n // hook can be properly deduped by the scheduler. \"__wdc\" stands for \"with\r\n // deactivation check\".\r\n const wrappedHook = hook.__wdc ||\r\n (hook.__wdc = () => {\r\n // only fire the hook if the target instance is NOT in a deactivated branch.\r\n let current = target;\r\n while (current) {\r\n if (current.isDeactivated) {\r\n return;\r\n }\r\n current = current.parent;\r\n }\r\n hook();\r\n });\r\n injectHook(type, wrappedHook, target);\r\n // In addition to registering it on the target instance, we walk up the parent\r\n // chain and register it on all ancestor instances that are keep-alive roots.\r\n // This avoids the need to walk the entire component tree when invoking these\r\n // hooks, and more importantly, avoids the need to track child components in\r\n // arrays.\r\n if (target) {\r\n let current = target.parent;\r\n while (current && current.parent) {\r\n if (isKeepAlive(current.parent.vnode)) {\r\n injectToKeepAliveRoot(wrappedHook, type, target, current);\r\n }\r\n current = current.parent;\r\n }\r\n }\r\n}\r\nfunction injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {\r\n // injectHook wraps the original for error handling, so make sure to remove\r\n // the wrapped version.\r\n const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */);\r\n onUnmounted(() => {\r\n remove(keepAliveRoot[type], injected);\r\n }, target);\r\n}\r\nfunction resetShapeFlag(vnode) {\r\n let shapeFlag = vnode.shapeFlag;\r\n if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n shapeFlag -= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;\r\n }\r\n if (shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\r\n shapeFlag -= 512 /* COMPONENT_KEPT_ALIVE */;\r\n }\r\n vnode.shapeFlag = shapeFlag;\r\n}\r\nfunction getInnerChild(vnode) {\r\n return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;\r\n}\n\nfunction injectHook(type, hook, target = currentInstance, prepend = false) {\r\n if (target) {\r\n const hooks = target[type] || (target[type] = []);\r\n // cache the error handling wrapper for injected hooks so the same hook\r\n // can be properly deduped by the scheduler. \"__weh\" stands for \"with error\r\n // handling\".\r\n const wrappedHook = hook.__weh ||\r\n (hook.__weh = (...args) => {\r\n if (target.isUnmounted) {\r\n return;\r\n }\r\n // disable tracking inside all lifecycle hooks\r\n // since they can potentially be called inside effects.\r\n pauseTracking();\r\n // Set currentInstance during hook invocation.\r\n // This assumes the hook does not synchronously trigger other hooks, which\r\n // can only be false when the user does something really funky.\r\n setCurrentInstance(target);\r\n const res = callWithAsyncErrorHandling(hook, target, type, args);\r\n unsetCurrentInstance();\r\n resetTracking();\r\n return res;\r\n });\r\n if (prepend) {\r\n hooks.unshift(wrappedHook);\r\n }\r\n else {\r\n hooks.push(wrappedHook);\r\n }\r\n return wrappedHook;\r\n }\r\n else if ((false)) {}\r\n}\r\nconst createHook = (lifecycle) => (hook, target = currentInstance) => \r\n// post-create lifecycle registrations are noops during SSR (except for serverPrefetch)\r\n(!isInSSRComponentSetup || lifecycle === \"sp\" /* SERVER_PREFETCH */) &&\r\n injectHook(lifecycle, hook, target);\r\nconst onBeforeMount = createHook(\"bm\" /* BEFORE_MOUNT */);\r\nconst onMounted = createHook(\"m\" /* MOUNTED */);\r\nconst onBeforeUpdate = createHook(\"bu\" /* BEFORE_UPDATE */);\r\nconst onUpdated = createHook(\"u\" /* UPDATED */);\r\nconst onBeforeUnmount = createHook(\"bum\" /* BEFORE_UNMOUNT */);\r\nconst onUnmounted = createHook(\"um\" /* UNMOUNTED */);\r\nconst onServerPrefetch = createHook(\"sp\" /* SERVER_PREFETCH */);\r\nconst onRenderTriggered = createHook(\"rtg\" /* RENDER_TRIGGERED */);\r\nconst onRenderTracked = createHook(\"rtc\" /* RENDER_TRACKED */);\r\nfunction onErrorCaptured(hook, target = currentInstance) {\r\n injectHook(\"ec\" /* ERROR_CAPTURED */, hook, target);\r\n}\n\nfunction createDuplicateChecker() {\r\n const cache = Object.create(null);\r\n return (type, key) => {\r\n if (cache[key]) {\r\n runtime_core_esm_bundler_warn(`${type} property \"${key}\" is already defined in ${cache[key]}.`);\r\n }\r\n else {\r\n cache[key] = type;\r\n }\r\n };\r\n}\r\nlet shouldCacheAccess = true;\r\nfunction applyOptions(instance) {\r\n const options = resolveMergedOptions(instance);\r\n const publicThis = instance.proxy;\r\n const ctx = instance.ctx;\r\n // do not cache property access on public proxy during state initialization\r\n shouldCacheAccess = false;\r\n // call beforeCreate first before accessing other options since\r\n // the hook may mutate resolved options (#2791)\r\n if (options.beforeCreate) {\r\n callHook(options.beforeCreate, instance, \"bc\" /* BEFORE_CREATE */);\r\n }\r\n const { \r\n // state\r\n data: dataOptions, computed: computedOptions, methods, watch: watchOptions, provide: provideOptions, inject: injectOptions, \r\n // lifecycle\r\n created, beforeMount, mounted, beforeUpdate, updated, activated, deactivated, beforeDestroy, beforeUnmount, destroyed, unmounted, render, renderTracked, renderTriggered, errorCaptured, serverPrefetch, \r\n // public API\r\n expose, inheritAttrs, \r\n // assets\r\n components, directives, filters } = options;\r\n const checkDuplicateProperties = ( false) ? 0 : null;\r\n if ((false)) {}\r\n // options initialization order (to be consistent with Vue 2):\r\n // - props (already done outside of this function)\r\n // - inject\r\n // - methods\r\n // - data (deferred since it relies on `this` access)\r\n // - computed\r\n // - watch (deferred since it relies on `this` access)\r\n if (injectOptions) {\r\n resolveInjections(injectOptions, ctx, checkDuplicateProperties, instance.appContext.config.unwrapInjectedRef);\r\n }\r\n if (methods) {\r\n for (const key in methods) {\r\n const methodHandler = methods[key];\r\n if (isFunction(methodHandler)) {\r\n // In dev mode, we use the `createRenderContext` function to define\r\n // methods to the proxy target, and those are read-only but\r\n // reconfigurable, so it needs to be redefined here\r\n if ((false)) {}\r\n else {\r\n ctx[key] = methodHandler.bind(publicThis);\r\n }\r\n if ((false)) {}\r\n }\r\n else if ((false)) {}\r\n }\r\n }\r\n if (dataOptions) {\r\n if (false) {}\r\n const data = dataOptions.call(publicThis, publicThis);\r\n if (false) {}\r\n if (!shared_esm_bundler_isObject(data)) {\r\n ( false) && 0;\r\n }\r\n else {\r\n instance.data = reactive(data);\r\n if ((false)) {}\r\n }\r\n }\r\n // state initialization complete at this point - start caching access\r\n shouldCacheAccess = true;\r\n if (computedOptions) {\r\n for (const key in computedOptions) {\r\n const opt = computedOptions[key];\r\n const get = isFunction(opt)\r\n ? opt.bind(publicThis, publicThis)\r\n : isFunction(opt.get)\r\n ? opt.get.bind(publicThis, publicThis)\r\n : shared_esm_bundler_NOOP;\r\n if (false) {}\r\n const set = !isFunction(opt) && isFunction(opt.set)\r\n ? opt.set.bind(publicThis)\r\n : ( false)\r\n ? 0\r\n : shared_esm_bundler_NOOP;\r\n const c = computed({\r\n get,\r\n set\r\n });\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => c.value,\r\n set: v => (c.value = v)\r\n });\r\n if ((false)) {}\r\n }\r\n }\r\n if (watchOptions) {\r\n for (const key in watchOptions) {\r\n createWatcher(watchOptions[key], ctx, publicThis, key);\r\n }\r\n }\r\n if (provideOptions) {\r\n const provides = isFunction(provideOptions)\r\n ? provideOptions.call(publicThis)\r\n : provideOptions;\r\n Reflect.ownKeys(provides).forEach(key => {\r\n provide(key, provides[key]);\r\n });\r\n }\r\n if (created) {\r\n callHook(created, instance, \"c\" /* CREATED */);\r\n }\r\n function registerLifecycleHook(register, hook) {\r\n if (shared_esm_bundler_isArray(hook)) {\r\n hook.forEach(_hook => register(_hook.bind(publicThis)));\r\n }\r\n else if (hook) {\r\n register(hook.bind(publicThis));\r\n }\r\n }\r\n registerLifecycleHook(onBeforeMount, beforeMount);\r\n registerLifecycleHook(onMounted, mounted);\r\n registerLifecycleHook(onBeforeUpdate, beforeUpdate);\r\n registerLifecycleHook(onUpdated, updated);\r\n registerLifecycleHook(onActivated, activated);\r\n registerLifecycleHook(onDeactivated, deactivated);\r\n registerLifecycleHook(onErrorCaptured, errorCaptured);\r\n registerLifecycleHook(onRenderTracked, renderTracked);\r\n registerLifecycleHook(onRenderTriggered, renderTriggered);\r\n registerLifecycleHook(onBeforeUnmount, beforeUnmount);\r\n registerLifecycleHook(onUnmounted, unmounted);\r\n registerLifecycleHook(onServerPrefetch, serverPrefetch);\r\n if (shared_esm_bundler_isArray(expose)) {\r\n if (expose.length) {\r\n const exposed = instance.exposed || (instance.exposed = {});\r\n expose.forEach(key => {\r\n Object.defineProperty(exposed, key, {\r\n get: () => publicThis[key],\r\n set: val => (publicThis[key] = val)\r\n });\r\n });\r\n }\r\n else if (!instance.exposed) {\r\n instance.exposed = {};\r\n }\r\n }\r\n // options that are handled when creating the instance but also need to be\r\n // applied from mixins\r\n if (render && instance.render === shared_esm_bundler_NOOP) {\r\n instance.render = render;\r\n }\r\n if (inheritAttrs != null) {\r\n instance.inheritAttrs = inheritAttrs;\r\n }\r\n // asset options.\r\n if (components)\r\n instance.components = components;\r\n if (directives)\r\n instance.directives = directives;\r\n}\r\nfunction resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared_esm_bundler_NOOP, unwrapRef = false) {\r\n if (shared_esm_bundler_isArray(injectOptions)) {\r\n injectOptions = normalizeInject(injectOptions);\r\n }\r\n for (const key in injectOptions) {\r\n const opt = injectOptions[key];\r\n let injected;\r\n if (shared_esm_bundler_isObject(opt)) {\r\n if ('default' in opt) {\r\n injected = inject(opt.from || key, opt.default, true /* treat default function as factory */);\r\n }\r\n else {\r\n injected = inject(opt.from || key);\r\n }\r\n }\r\n else {\r\n injected = inject(opt);\r\n }\r\n if (isRef(injected)) {\r\n // TODO remove the check in 3.3\r\n if (unwrapRef) {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => injected.value,\r\n set: v => (injected.value = v)\r\n });\r\n }\r\n else {\r\n if ((false)) {}\r\n ctx[key] = injected;\r\n }\r\n }\r\n else {\r\n ctx[key] = injected;\r\n }\r\n if ((false)) {}\r\n }\r\n}\r\nfunction callHook(hook, instance, type) {\r\n callWithAsyncErrorHandling(shared_esm_bundler_isArray(hook)\r\n ? hook.map(h => h.bind(instance.proxy))\r\n : hook.bind(instance.proxy), instance, type);\r\n}\r\nfunction createWatcher(raw, ctx, publicThis, key) {\r\n const getter = key.includes('.')\r\n ? createPathGetter(publicThis, key)\r\n : () => publicThis[key];\r\n if (shared_esm_bundler_isString(raw)) {\r\n const handler = ctx[raw];\r\n if (isFunction(handler)) {\r\n watch(getter, handler);\r\n }\r\n else if ((false)) {}\r\n }\r\n else if (isFunction(raw)) {\r\n watch(getter, raw.bind(publicThis));\r\n }\r\n else if (shared_esm_bundler_isObject(raw)) {\r\n if (shared_esm_bundler_isArray(raw)) {\r\n raw.forEach(r => createWatcher(r, ctx, publicThis, key));\r\n }\r\n else {\r\n const handler = isFunction(raw.handler)\r\n ? raw.handler.bind(publicThis)\r\n : ctx[raw.handler];\r\n if (isFunction(handler)) {\r\n watch(getter, handler, raw);\r\n }\r\n else if ((false)) {}\r\n }\r\n }\r\n else if ((false)) {}\r\n}\r\n/**\r\n * Resolve merged options and cache it on the component.\r\n * This is done only once per-component since the merging does not involve\r\n * instances.\r\n */\r\nfunction resolveMergedOptions(instance) {\r\n const base = instance.type;\r\n const { mixins, extends: extendsOptions } = base;\r\n const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;\r\n const cached = cache.get(base);\r\n let resolved;\r\n if (cached) {\r\n resolved = cached;\r\n }\r\n else if (!globalMixins.length && !mixins && !extendsOptions) {\r\n {\r\n resolved = base;\r\n }\r\n }\r\n else {\r\n resolved = {};\r\n if (globalMixins.length) {\r\n globalMixins.forEach(m => mergeOptions(resolved, m, optionMergeStrategies, true));\r\n }\r\n mergeOptions(resolved, base, optionMergeStrategies);\r\n }\r\n cache.set(base, resolved);\r\n return resolved;\r\n}\r\nfunction mergeOptions(to, from, strats, asMixin = false) {\r\n const { mixins, extends: extendsOptions } = from;\r\n if (extendsOptions) {\r\n mergeOptions(to, extendsOptions, strats, true);\r\n }\r\n if (mixins) {\r\n mixins.forEach((m) => mergeOptions(to, m, strats, true));\r\n }\r\n for (const key in from) {\r\n if (asMixin && key === 'expose') {\r\n ( false) &&\r\n 0;\r\n }\r\n else {\r\n const strat = internalOptionMergeStrats[key] || (strats && strats[key]);\r\n to[key] = strat ? strat(to[key], from[key]) : from[key];\r\n }\r\n }\r\n return to;\r\n}\r\nconst internalOptionMergeStrats = {\r\n data: mergeDataFn,\r\n props: mergeObjectOptions,\r\n emits: mergeObjectOptions,\r\n // objects\r\n methods: mergeObjectOptions,\r\n computed: mergeObjectOptions,\r\n // lifecycle\r\n beforeCreate: mergeAsArray,\r\n created: mergeAsArray,\r\n beforeMount: mergeAsArray,\r\n mounted: mergeAsArray,\r\n beforeUpdate: mergeAsArray,\r\n updated: mergeAsArray,\r\n beforeDestroy: mergeAsArray,\r\n beforeUnmount: mergeAsArray,\r\n destroyed: mergeAsArray,\r\n unmounted: mergeAsArray,\r\n activated: mergeAsArray,\r\n deactivated: mergeAsArray,\r\n errorCaptured: mergeAsArray,\r\n serverPrefetch: mergeAsArray,\r\n // assets\r\n components: mergeObjectOptions,\r\n directives: mergeObjectOptions,\r\n // watch\r\n watch: mergeWatchOptions,\r\n // provide / inject\r\n provide: mergeDataFn,\r\n inject: mergeInject\r\n};\r\nfunction mergeDataFn(to, from) {\r\n if (!from) {\r\n return to;\r\n }\r\n if (!to) {\r\n return from;\r\n }\r\n return function mergedDataFn() {\r\n return (shared_esm_bundler_extend)(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);\r\n };\r\n}\r\nfunction mergeInject(to, from) {\r\n return mergeObjectOptions(normalizeInject(to), normalizeInject(from));\r\n}\r\nfunction normalizeInject(raw) {\r\n if (shared_esm_bundler_isArray(raw)) {\r\n const res = {};\r\n for (let i = 0; i < raw.length; i++) {\r\n res[raw[i]] = raw[i];\r\n }\r\n return res;\r\n }\r\n return raw;\r\n}\r\nfunction mergeAsArray(to, from) {\r\n return to ? [...new Set([].concat(to, from))] : from;\r\n}\r\nfunction mergeObjectOptions(to, from) {\r\n return to ? shared_esm_bundler_extend(shared_esm_bundler_extend(Object.create(null), to), from) : from;\r\n}\r\nfunction mergeWatchOptions(to, from) {\r\n if (!to)\r\n return from;\r\n if (!from)\r\n return to;\r\n const merged = shared_esm_bundler_extend(Object.create(null), to);\r\n for (const key in from) {\r\n merged[key] = mergeAsArray(to[key], from[key]);\r\n }\r\n return merged;\r\n}\n\nfunction initProps(instance, rawProps, isStateful, // result of bitwise flag comparison\r\nisSSR = false) {\r\n const props = {};\r\n const attrs = {};\r\n def(attrs, InternalObjectKey, 1);\r\n instance.propsDefaults = Object.create(null);\r\n setFullProps(instance, rawProps, props, attrs);\r\n // ensure all declared prop keys are present\r\n for (const key in instance.propsOptions[0]) {\r\n if (!(key in props)) {\r\n props[key] = undefined;\r\n }\r\n }\r\n // validation\r\n if ((false)) {}\r\n if (isStateful) {\r\n // stateful\r\n instance.props = isSSR ? props : shallowReactive(props);\r\n }\r\n else {\r\n if (!instance.type.props) {\r\n // functional w/ optional props, props === attrs\r\n instance.props = attrs;\r\n }\r\n else {\r\n // functional w/ declared props\r\n instance.props = props;\r\n }\r\n }\r\n instance.attrs = attrs;\r\n}\r\nfunction updateProps(instance, rawProps, rawPrevProps, optimized) {\r\n const { props, attrs, vnode: { patchFlag } } = instance;\r\n const rawCurrentProps = reactivity_esm_bundler_toRaw(props);\r\n const [options] = instance.propsOptions;\r\n let hasAttrsChanged = false;\r\n if (\r\n // always force full diff in dev\r\n // - #1942 if hmr is enabled with sfc component\r\n // - vite#872 non-sfc component used by sfc component\r\n true &&\r\n (optimized || patchFlag > 0) &&\r\n !(patchFlag & 16 /* FULL_PROPS */)) {\r\n if (patchFlag & 8 /* PROPS */) {\r\n // Compiler-generated props & no keys change, just set the updated\r\n // the props.\r\n const propsToUpdate = instance.vnode.dynamicProps;\r\n for (let i = 0; i < propsToUpdate.length; i++) {\r\n let key = propsToUpdate[i];\r\n // PROPS flag guarantees rawProps to be non-null\r\n const value = rawProps[key];\r\n if (options) {\r\n // attr / props separation was done on init and will be consistent\r\n // in this code path, so just check if attrs have it.\r\n if (shared_esm_bundler_hasOwn(attrs, key)) {\r\n if (value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n else {\r\n const camelizedKey = camelize(key);\r\n props[camelizedKey] = resolvePropValue(options, rawCurrentProps, camelizedKey, value, instance, false /* isAbsent */);\r\n }\r\n }\r\n else {\r\n if (value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n // full props update.\r\n if (setFullProps(instance, rawProps, props, attrs)) {\r\n hasAttrsChanged = true;\r\n }\r\n // in case of dynamic props, check if we need to delete keys from\r\n // the props object\r\n let kebabKey;\r\n for (const key in rawCurrentProps) {\r\n if (!rawProps ||\r\n // for camelCase\r\n (!shared_esm_bundler_hasOwn(rawProps, key) &&\r\n // it's possible the original props was passed in as kebab-case\r\n // and converted to camelCase (#955)\r\n ((kebabKey = shared_esm_bundler_hyphenate(key)) === key || !shared_esm_bundler_hasOwn(rawProps, kebabKey)))) {\r\n if (options) {\r\n if (rawPrevProps &&\r\n // for camelCase\r\n (rawPrevProps[key] !== undefined ||\r\n // for kebab-case\r\n rawPrevProps[kebabKey] !== undefined)) {\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, undefined, instance, true /* isAbsent */);\r\n }\r\n }\r\n else {\r\n delete props[key];\r\n }\r\n }\r\n }\r\n // in the case of functional component w/o props declaration, props and\r\n // attrs point to the same object so it should already have been updated.\r\n if (attrs !== rawCurrentProps) {\r\n for (const key in attrs) {\r\n if (!rawProps || !shared_esm_bundler_hasOwn(rawProps, key)) {\r\n delete attrs[key];\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n // trigger updates for $attrs in case it's used in component slots\r\n if (hasAttrsChanged) {\r\n trigger(instance, \"set\" /* SET */, '$attrs');\r\n }\r\n if ((false)) {}\r\n}\r\nfunction setFullProps(instance, rawProps, props, attrs) {\r\n const [options, needCastKeys] = instance.propsOptions;\r\n let hasAttrsChanged = false;\r\n let rawCastValues;\r\n if (rawProps) {\r\n for (let key in rawProps) {\r\n // key, ref are reserved and never passed down\r\n if (isReservedProp(key)) {\r\n continue;\r\n }\r\n const value = rawProps[key];\r\n // prop option names are camelized during normalization, so to support\r\n // kebab -> camel conversion here we need to camelize the key.\r\n let camelKey;\r\n if (options && shared_esm_bundler_hasOwn(options, (camelKey = camelize(key)))) {\r\n if (!needCastKeys || !needCastKeys.includes(camelKey)) {\r\n props[camelKey] = value;\r\n }\r\n else {\r\n (rawCastValues || (rawCastValues = {}))[camelKey] = value;\r\n }\r\n }\r\n else if (!isEmitListener(instance.emitsOptions, key)) {\r\n if (value !== attrs[key]) {\r\n attrs[key] = value;\r\n hasAttrsChanged = true;\r\n }\r\n }\r\n }\r\n }\r\n if (needCastKeys) {\r\n const rawCurrentProps = reactivity_esm_bundler_toRaw(props);\r\n const castValues = rawCastValues || EMPTY_OBJ;\r\n for (let i = 0; i < needCastKeys.length; i++) {\r\n const key = needCastKeys[i];\r\n props[key] = resolvePropValue(options, rawCurrentProps, key, castValues[key], instance, !shared_esm_bundler_hasOwn(castValues, key));\r\n }\r\n }\r\n return hasAttrsChanged;\r\n}\r\nfunction resolvePropValue(options, props, key, value, instance, isAbsent) {\r\n const opt = options[key];\r\n if (opt != null) {\r\n const hasDefault = shared_esm_bundler_hasOwn(opt, 'default');\r\n // default values\r\n if (hasDefault && value === undefined) {\r\n const defaultValue = opt.default;\r\n if (opt.type !== Function && isFunction(defaultValue)) {\r\n const { propsDefaults } = instance;\r\n if (key in propsDefaults) {\r\n value = propsDefaults[key];\r\n }\r\n else {\r\n setCurrentInstance(instance);\r\n value = propsDefaults[key] = defaultValue.call(null, props);\r\n unsetCurrentInstance();\r\n }\r\n }\r\n else {\r\n value = defaultValue;\r\n }\r\n }\r\n // boolean casting\r\n if (opt[0 /* shouldCast */]) {\r\n if (isAbsent && !hasDefault) {\r\n value = false;\r\n }\r\n else if (opt[1 /* shouldCastTrue */] &&\r\n (value === '' || value === shared_esm_bundler_hyphenate(key))) {\r\n value = true;\r\n }\r\n }\r\n }\r\n return value;\r\n}\r\nfunction normalizePropsOptions(comp, appContext, asMixin = false) {\r\n const cache = appContext.propsCache;\r\n const cached = cache.get(comp);\r\n if (cached) {\r\n return cached;\r\n }\r\n const raw = comp.props;\r\n const normalized = {};\r\n const needCastKeys = [];\r\n // apply mixin/extends props\r\n let hasExtends = false;\r\n if ( true && !isFunction(comp)) {\r\n const extendProps = (raw) => {\r\n hasExtends = true;\r\n const [props, keys] = normalizePropsOptions(raw, appContext, true);\r\n shared_esm_bundler_extend(normalized, props);\r\n if (keys)\r\n needCastKeys.push(...keys);\r\n };\r\n if (!asMixin && appContext.mixins.length) {\r\n appContext.mixins.forEach(extendProps);\r\n }\r\n if (comp.extends) {\r\n extendProps(comp.extends);\r\n }\r\n if (comp.mixins) {\r\n comp.mixins.forEach(extendProps);\r\n }\r\n }\r\n if (!raw && !hasExtends) {\r\n cache.set(comp, EMPTY_ARR);\r\n return EMPTY_ARR;\r\n }\r\n if (shared_esm_bundler_isArray(raw)) {\r\n for (let i = 0; i < raw.length; i++) {\r\n if (false) {}\r\n const normalizedKey = camelize(raw[i]);\r\n if (validatePropName(normalizedKey)) {\r\n normalized[normalizedKey] = EMPTY_OBJ;\r\n }\r\n }\r\n }\r\n else if (raw) {\r\n if (false) {}\r\n for (const key in raw) {\r\n const normalizedKey = camelize(key);\r\n if (validatePropName(normalizedKey)) {\r\n const opt = raw[key];\r\n const prop = (normalized[normalizedKey] =\r\n shared_esm_bundler_isArray(opt) || isFunction(opt) ? { type: opt } : opt);\r\n if (prop) {\r\n const booleanIndex = getTypeIndex(Boolean, prop.type);\r\n const stringIndex = getTypeIndex(String, prop.type);\r\n prop[0 /* shouldCast */] = booleanIndex > -1;\r\n prop[1 /* shouldCastTrue */] =\r\n stringIndex < 0 || booleanIndex < stringIndex;\r\n // if the prop needs boolean casting or default value\r\n if (booleanIndex > -1 || shared_esm_bundler_hasOwn(prop, 'default')) {\r\n needCastKeys.push(normalizedKey);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n const res = [normalized, needCastKeys];\r\n cache.set(comp, res);\r\n return res;\r\n}\r\nfunction validatePropName(key) {\r\n if (key[0] !== '$') {\r\n return true;\r\n }\r\n else if ((false)) {}\r\n return false;\r\n}\r\n// use function string name to check type constructors\r\n// so that it works across vms / iframes.\r\nfunction getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : ctor === null ? 'null' : '';\r\n}\r\nfunction isSameType(a, b) {\r\n return getType(a) === getType(b);\r\n}\r\nfunction getTypeIndex(type, expectedTypes) {\r\n if (shared_esm_bundler_isArray(expectedTypes)) {\r\n return expectedTypes.findIndex(t => isSameType(t, type));\r\n }\r\n else if (isFunction(expectedTypes)) {\r\n return isSameType(expectedTypes, type) ? 0 : -1;\r\n }\r\n return -1;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProps(rawProps, props, instance) {\r\n const resolvedValues = toRaw(props);\r\n const options = instance.propsOptions[0];\r\n for (const key in options) {\r\n let opt = options[key];\r\n if (opt == null)\r\n continue;\r\n validateProp(key, resolvedValues[key], opt, !hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key)));\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction validateProp(name, value, prop, isAbsent) {\r\n const { type, required, validator } = prop;\r\n // required!\r\n if (required && isAbsent) {\r\n runtime_core_esm_bundler_warn('Missing required prop: \"' + name + '\"');\r\n return;\r\n }\r\n // missing but optional\r\n if (value == null && !prop.required) {\r\n return;\r\n }\r\n // type check\r\n if (type != null && type !== true) {\r\n let isValid = false;\r\n const types = isArray(type) ? type : [type];\r\n const expectedTypes = [];\r\n // value is valid as long as one of the specified types match\r\n for (let i = 0; i < types.length && !isValid; i++) {\r\n const { valid, expectedType } = assertType(value, types[i]);\r\n expectedTypes.push(expectedType || '');\r\n isValid = valid;\r\n }\r\n if (!isValid) {\r\n runtime_core_esm_bundler_warn(getInvalidTypeMessage(name, value, expectedTypes));\r\n return;\r\n }\r\n }\r\n // custom validator\r\n if (validator && !validator(value)) {\r\n runtime_core_esm_bundler_warn('Invalid prop: custom validator check failed for prop \"' + name + '\".');\r\n }\r\n}\r\nconst isSimpleType = /*#__PURE__*/ (/* unused pure expression or super */ null && (makeMap('String,Number,Boolean,Function,Symbol,BigInt')));\r\n/**\r\n * dev only\r\n */\r\nfunction assertType(value, type) {\r\n let valid;\r\n const expectedType = getType(type);\r\n if (isSimpleType(expectedType)) {\r\n const t = typeof value;\r\n valid = t === expectedType.toLowerCase();\r\n // for primitive wrapper objects\r\n if (!valid && t === 'object') {\r\n valid = value instanceof type;\r\n }\r\n }\r\n else if (expectedType === 'Object') {\r\n valid = isObject(value);\r\n }\r\n else if (expectedType === 'Array') {\r\n valid = isArray(value);\r\n }\r\n else if (expectedType === 'null') {\r\n valid = value === null;\r\n }\r\n else {\r\n valid = value instanceof type;\r\n }\r\n return {\r\n valid,\r\n expectedType\r\n };\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction getInvalidTypeMessage(name, value, expectedTypes) {\r\n let message = `Invalid prop: type check failed for prop \"${name}\".` +\r\n ` Expected ${expectedTypes.map(capitalize).join(' | ')}`;\r\n const expectedType = expectedTypes[0];\r\n const receivedType = toRawType(value);\r\n const expectedValue = styleValue(value, expectedType);\r\n const receivedValue = styleValue(value, receivedType);\r\n // check if we need to specify expected value\r\n if (expectedTypes.length === 1 &&\r\n isExplicable(expectedType) &&\r\n !isBoolean(expectedType, receivedType)) {\r\n message += ` with value ${expectedValue}`;\r\n }\r\n message += `, got ${receivedType} `;\r\n // check if we need to specify received value\r\n if (isExplicable(receivedType)) {\r\n message += `with value ${receivedValue}.`;\r\n }\r\n return message;\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction styleValue(value, type) {\r\n if (type === 'String') {\r\n return `\"${value}\"`;\r\n }\r\n else if (type === 'Number') {\r\n return `${Number(value)}`;\r\n }\r\n else {\r\n return `${value}`;\r\n }\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isExplicable(type) {\r\n const explicitTypes = ['string', 'number', 'boolean'];\r\n return explicitTypes.some(elem => type.toLowerCase() === elem);\r\n}\r\n/**\r\n * dev only\r\n */\r\nfunction isBoolean(...args) {\r\n return args.some(elem => elem.toLowerCase() === 'boolean');\r\n}\n\nconst isInternalKey = (key) => key[0] === '_' || key === '$stable';\r\nconst normalizeSlotValue = (value) => shared_esm_bundler_isArray(value)\r\n ? value.map(normalizeVNode)\r\n : [normalizeVNode(value)];\r\nconst normalizeSlot = (key, rawSlot, ctx) => {\r\n const normalized = withCtx((...args) => {\r\n if (false) {}\r\n return normalizeSlotValue(rawSlot(...args));\r\n }, ctx);\r\n normalized._c = false;\r\n return normalized;\r\n};\r\nconst normalizeObjectSlots = (rawSlots, slots, instance) => {\r\n const ctx = rawSlots._ctx;\r\n for (const key in rawSlots) {\r\n if (isInternalKey(key))\r\n continue;\r\n const value = rawSlots[key];\r\n if (isFunction(value)) {\r\n slots[key] = normalizeSlot(key, value, ctx);\r\n }\r\n else if (value != null) {\r\n if (false) {}\r\n const normalized = normalizeSlotValue(value);\r\n slots[key] = () => normalized;\r\n }\r\n }\r\n};\r\nconst normalizeVNodeSlots = (instance, children) => {\r\n if (false) {}\r\n const normalized = normalizeSlotValue(children);\r\n instance.slots.default = () => normalized;\r\n};\r\nconst initSlots = (instance, children) => {\r\n if (instance.vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n // users can get the shallow readonly version of the slots object through `this.$slots`,\r\n // we should avoid the proxy object polluting the slots of the internal instance\r\n instance.slots = reactivity_esm_bundler_toRaw(children);\r\n // make compiler marker non-enumerable\r\n def(children, '_', type);\r\n }\r\n else {\r\n normalizeObjectSlots(children, (instance.slots = {}));\r\n }\r\n }\r\n else {\r\n instance.slots = {};\r\n if (children) {\r\n normalizeVNodeSlots(instance, children);\r\n }\r\n }\r\n def(instance.slots, InternalObjectKey, 1);\r\n};\r\nconst updateSlots = (instance, children, optimized) => {\r\n const { vnode, slots } = instance;\r\n let needDeletionCheck = true;\r\n let deletionComparisonTarget = EMPTY_OBJ;\r\n if (vnode.shapeFlag & 32 /* SLOTS_CHILDREN */) {\r\n const type = children._;\r\n if (type) {\r\n // compiled slots.\r\n if (false) {}\r\n else if (optimized && type === 1 /* STABLE */) {\r\n // compiled AND stable.\r\n // no need to update, and skip stale slots removal.\r\n needDeletionCheck = false;\r\n }\r\n else {\r\n // compiled but dynamic (v-if/v-for on slots) - update slots, but skip\r\n // normalization.\r\n shared_esm_bundler_extend(slots, children);\r\n // #2893\r\n // when rendering the optimized slots by manually written render function,\r\n // we need to delete the `slots._` flag if necessary to make subsequent updates reliable,\r\n // i.e. let the `renderSlot` create the bailed Fragment\r\n if (!optimized && type === 1 /* STABLE */) {\r\n delete slots._;\r\n }\r\n }\r\n }\r\n else {\r\n needDeletionCheck = !children.$stable;\r\n normalizeObjectSlots(children, slots);\r\n }\r\n deletionComparisonTarget = children;\r\n }\r\n else if (children) {\r\n // non slot object children (direct value) passed to a component\r\n normalizeVNodeSlots(instance, children);\r\n deletionComparisonTarget = { default: 1 };\r\n }\r\n // delete stale slots\r\n if (needDeletionCheck) {\r\n for (const key in slots) {\r\n if (!isInternalKey(key) && !(key in deletionComparisonTarget)) {\r\n delete slots[key];\r\n }\r\n }\r\n }\r\n};\n\n/**\r\nRuntime helper for applying directives to a vnode. Example usage:\r\n\nconst comp = resolveComponent('comp')\r\nconst foo = resolveDirective('foo')\r\nconst bar = resolveDirective('bar')\r\n\nreturn withDirectives(h(comp), [\r\n [foo, this.x],\r\n [bar, this.y]\r\n])\r\n*/\r\nconst isBuiltInDirective = /*#__PURE__*/ (/* unused pure expression or super */ null && (makeMap('bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo')));\r\nfunction validateDirectiveName(name) {\r\n if (isBuiltInDirective(name)) {\r\n runtime_core_esm_bundler_warn('Do not use built-in directive ids as custom directive id: ' + name);\r\n }\r\n}\r\n/**\r\n * Adds directives to a VNode.\r\n */\r\nfunction withDirectives(vnode, directives) {\r\n const internalInstance = currentRenderingInstance;\r\n if (internalInstance === null) {\r\n ( false) && 0;\r\n return vnode;\r\n }\r\n const instance = internalInstance.proxy;\r\n const bindings = vnode.dirs || (vnode.dirs = []);\r\n for (let i = 0; i < directives.length; i++) {\r\n let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];\r\n if (isFunction(dir)) {\r\n dir = {\r\n mounted: dir,\r\n updated: dir\r\n };\r\n }\r\n if (dir.deep) {\r\n traverse(value);\r\n }\r\n bindings.push({\r\n dir,\r\n instance,\r\n value,\r\n oldValue: void 0,\r\n arg,\r\n modifiers\r\n });\r\n }\r\n return vnode;\r\n}\r\nfunction invokeDirectiveHook(vnode, prevVNode, instance, name) {\r\n const bindings = vnode.dirs;\r\n const oldBindings = prevVNode && prevVNode.dirs;\r\n for (let i = 0; i < bindings.length; i++) {\r\n const binding = bindings[i];\r\n if (oldBindings) {\r\n binding.oldValue = oldBindings[i].value;\r\n }\r\n let hook = binding.dir[name];\r\n if (hook) {\r\n // disable tracking inside all lifecycle hooks\r\n // since they can potentially be called inside effects.\r\n pauseTracking();\r\n callWithAsyncErrorHandling(hook, instance, 8 /* DIRECTIVE_HOOK */, [\r\n vnode.el,\r\n binding,\r\n vnode,\r\n prevVNode\r\n ]);\r\n resetTracking();\r\n }\r\n }\r\n}\n\nfunction createAppContext() {\r\n return {\r\n app: null,\r\n config: {\r\n isNativeTag: shared_esm_bundler_NO,\r\n performance: false,\r\n globalProperties: {},\r\n optionMergeStrategies: {},\r\n errorHandler: undefined,\r\n warnHandler: undefined,\r\n compilerOptions: {}\r\n },\r\n mixins: [],\r\n components: {},\r\n directives: {},\r\n provides: Object.create(null),\r\n optionsCache: new WeakMap(),\r\n propsCache: new WeakMap(),\r\n emitsCache: new WeakMap()\r\n };\r\n}\r\nlet uid = 0;\r\nfunction createAppAPI(render, hydrate) {\r\n return function createApp(rootComponent, rootProps = null) {\r\n if (rootProps != null && !shared_esm_bundler_isObject(rootProps)) {\r\n ( false) && 0;\r\n rootProps = null;\r\n }\r\n const context = createAppContext();\r\n const installedPlugins = new Set();\r\n let isMounted = false;\r\n const app = (context.app = {\r\n _uid: uid++,\r\n _component: rootComponent,\r\n _props: rootProps,\r\n _container: null,\r\n _context: context,\r\n _instance: null,\r\n version,\r\n get config() {\r\n return context.config;\r\n },\r\n set config(v) {\r\n if ((false)) {}\r\n },\r\n use(plugin, ...options) {\r\n if (installedPlugins.has(plugin)) {\r\n ( false) && 0;\r\n }\r\n else if (plugin && isFunction(plugin.install)) {\r\n installedPlugins.add(plugin);\r\n plugin.install(app, ...options);\r\n }\r\n else if (isFunction(plugin)) {\r\n installedPlugins.add(plugin);\r\n plugin(app, ...options);\r\n }\r\n else if ((false)) {}\r\n return app;\r\n },\r\n mixin(mixin) {\r\n if (true) {\r\n if (!context.mixins.includes(mixin)) {\r\n context.mixins.push(mixin);\r\n }\r\n else if ((false)) {}\r\n }\r\n else {}\r\n return app;\r\n },\r\n component(name, component) {\r\n if ((false)) {}\r\n if (!component) {\r\n return context.components[name];\r\n }\r\n if (false) {}\r\n context.components[name] = component;\r\n return app;\r\n },\r\n directive(name, directive) {\r\n if ((false)) {}\r\n if (!directive) {\r\n return context.directives[name];\r\n }\r\n if (false) {}\r\n context.directives[name] = directive;\r\n return app;\r\n },\r\n mount(rootContainer, isHydrate, isSVG) {\r\n if (!isMounted) {\r\n const vnode = createVNode(rootComponent, rootProps);\r\n // store app context on the root VNode.\r\n // this will be set on the root instance on initial mount.\r\n vnode.appContext = context;\r\n // HMR root reload\r\n if ((false)) {}\r\n if (isHydrate && hydrate) {\r\n hydrate(vnode, rootContainer);\r\n }\r\n else {\r\n render(vnode, rootContainer, isSVG);\r\n }\r\n isMounted = true;\r\n app._container = rootContainer;\r\n rootContainer.__vue_app__ = app;\r\n if (false) {}\r\n return getExposeProxy(vnode.component) || vnode.component.proxy;\r\n }\r\n else if ((false)) {}\r\n },\r\n unmount() {\r\n if (isMounted) {\r\n render(null, app._container);\r\n if (false) {}\r\n delete app._container.__vue_app__;\r\n }\r\n else if ((false)) {}\r\n },\r\n provide(key, value) {\r\n if (false) {}\r\n // TypeScript doesn't allow symbols as index type\r\n // https://github.com/Microsoft/TypeScript/issues/24587\r\n context.provides[key] = value;\r\n return app;\r\n }\r\n });\r\n return app;\r\n };\r\n}\n\nlet hasMismatch = false;\r\nconst isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';\r\nconst isComment = (node) => node.nodeType === 8 /* COMMENT */;\r\n// Note: hydration is DOM-specific\r\n// But we have to place it in core due to tight coupling with core - splitting\r\n// it out creates a ton of unnecessary complexity.\r\n// Hydration also depends on some renderer internal logic which needs to be\r\n// passed in via arguments.\r\nfunction createHydrationFunctions(rendererInternals) {\r\n const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;\r\n const hydrate = (vnode, container) => {\r\n if (!container.hasChildNodes()) {\r\n ( false) &&\r\n 0;\r\n patch(null, vnode, container);\r\n flushPostFlushCbs();\r\n return;\r\n }\r\n hasMismatch = false;\r\n hydrateNode(container.firstChild, vnode, null, null, null);\r\n flushPostFlushCbs();\r\n if (hasMismatch && !false) {\r\n // this error should show up in production\r\n console.error(`Hydration completed but contains mismatches.`);\r\n }\r\n };\r\n const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {\r\n const isFragmentStart = isComment(node) && node.data === '[';\r\n const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);\r\n const { type, ref, shapeFlag } = vnode;\r\n const domType = node.nodeType;\r\n vnode.el = node;\r\n let nextNode = null;\r\n switch (type) {\r\n case Text:\r\n if (domType !== 3 /* TEXT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n if (node.data !== vnode.children) {\r\n hasMismatch = true;\r\n ( false) &&\r\n 0;\r\n node.data = vnode.children;\r\n }\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Comment:\r\n if (domType !== 8 /* COMMENT */ || isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = nextSibling(node);\r\n }\r\n break;\r\n case Static:\r\n if (domType !== 1 /* ELEMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n // determine anchor, adopt content\r\n nextNode = node;\r\n // if the static vnode has its content stripped during build,\r\n // adopt it from the server-rendered HTML.\r\n const needToAdoptContent = !vnode.children.length;\r\n for (let i = 0; i < vnode.staticCount; i++) {\r\n if (needToAdoptContent)\r\n vnode.children += nextNode.outerHTML;\r\n if (i === vnode.staticCount - 1) {\r\n vnode.anchor = nextNode;\r\n }\r\n nextNode = nextSibling(nextNode);\r\n }\r\n return nextNode;\r\n }\r\n break;\r\n case Fragment:\r\n if (!isFragmentStart) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateFragment(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n if (domType !== 1 /* ELEMENT */ ||\r\n vnode.type.toLowerCase() !==\r\n node.tagName.toLowerCase()) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = hydrateElement(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n // when setting up the render effect, if the initial vnode already\r\n // has .el set, the component will perform hydration instead of mount\r\n // on its sub-tree.\r\n vnode.slotScopeIds = slotScopeIds;\r\n const container = parentNode(node);\r\n mountComponent(vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), optimized);\r\n // component may be async, so in the case of fragments we cannot rely\r\n // on component's rendered output to determine the end of the fragment\r\n // instead, we do a lookahead to find the end anchor node.\r\n nextNode = isFragmentStart\r\n ? locateClosingAsyncAnchor(node)\r\n : nextSibling(node);\r\n // #3787\r\n // if component is async, it may get moved / unmounted before its\r\n // inner component is loaded, so we need to give it a placeholder\r\n // vnode that matches its adopted DOM.\r\n if (isAsyncWrapper(vnode)) {\r\n let subTree;\r\n if (isFragmentStart) {\r\n subTree = createVNode(Fragment);\r\n subTree.anchor = nextNode\r\n ? nextNode.previousSibling\r\n : container.lastChild;\r\n }\r\n else {\r\n subTree =\r\n node.nodeType === 3 ? createTextVNode('') : createVNode('div');\r\n }\r\n subTree.el = node;\r\n vnode.component.subTree = subTree;\r\n }\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n if (domType !== 8 /* COMMENT */) {\r\n nextNode = onMismatch();\r\n }\r\n else {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, rendererInternals, hydrateChildren);\r\n }\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n nextNode = vnode.type.hydrate(node, vnode, parentComponent, parentSuspense, isSVGContainer(parentNode(node)), slotScopeIds, optimized, rendererInternals, hydrateNode);\r\n }\r\n else if ((false)) {}\r\n }\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode);\r\n }\r\n return nextNode;\r\n };\r\n const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n optimized = optimized || !!vnode.dynamicChildren;\r\n const { type, props, patchFlag, shapeFlag, dirs } = vnode;\r\n // #4006 for form elements with non-string v-model value bindings\r\n // e.g. <option :value=\"obj\">, <input type=\"checkbox\" :true-value=\"1\">\r\n const forcePatchValue = (type === 'input' && dirs) || type === 'option';\r\n // skip props & children if this is hoisted static nodes\r\n if (forcePatchValue || patchFlag !== -1 /* HOISTED */) {\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n // props\r\n if (props) {\r\n if (forcePatchValue ||\r\n !optimized ||\r\n patchFlag & (16 /* FULL_PROPS */ | 32 /* HYDRATE_EVENTS */)) {\r\n for (const key in props) {\r\n if ((forcePatchValue && key.endsWith('value')) ||\r\n (isOn(key) && !isReservedProp(key))) {\r\n patchProp(el, key, null, props[key], false, undefined, parentComponent);\r\n }\r\n }\r\n }\r\n else if (props.onClick) {\r\n // Fast path for click listeners (which is most often) to avoid\r\n // iterating through props.\r\n patchProp(el, 'onClick', null, props.onClick, false, undefined, parentComponent);\r\n }\r\n }\r\n // vnode / directive hooks\r\n let vnodeHooks;\r\n if ((vnodeHooks = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {\r\n queueEffectWithSuspense(() => {\r\n vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n // children\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */ &&\r\n // skip if element has innerHTML / textContent\r\n !(props && (props.innerHTML || props.textContent))) {\r\n let next = hydrateChildren(el.firstChild, vnode, el, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n let hasWarned = false;\r\n while (next) {\r\n hasMismatch = true;\r\n if (false) {}\r\n // The SSRed DOM contains more nodes than it should. Remove them.\r\n const cur = next;\r\n next = next.nextSibling;\r\n remove(cur);\r\n }\r\n }\r\n else if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n if (el.textContent !== vnode.children) {\r\n hasMismatch = true;\r\n ( false) &&\r\n 0;\r\n el.textContent = vnode.children;\r\n }\r\n }\r\n }\r\n return el.nextSibling;\r\n };\r\n const hydrateChildren = (node, parentVNode, container, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n optimized = optimized || !!parentVNode.dynamicChildren;\r\n const children = parentVNode.children;\r\n const l = children.length;\r\n let hasWarned = false;\r\n for (let i = 0; i < l; i++) {\r\n const vnode = optimized\r\n ? children[i]\r\n : (children[i] = normalizeVNode(children[i]));\r\n if (node) {\r\n node = hydrateNode(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n else if (vnode.type === Text && !vnode.children) {\r\n continue;\r\n }\r\n else {\r\n hasMismatch = true;\r\n if (false) {}\r\n // the SSRed DOM didn't contain enough nodes. Mount the missing ones.\r\n patch(null, vnode, container, null, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n }\r\n }\r\n return node;\r\n };\r\n const hydrateFragment = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {\r\n const { slotScopeIds: fragmentSlotScopeIds } = vnode;\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n const container = parentNode(node);\r\n const next = hydrateChildren(nextSibling(node), vnode, container, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n if (next && isComment(next) && next.data === ']') {\r\n return nextSibling((vnode.anchor = next));\r\n }\r\n else {\r\n // fragment didn't hydrate successfully, since we didn't get a end anchor\r\n // back. This should have led to node/children mismatch warnings.\r\n hasMismatch = true;\r\n // since the anchor is missing, we need to create one and insert it\r\n insert((vnode.anchor = createComment(`]`)), container, next);\r\n return next;\r\n }\r\n };\r\n const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {\r\n hasMismatch = true;\r\n ( false) &&\r\n 0;\r\n vnode.el = null;\r\n if (isFragment) {\r\n // remove excessive fragment nodes\r\n const end = locateClosingAsyncAnchor(node);\r\n while (true) {\r\n const next = nextSibling(node);\r\n if (next && next !== end) {\r\n remove(next);\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n }\r\n const next = nextSibling(node);\r\n const container = parentNode(node);\r\n remove(node);\r\n patch(null, vnode, container, next, parentComponent, parentSuspense, isSVGContainer(container), slotScopeIds);\r\n return next;\r\n };\r\n const locateClosingAsyncAnchor = (node) => {\r\n let match = 0;\r\n while (node) {\r\n node = nextSibling(node);\r\n if (node && isComment(node)) {\r\n if (node.data === '[')\r\n match++;\r\n if (node.data === ']') {\r\n if (match === 0) {\r\n return nextSibling(node);\r\n }\r\n else {\r\n match--;\r\n }\r\n }\r\n }\r\n }\r\n return node;\r\n };\r\n return [hydrate, hydrateNode];\r\n}\n\nlet supported;\r\nlet perf;\r\nfunction startMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n perf.mark(`vue-${type}-${instance.uid}`);\r\n }\r\n if (false) {}\r\n}\r\nfunction endMeasure(instance, type) {\r\n if (instance.appContext.config.performance && isSupported()) {\r\n const startTag = `vue-${type}-${instance.uid}`;\r\n const endTag = startTag + `:end`;\r\n perf.mark(endTag);\r\n perf.measure(`<${formatComponentName(instance, instance.type)}> ${type}`, startTag, endTag);\r\n perf.clearMarks(startTag);\r\n perf.clearMarks(endTag);\r\n }\r\n if (false) {}\r\n}\r\nfunction isSupported() {\r\n if (supported !== undefined) {\r\n return supported;\r\n }\r\n /* eslint-disable no-restricted-globals */\r\n if (typeof window !== 'undefined' && window.performance) {\r\n supported = true;\r\n perf = window.performance;\r\n }\r\n else {\r\n supported = false;\r\n }\r\n /* eslint-enable no-restricted-globals */\r\n return supported;\r\n}\n\n/**\r\n * This is only called in esm-bundler builds.\r\n * It is called when a renderer is created, in `baseCreateRenderer` so that\r\n * importing runtime-core is side-effects free.\r\n *\r\n * istanbul-ignore-next\r\n */\r\nfunction initFeatureFlags() {\r\n const needWarn = [];\r\n if (false) {}\r\n if (false) {}\r\n if (false) {}\r\n}\n\nconst queuePostRenderEffect = queueEffectWithSuspense\r\n ;\r\n/**\r\n * The createRenderer function accepts two generic arguments:\r\n * HostNode and HostElement, corresponding to Node and Element types in the\r\n * host environment. For example, for runtime-dom, HostNode would be the DOM\r\n * `Node` interface and HostElement would be the DOM `Element` interface.\r\n *\r\n * Custom renderers can pass in the platform specific types like this:\r\n *\r\n * ``` js\r\n * const { render, createApp } = createRenderer<Node, Element>({\r\n * patchProp,\r\n * ...nodeOps\r\n * })\r\n * ```\r\n */\r\nfunction createRenderer(options) {\r\n return baseCreateRenderer(options);\r\n}\r\n// Separate API for creating hydration-enabled renderer.\r\n// Hydration logic is only used when calling this function, making it\r\n// tree-shakable.\r\nfunction createHydrationRenderer(options) {\r\n return baseCreateRenderer(options, createHydrationFunctions);\r\n}\r\n// implementation\r\nfunction baseCreateRenderer(options, createHydrationFns) {\r\n // compile-time feature flags check\r\n {\r\n initFeatureFlags();\r\n }\r\n const target = getGlobalThis();\r\n target.__VUE__ = true;\r\n if (false) {}\r\n const { insert: hostInsert, remove: hostRemove, patchProp: hostPatchProp, createElement: hostCreateElement, createText: hostCreateText, createComment: hostCreateComment, setText: hostSetText, setElementText: hostSetElementText, parentNode: hostParentNode, nextSibling: hostNextSibling, setScopeId: hostSetScopeId = shared_esm_bundler_NOOP, cloneNode: hostCloneNode, insertStaticContent: hostInsertStaticContent } = options;\r\n // Note: functions inside this closure should use `const xxx = () => {}`\r\n // style in order to prevent being inlined by minifiers.\r\n const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, isSVG = false, slotScopeIds = null, optimized = false ? 0 : !!n2.dynamicChildren) => {\r\n if (n1 === n2) {\r\n return;\r\n }\r\n // patching & not same type, unmount old tree\r\n if (n1 && !isSameVNodeType(n1, n2)) {\r\n anchor = getNextHostNode(n1);\r\n unmount(n1, parentComponent, parentSuspense, true);\r\n n1 = null;\r\n }\r\n if (n2.patchFlag === -2 /* BAIL */) {\r\n optimized = false;\r\n n2.dynamicChildren = null;\r\n }\r\n const { type, ref, shapeFlag } = n2;\r\n switch (type) {\r\n case Text:\r\n processText(n1, n2, container, anchor);\r\n break;\r\n case Comment:\r\n processCommentNode(n1, n2, container, anchor);\r\n break;\r\n case Static:\r\n if (n1 == null) {\r\n mountStaticNode(n2, container, anchor, isSVG);\r\n }\r\n else if ((false)) {}\r\n break;\r\n case Fragment:\r\n processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n break;\r\n default:\r\n if (shapeFlag & 1 /* ELEMENT */) {\r\n processElement(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 6 /* COMPONENT */) {\r\n processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (shapeFlag & 64 /* TELEPORT */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else if (shapeFlag & 128 /* SUSPENSE */) {\r\n type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);\r\n }\r\n else if ((false)) {}\r\n }\r\n // set ref\r\n if (ref != null && parentComponent) {\r\n setRef(ref, n1 && n1.ref, parentSuspense, n2 || n1, !n2);\r\n }\r\n };\r\n const processText = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateText(n2.children)), container, anchor);\r\n }\r\n else {\r\n const el = (n2.el = n1.el);\r\n if (n2.children !== n1.children) {\r\n hostSetText(el, n2.children);\r\n }\r\n }\r\n };\r\n const processCommentNode = (n1, n2, container, anchor) => {\r\n if (n1 == null) {\r\n hostInsert((n2.el = hostCreateComment(n2.children || '')), container, anchor);\r\n }\r\n else {\r\n // there's no support for dynamic comments\r\n n2.el = n1.el;\r\n }\r\n };\r\n const mountStaticNode = (n2, container, anchor, isSVG) => {\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n };\r\n /**\r\n * Dev / HMR only\r\n */\r\n const patchStaticNode = (n1, n2, container, isSVG) => {\r\n // static nodes are only patched during dev for HMR\r\n if (n2.children !== n1.children) {\r\n const anchor = hostNextSibling(n1.anchor);\r\n // remove existing\r\n removeStaticNode(n1);\r\n [n2.el, n2.anchor] = hostInsertStaticContent(n2.children, container, anchor, isSVG);\r\n }\r\n else {\r\n n2.el = n1.el;\r\n n2.anchor = n1.anchor;\r\n }\r\n };\r\n const moveStaticNode = ({ el, anchor }, container, nextSibling) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostInsert(el, container, nextSibling);\r\n el = next;\r\n }\r\n hostInsert(anchor, container, nextSibling);\r\n };\r\n const removeStaticNode = ({ el, anchor }) => {\r\n let next;\r\n while (el && el !== anchor) {\r\n next = hostNextSibling(el);\r\n hostRemove(el);\r\n el = next;\r\n }\r\n hostRemove(anchor);\r\n };\r\n const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n isSVG = isSVG || n2.type === 'svg';\r\n if (n1 == null) {\r\n mountElement(n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n patchElement(n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n let el;\r\n let vnodeHook;\r\n const { type, props, shapeFlag, transition, patchFlag, dirs } = vnode;\r\n if ( true &&\r\n vnode.el &&\r\n hostCloneNode !== undefined &&\r\n patchFlag === -1 /* HOISTED */) {\r\n // If a vnode has non-null el, it means it's being reused.\r\n // Only static vnodes can be reused, so its mounted DOM nodes should be\r\n // exactly the same, and we can simply do a clone here.\r\n // only do this in production since cloned trees cannot be HMR updated.\r\n el = vnode.el = hostCloneNode(vnode.el);\r\n }\r\n else {\r\n el = vnode.el = hostCreateElement(vnode.type, isSVG, props && props.is, props);\r\n // mount children first, since some props may rely on child content\r\n // being already rendered, e.g. `<select value>`\r\n if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n hostSetElementText(el, vnode.children);\r\n }\r\n else if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(vnode.children, el, null, parentComponent, parentSuspense, isSVG && type !== 'foreignObject', slotScopeIds, optimized);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'created');\r\n }\r\n // props\r\n if (props) {\r\n for (const key in props) {\r\n if (key !== 'value' && !isReservedProp(key)) {\r\n hostPatchProp(el, key, null, props[key], isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n /**\r\n * Special case for setting value on DOM elements:\r\n * - it can be order-sensitive (e.g. should be set *after* min/max, #2325, #4024)\r\n * - it needs to be forced (#1471)\r\n * #2353 proposes adding another renderer option to configure this, but\r\n * the properties affects are so finite it is worth special casing it\r\n * here to reduce the complexity. (Special casing it also should not\r\n * affect non-DOM renderers)\r\n */\r\n if ('value' in props) {\r\n hostPatchProp(el, 'value', null, props.value);\r\n }\r\n if ((vnodeHook = props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n }\r\n // scopeId\r\n setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);\r\n }\r\n if (false) {}\r\n if (dirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeMount');\r\n }\r\n // #1583 For inside suspense + suspense not resolved case, enter hook should call when suspense resolved\r\n // #1689 For inside suspense + suspense resolved case, just call it\r\n const needCallTransitionHooks = (!parentSuspense || (parentSuspense && !parentSuspense.pendingBranch)) &&\r\n transition &&\r\n !transition.persisted;\r\n if (needCallTransitionHooks) {\r\n transition.beforeEnter(el);\r\n }\r\n hostInsert(el, container, anchor);\r\n if ((vnodeHook = props && props.onVnodeMounted) ||\r\n needCallTransitionHooks ||\r\n dirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n needCallTransitionHooks && transition.enter(el);\r\n dirs && invokeDirectiveHook(vnode, null, parentComponent, 'mounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => {\r\n if (scopeId) {\r\n hostSetScopeId(el, scopeId);\r\n }\r\n if (slotScopeIds) {\r\n for (let i = 0; i < slotScopeIds.length; i++) {\r\n hostSetScopeId(el, slotScopeIds[i]);\r\n }\r\n }\r\n if (parentComponent) {\r\n let subTree = parentComponent.subTree;\r\n if (false /* DEV_ROOT_FRAGMENT */) {}\r\n if (vnode === subTree) {\r\n const parentVNode = parentComponent.vnode;\r\n setScopeId(el, parentVNode, parentVNode.scopeId, parentVNode.slotScopeIds, parentComponent.parent);\r\n }\r\n }\r\n };\r\n const mountChildren = (children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, start = 0) => {\r\n for (let i = start; i < children.length; i++) {\r\n const child = (children[i] = optimized\r\n ? cloneIfMounted(children[i])\r\n : normalizeVNode(children[i]));\r\n patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n const patchElement = (n1, n2, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n const el = (n2.el = n1.el);\r\n let { patchFlag, dynamicChildren, dirs } = n2;\r\n // #1426 take the old vnode's patch flag into account since user may clone a\r\n // compiler-generated vnode, which de-opts to FULL_PROPS\r\n patchFlag |= n1.patchFlag & 16 /* FULL_PROPS */;\r\n const oldProps = n1.props || EMPTY_OBJ;\r\n const newProps = n2.props || EMPTY_OBJ;\r\n let vnodeHook;\r\n if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n }\r\n if (dirs) {\r\n invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');\r\n }\r\n if (false) {}\r\n const areChildrenSVG = isSVG && n2.type !== 'foreignObject';\r\n if (dynamicChildren) {\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);\r\n if (false) {}\r\n }\r\n else if (!optimized) {\r\n // full diff\r\n patchChildren(n1, n2, el, null, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds, false);\r\n }\r\n if (patchFlag > 0) {\r\n // the presence of a patchFlag means this element's render code was\r\n // generated by the compiler and can take the fast path.\r\n // in this path old node and new node are guaranteed to have the same shape\r\n // (i.e. at the exact same position in the source template)\r\n if (patchFlag & 16 /* FULL_PROPS */) {\r\n // element props contain dynamic keys, full diff needed\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n else {\r\n // class\r\n // this flag is matched when the element has dynamic class bindings.\r\n if (patchFlag & 2 /* CLASS */) {\r\n if (oldProps.class !== newProps.class) {\r\n hostPatchProp(el, 'class', null, newProps.class, isSVG);\r\n }\r\n }\r\n // style\r\n // this flag is matched when the element has dynamic style bindings\r\n if (patchFlag & 4 /* STYLE */) {\r\n hostPatchProp(el, 'style', oldProps.style, newProps.style, isSVG);\r\n }\r\n // props\r\n // This flag is matched when the element has dynamic prop/attr bindings\r\n // other than class and style. The keys of dynamic prop/attrs are saved for\r\n // faster iteration.\r\n // Note dynamic keys like :[foo]=\"bar\" will cause this optimization to\r\n // bail out and go through a full diff because we need to unset the old key\r\n if (patchFlag & 8 /* PROPS */) {\r\n // if the flag is present then dynamicProps must be non-null\r\n const propsToUpdate = n2.dynamicProps;\r\n for (let i = 0; i < propsToUpdate.length; i++) {\r\n const key = propsToUpdate[i];\r\n const prev = oldProps[key];\r\n const next = newProps[key];\r\n // #1471 force patch value\r\n if (next !== prev || key === 'value') {\r\n hostPatchProp(el, key, prev, next, isSVG, n1.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n }\r\n // text\r\n // This flag is matched when the element has only dynamic text children.\r\n if (patchFlag & 1 /* TEXT */) {\r\n if (n1.children !== n2.children) {\r\n hostSetElementText(el, n2.children);\r\n }\r\n }\r\n }\r\n else if (!optimized && dynamicChildren == null) {\r\n // unoptimized, full diff\r\n patchProps(el, n2, oldProps, newProps, parentComponent, parentSuspense, isSVG);\r\n }\r\n if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1);\r\n dirs && invokeDirectiveHook(n2, n1, parentComponent, 'updated');\r\n }, parentSuspense);\r\n }\r\n };\r\n // The fast path for blocks.\r\n const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, isSVG, slotScopeIds) => {\r\n for (let i = 0; i < newChildren.length; i++) {\r\n const oldVNode = oldChildren[i];\r\n const newVNode = newChildren[i];\r\n // Determine the container (parent element) for the patch.\r\n const container = \r\n // oldVNode may be an errored async setup() component inside Suspense\r\n // which will not have a mounted element\r\n oldVNode.el &&\r\n // - In the case of a Fragment, we need to provide the actual parent\r\n // of the Fragment itself so it can move its children.\r\n (oldVNode.type === Fragment ||\r\n // - In the case of different nodes, there is going to be a replacement\r\n // which also requires the correct parent container\r\n !isSameVNodeType(oldVNode, newVNode) ||\r\n // - In the case of a component, it could contain anything.\r\n oldVNode.shapeFlag & (6 /* COMPONENT */ | 64 /* TELEPORT */))\r\n ? hostParentNode(oldVNode.el)\r\n : // In other cases, the parent container is not actually used so we\r\n // just pass the block element here to avoid a DOM parentNode call.\r\n fallbackContainer;\r\n patch(oldVNode, newVNode, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, true);\r\n }\r\n };\r\n const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, isSVG) => {\r\n if (oldProps !== newProps) {\r\n for (const key in newProps) {\r\n // empty string is not valid prop\r\n if (isReservedProp(key))\r\n continue;\r\n const next = newProps[key];\r\n const prev = oldProps[key];\r\n // defer patching value\r\n if (next !== prev && key !== 'value') {\r\n hostPatchProp(el, key, prev, next, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n if (oldProps !== EMPTY_OBJ) {\r\n for (const key in oldProps) {\r\n if (!isReservedProp(key) && !(key in newProps)) {\r\n hostPatchProp(el, key, oldProps[key], null, isSVG, vnode.children, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n }\r\n }\r\n if ('value' in newProps) {\r\n hostPatchProp(el, 'value', oldProps.value, newProps.value);\r\n }\r\n }\r\n };\r\n const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));\r\n const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));\r\n let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;\r\n if (false) {}\r\n // check if this is a slot fragment with :slotted scope ids\r\n if (fragmentSlotScopeIds) {\r\n slotScopeIds = slotScopeIds\r\n ? slotScopeIds.concat(fragmentSlotScopeIds)\r\n : fragmentSlotScopeIds;\r\n }\r\n if (n1 == null) {\r\n hostInsert(fragmentStartAnchor, container, anchor);\r\n hostInsert(fragmentEndAnchor, container, anchor);\r\n // a fragment can only have array children\r\n // since they are either generated by the compiler, or implicitly created\r\n // from arrays.\r\n mountChildren(n2.children, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n if (patchFlag > 0 &&\r\n patchFlag & 64 /* STABLE_FRAGMENT */ &&\r\n dynamicChildren &&\r\n // #2715 the previous fragment could've been a BAILed one as a result\r\n // of renderSlot() with no valid children\r\n n1.dynamicChildren) {\r\n // a stable fragment (template root or <template v-for>) doesn't need to\r\n // patch children order, but it may contain dynamicChildren.\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, container, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n if (false) {}\r\n else if (\r\n // #2080 if the stable fragment has a key, it's a <template v-for> that may\r\n // get moved around. Make sure all root level vnodes inherit el.\r\n // #2134 or if it's a component root, it may also get moved around\r\n // as the component is being moved.\r\n n2.key != null ||\r\n (parentComponent && n2 === parentComponent.subTree)) {\r\n traverseStaticChildren(n1, n2, true /* shallow */);\r\n }\r\n }\r\n else {\r\n // keyed / unkeyed, or manual fragments.\r\n // for keyed & unkeyed, since they are compiler generated from v-for,\r\n // each child is guaranteed to be a block so the fragment will never\r\n // have dynamicChildren.\r\n patchChildren(n1, n2, container, fragmentEndAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n };\r\n const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n n2.slotScopeIds = slotScopeIds;\r\n if (n1 == null) {\r\n if (n2.shapeFlag & 512 /* COMPONENT_KEPT_ALIVE */) {\r\n parentComponent.ctx.activate(n2, container, anchor, isSVG, optimized);\r\n }\r\n else {\r\n mountComponent(n2, container, anchor, parentComponent, parentSuspense, isSVG, optimized);\r\n }\r\n }\r\n else {\r\n updateComponent(n1, n2, optimized);\r\n }\r\n };\r\n const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {\r\n const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));\r\n if (false) {}\r\n if ((false)) {}\r\n // inject renderer internals for keepAlive\r\n if (isKeepAlive(initialVNode)) {\r\n instance.ctx.renderer = internals;\r\n }\r\n // resolve props and slots for setup context\r\n {\r\n if ((false)) {}\r\n setupComponent(instance);\r\n if ((false)) {}\r\n }\r\n // setup() is async. This component relies on async logic to be resolved\r\n // before proceeding\r\n if (instance.asyncDep) {\r\n parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect);\r\n // Give it a placeholder if this is not hydration\r\n // TODO handle self-defined fallback\r\n if (!initialVNode.el) {\r\n const placeholder = (instance.subTree = createVNode(Comment));\r\n processCommentNode(null, placeholder, container, anchor);\r\n }\r\n return;\r\n }\r\n setupRenderEffect(instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized);\r\n if ((false)) {}\r\n };\r\n const updateComponent = (n1, n2, optimized) => {\r\n const instance = (n2.component = n1.component);\r\n if (shouldUpdateComponent(n1, n2, optimized)) {\r\n if (instance.asyncDep &&\r\n !instance.asyncResolved) {\r\n // async & still pending - just update props and slots\r\n // since the component's reactive effect for render isn't set-up yet\r\n if ((false)) {}\r\n updateComponentPreRender(instance, n2, optimized);\r\n if ((false)) {}\r\n return;\r\n }\r\n else {\r\n // normal update\r\n instance.next = n2;\r\n // in case the child component is also queued, remove it to avoid\r\n // double updating the same child component in the same flush.\r\n invalidateJob(instance.update);\r\n // instance.update is the reactive effect.\r\n instance.update();\r\n }\r\n }\r\n else {\r\n // no update needed. just copy over properties\r\n n2.component = n1.component;\r\n n2.el = n1.el;\r\n instance.vnode = n2;\r\n }\r\n };\r\n const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, isSVG, optimized) => {\r\n const componentUpdateFn = () => {\r\n if (!instance.isMounted) {\r\n let vnodeHook;\r\n const { el, props } = initialVNode;\r\n const { bm, m, parent } = instance;\r\n const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);\r\n effect.allowRecurse = false;\r\n // beforeMount hook\r\n if (bm) {\r\n invokeArrayFns(bm);\r\n }\r\n // onVnodeBeforeMount\r\n if (!isAsyncWrapperVNode &&\r\n (vnodeHook = props && props.onVnodeBeforeMount)) {\r\n invokeVNodeHook(vnodeHook, parent, initialVNode);\r\n }\r\n effect.allowRecurse = true;\r\n if (el && hydrateNode) {\r\n // vnode has adopted host node - perform hydration instead of mount.\r\n const hydrateSubTree = () => {\r\n if ((false)) {}\r\n instance.subTree = renderComponentRoot(instance);\r\n if ((false)) {}\r\n if ((false)) {}\r\n hydrateNode(el, instance.subTree, instance, parentSuspense, null);\r\n if ((false)) {}\r\n };\r\n if (isAsyncWrapperVNode) {\r\n initialVNode.type.__asyncLoader().then(\r\n // note: we are moving the render call into an async callback,\r\n // which means it won't track dependencies - but it's ok because\r\n // a server-rendered async wrapper is already in resolved state\r\n // and it will never need to change.\r\n () => !instance.isUnmounted && hydrateSubTree());\r\n }\r\n else {\r\n hydrateSubTree();\r\n }\r\n }\r\n else {\r\n if ((false)) {}\r\n const subTree = (instance.subTree = renderComponentRoot(instance));\r\n if ((false)) {}\r\n if ((false)) {}\r\n patch(null, subTree, container, anchor, instance, parentSuspense, isSVG);\r\n if ((false)) {}\r\n initialVNode.el = subTree.el;\r\n }\r\n // mounted hook\r\n if (m) {\r\n queuePostRenderEffect(m, parentSuspense);\r\n }\r\n // onVnodeMounted\r\n if (!isAsyncWrapperVNode &&\r\n (vnodeHook = props && props.onVnodeMounted)) {\r\n const scopedInitialVNode = initialVNode;\r\n queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), parentSuspense);\r\n }\r\n // activated hook for keep-alive roots.\r\n // #1742 activated hook must be accessed after first render\r\n // since the hook may be injected by a child keep-alive\r\n if (initialVNode.shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n instance.a && queuePostRenderEffect(instance.a, parentSuspense);\r\n }\r\n instance.isMounted = true;\r\n if (false) {}\r\n // #2458: deference mount-only object parameters to prevent memleaks\r\n initialVNode = container = anchor = null;\r\n }\r\n else {\r\n // updateComponent\r\n // This is triggered by mutation of component's own state (next: null)\r\n // OR parent calling processComponent (next: VNode)\r\n let { next, bu, u, parent, vnode } = instance;\r\n let originNext = next;\r\n let vnodeHook;\r\n if ((false)) {}\r\n // Disallow component effect recursion during pre-lifecycle hooks.\r\n effect.allowRecurse = false;\r\n if (next) {\r\n next.el = vnode.el;\r\n updateComponentPreRender(instance, next, optimized);\r\n }\r\n else {\r\n next = vnode;\r\n }\r\n // beforeUpdate hook\r\n if (bu) {\r\n invokeArrayFns(bu);\r\n }\r\n // onVnodeBeforeUpdate\r\n if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {\r\n invokeVNodeHook(vnodeHook, parent, next, vnode);\r\n }\r\n effect.allowRecurse = true;\r\n // render\r\n if ((false)) {}\r\n const nextTree = renderComponentRoot(instance);\r\n if ((false)) {}\r\n const prevTree = instance.subTree;\r\n instance.subTree = nextTree;\r\n if ((false)) {}\r\n patch(prevTree, nextTree, \r\n // parent may have changed if it's in a teleport\r\n hostParentNode(prevTree.el), \r\n // anchor may have changed if it's in a fragment\r\n getNextHostNode(prevTree), instance, parentSuspense, isSVG);\r\n if ((false)) {}\r\n next.el = nextTree.el;\r\n if (originNext === null) {\r\n // self-triggered update. In case of HOC, update parent component\r\n // vnode el. HOC is indicated by parent instance's subTree pointing\r\n // to child component's vnode\r\n updateHOCHostEl(instance, nextTree.el);\r\n }\r\n // updated hook\r\n if (u) {\r\n queuePostRenderEffect(u, parentSuspense);\r\n }\r\n // onVnodeUpdated\r\n if ((vnodeHook = next.props && next.props.onVnodeUpdated)) {\r\n queuePostRenderEffect(() => invokeVNodeHook(vnodeHook, parent, next, vnode), parentSuspense);\r\n }\r\n if (false) {}\r\n if ((false)) {}\r\n }\r\n };\r\n // create reactive effect for rendering\r\n const effect = new ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope\r\n );\r\n const update = (instance.update = effect.run.bind(effect));\r\n update.id = instance.uid;\r\n // allowRecurse\r\n // #1801, #2043 component render effects should allow recursive updates\r\n effect.allowRecurse = update.allowRecurse = true;\r\n if ((false)) {}\r\n update();\r\n };\r\n const updateComponentPreRender = (instance, nextVNode, optimized) => {\r\n nextVNode.component = instance;\r\n const prevProps = instance.vnode.props;\r\n instance.vnode = nextVNode;\r\n instance.next = null;\r\n updateProps(instance, nextVNode.props, prevProps, optimized);\r\n updateSlots(instance, nextVNode.children, optimized);\r\n pauseTracking();\r\n // props update may have triggered pre-flush watchers.\r\n // flush them before the render update.\r\n flushPreFlushCbs(undefined, instance.update);\r\n resetTracking();\r\n };\r\n const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {\r\n const c1 = n1 && n1.children;\r\n const prevShapeFlag = n1 ? n1.shapeFlag : 0;\r\n const c2 = n2.children;\r\n const { patchFlag, shapeFlag } = n2;\r\n // fast path\r\n if (patchFlag > 0) {\r\n if (patchFlag & 128 /* KEYED_FRAGMENT */) {\r\n // this could be either fully-keyed or mixed (some keyed some not)\r\n // presence of patchFlag means children are guaranteed to be arrays\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n else if (patchFlag & 256 /* UNKEYED_FRAGMENT */) {\r\n // unkeyed\r\n patchUnkeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n return;\r\n }\r\n }\r\n // children has 3 possibilities: text, array or no children.\r\n if (shapeFlag & 8 /* TEXT_CHILDREN */) {\r\n // text children fast path\r\n if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n unmountChildren(c1, parentComponent, parentSuspense);\r\n }\r\n if (c2 !== c1) {\r\n hostSetElementText(container, c2);\r\n }\r\n }\r\n else {\r\n if (prevShapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n // prev children was array\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n // two arrays, cannot assume anything, do full diff\r\n patchKeyedChildren(c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n // no new children, just unmount old\r\n unmountChildren(c1, parentComponent, parentSuspense, true);\r\n }\r\n }\r\n else {\r\n // prev children was text OR null\r\n // new children is array OR null\r\n if (prevShapeFlag & 8 /* TEXT_CHILDREN */) {\r\n hostSetElementText(container, '');\r\n }\r\n // mount new if array\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n }\r\n }\r\n };\r\n const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n c1 = c1 || EMPTY_ARR;\r\n c2 = c2 || EMPTY_ARR;\r\n const oldLength = c1.length;\r\n const newLength = c2.length;\r\n const commonLength = Math.min(oldLength, newLength);\r\n let i;\r\n for (i = 0; i < commonLength; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n if (oldLength > newLength) {\r\n // remove old\r\n unmountChildren(c1, parentComponent, parentSuspense, true, false, commonLength);\r\n }\r\n else {\r\n // mount new\r\n mountChildren(c2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, commonLength);\r\n }\r\n };\r\n // can be all-keyed or mixed\r\n const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized) => {\r\n let i = 0;\r\n const l2 = c2.length;\r\n let e1 = c1.length - 1; // prev ending index\r\n let e2 = l2 - 1; // next ending index\r\n // 1. sync from start\r\n // (a b) c\r\n // (a b) d e\r\n while (i <= e1 && i <= e2) {\r\n const n1 = c1[i];\r\n const n2 = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n i++;\r\n }\r\n // 2. sync from end\r\n // a (b c)\r\n // d e (b c)\r\n while (i <= e1 && i <= e2) {\r\n const n1 = c1[e1];\r\n const n2 = (c2[e2] = optimized\r\n ? cloneIfMounted(c2[e2])\r\n : normalizeVNode(c2[e2]));\r\n if (isSameVNodeType(n1, n2)) {\r\n patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else {\r\n break;\r\n }\r\n e1--;\r\n e2--;\r\n }\r\n // 3. common sequence + mount\r\n // (a b)\r\n // (a b) c\r\n // i = 2, e1 = 1, e2 = 2\r\n // (a b)\r\n // c (a b)\r\n // i = 0, e1 = -1, e2 = 0\r\n if (i > e1) {\r\n if (i <= e2) {\r\n const nextPos = e2 + 1;\r\n const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor;\r\n while (i <= e2) {\r\n patch(null, (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n i++;\r\n }\r\n }\r\n }\r\n // 4. common sequence + unmount\r\n // (a b) c\r\n // (a b)\r\n // i = 2, e1 = 2, e2 = 1\r\n // a (b c)\r\n // (b c)\r\n // i = 0, e1 = 0, e2 = -1\r\n else if (i > e2) {\r\n while (i <= e1) {\r\n unmount(c1[i], parentComponent, parentSuspense, true);\r\n i++;\r\n }\r\n }\r\n // 5. unknown sequence\r\n // [i ... e1 + 1]: a b [c d e] f g\r\n // [i ... e2 + 1]: a b [e d c h] f g\r\n // i = 2, e1 = 4, e2 = 5\r\n else {\r\n const s1 = i; // prev starting index\r\n const s2 = i; // next starting index\r\n // 5.1 build key:index map for newChildren\r\n const keyToNewIndexMap = new Map();\r\n for (i = s2; i <= e2; i++) {\r\n const nextChild = (c2[i] = optimized\r\n ? cloneIfMounted(c2[i])\r\n : normalizeVNode(c2[i]));\r\n if (nextChild.key != null) {\r\n if (false) {}\r\n keyToNewIndexMap.set(nextChild.key, i);\r\n }\r\n }\r\n // 5.2 loop through old children left to be patched and try to patch\r\n // matching nodes & remove nodes that are no longer present\r\n let j;\r\n let patched = 0;\r\n const toBePatched = e2 - s2 + 1;\r\n let moved = false;\r\n // used to track whether any node has moved\r\n let maxNewIndexSoFar = 0;\r\n // works as Map<newIndex, oldIndex>\r\n // Note that oldIndex is offset by +1\r\n // and oldIndex = 0 is a special value indicating the new node has\r\n // no corresponding old node.\r\n // used for determining longest stable subsequence\r\n const newIndexToOldIndexMap = new Array(toBePatched);\r\n for (i = 0; i < toBePatched; i++)\r\n newIndexToOldIndexMap[i] = 0;\r\n for (i = s1; i <= e1; i++) {\r\n const prevChild = c1[i];\r\n if (patched >= toBePatched) {\r\n // all new children have been patched so this can only be a removal\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n continue;\r\n }\r\n let newIndex;\r\n if (prevChild.key != null) {\r\n newIndex = keyToNewIndexMap.get(prevChild.key);\r\n }\r\n else {\r\n // key-less node, try to locate a key-less node of the same type\r\n for (j = s2; j <= e2; j++) {\r\n if (newIndexToOldIndexMap[j - s2] === 0 &&\r\n isSameVNodeType(prevChild, c2[j])) {\r\n newIndex = j;\r\n break;\r\n }\r\n }\r\n }\r\n if (newIndex === undefined) {\r\n unmount(prevChild, parentComponent, parentSuspense, true);\r\n }\r\n else {\r\n newIndexToOldIndexMap[newIndex - s2] = i + 1;\r\n if (newIndex >= maxNewIndexSoFar) {\r\n maxNewIndexSoFar = newIndex;\r\n }\r\n else {\r\n moved = true;\r\n }\r\n patch(prevChild, c2[newIndex], container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n patched++;\r\n }\r\n }\r\n // 5.3 move and mount\r\n // generate longest stable subsequence only when nodes have moved\r\n const increasingNewIndexSequence = moved\r\n ? getSequence(newIndexToOldIndexMap)\r\n : EMPTY_ARR;\r\n j = increasingNewIndexSequence.length - 1;\r\n // looping backwards so that we can use last patched node as anchor\r\n for (i = toBePatched - 1; i >= 0; i--) {\r\n const nextIndex = s2 + i;\r\n const nextChild = c2[nextIndex];\r\n const anchor = nextIndex + 1 < l2 ? c2[nextIndex + 1].el : parentAnchor;\r\n if (newIndexToOldIndexMap[i] === 0) {\r\n // mount new\r\n patch(null, nextChild, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n else if (moved) {\r\n // move if:\r\n // There is no stable subsequence (e.g. a reverse)\r\n // OR current node is not among the stable sequence\r\n if (j < 0 || i !== increasingNewIndexSequence[j]) {\r\n move(nextChild, container, anchor, 2 /* REORDER */);\r\n }\r\n else {\r\n j--;\r\n }\r\n }\r\n }\r\n }\r\n };\r\n const move = (vnode, container, anchor, moveType, parentSuspense = null) => {\r\n const { el, type, transition, children, shapeFlag } = vnode;\r\n if (shapeFlag & 6 /* COMPONENT */) {\r\n move(vnode.component.subTree, container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.suspense.move(container, anchor, moveType);\r\n return;\r\n }\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n type.move(vnode, container, anchor, internals);\r\n return;\r\n }\r\n if (type === Fragment) {\r\n hostInsert(el, container, anchor);\r\n for (let i = 0; i < children.length; i++) {\r\n move(children[i], container, anchor, moveType);\r\n }\r\n hostInsert(vnode.anchor, container, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n moveStaticNode(vnode, container, anchor);\r\n return;\r\n }\r\n // single nodes\r\n const needTransition = moveType !== 2 /* REORDER */ &&\r\n shapeFlag & 1 /* ELEMENT */ &&\r\n transition;\r\n if (needTransition) {\r\n if (moveType === 0 /* ENTER */) {\r\n transition.beforeEnter(el);\r\n hostInsert(el, container, anchor);\r\n queuePostRenderEffect(() => transition.enter(el), parentSuspense);\r\n }\r\n else {\r\n const { leave, delayLeave, afterLeave } = transition;\r\n const remove = () => hostInsert(el, container, anchor);\r\n const performLeave = () => {\r\n leave(el, () => {\r\n remove();\r\n afterLeave && afterLeave();\r\n });\r\n };\r\n if (delayLeave) {\r\n delayLeave(el, remove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n }\r\n else {\r\n hostInsert(el, container, anchor);\r\n }\r\n };\r\n const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => {\r\n const { type, props, ref, children, dynamicChildren, shapeFlag, patchFlag, dirs } = vnode;\r\n // unset ref\r\n if (ref != null) {\r\n setRef(ref, null, parentSuspense, vnode, true);\r\n }\r\n if (shapeFlag & 256 /* COMPONENT_SHOULD_KEEP_ALIVE */) {\r\n parentComponent.ctx.deactivate(vnode);\r\n return;\r\n }\r\n const shouldInvokeDirs = shapeFlag & 1 /* ELEMENT */ && dirs;\r\n const shouldInvokeVnodeHook = !isAsyncWrapper(vnode);\r\n let vnodeHook;\r\n if (shouldInvokeVnodeHook &&\r\n (vnodeHook = props && props.onVnodeBeforeUnmount)) {\r\n invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n }\r\n if (shapeFlag & 6 /* COMPONENT */) {\r\n unmountComponent(vnode.component, parentSuspense, doRemove);\r\n }\r\n else {\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n vnode.suspense.unmount(parentSuspense, doRemove);\r\n return;\r\n }\r\n if (shouldInvokeDirs) {\r\n invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount');\r\n }\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n vnode.type.remove(vnode, parentComponent, parentSuspense, optimized, internals, doRemove);\r\n }\r\n else if (dynamicChildren &&\r\n // #1153: fast path should not be taken for non-stable (v-for) fragments\r\n (type !== Fragment ||\r\n (patchFlag > 0 && patchFlag & 64 /* STABLE_FRAGMENT */))) {\r\n // fast path for block nodes: only need to unmount dynamic children.\r\n unmountChildren(dynamicChildren, parentComponent, parentSuspense, false, true);\r\n }\r\n else if ((type === Fragment &&\r\n patchFlag &\r\n (128 /* KEYED_FRAGMENT */ | 256 /* UNKEYED_FRAGMENT */)) ||\r\n (!optimized && shapeFlag & 16 /* ARRAY_CHILDREN */)) {\r\n unmountChildren(children, parentComponent, parentSuspense);\r\n }\r\n if (doRemove) {\r\n remove(vnode);\r\n }\r\n }\r\n if ((shouldInvokeVnodeHook &&\r\n (vnodeHook = props && props.onVnodeUnmounted)) ||\r\n shouldInvokeDirs) {\r\n queuePostRenderEffect(() => {\r\n vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);\r\n shouldInvokeDirs &&\r\n invokeDirectiveHook(vnode, null, parentComponent, 'unmounted');\r\n }, parentSuspense);\r\n }\r\n };\r\n const remove = vnode => {\r\n const { type, el, anchor, transition } = vnode;\r\n if (type === Fragment) {\r\n removeFragment(el, anchor);\r\n return;\r\n }\r\n if (type === Static) {\r\n removeStaticNode(vnode);\r\n return;\r\n }\r\n const performRemove = () => {\r\n hostRemove(el);\r\n if (transition && !transition.persisted && transition.afterLeave) {\r\n transition.afterLeave();\r\n }\r\n };\r\n if (vnode.shapeFlag & 1 /* ELEMENT */ &&\r\n transition &&\r\n !transition.persisted) {\r\n const { leave, delayLeave } = transition;\r\n const performLeave = () => leave(el, performRemove);\r\n if (delayLeave) {\r\n delayLeave(vnode.el, performRemove, performLeave);\r\n }\r\n else {\r\n performLeave();\r\n }\r\n }\r\n else {\r\n performRemove();\r\n }\r\n };\r\n const removeFragment = (cur, end) => {\r\n // For fragments, directly remove all contained DOM nodes.\r\n // (fragment child nodes cannot have transition)\r\n let next;\r\n while (cur !== end) {\r\n next = hostNextSibling(cur);\r\n hostRemove(cur);\r\n cur = next;\r\n }\r\n hostRemove(end);\r\n };\r\n const unmountComponent = (instance, parentSuspense, doRemove) => {\r\n if (false) {}\r\n const { bum, scope, update, subTree, um } = instance;\r\n // beforeUnmount hook\r\n if (bum) {\r\n invokeArrayFns(bum);\r\n }\r\n // stop effects in component scope\r\n scope.stop();\r\n // update may be null if a component is unmounted before its async\r\n // setup has resolved.\r\n if (update) {\r\n // so that scheduler will no longer invoke it\r\n update.active = false;\r\n unmount(subTree, instance, parentSuspense, doRemove);\r\n }\r\n // unmounted hook\r\n if (um) {\r\n queuePostRenderEffect(um, parentSuspense);\r\n }\r\n queuePostRenderEffect(() => {\r\n instance.isUnmounted = true;\r\n }, parentSuspense);\r\n // A component with async dep inside a pending suspense is unmounted before\r\n // its async dep resolves. This should remove the dep from the suspense, and\r\n // cause the suspense to resolve immediately if that was the last dep.\r\n if (parentSuspense &&\r\n parentSuspense.pendingBranch &&\r\n !parentSuspense.isUnmounted &&\r\n instance.asyncDep &&\r\n !instance.asyncResolved &&\r\n instance.suspenseId === parentSuspense.pendingId) {\r\n parentSuspense.deps--;\r\n if (parentSuspense.deps === 0) {\r\n parentSuspense.resolve();\r\n }\r\n }\r\n if (false) {}\r\n };\r\n const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => {\r\n for (let i = start; i < children.length; i++) {\r\n unmount(children[i], parentComponent, parentSuspense, doRemove, optimized);\r\n }\r\n };\r\n const getNextHostNode = vnode => {\r\n if (vnode.shapeFlag & 6 /* COMPONENT */) {\r\n return getNextHostNode(vnode.component.subTree);\r\n }\r\n if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n return vnode.suspense.next();\r\n }\r\n return hostNextSibling((vnode.anchor || vnode.el));\r\n };\r\n const render = (vnode, container, isSVG) => {\r\n if (vnode == null) {\r\n if (container._vnode) {\r\n unmount(container._vnode, null, null, true);\r\n }\r\n }\r\n else {\r\n patch(container._vnode || null, vnode, container, null, null, null, isSVG);\r\n }\r\n flushPostFlushCbs();\r\n container._vnode = vnode;\r\n };\r\n const internals = {\r\n p: patch,\r\n um: unmount,\r\n m: move,\r\n r: remove,\r\n mt: mountComponent,\r\n mc: mountChildren,\r\n pc: patchChildren,\r\n pbc: patchBlockChildren,\r\n n: getNextHostNode,\r\n o: options\r\n };\r\n let hydrate;\r\n let hydrateNode;\r\n if (createHydrationFns) {\r\n [hydrate, hydrateNode] = createHydrationFns(internals);\r\n }\r\n return {\r\n render,\r\n hydrate,\r\n createApp: createAppAPI(render, hydrate)\r\n };\r\n}\r\nfunction setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {\r\n if (shared_esm_bundler_isArray(rawRef)) {\r\n rawRef.forEach((r, i) => setRef(r, oldRawRef && (shared_esm_bundler_isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));\r\n return;\r\n }\r\n if (isAsyncWrapper(vnode) && !isUnmount) {\r\n // when mounting async components, nothing needs to be done,\r\n // because the template ref is forwarded to inner component\r\n return;\r\n }\r\n const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */\r\n ? getExposeProxy(vnode.component) || vnode.component.proxy\r\n : vnode.el;\r\n const value = isUnmount ? null : refValue;\r\n const { i: owner, r: ref } = rawRef;\r\n if (false) {}\r\n const oldRef = oldRawRef && oldRawRef.r;\r\n const refs = owner.refs === EMPTY_OBJ ? (owner.refs = {}) : owner.refs;\r\n const setupState = owner.setupState;\r\n // dynamic ref changed. unset old ref\r\n if (oldRef != null && oldRef !== ref) {\r\n if (shared_esm_bundler_isString(oldRef)) {\r\n refs[oldRef] = null;\r\n if (shared_esm_bundler_hasOwn(setupState, oldRef)) {\r\n setupState[oldRef] = null;\r\n }\r\n }\r\n else if (isRef(oldRef)) {\r\n oldRef.value = null;\r\n }\r\n }\r\n if (shared_esm_bundler_isString(ref)) {\r\n const doSet = () => {\r\n {\r\n refs[ref] = value;\r\n }\r\n if (shared_esm_bundler_hasOwn(setupState, ref)) {\r\n setupState[ref] = value;\r\n }\r\n };\r\n // #1789: for non-null values, set them after render\r\n // null values means this is unmount and it should not overwrite another\r\n // ref with the same key\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isRef(ref)) {\r\n const doSet = () => {\r\n ref.value = value;\r\n };\r\n if (value) {\r\n doSet.id = -1;\r\n queuePostRenderEffect(doSet, parentSuspense);\r\n }\r\n else {\r\n doSet();\r\n }\r\n }\r\n else if (isFunction(ref)) {\r\n callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);\r\n }\r\n else if ((false)) {}\r\n}\r\nfunction invokeVNodeHook(hook, instance, vnode, prevVNode = null) {\r\n callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [\r\n vnode,\r\n prevVNode\r\n ]);\r\n}\r\n/**\r\n * #1156\r\n * When a component is HMR-enabled, we need to make sure that all static nodes\r\n * inside a block also inherit the DOM element from the previous tree so that\r\n * HMR updates (which are full updates) can retrieve the element for patching.\r\n *\r\n * #2080\r\n * Inside keyed `template` fragment static children, if a fragment is moved,\r\n * the children will always be moved. Therefore, in order to ensure correct move\r\n * position, el should be inherited from previous nodes.\r\n */\r\nfunction traverseStaticChildren(n1, n2, shallow = false) {\r\n const ch1 = n1.children;\r\n const ch2 = n2.children;\r\n if (shared_esm_bundler_isArray(ch1) && shared_esm_bundler_isArray(ch2)) {\r\n for (let i = 0; i < ch1.length; i++) {\r\n // this is only called in the optimized path so array children are\r\n // guaranteed to be vnodes\r\n const c1 = ch1[i];\r\n let c2 = ch2[i];\r\n if (c2.shapeFlag & 1 /* ELEMENT */ && !c2.dynamicChildren) {\r\n if (c2.patchFlag <= 0 || c2.patchFlag === 32 /* HYDRATE_EVENTS */) {\r\n c2 = ch2[i] = cloneIfMounted(ch2[i]);\r\n c2.el = c1.el;\r\n }\r\n if (!shallow)\r\n traverseStaticChildren(c1, c2);\r\n }\r\n // also inherit for comment nodes, but not placeholders (e.g. v-if which\r\n // would have received .el during block patch)\r\n if (false) {}\r\n }\r\n }\r\n}\r\n// https://en.wikipedia.org/wiki/Longest_increasing_subsequence\r\nfunction getSequence(arr) {\r\n const p = arr.slice();\r\n const result = [0];\r\n let i, j, u, v, c;\r\n const len = arr.length;\r\n for (i = 0; i < len; i++) {\r\n const arrI = arr[i];\r\n if (arrI !== 0) {\r\n j = result[result.length - 1];\r\n if (arr[j] < arrI) {\r\n p[i] = j;\r\n result.push(i);\r\n continue;\r\n }\r\n u = 0;\r\n v = result.length - 1;\r\n while (u < v) {\r\n c = (u + v) >> 1;\r\n if (arr[result[c]] < arrI) {\r\n u = c + 1;\r\n }\r\n else {\r\n v = c;\r\n }\r\n }\r\n if (arrI < arr[result[u]]) {\r\n if (u > 0) {\r\n p[i] = result[u - 1];\r\n }\r\n result[u] = i;\r\n }\r\n }\r\n }\r\n u = result.length;\r\n v = result[u - 1];\r\n while (u-- > 0) {\r\n result[u] = v;\r\n v = p[v];\r\n }\r\n return result;\r\n}\n\nconst isTeleport = (type) => type.__isTeleport;\r\nconst isTeleportDisabled = (props) => props && (props.disabled || props.disabled === '');\r\nconst isTargetSVG = (target) => typeof SVGElement !== 'undefined' && target instanceof SVGElement;\r\nconst resolveTarget = (props, select) => {\r\n const targetSelector = props && props.to;\r\n if (shared_esm_bundler_isString(targetSelector)) {\r\n if (!select) {\r\n ( false) &&\r\n 0;\r\n return null;\r\n }\r\n else {\r\n const target = select(targetSelector);\r\n if (!target) {\r\n ( false) &&\r\n 0;\r\n }\r\n return target;\r\n }\r\n }\r\n else {\r\n if (false) {}\r\n return targetSelector;\r\n }\r\n};\r\nconst TeleportImpl = {\r\n __isTeleport: true,\r\n process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {\r\n const { mc: mountChildren, pc: patchChildren, pbc: patchBlockChildren, o: { insert, querySelector, createText, createComment } } = internals;\r\n const disabled = isTeleportDisabled(n2.props);\r\n let { shapeFlag, children, dynamicChildren } = n2;\r\n // #3302\r\n // HMR updated, force full diff\r\n if (false) {}\r\n if (n1 == null) {\r\n // insert anchors in the main view\r\n const placeholder = (n2.el = ( false)\r\n ? 0\r\n : createText(''));\r\n const mainAnchor = (n2.anchor = ( false)\r\n ? 0\r\n : createText(''));\r\n insert(placeholder, container, anchor);\r\n insert(mainAnchor, container, anchor);\r\n const target = (n2.target = resolveTarget(n2.props, querySelector));\r\n const targetAnchor = (n2.targetAnchor = createText(''));\r\n if (target) {\r\n insert(targetAnchor, target);\r\n // #2652 we could be teleporting from a non-SVG tree into an SVG tree\r\n isSVG = isSVG || isTargetSVG(target);\r\n }\r\n else if (false) {}\r\n const mount = (container, anchor) => {\r\n // Teleport *always* has Array children. This is enforced in both the\r\n // compiler and vnode children normalization.\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n mountChildren(children, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);\r\n }\r\n };\r\n if (disabled) {\r\n mount(container, mainAnchor);\r\n }\r\n else if (target) {\r\n mount(target, targetAnchor);\r\n }\r\n }\r\n else {\r\n // update content\r\n n2.el = n1.el;\r\n const mainAnchor = (n2.anchor = n1.anchor);\r\n const target = (n2.target = n1.target);\r\n const targetAnchor = (n2.targetAnchor = n1.targetAnchor);\r\n const wasDisabled = isTeleportDisabled(n1.props);\r\n const currentContainer = wasDisabled ? container : target;\r\n const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;\r\n isSVG = isSVG || isTargetSVG(target);\r\n if (dynamicChildren) {\r\n // fast path when the teleport happens to be a block root\r\n patchBlockChildren(n1.dynamicChildren, dynamicChildren, currentContainer, parentComponent, parentSuspense, isSVG, slotScopeIds);\r\n // even in block tree mode we need to make sure all root-level nodes\r\n // in the teleport inherit previous DOM references so that they can\r\n // be moved in future patches.\r\n traverseStaticChildren(n1, n2, true);\r\n }\r\n else if (!optimized) {\r\n patchChildren(n1, n2, currentContainer, currentAnchor, parentComponent, parentSuspense, isSVG, slotScopeIds, false);\r\n }\r\n if (disabled) {\r\n if (!wasDisabled) {\r\n // enabled -> disabled\r\n // move into main container\r\n moveTeleport(n2, container, mainAnchor, internals, 1 /* TOGGLE */);\r\n }\r\n }\r\n else {\r\n // target changed\r\n if ((n2.props && n2.props.to) !== (n1.props && n1.props.to)) {\r\n const nextTarget = (n2.target = resolveTarget(n2.props, querySelector));\r\n if (nextTarget) {\r\n moveTeleport(n2, nextTarget, null, internals, 0 /* TARGET_CHANGE */);\r\n }\r\n else if ((false)) {}\r\n }\r\n else if (wasDisabled) {\r\n // disabled -> enabled\r\n // move into teleport target\r\n moveTeleport(n2, target, targetAnchor, internals, 1 /* TOGGLE */);\r\n }\r\n }\r\n }\r\n },\r\n remove(vnode, parentComponent, parentSuspense, optimized, { um: unmount, o: { remove: hostRemove } }, doRemove) {\r\n const { shapeFlag, children, anchor, targetAnchor, target, props } = vnode;\r\n if (target) {\r\n hostRemove(targetAnchor);\r\n }\r\n // an unmounted teleport should always remove its children if not disabled\r\n if (doRemove || !isTeleportDisabled(props)) {\r\n hostRemove(anchor);\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n unmount(child, parentComponent, parentSuspense, true, !!child.dynamicChildren);\r\n }\r\n }\r\n }\r\n },\r\n move: moveTeleport,\r\n hydrate: hydrateTeleport\r\n};\r\nfunction moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }, moveType = 2 /* REORDER */) {\r\n // move target anchor if this is a target change.\r\n if (moveType === 0 /* TARGET_CHANGE */) {\r\n insert(vnode.targetAnchor, container, parentAnchor);\r\n }\r\n const { el, anchor, shapeFlag, children, props } = vnode;\r\n const isReorder = moveType === 2 /* REORDER */;\r\n // move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(el, container, parentAnchor);\r\n }\r\n // if this is a re-order and teleport is enabled (content is in target)\r\n // do not move children. So the opposite is: only move children if this\r\n // is not a reorder, or the teleport is disabled\r\n if (!isReorder || isTeleportDisabled(props)) {\r\n // Teleport has either Array children or no children.\r\n if (shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n for (let i = 0; i < children.length; i++) {\r\n move(children[i], container, parentAnchor, 2 /* REORDER */);\r\n }\r\n }\r\n }\r\n // move main view anchor if this is a re-order.\r\n if (isReorder) {\r\n insert(anchor, container, parentAnchor);\r\n }\r\n}\r\nfunction hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector } }, hydrateChildren) {\r\n const target = (vnode.target = resolveTarget(vnode.props, querySelector));\r\n if (target) {\r\n // if multiple teleports rendered to the same target element, we need to\r\n // pick up from where the last teleport finished instead of the first node\r\n const targetNode = target._lpa || target.firstChild;\r\n if (vnode.shapeFlag & 16 /* ARRAY_CHILDREN */) {\r\n if (isTeleportDisabled(vnode.props)) {\r\n vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);\r\n vnode.targetAnchor = targetNode;\r\n }\r\n else {\r\n vnode.anchor = nextSibling(node);\r\n vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);\r\n }\r\n target._lpa =\r\n vnode.targetAnchor && nextSibling(vnode.targetAnchor);\r\n }\r\n }\r\n return vnode.anchor && nextSibling(vnode.anchor);\r\n}\r\n// Force-casted public typing for h and TSX props inference\r\nconst Teleport = TeleportImpl;\n\nconst COMPONENTS = 'components';\r\nconst DIRECTIVES = 'directives';\r\n/**\r\n * @private\r\n */\r\nfunction resolveComponent(name, maybeSelfReference) {\r\n return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;\r\n}\r\nconst NULL_DYNAMIC_COMPONENT = Symbol();\r\n/**\r\n * @private\r\n */\r\nfunction resolveDynamicComponent(component) {\r\n if (shared_esm_bundler_isString(component)) {\r\n return resolveAsset(COMPONENTS, component, false) || component;\r\n }\r\n else {\r\n // invalid types will fallthrough to createVNode and raise warning\r\n return (component || NULL_DYNAMIC_COMPONENT);\r\n }\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction resolveDirective(name) {\r\n return resolveAsset(DIRECTIVES, name);\r\n}\r\n// implementation\r\nfunction resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {\r\n const instance = currentRenderingInstance || currentInstance;\r\n if (instance) {\r\n const Component = instance.type;\r\n // explicit self name has highest priority\r\n if (type === COMPONENTS) {\r\n const selfName = getComponentName(Component);\r\n if (selfName &&\r\n (selfName === name ||\r\n selfName === camelize(name) ||\r\n selfName === shared_esm_bundler_capitalize(camelize(name)))) {\r\n return Component;\r\n }\r\n }\r\n const res = \r\n // local registration\r\n // check instance[type] first which is resolved for options API\r\n resolve(instance[type] || Component[type], name) ||\r\n // global registration\r\n resolve(instance.appContext[type], name);\r\n if (!res && maybeSelfReference) {\r\n // fallback to implicit self-reference\r\n return Component;\r\n }\r\n if (false) {}\r\n return res;\r\n }\r\n else if ((false)) {}\r\n}\r\nfunction resolve(registry, name) {\r\n return (registry &&\r\n (registry[name] ||\r\n registry[camelize(name)] ||\r\n registry[shared_esm_bundler_capitalize(camelize(name))]));\r\n}\n\nconst Fragment = Symbol(( false) ? 0 : undefined);\r\nconst Text = Symbol(( false) ? 0 : undefined);\r\nconst Comment = Symbol(( false) ? 0 : undefined);\r\nconst Static = Symbol(( false) ? 0 : undefined);\r\n// Since v-if and v-for are the two possible ways node structure can dynamically\r\n// change, once we consider v-if branches and each v-for fragment a block, we\r\n// can divide a template into nested blocks, and within each block the node\r\n// structure would be stable. This allows us to skip most children diffing\r\n// and only worry about the dynamic nodes (indicated by patch flags).\r\nconst blockStack = [];\r\nlet currentBlock = null;\r\n/**\r\n * Open a block.\r\n * This must be called before `createBlock`. It cannot be part of `createBlock`\r\n * because the children of the block are evaluated before `createBlock` itself\r\n * is called. The generated code typically looks like this:\r\n *\r\n * ```js\r\n * function render() {\r\n * return (openBlock(),createBlock('div', null, [...]))\r\n * }\r\n * ```\r\n * disableTracking is true when creating a v-for fragment block, since a v-for\r\n * fragment always diffs its children.\r\n *\r\n * @private\r\n */\r\nfunction openBlock(disableTracking = false) {\r\n blockStack.push((currentBlock = disableTracking ? null : []));\r\n}\r\nfunction closeBlock() {\r\n blockStack.pop();\r\n currentBlock = blockStack[blockStack.length - 1] || null;\r\n}\r\n// Whether we should be tracking dynamic child nodes inside a block.\r\n// Only tracks when this value is > 0\r\n// We are not using a simple boolean because this value may need to be\r\n// incremented/decremented by nested usage of v-once (see below)\r\nlet isBlockTreeEnabled = 1;\r\n/**\r\n * Block tracking sometimes needs to be disabled, for example during the\r\n * creation of a tree that needs to be cached by v-once. The compiler generates\r\n * code like this:\r\n *\r\n * ``` js\r\n * _cache[1] || (\r\n * setBlockTracking(-1),\r\n * _cache[1] = createVNode(...),\r\n * setBlockTracking(1),\r\n * _cache[1]\r\n * )\r\n * ```\r\n *\r\n * @private\r\n */\r\nfunction setBlockTracking(value) {\r\n isBlockTreeEnabled += value;\r\n}\r\nfunction setupBlock(vnode) {\r\n // save current block children on the block vnode\r\n vnode.dynamicChildren =\r\n isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null;\r\n // close block\r\n closeBlock();\r\n // a block is always going to be patched, so track it as a child of its\r\n // parent block\r\n if (isBlockTreeEnabled > 0 && currentBlock) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) {\r\n return setupBlock(createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, true /* isBlock */));\r\n}\r\n/**\r\n * Create a block root vnode. Takes the same exact arguments as `createVNode`.\r\n * A block root keeps track of dynamic nodes within the block in the\r\n * `dynamicChildren` array.\r\n *\r\n * @private\r\n */\r\nfunction createBlock(type, props, children, patchFlag, dynamicProps) {\r\n return setupBlock(createVNode(type, props, children, patchFlag, dynamicProps, true /* isBlock: prevent a block from tracking itself */));\r\n}\r\nfunction isVNode(value) {\r\n return value ? value.__v_isVNode === true : false;\r\n}\r\nfunction isSameVNodeType(n1, n2) {\r\n if (false) {}\r\n return n1.type === n2.type && n1.key === n2.key;\r\n}\r\nlet vnodeArgsTransformer;\r\n/**\r\n * Internal API for registering an arguments transform for createVNode\r\n * used for creating stubs in the test-utils\r\n * It is *internal* but needs to be exposed for test-utils to pick up proper\r\n * typings\r\n */\r\nfunction transformVNodeArgs(transformer) {\r\n vnodeArgsTransformer = transformer;\r\n}\r\nconst createVNodeWithArgsTransform = (...args) => {\r\n return _createVNode(...(vnodeArgsTransformer\r\n ? vnodeArgsTransformer(args, currentRenderingInstance)\r\n : args));\r\n};\r\nconst InternalObjectKey = `__vInternal`;\r\nconst normalizeKey = ({ key }) => key != null ? key : null;\r\nconst normalizeRef = ({ ref }) => {\r\n return (ref != null\r\n ? shared_esm_bundler_isString(ref) || isRef(ref) || isFunction(ref)\r\n ? { i: currentRenderingInstance, r: ref }\r\n : ref\r\n : null);\r\n};\r\nfunction createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1 /* ELEMENT */, isBlockNode = false, needFullChildrenNormalization = false) {\r\n const vnode = {\r\n __v_isVNode: true,\r\n __v_skip: true,\r\n type,\r\n props,\r\n key: props && normalizeKey(props),\r\n ref: props && normalizeRef(props),\r\n scopeId: currentScopeId,\r\n slotScopeIds: null,\r\n children,\r\n component: null,\r\n suspense: null,\r\n ssContent: null,\r\n ssFallback: null,\r\n dirs: null,\r\n transition: null,\r\n el: null,\r\n anchor: null,\r\n target: null,\r\n targetAnchor: null,\r\n staticCount: 0,\r\n shapeFlag,\r\n patchFlag,\r\n dynamicProps,\r\n dynamicChildren: null,\r\n appContext: null\r\n };\r\n if (needFullChildrenNormalization) {\r\n normalizeChildren(vnode, children);\r\n // normalize suspense children\r\n if (shapeFlag & 128 /* SUSPENSE */) {\r\n type.normalize(vnode);\r\n }\r\n }\r\n else if (children) {\r\n // compiled element vnode - if children is passed, only possible types are\r\n // string or Array.\r\n vnode.shapeFlag |= shared_esm_bundler_isString(children)\r\n ? 8 /* TEXT_CHILDREN */\r\n : 16 /* ARRAY_CHILDREN */;\r\n }\r\n // validate key\r\n if (false) {}\r\n // track vnode for block tree\r\n if (isBlockTreeEnabled > 0 &&\r\n // avoid a block node from tracking itself\r\n !isBlockNode &&\r\n // has current parent block\r\n currentBlock &&\r\n // presence of a patch flag indicates this node needs patching on updates.\r\n // component nodes also should always be patched, because even if the\r\n // component doesn't need to update, it needs to persist the instance on to\r\n // the next vnode so that it can be properly unmounted later.\r\n (vnode.patchFlag > 0 || shapeFlag & 6 /* COMPONENT */) &&\r\n // the EVENTS flag is only for hydration and if it is the only flag, the\r\n // vnode should not be considered dynamic due to handler caching.\r\n vnode.patchFlag !== 32 /* HYDRATE_EVENTS */) {\r\n currentBlock.push(vnode);\r\n }\r\n return vnode;\r\n}\r\nconst createVNode = (( false) ? 0 : _createVNode);\r\nfunction _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {\r\n if (!type || type === NULL_DYNAMIC_COMPONENT) {\r\n if (false) {}\r\n type = Comment;\r\n }\r\n if (isVNode(type)) {\r\n // createVNode receiving an existing vnode. This happens in cases like\r\n // <component :is=\"vnode\"/>\r\n // #2078 make sure to merge refs during the clone instead of overwriting it\r\n const cloned = cloneVNode(type, props, true /* mergeRef: true */);\r\n if (children) {\r\n normalizeChildren(cloned, children);\r\n }\r\n return cloned;\r\n }\r\n // class component normalization.\r\n if (isClassComponent(type)) {\r\n type = type.__vccOpts;\r\n }\r\n // class & style normalization.\r\n if (props) {\r\n // for reactive or proxy objects, we need to clone it to enable mutation.\r\n props = guardReactiveProps(props);\r\n let { class: klass, style } = props;\r\n if (klass && !shared_esm_bundler_isString(klass)) {\r\n props.class = normalizeClass(klass);\r\n }\r\n if (shared_esm_bundler_isObject(style)) {\r\n // reactive state objects need to be cloned since they are likely to be\r\n // mutated\r\n if (isProxy(style) && !shared_esm_bundler_isArray(style)) {\r\n style = shared_esm_bundler_extend({}, style);\r\n }\r\n props.style = normalizeStyle(style);\r\n }\r\n }\r\n // encode the vnode type information into a bitmap\r\n const shapeFlag = shared_esm_bundler_isString(type)\r\n ? 1 /* ELEMENT */\r\n : isSuspense(type)\r\n ? 128 /* SUSPENSE */\r\n : isTeleport(type)\r\n ? 64 /* TELEPORT */\r\n : shared_esm_bundler_isObject(type)\r\n ? 4 /* STATEFUL_COMPONENT */\r\n : isFunction(type)\r\n ? 2 /* FUNCTIONAL_COMPONENT */\r\n : 0;\r\n if (false) {}\r\n return createBaseVNode(type, props, children, patchFlag, dynamicProps, shapeFlag, isBlockNode, true);\r\n}\r\nfunction guardReactiveProps(props) {\r\n if (!props)\r\n return null;\r\n return isProxy(props) || InternalObjectKey in props\r\n ? shared_esm_bundler_extend({}, props)\r\n : props;\r\n}\r\nfunction cloneVNode(vnode, extraProps, mergeRef = false) {\r\n // This is intentionally NOT using spread or extend to avoid the runtime\r\n // key enumeration cost.\r\n const { props, ref, patchFlag, children } = vnode;\r\n const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props;\r\n const cloned = {\r\n __v_isVNode: true,\r\n __v_skip: true,\r\n type: vnode.type,\r\n props: mergedProps,\r\n key: mergedProps && normalizeKey(mergedProps),\r\n ref: extraProps && extraProps.ref\r\n ? // #2078 in the case of <component :is=\"vnode\" ref=\"extra\"/>\r\n // if the vnode itself already has a ref, cloneVNode will need to merge\r\n // the refs so the single vnode can be set on multiple refs\r\n mergeRef && ref\r\n ? shared_esm_bundler_isArray(ref)\r\n ? ref.concat(normalizeRef(extraProps))\r\n : [ref, normalizeRef(extraProps)]\r\n : normalizeRef(extraProps)\r\n : ref,\r\n scopeId: vnode.scopeId,\r\n slotScopeIds: vnode.slotScopeIds,\r\n children: false\r\n ? 0\r\n : children,\r\n target: vnode.target,\r\n targetAnchor: vnode.targetAnchor,\r\n staticCount: vnode.staticCount,\r\n shapeFlag: vnode.shapeFlag,\r\n // if the vnode is cloned with extra props, we can no longer assume its\r\n // existing patch flag to be reliable and need to add the FULL_PROPS flag.\r\n // note: perserve flag for fragments since they use the flag for children\r\n // fast paths only.\r\n patchFlag: extraProps && vnode.type !== Fragment\r\n ? patchFlag === -1 // hoisted node\r\n ? 16 /* FULL_PROPS */\r\n : patchFlag | 16 /* FULL_PROPS */\r\n : patchFlag,\r\n dynamicProps: vnode.dynamicProps,\r\n dynamicChildren: vnode.dynamicChildren,\r\n appContext: vnode.appContext,\r\n dirs: vnode.dirs,\r\n transition: vnode.transition,\r\n // These should technically only be non-null on mounted VNodes. However,\r\n // they *should* be copied for kept-alive vnodes. So we just always copy\r\n // them since them being non-null during a mount doesn't affect the logic as\r\n // they will simply be overwritten.\r\n component: vnode.component,\r\n suspense: vnode.suspense,\r\n ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),\r\n ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),\r\n el: vnode.el,\r\n anchor: vnode.anchor\r\n };\r\n return cloned;\r\n}\r\n/**\r\n * Dev only, for HMR of hoisted vnodes reused in v-for\r\n * https://github.com/vitejs/vite/issues/2022\r\n */\r\nfunction deepCloneVNode(vnode) {\r\n const cloned = cloneVNode(vnode);\r\n if (isArray(vnode.children)) {\r\n cloned.children = vnode.children.map(deepCloneVNode);\r\n }\r\n return cloned;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createTextVNode(text = ' ', flag = 0) {\r\n return createVNode(Text, null, text, flag);\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createStaticVNode(content, numberOfNodes) {\r\n // A static vnode can contain multiple stringified elements, and the number\r\n // of elements is necessary for hydration.\r\n const vnode = createVNode(Static, null, content);\r\n vnode.staticCount = numberOfNodes;\r\n return vnode;\r\n}\r\n/**\r\n * @private\r\n */\r\nfunction createCommentVNode(text = '', \r\n// when used as the v-else branch, the comment node must be created as a\r\n// block to ensure correct updates.\r\nasBlock = false) {\r\n return asBlock\r\n ? (openBlock(), createBlock(Comment, null, text))\r\n : createVNode(Comment, null, text);\r\n}\r\nfunction normalizeVNode(child) {\r\n if (child == null || typeof child === 'boolean') {\r\n // empty placeholder\r\n return createVNode(Comment);\r\n }\r\n else if (shared_esm_bundler_isArray(child)) {\r\n // fragment\r\n return createVNode(Fragment, null, \r\n // #3666, avoid reference pollution when reusing vnode\r\n child.slice());\r\n }\r\n else if (typeof child === 'object') {\r\n // already vnode, this should be the most common since compiled templates\r\n // always produce all-vnode children arrays\r\n return cloneIfMounted(child);\r\n }\r\n else {\r\n // strings and numbers\r\n return createVNode(Text, null, String(child));\r\n }\r\n}\r\n// optimized normalization for template-compiled render fns\r\nfunction cloneIfMounted(child) {\r\n return child.el === null || child.memo ? child : cloneVNode(child);\r\n}\r\nfunction normalizeChildren(vnode, children) {\r\n let type = 0;\r\n const { shapeFlag } = vnode;\r\n if (children == null) {\r\n children = null;\r\n }\r\n else if (shared_esm_bundler_isArray(children)) {\r\n type = 16 /* ARRAY_CHILDREN */;\r\n }\r\n else if (typeof children === 'object') {\r\n if (shapeFlag & (1 /* ELEMENT */ | 64 /* TELEPORT */)) {\r\n // Normalize slot to plain children for plain element and Teleport\r\n const slot = children.default;\r\n if (slot) {\r\n // _c marker is added by withCtx() indicating this is a compiled slot\r\n slot._c && (slot._d = false);\r\n normalizeChildren(vnode, slot());\r\n slot._c && (slot._d = true);\r\n }\r\n return;\r\n }\r\n else {\r\n type = 32 /* SLOTS_CHILDREN */;\r\n const slotFlag = children._;\r\n if (!slotFlag && !(InternalObjectKey in children)) {\r\n children._ctx = currentRenderingInstance;\r\n }\r\n else if (slotFlag === 3 /* FORWARDED */ && currentRenderingInstance) {\r\n // a child component receives forwarded slots from the parent.\r\n // its slot type is determined by its parent's slot type.\r\n if (currentRenderingInstance.slots._ === 1 /* STABLE */) {\r\n children._ = 1 /* STABLE */;\r\n }\r\n else {\r\n children._ = 2 /* DYNAMIC */;\r\n vnode.patchFlag |= 1024 /* DYNAMIC_SLOTS */;\r\n }\r\n }\r\n }\r\n }\r\n else if (isFunction(children)) {\r\n children = { default: children, _ctx: currentRenderingInstance };\r\n type = 32 /* SLOTS_CHILDREN */;\r\n }\r\n else {\r\n children = String(children);\r\n // force teleport children to array so it can be moved around\r\n if (shapeFlag & 64 /* TELEPORT */) {\r\n type = 16 /* ARRAY_CHILDREN */;\r\n children = [createTextVNode(children)];\r\n }\r\n else {\r\n type = 8 /* TEXT_CHILDREN */;\r\n }\r\n }\r\n vnode.children = children;\r\n vnode.shapeFlag |= type;\r\n}\r\nfunction mergeProps(...args) {\r\n const ret = {};\r\n for (let i = 0; i < args.length; i++) {\r\n const toMerge = args[i];\r\n for (const key in toMerge) {\r\n if (key === 'class') {\r\n if (ret.class !== toMerge.class) {\r\n ret.class = normalizeClass([ret.class, toMerge.class]);\r\n }\r\n }\r\n else if (key === 'style') {\r\n ret.style = normalizeStyle([ret.style, toMerge.style]);\r\n }\r\n else if (isOn(key)) {\r\n const existing = ret[key];\r\n const incoming = toMerge[key];\r\n if (existing !== incoming &&\r\n !(shared_esm_bundler_isArray(existing) && existing.includes(incoming))) {\r\n ret[key] = existing\r\n ? [].concat(existing, incoming)\r\n : incoming;\r\n }\r\n }\r\n else if (key !== '') {\r\n ret[key] = toMerge[key];\r\n }\r\n }\r\n }\r\n return ret;\r\n}\n\n/**\r\n * Actual implementation\r\n */\r\nfunction renderList(source, renderItem, cache, index) {\r\n let ret;\r\n const cached = (cache && cache[index]);\r\n if (shared_esm_bundler_isArray(source) || shared_esm_bundler_isString(source)) {\r\n ret = new Array(source.length);\r\n for (let i = 0, l = source.length; i < l; i++) {\r\n ret[i] = renderItem(source[i], i, undefined, cached && cached[i]);\r\n }\r\n }\r\n else if (typeof source === 'number') {\r\n if (false) {}\r\n ret = new Array(source);\r\n for (let i = 0; i < source; i++) {\r\n ret[i] = renderItem(i + 1, i, undefined, cached && cached[i]);\r\n }\r\n }\r\n else if (shared_esm_bundler_isObject(source)) {\r\n if (source[Symbol.iterator]) {\r\n ret = Array.from(source, (item, i) => renderItem(item, i, undefined, cached && cached[i]));\r\n }\r\n else {\r\n const keys = Object.keys(source);\r\n ret = new Array(keys.length);\r\n for (let i = 0, l = keys.length; i < l; i++) {\r\n const key = keys[i];\r\n ret[i] = renderItem(source[key], key, i, cached && cached[i]);\r\n }\r\n }\r\n }\r\n else {\r\n ret = [];\r\n }\r\n if (cache) {\r\n cache[index] = ret;\r\n }\r\n return ret;\r\n}\n\n/**\r\n * Compiler runtime helper for creating dynamic slots object\r\n * @private\r\n */\r\nfunction createSlots(slots, dynamicSlots) {\r\n for (let i = 0; i < dynamicSlots.length; i++) {\r\n const slot = dynamicSlots[i];\r\n // array of dynamic slot generated by <template v-for=\"...\" #[...]>\r\n if (shared_esm_bundler_isArray(slot)) {\r\n for (let j = 0; j < slot.length; j++) {\r\n slots[slot[j].name] = slot[j].fn;\r\n }\r\n }\r\n else if (slot) {\r\n // conditional single slot generated by <template v-if=\"...\" #foo>\r\n slots[slot.name] = slot.fn;\r\n }\r\n }\r\n return slots;\r\n}\n\n/**\r\n * Compiler runtime helper for rendering `<slot/>`\r\n * @private\r\n */\r\nfunction renderSlot(slots, name, props = {}, \r\n// this is not a user-facing function, so the fallback is always generated by\r\n// the compiler and guaranteed to be a function returning an array\r\nfallback, noSlotted) {\r\n if (currentRenderingInstance.isCE) {\r\n return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());\r\n }\r\n let slot = slots[name];\r\n if (false) {}\r\n // a compiled slot disables block tracking by default to avoid manual\r\n // invocation interfering with template-based block tracking, but in\r\n // `renderSlot` we can be sure that it's template-based so we can force\r\n // enable it.\r\n if (slot && slot._c) {\r\n slot._d = false;\r\n }\r\n openBlock();\r\n const validSlotContent = slot && ensureValidVNode(slot(props));\r\n const rendered = createBlock(Fragment, { key: props.key || `_${name}` }, validSlotContent || (fallback ? fallback() : []), validSlotContent && slots._ === 1 /* STABLE */\r\n ? 64 /* STABLE_FRAGMENT */\r\n : -2 /* BAIL */);\r\n if (!noSlotted && rendered.scopeId) {\r\n rendered.slotScopeIds = [rendered.scopeId + '-s'];\r\n }\r\n if (slot && slot._c) {\r\n slot._d = true;\r\n }\r\n return rendered;\r\n}\r\nfunction ensureValidVNode(vnodes) {\r\n return vnodes.some(child => {\r\n if (!isVNode(child))\r\n return true;\r\n if (child.type === Comment)\r\n return false;\r\n if (child.type === Fragment &&\r\n !ensureValidVNode(child.children))\r\n return false;\r\n return true;\r\n })\r\n ? vnodes\r\n : null;\r\n}\n\n/**\r\n * For prefixing keys in v-on=\"obj\" with \"on\"\r\n * @private\r\n */\r\nfunction toHandlers(obj) {\r\n const ret = {};\r\n if (false) {}\r\n for (const key in obj) {\r\n ret[toHandlerKey(key)] = obj[key];\r\n }\r\n return ret;\r\n}\n\n/**\r\n * #2437 In Vue 3, functional components do not have a public instance proxy but\r\n * they exist in the internal parent chain. For code that relies on traversing\r\n * public $parent chains, skip functional ones and go to the parent instead.\r\n */\r\nconst getPublicInstance = (i) => {\r\n if (!i)\r\n return null;\r\n if (isStatefulComponent(i))\r\n return getExposeProxy(i) || i.proxy;\r\n return getPublicInstance(i.parent);\r\n};\r\nconst publicPropertiesMap = shared_esm_bundler_extend(Object.create(null), {\r\n $: i => i,\r\n $el: i => i.vnode.el,\r\n $data: i => i.data,\r\n $props: i => (( false) ? 0 : i.props),\r\n $attrs: i => (( false) ? 0 : i.attrs),\r\n $slots: i => (( false) ? 0 : i.slots),\r\n $refs: i => (( false) ? 0 : i.refs),\r\n $parent: i => getPublicInstance(i.parent),\r\n $root: i => getPublicInstance(i.root),\r\n $emit: i => i.emit,\r\n $options: i => ( true ? resolveMergedOptions(i) : 0),\r\n $forceUpdate: i => () => queueJob(i.update),\r\n $nextTick: i => nextTick.bind(i.proxy),\r\n $watch: i => ( true ? instanceWatch.bind(i) : 0)\r\n});\r\nconst PublicInstanceProxyHandlers = {\r\n get({ _: instance }, key) {\r\n const { ctx, setupState, data, props, accessCache, type, appContext } = instance;\r\n // for internal formatters to know that this is a Vue instance\r\n if (false) {}\r\n // prioritize <script setup> bindings during dev.\r\n // this allows even properties that start with _ or $ to be used - so that\r\n // it aligns with the production behavior where the render fn is inlined and\r\n // indeed has access to all declared variables.\r\n if (false) {}\r\n // data / props / ctx\r\n // This getter gets called for every property access on the render context\r\n // during render and is a major hotspot. The most expensive part of this\r\n // is the multiple hasOwn() calls. It's much faster to do a simple property\r\n // access on a plain object, so we use an accessCache object (with null\r\n // prototype) to memoize what access type a key corresponds to.\r\n let normalizedProps;\r\n if (key[0] !== '$') {\r\n const n = accessCache[key];\r\n if (n !== undefined) {\r\n switch (n) {\r\n case 0 /* SETUP */:\r\n return setupState[key];\r\n case 1 /* DATA */:\r\n return data[key];\r\n case 3 /* CONTEXT */:\r\n return ctx[key];\r\n case 2 /* PROPS */:\r\n return props[key];\r\n // default: just fallthrough\r\n }\r\n }\r\n else if (setupState !== EMPTY_OBJ && shared_esm_bundler_hasOwn(setupState, key)) {\r\n accessCache[key] = 0 /* SETUP */;\r\n return setupState[key];\r\n }\r\n else if (data !== EMPTY_OBJ && shared_esm_bundler_hasOwn(data, key)) {\r\n accessCache[key] = 1 /* DATA */;\r\n return data[key];\r\n }\r\n else if (\r\n // only cache other properties when instance has declared (thus stable)\r\n // props\r\n (normalizedProps = instance.propsOptions[0]) &&\r\n shared_esm_bundler_hasOwn(normalizedProps, key)) {\r\n accessCache[key] = 2 /* PROPS */;\r\n return props[key];\r\n }\r\n else if (ctx !== EMPTY_OBJ && shared_esm_bundler_hasOwn(ctx, key)) {\r\n accessCache[key] = 3 /* CONTEXT */;\r\n return ctx[key];\r\n }\r\n else if ( false || shouldCacheAccess) {\r\n accessCache[key] = 4 /* OTHER */;\r\n }\r\n }\r\n const publicGetter = publicPropertiesMap[key];\r\n let cssModule, globalProperties;\r\n // public $xxx properties\r\n if (publicGetter) {\r\n if (key === '$attrs') {\r\n track(instance, \"get\" /* GET */, key);\r\n ( false) && 0;\r\n }\r\n return publicGetter(instance);\r\n }\r\n else if (\r\n // css module (injected by vue-loader)\r\n (cssModule = type.__cssModules) &&\r\n (cssModule = cssModule[key])) {\r\n return cssModule;\r\n }\r\n else if (ctx !== EMPTY_OBJ && shared_esm_bundler_hasOwn(ctx, key)) {\r\n // user may set custom properties to `this` that start with `$`\r\n accessCache[key] = 3 /* CONTEXT */;\r\n return ctx[key];\r\n }\r\n else if (\r\n // global properties\r\n ((globalProperties = appContext.config.globalProperties),\r\n shared_esm_bundler_hasOwn(globalProperties, key))) {\r\n {\r\n return globalProperties[key];\r\n }\r\n }\r\n else if (false) {}\r\n },\r\n set({ _: instance }, key, value) {\r\n const { data, setupState, ctx } = instance;\r\n if (setupState !== EMPTY_OBJ && shared_esm_bundler_hasOwn(setupState, key)) {\r\n setupState[key] = value;\r\n }\r\n else if (data !== EMPTY_OBJ && shared_esm_bundler_hasOwn(data, key)) {\r\n data[key] = value;\r\n }\r\n else if (shared_esm_bundler_hasOwn(instance.props, key)) {\r\n ( false) &&\r\n 0;\r\n return false;\r\n }\r\n if (key[0] === '$' && key.slice(1) in instance) {\r\n ( false) &&\r\n 0;\r\n return false;\r\n }\r\n else {\r\n if (false) {}\r\n else {\r\n ctx[key] = value;\r\n }\r\n }\r\n return true;\r\n },\r\n has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {\r\n let normalizedProps;\r\n return (accessCache[key] !== undefined ||\r\n (data !== EMPTY_OBJ && shared_esm_bundler_hasOwn(data, key)) ||\r\n (setupState !== EMPTY_OBJ && shared_esm_bundler_hasOwn(setupState, key)) ||\r\n ((normalizedProps = propsOptions[0]) && shared_esm_bundler_hasOwn(normalizedProps, key)) ||\r\n shared_esm_bundler_hasOwn(ctx, key) ||\r\n shared_esm_bundler_hasOwn(publicPropertiesMap, key) ||\r\n shared_esm_bundler_hasOwn(appContext.config.globalProperties, key));\r\n }\r\n};\r\nif (false) {}\r\nconst RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ shared_esm_bundler_extend({}, PublicInstanceProxyHandlers, {\r\n get(target, key) {\r\n // fast path for unscopables when using `with` block\r\n if (key === Symbol.unscopables) {\r\n return;\r\n }\r\n return PublicInstanceProxyHandlers.get(target, key, target);\r\n },\r\n has(_, key) {\r\n const has = key[0] !== '_' && !isGloballyWhitelisted(key);\r\n if (false) {}\r\n return has;\r\n }\r\n});\r\n// dev only\r\n// In dev mode, the proxy target exposes the same properties as seen on `this`\r\n// for easier console inspection. In prod mode it will be an empty object so\r\n// these properties definitions can be skipped.\r\nfunction createDevRenderContext(instance) {\r\n const target = {};\r\n // expose internal instance for proxy handlers\r\n Object.defineProperty(target, `_`, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () => instance\r\n });\r\n // expose public properties\r\n Object.keys(publicPropertiesMap).forEach(key => {\r\n Object.defineProperty(target, key, {\r\n configurable: true,\r\n enumerable: false,\r\n get: () => publicPropertiesMap[key](instance),\r\n // intercepted by the proxy so no need for implementation,\r\n // but needed to prevent set errors\r\n set: NOOP\r\n });\r\n });\r\n return target;\r\n}\r\n// dev only\r\nfunction exposePropsOnRenderContext(instance) {\r\n const { ctx, propsOptions: [propsOptions] } = instance;\r\n if (propsOptions) {\r\n Object.keys(propsOptions).forEach(key => {\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => instance.props[key],\r\n set: NOOP\r\n });\r\n });\r\n }\r\n}\r\n// dev only\r\nfunction exposeSetupStateOnRenderContext(instance) {\r\n const { ctx, setupState } = instance;\r\n Object.keys(toRaw(setupState)).forEach(key => {\r\n if (!setupState.__isScriptSetup) {\r\n if (key[0] === '$' || key[0] === '_') {\r\n runtime_core_esm_bundler_warn(`setup() return property ${JSON.stringify(key)} should not start with \"$\" or \"_\" ` +\r\n `which are reserved prefixes for Vue internals.`);\r\n return;\r\n }\r\n Object.defineProperty(ctx, key, {\r\n enumerable: true,\r\n configurable: true,\r\n get: () => setupState[key],\r\n set: NOOP\r\n });\r\n }\r\n });\r\n}\n\nconst emptyAppContext = createAppContext();\r\nlet uid$1 = 0;\r\nfunction createComponentInstance(vnode, parent, suspense) {\r\n const type = vnode.type;\r\n // inherit parent app context - or - if root, adopt from root vnode\r\n const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;\r\n const instance = {\r\n uid: uid$1++,\r\n vnode,\r\n type,\r\n parent,\r\n appContext,\r\n root: null,\r\n next: null,\r\n subTree: null,\r\n update: null,\r\n scope: new EffectScope(true /* detached */),\r\n render: null,\r\n proxy: null,\r\n exposed: null,\r\n exposeProxy: null,\r\n withProxy: null,\r\n provides: parent ? parent.provides : Object.create(appContext.provides),\r\n accessCache: null,\r\n renderCache: [],\r\n // local resovled assets\r\n components: null,\r\n directives: null,\r\n // resolved props and emits options\r\n propsOptions: normalizePropsOptions(type, appContext),\r\n emitsOptions: normalizeEmitsOptions(type, appContext),\r\n // emit\r\n emit: null,\r\n emitted: null,\r\n // props default value\r\n propsDefaults: EMPTY_OBJ,\r\n // inheritAttrs\r\n inheritAttrs: type.inheritAttrs,\r\n // state\r\n ctx: EMPTY_OBJ,\r\n data: EMPTY_OBJ,\r\n props: EMPTY_OBJ,\r\n attrs: EMPTY_OBJ,\r\n slots: EMPTY_OBJ,\r\n refs: EMPTY_OBJ,\r\n setupState: EMPTY_OBJ,\r\n setupContext: null,\r\n // suspense related\r\n suspense,\r\n suspenseId: suspense ? suspense.pendingId : 0,\r\n asyncDep: null,\r\n asyncResolved: false,\r\n // lifecycle hooks\r\n // not using enums here because it results in computed properties\r\n isMounted: false,\r\n isUnmounted: false,\r\n isDeactivated: false,\r\n bc: null,\r\n c: null,\r\n bm: null,\r\n m: null,\r\n bu: null,\r\n u: null,\r\n um: null,\r\n bum: null,\r\n da: null,\r\n a: null,\r\n rtg: null,\r\n rtc: null,\r\n ec: null,\r\n sp: null\r\n };\r\n if ((false)) {}\r\n else {\r\n instance.ctx = { _: instance };\r\n }\r\n instance.root = parent ? parent.root : instance;\r\n instance.emit = emit$1.bind(null, instance);\r\n // apply custom element special handling\r\n if (vnode.ce) {\r\n vnode.ce(instance);\r\n }\r\n return instance;\r\n}\r\nlet currentInstance = null;\r\nconst getCurrentInstance = () => currentInstance || currentRenderingInstance;\r\nconst setCurrentInstance = (instance) => {\r\n currentInstance = instance;\r\n instance.scope.on();\r\n};\r\nconst unsetCurrentInstance = () => {\r\n currentInstance && currentInstance.scope.off();\r\n currentInstance = null;\r\n};\r\nconst isBuiltInTag = /*#__PURE__*/ (/* unused pure expression or super */ null && (makeMap('slot,component')));\r\nfunction validateComponentName(name, config) {\r\n const appIsNativeTag = config.isNativeTag || NO;\r\n if (isBuiltInTag(name) || appIsNativeTag(name)) {\r\n runtime_core_esm_bundler_warn('Do not use built-in or reserved HTML elements as component id: ' + name);\r\n }\r\n}\r\nfunction isStatefulComponent(instance) {\r\n return instance.vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */;\r\n}\r\nlet isInSSRComponentSetup = false;\r\nfunction setupComponent(instance, isSSR = false) {\r\n isInSSRComponentSetup = isSSR;\r\n const { props, children } = instance.vnode;\r\n const isStateful = isStatefulComponent(instance);\r\n initProps(instance, props, isStateful, isSSR);\r\n initSlots(instance, children);\r\n const setupResult = isStateful\r\n ? setupStatefulComponent(instance, isSSR)\r\n : undefined;\r\n isInSSRComponentSetup = false;\r\n return setupResult;\r\n}\r\nfunction setupStatefulComponent(instance, isSSR) {\r\n const Component = instance.type;\r\n if ((false)) {}\r\n // 0. create render proxy property access cache\r\n instance.accessCache = Object.create(null);\r\n // 1. create public instance / render proxy\r\n // also mark it raw so it's never observed\r\n instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));\r\n if ((false)) {}\r\n // 2. call setup()\r\n const { setup } = Component;\r\n if (setup) {\r\n const setupContext = (instance.setupContext =\r\n setup.length > 1 ? createSetupContext(instance) : null);\r\n setCurrentInstance(instance);\r\n pauseTracking();\r\n const setupResult = callWithErrorHandling(setup, instance, 0 /* SETUP_FUNCTION */, [( false) ? 0 : instance.props, setupContext]);\r\n resetTracking();\r\n unsetCurrentInstance();\r\n if (isPromise(setupResult)) {\r\n setupResult.then(unsetCurrentInstance, unsetCurrentInstance);\r\n if (isSSR) {\r\n // return the promise so server-renderer can wait on it\r\n return setupResult\r\n .then((resolvedResult) => {\r\n handleSetupResult(instance, resolvedResult, isSSR);\r\n })\r\n .catch(e => {\r\n handleError(e, instance, 0 /* SETUP_FUNCTION */);\r\n });\r\n }\r\n else {\r\n // async setup returned Promise.\r\n // bail here and wait for re-entry.\r\n instance.asyncDep = setupResult;\r\n }\r\n }\r\n else {\r\n handleSetupResult(instance, setupResult, isSSR);\r\n }\r\n }\r\n else {\r\n finishComponentSetup(instance, isSSR);\r\n }\r\n}\r\nfunction handleSetupResult(instance, setupResult, isSSR) {\r\n if (isFunction(setupResult)) {\r\n // setup returned an inline render function\r\n if (instance.type.__ssrInlineRender) {\r\n // when the function's name is `ssrRender` (compiled by SFC inline mode),\r\n // set it as ssrRender instead.\r\n instance.ssrRender = setupResult;\r\n }\r\n else {\r\n instance.render = setupResult;\r\n }\r\n }\r\n else if (shared_esm_bundler_isObject(setupResult)) {\r\n if (false) {}\r\n // setup returned bindings.\r\n // assuming a render function compiled from template is present.\r\n if (false) {}\r\n instance.setupState = proxyRefs(setupResult);\r\n if ((false)) {}\r\n }\r\n else if (false) {}\r\n finishComponentSetup(instance, isSSR);\r\n}\r\nlet compile;\r\nlet installWithProxy;\r\n/**\r\n * For runtime-dom to register the compiler.\r\n * Note the exported method uses any to avoid d.ts relying on the compiler types.\r\n */\r\nfunction registerRuntimeCompiler(_compile) {\r\n compile = _compile;\r\n installWithProxy = i => {\r\n if (i.render._rc) {\r\n i.withProxy = new Proxy(i.ctx, RuntimeCompiledPublicInstanceProxyHandlers);\r\n }\r\n };\r\n}\r\n// dev only\r\nconst runtime_core_esm_bundler_isRuntimeOnly = () => !compile;\r\nfunction finishComponentSetup(instance, isSSR, skipOptions) {\r\n const Component = instance.type;\r\n // template / render function normalization\r\n // could be already set when returned from setup()\r\n if (!instance.render) {\r\n // only do on-the-fly compile if not in SSR - SSR on-the-fly compliation\r\n // is done by server-renderer\r\n if (!isSSR && compile && !Component.render) {\r\n const template = Component.template;\r\n if (template) {\r\n if ((false)) {}\r\n const { isCustomElement, compilerOptions } = instance.appContext.config;\r\n const { delimiters, compilerOptions: componentCompilerOptions } = Component;\r\n const finalCompilerOptions = shared_esm_bundler_extend(shared_esm_bundler_extend({\r\n isCustomElement,\r\n delimiters\r\n }, compilerOptions), componentCompilerOptions);\r\n Component.render = compile(template, finalCompilerOptions);\r\n if ((false)) {}\r\n }\r\n }\r\n instance.render = (Component.render || shared_esm_bundler_NOOP);\r\n // for runtime-compiled render functions using `with` blocks, the render\r\n // proxy used needs a different `has` handler which is more performant and\r\n // also only allows a whitelist of globals to fallthrough.\r\n if (installWithProxy) {\r\n installWithProxy(instance);\r\n }\r\n }\r\n // support for 2.x options\r\n if (true) {\r\n setCurrentInstance(instance);\r\n pauseTracking();\r\n applyOptions(instance);\r\n resetTracking();\r\n unsetCurrentInstance();\r\n }\r\n // warn missing template/render\r\n // the runtime compilation of template in SSR is done by server-render\r\n if (false) {}\r\n}\r\nfunction createAttrsProxy(instance) {\r\n return new Proxy(instance.attrs, ( false)\r\n ? 0\r\n : {\r\n get(target, key) {\r\n track(instance, \"get\" /* GET */, '$attrs');\r\n return target[key];\r\n }\r\n });\r\n}\r\nfunction createSetupContext(instance) {\r\n const expose = exposed => {\r\n if (false) {}\r\n instance.exposed = exposed || {};\r\n };\r\n let attrs;\r\n if ((false)) {}\r\n else {\r\n return {\r\n get attrs() {\r\n return attrs || (attrs = createAttrsProxy(instance));\r\n },\r\n slots: instance.slots,\r\n emit: instance.emit,\r\n expose\r\n };\r\n }\r\n}\r\nfunction getExposeProxy(instance) {\r\n if (instance.exposed) {\r\n return (instance.exposeProxy ||\r\n (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {\r\n get(target, key) {\r\n if (key in target) {\r\n return target[key];\r\n }\r\n else if (key in publicPropertiesMap) {\r\n return publicPropertiesMap[key](instance);\r\n }\r\n }\r\n })));\r\n }\r\n}\r\nconst classifyRE = /(?:^|[-_])(\\w)/g;\r\nconst classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');\r\nfunction getComponentName(Component) {\r\n return isFunction(Component)\r\n ? Component.displayName || Component.name\r\n : Component.name;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatComponentName(instance, Component, isRoot = false) {\r\n let name = getComponentName(Component);\r\n if (!name && Component.__file) {\r\n const match = Component.__file.match(/([^/\\\\]+)\\.\\w+$/);\r\n if (match) {\r\n name = match[1];\r\n }\r\n }\r\n if (!name && instance && instance.parent) {\r\n // try to infer the name based on reverse resolution\r\n const inferFromRegistry = (registry) => {\r\n for (const key in registry) {\r\n if (registry[key] === Component) {\r\n return key;\r\n }\r\n }\r\n };\r\n name =\r\n inferFromRegistry(instance.components ||\r\n instance.parent.type.components) || inferFromRegistry(instance.appContext.components);\r\n }\r\n return name ? classify(name) : isRoot ? `App` : `Anonymous`;\r\n}\r\nfunction isClassComponent(value) {\r\n return isFunction(value) && '__vccOpts' in value;\r\n}\n\nconst stack = [];\r\nfunction pushWarningContext(vnode) {\r\n stack.push(vnode);\r\n}\r\nfunction popWarningContext() {\r\n stack.pop();\r\n}\r\nfunction runtime_core_esm_bundler_warn(msg, ...args) {\r\n // avoid props formatting or warn handler tracking deps that might be mutated\r\n // during patch, leading to infinite recursion.\r\n pauseTracking();\r\n const instance = stack.length ? stack[stack.length - 1].component : null;\r\n const appWarnHandler = instance && instance.appContext.config.warnHandler;\r\n const trace = getComponentTrace();\r\n if (appWarnHandler) {\r\n callWithErrorHandling(appWarnHandler, instance, 11 /* APP_WARN_HANDLER */, [\r\n msg + args.join(''),\r\n instance && instance.proxy,\r\n trace\r\n .map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)\r\n .join('\\n'),\r\n trace\r\n ]);\r\n }\r\n else {\r\n const warnArgs = [`[Vue warn]: ${msg}`, ...args];\r\n /* istanbul ignore if */\r\n if (trace.length &&\r\n // avoid spamming console during tests\r\n !false) {\r\n warnArgs.push(`\\n`, ...formatTrace(trace));\r\n }\r\n console.warn(...warnArgs);\r\n }\r\n resetTracking();\r\n}\r\nfunction getComponentTrace() {\r\n let currentVNode = stack[stack.length - 1];\r\n if (!currentVNode) {\r\n return [];\r\n }\r\n // we can't just use the stack because it will be incomplete during updates\r\n // that did not start from the root. Re-construct the parent chain using\r\n // instance parent pointers.\r\n const normalizedStack = [];\r\n while (currentVNode) {\r\n const last = normalizedStack[0];\r\n if (last && last.vnode === currentVNode) {\r\n last.recurseCount++;\r\n }\r\n else {\r\n normalizedStack.push({\r\n vnode: currentVNode,\r\n recurseCount: 0\r\n });\r\n }\r\n const parentInstance = currentVNode.component && currentVNode.component.parent;\r\n currentVNode = parentInstance && parentInstance.vnode;\r\n }\r\n return normalizedStack;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatTrace(trace) {\r\n const logs = [];\r\n trace.forEach((entry, i) => {\r\n logs.push(...(i === 0 ? [] : [`\\n`]), ...formatTraceEntry(entry));\r\n });\r\n return logs;\r\n}\r\nfunction formatTraceEntry({ vnode, recurseCount }) {\r\n const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;\r\n const isRoot = vnode.component ? vnode.component.parent == null : false;\r\n const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;\r\n const close = `>` + postfix;\r\n return vnode.props\r\n ? [open, ...formatProps(vnode.props), close]\r\n : [open + close];\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProps(props) {\r\n const res = [];\r\n const keys = Object.keys(props);\r\n keys.slice(0, 3).forEach(key => {\r\n res.push(...formatProp(key, props[key]));\r\n });\r\n if (keys.length > 3) {\r\n res.push(` ...`);\r\n }\r\n return res;\r\n}\r\n/* istanbul ignore next */\r\nfunction formatProp(key, value, raw) {\r\n if (shared_esm_bundler_isString(value)) {\r\n value = JSON.stringify(value);\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (typeof value === 'number' ||\r\n typeof value === 'boolean' ||\r\n value == null) {\r\n return raw ? value : [`${key}=${value}`];\r\n }\r\n else if (isRef(value)) {\r\n value = formatProp(key, reactivity_esm_bundler_toRaw(value.value), true);\r\n return raw ? value : [`${key}=Ref<`, value, `>`];\r\n }\r\n else if (isFunction(value)) {\r\n return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];\r\n }\r\n else {\r\n value = reactivity_esm_bundler_toRaw(value);\r\n return raw ? value : [`${key}=`, value];\r\n }\r\n}\n\nconst ErrorTypeStrings = {\r\n [\"sp\" /* SERVER_PREFETCH */]: 'serverPrefetch hook',\r\n [\"bc\" /* BEFORE_CREATE */]: 'beforeCreate hook',\r\n [\"c\" /* CREATED */]: 'created hook',\r\n [\"bm\" /* BEFORE_MOUNT */]: 'beforeMount hook',\r\n [\"m\" /* MOUNTED */]: 'mounted hook',\r\n [\"bu\" /* BEFORE_UPDATE */]: 'beforeUpdate hook',\r\n [\"u\" /* UPDATED */]: 'updated',\r\n [\"bum\" /* BEFORE_UNMOUNT */]: 'beforeUnmount hook',\r\n [\"um\" /* UNMOUNTED */]: 'unmounted hook',\r\n [\"a\" /* ACTIVATED */]: 'activated hook',\r\n [\"da\" /* DEACTIVATED */]: 'deactivated hook',\r\n [\"ec\" /* ERROR_CAPTURED */]: 'errorCaptured hook',\r\n [\"rtc\" /* RENDER_TRACKED */]: 'renderTracked hook',\r\n [\"rtg\" /* RENDER_TRIGGERED */]: 'renderTriggered hook',\r\n [0 /* SETUP_FUNCTION */]: 'setup function',\r\n [1 /* RENDER_FUNCTION */]: 'render function',\r\n [2 /* WATCH_GETTER */]: 'watcher getter',\r\n [3 /* WATCH_CALLBACK */]: 'watcher callback',\r\n [4 /* WATCH_CLEANUP */]: 'watcher cleanup function',\r\n [5 /* NATIVE_EVENT_HANDLER */]: 'native event handler',\r\n [6 /* COMPONENT_EVENT_HANDLER */]: 'component event handler',\r\n [7 /* VNODE_HOOK */]: 'vnode hook',\r\n [8 /* DIRECTIVE_HOOK */]: 'directive hook',\r\n [9 /* TRANSITION_HOOK */]: 'transition hook',\r\n [10 /* APP_ERROR_HANDLER */]: 'app errorHandler',\r\n [11 /* APP_WARN_HANDLER */]: 'app warnHandler',\r\n [12 /* FUNCTION_REF */]: 'ref function',\r\n [13 /* ASYNC_COMPONENT_LOADER */]: 'async component loader',\r\n [14 /* SCHEDULER */]: 'scheduler flush. This is likely a Vue internals bug. ' +\r\n 'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/vue-next'\r\n};\r\nfunction callWithErrorHandling(fn, instance, type, args) {\r\n let res;\r\n try {\r\n res = args ? fn(...args) : fn();\r\n }\r\n catch (err) {\r\n handleError(err, instance, type);\r\n }\r\n return res;\r\n}\r\nfunction callWithAsyncErrorHandling(fn, instance, type, args) {\r\n if (isFunction(fn)) {\r\n const res = callWithErrorHandling(fn, instance, type, args);\r\n if (res && isPromise(res)) {\r\n res.catch(err => {\r\n handleError(err, instance, type);\r\n });\r\n }\r\n return res;\r\n }\r\n const values = [];\r\n for (let i = 0; i < fn.length; i++) {\r\n values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));\r\n }\r\n return values;\r\n}\r\nfunction handleError(err, instance, type, throwInDev = true) {\r\n const contextVNode = instance ? instance.vnode : null;\r\n if (instance) {\r\n let cur = instance.parent;\r\n // the exposed instance is the render proxy to keep it consistent with 2.x\r\n const exposedInstance = instance.proxy;\r\n // in production the hook receives only the error code\r\n const errorInfo = ( false) ? 0 : type;\r\n while (cur) {\r\n const errorCapturedHooks = cur.ec;\r\n if (errorCapturedHooks) {\r\n for (let i = 0; i < errorCapturedHooks.length; i++) {\r\n if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {\r\n return;\r\n }\r\n }\r\n }\r\n cur = cur.parent;\r\n }\r\n // app-level handling\r\n const appErrorHandler = instance.appContext.config.errorHandler;\r\n if (appErrorHandler) {\r\n callWithErrorHandling(appErrorHandler, null, 10 /* APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);\r\n return;\r\n }\r\n }\r\n logError(err, type, contextVNode, throwInDev);\r\n}\r\nfunction logError(err, type, contextVNode, throwInDev = true) {\r\n if ((false)) {}\r\n else {\r\n // recover in prod to reduce the impact on end-user\r\n console.error(err);\r\n }\r\n}\n\nlet isFlushing = false;\r\nlet isFlushPending = false;\r\nconst runtime_core_esm_bundler_queue = [];\r\nlet flushIndex = 0;\r\nconst pendingPreFlushCbs = [];\r\nlet activePreFlushCbs = null;\r\nlet preFlushIndex = 0;\r\nconst pendingPostFlushCbs = [];\r\nlet activePostFlushCbs = null;\r\nlet postFlushIndex = 0;\r\nconst resolvedPromise = Promise.resolve();\r\nlet currentFlushPromise = null;\r\nlet currentPreFlushParentJob = null;\r\nconst RECURSION_LIMIT = 100;\r\nfunction nextTick(fn) {\r\n const p = currentFlushPromise || resolvedPromise;\r\n return fn ? p.then(this ? fn.bind(this) : fn) : p;\r\n}\r\n// #2768\r\n// Use binary-search to find a suitable position in the queue,\r\n// so that the queue maintains the increasing order of job's id,\r\n// which can prevent the job from being skipped and also can avoid repeated patching.\r\nfunction findInsertionIndex(id) {\r\n // the start index should be `flushIndex + 1`\r\n let start = flushIndex + 1;\r\n let end = runtime_core_esm_bundler_queue.length;\r\n while (start < end) {\r\n const middle = (start + end) >>> 1;\r\n const middleJobId = getId(runtime_core_esm_bundler_queue[middle]);\r\n middleJobId < id ? (start = middle + 1) : (end = middle);\r\n }\r\n return start;\r\n}\r\nfunction queueJob(job) {\r\n // the dedupe search uses the startIndex argument of Array.includes()\r\n // by default the search index includes the current job that is being run\r\n // so it cannot recursively trigger itself again.\r\n // if the job is a watch() callback, the search will start with a +1 index to\r\n // allow it recursively trigger itself - it is the user's responsibility to\r\n // ensure it doesn't end up in an infinite loop.\r\n if ((!runtime_core_esm_bundler_queue.length ||\r\n !runtime_core_esm_bundler_queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) &&\r\n job !== currentPreFlushParentJob) {\r\n if (job.id == null) {\r\n runtime_core_esm_bundler_queue.push(job);\r\n }\r\n else {\r\n runtime_core_esm_bundler_queue.splice(findInsertionIndex(job.id), 0, job);\r\n }\r\n queueFlush();\r\n }\r\n}\r\nfunction queueFlush() {\r\n if (!isFlushing && !isFlushPending) {\r\n isFlushPending = true;\r\n currentFlushPromise = resolvedPromise.then(flushJobs);\r\n }\r\n}\r\nfunction invalidateJob(job) {\r\n const i = runtime_core_esm_bundler_queue.indexOf(job);\r\n if (i > flushIndex) {\r\n runtime_core_esm_bundler_queue.splice(i, 1);\r\n }\r\n}\r\nfunction queueCb(cb, activeQueue, pendingQueue, index) {\r\n if (!shared_esm_bundler_isArray(cb)) {\r\n if (!activeQueue ||\r\n !activeQueue.includes(cb, cb.allowRecurse ? index + 1 : index)) {\r\n pendingQueue.push(cb);\r\n }\r\n }\r\n else {\r\n // if cb is an array, it is a component lifecycle hook which can only be\r\n // triggered by a job, which is already deduped in the main queue, so\r\n // we can skip duplicate check here to improve perf\r\n pendingQueue.push(...cb);\r\n }\r\n queueFlush();\r\n}\r\nfunction queuePreFlushCb(cb) {\r\n queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);\r\n}\r\nfunction queuePostFlushCb(cb) {\r\n queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);\r\n}\r\nfunction flushPreFlushCbs(seen, parentJob = null) {\r\n if (pendingPreFlushCbs.length) {\r\n currentPreFlushParentJob = parentJob;\r\n activePreFlushCbs = [...new Set(pendingPreFlushCbs)];\r\n pendingPreFlushCbs.length = 0;\r\n if ((false)) {}\r\n for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {\r\n if (false) {}\r\n activePreFlushCbs[preFlushIndex]();\r\n }\r\n activePreFlushCbs = null;\r\n preFlushIndex = 0;\r\n currentPreFlushParentJob = null;\r\n // recursively flush until it drains\r\n flushPreFlushCbs(seen, parentJob);\r\n }\r\n}\r\nfunction flushPostFlushCbs(seen) {\r\n if (pendingPostFlushCbs.length) {\r\n const deduped = [...new Set(pendingPostFlushCbs)];\r\n pendingPostFlushCbs.length = 0;\r\n // #1947 already has active queue, nested flushPostFlushCbs call\r\n if (activePostFlushCbs) {\r\n activePostFlushCbs.push(...deduped);\r\n return;\r\n }\r\n activePostFlushCbs = deduped;\r\n if ((false)) {}\r\n activePostFlushCbs.sort((a, b) => getId(a) - getId(b));\r\n for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {\r\n if (false) {}\r\n activePostFlushCbs[postFlushIndex]();\r\n }\r\n activePostFlushCbs = null;\r\n postFlushIndex = 0;\r\n }\r\n}\r\nconst getId = (job) => job.id == null ? Infinity : job.id;\r\nfunction flushJobs(seen) {\r\n isFlushPending = false;\r\n isFlushing = true;\r\n if ((false)) {}\r\n flushPreFlushCbs(seen);\r\n // Sort queue before flush.\r\n // This ensures that:\r\n // 1. Components are updated from parent to child. (because parent is always\r\n // created before the child so its render effect will have smaller\r\n // priority number)\r\n // 2. If a component is unmounted during a parent component's update,\r\n // its update can be skipped.\r\n runtime_core_esm_bundler_queue.sort((a, b) => getId(a) - getId(b));\r\n // conditional usage of checkRecursiveUpdate must be determined out of\r\n // try ... catch block since Rollup by default de-optimizes treeshaking\r\n // inside try-catch. This can leave all warning code unshaked. Although\r\n // they would get eventually shaken by a minifier like terser, some minifiers\r\n // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)\r\n const check = ( false)\r\n ? 0\r\n : shared_esm_bundler_NOOP;\r\n try {\r\n for (flushIndex = 0; flushIndex < runtime_core_esm_bundler_queue.length; flushIndex++) {\r\n const job = runtime_core_esm_bundler_queue[flushIndex];\r\n if (job && job.active !== false) {\r\n if (false) {}\r\n // console.log(`running:`, job.id)\r\n callWithErrorHandling(job, null, 14 /* SCHEDULER */);\r\n }\r\n }\r\n }\r\n finally {\r\n flushIndex = 0;\r\n runtime_core_esm_bundler_queue.length = 0;\r\n flushPostFlushCbs(seen);\r\n isFlushing = false;\r\n currentFlushPromise = null;\r\n // some postFlushCb queued jobs!\r\n // keep flushing until it drains.\r\n if (runtime_core_esm_bundler_queue.length ||\r\n pendingPreFlushCbs.length ||\r\n pendingPostFlushCbs.length) {\r\n flushJobs(seen);\r\n }\r\n }\r\n}\r\nfunction checkRecursiveUpdates(seen, fn) {\r\n if (!seen.has(fn)) {\r\n seen.set(fn, 1);\r\n }\r\n else {\r\n const count = seen.get(fn);\r\n if (count > RECURSION_LIMIT) {\r\n const instance = fn.ownerInstance;\r\n const componentName = instance && getComponentName(instance.type);\r\n runtime_core_esm_bundler_warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +\r\n `This means you have a reactive effect that is mutating its own ` +\r\n `dependencies and thus recursively triggering itself. Possible sources ` +\r\n `include component template, render function, updated hook or ` +\r\n `watcher source function.`);\r\n return true;\r\n }\r\n else {\r\n seen.set(fn, count + 1);\r\n }\r\n }\r\n}\n\n// Simple effect.\r\nfunction watchEffect(effect, options) {\r\n return doWatch(effect, null, options);\r\n}\r\nfunction watchPostEffect(effect, options) {\r\n return doWatch(effect, null, (( false)\r\n ? 0\r\n : { flush: 'post' }));\r\n}\r\nfunction watchSyncEffect(effect, options) {\r\n return doWatch(effect, null, (( false)\r\n ? 0\r\n : { flush: 'sync' }));\r\n}\r\n// initial value for watchers to trigger on undefined initial values\r\nconst INITIAL_WATCHER_VALUE = {};\r\n// implementation\r\nfunction watch(source, cb, options) {\r\n if (false) {}\r\n return doWatch(source, cb, options);\r\n}\r\nfunction doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {\r\n if (false) {}\r\n const warnInvalidSource = (s) => {\r\n runtime_core_esm_bundler_warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +\r\n `a reactive object, or an array of these types.`);\r\n };\r\n const instance = currentInstance;\r\n let getter;\r\n let forceTrigger = false;\r\n let isMultiSource = false;\r\n if (isRef(source)) {\r\n getter = () => source.value;\r\n forceTrigger = !!source._shallow;\r\n }\r\n else if (isReactive(source)) {\r\n getter = () => source;\r\n deep = true;\r\n }\r\n else if (shared_esm_bundler_isArray(source)) {\r\n isMultiSource = true;\r\n forceTrigger = source.some(isReactive);\r\n getter = () => source.map(s => {\r\n if (isRef(s)) {\r\n return s.value;\r\n }\r\n else if (isReactive(s)) {\r\n return traverse(s);\r\n }\r\n else if (isFunction(s)) {\r\n return callWithErrorHandling(s, instance, 2 /* WATCH_GETTER */);\r\n }\r\n else {\r\n ( false) && 0;\r\n }\r\n });\r\n }\r\n else if (isFunction(source)) {\r\n if (cb) {\r\n // getter with cb\r\n getter = () => callWithErrorHandling(source, instance, 2 /* WATCH_GETTER */);\r\n }\r\n else {\r\n // no cb -> simple effect\r\n getter = () => {\r\n if (instance && instance.isUnmounted) {\r\n return;\r\n }\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n return callWithAsyncErrorHandling(source, instance, 3 /* WATCH_CALLBACK */, [onInvalidate]);\r\n };\r\n }\r\n }\r\n else {\r\n getter = shared_esm_bundler_NOOP;\r\n ( false) && 0;\r\n }\r\n if (cb && deep) {\r\n const baseGetter = getter;\r\n getter = () => traverse(baseGetter());\r\n }\r\n let cleanup;\r\n let onInvalidate = (fn) => {\r\n cleanup = effect.onStop = () => {\r\n callWithErrorHandling(fn, instance, 4 /* WATCH_CLEANUP */);\r\n };\r\n };\r\n // in SSR there is no need to setup an actual effect, and it should be noop\r\n // unless it's eager\r\n if (isInSSRComponentSetup) {\r\n // we will also not call the invalidate callback (+ runner is not set up)\r\n onInvalidate = shared_esm_bundler_NOOP;\r\n if (!cb) {\r\n getter();\r\n }\r\n else if (immediate) {\r\n callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\r\n getter(),\r\n isMultiSource ? [] : undefined,\r\n onInvalidate\r\n ]);\r\n }\r\n return shared_esm_bundler_NOOP;\r\n }\r\n let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;\r\n const job = () => {\r\n if (!effect.active) {\r\n return;\r\n }\r\n if (cb) {\r\n // watch(source, cb)\r\n const newValue = effect.run();\r\n if (deep ||\r\n forceTrigger ||\r\n (isMultiSource\r\n ? newValue.some((v, i) => hasChanged(v, oldValue[i]))\r\n : hasChanged(newValue, oldValue)) ||\r\n (false )) {\r\n // cleanup before running cb again\r\n if (cleanup) {\r\n cleanup();\r\n }\r\n callWithAsyncErrorHandling(cb, instance, 3 /* WATCH_CALLBACK */, [\r\n newValue,\r\n // pass undefined as the old value when it's changed for the first time\r\n oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,\r\n onInvalidate\r\n ]);\r\n oldValue = newValue;\r\n }\r\n }\r\n else {\r\n // watchEffect\r\n effect.run();\r\n }\r\n };\r\n // important: mark the job as a watcher callback so that scheduler knows\r\n // it is allowed to self-trigger (#1727)\r\n job.allowRecurse = !!cb;\r\n let scheduler;\r\n if (flush === 'sync') {\r\n scheduler = job; // the scheduler function gets called directly\r\n }\r\n else if (flush === 'post') {\r\n scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);\r\n }\r\n else {\r\n // default: 'pre'\r\n scheduler = () => {\r\n if (!instance || instance.isMounted) {\r\n queuePreFlushCb(job);\r\n }\r\n else {\r\n // with 'pre' option, the first call must happen before\r\n // the component is mounted so it is called synchronously.\r\n job();\r\n }\r\n };\r\n }\r\n const effect = new ReactiveEffect(getter, scheduler);\r\n if ((false)) {}\r\n // initial run\r\n if (cb) {\r\n if (immediate) {\r\n job();\r\n }\r\n else {\r\n oldValue = effect.run();\r\n }\r\n }\r\n else if (flush === 'post') {\r\n queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);\r\n }\r\n else {\r\n effect.run();\r\n }\r\n return () => {\r\n effect.stop();\r\n if (instance && instance.scope) {\r\n remove(instance.scope.effects, effect);\r\n }\r\n };\r\n}\r\n// this.$watch\r\nfunction instanceWatch(source, value, options) {\r\n const publicThis = this.proxy;\r\n const getter = shared_esm_bundler_isString(source)\r\n ? source.includes('.')\r\n ? createPathGetter(publicThis, source)\r\n : () => publicThis[source]\r\n : source.bind(publicThis, publicThis);\r\n let cb;\r\n if (isFunction(value)) {\r\n cb = value;\r\n }\r\n else {\r\n cb = value.handler;\r\n options = value;\r\n }\r\n const cur = currentInstance;\r\n setCurrentInstance(this);\r\n const res = doWatch(getter, cb.bind(publicThis), options);\r\n if (cur) {\r\n setCurrentInstance(cur);\r\n }\r\n else {\r\n unsetCurrentInstance();\r\n }\r\n return res;\r\n}\r\nfunction createPathGetter(ctx, path) {\r\n const segments = path.split('.');\r\n return () => {\r\n let cur = ctx;\r\n for (let i = 0; i < segments.length && cur; i++) {\r\n cur = cur[segments[i]];\r\n }\r\n return cur;\r\n };\r\n}\r\nfunction traverse(value, seen) {\r\n if (!shared_esm_bundler_isObject(value) || value[\"__v_skip\" /* SKIP */]) {\r\n return value;\r\n }\r\n seen = seen || new Set();\r\n if (seen.has(value)) {\r\n return value;\r\n }\r\n seen.add(value);\r\n if (isRef(value)) {\r\n traverse(value.value, seen);\r\n }\r\n else if (shared_esm_bundler_isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n traverse(value[i], seen);\r\n }\r\n }\r\n else if (isSet(value) || isMap(value)) {\r\n value.forEach((v) => {\r\n traverse(v, seen);\r\n });\r\n }\r\n else if (isPlainObject(value)) {\r\n for (const key in value) {\r\n traverse(value[key], seen);\r\n }\r\n }\r\n return value;\r\n}\n\n// dev only\r\nconst warnRuntimeUsage = (method) => runtime_core_esm_bundler_warn(`${method}() is a compiler-hint helper that is only usable inside ` +\r\n `<script setup> of a single file component. Its arguments should be ` +\r\n `compiled away and passing it at runtime has no effect.`);\r\n// implementation\r\nfunction defineProps() {\r\n if ((false)) {}\r\n return null;\r\n}\r\n// implementation\r\nfunction defineEmits() {\r\n if ((false)) {}\r\n return null;\r\n}\r\n/**\r\n * Vue `<script setup>` compiler macro for declaring a component's exposed\r\n * instance properties when it is accessed by a parent component via template\r\n * refs.\r\n *\r\n * `<script setup>` components are closed by default - i.e. varaibles inside\r\n * the `<script setup>` scope is not exposed to parent unless explicitly exposed\r\n * via `defineExpose`.\r\n *\r\n * This is only usable inside `<script setup>`, is compiled away in the\r\n * output and should **not** be actually called at runtime.\r\n */\r\nfunction defineExpose(exposed) {\r\n if ((false)) {}\r\n}\r\n/**\r\n * Vue `<script setup>` compiler macro for providing props default values when\r\n * using type-based `defineProps` declaration.\r\n *\r\n * Example usage:\r\n * ```ts\r\n * withDefaults(defineProps<{\r\n * size?: number\r\n * labels?: string[]\r\n * }>(), {\r\n * size: 3,\r\n * labels: () => ['default label']\r\n * })\r\n * ```\r\n *\r\n * This is only usable inside `<script setup>`, is compiled away in the output\r\n * and should **not** be actually called at runtime.\r\n */\r\nfunction withDefaults(props, defaults) {\r\n if ((false)) {}\r\n return null;\r\n}\r\nfunction useSlots() {\r\n return getContext().slots;\r\n}\r\nfunction useAttrs() {\r\n return getContext().attrs;\r\n}\r\nfunction getContext() {\r\n const i = getCurrentInstance();\r\n if (false) {}\r\n return i.setupContext || (i.setupContext = createSetupContext(i));\r\n}\r\n/**\r\n * Runtime helper for merging default declarations. Imported by compiled code\r\n * only.\r\n * @internal\r\n */\r\nfunction mergeDefaults(raw, defaults) {\r\n const props = shared_esm_bundler_isArray(raw)\r\n ? raw.reduce((normalized, p) => ((normalized[p] = {}), normalized), {})\r\n : raw;\r\n for (const key in defaults) {\r\n const opt = props[key];\r\n if (opt) {\r\n if (shared_esm_bundler_isArray(opt) || isFunction(opt)) {\r\n props[key] = { type: opt, default: defaults[key] };\r\n }\r\n else {\r\n opt.default = defaults[key];\r\n }\r\n }\r\n else if (opt === null) {\r\n props[key] = { default: defaults[key] };\r\n }\r\n else if ((false)) {}\r\n }\r\n return props;\r\n}\r\n/**\r\n * Used to create a proxy for the rest element when destructuring props with\r\n * defineProps().\r\n * @internal\r\n */\r\nfunction createPropsRestProxy(props, excludedKeys) {\r\n const ret = {};\r\n for (const key in props) {\r\n if (!excludedKeys.includes(key)) {\r\n Object.defineProperty(ret, key, {\r\n enumerable: true,\r\n get: () => props[key]\r\n });\r\n }\r\n }\r\n return ret;\r\n}\r\n/**\r\n * `<script setup>` helper for persisting the current instance context over\r\n * async/await flows.\r\n *\r\n * `@vue/compiler-sfc` converts the following:\r\n *\r\n * ```ts\r\n * const x = await foo()\r\n * ```\r\n *\r\n * into:\r\n *\r\n * ```ts\r\n * let __temp, __restore\r\n * const x = (([__temp, __restore] = withAsyncContext(() => foo())),__temp=await __temp,__restore(),__temp)\r\n * ```\r\n * @internal\r\n */\r\nfunction withAsyncContext(getAwaitable) {\r\n const ctx = getCurrentInstance();\r\n if (false) {}\r\n let awaitable = getAwaitable();\r\n unsetCurrentInstance();\r\n if (isPromise(awaitable)) {\r\n awaitable = awaitable.catch(e => {\r\n setCurrentInstance(ctx);\r\n throw e;\r\n });\r\n }\r\n return [awaitable, () => setCurrentInstance(ctx)];\r\n}\n\n// Actual implementation\r\nfunction h(type, propsOrChildren, children) {\r\n const l = arguments.length;\r\n if (l === 2) {\r\n if (shared_esm_bundler_isObject(propsOrChildren) && !shared_esm_bundler_isArray(propsOrChildren)) {\r\n // single vnode without props\r\n if (isVNode(propsOrChildren)) {\r\n return createVNode(type, null, [propsOrChildren]);\r\n }\r\n // props without children\r\n return createVNode(type, propsOrChildren);\r\n }\r\n else {\r\n // omit props\r\n return createVNode(type, null, propsOrChildren);\r\n }\r\n }\r\n else {\r\n if (l > 3) {\r\n children = Array.prototype.slice.call(arguments, 2);\r\n }\r\n else if (l === 3 && isVNode(children)) {\r\n children = [children];\r\n }\r\n return createVNode(type, propsOrChildren, children);\r\n }\r\n}\n\nconst ssrContextKey = Symbol(( false) ? 0 : ``);\r\nconst useSSRContext = () => {\r\n {\r\n const ctx = inject(ssrContextKey);\r\n if (!ctx) {\r\n runtime_core_esm_bundler_warn(`Server rendering context not provided. Make sure to only call ` +\r\n `useSSRContext() conditionally in the server build.`);\r\n }\r\n return ctx;\r\n }\r\n};\n\nfunction runtime_core_esm_bundler_initCustomFormatter() {\r\n /* eslint-disable no-restricted-globals */\r\n if (true) {\r\n return;\r\n }\r\n const vueStyle = { style: 'color:#3ba776' };\r\n const numberStyle = { style: 'color:#0b1bc9' };\r\n const stringStyle = { style: 'color:#b62e24' };\r\n const keywordStyle = { style: 'color:#9d288c' };\r\n // custom formatter for Chrome\r\n // https://www.mattzeunert.com/2016/02/19/custom-chrome-devtools-object-formatters.html\r\n const formatter = {\r\n header(obj) {\r\n // TODO also format ComponentPublicInstance & ctx.slots/attrs in setup\r\n if (!shared_esm_bundler_isObject(obj)) {\r\n return null;\r\n }\r\n if (obj.__isVue) {\r\n return ['div', vueStyle, `VueInstance`];\r\n }\r\n else if (isRef(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, genRefFlag(obj)],\r\n '<',\r\n formatValue(obj.value),\r\n `>`\r\n ];\r\n }\r\n else if (isReactive(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, 'Reactive'],\r\n '<',\r\n formatValue(obj),\r\n `>${isReadonly(obj) ? ` (readonly)` : ``}`\r\n ];\r\n }\r\n else if (isReadonly(obj)) {\r\n return [\r\n 'div',\r\n {},\r\n ['span', vueStyle, 'Readonly'],\r\n '<',\r\n formatValue(obj),\r\n '>'\r\n ];\r\n }\r\n return null;\r\n },\r\n hasBody(obj) {\r\n return obj && obj.__isVue;\r\n },\r\n body(obj) {\r\n if (obj && obj.__isVue) {\r\n return [\r\n 'div',\r\n {},\r\n ...formatInstance(obj.$)\r\n ];\r\n }\r\n }\r\n };\r\n function formatInstance(instance) {\r\n const blocks = [];\r\n if (instance.type.props && instance.props) {\r\n blocks.push(createInstanceBlock('props', reactivity_esm_bundler_toRaw(instance.props)));\r\n }\r\n if (instance.setupState !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('setup', instance.setupState));\r\n }\r\n if (instance.data !== EMPTY_OBJ) {\r\n blocks.push(createInstanceBlock('data', reactivity_esm_bundler_toRaw(instance.data)));\r\n }\r\n const computed = extractKeys(instance, 'computed');\r\n if (computed) {\r\n blocks.push(createInstanceBlock('computed', computed));\r\n }\r\n const injected = extractKeys(instance, 'inject');\r\n if (injected) {\r\n blocks.push(createInstanceBlock('injected', injected));\r\n }\r\n blocks.push([\r\n 'div',\r\n {},\r\n [\r\n 'span',\r\n {\r\n style: keywordStyle.style + ';opacity:0.66'\r\n },\r\n '$ (internal): '\r\n ],\r\n ['object', { object: instance }]\r\n ]);\r\n return blocks;\r\n }\r\n function createInstanceBlock(type, target) {\r\n target = shared_esm_bundler_extend({}, target);\r\n if (!Object.keys(target).length) {\r\n return ['span', {}];\r\n }\r\n return [\r\n 'div',\r\n { style: 'line-height:1.25em;margin-bottom:0.6em' },\r\n [\r\n 'div',\r\n {\r\n style: 'color:#476582'\r\n },\r\n type\r\n ],\r\n [\r\n 'div',\r\n {\r\n style: 'padding-left:1.25em'\r\n },\r\n ...Object.keys(target).map(key => {\r\n return [\r\n 'div',\r\n {},\r\n ['span', keywordStyle, key + ': '],\r\n formatValue(target[key], false)\r\n ];\r\n })\r\n ]\r\n ];\r\n }\r\n function formatValue(v, asRaw = true) {\r\n if (typeof v === 'number') {\r\n return ['span', numberStyle, v];\r\n }\r\n else if (typeof v === 'string') {\r\n return ['span', stringStyle, JSON.stringify(v)];\r\n }\r\n else if (typeof v === 'boolean') {\r\n return ['span', keywordStyle, v];\r\n }\r\n else if (shared_esm_bundler_isObject(v)) {\r\n return ['object', { object: asRaw ? reactivity_esm_bundler_toRaw(v) : v }];\r\n }\r\n else {\r\n return ['span', stringStyle, String(v)];\r\n }\r\n }\r\n function extractKeys(instance, type) {\r\n const Comp = instance.type;\r\n if (isFunction(Comp)) {\r\n return;\r\n }\r\n const extracted = {};\r\n for (const key in instance.ctx) {\r\n if (isKeyOfType(Comp, key, type)) {\r\n extracted[key] = instance.ctx[key];\r\n }\r\n }\r\n return extracted;\r\n }\r\n function isKeyOfType(Comp, key, type) {\r\n const opts = Comp[type];\r\n if ((shared_esm_bundler_isArray(opts) && opts.includes(key)) ||\r\n (shared_esm_bundler_isObject(opts) && key in opts)) {\r\n return true;\r\n }\r\n if (Comp.extends && isKeyOfType(Comp.extends, key, type)) {\r\n return true;\r\n }\r\n if (Comp.mixins && Comp.mixins.some(m => isKeyOfType(m, key, type))) {\r\n return true;\r\n }\r\n }\r\n function genRefFlag(v) {\r\n if (v._shallow) {\r\n return `ShallowRef`;\r\n }\r\n if (v.effect) {\r\n return `ComputedRef`;\r\n }\r\n return `Ref`;\r\n }\r\n if (window.devtoolsFormatters) {\r\n window.devtoolsFormatters.push(formatter);\r\n }\r\n else {\r\n window.devtoolsFormatters = [formatter];\r\n }\r\n}\n\nfunction withMemo(memo, render, cache, index) {\r\n const cached = cache[index];\r\n if (cached && isMemoSame(cached, memo)) {\r\n return cached;\r\n }\r\n const ret = render();\r\n // shallow clone\r\n ret.memo = memo.slice();\r\n return (cache[index] = ret);\r\n}\r\nfunction isMemoSame(cached, memo) {\r\n const prev = cached.memo;\r\n if (prev.length != memo.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < prev.length; i++) {\r\n if (prev[i] !== memo[i]) {\r\n return false;\r\n }\r\n }\r\n // make sure to let parent block track it when returning cached\r\n if (isBlockTreeEnabled > 0 && currentBlock) {\r\n currentBlock.push(cached);\r\n }\r\n return true;\r\n}\n\n// Core API ------------------------------------------------------------------\r\nconst version = \"3.2.22\";\r\nconst _ssrUtils = {\r\n createComponentInstance,\r\n setupComponent,\r\n renderComponentRoot,\r\n setCurrentRenderingInstance,\r\n isVNode,\r\n normalizeVNode\r\n};\r\n/**\r\n * SSR utils for \\@vue/server-renderer. Only exposed in cjs builds.\r\n * @internal\r\n */\r\nconst ssrUtils = (_ssrUtils );\r\n/**\r\n * @internal only exposed in compat builds\r\n */\r\nconst resolveFilter = null;\r\n/**\r\n * @internal only exposed in compat builds.\r\n */\r\nconst compatUtils = (null);\n\n\n\n;// CONCATENATED MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js\n\n\n\n\nconst svgNS = 'http://www.w3.org/2000/svg';\r\nconst doc = (typeof document !== 'undefined' ? document : null);\r\nconst staticTemplateCache = new Map();\r\nconst nodeOps = {\r\n insert: (child, parent, anchor) => {\r\n parent.insertBefore(child, anchor || null);\r\n },\r\n remove: child => {\r\n const parent = child.parentNode;\r\n if (parent) {\r\n parent.removeChild(child);\r\n }\r\n },\r\n createElement: (tag, isSVG, is, props) => {\r\n const el = isSVG\r\n ? doc.createElementNS(svgNS, tag)\r\n : doc.createElement(tag, is ? { is } : undefined);\r\n if (tag === 'select' && props && props.multiple != null) {\r\n el.setAttribute('multiple', props.multiple);\r\n }\r\n return el;\r\n },\r\n createText: text => doc.createTextNode(text),\r\n createComment: text => doc.createComment(text),\r\n setText: (node, text) => {\r\n node.nodeValue = text;\r\n },\r\n setElementText: (el, text) => {\r\n el.textContent = text;\r\n },\r\n parentNode: node => node.parentNode,\r\n nextSibling: node => node.nextSibling,\r\n querySelector: selector => doc.querySelector(selector),\r\n setScopeId(el, id) {\r\n el.setAttribute(id, '');\r\n },\r\n cloneNode(el) {\r\n const cloned = el.cloneNode(true);\r\n // #3072\r\n // - in `patchDOMProp`, we store the actual value in the `el._value` property.\r\n // - normally, elements using `:value` bindings will not be hoisted, but if\r\n // the bound value is a constant, e.g. `:value=\"true\"` - they do get\r\n // hoisted.\r\n // - in production, hoisted nodes are cloned when subsequent inserts, but\r\n // cloneNode() does not copy the custom property we attached.\r\n // - This may need to account for other custom DOM properties we attach to\r\n // elements in addition to `_value` in the future.\r\n if (`_value` in el) {\r\n cloned._value = el._value;\r\n }\r\n return cloned;\r\n },\r\n // __UNSAFE__\r\n // Reason: innerHTML.\r\n // Static content here can only come from compiled templates.\r\n // As long as the user only uses trusted templates, this is safe.\r\n insertStaticContent(content, parent, anchor, isSVG) {\r\n // <parent> before | first ... last | anchor </parent>\r\n const before = anchor ? anchor.previousSibling : parent.lastChild;\r\n let template = staticTemplateCache.get(content);\r\n if (!template) {\r\n const t = doc.createElement('template');\r\n t.innerHTML = isSVG ? `<svg>${content}</svg>` : content;\r\n template = t.content;\r\n if (isSVG) {\r\n // remove outer svg wrapper\r\n const wrapper = template.firstChild;\r\n while (wrapper.firstChild) {\r\n template.appendChild(wrapper.firstChild);\r\n }\r\n template.removeChild(wrapper);\r\n }\r\n staticTemplateCache.set(content, template);\r\n }\r\n parent.insertBefore(template.cloneNode(true), anchor);\r\n return [\r\n // first\r\n before ? before.nextSibling : parent.firstChild,\r\n // last\r\n anchor ? anchor.previousSibling : parent.lastChild\r\n ];\r\n }\r\n};\n\n// compiler should normalize class + :class bindings on the same element\r\n// into a single binding ['staticClass', dynamic]\r\nfunction patchClass(el, value, isSVG) {\r\n // directly setting className should be faster than setAttribute in theory\r\n // if this is an element during a transition, take the temporary transition\r\n // classes into account.\r\n const transitionClasses = el._vtc;\r\n if (transitionClasses) {\r\n value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(' ');\r\n }\r\n if (value == null) {\r\n el.removeAttribute('class');\r\n }\r\n else if (isSVG) {\r\n el.setAttribute('class', value);\r\n }\r\n else {\r\n el.className = value;\r\n }\r\n}\n\nfunction patchStyle(el, prev, next) {\r\n const style = el.style;\r\n const isCssString = shared_esm_bundler_isString(next);\r\n if (next && !isCssString) {\r\n for (const key in next) {\r\n setStyle(style, key, next[key]);\r\n }\r\n if (prev && !shared_esm_bundler_isString(prev)) {\r\n for (const key in prev) {\r\n if (next[key] == null) {\r\n setStyle(style, key, '');\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n const currentDisplay = style.display;\r\n if (isCssString) {\r\n if (prev !== next) {\r\n style.cssText = next;\r\n }\r\n }\r\n else if (prev) {\r\n el.removeAttribute('style');\r\n }\r\n // indicates that the `display` of the element is controlled by `v-show`,\r\n // so we always keep the current `display` value regardless of the `style`\r\n // value, thus handing over control to `v-show`.\r\n if ('_vod' in el) {\r\n style.display = currentDisplay;\r\n }\r\n }\r\n}\r\nconst importantRE = /\\s*!important$/;\r\nfunction setStyle(style, name, val) {\r\n if (shared_esm_bundler_isArray(val)) {\r\n val.forEach(v => setStyle(style, name, v));\r\n }\r\n else {\r\n if (name.startsWith('--')) {\r\n // custom property definition\r\n style.setProperty(name, val);\r\n }\r\n else {\r\n const prefixed = autoPrefix(style, name);\r\n if (importantRE.test(val)) {\r\n // !important\r\n style.setProperty(shared_esm_bundler_hyphenate(prefixed), val.replace(importantRE, ''), 'important');\r\n }\r\n else {\r\n style[prefixed] = val;\r\n }\r\n }\r\n }\r\n}\r\nconst prefixes = ['Webkit', 'Moz', 'ms'];\r\nconst prefixCache = {};\r\nfunction autoPrefix(style, rawName) {\r\n const cached = prefixCache[rawName];\r\n if (cached) {\r\n return cached;\r\n }\r\n let name = camelize(rawName);\r\n if (name !== 'filter' && name in style) {\r\n return (prefixCache[rawName] = name);\r\n }\r\n name = shared_esm_bundler_capitalize(name);\r\n for (let i = 0; i < prefixes.length; i++) {\r\n const prefixed = prefixes[i] + name;\r\n if (prefixed in style) {\r\n return (prefixCache[rawName] = prefixed);\r\n }\r\n }\r\n return rawName;\r\n}\n\nconst xlinkNS = 'http://www.w3.org/1999/xlink';\r\nfunction patchAttr(el, key, value, isSVG, instance) {\r\n if (isSVG && key.startsWith('xlink:')) {\r\n if (value == null) {\r\n el.removeAttributeNS(xlinkNS, key.slice(6, key.length));\r\n }\r\n else {\r\n el.setAttributeNS(xlinkNS, key, value);\r\n }\r\n }\r\n else {\r\n // note we are only checking boolean attributes that don't have a\r\n // corresponding dom prop of the same name here.\r\n const isBoolean = isSpecialBooleanAttr(key);\r\n if (value == null || (isBoolean && !includeBooleanAttr(value))) {\r\n el.removeAttribute(key);\r\n }\r\n else {\r\n el.setAttribute(key, isBoolean ? '' : value);\r\n }\r\n }\r\n}\n\n// __UNSAFE__\r\n// functions. The user is responsible for using them with only trusted content.\r\nfunction patchDOMProp(el, key, value, \r\n// the following args are passed only due to potential innerHTML/textContent\r\n// overriding existing VNodes, in which case the old tree must be properly\r\n// unmounted.\r\nprevChildren, parentComponent, parentSuspense, unmountChildren) {\r\n if (key === 'innerHTML' || key === 'textContent') {\r\n if (prevChildren) {\r\n unmountChildren(prevChildren, parentComponent, parentSuspense);\r\n }\r\n el[key] = value == null ? '' : value;\r\n return;\r\n }\r\n if (key === 'value' && el.tagName !== 'PROGRESS') {\r\n // store value as _value as well since\r\n // non-string values will be stringified.\r\n el._value = value;\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue) {\r\n el.value = newValue;\r\n }\r\n if (value == null) {\r\n el.removeAttribute(key);\r\n }\r\n return;\r\n }\r\n if (value === '' || value == null) {\r\n const type = typeof el[key];\r\n if (type === 'boolean') {\r\n // e.g. <select multiple> compiles to { multiple: '' }\r\n el[key] = includeBooleanAttr(value);\r\n return;\r\n }\r\n else if (value == null && type === 'string') {\r\n // e.g. <div :id=\"null\">\r\n el[key] = '';\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n else if (type === 'number') {\r\n // e.g. <img :width=\"null\">\r\n // the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error\r\n try {\r\n el[key] = 0;\r\n }\r\n catch (_a) { }\r\n el.removeAttribute(key);\r\n return;\r\n }\r\n }\r\n // some properties perform value validation and throw\r\n try {\r\n el[key] = value;\r\n }\r\n catch (e) {\r\n if ((false)) {}\r\n }\r\n}\n\n// Async edge case fix requires storing an event listener's attach timestamp.\r\nlet _getNow = Date.now;\r\nlet skipTimestampCheck = false;\r\nif (typeof window !== 'undefined') {\r\n // Determine what event timestamp the browser is using. Annoyingly, the\r\n // timestamp can either be hi-res (relative to page load) or low-res\r\n // (relative to UNIX epoch), so in order to compare time we have to use the\r\n // same timestamp type when saving the flush timestamp.\r\n if (_getNow() > document.createEvent('Event').timeStamp) {\r\n // if the low-res timestamp which is bigger than the event timestamp\r\n // (which is evaluated AFTER) it means the event is using a hi-res timestamp,\r\n // and we need to use the hi-res version for event listeners as well.\r\n _getNow = () => performance.now();\r\n }\r\n // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation\r\n // and does not fire microtasks in between event propagation, so safe to exclude.\r\n const ffMatch = navigator.userAgent.match(/firefox\\/(\\d+)/i);\r\n skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);\r\n}\r\n// To avoid the overhead of repeatedly calling performance.now(), we cache\r\n// and use the same timestamp for all event listeners attached in the same tick.\r\nlet cachedNow = 0;\r\nconst p = Promise.resolve();\r\nconst runtime_dom_esm_bundler_reset = () => {\r\n cachedNow = 0;\r\n};\r\nconst getNow = () => cachedNow || (p.then(runtime_dom_esm_bundler_reset), (cachedNow = _getNow()));\r\nfunction addEventListener(el, event, handler, options) {\r\n el.addEventListener(event, handler, options);\r\n}\r\nfunction removeEventListener(el, event, handler, options) {\r\n el.removeEventListener(event, handler, options);\r\n}\r\nfunction patchEvent(el, rawName, prevValue, nextValue, instance = null) {\r\n // vei = vue event invokers\r\n const invokers = el._vei || (el._vei = {});\r\n const existingInvoker = invokers[rawName];\r\n if (nextValue && existingInvoker) {\r\n // patch\r\n existingInvoker.value = nextValue;\r\n }\r\n else {\r\n const [name, options] = parseName(rawName);\r\n if (nextValue) {\r\n // add\r\n const invoker = (invokers[rawName] = createInvoker(nextValue, instance));\r\n addEventListener(el, name, invoker, options);\r\n }\r\n else if (existingInvoker) {\r\n // remove\r\n removeEventListener(el, name, existingInvoker, options);\r\n invokers[rawName] = undefined;\r\n }\r\n }\r\n}\r\nconst optionsModifierRE = /(?:Once|Passive|Capture)$/;\r\nfunction parseName(name) {\r\n let options;\r\n if (optionsModifierRE.test(name)) {\r\n options = {};\r\n let m;\r\n while ((m = name.match(optionsModifierRE))) {\r\n name = name.slice(0, name.length - m[0].length);\r\n options[m[0].toLowerCase()] = true;\r\n }\r\n }\r\n return [shared_esm_bundler_hyphenate(name.slice(2)), options];\r\n}\r\nfunction createInvoker(initialValue, instance) {\r\n const invoker = (e) => {\r\n // async edge case #6566: inner click event triggers patch, event handler\r\n // attached to outer element during patch, and triggered again. This\r\n // happens because browsers fire microtask ticks between event propagation.\r\n // the solution is simple: we save the timestamp when a handler is attached,\r\n // and the handler would only fire if the event passed to it was fired\r\n // AFTER it was attached.\r\n const timeStamp = e.timeStamp || _getNow();\r\n if (skipTimestampCheck || timeStamp >= invoker.attached - 1) {\r\n callWithAsyncErrorHandling(patchStopImmediatePropagation(e, invoker.value), instance, 5 /* NATIVE_EVENT_HANDLER */, [e]);\r\n }\r\n };\r\n invoker.value = initialValue;\r\n invoker.attached = getNow();\r\n return invoker;\r\n}\r\nfunction patchStopImmediatePropagation(e, value) {\r\n if (shared_esm_bundler_isArray(value)) {\r\n const originalStop = e.stopImmediatePropagation;\r\n e.stopImmediatePropagation = () => {\r\n originalStop.call(e);\r\n e._stopped = true;\r\n };\r\n return value.map(fn => (e) => !e._stopped && fn(e));\r\n }\r\n else {\r\n return value;\r\n }\r\n}\n\nconst nativeOnRE = /^on[a-z]/;\r\nconst patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {\r\n if (key === 'class') {\r\n patchClass(el, nextValue, isSVG);\r\n }\r\n else if (key === 'style') {\r\n patchStyle(el, prevValue, nextValue);\r\n }\r\n else if (isOn(key)) {\r\n // ignore v-model listeners\r\n if (!isModelListener(key)) {\r\n patchEvent(el, key, prevValue, nextValue, parentComponent);\r\n }\r\n }\r\n else if (key[0] === '.'\r\n ? ((key = key.slice(1)), true)\r\n : key[0] === '^'\r\n ? ((key = key.slice(1)), false)\r\n : shouldSetAsProp(el, key, nextValue, isSVG)) {\r\n patchDOMProp(el, key, nextValue, prevChildren, parentComponent, parentSuspense, unmountChildren);\r\n }\r\n else {\r\n // special case for <input v-model type=\"checkbox\"> with\r\n // :true-value & :false-value\r\n // store value as dom properties since non-string values will be\r\n // stringified.\r\n if (key === 'true-value') {\r\n el._trueValue = nextValue;\r\n }\r\n else if (key === 'false-value') {\r\n el._falseValue = nextValue;\r\n }\r\n patchAttr(el, key, nextValue, isSVG);\r\n }\r\n};\r\nfunction shouldSetAsProp(el, key, value, isSVG) {\r\n if (isSVG) {\r\n // most keys must be set as attribute on svg elements to work\r\n // ...except innerHTML & textContent\r\n if (key === 'innerHTML' || key === 'textContent') {\r\n return true;\r\n }\r\n // or native onclick with function values\r\n if (key in el && nativeOnRE.test(key) && isFunction(value)) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n // spellcheck and draggable are numerated attrs, however their\r\n // corresponding DOM properties are actually booleans - this leads to\r\n // setting it with a string \"false\" value leading it to be coerced to\r\n // `true`, so we need to always treat them as attributes.\r\n // Note that `contentEditable` doesn't have this problem: its DOM\r\n // property is also enumerated string values.\r\n if (key === 'spellcheck' || key === 'draggable') {\r\n return false;\r\n }\r\n // #1787, #2840 form property on form elements is readonly and must be set as\r\n // attribute.\r\n if (key === 'form') {\r\n return false;\r\n }\r\n // #1526 <input list> must be set as attribute\r\n if (key === 'list' && el.tagName === 'INPUT') {\r\n return false;\r\n }\r\n // #2766 <textarea type> must be set as attribute\r\n if (key === 'type' && el.tagName === 'TEXTAREA') {\r\n return false;\r\n }\r\n // native onclick with string value, must be set as attribute\r\n if (nativeOnRE.test(key) && shared_esm_bundler_isString(value)) {\r\n return false;\r\n }\r\n return key in el;\r\n}\n\nfunction defineCustomElement(options, hydate) {\r\n const Comp = defineComponent(options);\r\n class VueCustomElement extends VueElement {\r\n constructor(initialProps) {\r\n super(Comp, initialProps, hydate);\r\n }\r\n }\r\n VueCustomElement.def = Comp;\r\n return VueCustomElement;\r\n}\r\nconst defineSSRCustomElement = ((options) => {\r\n // @ts-ignore\r\n return defineCustomElement(options, hydrate);\r\n});\r\nconst BaseClass = (typeof HTMLElement !== 'undefined' ? HTMLElement : class {\r\n});\r\nclass VueElement extends BaseClass {\r\n constructor(_def, _props = {}, hydrate) {\r\n super();\r\n this._def = _def;\r\n this._props = _props;\r\n /**\r\n * @internal\r\n */\r\n this._instance = null;\r\n this._connected = false;\r\n this._resolved = false;\r\n this._numberProps = null;\r\n if (this.shadowRoot && hydrate) {\r\n hydrate(this._createVNode(), this.shadowRoot);\r\n }\r\n else {\r\n if (false) {}\r\n this.attachShadow({ mode: 'open' });\r\n }\r\n }\r\n connectedCallback() {\r\n this._connected = true;\r\n if (!this._instance) {\r\n this._resolveDef();\r\n }\r\n }\r\n disconnectedCallback() {\r\n this._connected = false;\r\n nextTick(() => {\r\n if (!this._connected) {\r\n render(null, this.shadowRoot);\r\n this._instance = null;\r\n }\r\n });\r\n }\r\n /**\r\n * resolve inner component definition (handle possible async component)\r\n */\r\n _resolveDef() {\r\n if (this._resolved) {\r\n return;\r\n }\r\n this._resolved = true;\r\n // set initial attrs\r\n for (let i = 0; i < this.attributes.length; i++) {\r\n this._setAttr(this.attributes[i].name);\r\n }\r\n // watch future attr changes\r\n new MutationObserver(mutations => {\r\n for (const m of mutations) {\r\n this._setAttr(m.attributeName);\r\n }\r\n }).observe(this, { attributes: true });\r\n const resolve = (def) => {\r\n const { props, styles } = def;\r\n const hasOptions = !shared_esm_bundler_isArray(props);\r\n const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];\r\n // cast Number-type props set before resolve\r\n let numberProps;\r\n if (hasOptions) {\r\n for (const key in this._props) {\r\n const opt = props[key];\r\n if (opt === Number || (opt && opt.type === Number)) {\r\n this._props[key] = toNumber(this._props[key]);\r\n (numberProps || (numberProps = Object.create(null)))[key] = true;\r\n }\r\n }\r\n }\r\n this._numberProps = numberProps;\r\n // check if there are props set pre-upgrade or connect\r\n for (const key of Object.keys(this)) {\r\n if (key[0] !== '_') {\r\n this._setProp(key, this[key], true, false);\r\n }\r\n }\r\n // defining getter/setters on prototype\r\n for (const key of rawKeys.map(camelize)) {\r\n Object.defineProperty(this, key, {\r\n get() {\r\n return this._getProp(key);\r\n },\r\n set(val) {\r\n this._setProp(key, val);\r\n }\r\n });\r\n }\r\n // apply CSS\r\n this._applyStyles(styles);\r\n // initial render\r\n this._update();\r\n };\r\n const asyncDef = this._def.__asyncLoader;\r\n if (asyncDef) {\r\n asyncDef().then(resolve);\r\n }\r\n else {\r\n resolve(this._def);\r\n }\r\n }\r\n _setAttr(key) {\r\n let value = this.getAttribute(key);\r\n if (this._numberProps && this._numberProps[key]) {\r\n value = toNumber(value);\r\n }\r\n this._setProp(camelize(key), value, false);\r\n }\r\n /**\r\n * @internal\r\n */\r\n _getProp(key) {\r\n return this._props[key];\r\n }\r\n /**\r\n * @internal\r\n */\r\n _setProp(key, val, shouldReflect = true, shouldUpdate = true) {\r\n if (val !== this._props[key]) {\r\n this._props[key] = val;\r\n if (shouldUpdate && this._instance) {\r\n this._update();\r\n }\r\n // reflect\r\n if (shouldReflect) {\r\n if (val === true) {\r\n this.setAttribute(shared_esm_bundler_hyphenate(key), '');\r\n }\r\n else if (typeof val === 'string' || typeof val === 'number') {\r\n this.setAttribute(shared_esm_bundler_hyphenate(key), val + '');\r\n }\r\n else if (!val) {\r\n this.removeAttribute(shared_esm_bundler_hyphenate(key));\r\n }\r\n }\r\n }\r\n }\r\n _update() {\r\n render(this._createVNode(), this.shadowRoot);\r\n }\r\n _createVNode() {\r\n const vnode = createVNode(this._def, shared_esm_bundler_extend({}, this._props));\r\n if (!this._instance) {\r\n vnode.ce = instance => {\r\n this._instance = instance;\r\n instance.isCE = true;\r\n // HMR\r\n if ((false)) {}\r\n // intercept emit\r\n instance.emit = (event, ...args) => {\r\n this.dispatchEvent(new CustomEvent(event, {\r\n detail: args\r\n }));\r\n };\r\n // locate nearest Vue custom element parent for provide/inject\r\n let parent = this;\r\n while ((parent =\r\n parent && (parent.parentNode || parent.host))) {\r\n if (parent instanceof VueElement) {\r\n instance.parent = parent._instance;\r\n break;\r\n }\r\n }\r\n };\r\n }\r\n return vnode;\r\n }\r\n _applyStyles(styles) {\r\n if (styles) {\r\n styles.forEach(css => {\r\n const s = document.createElement('style');\r\n s.textContent = css;\r\n this.shadowRoot.appendChild(s);\r\n // record for HMR\r\n if ((false)) {}\r\n });\r\n }\r\n }\r\n}\n\nfunction useCssModule(name = '$style') {\r\n /* istanbul ignore else */\r\n {\r\n const instance = getCurrentInstance();\r\n if (!instance) {\r\n ( false) && 0;\r\n return EMPTY_OBJ;\r\n }\r\n const modules = instance.type.__cssModules;\r\n if (!modules) {\r\n ( false) && 0;\r\n return EMPTY_OBJ;\r\n }\r\n const mod = modules[name];\r\n if (!mod) {\r\n ( false) &&\r\n 0;\r\n return EMPTY_OBJ;\r\n }\r\n return mod;\r\n }\r\n}\n\n/**\r\n * Runtime helper for SFC's CSS variable injection feature.\r\n * @private\r\n */\r\nfunction useCssVars(getter) {\r\n const instance = getCurrentInstance();\r\n /* istanbul ignore next */\r\n if (!instance) {\r\n ( false) &&\r\n 0;\r\n return;\r\n }\r\n const setVars = () => setVarsOnVNode(instance.subTree, getter(instance.proxy));\r\n watchPostEffect(setVars);\r\n onMounted(() => {\r\n const ob = new MutationObserver(setVars);\r\n ob.observe(instance.subTree.el.parentNode, { childList: true });\r\n onUnmounted(() => ob.disconnect());\r\n });\r\n}\r\nfunction setVarsOnVNode(vnode, vars) {\r\n if (vnode.shapeFlag & 128 /* SUSPENSE */) {\r\n const suspense = vnode.suspense;\r\n vnode = suspense.activeBranch;\r\n if (suspense.pendingBranch && !suspense.isHydrating) {\r\n suspense.effects.push(() => {\r\n setVarsOnVNode(suspense.activeBranch, vars);\r\n });\r\n }\r\n }\r\n // drill down HOCs until it's a non-component vnode\r\n while (vnode.component) {\r\n vnode = vnode.component.subTree;\r\n }\r\n if (vnode.shapeFlag & 1 /* ELEMENT */ && vnode.el) {\r\n setVarsOnNode(vnode.el, vars);\r\n }\r\n else if (vnode.type === Fragment) {\r\n vnode.children.forEach(c => setVarsOnVNode(c, vars));\r\n }\r\n else if (vnode.type === Static) {\r\n let { el, anchor } = vnode;\r\n while (el) {\r\n setVarsOnNode(el, vars);\r\n if (el === anchor)\r\n break;\r\n el = el.nextSibling;\r\n }\r\n }\r\n}\r\nfunction setVarsOnNode(el, vars) {\r\n if (el.nodeType === 1) {\r\n const style = el.style;\r\n for (const key in vars) {\r\n style.setProperty(`--${key}`, vars[key]);\r\n }\r\n }\r\n}\n\nconst TRANSITION = 'transition';\r\nconst ANIMATION = 'animation';\r\n// DOM Transition is a higher-order-component based on the platform-agnostic\r\n// base Transition component, with DOM-specific logic.\r\nconst Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);\r\nTransition.displayName = 'Transition';\r\nconst DOMTransitionPropsValidators = {\r\n name: String,\r\n type: String,\r\n css: {\r\n type: Boolean,\r\n default: true\r\n },\r\n duration: [String, Number, Object],\r\n enterFromClass: String,\r\n enterActiveClass: String,\r\n enterToClass: String,\r\n appearFromClass: String,\r\n appearActiveClass: String,\r\n appearToClass: String,\r\n leaveFromClass: String,\r\n leaveActiveClass: String,\r\n leaveToClass: String\r\n};\r\nconst TransitionPropsValidators = (Transition.props =\r\n /*#__PURE__*/ shared_esm_bundler_extend({}, BaseTransition.props, DOMTransitionPropsValidators));\r\n/**\r\n * #3227 Incoming hooks may be merged into arrays when wrapping Transition\r\n * with custom HOCs.\r\n */\r\nconst runtime_dom_esm_bundler_callHook = (hook, args = []) => {\r\n if (shared_esm_bundler_isArray(hook)) {\r\n hook.forEach(h => h(...args));\r\n }\r\n else if (hook) {\r\n hook(...args);\r\n }\r\n};\r\n/**\r\n * Check if a hook expects a callback (2nd arg), which means the user\r\n * intends to explicitly control the end of the transition.\r\n */\r\nconst hasExplicitCallback = (hook) => {\r\n return hook\r\n ? shared_esm_bundler_isArray(hook)\r\n ? hook.some(h => h.length > 1)\r\n : hook.length > 1\r\n : false;\r\n};\r\nfunction resolveTransitionProps(rawProps) {\r\n const baseProps = {};\r\n for (const key in rawProps) {\r\n if (!(key in DOMTransitionPropsValidators)) {\r\n baseProps[key] = rawProps[key];\r\n }\r\n }\r\n if (rawProps.css === false) {\r\n return baseProps;\r\n }\r\n const { name = 'v', type, duration, enterFromClass = `${name}-enter-from`, enterActiveClass = `${name}-enter-active`, enterToClass = `${name}-enter-to`, appearFromClass = enterFromClass, appearActiveClass = enterActiveClass, appearToClass = enterToClass, leaveFromClass = `${name}-leave-from`, leaveActiveClass = `${name}-leave-active`, leaveToClass = `${name}-leave-to` } = rawProps;\r\n const durations = normalizeDuration(duration);\r\n const enterDuration = durations && durations[0];\r\n const leaveDuration = durations && durations[1];\r\n const { onBeforeEnter, onEnter, onEnterCancelled, onLeave, onLeaveCancelled, onBeforeAppear = onBeforeEnter, onAppear = onEnter, onAppearCancelled = onEnterCancelled } = baseProps;\r\n const finishEnter = (el, isAppear, done) => {\r\n removeTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);\r\n done && done();\r\n };\r\n const finishLeave = (el, done) => {\r\n removeTransitionClass(el, leaveToClass);\r\n removeTransitionClass(el, leaveActiveClass);\r\n done && done();\r\n };\r\n const makeEnterHook = (isAppear) => {\r\n return (el, done) => {\r\n const hook = isAppear ? onAppear : onEnter;\r\n const resolve = () => finishEnter(el, isAppear, done);\r\n runtime_dom_esm_bundler_callHook(hook, [el, resolve]);\r\n nextFrame(() => {\r\n removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);\r\n addTransitionClass(el, isAppear ? appearToClass : enterToClass);\r\n if (!hasExplicitCallback(hook)) {\r\n whenTransitionEnds(el, type, enterDuration, resolve);\r\n }\r\n });\r\n };\r\n };\r\n return shared_esm_bundler_extend(baseProps, {\r\n onBeforeEnter(el) {\r\n runtime_dom_esm_bundler_callHook(onBeforeEnter, [el]);\r\n addTransitionClass(el, enterFromClass);\r\n addTransitionClass(el, enterActiveClass);\r\n },\r\n onBeforeAppear(el) {\r\n runtime_dom_esm_bundler_callHook(onBeforeAppear, [el]);\r\n addTransitionClass(el, appearFromClass);\r\n addTransitionClass(el, appearActiveClass);\r\n },\r\n onEnter: makeEnterHook(false),\r\n onAppear: makeEnterHook(true),\r\n onLeave(el, done) {\r\n const resolve = () => finishLeave(el, done);\r\n addTransitionClass(el, leaveFromClass);\r\n // force reflow so *-leave-from classes immediately take effect (#2593)\r\n forceReflow();\r\n addTransitionClass(el, leaveActiveClass);\r\n nextFrame(() => {\r\n removeTransitionClass(el, leaveFromClass);\r\n addTransitionClass(el, leaveToClass);\r\n if (!hasExplicitCallback(onLeave)) {\r\n whenTransitionEnds(el, type, leaveDuration, resolve);\r\n }\r\n });\r\n runtime_dom_esm_bundler_callHook(onLeave, [el, resolve]);\r\n },\r\n onEnterCancelled(el) {\r\n finishEnter(el, false);\r\n runtime_dom_esm_bundler_callHook(onEnterCancelled, [el]);\r\n },\r\n onAppearCancelled(el) {\r\n finishEnter(el, true);\r\n runtime_dom_esm_bundler_callHook(onAppearCancelled, [el]);\r\n },\r\n onLeaveCancelled(el) {\r\n finishLeave(el);\r\n runtime_dom_esm_bundler_callHook(onLeaveCancelled, [el]);\r\n }\r\n });\r\n}\r\nfunction normalizeDuration(duration) {\r\n if (duration == null) {\r\n return null;\r\n }\r\n else if (shared_esm_bundler_isObject(duration)) {\r\n return [NumberOf(duration.enter), NumberOf(duration.leave)];\r\n }\r\n else {\r\n const n = NumberOf(duration);\r\n return [n, n];\r\n }\r\n}\r\nfunction NumberOf(val) {\r\n const res = toNumber(val);\r\n if ((false))\r\n {}\r\n return res;\r\n}\r\nfunction validateDuration(val) {\r\n if (typeof val !== 'number') {\r\n warn(`<transition> explicit duration is not a valid number - ` +\r\n `got ${JSON.stringify(val)}.`);\r\n }\r\n else if (isNaN(val)) {\r\n warn(`<transition> explicit duration is NaN - ` +\r\n 'the duration expression might be incorrect.');\r\n }\r\n}\r\nfunction addTransitionClass(el, cls) {\r\n cls.split(/\\s+/).forEach(c => c && el.classList.add(c));\r\n (el._vtc ||\r\n (el._vtc = new Set())).add(cls);\r\n}\r\nfunction removeTransitionClass(el, cls) {\r\n cls.split(/\\s+/).forEach(c => c && el.classList.remove(c));\r\n const { _vtc } = el;\r\n if (_vtc) {\r\n _vtc.delete(cls);\r\n if (!_vtc.size) {\r\n el._vtc = undefined;\r\n }\r\n }\r\n}\r\nfunction nextFrame(cb) {\r\n requestAnimationFrame(() => {\r\n requestAnimationFrame(cb);\r\n });\r\n}\r\nlet endId = 0;\r\nfunction whenTransitionEnds(el, expectedType, explicitTimeout, resolve) {\r\n const id = (el._endId = ++endId);\r\n const resolveIfNotStale = () => {\r\n if (id === el._endId) {\r\n resolve();\r\n }\r\n };\r\n if (explicitTimeout) {\r\n return setTimeout(resolveIfNotStale, explicitTimeout);\r\n }\r\n const { type, timeout, propCount } = getTransitionInfo(el, expectedType);\r\n if (!type) {\r\n return resolve();\r\n }\r\n const endEvent = type + 'end';\r\n let ended = 0;\r\n const end = () => {\r\n el.removeEventListener(endEvent, onEnd);\r\n resolveIfNotStale();\r\n };\r\n const onEnd = (e) => {\r\n if (e.target === el && ++ended >= propCount) {\r\n end();\r\n }\r\n };\r\n setTimeout(() => {\r\n if (ended < propCount) {\r\n end();\r\n }\r\n }, timeout + 1);\r\n el.addEventListener(endEvent, onEnd);\r\n}\r\nfunction getTransitionInfo(el, expectedType) {\r\n const styles = window.getComputedStyle(el);\r\n // JSDOM may return undefined for transition properties\r\n const getStyleProperties = (key) => (styles[key] || '').split(', ');\r\n const transitionDelays = getStyleProperties(TRANSITION + 'Delay');\r\n const transitionDurations = getStyleProperties(TRANSITION + 'Duration');\r\n const transitionTimeout = getTimeout(transitionDelays, transitionDurations);\r\n const animationDelays = getStyleProperties(ANIMATION + 'Delay');\r\n const animationDurations = getStyleProperties(ANIMATION + 'Duration');\r\n const animationTimeout = getTimeout(animationDelays, animationDurations);\r\n let type = null;\r\n let timeout = 0;\r\n let propCount = 0;\r\n /* istanbul ignore if */\r\n if (expectedType === TRANSITION) {\r\n if (transitionTimeout > 0) {\r\n type = TRANSITION;\r\n timeout = transitionTimeout;\r\n propCount = transitionDurations.length;\r\n }\r\n }\r\n else if (expectedType === ANIMATION) {\r\n if (animationTimeout > 0) {\r\n type = ANIMATION;\r\n timeout = animationTimeout;\r\n propCount = animationDurations.length;\r\n }\r\n }\r\n else {\r\n timeout = Math.max(transitionTimeout, animationTimeout);\r\n type =\r\n timeout > 0\r\n ? transitionTimeout > animationTimeout\r\n ? TRANSITION\r\n : ANIMATION\r\n : null;\r\n propCount = type\r\n ? type === TRANSITION\r\n ? transitionDurations.length\r\n : animationDurations.length\r\n : 0;\r\n }\r\n const hasTransform = type === TRANSITION &&\r\n /\\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);\r\n return {\r\n type,\r\n timeout,\r\n propCount,\r\n hasTransform\r\n };\r\n}\r\nfunction getTimeout(delays, durations) {\r\n while (delays.length < durations.length) {\r\n delays = delays.concat(delays);\r\n }\r\n return Math.max(...durations.map((d, i) => toMs(d) + toMs(delays[i])));\r\n}\r\n// Old versions of Chromium (below 61.0.3163.100) formats floating pointer\r\n// numbers in a locale-dependent way, using a comma instead of a dot.\r\n// If comma is not replaced with a dot, the input will be rounded down\r\n// (i.e. acting as a floor function) causing unexpected behaviors\r\nfunction toMs(s) {\r\n return Number(s.slice(0, -1).replace(',', '.')) * 1000;\r\n}\r\n// synchronously force layout to put elements into a certain state\r\nfunction forceReflow() {\r\n return document.body.offsetHeight;\r\n}\n\nconst positionMap = new WeakMap();\r\nconst newPositionMap = new WeakMap();\r\nconst TransitionGroupImpl = {\r\n name: 'TransitionGroup',\r\n props: /*#__PURE__*/ shared_esm_bundler_extend({}, TransitionPropsValidators, {\r\n tag: String,\r\n moveClass: String\r\n }),\r\n setup(props, { slots }) {\r\n const instance = getCurrentInstance();\r\n const state = useTransitionState();\r\n let prevChildren;\r\n let children;\r\n onUpdated(() => {\r\n // children is guaranteed to exist after initial render\r\n if (!prevChildren.length) {\r\n return;\r\n }\r\n const moveClass = props.moveClass || `${props.name || 'v'}-move`;\r\n if (!hasCSSTransform(prevChildren[0].el, instance.vnode.el, moveClass)) {\r\n return;\r\n }\r\n // we divide the work into three loops to avoid mixing DOM reads and writes\r\n // in each iteration - which helps prevent layout thrashing.\r\n prevChildren.forEach(callPendingCbs);\r\n prevChildren.forEach(recordPosition);\r\n const movedChildren = prevChildren.filter(applyTranslation);\r\n // force reflow to put everything in position\r\n forceReflow();\r\n movedChildren.forEach(c => {\r\n const el = c.el;\r\n const style = el.style;\r\n addTransitionClass(el, moveClass);\r\n style.transform = style.webkitTransform = style.transitionDuration = '';\r\n const cb = (el._moveCb = (e) => {\r\n if (e && e.target !== el) {\r\n return;\r\n }\r\n if (!e || /transform$/.test(e.propertyName)) {\r\n el.removeEventListener('transitionend', cb);\r\n el._moveCb = null;\r\n removeTransitionClass(el, moveClass);\r\n }\r\n });\r\n el.addEventListener('transitionend', cb);\r\n });\r\n });\r\n return () => {\r\n const rawProps = reactivity_esm_bundler_toRaw(props);\r\n const cssTransitionProps = resolveTransitionProps(rawProps);\r\n let tag = rawProps.tag || Fragment;\r\n prevChildren = children;\r\n children = slots.default ? getTransitionRawChildren(slots.default()) : [];\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (child.key != null) {\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n }\r\n else if ((false)) {}\r\n }\r\n if (prevChildren) {\r\n for (let i = 0; i < prevChildren.length; i++) {\r\n const child = prevChildren[i];\r\n setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));\r\n positionMap.set(child, child.el.getBoundingClientRect());\r\n }\r\n }\r\n return createVNode(tag, null, children);\r\n };\r\n }\r\n};\r\nconst TransitionGroup = TransitionGroupImpl;\r\nfunction callPendingCbs(c) {\r\n const el = c.el;\r\n if (el._moveCb) {\r\n el._moveCb();\r\n }\r\n if (el._enterCb) {\r\n el._enterCb();\r\n }\r\n}\r\nfunction recordPosition(c) {\r\n newPositionMap.set(c, c.el.getBoundingClientRect());\r\n}\r\nfunction applyTranslation(c) {\r\n const oldPos = positionMap.get(c);\r\n const newPos = newPositionMap.get(c);\r\n const dx = oldPos.left - newPos.left;\r\n const dy = oldPos.top - newPos.top;\r\n if (dx || dy) {\r\n const s = c.el.style;\r\n s.transform = s.webkitTransform = `translate(${dx}px,${dy}px)`;\r\n s.transitionDuration = '0s';\r\n return c;\r\n }\r\n}\r\nfunction hasCSSTransform(el, root, moveClass) {\r\n // Detect whether an element with the move class applied has\r\n // CSS transitions. Since the element may be inside an entering\r\n // transition at this very moment, we make a clone of it and remove\r\n // all other transition classes applied to ensure only the move class\r\n // is applied.\r\n const clone = el.cloneNode();\r\n if (el._vtc) {\r\n el._vtc.forEach(cls => {\r\n cls.split(/\\s+/).forEach(c => c && clone.classList.remove(c));\r\n });\r\n }\r\n moveClass.split(/\\s+/).forEach(c => c && clone.classList.add(c));\r\n clone.style.display = 'none';\r\n const container = (root.nodeType === 1 ? root : root.parentNode);\r\n container.appendChild(clone);\r\n const { hasTransform } = getTransitionInfo(clone);\r\n container.removeChild(clone);\r\n return hasTransform;\r\n}\n\nconst getModelAssigner = (vnode) => {\r\n const fn = vnode.props['onUpdate:modelValue'];\r\n return shared_esm_bundler_isArray(fn) ? value => invokeArrayFns(fn, value) : fn;\r\n};\r\nfunction onCompositionStart(e) {\r\n e.target.composing = true;\r\n}\r\nfunction onCompositionEnd(e) {\r\n const target = e.target;\r\n if (target.composing) {\r\n target.composing = false;\r\n runtime_dom_esm_bundler_trigger(target, 'input');\r\n }\r\n}\r\nfunction runtime_dom_esm_bundler_trigger(el, type) {\r\n const e = document.createEvent('HTMLEvents');\r\n e.initEvent(type, true, true);\r\n el.dispatchEvent(e);\r\n}\r\n// We are exporting the v-model runtime directly as vnode hooks so that it can\r\n// be tree-shaken in case v-model is never used.\r\nconst vModelText = {\r\n created(el, { modifiers: { lazy, trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n const castToNumber = number || (vnode.props && vnode.props.type === 'number');\r\n addEventListener(el, lazy ? 'change' : 'input', e => {\r\n if (e.target.composing)\r\n return;\r\n let domValue = el.value;\r\n if (trim) {\r\n domValue = domValue.trim();\r\n }\r\n else if (castToNumber) {\r\n domValue = toNumber(domValue);\r\n }\r\n el._assign(domValue);\r\n });\r\n if (trim) {\r\n addEventListener(el, 'change', () => {\r\n el.value = el.value.trim();\r\n });\r\n }\r\n if (!lazy) {\r\n addEventListener(el, 'compositionstart', onCompositionStart);\r\n addEventListener(el, 'compositionend', onCompositionEnd);\r\n // Safari < 10.2 & UIWebView doesn't fire compositionend when\r\n // switching focus before confirming composition choice\r\n // this also fixes the issue where some browsers e.g. iOS Chrome\r\n // fires \"change\" instead of \"input\" on autocomplete.\r\n addEventListener(el, 'change', onCompositionEnd);\r\n }\r\n },\r\n // set value on mounted so it's after min/max for type=\"range\"\r\n mounted(el, { value }) {\r\n el.value = value == null ? '' : value;\r\n },\r\n beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n // avoid clearing unresolved text. #2302\r\n if (el.composing)\r\n return;\r\n if (document.activeElement === el) {\r\n if (lazy) {\r\n return;\r\n }\r\n if (trim && el.value.trim() === value) {\r\n return;\r\n }\r\n if ((number || el.type === 'number') && toNumber(el.value) === value) {\r\n return;\r\n }\r\n }\r\n const newValue = value == null ? '' : value;\r\n if (el.value !== newValue) {\r\n el.value = newValue;\r\n }\r\n }\r\n};\r\nconst vModelCheckbox = {\r\n // #4096 array checkboxes need to be deep traversed\r\n deep: true,\r\n created(el, _, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () => {\r\n const modelValue = el._modelValue;\r\n const elementValue = getValue(el);\r\n const checked = el.checked;\r\n const assign = el._assign;\r\n if (shared_esm_bundler_isArray(modelValue)) {\r\n const index = looseIndexOf(modelValue, elementValue);\r\n const found = index !== -1;\r\n if (checked && !found) {\r\n assign(modelValue.concat(elementValue));\r\n }\r\n else if (!checked && found) {\r\n const filtered = [...modelValue];\r\n filtered.splice(index, 1);\r\n assign(filtered);\r\n }\r\n }\r\n else if (isSet(modelValue)) {\r\n const cloned = new Set(modelValue);\r\n if (checked) {\r\n cloned.add(elementValue);\r\n }\r\n else {\r\n cloned.delete(elementValue);\r\n }\r\n assign(cloned);\r\n }\r\n else {\r\n assign(getCheckboxValue(el, checked));\r\n }\r\n });\r\n },\r\n // set initial checked on mount to wait for true-value/false-value\r\n mounted: setChecked,\r\n beforeUpdate(el, binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n setChecked(el, binding, vnode);\r\n }\r\n};\r\nfunction setChecked(el, { value, oldValue }, vnode) {\r\n el._modelValue = value;\r\n if (shared_esm_bundler_isArray(value)) {\r\n el.checked = looseIndexOf(value, vnode.props.value) > -1;\r\n }\r\n else if (isSet(value)) {\r\n el.checked = value.has(vnode.props.value);\r\n }\r\n else if (value !== oldValue) {\r\n el.checked = looseEqual(value, getCheckboxValue(el, true));\r\n }\r\n}\r\nconst vModelRadio = {\r\n created(el, { value }, vnode) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n el._assign = getModelAssigner(vnode);\r\n addEventListener(el, 'change', () => {\r\n el._assign(getValue(el));\r\n });\r\n },\r\n beforeUpdate(el, { value, oldValue }, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n if (value !== oldValue) {\r\n el.checked = looseEqual(value, vnode.props.value);\r\n }\r\n }\r\n};\r\nconst vModelSelect = {\r\n // <select multiple> value need to be deep traversed\r\n deep: true,\r\n created(el, { value, modifiers: { number } }, vnode) {\r\n const isSetModel = isSet(value);\r\n addEventListener(el, 'change', () => {\r\n const selectedVal = Array.prototype.filter\r\n .call(el.options, (o) => o.selected)\r\n .map((o) => number ? toNumber(getValue(o)) : getValue(o));\r\n el._assign(el.multiple\r\n ? isSetModel\r\n ? new Set(selectedVal)\r\n : selectedVal\r\n : selectedVal[0]);\r\n });\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n // set value in mounted & updated because <select> relies on its children\r\n // <option>s.\r\n mounted(el, { value }) {\r\n setSelected(el, value);\r\n },\r\n beforeUpdate(el, _binding, vnode) {\r\n el._assign = getModelAssigner(vnode);\r\n },\r\n updated(el, { value }) {\r\n setSelected(el, value);\r\n }\r\n};\r\nfunction setSelected(el, value) {\r\n const isMultiple = el.multiple;\r\n if (isMultiple && !shared_esm_bundler_isArray(value) && !isSet(value)) {\r\n ( false) &&\r\n 0;\r\n return;\r\n }\r\n for (let i = 0, l = el.options.length; i < l; i++) {\r\n const option = el.options[i];\r\n const optionValue = getValue(option);\r\n if (isMultiple) {\r\n if (shared_esm_bundler_isArray(value)) {\r\n option.selected = looseIndexOf(value, optionValue) > -1;\r\n }\r\n else {\r\n option.selected = value.has(optionValue);\r\n }\r\n }\r\n else {\r\n if (looseEqual(getValue(option), value)) {\r\n if (el.selectedIndex !== i)\r\n el.selectedIndex = i;\r\n return;\r\n }\r\n }\r\n }\r\n if (!isMultiple && el.selectedIndex !== -1) {\r\n el.selectedIndex = -1;\r\n }\r\n}\r\n// retrieve raw value set via :value bindings\r\nfunction getValue(el) {\r\n return '_value' in el ? el._value : el.value;\r\n}\r\n// retrieve raw value for true-value and false-value set via :true-value or :false-value bindings\r\nfunction getCheckboxValue(el, checked) {\r\n const key = checked ? '_trueValue' : '_falseValue';\r\n return key in el ? el[key] : checked;\r\n}\r\nconst vModelDynamic = {\r\n created(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'created');\r\n },\r\n mounted(el, binding, vnode) {\r\n callModelHook(el, binding, vnode, null, 'mounted');\r\n },\r\n beforeUpdate(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'beforeUpdate');\r\n },\r\n updated(el, binding, vnode, prevVNode) {\r\n callModelHook(el, binding, vnode, prevVNode, 'updated');\r\n }\r\n};\r\nfunction callModelHook(el, binding, vnode, prevVNode, hook) {\r\n let modelToUse;\r\n switch (el.tagName) {\r\n case 'SELECT':\r\n modelToUse = vModelSelect;\r\n break;\r\n case 'TEXTAREA':\r\n modelToUse = vModelText;\r\n break;\r\n default:\r\n switch (vnode.props && vnode.props.type) {\r\n case 'checkbox':\r\n modelToUse = vModelCheckbox;\r\n break;\r\n case 'radio':\r\n modelToUse = vModelRadio;\r\n break;\r\n default:\r\n modelToUse = vModelText;\r\n }\r\n }\r\n const fn = modelToUse[hook];\r\n fn && fn(el, binding, vnode, prevVNode);\r\n}\r\n// SSR vnode transforms, only used when user includes client-oriented render\r\n// function in SSR\r\nfunction initVModelForSSR() {\r\n vModelText.getSSRProps = ({ value }) => ({ value });\r\n vModelRadio.getSSRProps = ({ value }, vnode) => {\r\n if (vnode.props && looseEqual(vnode.props.value, value)) {\r\n return { checked: true };\r\n }\r\n };\r\n vModelCheckbox.getSSRProps = ({ value }, vnode) => {\r\n if (shared_esm_bundler_isArray(value)) {\r\n if (vnode.props && looseIndexOf(value, vnode.props.value) > -1) {\r\n return { checked: true };\r\n }\r\n }\r\n else if (isSet(value)) {\r\n if (vnode.props && value.has(vnode.props.value)) {\r\n return { checked: true };\r\n }\r\n }\r\n else if (value) {\r\n return { checked: true };\r\n }\r\n };\r\n}\n\nconst systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];\r\nconst modifierGuards = {\r\n stop: e => e.stopPropagation(),\r\n prevent: e => e.preventDefault(),\r\n self: e => e.target !== e.currentTarget,\r\n ctrl: e => !e.ctrlKey,\r\n shift: e => !e.shiftKey,\r\n alt: e => !e.altKey,\r\n meta: e => !e.metaKey,\r\n left: e => 'button' in e && e.button !== 0,\r\n middle: e => 'button' in e && e.button !== 1,\r\n right: e => 'button' in e && e.button !== 2,\r\n exact: (e, modifiers) => systemModifiers.some(m => e[`${m}Key`] && !modifiers.includes(m))\r\n};\r\n/**\r\n * @private\r\n */\r\nconst withModifiers = (fn, modifiers) => {\r\n return (event, ...args) => {\r\n for (let i = 0; i < modifiers.length; i++) {\r\n const guard = modifierGuards[modifiers[i]];\r\n if (guard && guard(event, modifiers))\r\n return;\r\n }\r\n return fn(event, ...args);\r\n };\r\n};\r\n// Kept for 2.x compat.\r\n// Note: IE11 compat for `spacebar` and `del` is removed for now.\r\nconst keyNames = {\r\n esc: 'escape',\r\n space: ' ',\r\n up: 'arrow-up',\r\n left: 'arrow-left',\r\n right: 'arrow-right',\r\n down: 'arrow-down',\r\n delete: 'backspace'\r\n};\r\n/**\r\n * @private\r\n */\r\nconst withKeys = (fn, modifiers) => {\r\n return (event) => {\r\n if (!('key' in event)) {\r\n return;\r\n }\r\n const eventKey = shared_esm_bundler_hyphenate(event.key);\r\n if (modifiers.some(k => k === eventKey || keyNames[k] === eventKey)) {\r\n return fn(event);\r\n }\r\n };\r\n};\n\nconst vShow = {\r\n beforeMount(el, { value }, { transition }) {\r\n el._vod = el.style.display === 'none' ? '' : el.style.display;\r\n if (transition && value) {\r\n transition.beforeEnter(el);\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n mounted(el, { value }, { transition }) {\r\n if (transition && value) {\r\n transition.enter(el);\r\n }\r\n },\r\n updated(el, { value, oldValue }, { transition }) {\r\n if (!value === !oldValue)\r\n return;\r\n if (transition) {\r\n if (value) {\r\n transition.beforeEnter(el);\r\n setDisplay(el, true);\r\n transition.enter(el);\r\n }\r\n else {\r\n transition.leave(el, () => {\r\n setDisplay(el, false);\r\n });\r\n }\r\n }\r\n else {\r\n setDisplay(el, value);\r\n }\r\n },\r\n beforeUnmount(el, { value }) {\r\n setDisplay(el, value);\r\n }\r\n};\r\nfunction setDisplay(el, value) {\r\n el.style.display = value ? el._vod : 'none';\r\n}\r\n// SSR vnode transforms, only used when user includes client-oriented render\r\n// function in SSR\r\nfunction initVShowForSSR() {\r\n vShow.getSSRProps = ({ value }) => {\r\n if (!value) {\r\n return { style: { display: 'none' } };\r\n }\r\n };\r\n}\n\nconst rendererOptions = shared_esm_bundler_extend({ patchProp }, nodeOps);\r\n// lazy create the renderer - this makes core renderer logic tree-shakable\r\n// in case the user only imports reactivity utilities from Vue.\r\nlet renderer;\r\nlet enabledHydration = false;\r\nfunction ensureRenderer() {\r\n return (renderer ||\r\n (renderer = createRenderer(rendererOptions)));\r\n}\r\nfunction ensureHydrationRenderer() {\r\n renderer = enabledHydration\r\n ? renderer\r\n : createHydrationRenderer(rendererOptions);\r\n enabledHydration = true;\r\n return renderer;\r\n}\r\n// use explicit type casts here to avoid import() calls in rolled-up d.ts\r\nconst render = ((...args) => {\r\n ensureRenderer().render(...args);\r\n});\r\nconst hydrate = ((...args) => {\r\n ensureHydrationRenderer().hydrate(...args);\r\n});\r\nconst createApp = ((...args) => {\r\n const app = ensureRenderer().createApp(...args);\r\n if ((false)) {}\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) => {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (!container)\r\n return;\r\n const component = app._component;\r\n if (!isFunction(component) && !component.render && !component.template) {\r\n // __UNSAFE__\r\n // Reason: potential execution of JS expressions in in-DOM template.\r\n // The user must make sure the in-DOM template is trusted. If it's\r\n // rendered by the server, the template should not contain any user data.\r\n component.template = container.innerHTML;\r\n }\r\n // clear content before mounting\r\n container.innerHTML = '';\r\n const proxy = mount(container, false, container instanceof SVGElement);\r\n if (container instanceof Element) {\r\n container.removeAttribute('v-cloak');\r\n container.setAttribute('data-v-app', '');\r\n }\r\n return proxy;\r\n };\r\n return app;\r\n});\r\nconst createSSRApp = ((...args) => {\r\n const app = ensureHydrationRenderer().createApp(...args);\r\n if ((false)) {}\r\n const { mount } = app;\r\n app.mount = (containerOrSelector) => {\r\n const container = normalizeContainer(containerOrSelector);\r\n if (container) {\r\n return mount(container, true, container instanceof SVGElement);\r\n }\r\n };\r\n return app;\r\n});\r\nfunction injectNativeTagCheck(app) {\r\n // Inject `isNativeTag`\r\n // this is used for component name validation (dev only)\r\n Object.defineProperty(app.config, 'isNativeTag', {\r\n value: (tag) => isHTMLTag(tag) || isSVGTag(tag),\r\n writable: false\r\n });\r\n}\r\n// dev only\r\nfunction injectCompilerOptionsCheck(app) {\r\n if (isRuntimeOnly()) {\r\n const isCustomElement = app.config.isCustomElement;\r\n Object.defineProperty(app.config, 'isCustomElement', {\r\n get() {\r\n return isCustomElement;\r\n },\r\n set() {\r\n warn(`The \\`isCustomElement\\` config option is deprecated. Use ` +\r\n `\\`compilerOptions.isCustomElement\\` instead.`);\r\n }\r\n });\r\n const compilerOptions = app.config.compilerOptions;\r\n const msg = `The \\`compilerOptions\\` config option is only respected when using ` +\r\n `a build of Vue.js that includes the runtime compiler (aka \"full build\"). ` +\r\n `Since you are using the runtime-only build, \\`compilerOptions\\` ` +\r\n `must be passed to \\`@vue/compiler-dom\\` in the build setup instead.\\n` +\r\n `- For vue-loader: pass it via vue-loader's \\`compilerOptions\\` loader option.\\n` +\r\n `- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\\n` +\r\n `- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;\r\n Object.defineProperty(app.config, 'compilerOptions', {\r\n get() {\r\n warn(msg);\r\n return compilerOptions;\r\n },\r\n set() {\r\n warn(msg);\r\n }\r\n });\r\n }\r\n}\r\nfunction normalizeContainer(container) {\r\n if (shared_esm_bundler_isString(container)) {\r\n const res = document.querySelector(container);\r\n if (false) {}\r\n return res;\r\n }\r\n if (false) {}\r\n return container;\r\n}\r\nlet ssrDirectiveInitialized = false;\r\n/**\r\n * @internal\r\n */\r\nconst initDirectivesForSSR = () => {\r\n if (!ssrDirectiveInitialized) {\r\n ssrDirectiveInitialized = true;\r\n initVModelForSSR();\r\n initVShowForSSR();\r\n }\r\n }\r\n ;\n\n\n\n;// CONCATENATED MODULE: ./node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js\n\n\n\nfunction defaultOnError(error) {\r\n throw error;\r\n}\r\nfunction defaultOnWarn(msg) {\r\n ( false) && 0;\r\n}\r\nfunction createCompilerError(code, loc, messages, additionalMessage) {\r\n const msg = false\r\n ? 0\r\n : code;\r\n const error = new SyntaxError(String(msg));\r\n error.code = code;\r\n error.loc = loc;\r\n return error;\r\n}\r\nconst errorMessages = {\r\n // parse errors\r\n [0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */]: 'Illegal comment.',\r\n [1 /* CDATA_IN_HTML_CONTENT */]: 'CDATA section is allowed only in XML context.',\r\n [2 /* DUPLICATE_ATTRIBUTE */]: 'Duplicate attribute.',\r\n [3 /* END_TAG_WITH_ATTRIBUTES */]: 'End tag cannot have attributes.',\r\n [4 /* END_TAG_WITH_TRAILING_SOLIDUS */]: \"Illegal '/' in tags.\",\r\n [5 /* EOF_BEFORE_TAG_NAME */]: 'Unexpected EOF in tag.',\r\n [6 /* EOF_IN_CDATA */]: 'Unexpected EOF in CDATA section.',\r\n [7 /* EOF_IN_COMMENT */]: 'Unexpected EOF in comment.',\r\n [8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */]: 'Unexpected EOF in script.',\r\n [9 /* EOF_IN_TAG */]: 'Unexpected EOF in tag.',\r\n [10 /* INCORRECTLY_CLOSED_COMMENT */]: 'Incorrectly closed comment.',\r\n [11 /* INCORRECTLY_OPENED_COMMENT */]: 'Incorrectly opened comment.',\r\n [12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */]: \"Illegal tag name. Use '<' to print '<'.\",\r\n [13 /* MISSING_ATTRIBUTE_VALUE */]: 'Attribute value was expected.',\r\n [14 /* MISSING_END_TAG_NAME */]: 'End tag name was expected.',\r\n [15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */]: 'Whitespace was expected.',\r\n [16 /* NESTED_COMMENT */]: \"Unexpected '\x3c!--' in comment.\",\r\n [17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */]: 'Attribute name cannot contain U+0022 (\"), U+0027 (\\'), and U+003C (<).',\r\n [18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */]: 'Unquoted attribute value cannot contain U+0022 (\"), U+0027 (\\'), U+003C (<), U+003D (=), and U+0060 (`).',\r\n [19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */]: \"Attribute name cannot start with '='.\",\r\n [21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */]: \"'<?' is allowed only in XML context.\",\r\n [20 /* UNEXPECTED_NULL_CHARACTER */]: `Unexpected null character.`,\r\n [22 /* UNEXPECTED_SOLIDUS_IN_TAG */]: \"Illegal '/' in tags.\",\r\n // Vue-specific parse errors\r\n [23 /* X_INVALID_END_TAG */]: 'Invalid end tag.',\r\n [24 /* X_MISSING_END_TAG */]: 'Element is missing end tag.',\r\n [25 /* X_MISSING_INTERPOLATION_END */]: 'Interpolation end sign was not found.',\r\n [27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */]: 'End bracket for dynamic directive argument was not found. ' +\r\n 'Note that dynamic directive argument cannot contain spaces.',\r\n [26 /* X_MISSING_DIRECTIVE_NAME */]: 'Legal directive name was expected.',\r\n // transform errors\r\n [28 /* X_V_IF_NO_EXPRESSION */]: `v-if/v-else-if is missing expression.`,\r\n [29 /* X_V_IF_SAME_KEY */]: `v-if/else branches must use unique keys.`,\r\n [30 /* X_V_ELSE_NO_ADJACENT_IF */]: `v-else/v-else-if has no adjacent v-if or v-else-if.`,\r\n [31 /* X_V_FOR_NO_EXPRESSION */]: `v-for is missing expression.`,\r\n [32 /* X_V_FOR_MALFORMED_EXPRESSION */]: `v-for has invalid expression.`,\r\n [33 /* X_V_FOR_TEMPLATE_KEY_PLACEMENT */]: `<template v-for> key should be placed on the <template> tag.`,\r\n [34 /* X_V_BIND_NO_EXPRESSION */]: `v-bind is missing expression.`,\r\n [35 /* X_V_ON_NO_EXPRESSION */]: `v-on is missing expression.`,\r\n [36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */]: `Unexpected custom directive on <slot> outlet.`,\r\n [37 /* X_V_SLOT_MIXED_SLOT_USAGE */]: `Mixed v-slot usage on both the component and nested <template>.` +\r\n `When there are multiple named slots, all slots should use <template> ` +\r\n `syntax to avoid scope ambiguity.`,\r\n [38 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */]: `Duplicate slot names found. `,\r\n [39 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */]: `Extraneous children found when component already has explicitly named ` +\r\n `default slot. These children will be ignored.`,\r\n [40 /* X_V_SLOT_MISPLACED */]: `v-slot can only be used on components or <template> tags.`,\r\n [41 /* X_V_MODEL_NO_EXPRESSION */]: `v-model is missing expression.`,\r\n [42 /* X_V_MODEL_MALFORMED_EXPRESSION */]: `v-model value must be a valid JavaScript member expression.`,\r\n [43 /* X_V_MODEL_ON_SCOPE_VARIABLE */]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,\r\n [44 /* X_INVALID_EXPRESSION */]: `Error parsing JavaScript expression: `,\r\n [45 /* X_KEEP_ALIVE_INVALID_CHILDREN */]: `<KeepAlive> expects exactly one child component.`,\r\n // generic errors\r\n [46 /* X_PREFIX_ID_NOT_SUPPORTED */]: `\"prefixIdentifiers\" option is not supported in this build of compiler.`,\r\n [47 /* X_MODULE_MODE_NOT_SUPPORTED */]: `ES module mode is not supported in this build of compiler.`,\r\n [48 /* X_CACHE_HANDLER_NOT_SUPPORTED */]: `\"cacheHandlers\" option is only supported when the \"prefixIdentifiers\" option is enabled.`,\r\n [49 /* X_SCOPE_ID_NOT_SUPPORTED */]: `\"scopeId\" option is only supported in module mode.`,\r\n // just to fulfill types\r\n [50 /* __EXTEND_POINT__ */]: ``\r\n};\n\nconst FRAGMENT = Symbol(( false) ? 0 : ``);\r\nconst TELEPORT = Symbol(( false) ? 0 : ``);\r\nconst SUSPENSE = Symbol(( false) ? 0 : ``);\r\nconst KEEP_ALIVE = Symbol(( false) ? 0 : ``);\r\nconst BASE_TRANSITION = Symbol(( false) ? 0 : ``);\r\nconst OPEN_BLOCK = Symbol(( false) ? 0 : ``);\r\nconst CREATE_BLOCK = Symbol(( false) ? 0 : ``);\r\nconst CREATE_ELEMENT_BLOCK = Symbol(( false) ? 0 : ``);\r\nconst CREATE_VNODE = Symbol(( false) ? 0 : ``);\r\nconst CREATE_ELEMENT_VNODE = Symbol(( false) ? 0 : ``);\r\nconst CREATE_COMMENT = Symbol(( false) ? 0 : ``);\r\nconst CREATE_TEXT = Symbol(( false) ? 0 : ``);\r\nconst CREATE_STATIC = Symbol(( false) ? 0 : ``);\r\nconst RESOLVE_COMPONENT = Symbol(( false) ? 0 : ``);\r\nconst RESOLVE_DYNAMIC_COMPONENT = Symbol(( false) ? 0 : ``);\r\nconst RESOLVE_DIRECTIVE = Symbol(( false) ? 0 : ``);\r\nconst RESOLVE_FILTER = Symbol(( false) ? 0 : ``);\r\nconst WITH_DIRECTIVES = Symbol(( false) ? 0 : ``);\r\nconst RENDER_LIST = Symbol(( false) ? 0 : ``);\r\nconst RENDER_SLOT = Symbol(( false) ? 0 : ``);\r\nconst CREATE_SLOTS = Symbol(( false) ? 0 : ``);\r\nconst TO_DISPLAY_STRING = Symbol(( false) ? 0 : ``);\r\nconst MERGE_PROPS = Symbol(( false) ? 0 : ``);\r\nconst NORMALIZE_CLASS = Symbol(( false) ? 0 : ``);\r\nconst NORMALIZE_STYLE = Symbol(( false) ? 0 : ``);\r\nconst NORMALIZE_PROPS = Symbol(( false) ? 0 : ``);\r\nconst GUARD_REACTIVE_PROPS = Symbol(( false) ? 0 : ``);\r\nconst TO_HANDLERS = Symbol(( false) ? 0 : ``);\r\nconst CAMELIZE = Symbol(( false) ? 0 : ``);\r\nconst CAPITALIZE = Symbol(( false) ? 0 : ``);\r\nconst TO_HANDLER_KEY = Symbol(( false) ? 0 : ``);\r\nconst SET_BLOCK_TRACKING = Symbol(( false) ? 0 : ``);\r\nconst PUSH_SCOPE_ID = Symbol(( false) ? 0 : ``);\r\nconst POP_SCOPE_ID = Symbol(( false) ? 0 : ``);\r\nconst WITH_CTX = Symbol(( false) ? 0 : ``);\r\nconst UNREF = Symbol(( false) ? 0 : ``);\r\nconst IS_REF = Symbol(( false) ? 0 : ``);\r\nconst WITH_MEMO = Symbol(( false) ? 0 : ``);\r\nconst IS_MEMO_SAME = Symbol(( false) ? 0 : ``);\r\n// Name mapping for runtime helpers that need to be imported from 'vue' in\r\n// generated code. Make sure these are correctly exported in the runtime!\r\n// Using `any` here because TS doesn't allow symbols as index type.\r\nconst helperNameMap = {\r\n [FRAGMENT]: `Fragment`,\r\n [TELEPORT]: `Teleport`,\r\n [SUSPENSE]: `Suspense`,\r\n [KEEP_ALIVE]: `KeepAlive`,\r\n [BASE_TRANSITION]: `BaseTransition`,\r\n [OPEN_BLOCK]: `openBlock`,\r\n [CREATE_BLOCK]: `createBlock`,\r\n [CREATE_ELEMENT_BLOCK]: `createElementBlock`,\r\n [CREATE_VNODE]: `createVNode`,\r\n [CREATE_ELEMENT_VNODE]: `createElementVNode`,\r\n [CREATE_COMMENT]: `createCommentVNode`,\r\n [CREATE_TEXT]: `createTextVNode`,\r\n [CREATE_STATIC]: `createStaticVNode`,\r\n [RESOLVE_COMPONENT]: `resolveComponent`,\r\n [RESOLVE_DYNAMIC_COMPONENT]: `resolveDynamicComponent`,\r\n [RESOLVE_DIRECTIVE]: `resolveDirective`,\r\n [RESOLVE_FILTER]: `resolveFilter`,\r\n [WITH_DIRECTIVES]: `withDirectives`,\r\n [RENDER_LIST]: `renderList`,\r\n [RENDER_SLOT]: `renderSlot`,\r\n [CREATE_SLOTS]: `createSlots`,\r\n [TO_DISPLAY_STRING]: `toDisplayString`,\r\n [MERGE_PROPS]: `mergeProps`,\r\n [NORMALIZE_CLASS]: `normalizeClass`,\r\n [NORMALIZE_STYLE]: `normalizeStyle`,\r\n [NORMALIZE_PROPS]: `normalizeProps`,\r\n [GUARD_REACTIVE_PROPS]: `guardReactiveProps`,\r\n [TO_HANDLERS]: `toHandlers`,\r\n [CAMELIZE]: `camelize`,\r\n [CAPITALIZE]: `capitalize`,\r\n [TO_HANDLER_KEY]: `toHandlerKey`,\r\n [SET_BLOCK_TRACKING]: `setBlockTracking`,\r\n [PUSH_SCOPE_ID]: `pushScopeId`,\r\n [POP_SCOPE_ID]: `popScopeId`,\r\n [WITH_CTX]: `withCtx`,\r\n [UNREF]: `unref`,\r\n [IS_REF]: `isRef`,\r\n [WITH_MEMO]: `withMemo`,\r\n [IS_MEMO_SAME]: `isMemoSame`\r\n};\r\nfunction registerRuntimeHelpers(helpers) {\r\n Object.getOwnPropertySymbols(helpers).forEach(s => {\r\n helperNameMap[s] = helpers[s];\r\n });\r\n}\n\n// AST Utilities ---------------------------------------------------------------\r\n// Some expressions, e.g. sequence and conditional expressions, are never\r\n// associated with template nodes, so their source locations are just a stub.\r\n// Container types like CompoundExpression also don't need a real location.\r\nconst locStub = {\r\n source: '',\r\n start: { line: 1, column: 1, offset: 0 },\r\n end: { line: 1, column: 1, offset: 0 }\r\n};\r\nfunction createRoot(children, loc = locStub) {\r\n return {\r\n type: 0 /* ROOT */,\r\n children,\r\n helpers: [],\r\n components: [],\r\n directives: [],\r\n hoists: [],\r\n imports: [],\r\n cached: 0,\r\n temps: 0,\r\n codegenNode: undefined,\r\n loc\r\n };\r\n}\r\nfunction createVNodeCall(context, tag, props, children, patchFlag, dynamicProps, directives, isBlock = false, disableTracking = false, isComponent = false, loc = locStub) {\r\n if (context) {\r\n if (isBlock) {\r\n context.helper(OPEN_BLOCK);\r\n context.helper(getVNodeBlockHelper(context.inSSR, isComponent));\r\n }\r\n else {\r\n context.helper(getVNodeHelper(context.inSSR, isComponent));\r\n }\r\n if (directives) {\r\n context.helper(WITH_DIRECTIVES);\r\n }\r\n }\r\n return {\r\n type: 13 /* VNODE_CALL */,\r\n tag,\r\n props,\r\n children,\r\n patchFlag,\r\n dynamicProps,\r\n directives,\r\n isBlock,\r\n disableTracking,\r\n isComponent,\r\n loc\r\n };\r\n}\r\nfunction createArrayExpression(elements, loc = locStub) {\r\n return {\r\n type: 17 /* JS_ARRAY_EXPRESSION */,\r\n loc,\r\n elements\r\n };\r\n}\r\nfunction createObjectExpression(properties, loc = locStub) {\r\n return {\r\n type: 15 /* JS_OBJECT_EXPRESSION */,\r\n loc,\r\n properties\r\n };\r\n}\r\nfunction createObjectProperty(key, value) {\r\n return {\r\n type: 16 /* JS_PROPERTY */,\r\n loc: locStub,\r\n key: shared_esm_bundler_isString(key) ? createSimpleExpression(key, true) : key,\r\n value\r\n };\r\n}\r\nfunction createSimpleExpression(content, isStatic = false, loc = locStub, constType = 0 /* NOT_CONSTANT */) {\r\n return {\r\n type: 4 /* SIMPLE_EXPRESSION */,\r\n loc,\r\n content,\r\n isStatic,\r\n constType: isStatic ? 3 /* CAN_STRINGIFY */ : constType\r\n };\r\n}\r\nfunction createInterpolation(content, loc) {\r\n return {\r\n type: 5 /* INTERPOLATION */,\r\n loc,\r\n content: isString(content)\r\n ? createSimpleExpression(content, false, loc)\r\n : content\r\n };\r\n}\r\nfunction createCompoundExpression(children, loc = locStub) {\r\n return {\r\n type: 8 /* COMPOUND_EXPRESSION */,\r\n loc,\r\n children\r\n };\r\n}\r\nfunction createCallExpression(callee, args = [], loc = locStub) {\r\n return {\r\n type: 14 /* JS_CALL_EXPRESSION */,\r\n loc,\r\n callee,\r\n arguments: args\r\n };\r\n}\r\nfunction createFunctionExpression(params, returns = undefined, newline = false, isSlot = false, loc = locStub) {\r\n return {\r\n type: 18 /* JS_FUNCTION_EXPRESSION */,\r\n params,\r\n returns,\r\n newline,\r\n isSlot,\r\n loc\r\n };\r\n}\r\nfunction createConditionalExpression(test, consequent, alternate, newline = true) {\r\n return {\r\n type: 19 /* JS_CONDITIONAL_EXPRESSION */,\r\n test,\r\n consequent,\r\n alternate,\r\n newline,\r\n loc: locStub\r\n };\r\n}\r\nfunction createCacheExpression(index, value, isVNode = false) {\r\n return {\r\n type: 20 /* JS_CACHE_EXPRESSION */,\r\n index,\r\n value,\r\n isVNode,\r\n loc: locStub\r\n };\r\n}\r\nfunction createBlockStatement(body) {\r\n return {\r\n type: 21 /* JS_BLOCK_STATEMENT */,\r\n body,\r\n loc: locStub\r\n };\r\n}\r\nfunction createTemplateLiteral(elements) {\r\n return {\r\n type: 22 /* JS_TEMPLATE_LITERAL */,\r\n elements,\r\n loc: locStub\r\n };\r\n}\r\nfunction createIfStatement(test, consequent, alternate) {\r\n return {\r\n type: 23 /* JS_IF_STATEMENT */,\r\n test,\r\n consequent,\r\n alternate,\r\n loc: locStub\r\n };\r\n}\r\nfunction createAssignmentExpression(left, right) {\r\n return {\r\n type: 24 /* JS_ASSIGNMENT_EXPRESSION */,\r\n left,\r\n right,\r\n loc: locStub\r\n };\r\n}\r\nfunction createSequenceExpression(expressions) {\r\n return {\r\n type: 25 /* JS_SEQUENCE_EXPRESSION */,\r\n expressions,\r\n loc: locStub\r\n };\r\n}\r\nfunction createReturnStatement(returns) {\r\n return {\r\n type: 26 /* JS_RETURN_STATEMENT */,\r\n returns,\r\n loc: locStub\r\n };\r\n}\n\nconst isStaticExp = (p) => p.type === 4 /* SIMPLE_EXPRESSION */ && p.isStatic;\r\nconst isBuiltInType = (tag, expected) => tag === expected || tag === shared_esm_bundler_hyphenate(expected);\r\nfunction isCoreComponent(tag) {\r\n if (isBuiltInType(tag, 'Teleport')) {\r\n return TELEPORT;\r\n }\r\n else if (isBuiltInType(tag, 'Suspense')) {\r\n return SUSPENSE;\r\n }\r\n else if (isBuiltInType(tag, 'KeepAlive')) {\r\n return KEEP_ALIVE;\r\n }\r\n else if (isBuiltInType(tag, 'BaseTransition')) {\r\n return BASE_TRANSITION;\r\n }\r\n}\r\nconst nonIdentifierRE = /^\\d|[^\\$\\w]/;\r\nconst isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);\r\nconst validFirstIdentCharRE = /[A-Za-z_$\\xA0-\\uFFFF]/;\r\nconst validIdentCharRE = /[\\.\\?\\w$\\xA0-\\uFFFF]/;\r\nconst whitespaceRE = /\\s+[.[]\\s*|\\s*[.[]\\s+/g;\r\n/**\r\n * Simple lexer to check if an expression is a member expression. This is\r\n * lax and only checks validity at the root level (i.e. does not validate exps\r\n * inside square brackets), but it's ok since these are only used on template\r\n * expressions and false positives are invalid expressions in the first place.\r\n */\r\nconst isMemberExpressionBrowser = (path) => {\r\n // remove whitespaces around . or [ first\r\n path = path.trim().replace(whitespaceRE, s => s.trim());\r\n let state = 0 /* inMemberExp */;\r\n let stateStack = [];\r\n let currentOpenBracketCount = 0;\r\n let currentOpenParensCount = 0;\r\n let currentStringType = null;\r\n for (let i = 0; i < path.length; i++) {\r\n const char = path.charAt(i);\r\n switch (state) {\r\n case 0 /* inMemberExp */:\r\n if (char === '[') {\r\n stateStack.push(state);\r\n state = 1 /* inBrackets */;\r\n currentOpenBracketCount++;\r\n }\r\n else if (char === '(') {\r\n stateStack.push(state);\r\n state = 2 /* inParens */;\r\n currentOpenParensCount++;\r\n }\r\n else if (!(i === 0 ? validFirstIdentCharRE : validIdentCharRE).test(char)) {\r\n return false;\r\n }\r\n break;\r\n case 1 /* inBrackets */:\r\n if (char === `'` || char === `\"` || char === '`') {\r\n stateStack.push(state);\r\n state = 3 /* inString */;\r\n currentStringType = char;\r\n }\r\n else if (char === `[`) {\r\n currentOpenBracketCount++;\r\n }\r\n else if (char === `]`) {\r\n if (!--currentOpenBracketCount) {\r\n state = stateStack.pop();\r\n }\r\n }\r\n break;\r\n case 2 /* inParens */:\r\n if (char === `'` || char === `\"` || char === '`') {\r\n stateStack.push(state);\r\n state = 3 /* inString */;\r\n currentStringType = char;\r\n }\r\n else if (char === `(`) {\r\n currentOpenParensCount++;\r\n }\r\n else if (char === `)`) {\r\n // if the exp ends as a call then it should not be considered valid\r\n if (i === path.length - 1) {\r\n return false;\r\n }\r\n if (!--currentOpenParensCount) {\r\n state = stateStack.pop();\r\n }\r\n }\r\n break;\r\n case 3 /* inString */:\r\n if (char === currentStringType) {\r\n state = stateStack.pop();\r\n currentStringType = null;\r\n }\r\n break;\r\n }\r\n }\r\n return !currentOpenBracketCount && !currentOpenParensCount;\r\n};\r\nconst isMemberExpressionNode = (/* unused pure expression or super */ null && (NOOP))\r\n ;\r\nconst isMemberExpression = isMemberExpressionBrowser\r\n ;\r\nfunction getInnerRange(loc, offset, length) {\r\n const source = loc.source.slice(offset, offset + length);\r\n const newLoc = {\r\n source,\r\n start: advancePositionWithClone(loc.start, loc.source, offset),\r\n end: loc.end\r\n };\r\n if (length != null) {\r\n newLoc.end = advancePositionWithClone(loc.start, loc.source, offset + length);\r\n }\r\n return newLoc;\r\n}\r\nfunction advancePositionWithClone(pos, source, numberOfCharacters = source.length) {\r\n return advancePositionWithMutation(shared_esm_bundler_extend({}, pos), source, numberOfCharacters);\r\n}\r\n// advance by mutation without cloning (for performance reasons), since this\r\n// gets called a lot in the parser\r\nfunction advancePositionWithMutation(pos, source, numberOfCharacters = source.length) {\r\n let linesCount = 0;\r\n let lastNewLinePos = -1;\r\n for (let i = 0; i < numberOfCharacters; i++) {\r\n if (source.charCodeAt(i) === 10 /* newline char code */) {\r\n linesCount++;\r\n lastNewLinePos = i;\r\n }\r\n }\r\n pos.offset += numberOfCharacters;\r\n pos.line += linesCount;\r\n pos.column =\r\n lastNewLinePos === -1\r\n ? pos.column + numberOfCharacters\r\n : numberOfCharacters - lastNewLinePos;\r\n return pos;\r\n}\r\nfunction assert(condition, msg) {\r\n /* istanbul ignore if */\r\n if (!condition) {\r\n throw new Error(msg || `unexpected compiler condition`);\r\n }\r\n}\r\nfunction findDir(node, name, allowEmpty = false) {\r\n for (let i = 0; i < node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 7 /* DIRECTIVE */ &&\r\n (allowEmpty || p.exp) &&\r\n (shared_esm_bundler_isString(name) ? p.name === name : name.test(p.name))) {\r\n return p;\r\n }\r\n }\r\n}\r\nfunction findProp(node, name, dynamicOnly = false, allowEmpty = false) {\r\n for (let i = 0; i < node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 6 /* ATTRIBUTE */) {\r\n if (dynamicOnly)\r\n continue;\r\n if (p.name === name && (p.value || allowEmpty)) {\r\n return p;\r\n }\r\n }\r\n else if (p.name === 'bind' &&\r\n (p.exp || allowEmpty) &&\r\n isBindKey(p.arg, name)) {\r\n return p;\r\n }\r\n }\r\n}\r\nfunction isBindKey(arg, name) {\r\n return !!(arg && isStaticExp(arg) && arg.content === name);\r\n}\r\nfunction hasDynamicKeyVBind(node) {\r\n return node.props.some(p => p.type === 7 /* DIRECTIVE */ &&\r\n p.name === 'bind' &&\r\n (!p.arg || // v-bind=\"obj\"\r\n p.arg.type !== 4 /* SIMPLE_EXPRESSION */ || // v-bind:[_ctx.foo]\r\n !p.arg.isStatic) // v-bind:[foo]\r\n );\r\n}\r\nfunction isText(node) {\r\n return node.type === 5 /* INTERPOLATION */ || node.type === 2 /* TEXT */;\r\n}\r\nfunction isVSlot(p) {\r\n return p.type === 7 /* DIRECTIVE */ && p.name === 'slot';\r\n}\r\nfunction isTemplateNode(node) {\r\n return (node.type === 1 /* ELEMENT */ && node.tagType === 3 /* TEMPLATE */);\r\n}\r\nfunction isSlotOutlet(node) {\r\n return node.type === 1 /* ELEMENT */ && node.tagType === 2 /* SLOT */;\r\n}\r\nfunction getVNodeHelper(ssr, isComponent) {\r\n return ssr || isComponent ? CREATE_VNODE : CREATE_ELEMENT_VNODE;\r\n}\r\nfunction getVNodeBlockHelper(ssr, isComponent) {\r\n return ssr || isComponent ? CREATE_BLOCK : CREATE_ELEMENT_BLOCK;\r\n}\r\nconst propsHelperSet = new Set([NORMALIZE_PROPS, GUARD_REACTIVE_PROPS]);\r\nfunction getUnnormalizedProps(props, callPath = []) {\r\n if (props &&\r\n !shared_esm_bundler_isString(props) &&\r\n props.type === 14 /* JS_CALL_EXPRESSION */) {\r\n const callee = props.callee;\r\n if (!shared_esm_bundler_isString(callee) && propsHelperSet.has(callee)) {\r\n return getUnnormalizedProps(props.arguments[0], callPath.concat(props));\r\n }\r\n }\r\n return [props, callPath];\r\n}\r\nfunction injectProp(node, prop, context) {\r\n let propsWithInjection;\r\n const originalProps = node.type === 13 /* VNODE_CALL */ ? node.props : node.arguments[2];\r\n /**\r\n * 1. mergeProps(...)\r\n * 2. toHandlers(...)\r\n * 3. normalizeProps(...)\r\n * 4. normalizeProps(guardReactiveProps(...))\r\n *\r\n * we need to get the real props before normalization\r\n */\r\n let props = originalProps;\r\n let callPath = [];\r\n let parentCall;\r\n if (props &&\r\n !shared_esm_bundler_isString(props) &&\r\n props.type === 14 /* JS_CALL_EXPRESSION */) {\r\n const ret = getUnnormalizedProps(props);\r\n props = ret[0];\r\n callPath = ret[1];\r\n parentCall = callPath[callPath.length - 1];\r\n }\r\n if (props == null || shared_esm_bundler_isString(props)) {\r\n propsWithInjection = createObjectExpression([prop]);\r\n }\r\n else if (props.type === 14 /* JS_CALL_EXPRESSION */) {\r\n // merged props... add ours\r\n // only inject key to object literal if it's the first argument so that\r\n // if doesn't override user provided keys\r\n const first = props.arguments[0];\r\n if (!shared_esm_bundler_isString(first) && first.type === 15 /* JS_OBJECT_EXPRESSION */) {\r\n first.properties.unshift(prop);\r\n }\r\n else {\r\n if (props.callee === TO_HANDLERS) {\r\n // #2366\r\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\r\n createObjectExpression([prop]),\r\n props\r\n ]);\r\n }\r\n else {\r\n props.arguments.unshift(createObjectExpression([prop]));\r\n }\r\n }\r\n !propsWithInjection && (propsWithInjection = props);\r\n }\r\n else if (props.type === 15 /* JS_OBJECT_EXPRESSION */) {\r\n let alreadyExists = false;\r\n // check existing key to avoid overriding user provided keys\r\n if (prop.key.type === 4 /* SIMPLE_EXPRESSION */) {\r\n const propKeyName = prop.key.content;\r\n alreadyExists = props.properties.some(p => p.key.type === 4 /* SIMPLE_EXPRESSION */ &&\r\n p.key.content === propKeyName);\r\n }\r\n if (!alreadyExists) {\r\n props.properties.unshift(prop);\r\n }\r\n propsWithInjection = props;\r\n }\r\n else {\r\n // single v-bind with expression, return a merged replacement\r\n propsWithInjection = createCallExpression(context.helper(MERGE_PROPS), [\r\n createObjectExpression([prop]),\r\n props\r\n ]);\r\n // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(props))`,\r\n // it will be rewritten as `normalizeProps(mergeProps({ key: 0 }, props))`,\r\n // the `guardReactiveProps` will no longer be needed\r\n if (parentCall && parentCall.callee === GUARD_REACTIVE_PROPS) {\r\n parentCall = callPath[callPath.length - 2];\r\n }\r\n }\r\n if (node.type === 13 /* VNODE_CALL */) {\r\n if (parentCall) {\r\n parentCall.arguments[0] = propsWithInjection;\r\n }\r\n else {\r\n node.props = propsWithInjection;\r\n }\r\n }\r\n else {\r\n if (parentCall) {\r\n parentCall.arguments[0] = propsWithInjection;\r\n }\r\n else {\r\n node.arguments[2] = propsWithInjection;\r\n }\r\n }\r\n}\r\nfunction toValidAssetId(name, type) {\r\n // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character\r\n return `_${type}_${name.replace(/[^\\w]/g, (searchValue, replaceValue) => {\r\n return searchValue === '-' ? '_' : name.charCodeAt(replaceValue).toString();\r\n })}`;\r\n}\r\n// Check if a node contains expressions that reference current context scope ids\r\nfunction hasScopeRef(node, ids) {\r\n if (!node || Object.keys(ids).length === 0) {\r\n return false;\r\n }\r\n switch (node.type) {\r\n case 1 /* ELEMENT */:\r\n for (let i = 0; i < node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 7 /* DIRECTIVE */ &&\r\n (hasScopeRef(p.arg, ids) || hasScopeRef(p.exp, ids))) {\r\n return true;\r\n }\r\n }\r\n return node.children.some(c => hasScopeRef(c, ids));\r\n case 11 /* FOR */:\r\n if (hasScopeRef(node.source, ids)) {\r\n return true;\r\n }\r\n return node.children.some(c => hasScopeRef(c, ids));\r\n case 9 /* IF */:\r\n return node.branches.some(b => hasScopeRef(b, ids));\r\n case 10 /* IF_BRANCH */:\r\n if (hasScopeRef(node.condition, ids)) {\r\n return true;\r\n }\r\n return node.children.some(c => hasScopeRef(c, ids));\r\n case 4 /* SIMPLE_EXPRESSION */:\r\n return (!node.isStatic &&\r\n isSimpleIdentifier(node.content) &&\r\n !!ids[node.content]);\r\n case 8 /* COMPOUND_EXPRESSION */:\r\n return node.children.some(c => isObject(c) && hasScopeRef(c, ids));\r\n case 5 /* INTERPOLATION */:\r\n case 12 /* TEXT_CALL */:\r\n return hasScopeRef(node.content, ids);\r\n case 2 /* TEXT */:\r\n case 3 /* COMMENT */:\r\n return false;\r\n default:\r\n if ((false)) {}\r\n return false;\r\n }\r\n}\r\nfunction getMemoedVNodeCall(node) {\r\n if (node.type === 14 /* JS_CALL_EXPRESSION */ && node.callee === WITH_MEMO) {\r\n return node.arguments[1].returns;\r\n }\r\n else {\r\n return node;\r\n }\r\n}\r\nfunction makeBlock(node, { helper, removeHelper, inSSR }) {\r\n if (!node.isBlock) {\r\n node.isBlock = true;\r\n removeHelper(getVNodeHelper(inSSR, node.isComponent));\r\n helper(OPEN_BLOCK);\r\n helper(getVNodeBlockHelper(inSSR, node.isComponent));\r\n }\r\n}\n\nconst deprecationData = {\r\n [\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */]: {\r\n message: `Platform-native elements with \"is\" prop will no longer be ` +\r\n `treated as components in Vue 3 unless the \"is\" value is explicitly ` +\r\n `prefixed with \"vue:\".`,\r\n link: `https://v3.vuejs.org/guide/migration/custom-elements-interop.html`\r\n },\r\n [\"COMPILER_V_BIND_SYNC\" /* COMPILER_V_BIND_SYNC */]: {\r\n message: key => `.sync modifier for v-bind has been removed. Use v-model with ` +\r\n `argument instead. \\`v-bind:${key}.sync\\` should be changed to ` +\r\n `\\`v-model:${key}\\`.`,\r\n link: `https://v3.vuejs.org/guide/migration/v-model.html`\r\n },\r\n [\"COMPILER_V_BIND_PROP\" /* COMPILER_V_BIND_PROP */]: {\r\n message: `.prop modifier for v-bind has been removed and no longer necessary. ` +\r\n `Vue 3 will automatically set a binding as DOM property when appropriate.`\r\n },\r\n [\"COMPILER_V_BIND_OBJECT_ORDER\" /* COMPILER_V_BIND_OBJECT_ORDER */]: {\r\n message: `v-bind=\"obj\" usage is now order sensitive and behaves like JavaScript ` +\r\n `object spread: it will now overwrite an existing non-mergeable attribute ` +\r\n `that appears before v-bind in the case of conflict. ` +\r\n `To retain 2.x behavior, move v-bind to make it the first attribute. ` +\r\n `You can also suppress this warning if the usage is intended.`,\r\n link: `https://v3.vuejs.org/guide/migration/v-bind.html`\r\n },\r\n [\"COMPILER_V_ON_NATIVE\" /* COMPILER_V_ON_NATIVE */]: {\r\n message: `.native modifier for v-on has been removed as is no longer necessary.`,\r\n link: `https://v3.vuejs.org/guide/migration/v-on-native-modifier-removed.html`\r\n },\r\n [\"COMPILER_V_IF_V_FOR_PRECEDENCE\" /* COMPILER_V_IF_V_FOR_PRECEDENCE */]: {\r\n message: `v-if / v-for precedence when used on the same element has changed ` +\r\n `in Vue 3: v-if now takes higher precedence and will no longer have ` +\r\n `access to v-for scope variables. It is best to avoid the ambiguity ` +\r\n `with <template> tags or use a computed property that filters v-for ` +\r\n `data source.`,\r\n link: `https://v3.vuejs.org/guide/migration/v-if-v-for.html`\r\n },\r\n [\"COMPILER_V_FOR_REF\" /* COMPILER_V_FOR_REF */]: {\r\n message: `Ref usage on v-for no longer creates array ref values in Vue 3. ` +\r\n `Consider using function refs or refactor to avoid ref usage altogether.`,\r\n link: `https://v3.vuejs.org/guide/migration/array-refs.html`\r\n },\r\n [\"COMPILER_NATIVE_TEMPLATE\" /* COMPILER_NATIVE_TEMPLATE */]: {\r\n message: `<template> with no special directives will render as a native template ` +\r\n `element instead of its inner content in Vue 3.`\r\n },\r\n [\"COMPILER_INLINE_TEMPLATE\" /* COMPILER_INLINE_TEMPLATE */]: {\r\n message: `\"inline-template\" has been removed in Vue 3.`,\r\n link: `https://v3.vuejs.org/guide/migration/inline-template-attribute.html`\r\n },\r\n [\"COMPILER_FILTER\" /* COMPILER_FILTERS */]: {\r\n message: `filters have been removed in Vue 3. ` +\r\n `The \"|\" symbol will be treated as native JavaScript bitwise OR operator. ` +\r\n `Use method calls or computed properties instead.`,\r\n link: `https://v3.vuejs.org/guide/migration/filters.html`\r\n }\r\n};\r\nfunction getCompatValue(key, context) {\r\n const config = context.options\r\n ? context.options.compatConfig\r\n : context.compatConfig;\r\n const value = config && config[key];\r\n if (key === 'MODE') {\r\n return value || 3; // compiler defaults to v3 behavior\r\n }\r\n else {\r\n return value;\r\n }\r\n}\r\nfunction isCompatEnabled(key, context) {\r\n const mode = getCompatValue('MODE', context);\r\n const value = getCompatValue(key, context);\r\n // in v3 mode, only enable if explicitly set to true\r\n // otherwise enable for any non-false value\r\n return mode === 3 ? value === true : value !== false;\r\n}\r\nfunction checkCompatEnabled(key, context, loc, ...args) {\r\n const enabled = isCompatEnabled(key, context);\r\n if (false) {}\r\n return enabled;\r\n}\r\nfunction warnDeprecation(key, context, loc, ...args) {\r\n const val = getCompatValue(key, context);\r\n if (val === 'suppress-warning') {\r\n return;\r\n }\r\n const { message, link } = deprecationData[key];\r\n const msg = `(deprecation ${key}) ${typeof message === 'function' ? message(...args) : message}${link ? `\\n Details: ${link}` : ``}`;\r\n const err = new SyntaxError(msg);\r\n err.code = key;\r\n if (loc)\r\n err.loc = loc;\r\n context.onWarn(err);\r\n}\n\n// The default decoder only provides escapes for characters reserved as part of\r\n// the template syntax, and is only used if the custom renderer did not provide\r\n// a platform-specific decoder.\r\nconst decodeRE = /&(gt|lt|amp|apos|quot);/g;\r\nconst decodeMap = {\r\n gt: '>',\r\n lt: '<',\r\n amp: '&',\r\n apos: \"'\",\r\n quot: '\"'\r\n};\r\nconst defaultParserOptions = {\r\n delimiters: [`{{`, `}}`],\r\n getNamespace: () => 0 /* HTML */,\r\n getTextMode: () => 0 /* DATA */,\r\n isVoidTag: shared_esm_bundler_NO,\r\n isPreTag: shared_esm_bundler_NO,\r\n isCustomElement: shared_esm_bundler_NO,\r\n decodeEntities: (rawText) => rawText.replace(decodeRE, (_, p1) => decodeMap[p1]),\r\n onError: defaultOnError,\r\n onWarn: defaultOnWarn,\r\n comments: (\"production\" !== 'production')\r\n};\r\nfunction compiler_core_esm_bundler_baseParse(content, options = {}) {\r\n const context = createParserContext(content, options);\r\n const start = getCursor(context);\r\n return createRoot(parseChildren(context, 0 /* DATA */, []), getSelection(context, start));\r\n}\r\nfunction createParserContext(content, rawOptions) {\r\n const options = shared_esm_bundler_extend({}, defaultParserOptions);\r\n let key;\r\n for (key in rawOptions) {\r\n // @ts-ignore\r\n options[key] =\r\n rawOptions[key] === undefined\r\n ? defaultParserOptions[key]\r\n : rawOptions[key];\r\n }\r\n return {\r\n options,\r\n column: 1,\r\n line: 1,\r\n offset: 0,\r\n originalSource: content,\r\n source: content,\r\n inPre: false,\r\n inVPre: false,\r\n onWarn: options.onWarn\r\n };\r\n}\r\nfunction parseChildren(context, mode, ancestors) {\r\n const parent = last(ancestors);\r\n const ns = parent ? parent.ns : 0 /* HTML */;\r\n const nodes = [];\r\n while (!isEnd(context, mode, ancestors)) {\r\n const s = context.source;\r\n let node = undefined;\r\n if (mode === 0 /* DATA */ || mode === 1 /* RCDATA */) {\r\n if (!context.inVPre && startsWith(s, context.options.delimiters[0])) {\r\n // '{{'\r\n node = parseInterpolation(context, mode);\r\n }\r\n else if (mode === 0 /* DATA */ && s[0] === '<') {\r\n // https://html.spec.whatwg.org/multipage/parsing.html#tag-open-state\r\n if (s.length === 1) {\r\n emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 1);\r\n }\r\n else if (s[1] === '!') {\r\n // https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state\r\n if (startsWith(s, '\x3c!--')) {\r\n node = parseComment(context);\r\n }\r\n else if (startsWith(s, '<!DOCTYPE')) {\r\n // Ignore DOCTYPE by a limitation.\r\n node = parseBogusComment(context);\r\n }\r\n else if (startsWith(s, '<![CDATA[')) {\r\n if (ns !== 0 /* HTML */) {\r\n node = parseCDATA(context, ancestors);\r\n }\r\n else {\r\n emitError(context, 1 /* CDATA_IN_HTML_CONTENT */);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else {\r\n emitError(context, 11 /* INCORRECTLY_OPENED_COMMENT */);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else if (s[1] === '/') {\r\n // https://html.spec.whatwg.org/multipage/parsing.html#end-tag-open-state\r\n if (s.length === 2) {\r\n emitError(context, 5 /* EOF_BEFORE_TAG_NAME */, 2);\r\n }\r\n else if (s[2] === '>') {\r\n emitError(context, 14 /* MISSING_END_TAG_NAME */, 2);\r\n advanceBy(context, 3);\r\n continue;\r\n }\r\n else if (/[a-z]/i.test(s[2])) {\r\n emitError(context, 23 /* X_INVALID_END_TAG */);\r\n parseTag(context, 1 /* End */, parent);\r\n continue;\r\n }\r\n else {\r\n emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 2);\r\n node = parseBogusComment(context);\r\n }\r\n }\r\n else if (/[a-z]/i.test(s[1])) {\r\n node = parseElement(context, ancestors);\r\n // 2.x <template> with no directive compat\r\n if (isCompatEnabled(\"COMPILER_NATIVE_TEMPLATE\" /* COMPILER_NATIVE_TEMPLATE */, context) &&\r\n node &&\r\n node.tag === 'template' &&\r\n !node.props.some(p => p.type === 7 /* DIRECTIVE */ &&\r\n isSpecialTemplateDirective(p.name))) {\r\n ( false) &&\r\n 0;\r\n node = node.children;\r\n }\r\n }\r\n else if (s[1] === '?') {\r\n emitError(context, 21 /* UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME */, 1);\r\n node = parseBogusComment(context);\r\n }\r\n else {\r\n emitError(context, 12 /* INVALID_FIRST_CHARACTER_OF_TAG_NAME */, 1);\r\n }\r\n }\r\n }\r\n if (!node) {\r\n node = parseText(context, mode);\r\n }\r\n if (shared_esm_bundler_isArray(node)) {\r\n for (let i = 0; i < node.length; i++) {\r\n pushNode(nodes, node[i]);\r\n }\r\n }\r\n else {\r\n pushNode(nodes, node);\r\n }\r\n }\r\n // Whitespace handling strategy like v2\r\n let removedWhitespace = false;\r\n if (mode !== 2 /* RAWTEXT */ && mode !== 1 /* RCDATA */) {\r\n const shouldCondense = context.options.whitespace !== 'preserve';\r\n for (let i = 0; i < nodes.length; i++) {\r\n const node = nodes[i];\r\n if (!context.inPre && node.type === 2 /* TEXT */) {\r\n if (!/[^\\t\\r\\n\\f ]/.test(node.content)) {\r\n const prev = nodes[i - 1];\r\n const next = nodes[i + 1];\r\n // Remove if:\r\n // - the whitespace is the first or last node, or:\r\n // - (condense mode) the whitespace is adjacent to a comment, or:\r\n // - (condense mode) the whitespace is between two elements AND contains newline\r\n if (!prev ||\r\n !next ||\r\n (shouldCondense &&\r\n (prev.type === 3 /* COMMENT */ ||\r\n next.type === 3 /* COMMENT */ ||\r\n (prev.type === 1 /* ELEMENT */ &&\r\n next.type === 1 /* ELEMENT */ &&\r\n /[\\r\\n]/.test(node.content))))) {\r\n removedWhitespace = true;\r\n nodes[i] = null;\r\n }\r\n else {\r\n // Otherwise, the whitespace is condensed into a single space\r\n node.content = ' ';\r\n }\r\n }\r\n else if (shouldCondense) {\r\n // in condense mode, consecutive whitespaces in text are condensed\r\n // down to a single space.\r\n node.content = node.content.replace(/[\\t\\r\\n\\f ]+/g, ' ');\r\n }\r\n }\r\n // Remove comment nodes if desired by configuration.\r\n else if (node.type === 3 /* COMMENT */ && !context.options.comments) {\r\n removedWhitespace = true;\r\n nodes[i] = null;\r\n }\r\n }\r\n if (context.inPre && parent && context.options.isPreTag(parent.tag)) {\r\n // remove leading newline per html spec\r\n // https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element\r\n const first = nodes[0];\r\n if (first && first.type === 2 /* TEXT */) {\r\n first.content = first.content.replace(/^\\r?\\n/, '');\r\n }\r\n }\r\n }\r\n return removedWhitespace ? nodes.filter(Boolean) : nodes;\r\n}\r\nfunction pushNode(nodes, node) {\r\n if (node.type === 2 /* TEXT */) {\r\n const prev = last(nodes);\r\n // Merge if both this and the previous node are text and those are\r\n // consecutive. This happens for cases like \"a < b\".\r\n if (prev &&\r\n prev.type === 2 /* TEXT */ &&\r\n prev.loc.end.offset === node.loc.start.offset) {\r\n prev.content += node.content;\r\n prev.loc.end = node.loc.end;\r\n prev.loc.source += node.loc.source;\r\n return;\r\n }\r\n }\r\n nodes.push(node);\r\n}\r\nfunction parseCDATA(context, ancestors) {\r\n advanceBy(context, 9);\r\n const nodes = parseChildren(context, 3 /* CDATA */, ancestors);\r\n if (context.source.length === 0) {\r\n emitError(context, 6 /* EOF_IN_CDATA */);\r\n }\r\n else {\r\n advanceBy(context, 3);\r\n }\r\n return nodes;\r\n}\r\nfunction parseComment(context) {\r\n const start = getCursor(context);\r\n let content;\r\n // Regular comment.\r\n const match = /--(\\!)?>/.exec(context.source);\r\n if (!match) {\r\n content = context.source.slice(4);\r\n advanceBy(context, context.source.length);\r\n emitError(context, 7 /* EOF_IN_COMMENT */);\r\n }\r\n else {\r\n if (match.index <= 3) {\r\n emitError(context, 0 /* ABRUPT_CLOSING_OF_EMPTY_COMMENT */);\r\n }\r\n if (match[1]) {\r\n emitError(context, 10 /* INCORRECTLY_CLOSED_COMMENT */);\r\n }\r\n content = context.source.slice(4, match.index);\r\n // Advancing with reporting nested comments.\r\n const s = context.source.slice(0, match.index);\r\n let prevIndex = 1, nestedIndex = 0;\r\n while ((nestedIndex = s.indexOf('\x3c!--', prevIndex)) !== -1) {\r\n advanceBy(context, nestedIndex - prevIndex + 1);\r\n if (nestedIndex + 4 < s.length) {\r\n emitError(context, 16 /* NESTED_COMMENT */);\r\n }\r\n prevIndex = nestedIndex + 1;\r\n }\r\n advanceBy(context, match.index + match[0].length - prevIndex + 1);\r\n }\r\n return {\r\n type: 3 /* COMMENT */,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseBogusComment(context) {\r\n const start = getCursor(context);\r\n const contentStart = context.source[1] === '?' ? 1 : 2;\r\n let content;\r\n const closeIndex = context.source.indexOf('>');\r\n if (closeIndex === -1) {\r\n content = context.source.slice(contentStart);\r\n advanceBy(context, context.source.length);\r\n }\r\n else {\r\n content = context.source.slice(contentStart, closeIndex);\r\n advanceBy(context, closeIndex + 1);\r\n }\r\n return {\r\n type: 3 /* COMMENT */,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseElement(context, ancestors) {\r\n // Start tag.\r\n const wasInPre = context.inPre;\r\n const wasInVPre = context.inVPre;\r\n const parent = last(ancestors);\r\n const element = parseTag(context, 0 /* Start */, parent);\r\n const isPreBoundary = context.inPre && !wasInPre;\r\n const isVPreBoundary = context.inVPre && !wasInVPre;\r\n if (element.isSelfClosing || context.options.isVoidTag(element.tag)) {\r\n // #4030 self-closing <pre> tag\r\n if (isPreBoundary) {\r\n context.inPre = false;\r\n }\r\n if (isVPreBoundary) {\r\n context.inVPre = false;\r\n }\r\n return element;\r\n }\r\n // Children.\r\n ancestors.push(element);\r\n const mode = context.options.getTextMode(element, parent);\r\n const children = parseChildren(context, mode, ancestors);\r\n ancestors.pop();\r\n // 2.x inline-template compat\r\n {\r\n const inlineTemplateProp = element.props.find(p => p.type === 6 /* ATTRIBUTE */ && p.name === 'inline-template');\r\n if (inlineTemplateProp &&\r\n checkCompatEnabled(\"COMPILER_INLINE_TEMPLATE\" /* COMPILER_INLINE_TEMPLATE */, context, inlineTemplateProp.loc)) {\r\n const loc = getSelection(context, element.loc.end);\r\n inlineTemplateProp.value = {\r\n type: 2 /* TEXT */,\r\n content: loc.source,\r\n loc\r\n };\r\n }\r\n }\r\n element.children = children;\r\n // End tag.\r\n if (startsWithEndTagOpen(context.source, element.tag)) {\r\n parseTag(context, 1 /* End */, parent);\r\n }\r\n else {\r\n emitError(context, 24 /* X_MISSING_END_TAG */, 0, element.loc.start);\r\n if (context.source.length === 0 && element.tag.toLowerCase() === 'script') {\r\n const first = children[0];\r\n if (first && startsWith(first.loc.source, '\x3c!--')) {\r\n emitError(context, 8 /* EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT */);\r\n }\r\n }\r\n }\r\n element.loc = getSelection(context, element.loc.start);\r\n if (isPreBoundary) {\r\n context.inPre = false;\r\n }\r\n if (isVPreBoundary) {\r\n context.inVPre = false;\r\n }\r\n return element;\r\n}\r\nconst isSpecialTemplateDirective = /*#__PURE__*/ shared_esm_bundler_makeMap(`if,else,else-if,for,slot`);\r\nfunction parseTag(context, type, parent) {\r\n // Tag open.\r\n const start = getCursor(context);\r\n const match = /^<\\/?([a-z][^\\t\\r\\n\\f />]*)/i.exec(context.source);\r\n const tag = match[1];\r\n const ns = context.options.getNamespace(tag, parent);\r\n advanceBy(context, match[0].length);\r\n advanceSpaces(context);\r\n // save current state in case we need to re-parse attributes with v-pre\r\n const cursor = getCursor(context);\r\n const currentSource = context.source;\r\n // check <pre> tag\r\n if (context.options.isPreTag(tag)) {\r\n context.inPre = true;\r\n }\r\n // Attributes.\r\n let props = parseAttributes(context, type);\r\n // check v-pre\r\n if (type === 0 /* Start */ &&\r\n !context.inVPre &&\r\n props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {\r\n context.inVPre = true;\r\n // reset context\r\n shared_esm_bundler_extend(context, cursor);\r\n context.source = currentSource;\r\n // re-parse attrs and filter out v-pre itself\r\n props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');\r\n }\r\n // Tag close.\r\n let isSelfClosing = false;\r\n if (context.source.length === 0) {\r\n emitError(context, 9 /* EOF_IN_TAG */);\r\n }\r\n else {\r\n isSelfClosing = startsWith(context.source, '/>');\r\n if (type === 1 /* End */ && isSelfClosing) {\r\n emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);\r\n }\r\n advanceBy(context, isSelfClosing ? 2 : 1);\r\n }\r\n if (type === 1 /* End */) {\r\n return;\r\n }\r\n // 2.x deprecation checks\r\n if (false) {}\r\n let tagType = 0 /* ELEMENT */;\r\n if (!context.inVPre) {\r\n if (tag === 'slot') {\r\n tagType = 2 /* SLOT */;\r\n }\r\n else if (tag === 'template') {\r\n if (props.some(p => p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name))) {\r\n tagType = 3 /* TEMPLATE */;\r\n }\r\n }\r\n else if (isComponent(tag, props, context)) {\r\n tagType = 1 /* COMPONENT */;\r\n }\r\n }\r\n return {\r\n type: 1 /* ELEMENT */,\r\n ns,\r\n tag,\r\n tagType,\r\n props,\r\n isSelfClosing,\r\n children: [],\r\n loc: getSelection(context, start),\r\n codegenNode: undefined // to be created during transform phase\r\n };\r\n}\r\nfunction isComponent(tag, props, context) {\r\n const options = context.options;\r\n if (options.isCustomElement(tag)) {\r\n return false;\r\n }\r\n if (tag === 'component' ||\r\n /^[A-Z]/.test(tag) ||\r\n isCoreComponent(tag) ||\r\n (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||\r\n (options.isNativeTag && !options.isNativeTag(tag))) {\r\n return true;\r\n }\r\n // at this point the tag should be a native tag, but check for potential \"is\"\r\n // casting\r\n for (let i = 0; i < props.length; i++) {\r\n const p = props[i];\r\n if (p.type === 6 /* ATTRIBUTE */) {\r\n if (p.name === 'is' && p.value) {\r\n if (p.value.content.startsWith('vue:')) {\r\n return true;\r\n }\r\n else if (checkCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {\r\n return true;\r\n }\r\n }\r\n }\r\n else {\r\n // directive\r\n // v-is (TODO Deprecate)\r\n if (p.name === 'is') {\r\n return true;\r\n }\r\n else if (\r\n // :is on plain element - only treat as component in compat mode\r\n p.name === 'bind' &&\r\n isBindKey(p.arg, 'is') &&\r\n true &&\r\n checkCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context, p.loc)) {\r\n return true;\r\n }\r\n }\r\n }\r\n}\r\nfunction parseAttributes(context, type) {\r\n const props = [];\r\n const attributeNames = new Set();\r\n while (context.source.length > 0 &&\r\n !startsWith(context.source, '>') &&\r\n !startsWith(context.source, '/>')) {\r\n if (startsWith(context.source, '/')) {\r\n emitError(context, 22 /* UNEXPECTED_SOLIDUS_IN_TAG */);\r\n advanceBy(context, 1);\r\n advanceSpaces(context);\r\n continue;\r\n }\r\n if (type === 1 /* End */) {\r\n emitError(context, 3 /* END_TAG_WITH_ATTRIBUTES */);\r\n }\r\n const attr = parseAttribute(context, attributeNames);\r\n // Trim whitespace between class\r\n // https://github.com/vuejs/vue-next/issues/4251\r\n if (attr.type === 6 /* ATTRIBUTE */ &&\r\n attr.value &&\r\n attr.name === 'class') {\r\n attr.value.content = attr.value.content.replace(/\\s+/g, ' ').trim();\r\n }\r\n if (type === 0 /* Start */) {\r\n props.push(attr);\r\n }\r\n if (/^[^\\t\\r\\n\\f />]/.test(context.source)) {\r\n emitError(context, 15 /* MISSING_WHITESPACE_BETWEEN_ATTRIBUTES */);\r\n }\r\n advanceSpaces(context);\r\n }\r\n return props;\r\n}\r\nfunction parseAttribute(context, nameSet) {\r\n // Name.\r\n const start = getCursor(context);\r\n const match = /^[^\\t\\r\\n\\f />][^\\t\\r\\n\\f />=]*/.exec(context.source);\r\n const name = match[0];\r\n if (nameSet.has(name)) {\r\n emitError(context, 2 /* DUPLICATE_ATTRIBUTE */);\r\n }\r\n nameSet.add(name);\r\n if (name[0] === '=') {\r\n emitError(context, 19 /* UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME */);\r\n }\r\n {\r\n const pattern = /[\"'<]/g;\r\n let m;\r\n while ((m = pattern.exec(name))) {\r\n emitError(context, 17 /* UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME */, m.index);\r\n }\r\n }\r\n advanceBy(context, name.length);\r\n // Value\r\n let value = undefined;\r\n if (/^[\\t\\r\\n\\f ]*=/.test(context.source)) {\r\n advanceSpaces(context);\r\n advanceBy(context, 1);\r\n advanceSpaces(context);\r\n value = parseAttributeValue(context);\r\n if (!value) {\r\n emitError(context, 13 /* MISSING_ATTRIBUTE_VALUE */);\r\n }\r\n }\r\n const loc = getSelection(context, start);\r\n if (!context.inVPre && /^(v-[A-Za-z0-9-]|:|\\.|@|#)/.test(name)) {\r\n const match = /(?:^v-([a-z0-9-]+))?(?:(?::|^\\.|^@|^#)(\\[[^\\]]+\\]|[^\\.]+))?(.+)?$/i.exec(name);\r\n let isPropShorthand = startsWith(name, '.');\r\n let dirName = match[1] ||\r\n (isPropShorthand || startsWith(name, ':')\r\n ? 'bind'\r\n : startsWith(name, '@')\r\n ? 'on'\r\n : 'slot');\r\n let arg;\r\n if (match[2]) {\r\n const isSlot = dirName === 'slot';\r\n const startOffset = name.lastIndexOf(match[2]);\r\n const loc = getSelection(context, getNewPosition(context, start, startOffset), getNewPosition(context, start, startOffset + match[2].length + ((isSlot && match[3]) || '').length));\r\n let content = match[2];\r\n let isStatic = true;\r\n if (content.startsWith('[')) {\r\n isStatic = false;\r\n if (!content.endsWith(']')) {\r\n emitError(context, 27 /* X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END */);\r\n content = content.slice(1);\r\n }\r\n else {\r\n content = content.slice(1, content.length - 1);\r\n }\r\n }\r\n else if (isSlot) {\r\n // #1241 special case for v-slot: vuetify relies extensively on slot\r\n // names containing dots. v-slot doesn't have any modifiers and Vue 2.x\r\n // supports such usage so we are keeping it consistent with 2.x.\r\n content += match[3] || '';\r\n }\r\n arg = {\r\n type: 4 /* SIMPLE_EXPRESSION */,\r\n content,\r\n isStatic,\r\n constType: isStatic\r\n ? 3 /* CAN_STRINGIFY */\r\n : 0 /* NOT_CONSTANT */,\r\n loc\r\n };\r\n }\r\n if (value && value.isQuoted) {\r\n const valueLoc = value.loc;\r\n valueLoc.start.offset++;\r\n valueLoc.start.column++;\r\n valueLoc.end = advancePositionWithClone(valueLoc.start, value.content);\r\n valueLoc.source = valueLoc.source.slice(1, -1);\r\n }\r\n const modifiers = match[3] ? match[3].slice(1).split('.') : [];\r\n if (isPropShorthand)\r\n modifiers.push('prop');\r\n // 2.x compat v-bind:foo.sync -> v-model:foo\r\n if (dirName === 'bind' && arg) {\r\n if (modifiers.includes('sync') &&\r\n checkCompatEnabled(\"COMPILER_V_BIND_SYNC\" /* COMPILER_V_BIND_SYNC */, context, loc, arg.loc.source)) {\r\n dirName = 'model';\r\n modifiers.splice(modifiers.indexOf('sync'), 1);\r\n }\r\n if (false) {}\r\n }\r\n return {\r\n type: 7 /* DIRECTIVE */,\r\n name: dirName,\r\n exp: value && {\r\n type: 4 /* SIMPLE_EXPRESSION */,\r\n content: value.content,\r\n isStatic: false,\r\n // Treat as non-constant by default. This can be potentially set to\r\n // other values by `transformExpression` to make it eligible for hoisting.\r\n constType: 0 /* NOT_CONSTANT */,\r\n loc: value.loc\r\n },\r\n arg,\r\n modifiers,\r\n loc\r\n };\r\n }\r\n // missing directive name or illegal directive name\r\n if (!context.inVPre && startsWith(name, 'v-')) {\r\n emitError(context, 26 /* X_MISSING_DIRECTIVE_NAME */);\r\n }\r\n return {\r\n type: 6 /* ATTRIBUTE */,\r\n name,\r\n value: value && {\r\n type: 2 /* TEXT */,\r\n content: value.content,\r\n loc: value.loc\r\n },\r\n loc\r\n };\r\n}\r\nfunction parseAttributeValue(context) {\r\n const start = getCursor(context);\r\n let content;\r\n const quote = context.source[0];\r\n const isQuoted = quote === `\"` || quote === `'`;\r\n if (isQuoted) {\r\n // Quoted value.\r\n advanceBy(context, 1);\r\n const endIndex = context.source.indexOf(quote);\r\n if (endIndex === -1) {\r\n content = parseTextData(context, context.source.length, 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n else {\r\n content = parseTextData(context, endIndex, 4 /* ATTRIBUTE_VALUE */);\r\n advanceBy(context, 1);\r\n }\r\n }\r\n else {\r\n // Unquoted\r\n const match = /^[^\\t\\r\\n\\f >]+/.exec(context.source);\r\n if (!match) {\r\n return undefined;\r\n }\r\n const unexpectedChars = /[\"'<=`]/g;\r\n let m;\r\n while ((m = unexpectedChars.exec(match[0]))) {\r\n emitError(context, 18 /* UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE */, m.index);\r\n }\r\n content = parseTextData(context, match[0].length, 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n return { content, isQuoted, loc: getSelection(context, start) };\r\n}\r\nfunction parseInterpolation(context, mode) {\r\n const [open, close] = context.options.delimiters;\r\n const closeIndex = context.source.indexOf(close, open.length);\r\n if (closeIndex === -1) {\r\n emitError(context, 25 /* X_MISSING_INTERPOLATION_END */);\r\n return undefined;\r\n }\r\n const start = getCursor(context);\r\n advanceBy(context, open.length);\r\n const innerStart = getCursor(context);\r\n const innerEnd = getCursor(context);\r\n const rawContentLength = closeIndex - open.length;\r\n const rawContent = context.source.slice(0, rawContentLength);\r\n const preTrimContent = parseTextData(context, rawContentLength, mode);\r\n const content = preTrimContent.trim();\r\n const startOffset = preTrimContent.indexOf(content);\r\n if (startOffset > 0) {\r\n advancePositionWithMutation(innerStart, rawContent, startOffset);\r\n }\r\n const endOffset = rawContentLength - (preTrimContent.length - content.length - startOffset);\r\n advancePositionWithMutation(innerEnd, rawContent, endOffset);\r\n advanceBy(context, close.length);\r\n return {\r\n type: 5 /* INTERPOLATION */,\r\n content: {\r\n type: 4 /* SIMPLE_EXPRESSION */,\r\n isStatic: false,\r\n // Set `isConstant` to false by default and will decide in transformExpression\r\n constType: 0 /* NOT_CONSTANT */,\r\n content,\r\n loc: getSelection(context, innerStart, innerEnd)\r\n },\r\n loc: getSelection(context, start)\r\n };\r\n}\r\nfunction parseText(context, mode) {\r\n const endTokens = mode === 3 /* CDATA */ ? [']]>'] : ['<', context.options.delimiters[0]];\r\n let endIndex = context.source.length;\r\n for (let i = 0; i < endTokens.length; i++) {\r\n const index = context.source.indexOf(endTokens[i], 1);\r\n if (index !== -1 && endIndex > index) {\r\n endIndex = index;\r\n }\r\n }\r\n const start = getCursor(context);\r\n const content = parseTextData(context, endIndex, mode);\r\n return {\r\n type: 2 /* TEXT */,\r\n content,\r\n loc: getSelection(context, start)\r\n };\r\n}\r\n/**\r\n * Get text data with a given length from the current location.\r\n * This translates HTML entities in the text data.\r\n */\r\nfunction parseTextData(context, length, mode) {\r\n const rawText = context.source.slice(0, length);\r\n advanceBy(context, length);\r\n if (mode === 2 /* RAWTEXT */ ||\r\n mode === 3 /* CDATA */ ||\r\n rawText.indexOf('&') === -1) {\r\n return rawText;\r\n }\r\n else {\r\n // DATA or RCDATA containing \"&\"\". Entity decoding required.\r\n return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\r\n }\r\n}\r\nfunction getCursor(context) {\r\n const { column, line, offset } = context;\r\n return { column, line, offset };\r\n}\r\nfunction getSelection(context, start, end) {\r\n end = end || getCursor(context);\r\n return {\r\n start,\r\n end,\r\n source: context.originalSource.slice(start.offset, end.offset)\r\n };\r\n}\r\nfunction last(xs) {\r\n return xs[xs.length - 1];\r\n}\r\nfunction startsWith(source, searchString) {\r\n return source.startsWith(searchString);\r\n}\r\nfunction advanceBy(context, numberOfCharacters) {\r\n const { source } = context;\r\n advancePositionWithMutation(context, source, numberOfCharacters);\r\n context.source = source.slice(numberOfCharacters);\r\n}\r\nfunction advanceSpaces(context) {\r\n const match = /^[\\t\\r\\n\\f ]+/.exec(context.source);\r\n if (match) {\r\n advanceBy(context, match[0].length);\r\n }\r\n}\r\nfunction getNewPosition(context, start, numberOfCharacters) {\r\n return advancePositionWithClone(start, context.originalSource.slice(start.offset, numberOfCharacters), numberOfCharacters);\r\n}\r\nfunction emitError(context, code, offset, loc = getCursor(context)) {\r\n if (offset) {\r\n loc.offset += offset;\r\n loc.column += offset;\r\n }\r\n context.options.onError(createCompilerError(code, {\r\n start: loc,\r\n end: loc,\r\n source: ''\r\n }));\r\n}\r\nfunction isEnd(context, mode, ancestors) {\r\n const s = context.source;\r\n switch (mode) {\r\n case 0 /* DATA */:\r\n if (startsWith(s, '</')) {\r\n // TODO: probably bad performance\r\n for (let i = ancestors.length - 1; i >= 0; --i) {\r\n if (startsWithEndTagOpen(s, ancestors[i].tag)) {\r\n return true;\r\n }\r\n }\r\n }\r\n break;\r\n case 1 /* RCDATA */:\r\n case 2 /* RAWTEXT */: {\r\n const parent = last(ancestors);\r\n if (parent && startsWithEndTagOpen(s, parent.tag)) {\r\n return true;\r\n }\r\n break;\r\n }\r\n case 3 /* CDATA */:\r\n if (startsWith(s, ']]>')) {\r\n return true;\r\n }\r\n break;\r\n }\r\n return !s;\r\n}\r\nfunction startsWithEndTagOpen(source, tag) {\r\n return (startsWith(source, '</') &&\r\n source.slice(2, 2 + tag.length).toLowerCase() === tag.toLowerCase() &&\r\n /[\\t\\r\\n\\f />]/.test(source[2 + tag.length] || '>'));\r\n}\n\nfunction hoistStatic(root, context) {\r\n walk(root, context, \r\n // Root node is unfortunately non-hoistable due to potential parent\r\n // fallthrough attributes.\r\n isSingleElementRoot(root, root.children[0]));\r\n}\r\nfunction isSingleElementRoot(root, child) {\r\n const { children } = root;\r\n return (children.length === 1 &&\r\n child.type === 1 /* ELEMENT */ &&\r\n !isSlotOutlet(child));\r\n}\r\nfunction walk(node, context, doNotHoistNode = false) {\r\n // Some transforms, e.g. transformAssetUrls from @vue/compiler-sfc, replaces\r\n // static bindings with expressions. These expressions are guaranteed to be\r\n // constant so they are still eligible for hoisting, but they are only\r\n // available at runtime and therefore cannot be evaluated ahead of time.\r\n // This is only a concern for pre-stringification (via transformHoist by\r\n // @vue/compiler-dom), but doing it here allows us to perform only one full\r\n // walk of the AST and allow `stringifyStatic` to stop walking as soon as its\r\n // stringification threshold is met.\r\n let canStringify = true;\r\n const { children } = node;\r\n const originalCount = children.length;\r\n let hoistedCount = 0;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n // only plain elements & text calls are eligible for hoisting.\r\n if (child.type === 1 /* ELEMENT */ &&\r\n child.tagType === 0 /* ELEMENT */) {\r\n const constantType = doNotHoistNode\r\n ? 0 /* NOT_CONSTANT */\r\n : getConstantType(child, context);\r\n if (constantType > 0 /* NOT_CONSTANT */) {\r\n if (constantType < 3 /* CAN_STRINGIFY */) {\r\n canStringify = false;\r\n }\r\n if (constantType >= 2 /* CAN_HOIST */) {\r\n child.codegenNode.patchFlag =\r\n -1 /* HOISTED */ + (( false) ? 0 : ``);\r\n child.codegenNode = context.hoist(child.codegenNode);\r\n hoistedCount++;\r\n continue;\r\n }\r\n }\r\n else {\r\n // node may contain dynamic children, but its props may be eligible for\r\n // hoisting.\r\n const codegenNode = child.codegenNode;\r\n if (codegenNode.type === 13 /* VNODE_CALL */) {\r\n const flag = getPatchFlag(codegenNode);\r\n if ((!flag ||\r\n flag === 512 /* NEED_PATCH */ ||\r\n flag === 1 /* TEXT */) &&\r\n getGeneratedPropsConstantType(child, context) >=\r\n 2 /* CAN_HOIST */) {\r\n const props = getNodeProps(child);\r\n if (props) {\r\n codegenNode.props = context.hoist(props);\r\n }\r\n }\r\n if (codegenNode.dynamicProps) {\r\n codegenNode.dynamicProps = context.hoist(codegenNode.dynamicProps);\r\n }\r\n }\r\n }\r\n }\r\n else if (child.type === 12 /* TEXT_CALL */) {\r\n const contentType = getConstantType(child.content, context);\r\n if (contentType > 0) {\r\n if (contentType < 3 /* CAN_STRINGIFY */) {\r\n canStringify = false;\r\n }\r\n if (contentType >= 2 /* CAN_HOIST */) {\r\n child.codegenNode = context.hoist(child.codegenNode);\r\n hoistedCount++;\r\n }\r\n }\r\n }\r\n // walk further\r\n if (child.type === 1 /* ELEMENT */) {\r\n const isComponent = child.tagType === 1 /* COMPONENT */;\r\n if (isComponent) {\r\n context.scopes.vSlot++;\r\n }\r\n walk(child, context);\r\n if (isComponent) {\r\n context.scopes.vSlot--;\r\n }\r\n }\r\n else if (child.type === 11 /* FOR */) {\r\n // Do not hoist v-for single child because it has to be a block\r\n walk(child, context, child.children.length === 1);\r\n }\r\n else if (child.type === 9 /* IF */) {\r\n for (let i = 0; i < child.branches.length; i++) {\r\n // Do not hoist v-if single child because it has to be a block\r\n walk(child.branches[i], context, child.branches[i].children.length === 1);\r\n }\r\n }\r\n }\r\n if (canStringify && hoistedCount && context.transformHoist) {\r\n context.transformHoist(children, context, node);\r\n }\r\n // all children were hoisted - the entire children array is hoistable.\r\n if (hoistedCount &&\r\n hoistedCount === originalCount &&\r\n node.type === 1 /* ELEMENT */ &&\r\n node.tagType === 0 /* ELEMENT */ &&\r\n node.codegenNode &&\r\n node.codegenNode.type === 13 /* VNODE_CALL */ &&\r\n shared_esm_bundler_isArray(node.codegenNode.children)) {\r\n node.codegenNode.children = context.hoist(createArrayExpression(node.codegenNode.children));\r\n }\r\n}\r\nfunction getConstantType(node, context) {\r\n const { constantCache } = context;\r\n switch (node.type) {\r\n case 1 /* ELEMENT */:\r\n if (node.tagType !== 0 /* ELEMENT */) {\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n const cached = constantCache.get(node);\r\n if (cached !== undefined) {\r\n return cached;\r\n }\r\n const codegenNode = node.codegenNode;\r\n if (codegenNode.type !== 13 /* VNODE_CALL */) {\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n const flag = getPatchFlag(codegenNode);\r\n if (!flag) {\r\n let returnType = 3 /* CAN_STRINGIFY */;\r\n // Element itself has no patch flag. However we still need to check:\r\n // 1. Even for a node with no patch flag, it is possible for it to contain\r\n // non-hoistable expressions that refers to scope variables, e.g. compiler\r\n // injected keys or cached event handlers. Therefore we need to always\r\n // check the codegenNode's props to be sure.\r\n const generatedPropsType = getGeneratedPropsConstantType(node, context);\r\n if (generatedPropsType === 0 /* NOT_CONSTANT */) {\r\n constantCache.set(node, 0 /* NOT_CONSTANT */);\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n if (generatedPropsType < returnType) {\r\n returnType = generatedPropsType;\r\n }\r\n // 2. its children.\r\n for (let i = 0; i < node.children.length; i++) {\r\n const childType = getConstantType(node.children[i], context);\r\n if (childType === 0 /* NOT_CONSTANT */) {\r\n constantCache.set(node, 0 /* NOT_CONSTANT */);\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n if (childType < returnType) {\r\n returnType = childType;\r\n }\r\n }\r\n // 3. if the type is not already CAN_SKIP_PATCH which is the lowest non-0\r\n // type, check if any of the props can cause the type to be lowered\r\n // we can skip can_patch because it's guaranteed by the absence of a\r\n // patchFlag.\r\n if (returnType > 1 /* CAN_SKIP_PATCH */) {\r\n for (let i = 0; i < node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 7 /* DIRECTIVE */ && p.name === 'bind' && p.exp) {\r\n const expType = getConstantType(p.exp, context);\r\n if (expType === 0 /* NOT_CONSTANT */) {\r\n constantCache.set(node, 0 /* NOT_CONSTANT */);\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n if (expType < returnType) {\r\n returnType = expType;\r\n }\r\n }\r\n }\r\n }\r\n // only svg/foreignObject could be block here, however if they are\r\n // static then they don't need to be blocks since there will be no\r\n // nested updates.\r\n if (codegenNode.isBlock) {\r\n context.removeHelper(OPEN_BLOCK);\r\n context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));\r\n codegenNode.isBlock = false;\r\n context.helper(getVNodeHelper(context.inSSR, codegenNode.isComponent));\r\n }\r\n constantCache.set(node, returnType);\r\n return returnType;\r\n }\r\n else {\r\n constantCache.set(node, 0 /* NOT_CONSTANT */);\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n case 2 /* TEXT */:\r\n case 3 /* COMMENT */:\r\n return 3 /* CAN_STRINGIFY */;\r\n case 9 /* IF */:\r\n case 11 /* FOR */:\r\n case 10 /* IF_BRANCH */:\r\n return 0 /* NOT_CONSTANT */;\r\n case 5 /* INTERPOLATION */:\r\n case 12 /* TEXT_CALL */:\r\n return getConstantType(node.content, context);\r\n case 4 /* SIMPLE_EXPRESSION */:\r\n return node.constType;\r\n case 8 /* COMPOUND_EXPRESSION */:\r\n let returnType = 3 /* CAN_STRINGIFY */;\r\n for (let i = 0; i < node.children.length; i++) {\r\n const child = node.children[i];\r\n if (shared_esm_bundler_isString(child) || isSymbol(child)) {\r\n continue;\r\n }\r\n const childType = getConstantType(child, context);\r\n if (childType === 0 /* NOT_CONSTANT */) {\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n else if (childType < returnType) {\r\n returnType = childType;\r\n }\r\n }\r\n return returnType;\r\n default:\r\n if ((false)) {}\r\n return 0 /* NOT_CONSTANT */;\r\n }\r\n}\r\nconst allowHoistedHelperSet = new Set([\r\n NORMALIZE_CLASS,\r\n NORMALIZE_STYLE,\r\n NORMALIZE_PROPS,\r\n GUARD_REACTIVE_PROPS\r\n]);\r\nfunction getConstantTypeOfHelperCall(value, context) {\r\n if (value.type === 14 /* JS_CALL_EXPRESSION */ &&\r\n !shared_esm_bundler_isString(value.callee) &&\r\n allowHoistedHelperSet.has(value.callee)) {\r\n const arg = value.arguments[0];\r\n if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\r\n return getConstantType(arg, context);\r\n }\r\n else if (arg.type === 14 /* JS_CALL_EXPRESSION */) {\r\n // in the case of nested helper call, e.g. `normalizeProps(guardReactiveProps(exp))`\r\n return getConstantTypeOfHelperCall(arg, context);\r\n }\r\n }\r\n return 0 /* NOT_CONSTANT */;\r\n}\r\nfunction getGeneratedPropsConstantType(node, context) {\r\n let returnType = 3 /* CAN_STRINGIFY */;\r\n const props = getNodeProps(node);\r\n if (props && props.type === 15 /* JS_OBJECT_EXPRESSION */) {\r\n const { properties } = props;\r\n for (let i = 0; i < properties.length; i++) {\r\n const { key, value } = properties[i];\r\n const keyType = getConstantType(key, context);\r\n if (keyType === 0 /* NOT_CONSTANT */) {\r\n return keyType;\r\n }\r\n if (keyType < returnType) {\r\n returnType = keyType;\r\n }\r\n let valueType;\r\n if (value.type === 4 /* SIMPLE_EXPRESSION */) {\r\n valueType = getConstantType(value, context);\r\n }\r\n else if (value.type === 14 /* JS_CALL_EXPRESSION */) {\r\n // some helper calls can be hoisted,\r\n // such as the `normalizeProps` generated by the compiler for pre-normalize class,\r\n // in this case we need to respect the ConstantType of the helper's argments\r\n valueType = getConstantTypeOfHelperCall(value, context);\r\n }\r\n else {\r\n valueType = 0 /* NOT_CONSTANT */;\r\n }\r\n if (valueType === 0 /* NOT_CONSTANT */) {\r\n return valueType;\r\n }\r\n if (valueType < returnType) {\r\n returnType = valueType;\r\n }\r\n }\r\n }\r\n return returnType;\r\n}\r\nfunction getNodeProps(node) {\r\n const codegenNode = node.codegenNode;\r\n if (codegenNode.type === 13 /* VNODE_CALL */) {\r\n return codegenNode.props;\r\n }\r\n}\r\nfunction getPatchFlag(node) {\r\n const flag = node.patchFlag;\r\n return flag ? parseInt(flag, 10) : undefined;\r\n}\n\nfunction createTransformContext(root, { filename = '', prefixIdentifiers = false, hoistStatic = false, cacheHandlers = false, nodeTransforms = [], directiveTransforms = {}, transformHoist = null, isBuiltInComponent = shared_esm_bundler_NOOP, isCustomElement = shared_esm_bundler_NOOP, expressionPlugins = [], scopeId = null, slotted = true, ssr = false, inSSR = false, ssrCssVars = ``, bindingMetadata = EMPTY_OBJ, inline = false, isTS = false, onError = defaultOnError, onWarn = defaultOnWarn, compatConfig }) {\r\n const nameMatch = filename.replace(/\\?.*$/, '').match(/([^/\\\\]+)\\.\\w+$/);\r\n const context = {\r\n // options\r\n selfName: nameMatch && shared_esm_bundler_capitalize(camelize(nameMatch[1])),\r\n prefixIdentifiers,\r\n hoistStatic,\r\n cacheHandlers,\r\n nodeTransforms,\r\n directiveTransforms,\r\n transformHoist,\r\n isBuiltInComponent,\r\n isCustomElement,\r\n expressionPlugins,\r\n scopeId,\r\n slotted,\r\n ssr,\r\n inSSR,\r\n ssrCssVars,\r\n bindingMetadata,\r\n inline,\r\n isTS,\r\n onError,\r\n onWarn,\r\n compatConfig,\r\n // state\r\n root,\r\n helpers: new Map(),\r\n components: new Set(),\r\n directives: new Set(),\r\n hoists: [],\r\n imports: [],\r\n constantCache: new Map(),\r\n temps: 0,\r\n cached: 0,\r\n identifiers: Object.create(null),\r\n scopes: {\r\n vFor: 0,\r\n vSlot: 0,\r\n vPre: 0,\r\n vOnce: 0\r\n },\r\n parent: null,\r\n currentNode: root,\r\n childIndex: 0,\r\n inVOnce: false,\r\n // methods\r\n helper(name) {\r\n const count = context.helpers.get(name) || 0;\r\n context.helpers.set(name, count + 1);\r\n return name;\r\n },\r\n removeHelper(name) {\r\n const count = context.helpers.get(name);\r\n if (count) {\r\n const currentCount = count - 1;\r\n if (!currentCount) {\r\n context.helpers.delete(name);\r\n }\r\n else {\r\n context.helpers.set(name, currentCount);\r\n }\r\n }\r\n },\r\n helperString(name) {\r\n return `_${helperNameMap[context.helper(name)]}`;\r\n },\r\n replaceNode(node) {\r\n /* istanbul ignore if */\r\n if ((false)) {}\r\n context.parent.children[context.childIndex] = context.currentNode = node;\r\n },\r\n removeNode(node) {\r\n if (false) {}\r\n const list = context.parent.children;\r\n const removalIndex = node\r\n ? list.indexOf(node)\r\n : context.currentNode\r\n ? context.childIndex\r\n : -1;\r\n /* istanbul ignore if */\r\n if (false) {}\r\n if (!node || node === context.currentNode) {\r\n // current node removed\r\n context.currentNode = null;\r\n context.onNodeRemoved();\r\n }\r\n else {\r\n // sibling node removed\r\n if (context.childIndex > removalIndex) {\r\n context.childIndex--;\r\n context.onNodeRemoved();\r\n }\r\n }\r\n context.parent.children.splice(removalIndex, 1);\r\n },\r\n onNodeRemoved: () => { },\r\n addIdentifiers(exp) {\r\n },\r\n removeIdentifiers(exp) {\r\n },\r\n hoist(exp) {\r\n if (shared_esm_bundler_isString(exp))\r\n exp = createSimpleExpression(exp);\r\n context.hoists.push(exp);\r\n const identifier = createSimpleExpression(`_hoisted_${context.hoists.length}`, false, exp.loc, 2 /* CAN_HOIST */);\r\n identifier.hoisted = exp;\r\n return identifier;\r\n },\r\n cache(exp, isVNode = false) {\r\n return createCacheExpression(context.cached++, exp, isVNode);\r\n }\r\n };\r\n {\r\n context.filters = new Set();\r\n }\r\n return context;\r\n}\r\nfunction transform(root, options) {\r\n const context = createTransformContext(root, options);\r\n traverseNode(root, context);\r\n if (options.hoistStatic) {\r\n hoistStatic(root, context);\r\n }\r\n if (!options.ssr) {\r\n createRootCodegen(root, context);\r\n }\r\n // finalize meta information\r\n root.helpers = [...context.helpers.keys()];\r\n root.components = [...context.components];\r\n root.directives = [...context.directives];\r\n root.imports = context.imports;\r\n root.hoists = context.hoists;\r\n root.temps = context.temps;\r\n root.cached = context.cached;\r\n {\r\n root.filters = [...context.filters];\r\n }\r\n}\r\nfunction createRootCodegen(root, context) {\r\n const { helper } = context;\r\n const { children } = root;\r\n if (children.length === 1) {\r\n const child = children[0];\r\n // if the single child is an element, turn it into a block.\r\n if (isSingleElementRoot(root, child) && child.codegenNode) {\r\n // single element root is never hoisted so codegenNode will never be\r\n // SimpleExpressionNode\r\n const codegenNode = child.codegenNode;\r\n if (codegenNode.type === 13 /* VNODE_CALL */) {\r\n makeBlock(codegenNode, context);\r\n }\r\n root.codegenNode = codegenNode;\r\n }\r\n else {\r\n // - single <slot/>, IfNode, ForNode: already blocks.\r\n // - single text node: always patched.\r\n // root codegen falls through via genNode()\r\n root.codegenNode = child;\r\n }\r\n }\r\n else if (children.length > 1) {\r\n // root has multiple nodes - return a fragment block.\r\n let patchFlag = 64 /* STABLE_FRAGMENT */;\r\n let patchFlagText = PatchFlagNames[64];\r\n // check if the fragment actually contains a single valid child with\r\n // the rest being comments\r\n if (false) {}\r\n root.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, root.children, patchFlag + (( false) ? 0 : ``), undefined, undefined, true, undefined, false /* isComponent */);\r\n }\r\n else ;\r\n}\r\nfunction traverseChildren(parent, context) {\r\n let i = 0;\r\n const nodeRemoved = () => {\r\n i--;\r\n };\r\n for (; i < parent.children.length; i++) {\r\n const child = parent.children[i];\r\n if (shared_esm_bundler_isString(child))\r\n continue;\r\n context.parent = parent;\r\n context.childIndex = i;\r\n context.onNodeRemoved = nodeRemoved;\r\n traverseNode(child, context);\r\n }\r\n}\r\nfunction traverseNode(node, context) {\r\n context.currentNode = node;\r\n // apply transform plugins\r\n const { nodeTransforms } = context;\r\n const exitFns = [];\r\n for (let i = 0; i < nodeTransforms.length; i++) {\r\n const onExit = nodeTransforms[i](node, context);\r\n if (onExit) {\r\n if (shared_esm_bundler_isArray(onExit)) {\r\n exitFns.push(...onExit);\r\n }\r\n else {\r\n exitFns.push(onExit);\r\n }\r\n }\r\n if (!context.currentNode) {\r\n // node was removed\r\n return;\r\n }\r\n else {\r\n // node may have been replaced\r\n node = context.currentNode;\r\n }\r\n }\r\n switch (node.type) {\r\n case 3 /* COMMENT */:\r\n if (!context.ssr) {\r\n // inject import for the Comment symbol, which is needed for creating\r\n // comment nodes with `createVNode`\r\n context.helper(CREATE_COMMENT);\r\n }\r\n break;\r\n case 5 /* INTERPOLATION */:\r\n // no need to traverse, but we need to inject toString helper\r\n if (!context.ssr) {\r\n context.helper(TO_DISPLAY_STRING);\r\n }\r\n break;\r\n // for container types, further traverse downwards\r\n case 9 /* IF */:\r\n for (let i = 0; i < node.branches.length; i++) {\r\n traverseNode(node.branches[i], context);\r\n }\r\n break;\r\n case 10 /* IF_BRANCH */:\r\n case 11 /* FOR */:\r\n case 1 /* ELEMENT */:\r\n case 0 /* ROOT */:\r\n traverseChildren(node, context);\r\n break;\r\n }\r\n // exit transforms\r\n context.currentNode = node;\r\n let i = exitFns.length;\r\n while (i--) {\r\n exitFns[i]();\r\n }\r\n}\r\nfunction createStructuralDirectiveTransform(name, fn) {\r\n const matches = shared_esm_bundler_isString(name)\r\n ? (n) => n === name\r\n : (n) => name.test(n);\r\n return (node, context) => {\r\n if (node.type === 1 /* ELEMENT */) {\r\n const { props } = node;\r\n // structural directive transforms are not concerned with slots\r\n // as they are handled separately in vSlot.ts\r\n if (node.tagType === 3 /* TEMPLATE */ && props.some(isVSlot)) {\r\n return;\r\n }\r\n const exitFns = [];\r\n for (let i = 0; i < props.length; i++) {\r\n const prop = props[i];\r\n if (prop.type === 7 /* DIRECTIVE */ && matches(prop.name)) {\r\n // structural directives are removed to avoid infinite recursion\r\n // also we remove them *before* applying so that it can further\r\n // traverse itself in case it moves the node around\r\n props.splice(i, 1);\r\n i--;\r\n const onExit = fn(node, prop, context);\r\n if (onExit)\r\n exitFns.push(onExit);\r\n }\r\n }\r\n return exitFns;\r\n }\r\n };\r\n}\n\nconst PURE_ANNOTATION = `/*#__PURE__*/`;\r\nfunction createCodegenContext(ast, { mode = 'function', prefixIdentifiers = mode === 'module', sourceMap = false, filename = `template.vue.html`, scopeId = null, optimizeImports = false, runtimeGlobalName = `Vue`, runtimeModuleName = `vue`, ssrRuntimeModuleName = 'vue/server-renderer', ssr = false, isTS = false, inSSR = false }) {\r\n const context = {\r\n mode,\r\n prefixIdentifiers,\r\n sourceMap,\r\n filename,\r\n scopeId,\r\n optimizeImports,\r\n runtimeGlobalName,\r\n runtimeModuleName,\r\n ssrRuntimeModuleName,\r\n ssr,\r\n isTS,\r\n inSSR,\r\n source: ast.loc.source,\r\n code: ``,\r\n column: 1,\r\n line: 1,\r\n offset: 0,\r\n indentLevel: 0,\r\n pure: false,\r\n map: undefined,\r\n helper(key) {\r\n return `_${helperNameMap[key]}`;\r\n },\r\n push(code, node) {\r\n context.code += code;\r\n },\r\n indent() {\r\n newline(++context.indentLevel);\r\n },\r\n deindent(withoutNewLine = false) {\r\n if (withoutNewLine) {\r\n --context.indentLevel;\r\n }\r\n else {\r\n newline(--context.indentLevel);\r\n }\r\n },\r\n newline() {\r\n newline(context.indentLevel);\r\n }\r\n };\r\n function newline(n) {\r\n context.push('\\n' + ` `.repeat(n));\r\n }\r\n return context;\r\n}\r\nfunction generate(ast, options = {}) {\r\n const context = createCodegenContext(ast, options);\r\n if (options.onContextCreated)\r\n options.onContextCreated(context);\r\n const { mode, push, prefixIdentifiers, indent, deindent, newline, scopeId, ssr } = context;\r\n const hasHelpers = ast.helpers.length > 0;\r\n const useWithBlock = !prefixIdentifiers && mode !== 'module';\r\n // preambles\r\n // in setup() inline mode, the preamble is generated in a sub context\r\n // and returned separately.\r\n const preambleContext = context;\r\n {\r\n genFunctionPreamble(ast, preambleContext);\r\n }\r\n // enter render function\r\n const functionName = ssr ? `ssrRender` : `render`;\r\n const args = ssr ? ['_ctx', '_push', '_parent', '_attrs'] : ['_ctx', '_cache'];\r\n const signature = args.join(', ');\r\n {\r\n push(`function ${functionName}(${signature}) {`);\r\n }\r\n indent();\r\n if (useWithBlock) {\r\n push(`with (_ctx) {`);\r\n indent();\r\n // function mode const declarations should be inside with block\r\n // also they should be renamed to avoid collision with user properties\r\n if (hasHelpers) {\r\n push(`const { ${ast.helpers\r\n .map(s => `${helperNameMap[s]}: _${helperNameMap[s]}`)\r\n .join(', ')} } = _Vue`);\r\n push(`\\n`);\r\n newline();\r\n }\r\n }\r\n // generate asset resolution statements\r\n if (ast.components.length) {\r\n genAssets(ast.components, 'component', context);\r\n if (ast.directives.length || ast.temps > 0) {\r\n newline();\r\n }\r\n }\r\n if (ast.directives.length) {\r\n genAssets(ast.directives, 'directive', context);\r\n if (ast.temps > 0) {\r\n newline();\r\n }\r\n }\r\n if (ast.filters && ast.filters.length) {\r\n newline();\r\n genAssets(ast.filters, 'filter', context);\r\n newline();\r\n }\r\n if (ast.temps > 0) {\r\n push(`let `);\r\n for (let i = 0; i < ast.temps; i++) {\r\n push(`${i > 0 ? `, ` : ``}_temp${i}`);\r\n }\r\n }\r\n if (ast.components.length || ast.directives.length || ast.temps) {\r\n push(`\\n`);\r\n newline();\r\n }\r\n // generate the VNode tree expression\r\n if (!ssr) {\r\n push(`return `);\r\n }\r\n if (ast.codegenNode) {\r\n genNode(ast.codegenNode, context);\r\n }\r\n else {\r\n push(`null`);\r\n }\r\n if (useWithBlock) {\r\n deindent();\r\n push(`}`);\r\n }\r\n deindent();\r\n push(`}`);\r\n return {\r\n ast,\r\n code: context.code,\r\n preamble: ``,\r\n // SourceMapGenerator does have toJSON() method but it's not in the types\r\n map: context.map ? context.map.toJSON() : undefined\r\n };\r\n}\r\nfunction genFunctionPreamble(ast, context) {\r\n const { ssr, prefixIdentifiers, push, newline, runtimeModuleName, runtimeGlobalName, ssrRuntimeModuleName } = context;\r\n const VueBinding = runtimeGlobalName;\r\n const aliasHelper = (s) => `${helperNameMap[s]}: _${helperNameMap[s]}`;\r\n // Generate const declaration for helpers\r\n // In prefix mode, we place the const declaration at top so it's done\r\n // only once; But if we not prefixing, we place the declaration inside the\r\n // with block so it doesn't incur the `in` check cost for every helper access.\r\n if (ast.helpers.length > 0) {\r\n {\r\n // \"with\" mode.\r\n // save Vue in a separate variable to avoid collision\r\n push(`const _Vue = ${VueBinding}\\n`);\r\n // in \"with\" mode, helpers are declared inside the with block to avoid\r\n // has check cost, but hoists are lifted out of the function - we need\r\n // to provide the helper here.\r\n if (ast.hoists.length) {\r\n const staticHelpers = [\r\n CREATE_VNODE,\r\n CREATE_ELEMENT_VNODE,\r\n CREATE_COMMENT,\r\n CREATE_TEXT,\r\n CREATE_STATIC\r\n ]\r\n .filter(helper => ast.helpers.includes(helper))\r\n .map(aliasHelper)\r\n .join(', ');\r\n push(`const { ${staticHelpers} } = _Vue\\n`);\r\n }\r\n }\r\n }\r\n genHoists(ast.hoists, context);\r\n newline();\r\n push(`return `);\r\n}\r\nfunction genAssets(assets, type, { helper, push, newline, isTS }) {\r\n const resolver = helper(type === 'filter'\r\n ? RESOLVE_FILTER\r\n : type === 'component'\r\n ? RESOLVE_COMPONENT\r\n : RESOLVE_DIRECTIVE);\r\n for (let i = 0; i < assets.length; i++) {\r\n let id = assets[i];\r\n // potential component implicit self-reference inferred from SFC filename\r\n const maybeSelfReference = id.endsWith('__self');\r\n if (maybeSelfReference) {\r\n id = id.slice(0, -6);\r\n }\r\n push(`const ${toValidAssetId(id, type)} = ${resolver}(${JSON.stringify(id)}${maybeSelfReference ? `, true` : ``})${isTS ? `!` : ``}`);\r\n if (i < assets.length - 1) {\r\n newline();\r\n }\r\n }\r\n}\r\nfunction genHoists(hoists, context) {\r\n if (!hoists.length) {\r\n return;\r\n }\r\n context.pure = true;\r\n const { push, newline, helper, scopeId, mode } = context;\r\n newline();\r\n for (let i = 0; i < hoists.length; i++) {\r\n const exp = hoists[i];\r\n if (exp) {\r\n push(`const _hoisted_${i + 1} = ${``}`);\r\n genNode(exp, context);\r\n newline();\r\n }\r\n }\r\n context.pure = false;\r\n}\r\nfunction isText$1(n) {\r\n return (isString(n) ||\r\n n.type === 4 /* SIMPLE_EXPRESSION */ ||\r\n n.type === 2 /* TEXT */ ||\r\n n.type === 5 /* INTERPOLATION */ ||\r\n n.type === 8 /* COMPOUND_EXPRESSION */);\r\n}\r\nfunction genNodeListAsArray(nodes, context) {\r\n const multilines = nodes.length > 3 ||\r\n ((( false)) && 0);\r\n context.push(`[`);\r\n multilines && context.indent();\r\n genNodeList(nodes, context, multilines);\r\n multilines && context.deindent();\r\n context.push(`]`);\r\n}\r\nfunction genNodeList(nodes, context, multilines = false, comma = true) {\r\n const { push, newline } = context;\r\n for (let i = 0; i < nodes.length; i++) {\r\n const node = nodes[i];\r\n if (shared_esm_bundler_isString(node)) {\r\n push(node);\r\n }\r\n else if (shared_esm_bundler_isArray(node)) {\r\n genNodeListAsArray(node, context);\r\n }\r\n else {\r\n genNode(node, context);\r\n }\r\n if (i < nodes.length - 1) {\r\n if (multilines) {\r\n comma && push(',');\r\n newline();\r\n }\r\n else {\r\n comma && push(', ');\r\n }\r\n }\r\n }\r\n}\r\nfunction genNode(node, context) {\r\n if (shared_esm_bundler_isString(node)) {\r\n context.push(node);\r\n return;\r\n }\r\n if (isSymbol(node)) {\r\n context.push(context.helper(node));\r\n return;\r\n }\r\n switch (node.type) {\r\n case 1 /* ELEMENT */:\r\n case 9 /* IF */:\r\n case 11 /* FOR */:\r\n ( false) &&\r\n 0;\r\n genNode(node.codegenNode, context);\r\n break;\r\n case 2 /* TEXT */:\r\n genText(node, context);\r\n break;\r\n case 4 /* SIMPLE_EXPRESSION */:\r\n genExpression(node, context);\r\n break;\r\n case 5 /* INTERPOLATION */:\r\n genInterpolation(node, context);\r\n break;\r\n case 12 /* TEXT_CALL */:\r\n genNode(node.codegenNode, context);\r\n break;\r\n case 8 /* COMPOUND_EXPRESSION */:\r\n genCompoundExpression(node, context);\r\n break;\r\n case 3 /* COMMENT */:\r\n genComment(node, context);\r\n break;\r\n case 13 /* VNODE_CALL */:\r\n genVNodeCall(node, context);\r\n break;\r\n case 14 /* JS_CALL_EXPRESSION */:\r\n genCallExpression(node, context);\r\n break;\r\n case 15 /* JS_OBJECT_EXPRESSION */:\r\n genObjectExpression(node, context);\r\n break;\r\n case 17 /* JS_ARRAY_EXPRESSION */:\r\n genArrayExpression(node, context);\r\n break;\r\n case 18 /* JS_FUNCTION_EXPRESSION */:\r\n genFunctionExpression(node, context);\r\n break;\r\n case 19 /* JS_CONDITIONAL_EXPRESSION */:\r\n genConditionalExpression(node, context);\r\n break;\r\n case 20 /* JS_CACHE_EXPRESSION */:\r\n genCacheExpression(node, context);\r\n break;\r\n case 21 /* JS_BLOCK_STATEMENT */:\r\n genNodeList(node.body, context, true, false);\r\n break;\r\n // SSR only types\r\n case 22 /* JS_TEMPLATE_LITERAL */:\r\n break;\r\n case 23 /* JS_IF_STATEMENT */:\r\n break;\r\n case 24 /* JS_ASSIGNMENT_EXPRESSION */:\r\n break;\r\n case 25 /* JS_SEQUENCE_EXPRESSION */:\r\n break;\r\n case 26 /* JS_RETURN_STATEMENT */:\r\n break;\r\n /* istanbul ignore next */\r\n case 10 /* IF_BRANCH */:\r\n // noop\r\n break;\r\n default:\r\n if ((false)) {}\r\n }\r\n}\r\nfunction genText(node, context) {\r\n context.push(JSON.stringify(node.content), node);\r\n}\r\nfunction genExpression(node, context) {\r\n const { content, isStatic } = node;\r\n context.push(isStatic ? JSON.stringify(content) : content, node);\r\n}\r\nfunction genInterpolation(node, context) {\r\n const { push, helper, pure } = context;\r\n if (pure)\r\n push(PURE_ANNOTATION);\r\n push(`${helper(TO_DISPLAY_STRING)}(`);\r\n genNode(node.content, context);\r\n push(`)`);\r\n}\r\nfunction genCompoundExpression(node, context) {\r\n for (let i = 0; i < node.children.length; i++) {\r\n const child = node.children[i];\r\n if (shared_esm_bundler_isString(child)) {\r\n context.push(child);\r\n }\r\n else {\r\n genNode(child, context);\r\n }\r\n }\r\n}\r\nfunction genExpressionAsPropertyKey(node, context) {\r\n const { push } = context;\r\n if (node.type === 8 /* COMPOUND_EXPRESSION */) {\r\n push(`[`);\r\n genCompoundExpression(node, context);\r\n push(`]`);\r\n }\r\n else if (node.isStatic) {\r\n // only quote keys if necessary\r\n const text = isSimpleIdentifier(node.content)\r\n ? node.content\r\n : JSON.stringify(node.content);\r\n push(text, node);\r\n }\r\n else {\r\n push(`[${node.content}]`, node);\r\n }\r\n}\r\nfunction genComment(node, context) {\r\n const { push, helper, pure } = context;\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n push(`${helper(CREATE_COMMENT)}(${JSON.stringify(node.content)})`, node);\r\n}\r\nfunction genVNodeCall(node, context) {\r\n const { push, helper, pure } = context;\r\n const { tag, props, children, patchFlag, dynamicProps, directives, isBlock, disableTracking, isComponent } = node;\r\n if (directives) {\r\n push(helper(WITH_DIRECTIVES) + `(`);\r\n }\r\n if (isBlock) {\r\n push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `);\r\n }\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n const callHelper = isBlock\r\n ? getVNodeBlockHelper(context.inSSR, isComponent)\r\n : getVNodeHelper(context.inSSR, isComponent);\r\n push(helper(callHelper) + `(`, node);\r\n genNodeList(genNullableArgs([tag, props, children, patchFlag, dynamicProps]), context);\r\n push(`)`);\r\n if (isBlock) {\r\n push(`)`);\r\n }\r\n if (directives) {\r\n push(`, `);\r\n genNode(directives, context);\r\n push(`)`);\r\n }\r\n}\r\nfunction genNullableArgs(args) {\r\n let i = args.length;\r\n while (i--) {\r\n if (args[i] != null)\r\n break;\r\n }\r\n return args.slice(0, i + 1).map(arg => arg || `null`);\r\n}\r\n// JavaScript\r\nfunction genCallExpression(node, context) {\r\n const { push, helper, pure } = context;\r\n const callee = shared_esm_bundler_isString(node.callee) ? node.callee : helper(node.callee);\r\n if (pure) {\r\n push(PURE_ANNOTATION);\r\n }\r\n push(callee + `(`, node);\r\n genNodeList(node.arguments, context);\r\n push(`)`);\r\n}\r\nfunction genObjectExpression(node, context) {\r\n const { push, indent, deindent, newline } = context;\r\n const { properties } = node;\r\n if (!properties.length) {\r\n push(`{}`, node);\r\n return;\r\n }\r\n const multilines = properties.length > 1 ||\r\n ((( false)) &&\r\n 0);\r\n push(multilines ? `{` : `{ `);\r\n multilines && indent();\r\n for (let i = 0; i < properties.length; i++) {\r\n const { key, value } = properties[i];\r\n // key\r\n genExpressionAsPropertyKey(key, context);\r\n push(`: `);\r\n // value\r\n genNode(value, context);\r\n if (i < properties.length - 1) {\r\n // will only reach this if it's multilines\r\n push(`,`);\r\n newline();\r\n }\r\n }\r\n multilines && deindent();\r\n push(multilines ? `}` : ` }`);\r\n}\r\nfunction genArrayExpression(node, context) {\r\n genNodeListAsArray(node.elements, context);\r\n}\r\nfunction genFunctionExpression(node, context) {\r\n const { push, indent, deindent } = context;\r\n const { params, returns, body, newline, isSlot } = node;\r\n if (isSlot) {\r\n // wrap slot functions with owner context\r\n push(`_${helperNameMap[WITH_CTX]}(`);\r\n }\r\n push(`(`, node);\r\n if (shared_esm_bundler_isArray(params)) {\r\n genNodeList(params, context);\r\n }\r\n else if (params) {\r\n genNode(params, context);\r\n }\r\n push(`) => `);\r\n if (newline || body) {\r\n push(`{`);\r\n indent();\r\n }\r\n if (returns) {\r\n if (newline) {\r\n push(`return `);\r\n }\r\n if (shared_esm_bundler_isArray(returns)) {\r\n genNodeListAsArray(returns, context);\r\n }\r\n else {\r\n genNode(returns, context);\r\n }\r\n }\r\n else if (body) {\r\n genNode(body, context);\r\n }\r\n if (newline || body) {\r\n deindent();\r\n push(`}`);\r\n }\r\n if (isSlot) {\r\n if (node.isNonScopedSlot) {\r\n push(`, undefined, true`);\r\n }\r\n push(`)`);\r\n }\r\n}\r\nfunction genConditionalExpression(node, context) {\r\n const { test, consequent, alternate, newline: needNewline } = node;\r\n const { push, indent, deindent, newline } = context;\r\n if (test.type === 4 /* SIMPLE_EXPRESSION */) {\r\n const needsParens = !isSimpleIdentifier(test.content);\r\n needsParens && push(`(`);\r\n genExpression(test, context);\r\n needsParens && push(`)`);\r\n }\r\n else {\r\n push(`(`);\r\n genNode(test, context);\r\n push(`)`);\r\n }\r\n needNewline && indent();\r\n context.indentLevel++;\r\n needNewline || push(` `);\r\n push(`? `);\r\n genNode(consequent, context);\r\n context.indentLevel--;\r\n needNewline && newline();\r\n needNewline || push(` `);\r\n push(`: `);\r\n const isNested = alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */;\r\n if (!isNested) {\r\n context.indentLevel++;\r\n }\r\n genNode(alternate, context);\r\n if (!isNested) {\r\n context.indentLevel--;\r\n }\r\n needNewline && deindent(true /* without newline */);\r\n}\r\nfunction genCacheExpression(node, context) {\r\n const { push, helper, indent, deindent, newline } = context;\r\n push(`_cache[${node.index}] || (`);\r\n if (node.isVNode) {\r\n indent();\r\n push(`${helper(SET_BLOCK_TRACKING)}(-1),`);\r\n newline();\r\n }\r\n push(`_cache[${node.index}] = `);\r\n genNode(node.value, context);\r\n if (node.isVNode) {\r\n push(`,`);\r\n newline();\r\n push(`${helper(SET_BLOCK_TRACKING)}(1),`);\r\n newline();\r\n push(`_cache[${node.index}]`);\r\n deindent();\r\n }\r\n push(`)`);\r\n}\n\nfunction walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = Object.create(null)) {\r\n {\r\n return;\r\n }\r\n}\r\nfunction isReferencedIdentifier(id, parent, parentStack) {\r\n {\r\n return false;\r\n }\r\n}\r\nfunction isInDestructureAssignment(parent, parentStack) {\r\n if (parent &&\r\n (parent.type === 'ObjectProperty' || parent.type === 'ArrayPattern')) {\r\n let i = parentStack.length;\r\n while (i--) {\r\n const p = parentStack[i];\r\n if (p.type === 'AssignmentExpression') {\r\n return true;\r\n }\r\n else if (p.type !== 'ObjectProperty' && !p.type.endsWith('Pattern')) {\r\n break;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction walkFunctionParams(node, onIdent) {\r\n for (const p of node.params) {\r\n for (const id of extractIdentifiers(p)) {\r\n onIdent(id);\r\n }\r\n }\r\n}\r\nfunction walkBlockDeclarations(block, onIdent) {\r\n for (const stmt of block.body) {\r\n if (stmt.type === 'VariableDeclaration') {\r\n if (stmt.declare)\r\n continue;\r\n for (const decl of stmt.declarations) {\r\n for (const id of extractIdentifiers(decl.id)) {\r\n onIdent(id);\r\n }\r\n }\r\n }\r\n else if (stmt.type === 'FunctionDeclaration' ||\r\n stmt.type === 'ClassDeclaration') {\r\n if (stmt.declare || !stmt.id)\r\n continue;\r\n onIdent(stmt.id);\r\n }\r\n }\r\n}\r\nfunction extractIdentifiers(param, nodes = []) {\r\n switch (param.type) {\r\n case 'Identifier':\r\n nodes.push(param);\r\n break;\r\n case 'MemberExpression':\r\n let object = param;\r\n while (object.type === 'MemberExpression') {\r\n object = object.object;\r\n }\r\n nodes.push(object);\r\n break;\r\n case 'ObjectPattern':\r\n for (const prop of param.properties) {\r\n if (prop.type === 'RestElement') {\r\n extractIdentifiers(prop.argument, nodes);\r\n }\r\n else {\r\n extractIdentifiers(prop.value, nodes);\r\n }\r\n }\r\n break;\r\n case 'ArrayPattern':\r\n param.elements.forEach(element => {\r\n if (element)\r\n extractIdentifiers(element, nodes);\r\n });\r\n break;\r\n case 'RestElement':\r\n extractIdentifiers(param.argument, nodes);\r\n break;\r\n case 'AssignmentPattern':\r\n extractIdentifiers(param.left, nodes);\r\n break;\r\n }\r\n return nodes;\r\n}\r\nconst isFunctionType = (node) => {\r\n return /Function(?:Expression|Declaration)$|Method$/.test(node.type);\r\n};\r\nconst isStaticProperty = (node) => node &&\r\n (node.type === 'ObjectProperty' || node.type === 'ObjectMethod') &&\r\n !node.computed;\r\nconst isStaticPropertyKey = (node, parent) => isStaticProperty(parent) && parent.key === node;\n\n// these keywords should not appear inside expressions, but operators like\r\n// typeof, instanceof and in are allowed\r\nconst prohibitedKeywordRE = new RegExp('\\\\b' +\r\n ('do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +\r\n 'super,throw,while,yield,delete,export,import,return,switch,default,' +\r\n 'extends,finally,continue,debugger,function,arguments,typeof,void')\r\n .split(',')\r\n .join('\\\\b|\\\\b') +\r\n '\\\\b');\r\n// strip strings in expressions\r\nconst stripStringRE = /'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|`(?:[^`\\\\]|\\\\.)*\\$\\{|\\}(?:[^`\\\\]|\\\\.)*`|`(?:[^`\\\\]|\\\\.)*`/g;\r\n/**\r\n * Validate a non-prefixed expression.\r\n * This is only called when using the in-browser runtime compiler since it\r\n * doesn't prefix expressions.\r\n */\r\nfunction validateBrowserExpression(node, context, asParams = false, asRawStatements = false) {\r\n const exp = node.content;\r\n // empty expressions are validated per-directive since some directives\r\n // do allow empty expressions.\r\n if (!exp.trim()) {\r\n return;\r\n }\r\n try {\r\n new Function(asRawStatements\r\n ? ` ${exp} `\r\n : `return ${asParams ? `(${exp}) => {}` : `(${exp})`}`);\r\n }\r\n catch (e) {\r\n let message = e.message;\r\n const keywordMatch = exp\r\n .replace(stripStringRE, '')\r\n .match(prohibitedKeywordRE);\r\n if (keywordMatch) {\r\n message = `avoid using JavaScript keyword as property name: \"${keywordMatch[0]}\"`;\r\n }\r\n context.onError(createCompilerError(44 /* X_INVALID_EXPRESSION */, node.loc, undefined, message));\r\n }\r\n}\n\nconst transformExpression = (node, context) => {\r\n if (node.type === 5 /* INTERPOLATION */) {\r\n node.content = processExpression(node.content, context);\r\n }\r\n else if (node.type === 1 /* ELEMENT */) {\r\n // handle directives on element\r\n for (let i = 0; i < node.props.length; i++) {\r\n const dir = node.props[i];\r\n // do not process for v-on & v-for since they are special handled\r\n if (dir.type === 7 /* DIRECTIVE */ && dir.name !== 'for') {\r\n const exp = dir.exp;\r\n const arg = dir.arg;\r\n // do not process exp if this is v-on:arg - we need special handling\r\n // for wrapping inline statements.\r\n if (exp &&\r\n exp.type === 4 /* SIMPLE_EXPRESSION */ &&\r\n !(dir.name === 'on' && arg)) {\r\n dir.exp = processExpression(exp, context, \r\n // slot args must be processed as function params\r\n dir.name === 'slot');\r\n }\r\n if (arg && arg.type === 4 /* SIMPLE_EXPRESSION */ && !arg.isStatic) {\r\n dir.arg = processExpression(arg, context);\r\n }\r\n }\r\n }\r\n }\r\n};\r\n// Important: since this function uses Node.js only dependencies, it should\r\n// always be used with a leading !true check so that it can be\r\n// tree-shaken from the browser build.\r\nfunction processExpression(node, context, \r\n// some expressions like v-slot props & v-for aliases should be parsed as\r\n// function params\r\nasParams = false, \r\n// v-on handler values may contain multiple statements\r\nasRawStatements = false, localVars = Object.create(context.identifiers)) {\r\n {\r\n if ((false)) {}\r\n return node;\r\n }\r\n}\n\nconst transformIf = createStructuralDirectiveTransform(/^(if|else|else-if)$/, (node, dir, context) => {\r\n return processIf(node, dir, context, (ifNode, branch, isRoot) => {\r\n // #1587: We need to dynamically increment the key based on the current\r\n // node's sibling nodes, since chained v-if/else branches are\r\n // rendered at the same depth\r\n const siblings = context.parent.children;\r\n let i = siblings.indexOf(ifNode);\r\n let key = 0;\r\n while (i-- >= 0) {\r\n const sibling = siblings[i];\r\n if (sibling && sibling.type === 9 /* IF */) {\r\n key += sibling.branches.length;\r\n }\r\n }\r\n // Exit callback. Complete the codegenNode when all children have been\r\n // transformed.\r\n return () => {\r\n if (isRoot) {\r\n ifNode.codegenNode = createCodegenNodeForBranch(branch, key, context);\r\n }\r\n else {\r\n // attach this branch's codegen node to the v-if root.\r\n const parentCondition = getParentCondition(ifNode.codegenNode);\r\n parentCondition.alternate = createCodegenNodeForBranch(branch, key + ifNode.branches.length - 1, context);\r\n }\r\n };\r\n });\r\n});\r\n// target-agnostic transform used for both Client and SSR\r\nfunction processIf(node, dir, context, processCodegen) {\r\n if (dir.name !== 'else' &&\r\n (!dir.exp || !dir.exp.content.trim())) {\r\n const loc = dir.exp ? dir.exp.loc : node.loc;\r\n context.onError(createCompilerError(28 /* X_V_IF_NO_EXPRESSION */, dir.loc));\r\n dir.exp = createSimpleExpression(`true`, false, loc);\r\n }\r\n if (false) {}\r\n if (dir.name === 'if') {\r\n const branch = createIfBranch(node, dir);\r\n const ifNode = {\r\n type: 9 /* IF */,\r\n loc: node.loc,\r\n branches: [branch]\r\n };\r\n context.replaceNode(ifNode);\r\n if (processCodegen) {\r\n return processCodegen(ifNode, branch, true);\r\n }\r\n }\r\n else {\r\n // locate the adjacent v-if\r\n const siblings = context.parent.children;\r\n const comments = [];\r\n let i = siblings.indexOf(node);\r\n while (i-- >= -1) {\r\n const sibling = siblings[i];\r\n if (false /* COMMENT */) {}\r\n if (sibling &&\r\n sibling.type === 2 /* TEXT */ &&\r\n !sibling.content.trim().length) {\r\n context.removeNode(sibling);\r\n continue;\r\n }\r\n if (sibling && sibling.type === 9 /* IF */) {\r\n // Check if v-else was followed by v-else-if\r\n if (dir.name === 'else-if' &&\r\n sibling.branches[sibling.branches.length - 1].condition === undefined) {\r\n context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));\r\n }\r\n // move the node to the if node's branches\r\n context.removeNode();\r\n const branch = createIfBranch(node, dir);\r\n if (false) {}\r\n // check if user is forcing same key on different branches\r\n if (false) {}\r\n sibling.branches.push(branch);\r\n const onExit = processCodegen && processCodegen(sibling, branch, false);\r\n // since the branch was removed, it will not be traversed.\r\n // make sure to traverse here.\r\n traverseNode(branch, context);\r\n // call on exit\r\n if (onExit)\r\n onExit();\r\n // make sure to reset currentNode after traversal to indicate this\r\n // node has been removed.\r\n context.currentNode = null;\r\n }\r\n else {\r\n context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, node.loc));\r\n }\r\n break;\r\n }\r\n }\r\n}\r\nfunction createIfBranch(node, dir) {\r\n return {\r\n type: 10 /* IF_BRANCH */,\r\n loc: node.loc,\r\n condition: dir.name === 'else' ? undefined : dir.exp,\r\n children: node.tagType === 3 /* TEMPLATE */ && !findDir(node, 'for')\r\n ? node.children\r\n : [node],\r\n userKey: findProp(node, `key`)\r\n };\r\n}\r\nfunction createCodegenNodeForBranch(branch, keyIndex, context) {\r\n if (branch.condition) {\r\n return createConditionalExpression(branch.condition, createChildrenCodegenNode(branch, keyIndex, context), \r\n // make sure to pass in asBlock: true so that the comment node call\r\n // closes the current block.\r\n createCallExpression(context.helper(CREATE_COMMENT), [\r\n ( false) ? 0 : '\"\"',\r\n 'true'\r\n ]));\r\n }\r\n else {\r\n return createChildrenCodegenNode(branch, keyIndex, context);\r\n }\r\n}\r\nfunction createChildrenCodegenNode(branch, keyIndex, context) {\r\n const { helper } = context;\r\n const keyProperty = createObjectProperty(`key`, createSimpleExpression(`${keyIndex}`, false, locStub, 2 /* CAN_HOIST */));\r\n const { children } = branch;\r\n const firstChild = children[0];\r\n const needFragmentWrapper = children.length !== 1 || firstChild.type !== 1 /* ELEMENT */;\r\n if (needFragmentWrapper) {\r\n if (children.length === 1 && firstChild.type === 11 /* FOR */) {\r\n // optimize away nested fragments when child is a ForNode\r\n const vnodeCall = firstChild.codegenNode;\r\n injectProp(vnodeCall, keyProperty, context);\r\n return vnodeCall;\r\n }\r\n else {\r\n let patchFlag = 64 /* STABLE_FRAGMENT */;\r\n let patchFlagText = PatchFlagNames[64];\r\n // check if the fragment actually contains a single valid child with\r\n // the rest being comments\r\n if (false) {}\r\n return createVNodeCall(context, helper(FRAGMENT), createObjectExpression([keyProperty]), children, patchFlag + (( false) ? 0 : ``), undefined, undefined, true, false, false /* isComponent */, branch.loc);\r\n }\r\n }\r\n else {\r\n const ret = firstChild.codegenNode;\r\n const vnodeCall = getMemoedVNodeCall(ret);\r\n // Change createVNode to createBlock.\r\n if (vnodeCall.type === 13 /* VNODE_CALL */) {\r\n makeBlock(vnodeCall, context);\r\n }\r\n // inject branch key\r\n injectProp(vnodeCall, keyProperty, context);\r\n return ret;\r\n }\r\n}\r\nfunction isSameKey(a, b) {\r\n if (!a || a.type !== b.type) {\r\n return false;\r\n }\r\n if (a.type === 6 /* ATTRIBUTE */) {\r\n if (a.value.content !== b.value.content) {\r\n return false;\r\n }\r\n }\r\n else {\r\n // directive\r\n const exp = a.exp;\r\n const branchExp = b.exp;\r\n if (exp.type !== branchExp.type) {\r\n return false;\r\n }\r\n if (exp.type !== 4 /* SIMPLE_EXPRESSION */ ||\r\n exp.isStatic !== branchExp.isStatic ||\r\n exp.content !== branchExp.content) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}\r\nfunction getParentCondition(node) {\r\n while (true) {\r\n if (node.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\r\n if (node.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\r\n node = node.alternate;\r\n }\r\n else {\r\n return node;\r\n }\r\n }\r\n else if (node.type === 20 /* JS_CACHE_EXPRESSION */) {\r\n node = node.value;\r\n }\r\n }\r\n}\n\nconst transformFor = createStructuralDirectiveTransform('for', (node, dir, context) => {\r\n const { helper, removeHelper } = context;\r\n return processFor(node, dir, context, forNode => {\r\n // create the loop render function expression now, and add the\r\n // iterator on exit after all children have been traversed\r\n const renderExp = createCallExpression(helper(RENDER_LIST), [\r\n forNode.source\r\n ]);\r\n const memo = findDir(node, 'memo');\r\n const keyProp = findProp(node, `key`);\r\n const keyExp = keyProp &&\r\n (keyProp.type === 6 /* ATTRIBUTE */\r\n ? createSimpleExpression(keyProp.value.content, true)\r\n : keyProp.exp);\r\n const keyProperty = keyProp ? createObjectProperty(`key`, keyExp) : null;\r\n const isStableFragment = forNode.source.type === 4 /* SIMPLE_EXPRESSION */ &&\r\n forNode.source.constType > 0 /* NOT_CONSTANT */;\r\n const fragmentFlag = isStableFragment\r\n ? 64 /* STABLE_FRAGMENT */\r\n : keyProp\r\n ? 128 /* KEYED_FRAGMENT */\r\n : 256 /* UNKEYED_FRAGMENT */;\r\n forNode.codegenNode = createVNodeCall(context, helper(FRAGMENT), undefined, renderExp, fragmentFlag +\r\n (( false) ? 0 : ``), undefined, undefined, true /* isBlock */, !isStableFragment /* disableTracking */, false /* isComponent */, node.loc);\r\n return () => {\r\n // finish the codegen now that all children have been traversed\r\n let childBlock;\r\n const isTemplate = isTemplateNode(node);\r\n const { children } = forNode;\r\n // check <template v-for> key placement\r\n if (false) {}\r\n const needFragmentWrapper = children.length !== 1 || children[0].type !== 1 /* ELEMENT */;\r\n const slotOutlet = isSlotOutlet(node)\r\n ? node\r\n : isTemplate &&\r\n node.children.length === 1 &&\r\n isSlotOutlet(node.children[0])\r\n ? node.children[0] // api-extractor somehow fails to infer this\r\n : null;\r\n if (slotOutlet) {\r\n // <slot v-for=\"...\"> or <template v-for=\"...\"><slot/></template>\r\n childBlock = slotOutlet.codegenNode;\r\n if (isTemplate && keyProperty) {\r\n // <template v-for=\"...\" :key=\"...\"><slot/></template>\r\n // we need to inject the key to the renderSlot() call.\r\n // the props for renderSlot is passed as the 3rd argument.\r\n injectProp(childBlock, keyProperty, context);\r\n }\r\n }\r\n else if (needFragmentWrapper) {\r\n // <template v-for=\"...\"> with text or multi-elements\r\n // should generate a fragment block for each loop\r\n childBlock = createVNodeCall(context, helper(FRAGMENT), keyProperty ? createObjectExpression([keyProperty]) : undefined, node.children, 64 /* STABLE_FRAGMENT */ +\r\n (( false)\r\n ? 0\r\n : ``), undefined, undefined, true, undefined, false /* isComponent */);\r\n }\r\n else {\r\n // Normal element v-for. Directly use the child's codegenNode\r\n // but mark it as a block.\r\n childBlock = children[0]\r\n .codegenNode;\r\n if (isTemplate && keyProperty) {\r\n injectProp(childBlock, keyProperty, context);\r\n }\r\n if (childBlock.isBlock !== !isStableFragment) {\r\n if (childBlock.isBlock) {\r\n // switch from block to vnode\r\n removeHelper(OPEN_BLOCK);\r\n removeHelper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n else {\r\n // switch from vnode to block\r\n removeHelper(getVNodeHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n }\r\n childBlock.isBlock = !isStableFragment;\r\n if (childBlock.isBlock) {\r\n helper(OPEN_BLOCK);\r\n helper(getVNodeBlockHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n else {\r\n helper(getVNodeHelper(context.inSSR, childBlock.isComponent));\r\n }\r\n }\r\n if (memo) {\r\n const loop = createFunctionExpression(createForLoopParams(forNode.parseResult, [\r\n createSimpleExpression(`_cached`)\r\n ]));\r\n loop.body = createBlockStatement([\r\n createCompoundExpression([`const _memo = (`, memo.exp, `)`]),\r\n createCompoundExpression([\r\n `if (_cached`,\r\n ...(keyExp ? [` && _cached.key === `, keyExp] : []),\r\n ` && ${context.helperString(IS_MEMO_SAME)}(_cached, _memo)) return _cached`\r\n ]),\r\n createCompoundExpression([`const _item = `, childBlock]),\r\n createSimpleExpression(`_item.memo = _memo`),\r\n createSimpleExpression(`return _item`)\r\n ]);\r\n renderExp.arguments.push(loop, createSimpleExpression(`_cache`), createSimpleExpression(String(context.cached++)));\r\n }\r\n else {\r\n renderExp.arguments.push(createFunctionExpression(createForLoopParams(forNode.parseResult), childBlock, true /* force newline */));\r\n }\r\n };\r\n });\r\n});\r\n// target-agnostic transform used for both Client and SSR\r\nfunction processFor(node, dir, context, processCodegen) {\r\n if (!dir.exp) {\r\n context.onError(createCompilerError(31 /* X_V_FOR_NO_EXPRESSION */, dir.loc));\r\n return;\r\n }\r\n const parseResult = parseForExpression(\r\n // can only be simple expression because vFor transform is applied\r\n // before expression transform.\r\n dir.exp, context);\r\n if (!parseResult) {\r\n context.onError(createCompilerError(32 /* X_V_FOR_MALFORMED_EXPRESSION */, dir.loc));\r\n return;\r\n }\r\n const { addIdentifiers, removeIdentifiers, scopes } = context;\r\n const { source, value, key, index } = parseResult;\r\n const forNode = {\r\n type: 11 /* FOR */,\r\n loc: dir.loc,\r\n source,\r\n valueAlias: value,\r\n keyAlias: key,\r\n objectIndexAlias: index,\r\n parseResult,\r\n children: isTemplateNode(node) ? node.children : [node]\r\n };\r\n context.replaceNode(forNode);\r\n // bookkeeping\r\n scopes.vFor++;\r\n const onExit = processCodegen && processCodegen(forNode);\r\n return () => {\r\n scopes.vFor--;\r\n if (onExit)\r\n onExit();\r\n };\r\n}\r\nconst forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\r\n// This regex doesn't cover the case if key or index aliases have destructuring,\r\n// but those do not make sense in the first place, so this works in practice.\r\nconst forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\r\nconst stripParensRE = /^\\(|\\)$/g;\r\nfunction parseForExpression(input, context) {\r\n const loc = input.loc;\r\n const exp = input.content;\r\n const inMatch = exp.match(forAliasRE);\r\n if (!inMatch)\r\n return;\r\n const [, LHS, RHS] = inMatch;\r\n const result = {\r\n source: createAliasExpression(loc, RHS.trim(), exp.indexOf(RHS, LHS.length)),\r\n value: undefined,\r\n key: undefined,\r\n index: undefined\r\n };\r\n if (false) {}\r\n let valueContent = LHS.trim().replace(stripParensRE, '').trim();\r\n const trimmedOffset = LHS.indexOf(valueContent);\r\n const iteratorMatch = valueContent.match(forIteratorRE);\r\n if (iteratorMatch) {\r\n valueContent = valueContent.replace(forIteratorRE, '').trim();\r\n const keyContent = iteratorMatch[1].trim();\r\n let keyOffset;\r\n if (keyContent) {\r\n keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);\r\n result.key = createAliasExpression(loc, keyContent, keyOffset);\r\n if (false) {}\r\n }\r\n if (iteratorMatch[2]) {\r\n const indexContent = iteratorMatch[2].trim();\r\n if (indexContent) {\r\n result.index = createAliasExpression(loc, indexContent, exp.indexOf(indexContent, result.key\r\n ? keyOffset + keyContent.length\r\n : trimmedOffset + valueContent.length));\r\n if (false) {}\r\n }\r\n }\r\n }\r\n if (valueContent) {\r\n result.value = createAliasExpression(loc, valueContent, trimmedOffset);\r\n if (false) {}\r\n }\r\n return result;\r\n}\r\nfunction createAliasExpression(range, content, offset) {\r\n return createSimpleExpression(content, false, getInnerRange(range, offset, content.length));\r\n}\r\nfunction createForLoopParams({ value, key, index }, memoArgs = []) {\r\n return createParamsList([value, key, index, ...memoArgs]);\r\n}\r\nfunction createParamsList(args) {\r\n let i = args.length;\r\n while (i--) {\r\n if (args[i])\r\n break;\r\n }\r\n return args\r\n .slice(0, i + 1)\r\n .map((arg, i) => arg || createSimpleExpression(`_`.repeat(i + 1), false));\r\n}\n\nconst defaultFallback = createSimpleExpression(`undefined`, false);\r\n// A NodeTransform that:\r\n// 1. Tracks scope identifiers for scoped slots so that they don't get prefixed\r\n// by transformExpression. This is only applied in non-browser builds with\r\n// { prefixIdentifiers: true }.\r\n// 2. Track v-slot depths so that we know a slot is inside another slot.\r\n// Note the exit callback is executed before buildSlots() on the same node,\r\n// so only nested slots see positive numbers.\r\nconst trackSlotScopes = (node, context) => {\r\n if (node.type === 1 /* ELEMENT */ &&\r\n (node.tagType === 1 /* COMPONENT */ ||\r\n node.tagType === 3 /* TEMPLATE */)) {\r\n // We are only checking non-empty v-slot here\r\n // since we only care about slots that introduce scope variables.\r\n const vSlot = findDir(node, 'slot');\r\n if (vSlot) {\r\n vSlot.exp;\r\n context.scopes.vSlot++;\r\n return () => {\r\n context.scopes.vSlot--;\r\n };\r\n }\r\n }\r\n};\r\n// A NodeTransform that tracks scope identifiers for scoped slots with v-for.\r\n// This transform is only applied in non-browser builds with { prefixIdentifiers: true }\r\nconst trackVForSlotScopes = (node, context) => {\r\n let vFor;\r\n if (isTemplateNode(node) &&\r\n node.props.some(isVSlot) &&\r\n (vFor = findDir(node, 'for'))) {\r\n const result = (vFor.parseResult = parseForExpression(vFor.exp, context));\r\n if (result) {\r\n const { value, key, index } = result;\r\n const { addIdentifiers, removeIdentifiers } = context;\r\n value && addIdentifiers(value);\r\n key && addIdentifiers(key);\r\n index && addIdentifiers(index);\r\n return () => {\r\n value && removeIdentifiers(value);\r\n key && removeIdentifiers(key);\r\n index && removeIdentifiers(index);\r\n };\r\n }\r\n }\r\n};\r\nconst buildClientSlotFn = (props, children, loc) => createFunctionExpression(props, children, false /* newline */, true /* isSlot */, children.length ? children[0].loc : loc);\r\n// Instead of being a DirectiveTransform, v-slot processing is called during\r\n// transformElement to build the slots object for a component.\r\nfunction buildSlots(node, context, buildSlotFn = buildClientSlotFn) {\r\n context.helper(WITH_CTX);\r\n const { children, loc } = node;\r\n const slotsProperties = [];\r\n const dynamicSlots = [];\r\n // If the slot is inside a v-for or another v-slot, force it to be dynamic\r\n // since it likely uses a scope variable.\r\n let hasDynamicSlots = context.scopes.vSlot > 0 || context.scopes.vFor > 0;\r\n // 1. Check for slot with slotProps on component itself.\r\n // <Comp v-slot=\"{ prop }\"/>\r\n const onComponentSlot = findDir(node, 'slot', true);\r\n if (onComponentSlot) {\r\n const { arg, exp } = onComponentSlot;\r\n if (arg && !isStaticExp(arg)) {\r\n hasDynamicSlots = true;\r\n }\r\n slotsProperties.push(createObjectProperty(arg || createSimpleExpression('default', true), buildSlotFn(exp, children, loc)));\r\n }\r\n // 2. Iterate through children and check for template slots\r\n // <template v-slot:foo=\"{ prop }\">\r\n let hasTemplateSlots = false;\r\n let hasNamedDefaultSlot = false;\r\n const implicitDefaultChildren = [];\r\n const seenSlotNames = new Set();\r\n for (let i = 0; i < children.length; i++) {\r\n const slotElement = children[i];\r\n let slotDir;\r\n if (!isTemplateNode(slotElement) ||\r\n !(slotDir = findDir(slotElement, 'slot', true))) {\r\n // not a <template v-slot>, skip.\r\n if (slotElement.type !== 3 /* COMMENT */) {\r\n implicitDefaultChildren.push(slotElement);\r\n }\r\n continue;\r\n }\r\n if (onComponentSlot) {\r\n // already has on-component slot - this is incorrect usage.\r\n context.onError(createCompilerError(37 /* X_V_SLOT_MIXED_SLOT_USAGE */, slotDir.loc));\r\n break;\r\n }\r\n hasTemplateSlots = true;\r\n const { children: slotChildren, loc: slotLoc } = slotElement;\r\n const { arg: slotName = createSimpleExpression(`default`, true), exp: slotProps, loc: dirLoc } = slotDir;\r\n // check if name is dynamic.\r\n let staticSlotName;\r\n if (isStaticExp(slotName)) {\r\n staticSlotName = slotName ? slotName.content : `default`;\r\n }\r\n else {\r\n hasDynamicSlots = true;\r\n }\r\n const slotFunction = buildSlotFn(slotProps, slotChildren, slotLoc);\r\n // check if this slot is conditional (v-if/v-for)\r\n let vIf;\r\n let vElse;\r\n let vFor;\r\n if ((vIf = findDir(slotElement, 'if'))) {\r\n hasDynamicSlots = true;\r\n dynamicSlots.push(createConditionalExpression(vIf.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback));\r\n }\r\n else if ((vElse = findDir(slotElement, /^else(-if)?$/, true /* allowEmpty */))) {\r\n // find adjacent v-if\r\n let j = i;\r\n let prev;\r\n while (j--) {\r\n prev = children[j];\r\n if (prev.type !== 3 /* COMMENT */) {\r\n break;\r\n }\r\n }\r\n if (prev && isTemplateNode(prev) && findDir(prev, 'if')) {\r\n // remove node\r\n children.splice(i, 1);\r\n i--;\r\n // attach this slot to previous conditional\r\n let conditional = dynamicSlots[dynamicSlots.length - 1];\r\n while (conditional.alternate.type === 19 /* JS_CONDITIONAL_EXPRESSION */) {\r\n conditional = conditional.alternate;\r\n }\r\n conditional.alternate = vElse.exp\r\n ? createConditionalExpression(vElse.exp, buildDynamicSlot(slotName, slotFunction), defaultFallback)\r\n : buildDynamicSlot(slotName, slotFunction);\r\n }\r\n else {\r\n context.onError(createCompilerError(30 /* X_V_ELSE_NO_ADJACENT_IF */, vElse.loc));\r\n }\r\n }\r\n else if ((vFor = findDir(slotElement, 'for'))) {\r\n hasDynamicSlots = true;\r\n const parseResult = vFor.parseResult ||\r\n parseForExpression(vFor.exp, context);\r\n if (parseResult) {\r\n // Render the dynamic slots as an array and add it to the createSlot()\r\n // args. The runtime knows how to handle it appropriately.\r\n dynamicSlots.push(createCallExpression(context.helper(RENDER_LIST), [\r\n parseResult.source,\r\n createFunctionExpression(createForLoopParams(parseResult), buildDynamicSlot(slotName, slotFunction), true /* force newline */)\r\n ]));\r\n }\r\n else {\r\n context.onError(createCompilerError(32 /* X_V_FOR_MALFORMED_EXPRESSION */, vFor.loc));\r\n }\r\n }\r\n else {\r\n // check duplicate static names\r\n if (staticSlotName) {\r\n if (seenSlotNames.has(staticSlotName)) {\r\n context.onError(createCompilerError(38 /* X_V_SLOT_DUPLICATE_SLOT_NAMES */, dirLoc));\r\n continue;\r\n }\r\n seenSlotNames.add(staticSlotName);\r\n if (staticSlotName === 'default') {\r\n hasNamedDefaultSlot = true;\r\n }\r\n }\r\n slotsProperties.push(createObjectProperty(slotName, slotFunction));\r\n }\r\n }\r\n if (!onComponentSlot) {\r\n const buildDefaultSlotProperty = (props, children) => {\r\n const fn = buildSlotFn(props, children, loc);\r\n if (context.compatConfig) {\r\n fn.isNonScopedSlot = true;\r\n }\r\n return createObjectProperty(`default`, fn);\r\n };\r\n if (!hasTemplateSlots) {\r\n // implicit default slot (on component)\r\n slotsProperties.push(buildDefaultSlotProperty(undefined, children));\r\n }\r\n else if (implicitDefaultChildren.length &&\r\n // #3766\r\n // with whitespace: 'preserve', whitespaces between slots will end up in\r\n // implicitDefaultChildren. Ignore if all implicit children are whitespaces.\r\n implicitDefaultChildren.some(node => isNonWhitespaceContent(node))) {\r\n // implicit default slot (mixed with named slots)\r\n if (hasNamedDefaultSlot) {\r\n context.onError(createCompilerError(39 /* X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN */, implicitDefaultChildren[0].loc));\r\n }\r\n else {\r\n slotsProperties.push(buildDefaultSlotProperty(undefined, implicitDefaultChildren));\r\n }\r\n }\r\n }\r\n const slotFlag = hasDynamicSlots\r\n ? 2 /* DYNAMIC */\r\n : hasForwardedSlots(node.children)\r\n ? 3 /* FORWARDED */\r\n : 1 /* STABLE */;\r\n let slots = createObjectExpression(slotsProperties.concat(createObjectProperty(`_`, \r\n // 2 = compiled but dynamic = can skip normalization, but must run diff\r\n // 1 = compiled and static = can skip normalization AND diff as optimized\r\n createSimpleExpression(slotFlag + (( false) ? 0 : ``), false))), loc);\r\n if (dynamicSlots.length) {\r\n slots = createCallExpression(context.helper(CREATE_SLOTS), [\r\n slots,\r\n createArrayExpression(dynamicSlots)\r\n ]);\r\n }\r\n return {\r\n slots,\r\n hasDynamicSlots\r\n };\r\n}\r\nfunction buildDynamicSlot(name, fn) {\r\n return createObjectExpression([\r\n createObjectProperty(`name`, name),\r\n createObjectProperty(`fn`, fn)\r\n ]);\r\n}\r\nfunction hasForwardedSlots(children) {\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n switch (child.type) {\r\n case 1 /* ELEMENT */:\r\n if (child.tagType === 2 /* SLOT */ ||\r\n hasForwardedSlots(child.children)) {\r\n return true;\r\n }\r\n break;\r\n case 9 /* IF */:\r\n if (hasForwardedSlots(child.branches))\r\n return true;\r\n break;\r\n case 10 /* IF_BRANCH */:\r\n case 11 /* FOR */:\r\n if (hasForwardedSlots(child.children))\r\n return true;\r\n break;\r\n }\r\n }\r\n return false;\r\n}\r\nfunction isNonWhitespaceContent(node) {\r\n if (node.type !== 2 /* TEXT */ && node.type !== 12 /* TEXT_CALL */)\r\n return true;\r\n return node.type === 2 /* TEXT */\r\n ? !!node.content.trim()\r\n : isNonWhitespaceContent(node.content);\r\n}\n\n// some directive transforms (e.g. v-model) may return a symbol for runtime\r\n// import, which should be used instead of a resolveDirective call.\r\nconst directiveImportMap = new WeakMap();\r\n// generate a JavaScript AST for this element's codegen\r\nconst transformElement = (node, context) => {\r\n // perform the work on exit, after all child expressions have been\r\n // processed and merged.\r\n return function postTransformElement() {\r\n node = context.currentNode;\r\n if (!(node.type === 1 /* ELEMENT */ &&\r\n (node.tagType === 0 /* ELEMENT */ ||\r\n node.tagType === 1 /* COMPONENT */))) {\r\n return;\r\n }\r\n const { tag, props } = node;\r\n const isComponent = node.tagType === 1 /* COMPONENT */;\r\n // The goal of the transform is to create a codegenNode implementing the\r\n // VNodeCall interface.\r\n let vnodeTag = isComponent\r\n ? resolveComponentType(node, context)\r\n : `\"${tag}\"`;\r\n const isDynamicComponent = shared_esm_bundler_isObject(vnodeTag) && vnodeTag.callee === RESOLVE_DYNAMIC_COMPONENT;\r\n let vnodeProps;\r\n let vnodeChildren;\r\n let vnodePatchFlag;\r\n let patchFlag = 0;\r\n let vnodeDynamicProps;\r\n let dynamicPropNames;\r\n let vnodeDirectives;\r\n let shouldUseBlock = \r\n // dynamic component may resolve to plain elements\r\n isDynamicComponent ||\r\n vnodeTag === TELEPORT ||\r\n vnodeTag === SUSPENSE ||\r\n (!isComponent &&\r\n // <svg> and <foreignObject> must be forced into blocks so that block\r\n // updates inside get proper isSVG flag at runtime. (#639, #643)\r\n // This is technically web-specific, but splitting the logic out of core\r\n // leads to too much unnecessary complexity.\r\n (tag === 'svg' ||\r\n tag === 'foreignObject' ||\r\n // #938: elements with dynamic keys should be forced into blocks\r\n findProp(node, 'key', true)));\r\n // props\r\n if (props.length > 0) {\r\n const propsBuildResult = buildProps(node, context);\r\n vnodeProps = propsBuildResult.props;\r\n patchFlag = propsBuildResult.patchFlag;\r\n dynamicPropNames = propsBuildResult.dynamicPropNames;\r\n const directives = propsBuildResult.directives;\r\n vnodeDirectives =\r\n directives && directives.length\r\n ? createArrayExpression(directives.map(dir => buildDirectiveArgs(dir, context)))\r\n : undefined;\r\n }\r\n // children\r\n if (node.children.length > 0) {\r\n if (vnodeTag === KEEP_ALIVE) {\r\n // Although a built-in component, we compile KeepAlive with raw children\r\n // instead of slot functions so that it can be used inside Transition\r\n // or other Transition-wrapping HOCs.\r\n // To ensure correct updates with block optimizations, we need to:\r\n // 1. Force keep-alive into a block. This avoids its children being\r\n // collected by a parent block.\r\n shouldUseBlock = true;\r\n // 2. Force keep-alive to always be updated, since it uses raw children.\r\n patchFlag |= 1024 /* DYNAMIC_SLOTS */;\r\n if (false) {}\r\n }\r\n const shouldBuildAsSlots = isComponent &&\r\n // Teleport is not a real component and has dedicated runtime handling\r\n vnodeTag !== TELEPORT &&\r\n // explained above.\r\n vnodeTag !== KEEP_ALIVE;\r\n if (shouldBuildAsSlots) {\r\n const { slots, hasDynamicSlots } = buildSlots(node, context);\r\n vnodeChildren = slots;\r\n if (hasDynamicSlots) {\r\n patchFlag |= 1024 /* DYNAMIC_SLOTS */;\r\n }\r\n }\r\n else if (node.children.length === 1 && vnodeTag !== TELEPORT) {\r\n const child = node.children[0];\r\n const type = child.type;\r\n // check for dynamic text children\r\n const hasDynamicTextChild = type === 5 /* INTERPOLATION */ ||\r\n type === 8 /* COMPOUND_EXPRESSION */;\r\n if (hasDynamicTextChild &&\r\n getConstantType(child, context) === 0 /* NOT_CONSTANT */) {\r\n patchFlag |= 1 /* TEXT */;\r\n }\r\n // pass directly if the only child is a text node\r\n // (plain / interpolation / expression)\r\n if (hasDynamicTextChild || type === 2 /* TEXT */) {\r\n vnodeChildren = child;\r\n }\r\n else {\r\n vnodeChildren = node.children;\r\n }\r\n }\r\n else {\r\n vnodeChildren = node.children;\r\n }\r\n }\r\n // patchFlag & dynamicPropNames\r\n if (patchFlag !== 0) {\r\n if ((false)) {}\r\n else {\r\n vnodePatchFlag = String(patchFlag);\r\n }\r\n if (dynamicPropNames && dynamicPropNames.length) {\r\n vnodeDynamicProps = stringifyDynamicPropNames(dynamicPropNames);\r\n }\r\n }\r\n node.codegenNode = createVNodeCall(context, vnodeTag, vnodeProps, vnodeChildren, vnodePatchFlag, vnodeDynamicProps, vnodeDirectives, !!shouldUseBlock, false /* disableTracking */, isComponent, node.loc);\r\n };\r\n};\r\nfunction resolveComponentType(node, context, ssr = false) {\r\n let { tag } = node;\r\n // 1. dynamic component\r\n const isExplicitDynamic = isComponentTag(tag);\r\n const isProp = findProp(node, 'is');\r\n if (isProp) {\r\n if (isExplicitDynamic ||\r\n (isCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context))) {\r\n const exp = isProp.type === 6 /* ATTRIBUTE */\r\n ? isProp.value && createSimpleExpression(isProp.value.content, true)\r\n : isProp.exp;\r\n if (exp) {\r\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\r\n exp\r\n ]);\r\n }\r\n }\r\n else if (isProp.type === 6 /* ATTRIBUTE */ &&\r\n isProp.value.content.startsWith('vue:')) {\r\n // <button is=\"vue:xxx\">\r\n // if not <component>, only is value that starts with \"vue:\" will be\r\n // treated as component by the parse phase and reach here, unless it's\r\n // compat mode where all is values are considered components\r\n tag = isProp.value.content.slice(4);\r\n }\r\n }\r\n // 1.5 v-is (TODO: Deprecate)\r\n const isDir = !isExplicitDynamic && findDir(node, 'is');\r\n if (isDir && isDir.exp) {\r\n return createCallExpression(context.helper(RESOLVE_DYNAMIC_COMPONENT), [\r\n isDir.exp\r\n ]);\r\n }\r\n // 2. built-in components (Teleport, Transition, KeepAlive, Suspense...)\r\n const builtIn = isCoreComponent(tag) || context.isBuiltInComponent(tag);\r\n if (builtIn) {\r\n // built-ins are simply fallthroughs / have special handling during ssr\r\n // so we don't need to import their runtime equivalents\r\n if (!ssr)\r\n context.helper(builtIn);\r\n return builtIn;\r\n }\r\n // 5. user component (resolve)\r\n context.helper(RESOLVE_COMPONENT);\r\n context.components.add(tag);\r\n return toValidAssetId(tag, `component`);\r\n}\r\nfunction buildProps(node, context, props = node.props, ssr = false) {\r\n const { tag, loc: elementLoc } = node;\r\n const isComponent = node.tagType === 1 /* COMPONENT */;\r\n let properties = [];\r\n const mergeArgs = [];\r\n const runtimeDirectives = [];\r\n // patchFlag analysis\r\n let patchFlag = 0;\r\n let hasRef = false;\r\n let hasClassBinding = false;\r\n let hasStyleBinding = false;\r\n let hasHydrationEventBinding = false;\r\n let hasDynamicKeys = false;\r\n let hasVnodeHook = false;\r\n const dynamicPropNames = [];\r\n const analyzePatchFlag = ({ key, value }) => {\r\n if (isStaticExp(key)) {\r\n const name = key.content;\r\n const isEventHandler = isOn(name);\r\n if (!isComponent &&\r\n isEventHandler &&\r\n // omit the flag for click handlers because hydration gives click\r\n // dedicated fast path.\r\n name.toLowerCase() !== 'onclick' &&\r\n // omit v-model handlers\r\n name !== 'onUpdate:modelValue' &&\r\n // omit onVnodeXXX hooks\r\n !isReservedProp(name)) {\r\n hasHydrationEventBinding = true;\r\n }\r\n if (isEventHandler && isReservedProp(name)) {\r\n hasVnodeHook = true;\r\n }\r\n if (value.type === 20 /* JS_CACHE_EXPRESSION */ ||\r\n ((value.type === 4 /* SIMPLE_EXPRESSION */ ||\r\n value.type === 8 /* COMPOUND_EXPRESSION */) &&\r\n getConstantType(value, context) > 0)) {\r\n // skip if the prop is a cached handler or has constant value\r\n return;\r\n }\r\n if (name === 'ref') {\r\n hasRef = true;\r\n }\r\n else if (name === 'class') {\r\n hasClassBinding = true;\r\n }\r\n else if (name === 'style') {\r\n hasStyleBinding = true;\r\n }\r\n else if (name !== 'key' && !dynamicPropNames.includes(name)) {\r\n dynamicPropNames.push(name);\r\n }\r\n // treat the dynamic class and style binding of the component as dynamic props\r\n if (isComponent &&\r\n (name === 'class' || name === 'style') &&\r\n !dynamicPropNames.includes(name)) {\r\n dynamicPropNames.push(name);\r\n }\r\n }\r\n else {\r\n hasDynamicKeys = true;\r\n }\r\n };\r\n for (let i = 0; i < props.length; i++) {\r\n // static attribute\r\n const prop = props[i];\r\n if (prop.type === 6 /* ATTRIBUTE */) {\r\n const { loc, name, value } = prop;\r\n let valueNode = createSimpleExpression(value ? value.content : '', true, value ? value.loc : loc);\r\n if (name === 'ref') {\r\n hasRef = true;\r\n }\r\n // skip is on <component>, or is=\"vue:xxx\"\r\n if (name === 'is' &&\r\n (isComponentTag(tag) ||\r\n (value && value.content.startsWith('vue:')) ||\r\n (isCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context)))) {\r\n continue;\r\n }\r\n properties.push(createObjectProperty(createSimpleExpression(name, true, getInnerRange(loc, 0, name.length)), valueNode));\r\n }\r\n else {\r\n // directives\r\n const { name, arg, exp, loc } = prop;\r\n const isVBind = name === 'bind';\r\n const isVOn = name === 'on';\r\n // skip v-slot - it is handled by its dedicated transform.\r\n if (name === 'slot') {\r\n if (!isComponent) {\r\n context.onError(createCompilerError(40 /* X_V_SLOT_MISPLACED */, loc));\r\n }\r\n continue;\r\n }\r\n // skip v-once/v-memo - they are handled by dedicated transforms.\r\n if (name === 'once' || name === 'memo') {\r\n continue;\r\n }\r\n // skip v-is and :is on <component>\r\n if (name === 'is' ||\r\n (isVBind &&\r\n isBindKey(arg, 'is') &&\r\n (isComponentTag(tag) ||\r\n (isCompatEnabled(\"COMPILER_IS_ON_ELEMENT\" /* COMPILER_IS_ON_ELEMENT */, context))))) {\r\n continue;\r\n }\r\n // skip v-on in SSR compilation\r\n if (isVOn && ssr) {\r\n continue;\r\n }\r\n // special case for v-bind and v-on with no argument\r\n if (!arg && (isVBind || isVOn)) {\r\n hasDynamicKeys = true;\r\n if (exp) {\r\n if (properties.length) {\r\n mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\r\n properties = [];\r\n }\r\n if (isVBind) {\r\n {\r\n // 2.x v-bind object order compat\r\n if ((false)) {}\r\n if (isCompatEnabled(\"COMPILER_V_BIND_OBJECT_ORDER\" /* COMPILER_V_BIND_OBJECT_ORDER */, context)) {\r\n mergeArgs.unshift(exp);\r\n continue;\r\n }\r\n }\r\n mergeArgs.push(exp);\r\n }\r\n else {\r\n // v-on=\"obj\" -> toHandlers(obj)\r\n mergeArgs.push({\r\n type: 14 /* JS_CALL_EXPRESSION */,\r\n loc,\r\n callee: context.helper(TO_HANDLERS),\r\n arguments: [exp]\r\n });\r\n }\r\n }\r\n else {\r\n context.onError(createCompilerError(isVBind\r\n ? 34 /* X_V_BIND_NO_EXPRESSION */\r\n : 35 /* X_V_ON_NO_EXPRESSION */, loc));\r\n }\r\n continue;\r\n }\r\n const directiveTransform = context.directiveTransforms[name];\r\n if (directiveTransform) {\r\n // has built-in directive transform.\r\n const { props, needRuntime } = directiveTransform(prop, node, context);\r\n !ssr && props.forEach(analyzePatchFlag);\r\n properties.push(...props);\r\n if (needRuntime) {\r\n runtimeDirectives.push(prop);\r\n if (isSymbol(needRuntime)) {\r\n directiveImportMap.set(prop, needRuntime);\r\n }\r\n }\r\n }\r\n else {\r\n // no built-in transform, this is a user custom directive.\r\n runtimeDirectives.push(prop);\r\n }\r\n }\r\n if (prop.type === 6 /* ATTRIBUTE */ &&\r\n prop.name === 'ref' &&\r\n context.scopes.vFor > 0 &&\r\n checkCompatEnabled(\"COMPILER_V_FOR_REF\" /* COMPILER_V_FOR_REF */, context, prop.loc)) {\r\n properties.push(createObjectProperty(createSimpleExpression('refInFor', true), createSimpleExpression('true', false)));\r\n }\r\n }\r\n let propsExpression = undefined;\r\n // has v-bind=\"object\" or v-on=\"object\", wrap with mergeProps\r\n if (mergeArgs.length) {\r\n if (properties.length) {\r\n mergeArgs.push(createObjectExpression(dedupeProperties(properties), elementLoc));\r\n }\r\n if (mergeArgs.length > 1) {\r\n propsExpression = createCallExpression(context.helper(MERGE_PROPS), mergeArgs, elementLoc);\r\n }\r\n else {\r\n // single v-bind with nothing else - no need for a mergeProps call\r\n propsExpression = mergeArgs[0];\r\n }\r\n }\r\n else if (properties.length) {\r\n propsExpression = createObjectExpression(dedupeProperties(properties), elementLoc);\r\n }\r\n // patchFlag analysis\r\n if (hasDynamicKeys) {\r\n patchFlag |= 16 /* FULL_PROPS */;\r\n }\r\n else {\r\n if (hasClassBinding && !isComponent) {\r\n patchFlag |= 2 /* CLASS */;\r\n }\r\n if (hasStyleBinding && !isComponent) {\r\n patchFlag |= 4 /* STYLE */;\r\n }\r\n if (dynamicPropNames.length) {\r\n patchFlag |= 8 /* PROPS */;\r\n }\r\n if (hasHydrationEventBinding) {\r\n patchFlag |= 32 /* HYDRATE_EVENTS */;\r\n }\r\n }\r\n if ((patchFlag === 0 || patchFlag === 32 /* HYDRATE_EVENTS */) &&\r\n (hasRef || hasVnodeHook || runtimeDirectives.length > 0)) {\r\n patchFlag |= 512 /* NEED_PATCH */;\r\n }\r\n // pre-normalize props, SSR is skipped for now\r\n if (!context.inSSR && propsExpression) {\r\n switch (propsExpression.type) {\r\n case 15 /* JS_OBJECT_EXPRESSION */:\r\n // means that there is no v-bind,\r\n // but still need to deal with dynamic key binding\r\n let classKeyIndex = -1;\r\n let styleKeyIndex = -1;\r\n let hasDynamicKey = false;\r\n for (let i = 0; i < propsExpression.properties.length; i++) {\r\n const key = propsExpression.properties[i].key;\r\n if (isStaticExp(key)) {\r\n if (key.content === 'class') {\r\n classKeyIndex = i;\r\n }\r\n else if (key.content === 'style') {\r\n styleKeyIndex = i;\r\n }\r\n }\r\n else if (!key.isHandlerKey) {\r\n hasDynamicKey = true;\r\n }\r\n }\r\n const classProp = propsExpression.properties[classKeyIndex];\r\n const styleProp = propsExpression.properties[styleKeyIndex];\r\n // no dynamic key\r\n if (!hasDynamicKey) {\r\n if (classProp && !isStaticExp(classProp.value)) {\r\n classProp.value = createCallExpression(context.helper(NORMALIZE_CLASS), [classProp.value]);\r\n }\r\n if (styleProp &&\r\n !isStaticExp(styleProp.value) &&\r\n // the static style is compiled into an object,\r\n // so use `hasStyleBinding` to ensure that it is a dynamic style binding\r\n (hasStyleBinding ||\r\n // v-bind:style and style both exist,\r\n // v-bind:style with static literal object\r\n styleProp.value.type === 17 /* JS_ARRAY_EXPRESSION */)) {\r\n styleProp.value = createCallExpression(context.helper(NORMALIZE_STYLE), [styleProp.value]);\r\n }\r\n }\r\n else {\r\n // dynamic key binding, wrap with `normalizeProps`\r\n propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [propsExpression]);\r\n }\r\n break;\r\n case 14 /* JS_CALL_EXPRESSION */:\r\n // mergeProps call, do nothing\r\n break;\r\n default:\r\n // single v-bind\r\n propsExpression = createCallExpression(context.helper(NORMALIZE_PROPS), [\r\n createCallExpression(context.helper(GUARD_REACTIVE_PROPS), [\r\n propsExpression\r\n ])\r\n ]);\r\n break;\r\n }\r\n }\r\n return {\r\n props: propsExpression,\r\n directives: runtimeDirectives,\r\n patchFlag,\r\n dynamicPropNames\r\n };\r\n}\r\n// Dedupe props in an object literal.\r\n// Literal duplicated attributes would have been warned during the parse phase,\r\n// however, it's possible to encounter duplicated `onXXX` handlers with different\r\n// modifiers. We also need to merge static and dynamic class / style attributes.\r\n// - onXXX handlers / style: merge into array\r\n// - class: merge into single expression with concatenation\r\nfunction dedupeProperties(properties) {\r\n const knownProps = new Map();\r\n const deduped = [];\r\n for (let i = 0; i < properties.length; i++) {\r\n const prop = properties[i];\r\n // dynamic keys are always allowed\r\n if (prop.key.type === 8 /* COMPOUND_EXPRESSION */ || !prop.key.isStatic) {\r\n deduped.push(prop);\r\n continue;\r\n }\r\n const name = prop.key.content;\r\n const existing = knownProps.get(name);\r\n if (existing) {\r\n if (name === 'style' || name === 'class' || isOn(name)) {\r\n compiler_core_esm_bundler_mergeAsArray(existing, prop);\r\n }\r\n // unexpected duplicate, should have emitted error during parse\r\n }\r\n else {\r\n knownProps.set(name, prop);\r\n deduped.push(prop);\r\n }\r\n }\r\n return deduped;\r\n}\r\nfunction compiler_core_esm_bundler_mergeAsArray(existing, incoming) {\r\n if (existing.value.type === 17 /* JS_ARRAY_EXPRESSION */) {\r\n existing.value.elements.push(incoming.value);\r\n }\r\n else {\r\n existing.value = createArrayExpression([existing.value, incoming.value], existing.loc);\r\n }\r\n}\r\nfunction buildDirectiveArgs(dir, context) {\r\n const dirArgs = [];\r\n const runtime = directiveImportMap.get(dir);\r\n if (runtime) {\r\n // built-in directive with runtime\r\n dirArgs.push(context.helperString(runtime));\r\n }\r\n else {\r\n {\r\n // inject statement for resolving directive\r\n context.helper(RESOLVE_DIRECTIVE);\r\n context.directives.add(dir.name);\r\n dirArgs.push(toValidAssetId(dir.name, `directive`));\r\n }\r\n }\r\n const { loc } = dir;\r\n if (dir.exp)\r\n dirArgs.push(dir.exp);\r\n if (dir.arg) {\r\n if (!dir.exp) {\r\n dirArgs.push(`void 0`);\r\n }\r\n dirArgs.push(dir.arg);\r\n }\r\n if (Object.keys(dir.modifiers).length) {\r\n if (!dir.arg) {\r\n if (!dir.exp) {\r\n dirArgs.push(`void 0`);\r\n }\r\n dirArgs.push(`void 0`);\r\n }\r\n const trueExpression = createSimpleExpression(`true`, false, loc);\r\n dirArgs.push(createObjectExpression(dir.modifiers.map(modifier => createObjectProperty(modifier, trueExpression)), loc));\r\n }\r\n return createArrayExpression(dirArgs, dir.loc);\r\n}\r\nfunction stringifyDynamicPropNames(props) {\r\n let propsNamesString = `[`;\r\n for (let i = 0, l = props.length; i < l; i++) {\r\n propsNamesString += JSON.stringify(props[i]);\r\n if (i < l - 1)\r\n propsNamesString += ', ';\r\n }\r\n return propsNamesString + `]`;\r\n}\r\nfunction isComponentTag(tag) {\r\n return tag === 'component' || tag === 'Component';\r\n}\n\n( false)\r\n ? 0\r\n : {};\r\n( false) ? 0 : [];\r\nconst compiler_core_esm_bundler_cacheStringFunction = (fn) => {\r\n const cache = Object.create(null);\r\n return ((str) => {\r\n const hit = cache[str];\r\n return hit || (cache[str] = fn(str));\r\n });\r\n};\r\nconst compiler_core_esm_bundler_camelizeRE = /-(\\w)/g;\r\n/**\r\n * @private\r\n */\r\nconst compiler_core_esm_bundler_camelize = compiler_core_esm_bundler_cacheStringFunction((str) => {\r\n return str.replace(compiler_core_esm_bundler_camelizeRE, (_, c) => (c ? c.toUpperCase() : ''));\r\n});\n\nconst transformSlotOutlet = (node, context) => {\r\n if (isSlotOutlet(node)) {\r\n const { children, loc } = node;\r\n const { slotName, slotProps } = processSlotOutlet(node, context);\r\n const slotArgs = [\r\n context.prefixIdentifiers ? `_ctx.$slots` : `$slots`,\r\n slotName,\r\n '{}',\r\n 'undefined',\r\n 'true'\r\n ];\r\n let expectedLen = 2;\r\n if (slotProps) {\r\n slotArgs[2] = slotProps;\r\n expectedLen = 3;\r\n }\r\n if (children.length) {\r\n slotArgs[3] = createFunctionExpression([], children, false, false, loc);\r\n expectedLen = 4;\r\n }\r\n if (context.scopeId && !context.slotted) {\r\n expectedLen = 5;\r\n }\r\n slotArgs.splice(expectedLen); // remove unused arguments\r\n node.codegenNode = createCallExpression(context.helper(RENDER_SLOT), slotArgs, loc);\r\n }\r\n};\r\nfunction processSlotOutlet(node, context) {\r\n let slotName = `\"default\"`;\r\n let slotProps = undefined;\r\n const nonNameProps = [];\r\n for (let i = 0; i < node.props.length; i++) {\r\n const p = node.props[i];\r\n if (p.type === 6 /* ATTRIBUTE */) {\r\n if (p.value) {\r\n if (p.name === 'name') {\r\n slotName = JSON.stringify(p.value.content);\r\n }\r\n else {\r\n p.name = compiler_core_esm_bundler_camelize(p.name);\r\n nonNameProps.push(p);\r\n }\r\n }\r\n }\r\n else {\r\n if (p.name === 'bind' && isBindKey(p.arg, 'name')) {\r\n if (p.exp)\r\n slotName = p.exp;\r\n }\r\n else {\r\n if (p.name === 'bind' && p.arg && isStaticExp(p.arg)) {\r\n p.arg.content = compiler_core_esm_bundler_camelize(p.arg.content);\r\n }\r\n nonNameProps.push(p);\r\n }\r\n }\r\n }\r\n if (nonNameProps.length > 0) {\r\n const { props, directives } = buildProps(node, context, nonNameProps);\r\n slotProps = props;\r\n if (directives.length) {\r\n context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));\r\n }\r\n }\r\n return {\r\n slotName,\r\n slotProps\r\n };\r\n}\n\nconst fnExpRE = /^\\s*([\\w$_]+|(async\\s*)?\\([^)]*?\\))\\s*=>|^\\s*(async\\s+)?function(?:\\s+[\\w$]+)?\\s*\\(/;\r\nconst transformOn = (dir, node, context, augmentor) => {\r\n const { loc, modifiers, arg } = dir;\r\n if (!dir.exp && !modifiers.length) {\r\n context.onError(createCompilerError(35 /* X_V_ON_NO_EXPRESSION */, loc));\r\n }\r\n let eventName;\r\n if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\r\n if (arg.isStatic) {\r\n const rawName = arg.content;\r\n // for all event listeners, auto convert it to camelCase. See issue #2249\r\n eventName = createSimpleExpression(toHandlerKey(camelize(rawName)), true, arg.loc);\r\n }\r\n else {\r\n // #2388\r\n eventName = createCompoundExpression([\r\n `${context.helperString(TO_HANDLER_KEY)}(`,\r\n arg,\r\n `)`\r\n ]);\r\n }\r\n }\r\n else {\r\n // already a compound expression.\r\n eventName = arg;\r\n eventName.children.unshift(`${context.helperString(TO_HANDLER_KEY)}(`);\r\n eventName.children.push(`)`);\r\n }\r\n // handler processing\r\n let exp = dir.exp;\r\n if (exp && !exp.content.trim()) {\r\n exp = undefined;\r\n }\r\n let shouldCache = context.cacheHandlers && !exp && !context.inVOnce;\r\n if (exp) {\r\n const isMemberExp = isMemberExpression(exp.content);\r\n const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content));\r\n const hasMultipleStatements = exp.content.includes(`;`);\r\n if (false) {}\r\n if (isInlineStatement || (shouldCache && isMemberExp)) {\r\n // wrap inline statement in a function expression\r\n exp = createCompoundExpression([\r\n `${isInlineStatement\r\n ? `$event`\r\n : `${``}(...args)`} => ${hasMultipleStatements ? `{` : `(`}`,\r\n exp,\r\n hasMultipleStatements ? `}` : `)`\r\n ]);\r\n }\r\n }\r\n let ret = {\r\n props: [\r\n createObjectProperty(eventName, exp || createSimpleExpression(`() => {}`, false, loc))\r\n ]\r\n };\r\n // apply extended compiler augmentor\r\n if (augmentor) {\r\n ret = augmentor(ret);\r\n }\r\n if (shouldCache) {\r\n // cache handlers so that it's always the same handler being passed down.\r\n // this avoids unnecessary re-renders when users use inline handlers on\r\n // components.\r\n ret.props[0].value = context.cache(ret.props[0].value);\r\n }\r\n // mark the key as handler for props normalization check\r\n ret.props.forEach(p => (p.key.isHandlerKey = true));\r\n return ret;\r\n};\n\n// v-bind without arg is handled directly in ./transformElements.ts due to it affecting\r\n// codegen for the entire props object. This transform here is only for v-bind\r\n// *with* args.\r\nconst transformBind = (dir, _node, context) => {\r\n const { exp, modifiers, loc } = dir;\r\n const arg = dir.arg;\r\n if (arg.type !== 4 /* SIMPLE_EXPRESSION */) {\r\n arg.children.unshift(`(`);\r\n arg.children.push(`) || \"\"`);\r\n }\r\n else if (!arg.isStatic) {\r\n arg.content = `${arg.content} || \"\"`;\r\n }\r\n // .sync is replaced by v-model:arg\r\n if (modifiers.includes('camel')) {\r\n if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\r\n if (arg.isStatic) {\r\n arg.content = camelize(arg.content);\r\n }\r\n else {\r\n arg.content = `${context.helperString(CAMELIZE)}(${arg.content})`;\r\n }\r\n }\r\n else {\r\n arg.children.unshift(`${context.helperString(CAMELIZE)}(`);\r\n arg.children.push(`)`);\r\n }\r\n }\r\n if (!context.inSSR) {\r\n if (modifiers.includes('prop')) {\r\n injectPrefix(arg, '.');\r\n }\r\n if (modifiers.includes('attr')) {\r\n injectPrefix(arg, '^');\r\n }\r\n }\r\n if (!exp ||\r\n (exp.type === 4 /* SIMPLE_EXPRESSION */ && !exp.content.trim())) {\r\n context.onError(createCompilerError(34 /* X_V_BIND_NO_EXPRESSION */, loc));\r\n return {\r\n props: [createObjectProperty(arg, createSimpleExpression('', true, loc))]\r\n };\r\n }\r\n return {\r\n props: [createObjectProperty(arg, exp)]\r\n };\r\n};\r\nconst injectPrefix = (arg, prefix) => {\r\n if (arg.type === 4 /* SIMPLE_EXPRESSION */) {\r\n if (arg.isStatic) {\r\n arg.content = prefix + arg.content;\r\n }\r\n else {\r\n arg.content = `\\`${prefix}\\${${arg.content}}\\``;\r\n }\r\n }\r\n else {\r\n arg.children.unshift(`'${prefix}' + (`);\r\n arg.children.push(`)`);\r\n }\r\n};\n\n// Merge adjacent text nodes and expressions into a single expression\r\n// e.g. <div>abc {{ d }} {{ e }}</div> should have a single expression node as child.\r\nconst transformText = (node, context) => {\r\n if (node.type === 0 /* ROOT */ ||\r\n node.type === 1 /* ELEMENT */ ||\r\n node.type === 11 /* FOR */ ||\r\n node.type === 10 /* IF_BRANCH */) {\r\n // perform the transform on node exit so that all expressions have already\r\n // been processed.\r\n return () => {\r\n const children = node.children;\r\n let currentContainer = undefined;\r\n let hasText = false;\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (isText(child)) {\r\n hasText = true;\r\n for (let j = i + 1; j < children.length; j++) {\r\n const next = children[j];\r\n if (isText(next)) {\r\n if (!currentContainer) {\r\n currentContainer = children[i] = {\r\n type: 8 /* COMPOUND_EXPRESSION */,\r\n loc: child.loc,\r\n children: [child]\r\n };\r\n }\r\n // merge adjacent text node into current\r\n currentContainer.children.push(` + `, next);\r\n children.splice(j, 1);\r\n j--;\r\n }\r\n else {\r\n currentContainer = undefined;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!hasText ||\r\n // if this is a plain element with a single text child, leave it\r\n // as-is since the runtime has dedicated fast path for this by directly\r\n // setting textContent of the element.\r\n // for component root it's always normalized anyway.\r\n (children.length === 1 &&\r\n (node.type === 0 /* ROOT */ ||\r\n (node.type === 1 /* ELEMENT */ &&\r\n node.tagType === 0 /* ELEMENT */ &&\r\n // #3756\r\n // custom directives can potentially add DOM elements arbitrarily,\r\n // we need to avoid setting textContent of the element at runtime\r\n // to avoid accidentally overwriting the DOM elements added\r\n // by the user through custom directives.\r\n !node.props.find(p => p.type === 7 /* DIRECTIVE */ &&\r\n !context.directiveTransforms[p.name]) &&\r\n // in compat mode, <template> tags with no special directives\r\n // will be rendered as a fragment so its children must be\r\n // converted into vnodes.\r\n !(node.tag === 'template'))))) {\r\n return;\r\n }\r\n // pre-convert text nodes into createTextVNode(text) calls to avoid\r\n // runtime normalization.\r\n for (let i = 0; i < children.length; i++) {\r\n const child = children[i];\r\n if (isText(child) || child.type === 8 /* COMPOUND_EXPRESSION */) {\r\n const callArgs = [];\r\n // createTextVNode defaults to single whitespace, so if it is a\r\n // single space the code could be an empty call to save bytes.\r\n if (child.type !== 2 /* TEXT */ || child.content !== ' ') {\r\n callArgs.push(child);\r\n }\r\n // mark dynamic text with flag so it gets patched inside a block\r\n if (!context.ssr &&\r\n getConstantType(child, context) === 0 /* NOT_CONSTANT */) {\r\n callArgs.push(1 /* TEXT */ +\r\n (( false) ? 0 : ``));\r\n }\r\n children[i] = {\r\n type: 12 /* TEXT_CALL */,\r\n content: child,\r\n loc: child.loc,\r\n codegenNode: createCallExpression(context.helper(CREATE_TEXT), callArgs)\r\n };\r\n }\r\n }\r\n };\r\n }\r\n};\n\nconst seen = new WeakSet();\r\nconst transformOnce = (node, context) => {\r\n if (node.type === 1 /* ELEMENT */ && findDir(node, 'once', true)) {\r\n if (seen.has(node) || context.inVOnce) {\r\n return;\r\n }\r\n seen.add(node);\r\n context.inVOnce = true;\r\n context.helper(SET_BLOCK_TRACKING);\r\n return () => {\r\n context.inVOnce = false;\r\n const cur = context.currentNode;\r\n if (cur.codegenNode) {\r\n cur.codegenNode = context.cache(cur.codegenNode, true /* isVNode */);\r\n }\r\n };\r\n }\r\n};\n\nconst transformModel = (dir, node, context) => {\r\n const { exp, arg } = dir;\r\n if (!exp) {\r\n context.onError(createCompilerError(41 /* X_V_MODEL_NO_EXPRESSION */, dir.loc));\r\n return createTransformProps();\r\n }\r\n const rawExp = exp.loc.source;\r\n const expString = exp.type === 4 /* SIMPLE_EXPRESSION */ ? exp.content : rawExp;\r\n // im SFC <script setup> inline mode, the exp may have been transformed into\r\n // _unref(exp)\r\n context.bindingMetadata[rawExp];\r\n const maybeRef = !true /* SETUP_CONST */;\r\n if (!expString.trim() ||\r\n (!isMemberExpression(expString) && !maybeRef)) {\r\n context.onError(createCompilerError(42 /* X_V_MODEL_MALFORMED_EXPRESSION */, exp.loc));\r\n return createTransformProps();\r\n }\r\n const propName = arg ? arg : createSimpleExpression('modelValue', true);\r\n const eventName = arg\r\n ? isStaticExp(arg)\r\n ? `onUpdate:${arg.content}`\r\n : createCompoundExpression(['\"onUpdate:\" + ', arg])\r\n : `onUpdate:modelValue`;\r\n let assignmentExp;\r\n const eventArg = context.isTS ? `($event: any)` : `$event`;\r\n {\r\n assignmentExp = createCompoundExpression([\r\n `${eventArg} => ((`,\r\n exp,\r\n `) = $event)`\r\n ]);\r\n }\r\n const props = [\r\n // modelValue: foo\r\n createObjectProperty(propName, dir.exp),\r\n // \"onUpdate:modelValue\": $event => (foo = $event)\r\n createObjectProperty(eventName, assignmentExp)\r\n ];\r\n // modelModifiers: { foo: true, \"bar-baz\": true }\r\n if (dir.modifiers.length && node.tagType === 1 /* COMPONENT */) {\r\n const modifiers = dir.modifiers\r\n .map(m => (isSimpleIdentifier(m) ? m : JSON.stringify(m)) + `: true`)\r\n .join(`, `);\r\n const modifiersKey = arg\r\n ? isStaticExp(arg)\r\n ? `${arg.content}Modifiers`\r\n : createCompoundExpression([arg, ' + \"Modifiers\"'])\r\n : `modelModifiers`;\r\n props.push(createObjectProperty(modifiersKey, createSimpleExpression(`{ ${modifiers} }`, false, dir.loc, 2 /* CAN_HOIST */)));\r\n }\r\n return createTransformProps(props);\r\n};\r\nfunction createTransformProps(props = []) {\r\n return { props };\r\n}\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/;\r\nconst transformFilter = (node, context) => {\r\n if (!isCompatEnabled(\"COMPILER_FILTER\" /* COMPILER_FILTERS */, context)) {\r\n return;\r\n }\r\n if (node.type === 5 /* INTERPOLATION */) {\r\n // filter rewrite is applied before expression transform so only\r\n // simple expressions are possible at this stage\r\n rewriteFilter(node.content, context);\r\n }\r\n if (node.type === 1 /* ELEMENT */) {\r\n node.props.forEach((prop) => {\r\n if (prop.type === 7 /* DIRECTIVE */ &&\r\n prop.name !== 'for' &&\r\n prop.exp) {\r\n rewriteFilter(prop.exp, context);\r\n }\r\n });\r\n }\r\n};\r\nfunction rewriteFilter(node, context) {\r\n if (node.type === 4 /* SIMPLE_EXPRESSION */) {\r\n parseFilter(node, context);\r\n }\r\n else {\r\n for (let i = 0; i < node.children.length; i++) {\r\n const child = node.children[i];\r\n if (typeof child !== 'object')\r\n continue;\r\n if (child.type === 4 /* SIMPLE_EXPRESSION */) {\r\n parseFilter(child, context);\r\n }\r\n else if (child.type === 8 /* COMPOUND_EXPRESSION */) {\r\n rewriteFilter(node, context);\r\n }\r\n else if (child.type === 5 /* INTERPOLATION */) {\r\n rewriteFilter(child.content, context);\r\n }\r\n }\r\n }\r\n}\r\nfunction parseFilter(node, context) {\r\n const exp = node.content;\r\n let inSingle = false;\r\n let inDouble = false;\r\n let inTemplateString = false;\r\n let inRegex = false;\r\n let curly = 0;\r\n let square = 0;\r\n let paren = 0;\r\n let lastFilterIndex = 0;\r\n let c, prev, i, expression, filters = [];\r\n for (i = 0; i < exp.length; i++) {\r\n prev = c;\r\n c = exp.charCodeAt(i);\r\n if (inSingle) {\r\n if (c === 0x27 && prev !== 0x5c)\r\n inSingle = false;\r\n }\r\n else if (inDouble) {\r\n if (c === 0x22 && prev !== 0x5c)\r\n inDouble = false;\r\n }\r\n else if (inTemplateString) {\r\n if (c === 0x60 && prev !== 0x5c)\r\n inTemplateString = false;\r\n }\r\n else if (inRegex) {\r\n if (c === 0x2f && prev !== 0x5c)\r\n inRegex = false;\r\n }\r\n else if (c === 0x7c && // pipe\r\n exp.charCodeAt(i + 1) !== 0x7c &&\r\n exp.charCodeAt(i - 1) !== 0x7c &&\r\n !curly &&\r\n !square &&\r\n !paren) {\r\n if (expression === undefined) {\r\n // first filter, end of expression\r\n lastFilterIndex = i + 1;\r\n expression = exp.slice(0, i).trim();\r\n }\r\n else {\r\n pushFilter();\r\n }\r\n }\r\n else {\r\n switch (c) {\r\n case 0x22:\r\n inDouble = true;\r\n break; // \"\r\n case 0x27:\r\n inSingle = true;\r\n break; // '\r\n case 0x60:\r\n inTemplateString = true;\r\n break; // `\r\n case 0x28:\r\n paren++;\r\n break; // (\r\n case 0x29:\r\n paren--;\r\n break; // )\r\n case 0x5b:\r\n square++;\r\n break; // [\r\n case 0x5d:\r\n square--;\r\n break; // ]\r\n case 0x7b:\r\n curly++;\r\n break; // {\r\n case 0x7d:\r\n curly--;\r\n break; // }\r\n }\r\n if (c === 0x2f) {\r\n // /\r\n let j = i - 1;\r\n let p;\r\n // find first non-whitespace prev char\r\n for (; j >= 0; j--) {\r\n p = exp.charAt(j);\r\n if (p !== ' ')\r\n break;\r\n }\r\n if (!p || !validDivisionCharRE.test(p)) {\r\n inRegex = true;\r\n }\r\n }\r\n }\r\n }\r\n if (expression === undefined) {\r\n expression = exp.slice(0, i).trim();\r\n }\r\n else if (lastFilterIndex !== 0) {\r\n pushFilter();\r\n }\r\n function pushFilter() {\r\n filters.push(exp.slice(lastFilterIndex, i).trim());\r\n lastFilterIndex = i + 1;\r\n }\r\n if (filters.length) {\r\n ( false) &&\r\n 0;\r\n for (i = 0; i < filters.length; i++) {\r\n expression = wrapFilter(expression, filters[i], context);\r\n }\r\n node.content = expression;\r\n }\r\n}\r\nfunction wrapFilter(exp, filter, context) {\r\n context.helper(RESOLVE_FILTER);\r\n const i = filter.indexOf('(');\r\n if (i < 0) {\r\n context.filters.add(filter);\r\n return `${toValidAssetId(filter, 'filter')}(${exp})`;\r\n }\r\n else {\r\n const name = filter.slice(0, i);\r\n const args = filter.slice(i + 1);\r\n context.filters.add(name);\r\n return `${toValidAssetId(name, 'filter')}(${exp}${args !== ')' ? ',' + args : args}`;\r\n }\r\n}\n\nconst seen$1 = new WeakSet();\r\nconst transformMemo = (node, context) => {\r\n if (node.type === 1 /* ELEMENT */) {\r\n const dir = findDir(node, 'memo');\r\n if (!dir || seen$1.has(node)) {\r\n return;\r\n }\r\n seen$1.add(node);\r\n return () => {\r\n const codegenNode = node.codegenNode ||\r\n context.currentNode.codegenNode;\r\n if (codegenNode && codegenNode.type === 13 /* VNODE_CALL */) {\r\n // non-component sub tree should be turned into a block\r\n if (node.tagType !== 1 /* COMPONENT */) {\r\n makeBlock(codegenNode, context);\r\n }\r\n node.codegenNode = createCallExpression(context.helper(WITH_MEMO), [\r\n dir.exp,\r\n createFunctionExpression(undefined, codegenNode),\r\n `_cache`,\r\n String(context.cached++)\r\n ]);\r\n }\r\n };\r\n }\r\n};\n\nfunction getBaseTransformPreset(prefixIdentifiers) {\r\n return [\r\n [\r\n transformOnce,\r\n transformIf,\r\n transformMemo,\r\n transformFor,\r\n ...([transformFilter] ),\r\n ...(( false)\r\n ? 0\r\n : []),\r\n transformSlotOutlet,\r\n transformElement,\r\n trackSlotScopes,\r\n transformText\r\n ],\r\n {\r\n on: transformOn,\r\n bind: transformBind,\r\n model: transformModel\r\n }\r\n ];\r\n}\r\n// we name it `baseCompile` so that higher order compilers like\r\n// @vue/compiler-dom can export `compile` while re-exporting everything else.\r\nfunction baseCompile(template, options = {}) {\r\n const onError = options.onError || defaultOnError;\r\n const isModuleMode = options.mode === 'module';\r\n /* istanbul ignore if */\r\n {\r\n if (options.prefixIdentifiers === true) {\r\n onError(createCompilerError(46 /* X_PREFIX_ID_NOT_SUPPORTED */));\r\n }\r\n else if (isModuleMode) {\r\n onError(createCompilerError(47 /* X_MODULE_MODE_NOT_SUPPORTED */));\r\n }\r\n }\r\n const prefixIdentifiers = !true ;\r\n if (options.cacheHandlers) {\r\n onError(createCompilerError(48 /* X_CACHE_HANDLER_NOT_SUPPORTED */));\r\n }\r\n if (options.scopeId && !isModuleMode) {\r\n onError(createCompilerError(49 /* X_SCOPE_ID_NOT_SUPPORTED */));\r\n }\r\n const ast = shared_esm_bundler_isString(template) ? compiler_core_esm_bundler_baseParse(template, options) : template;\r\n const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();\r\n transform(ast, shared_esm_bundler_extend({}, options, {\r\n prefixIdentifiers,\r\n nodeTransforms: [\r\n ...nodeTransforms,\r\n ...(options.nodeTransforms || []) // user transforms\r\n ],\r\n directiveTransforms: shared_esm_bundler_extend({}, directiveTransforms, options.directiveTransforms || {} // user transforms\r\n )\r\n }));\r\n return generate(ast, shared_esm_bundler_extend({}, options, {\r\n prefixIdentifiers\r\n }));\r\n}\n\nconst noopDirectiveTransform = () => ({ props: [] });\n\n\n\n;// CONCATENATED MODULE: ./node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js\n\n\n\n\nconst V_MODEL_RADIO = Symbol(( false) ? 0 : ``);\r\nconst V_MODEL_CHECKBOX = Symbol(( false) ? 0 : ``);\r\nconst V_MODEL_TEXT = Symbol(( false) ? 0 : ``);\r\nconst V_MODEL_SELECT = Symbol(( false) ? 0 : ``);\r\nconst V_MODEL_DYNAMIC = Symbol(( false) ? 0 : ``);\r\nconst V_ON_WITH_MODIFIERS = Symbol(( false) ? 0 : ``);\r\nconst V_ON_WITH_KEYS = Symbol(( false) ? 0 : ``);\r\nconst V_SHOW = Symbol(( false) ? 0 : ``);\r\nconst compiler_dom_esm_bundler_TRANSITION = Symbol(( false) ? 0 : ``);\r\nconst TRANSITION_GROUP = Symbol(( false) ? 0 : ``);\r\nregisterRuntimeHelpers({\r\n [V_MODEL_RADIO]: `vModelRadio`,\r\n [V_MODEL_CHECKBOX]: `vModelCheckbox`,\r\n [V_MODEL_TEXT]: `vModelText`,\r\n [V_MODEL_SELECT]: `vModelSelect`,\r\n [V_MODEL_DYNAMIC]: `vModelDynamic`,\r\n [V_ON_WITH_MODIFIERS]: `withModifiers`,\r\n [V_ON_WITH_KEYS]: `withKeys`,\r\n [V_SHOW]: `vShow`,\r\n [compiler_dom_esm_bundler_TRANSITION]: `Transition`,\r\n [TRANSITION_GROUP]: `TransitionGroup`\r\n});\n\n/* eslint-disable no-restricted-globals */\r\nlet decoder;\r\nfunction decodeHtmlBrowser(raw, asAttr = false) {\r\n if (!decoder) {\r\n decoder = document.createElement('div');\r\n }\r\n if (asAttr) {\r\n decoder.innerHTML = `<div foo=\"${raw.replace(/\"/g, '"')}\">`;\r\n return decoder.children[0].getAttribute('foo');\r\n }\r\n else {\r\n decoder.innerHTML = raw;\r\n return decoder.textContent;\r\n }\r\n}\n\nconst isRawTextContainer = /*#__PURE__*/ shared_esm_bundler_makeMap('style,iframe,script,noscript', true);\r\nconst parserOptions = {\r\n isVoidTag: isVoidTag,\r\n isNativeTag: tag => shared_esm_bundler_isHTMLTag(tag) || shared_esm_bundler_isSVGTag(tag),\r\n isPreTag: tag => tag === 'pre',\r\n decodeEntities: decodeHtmlBrowser ,\r\n isBuiltInComponent: (tag) => {\r\n if (isBuiltInType(tag, `Transition`)) {\r\n return compiler_dom_esm_bundler_TRANSITION;\r\n }\r\n else if (isBuiltInType(tag, `TransitionGroup`)) {\r\n return TRANSITION_GROUP;\r\n }\r\n },\r\n // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher\r\n getNamespace(tag, parent) {\r\n let ns = parent ? parent.ns : 0 /* HTML */;\r\n if (parent && ns === 2 /* MATH_ML */) {\r\n if (parent.tag === 'annotation-xml') {\r\n if (tag === 'svg') {\r\n return 1 /* SVG */;\r\n }\r\n if (parent.props.some(a => a.type === 6 /* ATTRIBUTE */ &&\r\n a.name === 'encoding' &&\r\n a.value != null &&\r\n (a.value.content === 'text/html' ||\r\n a.value.content === 'application/xhtml+xml'))) {\r\n ns = 0 /* HTML */;\r\n }\r\n }\r\n else if (/^m(?:[ions]|text)$/.test(parent.tag) &&\r\n tag !== 'mglyph' &&\r\n tag !== 'malignmark') {\r\n ns = 0 /* HTML */;\r\n }\r\n }\r\n else if (parent && ns === 1 /* SVG */) {\r\n if (parent.tag === 'foreignObject' ||\r\n parent.tag === 'desc' ||\r\n parent.tag === 'title') {\r\n ns = 0 /* HTML */;\r\n }\r\n }\r\n if (ns === 0 /* HTML */) {\r\n if (tag === 'svg') {\r\n return 1 /* SVG */;\r\n }\r\n if (tag === 'math') {\r\n return 2 /* MATH_ML */;\r\n }\r\n }\r\n return ns;\r\n },\r\n // https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments\r\n getTextMode({ tag, ns }) {\r\n if (ns === 0 /* HTML */) {\r\n if (tag === 'textarea' || tag === 'title') {\r\n return 1 /* RCDATA */;\r\n }\r\n if (isRawTextContainer(tag)) {\r\n return 2 /* RAWTEXT */;\r\n }\r\n }\r\n return 0 /* DATA */;\r\n }\r\n};\n\n// Parse inline CSS strings for static style attributes into an object.\r\n// This is a NodeTransform since it works on the static `style` attribute and\r\n// converts it into a dynamic equivalent:\r\n// style=\"color: red\" -> :style='{ \"color\": \"red\" }'\r\n// It is then processed by `transformElement` and included in the generated\r\n// props.\r\nconst transformStyle = node => {\r\n if (node.type === 1 /* ELEMENT */) {\r\n node.props.forEach((p, i) => {\r\n if (p.type === 6 /* ATTRIBUTE */ && p.name === 'style' && p.value) {\r\n // replace p with an expression node\r\n node.props[i] = {\r\n type: 7 /* DIRECTIVE */,\r\n name: `bind`,\r\n arg: createSimpleExpression(`style`, true, p.loc),\r\n exp: parseInlineCSS(p.value.content, p.loc),\r\n modifiers: [],\r\n loc: p.loc\r\n };\r\n }\r\n });\r\n }\r\n};\r\nconst parseInlineCSS = (cssText, loc) => {\r\n const normalized = parseStringStyle(cssText);\r\n return createSimpleExpression(JSON.stringify(normalized), false, loc, 3 /* CAN_STRINGIFY */);\r\n};\n\nfunction createDOMCompilerError(code, loc) {\r\n return createCompilerError(code, loc, false ? 0 : undefined);\r\n}\r\nconst DOMErrorMessages = {\r\n [50 /* X_V_HTML_NO_EXPRESSION */]: `v-html is missing expression.`,\r\n [51 /* X_V_HTML_WITH_CHILDREN */]: `v-html will override element children.`,\r\n [52 /* X_V_TEXT_NO_EXPRESSION */]: `v-text is missing expression.`,\r\n [53 /* X_V_TEXT_WITH_CHILDREN */]: `v-text will override element children.`,\r\n [54 /* X_V_MODEL_ON_INVALID_ELEMENT */]: `v-model can only be used on <input>, <textarea> and <select> elements.`,\r\n [55 /* X_V_MODEL_ARG_ON_ELEMENT */]: `v-model argument is not supported on plain elements.`,\r\n [56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,\r\n [57 /* X_V_MODEL_UNNECESSARY_VALUE */]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,\r\n [58 /* X_V_SHOW_NO_EXPRESSION */]: `v-show is missing expression.`,\r\n [59 /* X_TRANSITION_INVALID_CHILDREN */]: `<Transition> expects exactly one child element or component.`,\r\n [60 /* X_IGNORED_SIDE_EFFECT_TAG */]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`\r\n};\n\nconst transformVHtml = (dir, node, context) => {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(50 /* X_V_HTML_NO_EXPRESSION */, loc));\r\n }\r\n if (node.children.length) {\r\n context.onError(createDOMCompilerError(51 /* X_V_HTML_WITH_CHILDREN */, loc));\r\n node.children.length = 0;\r\n }\r\n return {\r\n props: [\r\n createObjectProperty(createSimpleExpression(`innerHTML`, true, loc), exp || createSimpleExpression('', true))\r\n ]\r\n };\r\n};\n\nconst transformVText = (dir, node, context) => {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(52 /* X_V_TEXT_NO_EXPRESSION */, loc));\r\n }\r\n if (node.children.length) {\r\n context.onError(createDOMCompilerError(53 /* X_V_TEXT_WITH_CHILDREN */, loc));\r\n node.children.length = 0;\r\n }\r\n return {\r\n props: [\r\n createObjectProperty(createSimpleExpression(`textContent`, true), exp\r\n ? createCallExpression(context.helperString(TO_DISPLAY_STRING), [exp], loc)\r\n : createSimpleExpression('', true))\r\n ]\r\n };\r\n};\n\nconst compiler_dom_esm_bundler_transformModel = (dir, node, context) => {\r\n const baseResult = transformModel(dir, node, context);\r\n // base transform has errors OR component v-model (only need props)\r\n if (!baseResult.props.length || node.tagType === 1 /* COMPONENT */) {\r\n return baseResult;\r\n }\r\n if (dir.arg) {\r\n context.onError(createDOMCompilerError(55 /* X_V_MODEL_ARG_ON_ELEMENT */, dir.arg.loc));\r\n }\r\n function checkDuplicatedValue() {\r\n const value = findProp(node, 'value');\r\n if (value) {\r\n context.onError(createDOMCompilerError(57 /* X_V_MODEL_UNNECESSARY_VALUE */, value.loc));\r\n }\r\n }\r\n const { tag } = node;\r\n const isCustomElement = context.isCustomElement(tag);\r\n if (tag === 'input' ||\r\n tag === 'textarea' ||\r\n tag === 'select' ||\r\n isCustomElement) {\r\n let directiveToUse = V_MODEL_TEXT;\r\n let isInvalidType = false;\r\n if (tag === 'input' || isCustomElement) {\r\n const type = findProp(node, `type`);\r\n if (type) {\r\n if (type.type === 7 /* DIRECTIVE */) {\r\n // :type=\"foo\"\r\n directiveToUse = V_MODEL_DYNAMIC;\r\n }\r\n else if (type.value) {\r\n switch (type.value.content) {\r\n case 'radio':\r\n directiveToUse = V_MODEL_RADIO;\r\n break;\r\n case 'checkbox':\r\n directiveToUse = V_MODEL_CHECKBOX;\r\n break;\r\n case 'file':\r\n isInvalidType = true;\r\n context.onError(createDOMCompilerError(56 /* X_V_MODEL_ON_FILE_INPUT_ELEMENT */, dir.loc));\r\n break;\r\n default:\r\n // text type\r\n ( false) && 0;\r\n break;\r\n }\r\n }\r\n }\r\n else if (hasDynamicKeyVBind(node)) {\r\n // element has bindings with dynamic keys, which can possibly contain\r\n // \"type\".\r\n directiveToUse = V_MODEL_DYNAMIC;\r\n }\r\n else {\r\n // text type\r\n ( false) && 0;\r\n }\r\n }\r\n else if (tag === 'select') {\r\n directiveToUse = V_MODEL_SELECT;\r\n }\r\n else {\r\n // textarea\r\n ( false) && 0;\r\n }\r\n // inject runtime directive\r\n // by returning the helper symbol via needRuntime\r\n // the import will replaced a resolveDirective call.\r\n if (!isInvalidType) {\r\n baseResult.needRuntime = context.helper(directiveToUse);\r\n }\r\n }\r\n else {\r\n context.onError(createDOMCompilerError(54 /* X_V_MODEL_ON_INVALID_ELEMENT */, dir.loc));\r\n }\r\n // native vmodel doesn't need the `modelValue` props since they are also\r\n // passed to the runtime as `binding.value`. removing it reduces code size.\r\n baseResult.props = baseResult.props.filter(p => !(p.key.type === 4 /* SIMPLE_EXPRESSION */ &&\r\n p.key.content === 'modelValue'));\r\n return baseResult;\r\n};\n\nconst isEventOptionModifier = /*#__PURE__*/ shared_esm_bundler_makeMap(`passive,once,capture`);\r\nconst isNonKeyModifier = /*#__PURE__*/ shared_esm_bundler_makeMap(\r\n// event propagation management\r\n`stop,prevent,self,` +\r\n // system modifiers + exact\r\n `ctrl,shift,alt,meta,exact,` +\r\n // mouse\r\n `middle`);\r\n// left & right could be mouse or key modifiers based on event type\r\nconst maybeKeyModifier = /*#__PURE__*/ shared_esm_bundler_makeMap('left,right');\r\nconst isKeyboardEvent = /*#__PURE__*/ shared_esm_bundler_makeMap(`onkeyup,onkeydown,onkeypress`, true);\r\nconst resolveModifiers = (key, modifiers, context, loc) => {\r\n const keyModifiers = [];\r\n const nonKeyModifiers = [];\r\n const eventOptionModifiers = [];\r\n for (let i = 0; i < modifiers.length; i++) {\r\n const modifier = modifiers[i];\r\n if (modifier === 'native' &&\r\n checkCompatEnabled(\"COMPILER_V_ON_NATIVE\" /* COMPILER_V_ON_NATIVE */, context, loc)) {\r\n eventOptionModifiers.push(modifier);\r\n }\r\n else if (isEventOptionModifier(modifier)) {\r\n // eventOptionModifiers: modifiers for addEventListener() options,\r\n // e.g. .passive & .capture\r\n eventOptionModifiers.push(modifier);\r\n }\r\n else {\r\n // runtimeModifiers: modifiers that needs runtime guards\r\n if (maybeKeyModifier(modifier)) {\r\n if (isStaticExp(key)) {\r\n if (isKeyboardEvent(key.content)) {\r\n keyModifiers.push(modifier);\r\n }\r\n else {\r\n nonKeyModifiers.push(modifier);\r\n }\r\n }\r\n else {\r\n keyModifiers.push(modifier);\r\n nonKeyModifiers.push(modifier);\r\n }\r\n }\r\n else {\r\n if (isNonKeyModifier(modifier)) {\r\n nonKeyModifiers.push(modifier);\r\n }\r\n else {\r\n keyModifiers.push(modifier);\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n keyModifiers,\r\n nonKeyModifiers,\r\n eventOptionModifiers\r\n };\r\n};\r\nconst transformClick = (key, event) => {\r\n const isStaticClick = isStaticExp(key) && key.content.toLowerCase() === 'onclick';\r\n return isStaticClick\r\n ? createSimpleExpression(event, true)\r\n : key.type !== 4 /* SIMPLE_EXPRESSION */\r\n ? createCompoundExpression([\r\n `(`,\r\n key,\r\n `) === \"onClick\" ? \"${event}\" : (`,\r\n key,\r\n `)`\r\n ])\r\n : key;\r\n};\r\nconst compiler_dom_esm_bundler_transformOn = (dir, node, context) => {\r\n return transformOn(dir, node, context, baseResult => {\r\n const { modifiers } = dir;\r\n if (!modifiers.length)\r\n return baseResult;\r\n let { key, value: handlerExp } = baseResult.props[0];\r\n const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);\r\n // normalize click.right and click.middle since they don't actually fire\r\n if (nonKeyModifiers.includes('right')) {\r\n key = transformClick(key, `onContextmenu`);\r\n }\r\n if (nonKeyModifiers.includes('middle')) {\r\n key = transformClick(key, `onMouseup`);\r\n }\r\n if (nonKeyModifiers.length) {\r\n handlerExp = createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [\r\n handlerExp,\r\n JSON.stringify(nonKeyModifiers)\r\n ]);\r\n }\r\n if (keyModifiers.length &&\r\n // if event name is dynamic, always wrap with keys guard\r\n (!isStaticExp(key) || isKeyboardEvent(key.content))) {\r\n handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [\r\n handlerExp,\r\n JSON.stringify(keyModifiers)\r\n ]);\r\n }\r\n if (eventOptionModifiers.length) {\r\n const modifierPostfix = eventOptionModifiers.map(shared_esm_bundler_capitalize).join('');\r\n key = isStaticExp(key)\r\n ? createSimpleExpression(`${key.content}${modifierPostfix}`, true)\r\n : createCompoundExpression([`(`, key, `) + \"${modifierPostfix}\"`]);\r\n }\r\n return {\r\n props: [createObjectProperty(key, handlerExp)]\r\n };\r\n });\r\n};\n\nconst transformShow = (dir, node, context) => {\r\n const { exp, loc } = dir;\r\n if (!exp) {\r\n context.onError(createDOMCompilerError(58 /* X_V_SHOW_NO_EXPRESSION */, loc));\r\n }\r\n return {\r\n props: [],\r\n needRuntime: context.helper(V_SHOW)\r\n };\r\n};\n\nconst warnTransitionChildren = (node, context) => {\r\n if (node.type === 1 /* ELEMENT */ &&\r\n node.tagType === 1 /* COMPONENT */) {\r\n const component = context.isBuiltInComponent(node.tag);\r\n if (component === compiler_dom_esm_bundler_TRANSITION) {\r\n return () => {\r\n if (node.children.length && hasMultipleChildren(node)) {\r\n context.onError(createDOMCompilerError(59 /* X_TRANSITION_INVALID_CHILDREN */, {\r\n start: node.children[0].loc.start,\r\n end: node.children[node.children.length - 1].loc.end,\r\n source: ''\r\n }));\r\n }\r\n };\r\n }\r\n }\r\n};\r\nfunction hasMultipleChildren(node) {\r\n // #1352 filter out potential comment nodes.\r\n const children = (node.children = node.children.filter(c => c.type !== 3 /* COMMENT */ &&\r\n !(c.type === 2 /* TEXT */ && !c.content.trim())));\r\n const child = children[0];\r\n return (children.length !== 1 ||\r\n child.type === 11 /* FOR */ ||\r\n (child.type === 9 /* IF */ && child.branches.some(hasMultipleChildren)));\r\n}\n\nconst ignoreSideEffectTags = (node, context) => {\r\n if (node.type === 1 /* ELEMENT */ &&\r\n node.tagType === 0 /* ELEMENT */ &&\r\n (node.tag === 'script' || node.tag === 'style')) {\r\n context.onError(createDOMCompilerError(60 /* X_IGNORED_SIDE_EFFECT_TAG */, node.loc));\r\n context.removeNode();\r\n }\r\n};\n\nconst DOMNodeTransforms = [\r\n transformStyle,\r\n ...(( false) ? 0 : [])\r\n];\r\nconst DOMDirectiveTransforms = {\r\n cloak: noopDirectiveTransform,\r\n html: transformVHtml,\r\n text: transformVText,\r\n model: compiler_dom_esm_bundler_transformModel,\r\n on: compiler_dom_esm_bundler_transformOn,\r\n show: transformShow\r\n};\r\nfunction compiler_dom_esm_bundler_compile(template, options = {}) {\r\n return baseCompile(template, shared_esm_bundler_extend({}, parserOptions, options, {\r\n nodeTransforms: [\r\n // ignore <script> and <tag>\r\n // this is not put inside DOMNodeTransforms because that list is used\r\n // by compiler-ssr to generate vnode fallback branches\r\n ignoreSideEffectTags,\r\n ...DOMNodeTransforms,\r\n ...(options.nodeTransforms || [])\r\n ],\r\n directiveTransforms: shared_esm_bundler_extend({}, DOMDirectiveTransforms, options.directiveTransforms || {}),\r\n transformHoist: null \r\n }));\r\n}\r\nfunction parse(template, options = {}) {\r\n return baseParse(template, extend({}, parserOptions, options));\r\n}\n\n\n\n;// CONCATENATED MODULE: ./node_modules/vue/dist/vue.esm-bundler.js\n\n\n\n\n\n\nfunction initDev() {\r\n {\r\n initCustomFormatter();\r\n }\r\n}\n\n// This entry is the \"full-build\" that includes both the runtime\r\nif ((false)) {}\r\nconst compileCache = Object.create(null);\r\nfunction compileToFunction(template, options) {\r\n if (!shared_esm_bundler_isString(template)) {\r\n if (template.nodeType) {\r\n template = template.innerHTML;\r\n }\r\n else {\r\n ( false) && 0;\r\n return shared_esm_bundler_NOOP;\r\n }\r\n }\r\n const key = template;\r\n const cached = compileCache[key];\r\n if (cached) {\r\n return cached;\r\n }\r\n if (template[0] === '#') {\r\n const el = document.querySelector(template);\r\n if (false) {}\r\n // __UNSAFE__\r\n // Reason: potential execution of JS expressions in in-DOM template.\r\n // The user must make sure the in-DOM template is trusted. If it's rendered\r\n // by the server, the template should not contain any user data.\r\n template = el ? el.innerHTML : ``;\r\n }\r\n const { code } = compiler_dom_esm_bundler_compile(template, shared_esm_bundler_extend({\r\n hoistStatic: true,\r\n onError: ( false) ? 0 : undefined,\r\n onWarn: ( false) ? 0 : shared_esm_bundler_NOOP\r\n }, options));\r\n function onError(err, asWarning = false) {\r\n const message = asWarning\r\n ? err.message\r\n : `Template compilation error: ${err.message}`;\r\n const codeFrame = err.loc &&\r\n generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);\r\n runtime_core_esm_bundler_warn(codeFrame ? `${message}\\n${codeFrame}` : message);\r\n }\r\n // The wildcard import results in a huge object with every export\r\n // with keys that cannot be mangled, and can be quite heavy size-wise.\r\n // In the global build we know `Vue` is available globally so we can avoid\r\n // the wildcard object.\r\n const render = (new Function('Vue', code)(runtime_dom_esm_bundler_namespaceObject));\r\n render._rc = true;\r\n return (compileCache[key] = render);\r\n}\r\nregisterRuntimeCompiler(compileToFunction);\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE2Ni5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUywwQkFBTztBQUNoQjtBQUNBO0FBQ0Esb0JBQW9CLGlCQUFpQjtBQUNyQztBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQ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GV0IGNvdW50ID0gMDtcclxuICAgIGNvbnN0IHJlcyA9IFtdO1xyXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5lcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIGNvdW50ICs9XHJcbiAgICAgICAgICAgIGxpbmVzW2ldLmxlbmd0aCArXHJcbiAgICAgICAgICAgICAgICAoKG5ld2xpbmVTZXF1ZW5jZXNbaV0gJiYgbmV3bGluZVNlcXVlbmNlc1tpXS5sZW5ndGgpIHx8IDApO1xyXG4gICAgICAgIGlmIChjb3VudCA+PSBzdGFydCkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gaSAtIHJhbmdlOyBqIDw9IGkgKyByYW5nZSB8fCBlbmQgPiBjb3VudDsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaiA8IDAgfHwgaiA+PSBsaW5lcy5sZW5ndGgpXHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBsaW5lID0gaiArIDE7XHJcbiAgICAgICAgICAgICAgICByZXMucHVzaChgJHtsaW5lfSR7JyAnLnJlcGVhdChNYXRoLm1heCgzIC0gU3RyaW5nKGxpbmUpLmxlbmd0aCwgMCkpfXwgICR7bGluZXNbal19YCk7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBsaW5lTGVuZ3RoID0gbGluZXNbal0ubGVuZ3RoO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV3TGluZVNlcUxlbmd0aCA9IChuZXdsaW5lU2VxdWVuY2VzW2pdICYmIG5ld2xpbmVTZXF1ZW5jZXNbal0ubGVuZ3RoKSB8fCAwO1xyXG4gICAgICAgICAgICAgICAgaWYgKGogPT09IGkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBwdXNoIHVuZGVybGluZVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhZCA9IHN0YXJ0IC0gKGNvdW50IC0gKGxpbmVMZW5ndGggKyBuZXdMaW5lU2VxTGVuZ3RoKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbGVuZ3RoID0gTWF0aC5tYXgoMSwgZW5kID4gY291bnQgPyBsaW5lTGVuZ3RoIC0gcGFkIDogZW5kIC0gc3RhcnQpO1xyXG4gICAgICAgICAgICAgICAgICAgIHJlcy5wdXNoKGAgICB8ICBgICsgJyAnLnJlcGVhdChwYWQpICsgJ14nLnJlcGVhdChsZW5ndGgpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGogPiBpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuZCA+IGNvdW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlbmd0aCA9IE1hdGgubWF4KE1hdGgubWluKGVuZCAtIGNvdW50LCBsaW5lTGVuZ3RoKSwgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5wdXNoKGAgICB8ICBgICsgJ14nLnJlcGVhdChsZW5ndGgpKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY291bnQgKz0gbGluZUxlbmd0aCArIG5ld0xpbmVTZXFMZW5ndGg7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmV0dXJuIHJlcy5qb2luKCdcXG4nKTtcclxufVxuXG4vKipcclxuICogT24gdGhlIGNsaWVudCB3ZSBvbmx5IG5lZWQgdG8gb2ZmZXIgc3BlY2lhbCBjYXNlcyBmb3IgYm9vbGVhbiBhdHRyaWJ1dGVzIHRoYXRcclxuICogaGF2ZSBkaWZmZXJlbnQgbmFtZXMgZnJvbSB0aGVpciBjb3JyZXNwb25kaW5nIGRvbSBwcm9wZXJ0aWVzOlxyXG4gKiAtIGl0ZW1zY29wZSAtPiBO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NvbnN0IGl0ZW0gPSB2YWx1ZVtpXTtcclxuICAgICAgICAgICAgY29uc3Qgbm9ybWFsaXplZCA9IGlzU3RyaW5nKGl0ZW0pXHJcbiAgICAgICAgICAgICAgICA/IHBhcnNlU3RyaW5nU3R5bGUoaXRlbSlcclxuICAgICAgICAgICAgICAgIDogbm9ybWFsaXplU3R5bGUoaXRlbSk7XHJcbiAgICAgICAgICAgIGlmIChub3JtYWxpemVkKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBub3JtYWxpemVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzW2tleV0gPSBub3JtYWxpemVkW2tleV07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHJlcztcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzU3RyaW5nKHZhbHVlKSkge1xyXG4gICAgICAgIHJldHVybiB2YWx1ZTtcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzT2JqZWN0KHZhbHVlKSkge1xyXG4gICAgICAgIHJldHVybiB2YWx1ZTtcclxuICAgIH1cclxufVxyXG5jb25zdCBsaXN0RGVsaW1pdGVyUkUgPSAvOyg/IVteKF0qXFwpKS9nO1xyXG5jb25zdCBwcm9wZXJ0eURlbGltaXRlclJFID0gLzooLispLztcclxuZnVuY3Rpb24gcGFyc2VTdHJpbmdTdHlsZShjc3NUZXh0KSB7XHJcbiAgICBjb25zdCByZXQgPSB7fTtcclxuICAgIGNzc1RleHQuc3BsaXQobGlzdERlbGltaXRlclJFKS5mb3JFYWNoKGl0ZW0gPT4ge1xyXG4gICAgICAgIGlmIChpdGVtKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHRtcCA9IGl0ZW0uc3BsaXQocHJvcGVydHlEZWxpbWl0ZXJSRSk7XHJcbiAgICAgICAgICAgIHRtcC5sZW5ndGggPiAxICYmIChyZXRbdG1wWzB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4gICAgICAgICAgICAgICAgZXNjYXBlZCA9ICcmIzM5Oyc7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSA2MDogLy8gPFxyXG4gICAgICAgICAgICAgICAgZXNjYXBlZCA9ICcmbHQ7JztcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIDYyOiAvLyA+XHJcbiAgICAgICAgICAgICAgICBlc2NhcGVkID0gJyZndDsnO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGxhc3RJbmRleCAhPT0gaW5kZXgpIHtcclxuICAgICAgICAgICAgaHRtbCArPSBzdHIuc2xpY2UobGFzdEluZGV4LCBpbmRleCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGxhc3RJbmRleCA9IGluZGV4ICsgMTtcclxuICAgICAgICBodG1sICs9IGVzY2FwZWQ7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gbGFzdEluZGV4ICE9PSBpbmRleCA/IGh0bWwgKyBzdHIuc2xpY2UobGFzdEluZGV4LCBpbmRleCkgOiBodG1sO1xyXG59XHJcbi8vIGh0dHBzOi8vd3d3LnczLm9yZy9UUi9odG1sNTIvc3ludGF4Lmh0bWwjY29tbWVudHNcclxuY29uc3QgY29tbWVudFN0cmlwUkUgPSAvXi0/Pnw8IS0tfC0tPnwtLSE+fDwhLSQvZztcclxuZnVuY3Rpb24gZXNjYXBlSHRtbENvbW1lbnQoc3JjKSB7XHJcbiAgICByZXR1cm4gc3JjLnJlcGxhY2UoY29tbWVudFN0cmlwUkUsICcnKTtcclxufVxuXG5mdW5jdGlvbiBsb29zZUNvbXBhcmVBcnJheXMoYSwgYikge1xyXG4gICAgaWYgKGEubGVuZ3RoICE9PSBiLmxlbmd0aClcclxuICAgICAgICByZXR1c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xlZCAqL1xyXG4gICAgICAgIGlmICghYVZhbGlkVHlwZSB8fCAhYlZhbGlkVHlwZSkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGFLZXlzQ291bnQgPSBPYmplY3Qua2V5cyhhKS5sZW5ndGg7XHJcbiAgICAgICAgY29uc3QgYktleXNDb3VudCA9IE9iamVjdC5rZXlzKGIpLmxlbmd0aDtcclxuICAgICAgICBpZiAoYUtleXNDb3VudCAhPT0gYktleXNDb3VudCkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIGEpIHtcclxuICAgICAgICAgICAgY29uc3QgYUhhc0tleSA9IGEuaGFzT3duUHJvcGVydHkoa2V5KTtcclxuICAgICAgICAgICAgY29uc3QgYkhhc0tleSA9IGIuaGFzT3duUHJvcGVydHkoa2V5KTtcclxuICAgICAgICAgICAgaWYgKChhSGFzS2V5ICYmICFiSGFzS2V5KSB8fFxyXG4gICAgICAgICAgICAgICAgKCFhSGFzS2V5ICYmIGJIYXNLZXkpIHx8XHJcbiAgICAgICAgICAgICAgICAhbG9vc2VFcXVhbChhW2tleV0sIGJba2V5XSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiBTdHJpbmcoYSkgPT09IFN0cmluZyhiKTtcclxufVxyXG5mdW5jdGlvbiBsb29zZUluZGV4T2YoYXJyLCB2YWwpIHtcclxuICAgIHJldHVybiBhcnIuZmluZEluZGV4KGl0ZW0gPT4gbG9vc2VFcXVhbChpdGVtLCB2YWwpKTtcclxufVxuXG4vKipcclxuICogRm9yIGNvbnZlcnRpbmcge3sgaW50ZXJwb2xhdGlvbiB9fSB2YWx1ZXMgdG8gZGlzcGxheWVkIHN0cmluZ3MuX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aSA8IGZucy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIGZuc1tpXShhcmcpO1xyXG4gICAgfVxyXG59O1xyXG5jb25zdCBkZWYgPSAob2JqLCBrZXksIHZhbHVlKSA9PiB7XHJcbiAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkob2JqLCBrZXksIHtcclxuICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXHJcbiAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgdmFsdWVcclxuICAgIH0pO1xyXG59O1xyXG5jb25zdCB0b051bWJlciA9ICh2YWwpID0+IHtcclxuICAgIGNvbnN0IG4gPSBwYXJzZUZsb2F0KHZhbCk7XHJcbiAgICByZXR1cm4gaXNOYU4obikgPyB2YWwgOiBuO1xyXG59O1xyXG5sZXQgX2dsb2JhbFRoaXM7XHJcbmNvbnN0IGdldEdsb2JhbFRoaXMgPSAoKSA9PiB7XHJcbiAgICByZXR1cm4gKF9nbG9iYWxUaGlzIHx8XHJcbiAgICAgICAgKF9nbG9iYWxUaGlzID1cclxuICAgICAgICAgICAgdHlwZW9mIGdsb2JhbFRoaXMgIT09ICd1bmRlZmluZWQnXHJcbiAgICAgICAgICAgICAgICA/IGdsb2JhbFRoaXNcclxuICAgICAgICAgICAgICAgIDogdHlwZW9mIHNlbGYgIT09ICd1bmRlZmluZWQnXHJcbiAgICAgICAgICAgICAgICAgICAgPyBzZWxmXHJcbiAgICAgICAgICAgICAgICAgICAgOiB0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA/IHdpbmRvd1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IHR5cGVvZiBnbG9iYWwgIT09ICd1bmRlZmluZWQnXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGdsb2JhbFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB7fSkpO1xyXG59O1xuXG5leHBvcnQgeyBFTVB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uKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZmluYWxseSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLm9mZigpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICB3YXJuKGBjYW5ub3QgcnVuIGFuIGluYWN0aXZlIGVmZmVjdCBzY29wZS5gKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBvbigpIHtcclxuICAgICAgICBpZiAodGhpcy5hY3RpdmUpIHtcclxuICAgICAgICAgICAgZWZmZWN0U2NvcGVTdGFjay5wdXNoKHRoaXMpO1xyXG4gICAgICAgICAgICBhY3RpdmVFZmZlY3RTY29wZSA9IHRoaXM7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgb2ZmKCkge1xyXG4gICAgICAgIGlmICh0aGlzLmFjdGl2ZSkge1xyXG4gICAgICAgICAgICBlZmZlY3RTY29wZVN0YWNrLnBvcCgpO1xyXG4gICAgICAgICAgICBhY3RpdmVFZmZlY3RTY29wZSA9IGVmZmVjdFNjb3BlU3RhY2tbZWZmZWN0U2NvcGVTdGFjay5sZW5ndGggLSAxXTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBzdG9wKGZyb21QYXJlbnQpIHtcclxuICAgICAgICBpZiAodGhpcy5hY3RpdmUpIHtcclxuICAgICAgICAgICAgdGhpcy5lZmZlY3RzLmZvckVhY2goZSA9PiBlLnN0b3AoKSk7XHJcbiAgICAgICAgICAgIHRoaXMuY2xlYW51cHMuZm9yRWFjaChjbGVhbnVwID0+IGNsZWFudXAoKSk7XHJcbiAgICAgICAgICAgIGlmICh0aGlzLnNjb3Blcykge1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zY29wZXMuZm9yRWFjaChlID0+IGUuc3RvcCh0cnVlKSk7X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xuICAgICAgICAgICAgICAgIGVuYWJsZVRyYWNraW5nKCk7XHJcbiAgICAgICAgICAgICAgICB0cmFja09wQml0ID0gMSA8PCArK2VmZmVjdFRyYWNrRGVwdGg7XHJcbiAgICAgICAgICAgICAgICBpZiAoZWZmZWN0VHJhY2tEZXB0aCA8PSBtYXhNYXJrZXJCaXRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaW5pdERlcE1hcmtlcnModGhpcyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjbGVhbnVwRWZmZWN0KHRoaXMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZm4oKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBmaW5hbGx5IHtcclxuICAgICAgICAgICAgICAgIGlmIChlZmZlY3RUcmFja0RlcHRoIDw9IG1heE1hcmtlckJpdHMpIHtcclxuICAgICAgICAgICAgICAgICAgICBmaW5hbGl6ZURlcE1hcmtlcnModGhpcyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB0cmFja09wQml0ID0gMSA8PCAtLWVmZmVjdFRyYWNrRGVwdGg7XHJcbiAgICAgICAgICAgICAgICByZXNldFRyYWNraW5nKCk7XHJcbiAgICAgICAgICAgICAgICBlZmZlY3RTdGFjay5wb3AoKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG4gPSBlZmZlY3RTdGFjay5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICBhY3RpdmVFZmZlY3QgPSBuID4gMCA/IGVmZmVjdFN0YWNrW24gLSAxXSA6IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHN0b3AoKSB7XHJcbiAgICAgICAgaWYgKHRoaXMuYWN0aXZlKSB7XHJcbiAgICAgICAgICAgIGNsZ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ICBlbHNlIHtcclxuICAgICAgICAvLyBzY2hlZHVsZSBydW5zIGZvciBTRVQgfCBBREQgfCBERUxFVEVcclxuICAgICAgICBpZiAoa2V5ICE9PSB2b2lkIDApIHtcclxuICAgICAgICAgICAgZGVwcy5wdXNoKGRlcHNNYXAuZ2V0KGtleSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBhbHNvIHJ1biBmb3IgaXRlcmF0aW9uIGtleSBvbiBBREQgfCBERUxFVEUgfCBNYXAuU0VUXHJcbiAgICAgICAgc3dpdGNoICh0eXBlKSB7XHJcbiAgICAgICAgICAgIGNhc2UgXCJhZGRcIiAvKiBBREQgKi86XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzQXJyYXkodGFyZ2V0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRlcHMucHVzaChkZXBzTWFwLmdldChJVEVSQVRFX0tFWSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc01hcCh0YXJnZXQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlcHMucHVzaChkZXBzTWFwLmdldChNQVBfS0VZX0lURVJBVEVfS0VZKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNJbnRlZ2VyS2V5KGtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBuZXcgaW5kZXggYWRkZWQgdG8gYXJyYXkgLT4gbGVuZ3RoIGNoYW5nZXNcclxuICAgICAgICAgICAgICAgICAgICBkZXBzLnB1c2goZGVwc01hcC5nZXQoJ2xlbmd0aCcpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwiZGVsZXRlXCIgLyogREVMRVRFICovOlxyXG4gICAgICAgICAgICAgICAgaWYgKCFpc0FycmF5KHRhcmdldCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBkZXBzLnB1c2goZGVwc01hcC5nZXQoSVRFUkFURV9LRVkpKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNNYXAodGFyZ2V0KSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXBzLnB1c2goZGVwc01hcC5nZXQoTUFQX0tFWV9JVEVSQVRFX0tFWSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFwic2V0XCIgLyogU0VUICovOlxyXG4gICAgICAgICAgICAgICAgaWYgKGlzTWFwKHRhcmdldCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBkZXBzLnB1c2goZGVwc01hcC5nZXQoSVRFUkFURV9LRVkpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGNvbnN0IGV2ZW50SW5mbyA9IChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKVxyXG4gICAgICAgID8geyB0YXJnZXQsIHR5cGUsIGtleSwgbmV3VmFsdWUsIG9sZFZhbHVlLCBvbGRUYXJnZXQgfVxyXG4gICAgICAgIDogdW5kZWZpbmVkO1xyXG4gICAgaWYgKGRlcHMubGVuZ3RoID09PSAxKSB7XHJcbiAgICAgICAgaWYgKGRlcHNbMF0pIHtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgdHJpZ2dlckVmZmVjdHMoZGVwc1swXSwgZXZlbnRJbmZvKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHRyaWdnZXJFZmZlY3RzKGRlcHNbMF0pO1xyXG4gICAgICA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ICdpbmRleE9mJywgJ2xhc3RJbmRleE9mJ10uZm9yRWFjaChrZXkgPT4ge1xyXG4gICAgICAgIGluc3RydW1lbnRhdGlvbnNba2V5XSA9IGZ1bmN0aW9uICguLi5hcmdzKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGFyciA9IHRvUmF3KHRoaXMpO1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMCwgbCA9IHRoaXMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICB0cmFjayhhcnIsIFwiZ2V0XCIgLyogR0VUICovLCBpICsgJycpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIHdlIHJ1biB0aGUgbWV0aG9kIHVzaW5nIHRoZSBvcmlnaW5hbCBhcmdzIGZpcnN0ICh3aGljaCBtYXkgYmUgcmVhY3RpdmUpXHJcbiAgICAgICAgICAgIGNvbnN0IHJlcyA9IGFycltrZXldKC4uLmFyZ3MpO1xyXG4gICAgICAgICAgICBpZiAocmVzID09PSAtMSB8fCByZXMgPT09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBpZiB0aGF0IGRpZG4ndCB3b3JrLCBydW4gaXQgYWdhaW4gdXNpbmcgcmF3IHZhbHVlcy5cclxuICAgICAgICAgICAgICAgIHJldHVybiBhcnJba2V5XSguLi5hcmdzLm1hcCh0b1JhdykpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH07XHJcbiAgICB9KTtcclxuICAgIFsncHVzaCcsICdwb3AnLCAnc2hpZnQnLCAndW5zaGlmdCcsICdzcGxpY2UnXS5mb3JFYWNoKGtleSA9PiB7XHJcbiAgICAgICAgaW5zdHJ1bWVudGF0aW9uc1trZXldID0gZnVuY3Rpb24gKC4uLmFyZ3MpIHtcclxuICAgICAgICAgICAgcGF1c2VUcmFja2luZygpO1xyXG4gICAgICAgICAgICBjb25zdCByZXMgPSB0b1Jhdyh0aGlzKVtrZXldLmFwcGx5KHRoaXMsIGFyZ3MpO1xyXG4gICAgICAgICAgICByZXNldFRyYWNraW5nKCk7XHJcbiAgICAgICAgICAgIHJldHVybiByZXM7XHJcbiAgICAgICAgfTtcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIGluc3RydW1lbnRhdGlvbnM7XHJcbn1cclxuZnVuY3Rpb24gY3JlYXRlR2V0dGVyKGlzUmVhZG9ubHkgPSBmYWxzZSwgc2hhbGxvdyA9IGZhbHNlKSB7XHJcbiAgICByZXR1cm4gZnVuY3Rpb24gZ2V0KHRhcmdldCwga2V5LCByZWNlaXZlcikge1xyXG4gICAgICAgIGlmIChrZXkgPT09IFwiX192X2lzUmVhY3RpdmVcIiAvKiBJU19SRUFDVElWRSAqLykge1xyXG4gICAgICAgICAgICByZXR1cm4gIWlzUmVhZG9ubHk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGtleSA9PT0gXCJfX3ZfaXNSZWFkb25seVwiIC8qIElTX1JFQURPTkxZICovKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBpc1JlYWRvbmx5O1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChrZXkgPT09IFwiX192X3Jhd1wiIC8qIFJBVyAqLyAmJlxyXG4gICAgICAgICAgICByZWNlaXZlciA9PT1cclxuICAgICAgICAgICAgICAgIChpc1JlYWRvbmx5XHJcbiAgICAgICAgICAgICAgICAgICAgPyBzaGFsbG93XHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gc2hhbGxvd1JlYWRvbmx5TWFwXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogcmVhZG9ubHlNYXBcclxuICAgICAgICAgICAgICAgICAgICA6IHNoYWxsb3dcclxuICAgICAgICAgICAgICAgICAgICAgICAgPyBzaGFsbG93UmVhY3RpdmVNYXBcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiByZWFjdGl2ZU1hcCkuZ2V0KHRhcmdldCkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRhcmdldDtcclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3QgdGFyZ2V0SXNBcnJheSA9IGlzQXJyYXkodGFyZ2V0KTtcclxuICAgICAgICBpZiAoIWlzUmVhZG9ubHkgJiYgdGFyZ2V0SXNBcnJheSAmJiBoYXNPd24oYXJyYXlJbnN0cnVtZW50YXRpb25zLCBrZXkpKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBSZWZsZWN0LmdldChhcnJheUluc3RydW1lbnRhdGlvbnMsIGtleSwgcmVjZWl2ZXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCByZXMgPSBSZWZsZWN0LmdldCh0YXJnZXQsIGtleSwgcmVjZWl2ZXIpO1xyXG4gICAgICAgIGlmIChpc1N5bWJvbChrZXkpID8gYnVpbHRJblN5bWJvbHMuaGFzKGtleSkgOiBpc05vblRyYWNrYWJsZUtleXMoa2V5KSkge1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoIWlzUmVhZG9ubHkpIHtcclxuICAgICAgICAgICAgdHJhY2sodGFyZ2V0LCBcImdldFwiIC8qIEdFVCAqLywga2V5KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHNoYWxsb3cpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGlzUmVmKHJlcykpIHtcclxuICAgICAgICAgICAgLy8gcmVmIHVud3JhcHBpbmcgLSBkb2VzIG5vdCBhcHBseSBmb3IgQXJyYXkgKyBpbnRlZ2VyIGtleS5cclxuICAgICAgICAgICAgY29uc3Qgc2hvdWxkVW53cmFwID0gIXRhcmdldElzQXJyYXkgfHwgIWlzSW50ZWdlcktleShrZXkpO1xyXG4gICAgICAgICAgICByZXR1cm4gc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KSAmJiAhaXNSZWYodmFsdWUpKSB7XHJcbiAgICAgICAgICAgICAgICBvbGRWYWx1ZS52YWx1ZSA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3QgaGFkS2V5ID0gaXNBcnJheSh0YXJnZXQpICYmIGlzSW50ZWdlcktleShrZXkpXHJcbiAgICAgICAgICAgID8gTnVtYmVyKGtleSkgPCB0YXJnZXQubGVuZ3RoXHJcbiAgICAgICAgICAgIDogaGFzT3duKHRhcmdldCwga2V5KTtcclxuICAgICAgICBjb25zdCByZXN1bHQgPSBSZWZsZWN0LnNldCh0YXJnZXQsIGtleSwgdmFsdWUsIHJlY2VpdmVyKTtcclxuICAgICAgICAvLyBkb24ndCB0cmlnZ2VyIGlmIHRhcmdldCBpcyBzb21ldGhpbmcgdXAgaW4gdGhlIHByb3RvdHlwZSBjaGFpbiBvZiBvcmlnaW5hbFxyXG4gICAgICAgIGlmICh0YXJnZXQgPT09IHRvUmF3KHJlY2VpdmVyKSkge1xyXG4gICAgICAgICAgICBpZiAoIWhhZEtleSkge1xyXG4gICAgICAgICAgICAgICAgdHJpZ2dlcih0YXJnZXQsIFwiYWRkXCIgLyogQUREICovLCBrZXksIHZhbHVlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChoYXNDaGFuZ2VkKHZhbHVlLCBvbGRWYWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIHRyaWdnZXIodGFyZ2V0LCBcInNldFwiIC8qIFNFVCAqLywga2V5LCB2YWx1ZSwgb2xkVmFsdWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXN1bHQ7XHJcbiAgICB9O1xyXG59XHJcbmZ1bmN0aW9uIGRlbGV0ZVByb3BlcnR5KHRhcmdldCwga2V5KSB7XHJcbiAgICBjb25zdC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IHZhbHVlcyBlbWl0dGVkIGZyb20gdGhlIHJlYWwgaXRlcmF0b3JcclxuICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAvLyBpdGVyYXRvciBwcm90b2NvbFxyXG4gICAgICAgICAgICBuZXh0KCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeyB2YWx1ZSwgZG9uZSB9ID0gaW5uZXJJdGVyYXRvci5uZXh0KCk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZG9uZVxyXG4gICAgICAgICAgICAgICAgICAgID8geyB2YWx1ZSwgZG9uZSB9XHJcbiAgICAgICAgICAgICAgICAgICAgOiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBpc1BhaXIgPyBbd3JhcCh2YWx1ZVswXSksIHdyYXAodmFsdWVbMV0pXSA6IHdyYXAodmFsdWUpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkb25lXHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgLy8gaXRlcmFibGUgcHJvdG9jb2xcclxuICAgICAgICAgICAgW1N5bWJvbC5pdGVyYXRvcl0oKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH07XHJcbiAgICB9O1xyXG59XHJcbmZ1bmN0aW9uIGNyZWF0ZVJlYWRvbmx5TWV0aG9kKHR5cGUpIHtcclxuICAgIHJldHVybiBmdW5jdGlvbiAoLi4uYXJncykge1xyXG4gICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgY29uc3Qga2V5ID0gYXJnc1swXSA/IGBvbiBrZXkgXCIke2FyZ3NbMF19XCIgYCA6IGBgO1xyXG4gICAgICAgICAgICBjb25zb2xlLndhcm4oYCR7Y2FwaXRhbGl6ZSh0eXBlKX0gb3BlcmF0aW9uICR7a2V5fWZhaWxlZDogdGFyZ2V0IGlzIHJlYWRvbmx5LmAsIHRvUmF3KHRoaXMpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHR5cGUgPT09IFwiZGVsZXRlXCIgLyogREVMRVRFICovID8gZmFsc2UgOiB0aGlzO1xyXG4gICAgfTtcclxufVxyXG5mdW5jdGlvbiBjcmVhdGVJbnN0cnVtZW50YXRpb25zKCkge1xyXG4gICAgY29uc3QgbXV0YWJsZUluc3RydW1lbnRhdGlvbnMgPSB7XHJcbiAgICAgICAgZ2V0KGtleSkge1xyXG4gICAgICAgICAgICByZXR1cm4gZ2V0JDEodGhpcywga2V5KTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGdldCBzaXplKCkge1xyXG4gICAgICAgICAgICByZXR1cm4gc2l6ZSh0aGlzKTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGhhczogaGFzJDEsXHJcbiAgICAgICAgYWRkLFxyXG4gICAgICAgIHNldDogc2V0JDEsXHJcbiAgICAgICAgZGVsZXRlOiBkZWxldGVFbnRyeSxcclxuICAgICAgICBjbGVhcixcclxuICAgICAgICBmb3JFYWNoOiBjcmVhdGVGb3JFYWNoKGZhbHNlLCBmYWxzZSlcclxuICAgIH07XHJcbiAgICBjb25zdCBzaGFsbG93SW5zdHJ1bWVudGF0aW9ucyA9IHtcclxuICAgICAgICBnZXQoa2V5KSB7XHJcbiAgICAgICAgICAgIHJldHVybiBnZXQkMSh0aGlzLCBrZXksIGZhbHNlLCB0cnVlKTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGdldCBzaXplKCkge1xyXG4gICAgICAgICAgICByZXR1cm4gc2l6ZSh0aGlzKTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGhhczogaGFzJDEsXHJcbiAgICAgICAgYWRkLFxyXG4gICAgICAgIHNldDogc2V0JDEsXHJcbiAgICAgICAgZGVsZXRlOiBkZWxldGVFbnRyeSxcclxuICAgICAgICBjbGVhcixccl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cbiAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICB0cmFja0VmZmVjdHMocmVmLmRlcCwge1xyXG4gICAgICAgICAgICAgICAgdGFyZ2V0OiByZWYsXHJcbiAgICAgICAgICAgICAgICB0eXBlOiBcImdldFwiIC8qIEdFVCAqLyxcclxuICAgICAgICAgICAgICAgIGtleTogJ3ZhbHVlJ1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHRyYWNrRWZmZWN0cyhyZWYuZGVwKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gdHJpZ2dlclJlZlZhbHVlKHJlZiwgbmV3VmFsKSB7XHJcbiAgICByZWYgPSB0b1JhdyhyZWYpO1xyXG4gICAgaWYgKHJlZi5kZXApIHtcclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgIHRyaWdnZXJFZmZlY3RzKHJlZi5kZXAsIHtcclxuICAgICAgICAgICAgICAgIHRhcmdldDogcmVmLFxyXG4gICAgICAgICAgICAgICAgdHlwZTogXCJzZXRcIiAvKiBTRVQgKi8sXHJcbiAgICAgICAgICAgICAgICBrZXk6ICd2YWx1ZScsXHJcbiAgICAgICAgICAgICAgICBuZXdWYWx1ZTogbmV3VmFsXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdHJpZ2dlckVmZmVjdHMocmVmLmRlcCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbmZ1bmN0aW9uIGlzUmVmKHIpIHtcclxuICAgIHJldHVybiBCb29sZWFuKHIgJiYgci5fX3ZfaXNSZWYgPT09IHRydWUpO1xyXG59XHJcbmZ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ICAgICAgICAgICAgICBjb21wYXJlVGFyZ2V0ID0gdGhpcy5fdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzQ29tcGFyZVRhcmdldCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICghc2NoZWR1bGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWVUb0NvbXBhcmUgPSBoYXNDb21wYXJlVGFyZ2V0ID8gY29tcGFyZVRhcmdldCA6IHRoaXMuX3ZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzQ29tcGFyZVRhcmdldCA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgIHNjaGVkdWxlcigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmVmZmVjdC5hY3RpdmUgJiYgdGhpcy5fZ2V0KCkgIT09IHZhbHVlVG9Db21wYXJlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyUmVmVmFsdWUodGhpcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgc2NoZWR1bGVkID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBjaGFpbmVkIHVwc3RyZWFtIGNvbXB1dGVkcyBhcmUgbm90aWZpZWQgc3luY2hyb25vdXNseSB0byBlbnN1cmVcclxuICAgICAgICAgICAgICAgIC8vIHZhbHVlIGludmFsaWRhdGlvbiBpbiBjYXNlIG9mIHN5bmMgYWNjZXNzOyBub3JtYWwgZWZmZWN0cyBhcmVcclxuICAgICAgICAgICAgICAgIC8vIGRlZmVycmVkIHRvIGJlIHRyaWdnZXJlZCBpbi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KSB7XHJcbiAgICAgICAgY29uc3Qgb2xkQ29tcCA9IG5vcm1hbGl6ZUNsYXNzQ29tcG9uZW50KGluc3RhbmNlLnR5cGUpO1xyXG4gICAgICAgIGlmICghaG1yRGlydHlDb21wb25lbnRzLmhhcyhvbGRDb21wKSkge1xyXG4gICAgICAgICAgICAvLyAxLiBVcGRhdGUgZXhpc3RpbmcgY29tcCBkZWZpbml0aW9uIHRvIG1hdGNoIG5ldyBvbmVcclxuICAgICAgICAgICAgaWYgKG9sZENvbXAgIT09IHJlY29yZC5pbml0aWFsRGVmKSB7XHJcbiAgICAgICAgICAgICAgICB1cGRhdGVDb21wb25lbnREZWYob2xkQ29tcCwgbmV3Q29tcCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gMi4gbWFyayBkZWZpbml0aW9uIGRpcnR5LiBUaGlzIGZvcmNlcyB0aGUgcmVuZGVyZXIgdG8gcmVwbGFjZSB0aGVcclxuICAgICAgICAgICAgLy8gY29tcG9uZW50IG9uIHBhdGNoLlxyXG4gICAgICAgICAgICBobXJEaXJ0eUNvbXBvbmVudHMuYWRkKG9sZENvbXApO1xyXG4gICAgICAgIH1cclxuICAgICAgICAvLyAzLiBpbnZhbGlkYXRlIG9wdGlvbnMgcmVzb2x1dGlvbiBjYWNoZVxyXG4gICAgICAgIGluc3RhbmNlLmFwcENvbnRleHQub3B0aW9uc0NhY2hlLmRlbGV0ZShpbnN0YW5jZS50eXBlKTtcclxuICAgICAgICAvLyA0LiBhY3R1YWxseSB1cGRhdGVcclxuICAgICAgICBpZiAoaW5zdGFuY2UuY2VSZWxvYWQpIHtcclxuICAgICAgICAgICAgLy8gY3VzdG9tIGVsZW1lbnRcclxuICAgICAgICAgICAgaG1yRGlydHlDb21wb25lbnRzLmFkZChvbGRDb21wKTtcclxuICAgICAgICAgICAgaW5zdGFuY2UuY2VSZWxvYWQobmV3Q29tcC5zdHlsZXMpO1xyXG4gICAgICAgICAgICBobXJEaXJ0eUNvbXBvbmVudHMuZGVsZXRlKG9sZENvbXApO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpbnN0YW5jZS5wYXJlbnQpIHtcclxuICAgICAgICAgICAgLy8gNC4gRm9yY2UgdGhlIHBhcmVudCBpbnN0YW5jZSB0byByZS1yZW5kZXIuIFRoaXMgd2lsbCBjYXVzZSBhbGwgdXBkYXRlZFxyXG4gICAgICAgICAgICAvLyBjb21wb25lbnRzIHRvIGJlIHVubW91bnRlZCBhbmQgcmUtbW91bnRlZC4gUXVldWUgdGhlIHVwZGF0ZSBzbyB0aGF0IHdlXHJcbiAgICAgICAgICAgIC8vIGRvbid0IGVuZCB1cCBmb3JjaW5nIHRoZSBzYW1lIHBhcmVudCB0byByZS1yZW5kZXIgbXVsdGlwbGUgdGltZXMuXHJcbiAgICAgICAgICAgIHF1ZXVlSm9iKGluc3RhbmNlLnBhcmVudC51cGRhdGUpO1xyXG4gICAgICAgICAgICAvLyBpbnN0YW5jZSBpcyB0aGUgaW5uZXIgY29tcG9uZW50IG9mIGFuIGFzeW5jIGN1c3RvbSBlbGVtZW50XHJcbiAgICAgICAgICAgIC8vIGludm9rZSB0byByZXNldCBzdHlsZXNcclxuICAgICAgICAgICAgaWYgKGluc3RhbmNlLnBhcmVudC50eXBlLl9fYXN5bmNMb2FkZXIgJiZcclxuICAgICAgICAgICAgICAgIGluc3RhbmNlLnBhcmVudC5jZVJlbG9hZCkge1xyXG4gICAgICAgICAgICAgICAgaW5zdGFuY2UucGFyZW50LmNlUmVsb2FkKG5ld0NvbXAuc3R5bGVzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpbnN0YW5jZS5hcHBDb250ZXh0LnJlbG9hZCkge1xyXG4gICAgICAgICAgICAvLyByb290IGluc3RhbmNlIG1vdW50ZWQgdmlhIGNyZWF0ZUFwcCgpIGhhcyBhIHJlbG9hZCBtZXRob2RcclxuICAgICAgICAgICAgaW5zdGFuY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G4gICAgICAgICAgICAgICAgICAgIHdhcm4oYENvbXBvbmVudCBlbWl0dGVkIGV2ZW50IFwiJHtldmVudH1cIiBidXQgaXQgaXMgbmVpdGhlciBkZWNsYXJlZCBpbiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHRoZSBlbWl0cyBvcHRpb24gbm9yIGFzIGFuIFwiJHt0b0hhbmRsZXJLZXkoZXZlbnQpfVwiIHByb3AuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB2YWxpZGF0b3IgPSBlbWl0c09wdGlvbnNbZXZlbnRdO1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24odmFsaWRhdG9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGlzVmFsaWQgPSB2YWxpZGF0b3IoLi4ucmF3QXJncyk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1ZhbGlkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oYEludmFsaWQgZXZlbnQgYXJndW1lbnRzOiBldmVudCB2YWxpZGF0aW9uIGZhaWxlZCBmb3IgZXZlbnQgXCIke2V2ZW50fVwiLmApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGxldCBhcmdzID0gcmF3QXJncztcclxuICAgIGNvbnN0IGlzTW9kZWxMaXN0ZW5lciA9IGV2ZW50LnN0YXJ0c1dpdGgoJ3VwZGF0ZTonKTtcclxuICAgIC8vIGZvciB2LW1vZGVsIHVwZGF0ZTp4eHggZXZlbnRzLCBhcHBseSBtb2RpZmllcnMgb24gYXJnc1xyXG4gICAgY29uc3QgbW9kZWxBcmcgPSBpc01vZGVsTGlzdGVuZXIgJiYgZXZlbnQuc2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gLy8gZnVuY3Rpb25hbFxyXG4gICAgICAgICAgICBjb25zdCByZW5kZXIgPSBDb21wb25lbnQ7XHJcbiAgICAgICAgICAgIC8vIGluIGRldiwgbWFyayBhdHRycyBhY2Nlc3NlZCBpZiBvcHRpb25hbCBwcm9wcyAoYXR0cnMgPT09IHByb3BzKVxyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGF0dHJzID09PSBwcm9wcykge1xyXG4gICAgICAgICAgICAgICAgbWFya0F0dHJzQWNjZXNzZWQoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXN1bHQgPSBub3JtYWxpemVWTm9kZShyZW5kZXIubGVuZ3RoID4gMVxyXG4gICAgICAgICAgICAgICAgPyByZW5kZXIocHJvcHMsIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKVxyXG4gICAgICAgICAgICAgICAgICAgID8ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXQgYXR0cnMoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJrQXR0cnNBY2Nlc3NlZCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF0dHJzO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzbG90cyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW1pdFxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICA6IHsgYXR0cnMsIHNsb3RzLCBlbWl0IH0pXHJcbiAgICAgICAgICAgICAgICA6IHJlbmRlcihwcm9wcywgbnVsbCAvKiB3ZSBrbm93IGl0IGRvZXNuJ3QgbmVlZCBpdCAqLykpO1xyXG4gICAgICAgICAgICBmYWxsdGhyb3VnaEF0dHJzID0gQ29tcG9uZW50LnByb3BzXHJcbiAgICA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R0cnMpO1xyXG4gICAgICAgIGNvbnN0IHsgc2hhcGVGbGFnIH0gPSByb290O1xyXG4gICAgICAgIGlmIChrZXlzLmxlbmd0aCkge1xyXG4gICAgICAgICAgICBpZiAoc2hhcGVGbGFnICYgKDEgLyogRUxFTUVOVCAqLyB8IDYgLyogQ09NUE9ORU5UICovKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHByb3BzT3B0aW9ucyAmJiBrZXlzLnNvbWUoaXNNb2RlbExpc3RlbmVyKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIElmIGEgdi1tb2RlbCBsaXN0ZW5lciAob25VcGRhdGU6eHh4KSBoYXMgYSBjb3JyZXNwb25kaW5nIGRlY2xhcmVkXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gcHJvcCwgaXQgaW5kaWNhdGVzIHRoaXMgY29tcG9uZW50IGV4cGVjdHMgdG8gaGFuZGxlIHYtbW9kZWwgYW5kXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaXQgc2hvdWxkIG5vdCBmYWxsdGhyb3VnaC5cclxuICAgICAgICAgICAgICAgICAgICAvLyByZWxhdGVkOiAjMTU0MywgIzE2NDMsICMxOTg5XHJcbiAgICAgICAgICAgICAgICAgICAgZmFsbHRocm91Z2hBdHRycyA9IGZpbHRlck1vZGVsTGlzdGVuZXJzKGZhbGx0aHJvdWdoQXR0cnMsIHByb3BzT3B0aW9ucyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByb290ID0gY2xvbmVWTm9kZShyb290LCBmYWxsdGhyb3VnaEF0dHJzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgIWFjY2Vzc2VkQXR0cnMgJiYgcm9vdC50eXBlICE9PSBDb21tZW50KSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBhbGxBdHRycyA9IE9iamVjdC5rZXlzKGF0dHJzKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGV2ZW50QXR0cnMgPSBbXTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGV4dHJhQXR0cnMgPSBbXTtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwLCBsID0gYWxsQXR0cnMubGVuZ3RoOyBpIDwgbDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gYWxsQXR0cnNbaV07XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzT24oa2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZ25vcmUgdi1tb2RlbCBoYW5kbGVycyB3aGVuIHRoZXkgZmFpbCB0byBmYWxsdGhyb3VnaFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTW9kZWxMaXN0ZW5lcihrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgYG9uYCwgbG93ZXJjYXNlIGZpcnN0IGxldHRlciB0byByZWZsZWN0IGV2ZW50IGNhc2luZ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWNjdXJhdGVseVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRBdHRycy5wdXNoKGtleVsyXS50b0xvd2VyQ2FzZSgpICsga2V5LnNsaWNlKDMpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFBdHRycy5wdXNoKGtleSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGV4dHJhQXR0cnMubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihgRXh0cmFuZW91cyBub24tcHJvcHMgYXR0cmlidXRlcyAoYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGAke2V4dHJhQXR0cnMuam9pbignLCAnKX0pIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgd2VyZSBwYXNzZWQgdG8gY29tcG9uZW50IGJ1dCBjb3VsZCBub3QgYmUgYXV0b21hdGljYWxseSBpbmhlcml0ZWQgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBiZWNhdXNlIGNvbXBvbmVudCByZW5kZXJzIGZyYWdtZW50IG9yIHRleHQgcm9vdCBub2Rlcy5gKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChldmVudEF0dHJzLmxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYEV4dHJhbmVvdXMgbm9uLWVtaXRzIGV2ZW50IGxpc3RlbmVycyAoYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGAke2V2ZW50QXR0cnMuam9pbignLCAnKX0pIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgd2VyZSBwYXNzZWQgdG8gY29tcG9uZW50IGJ1dCBjb3VsZCBub3QgYmUgYXV0b21hdGljYWxseSBpbmhlcml0ZWQgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBiZWNhdXNlIGNvbXBvbmVudCByZW5kZXJzIGZyYWdtZW50IG9yIHRleHQgcm9vdCBub2Rlcy4gYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBJZiB0aGUgbGlzdGVuZXIgaXMgaW50ZW5kZWQgdG8gYmUgYSBjb21wb25lbnQgY3VzdG9tIGV2ZW50IGxpc3RlbmVyIG9ubHksIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgZGVjbGFyZSBpdCB1c2luZyB0aGUgXCJlbWl0c1wiIG9wdGlvbi5gKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVx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uICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBzaW5nbGVSb290ID0gY2hpbGQ7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gc2luZ2xlUm9vdDtcclxufVxyXG5jb25zdCBnZXRGdW5jdGlvbmFsRmFsbHRocm91Z2ggPSAoYXR0cnMpID0+IHtcclxuICAgIGxldCByZXM7XHJcbiAgICBmb3IgKGNvbnN0IGtleSBpbiBhdHRycykge1xyXG4gICAgICAgIGlmIChrZXkgPT09ICdjbGFzcycgfHwga2V5ID09PSAnc3R5bGUnIHx8IGlzT24oa2V5KSkge1xyXG4gICAgICAgICAgICAocmVzIHx8IChyZXMgPSB7fSkpW2tleV0gPSBhdHRyc1trZXldO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiByZXM7XHJcbn07XHJcbmNvbnN0IGZpbHRlck1vZGVsTGlzdGVuZXJzID0gKGF0dHJzLCBwcm9wcykgPT4ge1xyXG4gICAgY29uc3QgcmVzID0ge307XHJcbiAgICBmb3IgKGNvbnN0IGtleSBpbiBhdHRycykge1xyXG4gICAgICAgIGlmICghaXNNb2RlbExpc3RlbmVyKGtleSkgfHwgIShrZXkuc2xpY2UoOSkgaW4gcHJvcHMpKSB7XHJcbiAgICAgICAgICAgIHJlc1trZXldID0gYXR0cnNba2V5XTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gcmVzO1xyXG59O1xyXG5jb25zdCBpc0VsZW1lbnRSb290ID0gKHZub2RlKSA9PiB7XHJcbiAgICByZXR1cm4gKHZub2RlLnNoYXBlRmxhZyAmICg2IC8qIENPTVB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IHZub2RlLlxyXG4gICAgaWYgKG5leHRWTm9kZS5kaXJzIHx8IG5leHRWTm9kZS50cmFuc2l0aW9uKSB7XHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICB9XHJcbiAgICBpZiAob3B0aW1pemVkICYmIHBhdGNoRmxhZyA+PSAwKSB7XHJcbiAgICAgICAgaWYgKHBhdGNoRmxhZyAmIDEwMjQgLyogRFlOQU1JQ19TTE9UUyAqLykge1xyXG4gICAgICAgICAgICAvLyBzbG90IGNvbnRlbnQgdGhhdCByZWZlcmVuY2VzIHZhbHVlcyB0aGF0IG1pZ2h0IGhhdmUgY2hhbmdlZCxcclxuICAgICAgICAgICAgLy8gZS5nLiBpbiBhIHYtZm9yXHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAocGF0Y2hGbGFnICYgMTYgLyogRlVMTF9QUk9QUyAqLykge1xyXG4gICAgICAgICAgICBpZiAoIXByZXZQcm9wcykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuICEhbmV4dFByb3BzO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIHByZXNlbmNlIG9mIHRoaXMgZmxhZyBpbmRpY2F0ZXMgcHJvcHMgYXJlIGFsd2F5cyBub24tbnVsbFxyXG4gICAgICAgICAgICByZXR1cm4gaGFzUHJvcHNDaGFuZ2VkKHByZXZQcm9wcywgbmV4dFByb3BzLCBlbWl0cyk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHBhdGNoRmxhZyAmIDggLyogUFJPUFMgKi8pIHtcclxuICAgICAgICAgICAgY29uc3QgZHluYW1pY1Byb3BzID0gbmV4dFZOb2RlLmR5bmFtaWNQcm9wcztcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBkeW5hbWljUHJvcHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGR5bmFtaWNQcm9wc1tpXTtcclxuICAgICAgICAgICAgICAgIGlmIChuZXh0UHJvcHNba2V5XSAhPT0gcHJldlByb3BzW2tleV0gJiZcclxuICAgICAgICAgICAgICAgICAgICAhaXNFbWl0TGlzdGVuZXIoZW1pdHMsIGtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gICAgICAgIC8vIHRoaXMgcGF0aCBpcyBvbmx5IHRha2VuIGJ5IG1hbnVhbGx5IHdyaXR0ZW4gcmVuZGVyIGZ1bmN0aW9uc1xyXG4gICAgICAgIC8vIHNvIHByZXNlbmNlIG9mIGFueSBjaGlsZHJlbiBsZWFkcyB0byBhIGZvcmNlZCB1cGRhdGVcclxuICAgICAgICBpZiAocHJldkNoaWxkcmVuIHx8IG5leHRDaGlsZHJlbikge1xyXG4gICAgICAgICAgICBpZiAoIW5leHRDaGlsZHJlbiB8fCAhbmV4dENoaWxkcmVuLiRzdGFibGUpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChwcmV2UHJvcHMgPT09IG5leHRQcm9wcykge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghcHJldlByb3BzKSB7XHJcbiAgICAgICAgICAgIHJldHVybiAhIW5leHRQcm9wcztcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCFuZXh0UHJvcHMpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBoYXNQcm9wc0NoYW5nZWQocHJldlByb3BzLCBuZXh0UHJvcHMsIGVtaXRzKTtcclxuICAgIH1cclxuICAgIHJldHV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AgICAgICAvLyBubyBsb25nZXIgdmFsaWQuIHNldCBpdCBhcyB0aGUgYWN0aXZlIGJyYW5jaCBzbyBpdCB3aWxsIGJlIHVubW91bnRlZFxyXG4gICAgICAgICAgICAgICAgLy8gd2hlbiByZXNvbHZlZFxyXG4gICAgICAgICAgICAgICAgc3VzcGVuc2UuaXNIeWRyYXRpbmcgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIHN1c3BlbnNlLmFjdGl2ZUJyYW5jaCA9IHBlbmRpbmdCcmFuY2g7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICB1bm1vdW50KHBlbmRpbmdCcmFuY2gsIHBhcmVudENvbXBvbmVudCwgc3VzcGVuc2UpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGluY3JlbWVudCBwZW5kaW5nIElELiB0aGlzIGlzIHVzZWQgdG8gaW52YWxpZGF0ZSBhc3luYyBjYWxsYmFja3NcclxuICAgICAgICAgICAgLy8gcmVzZXQgc3VzcGVuc2Ugc3RhdGVcclxuICAgICAgICAgICAgc3VzcGVuc2UuZGVwcyA9IDA7XHJcbiAgICAgICAgICAgIC8vIGRpc2NhcmQgZWZmZWN0cyBmcm9tIHBlbmRpbmcgYnJhbmNoXHJcbiAgICAgICAgICAgIHN1c3BlbnNlLmVmZmVjdHMubGVuZ3RoID0gMDtcclxuICAgICAgICAgICAgLy8gZGlzY2FyZCBwcmV2aW91cyBjb250YWluZXJcclxuICAgICAgICAgICAgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyID0gY3JlYXRlRWxlbWVudCgnZGl2Jyk7XHJcbiAgICAgICAgICAgIGlmIChpc0luRmFsbGJhY2spIHtcclxuICAgICAgICAgICAgICAgIC8vIGFscmVhZHkgaW4gZmFsbGJhY2sgc3RhdGVcclxuICAgICAgICAgICAgICAgIHBhdGNoKG51bGwsIG5ld0JyYW5jaCwgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIHN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHN1c3BlbnNlLmRlcHMgPD0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN1c3BlbnNlLnJlc29sdmUoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoKGFjdGl2ZUJyYW5jaCwgbmV3RmFsbGJhY2ssIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIG51bGwsIC8vIGZhbGxiYWNrIHRyZWUgd2lsbCBub3QgaGF2ZSBzdXNwZW5zZSBjb250ZXh0XHJcbiAgICAgICAgICAgICAgICAgICAgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgICAgICBzZXRBY3RpdmVCcmFuY2goc3VzcGVuc2UsIG5ld0ZhbGxiYWNrKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChhY3RpdmVCcmFuY2ggJiYgaXNTYW1lVk5vZGVUeXBlKG5ld0JyYW5jaCwgYWN0aXZlQnJhbmNoKSkge1xyXG4gICAgICAgICAgICAgICAgLy8gdG9nZ2xlZCBcImJhY2tcIiB0byBjdXJyZW50IGFjdGl2ZSBicmFuY2hcclxuICAgICAgICAgICAgICAgIHBhdGNoKGFjdGl2ZUJyYW5jaCwgbmV3QnJhbmNoLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBzdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgIC8vIGZvcmNlIHJlc29sdmVcclxuICAgICAgICAgICAgICAgIHN1c3BlbnNlLnJlc29sdmUodHJ1ZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyBzd2l0Y2hlZCB0byBhIDNyZCBicmFuY2hcclxuICAgICAgICAgICAgICAgIHBhdGNoKG51bGwsIG5ld0JyYW5jaCwgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIHN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHN1c3BlbnNlLmRlcHMgPD0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHN1c3BlbnNlLnJlc29sdmUoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gICAgICAgIGlmIChhY3RpdmVCcmFuY2ggJiYgaXNTYW1lVk5vZGVUeXBlKG5ld0JyYW5jaCwgYWN0aXZlQnJhbmNoKSkge1xyXG4gICAgICAgICAgICAvLyByb290IGRpZCBub3QgY2hhbmdlLCBqdXN0IG5vcm1hbCBwYXRjaFxyXG4gICAgICAgICAgICBwYXRjaChhY3RpdmVCcmFuY2gsIG5ld0JyYW5jaCwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgc3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgIHNldEFjdGl2ZUJyYW5jaChzdXNwZW5zZSwgbmV3QnJhbmNoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIHJvb3Qgbm9kZSB0b2dnbGVkXHJcbiAgICAgICAgICAgIC8vIGludm9rZSBAcGVuZGluZyBldmVudFxyXG4gICAgICAgICAgICB0cmlnZ2VyRXZlbnQobjIsICdvblBlbmRpbmcnKTtcclxuICAgICAgICAgICAgLy8gbW91bnQgcGVuZGluZyBicmFuY2ggaW4gb2ZmLWRvbSBjb250YWluZXJcclxuICAgICAgICAgICAgc3VzcGVuc2UucGVuZGluZ0JyYW5jaCA9IG5ld0JyYW5jaDtcclxuICAgICAgICAgICAgc3VzcGVuc2UucGVuZGluZ0lkKys7XHJcbiAgICAgICAgICAgIHBhdGNoKG51bGwsIG5ld0JyYW5jaCwgc3VzcGVuc2UuaGlkZGVuQ29udGFpbmVyLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIHN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICBpZiAoc3VzcGVuc2UuZGVwcyA8PSAwKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBpbmNvbWluZyBicmFuY2ggaGFzIG5vIGFzeW5jIGRlcHMsIHJlc29sdmUgbm93LlxyXG4gICAgICAgICAgICAgICAgc3VzcGVuc2UucmVzb2x2ZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeyB0aW1lb3V0LCBwZW5kaW5nSWQgfSA9IHN1c3BlbnNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKHRpbWVvdXQgPiAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdXNwZW5zZS5wZW5kaW5nSWQgPT09IHBlbmRpbmdJZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VzcGVuc2UuZmFsbGJhY2sobmV3RmFsbGJhY2spO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICA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WJlcih2bm9kZS5wcm9wcyAmJiB2bm9kZS5wcm9wcy50aW1lb3V0KTtcclxuICAgIGNvbnN0IHN1c3BlbnNlID0ge1xyXG4gICAgICAgIHZub2RlLFxyXG4gICAgICAgIHBhcmVudCxcclxuICAgICAgICBwYXJlbnRDb21wb25lbnQsXHJcbiAgICAgICAgaXNTVkcsXHJcbiAgICAgICAgY29udGFpbmVyLFxyXG4gICAgICAgIGhpZGRlbkNvbnRhaW5lcixcclxuICAgICAgICBhbmNob3IsXHJcbiAgICAgICAgZGVwczogMCxcclxuICAgICAgICBwZW5kaW5nSWQ6IDAsXHJcbiAgICAgICAgdGltZW91dDogdHlwZW9mIHRpbWVvdXQgPT09ICdudW1iZXInID8gdGltZW91dCA6IC0xLFxyXG4gICAgICAgIGFjdGl2ZUJyYW5jaDogbnVsbCxcclxuICAgICAgICBwZW5kaW5nQnJhbmNoOiBudWxsLFxyXG4gICAgICAgIGlzSW5GYWxsYmFjazogdHJ1ZSxcclxuICAgICAgICBpc0h5ZHJhdGluZyxcclxuICAgICAgICBpc1VubW91bnRlZDogZmFsc2UsXHJcbiAgICAgICAgZWZmZWN0czogW10sXHJcbiAgICAgICAgcmVzb2x2ZShyZXN1bWUgPSBmYWxzZSkge1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3VtZSAmJiAhc3VzcGVuc2UucGVuZGluZ0JyYW5jaCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgc3VzcGVuc2UucmVzb2x2ZSgpIGlzIGNhbGxlZCB3aXRob3V0IGEgcGVuZGluZyBicmFuY2guYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoc3VzcGVuc2UuaXNVbm1vdW50ZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYHN1c3BlbnNlLnJlc29sdmUoKSBpcyBjYWxsZWQgb24gYW4gYWxyZWFkeSB1bm1vdW50ZWQgc3VzcGVuc2UgYm91bmRhcnkuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgeyB2bm9kZSwgYWN0aXZlQnJhbmNoLCBwZW5kaW5nQnJhbmNoLCBwZW5kaW5nSWQsIGVmZmVjdHMsIHBhcmVudENvbXBvbmVudCwgY29udGFpbmVyIH0gPSBzdXNwZW5zZTtcclxuICAgICAgICAgICAgaWYgKHN1c3BlbnNlLmlzSHlkcmF0aW5nKSB7XHJcbiAgICAgICAgICAgICAgICBzdXNwZW5zZS5pc0h5ZHJhdGluZyA9IGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKCFyZXN1bWUpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGRlbGF5RW50ZXIgPSBhY3RpdmVCcmFuY2ggJiZcclxuICAgICAgICAgICAgICAgICAgICBwZW5kaW5nQnJhbmNoLnRyYW5zaXRpb24gJiZcclxuICAgICAgICAgICAgICAgICAgICBwZW5kaW5nQnJhbmNoLnRyYW5zaXRpb24ubW9kZSA9PT0gJ291dC1pbic7XHJcbiAgICAgICAgICAgICAgICBpZiAoZGVsYXlFbnRlcikge1xyXG4gICAgICAgICAgICAgICAgICAgIGFjdGl2ZUJyYW5jaC50cmFuc2l0aW9uLmFmdGVyTGVhdmUgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwZW5kaW5nSWQgPT09IHN1c3BlbnNlLnBlbmRpbmdJZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW92ZShwZW5kaW5nQnJhbmNoLCBjb250YWluZXIsIGFuY2hvciwgMCAvKiBFTlRFUiAqLyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBpbml0aWFsIGFuY2hvciBvbiBtb3VudFxyXG4gICAgICAgICAgICAgICAgbGV0IHsgYW5jaG9yIH0gPSBzdXNwZW5zZTtcclxuICAgICAgICAgICAgICAgIC8vIHVubW91bnQgY3VycmVudCBhY3RpdmUgdHJlZVxyXG4gICAgICAgICAgICAgICAgaWYgKGFjdGl2ZUJyYW5jaCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBmYWxsYmFjayB0cmVlIHdhcyBtb3VudGVkLCBpdCBtYXkgaGF2ZSBiZWVuIG1vdmVkXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gYXMgcGFydCBvZiBhIHBhcmVudCBzdXNwZW5zZS4gZ2V0IHRoZSBsYXRlc3QgYW5jaG9yIGZvciBpbnNlcnRpb25cclxuICAgICAgICAgICAgICAgICAgICBhbmNob3IgPSBuZXh0KGFjdGl2ZUJyYW5jaCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdW5tb3VudChhY3RpdmVCcmFuY2gsIHBhcmVudENvbXBvbmVudCwgc3VzcGVuc2UsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFkZWxheUVudGVyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbW92ZSBjb250ZW50IGZyb20gb2ZmLWRvbSBjb250YWluZXIgdG8gYWN0dWFsIGNvbnRhaW5lclxyXG4gICAgICAgICAgICAgICAgICAgIG1vdmUocGVuZGluZ0JyYW5jaCwgY29udGFpbmVyLCBhbmNob3IsIDAgLyogRU5URVIgKi8pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHNldEFjdGl2ZUJyYW5jaChzdXNwZW5zZSwgcGVuZGluZ0JyYW5jaCk7XHJcbiAgICAgICAgICAgIHN1c3BlbnNlLnBlbmRpbmdCcmFuY2ggPSBudWxsO1xyXG4gICAgICAgICAgICBzdXNwZW5zZS5pc0luRmFsbGJhY2sgPSBmYWxzZTtcclxuICAgICAgICAgICAgLy8gZmx1c2ggYnVmZmVyZWQgZWZmZWN0c1xyXG4gICAgICAgICAgICAvLyBjaGVjayBpZiB0aGVyZSBpcyBhIHBlbmRpbmcgcGFyZW50IHN1c3BlbnNlXHJcbiAgICAgICAgICAgIGxldCBwYXJlbnQgPSBzdXNwZW5zZS5wYXJlbnQ7XHJcbiAgICAgICAgICAgIGxldCBoYXNVbnJlc29sdmVkQW5jZXN0b3IgPSBmYWxzZTtcclxuICAgICAgICAgICAgd2hpbGUgKHBhcmVudCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHBhcmVudC5wZW5kaW5nQnJhbmNoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZm91bmQgYSBwZW5kaW5nIHBhcmVudCBzdXNwZW5zZSwgbWVyZ2UgYnVmZmVyZWQgcG9zdCBqb2JzXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaW50byB0aGF0IHBhcmVudFxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudC5lZmZlY3RzLnB1c2goLi4uZWZmZWN0cyk7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzVW5yZXNvbHZlZEFuY2VzdG9yID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudC5wYXJlbnQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gbm8gcGVuZGluZyBwYXJlbnQgc3VzcGVuc2UsIGZsdXNoIGFsbCBqb2JzXHJcbiAgICAgICAgICAgIGlmICghaGFzVW5yZXNvbHZlZEFuY2VzdG9yKSB7XHJcbiAgICAgICAgICAgICAgICBxdWV1ZVBvc3RGbHVzaENiKGVmZmVjdHMpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHN1c3BlbnNlLmVmZmVjdHMgPSBbXTtcclxuICAgICAgICAgICAgLy8gaW52b2tlIEByZXNvbHZlIGV2ZW50XHJcbiAgICAgICAgICAgIHRyaWdnZXJFdmVudCh2bm9kZSwgJ29uUmVzb2x2ZScpO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgZmFsbGJhY2soZmFsbGJhY2tWTm9kZSkge1xyXG4gICAgICAgICAgICBpZiAoIXN1c3BlbnNlLnBlbmRpbmdCcmFuY2gpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCB7IHZub2RlLCBhY3RpdmVCcmFuY2gsIHBhcmVudENvbXBvbmVudCwgY29udGFpbmVyLCBpc1NWRyB9ID0gc3VzcGVuc2U7XHJcbiAgICAgICAgICAgIC8vIGludm9rZSBAZmFsbGJhY2sgZXZlbnRcclxuICAgICAgICAgICAgdHJpZ2dlckV2ZW50KHZub2RlLCAnb25GYWxsYmFjaycpO1xyXG4gICAgICAgICAgICBjb25zdCBhbmNob3IgPSBuZXh0KGFjdGl2ZUJyYW5jaCk7XHJcbiAgICAgICAgICAgIGNvbnN0IG1vdW50RmFsbGJhY2sgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIXN1c3BlbnNlLmlzSW5GYWxsYmFjaykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIG1vdW50IHRoZSBmYWxsYmFjayB0cmVlXHJcbiAgICAgICAgICAgICAgICBwYXRjaChudWxsLCBmYWxsYmFja1ZOb2RlLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBudWxsLCAvLyBmYWxsYmFjayB0cmVlIHdpbGwgbm90IGhhdmUgc3VzcGVuc2UgY29udGV4dFxyXG4gICAgICAgICAgICAgICAgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgIHNldEFjdGl2ZUJyYW5jaChzdXNwZW5zZSwgZmFsbGJhY2tWTm9kZSk7XHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgIGNvbnN0IGRlbGF5RW50ZXIgPSBmYWxsYmFja1ZOb2RlLnRyYW5zaXRpb24gJiYgZmFsbGJhY2tWTm9kZS50cmFuc2l0aW9uLm1vZGUgPT09ICdvdXQtaW4nO1xyXG4gICAgICAgICAgICBpZiAoZGVsYXlFbnRlcikge1xyXG4gICAgICAgICAgICAgICAgYWN0aXZlQnJhbmNoLnRyYW5zaXRpb24uYWZ0ZXJMZWF2ZSA9IG1vdW50RmFsbGJhY2s7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc3VzcGVuc2UuaXNJbkZhbGxiYWNrID0gdHJ1ZTtcclxuICAgICAgICAgICAgLy8gdW5tb3VudCBjdXJyZW50IGFjdGl2ZSBicmFuY2hcclxuICAgICAgICAgICAgdW5tb3VudChhY3RpdmVCcmFuY2gsIHBhcmVudENvbXBvbmVudCwgbnVsbCwgLy8gbm8gc3VzcGVuc2Ugc28gdW5tb3VudCBob29rcyBmaXJlIG5vd1xyXG4gICAgICAgICAgICB0cnVlIC8vIHNob3VsZFJlbW92ZVxyXG4gICAgICAgICAgICApO1xyXG4gICAgICAgICAgICBpZiAoIWRlbGF5RW50ZXIpIHtcclxuICAgICAgICAgICAgICAgIG1vdW50RmFsbGJhY2soKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgbW92ZShjb250YWluZXIsIGFuY2hvciwgdHlwZSkge1xyXG4gICAgICAgICAgICBzdXNwZW5zZS5hY3RpdmVCcmFuY2ggJiZcclxuICAgICAgICAgICAgICAgIG1vdmUoc3VzcGVuc2UuYWN0aXZlQnJhbmNoLCBjb250YWluZXIsIGFuY2hvciwgdHlwZSk7XHJcbiAgICAgICAgICAgIHN1c3BlbnNlLmNvbnRhaW5lciA9IGNvbnRhaW5lcjtcclxuICAgICAgICB9LFxyXG4gICAgICAgIG5leHQoKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBzdXNwZW5zZS5hY3RpdmVCcmFuY2ggJiYgbmV4dChzdXNwZW5zZS5hY3RpdmVCcmFuY2gpO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgcmVnaXN0ZXJEZXAoaW5zdGFuY2UsIHNldHVwUmVuZGVyRWZmZWN0KSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGlzSW5QZW5kaW5nU3VzcGVuc2UgPSAhIXN1c3BlbnNlLnBlbmRpbmdCcmFuY2g7XHJcbiAgICAgICAgICAgIGlmIChpc0luUGVuZGluZ1N1c3BlbnNlKSB7XHJcbiAgICAgICAgICAgICAgICBzdXNwZW5zZS5kZXBzKys7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgaHlkcmF0ZWRFbCA9IGluc3RhbmNlLnZub2RlLmVsO1xyXG4gICAgICAgICAgICBpbnN0YW5jZVxyXG4gICAgICAgICAgICAgICAgLmFzeW5jRGVwLmNhdGNoKGVyciA9PiB7XHJcbiAgICAgICAgICAgICAgICBoYW5kbGVFcnJvcihlcnIsIGluc3RhbmNlLCAwIC8qIFNFVFVQX0ZVTkNUSU9OICovKTtcclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC50aGVuKGFzeW5jU2V0dXBSZXN1bHQgPT4ge1xyXG4gICAgICAgICAgICAgICAgLy8gcmV0cnkgd2hlbiB0aGUgc2V0dXAoKSBwcm9taXNlIHJlc29sdmVzLlxyXG4gICAgICAgICAgICAgICAgLy8gY29tcG9uZW50IG1heSBoYXZlIGJlZW4gdW5tb3VudGVkIGJlZm9yZSByZXNvbHZlLlxyXG4gICAgICAgICAgICAgICAgaWYgKGluc3RhbmNlLmlzVW5tb3VudGVkIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgc3VzcGVuc2UuaXNVbm1vdW50ZWQgfHxcclxuICAgICAgICAgICAgICAgICAgICBzdXNwZW5zZS5wZW5kaW5nSWQgIT09IGluc3RhbmNlLnN1c3BlbnNlSWQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyByZXRyeSBmcm9tIHRoaXMgY29tcG9uZW50XHJcbiAgICAgICAgICAgICAgICBpbnN0YW5jZS5hc3luY1Jlc29sdmVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHsgdm5vZGUgfSA9IGluc3RhbmNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHB1c2hXYXJuaW5nQ29udGV4dCh2bm9kZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBoYW5kbGVTZXR1cFJlc3VsdChpbnN0YW5jZSwgYXN5bmNTZXR1cFJlc3VsdCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGh5ZHJhdGVkRWwpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyB2bm9kZSBtYXkgaGF2ZSBiZWVuIHJlcGxhY2VkIGlmIGFuIHVwZGF0ZSBoYXBwZW5lZCBiZWZvcmUgdGhlXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gYXN5bmMgZGVwIGlzIHJlc29sdmVkLlxyXG4gICAgICAgICAgICAgICAgICAgIHZub2RlLmVsID0gaHlkcmF0ZWRFbDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IHBsYWNlaG9sZGVyID0gIWh5ZHJhdGVkRWwgJiYgaW5zdGFuY2Uuc3ViVHJlZS5lbDtcclxuICAgICAgICAgICAgICAgIHNldHVwUmVuZGVyRWZmZWN0KGluc3RhbmNlLCB2bm9kZSwgXHJcbiAgICAgICAgICAgICAgICAvLyBjb21wb25lbnQgbWF5IGhhdmUgYmVlbiBtb3ZlZCBiZWZvcmUgcmVzb2x2ZS5cclxuICAgICAgICAgICAgICAgIC8vIGlmIHRoaXMgaXMgbm90IGEgaHlkcmF0aW9uLCBpbnN0YW5jZS5zdWJUcmVlIHdpbGwgYmUgdGhlIGNvbW1lbnRcclxuICAgICAgICAgICAgICAgIC8vIHBsYWNlaG9sZGVyLlxyXG4gICAgICAgICAgICAgICAgcGFyZW50Tm9kZShoeWRyYXRlZEVsIHx8IGluc3RhbmNlLnN1YlRyZWUuZWwpLCBcclxuICAgICAgICAgICAgICAgIC8vIGFuY2hvciB3aWxsIG5vdCBiZSB1c2VkIGlmIHRoaXMgaXMgaHlkcmF0aW9uLCBzbyBvbmx5IG5lZWQgdG9cclxuICAgICAgICAgICAgICAgIC8vIGNvbnNpZGVyIHRoZSBjb21tZW50IHBsYWNlaG9sZGVyIGNhc2UuXHJcbiAgICAgICAgICAgICAgICBoeWRyYXRlZEVsID8gbnVsbCA6IG5leHQoaW5zdGFuY2Uuc3ViVHJlZSksIHN1c3BlbnNlLCBpc1NWRywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgIGlmIChwbGFjZWhvbGRlcikge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZShwbGFjZWhvbGRlcik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB1cGRhdGVIT0NIb3N0RWwoaW5zdGFuY2UsIHZub2RlLmVsKTtcclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICBwb3BXYXJuaW5nQ29udGV4dCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gb25seSBkZWNyZWFzZSBkZXBzIG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4vY29tcG9uZW50UmVuZGVyQ29udGV4dC50cylcclxuICAgICAgICAgICAgcy5fZCA9IGZhbHNlO1xyXG4gICAgICAgICAgICBvcGVuQmxvY2soKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcyA9IHMoKTtcclxuICAgICAgICBpZiAodHJhY2tCbG9jaykge1xyXG4gICAgICAgICAgICBzLl9kID0gdHJ1ZTtcclxuICAgICAgICAgICAgYmxvY2sgPSBjdXJyZW50QmxvY2s7XHJcbiAgICAgICAgICAgIGNsb3NlQmxvY2soKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBpZiAoaXNBcnJheShzKSkge1xyXG4gICAgICAgIGNvbnN0IHNpbmdsZUNoaWxkID0gZmlsdGVyU2luZ2xlUm9vdChzKTtcclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmICFzaW5nbGVDaGlsZCkge1xyXG4gICAgICAgICAgICB3YXJuKGA8U3VzcGVuc2U+IHNsb3RzIGV4cGVjdCBhIHNpbmdsZSByb290IG5vZGUuYCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHMgPSBzaW5nbGVDaGlsZDtcclxuICAgIH1cclxuICAgIHMgPSBub3JtYWxpemVWTm9kZShzKTtcclxuICAgIGlmIChibG9jayAmJiAhcy5keW5hbWljQ2hpbGRyZW4pIHtcclxuICAgICAgICBzLmR5bmFtaWNDaGlsZHJlbiA9IGJsb2NrLmZpbHRlcihjID0+IGMgIT09IHMpO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIHM7XHJcbn1cclxuZnVuY3Rpb24gcXVldWVFZmZlY3RXaXRoU3VzcGVuc2UoZm4sIHN1c3BlbnNlKSB7XHJcbiAgICBpZiAoc3VzcGVuc2UgJiYgc3VzcGVuc2UucGVuZGluZ0JyYW5jaCkge1xyXG4gICAgICAgIGlmIChpc0FycmF5KGZuKSkge1xyXG4gICAgICAgICAgICBzdXNwZW5zZS5lZm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gICAgICAgICAgY29uc3QgZW50ZXJIb29rcyA9IHJlc29sdmVUcmFuc2l0aW9uSG9va3MoaW5uZXJDaGlsZCwgcmF3UHJvcHMsIHN0YXRlLCBpbnN0YW5jZSk7XHJcbiAgICAgICAgICAgIHNldFRyYW5zaXRpb25Ib29rcyhpbm5lckNoaWxkLCBlbnRlckhvb2tzKTtcclxuICAgICAgICAgICAgY29uc3Qgb2xkQ2hpbGQgPSBpbnN0YW5jZS5zdWJUcmVlO1xyXG4gICAgICAgICAgICBjb25zdCBvbGRJbm5lckNoaWxkID0gb2xkQ2hpbGQgJiYgZ2V0S2VlcEFsaXZlQ2hpbGQob2xkQ2hpbGQpO1xyXG4gICAgICAgICAgICBsZXQgdHJhbnNpdGlvbktleUNoYW5nZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgY29uc3QgeyBnZXRUcmFuc2l0aW9uS2V5IH0gPSBpbm5lckNoaWxkLnR5cGU7XHJcbiAgICAgICAgICAgIGlmIChnZXRUcmFuc2l0aW9uS2V5KSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBnZXRUcmFuc2l0aW9uS2V5KCk7XHJcbiAgICAgICAgICAgICAgICBpZiAocHJldlRyYW5zaXRpb25LZXkgPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHByZXZUcmFuc2l0aW9uS2V5ID0ga2V5O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoa2V5ICE9PSBwcmV2VHJhbnNpdGlvbktleSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHByZXZUcmFuc2l0aW9uS2V5ID0ga2V5O1xyXG4gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25LZXlDaGFuZ2VkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBoYW5kbGUgbW9kZVxyXG4gICAgICAgICAgICBpZiAob2xkSW5uZXJDaGlsZCAmJlxyXG4gICAgICAgICAgICAgICAgb2xkSW5uZXJDaGlsZC50eXBlICE9PSBDb21tZW50ICYmXHJcbiAgICAgICAgICAgICAgICAoIWlzU2FtZVZOb2RlVHlwZShpbm5lckNoaWxkLCBvbGRJbm5lckNoaWxkKSB8fCB0cmFuc2l0aW9uS2V5Q2hhbmdlZCkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGxlYXZpbmdIb29rcyA9IHJlc29sdmVUcmFuc2l0aW9uSG9va3Mob2xkSW5uZXJDaGlsZCwgcmF3UHJvcHMsIHN0YXRlLCBpbnN0YW5jZSk7XHJcbiAgICAgICAgICAgICAgICAvLyB1cGRhdGUgb2xkIHRyZWUncyBob29rcyBpbiBjYXNlIG9mIGR5bmFtaWMgdHJhbnNpdGlvblxyXG4gICAgICAgICAgICAgICAgc2V0VHJhbnNpdGlvbkhvb2tzKG9sZElubmVyQ2hpbGQsIGxlYXZpbmdIb29rcyk7XHJcbiAgICAgICAgICAgICAgICAvLyBzd2l0Y2hpbmcgYmV0d2VlbiBkaWZmZXJlbnQgdmlld3NcclxuICAgICAgICAgICAgICAgIGlmIChtb2RlID09PSAnb3V0LWluJykge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlLmlzTGVhdmluZyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHBsYWNlaG9sZGVyIG5vZGUgYW5kIHF1ZXVlIHVwZGF0ZSB3aGVuIGxlYXZlIGZpbmlzaGVzXHJcbiAgICAgICAgICAgICAgICAgICAgbGVhdmluZ0hvb2tzLmFmdGVyTGVhdmUgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlLmlzTGVhdmluZyA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnN0YW5jZS51cGRhdGUoKTtcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eVBsYWNlaG9sZGVyKGNoaWxkKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1vZGUgPT09ICdpbi1vdXQnICYmIGlubmVyQ2hpbGQudHlwZSAhPT0gQ29tbWVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGxlYXZpbmdIb29rcy5kZWxheUxlYXZlID0gKGVsLCBlYXJseVJlbW92ZSwgZGVsYXllZExlYXZlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGxlYXZpbmdWTm9kZXNDYWNoZSA9IGdldExlYXZpbmdOb2Rlc0ZvclR5cGUoc3RhdGUsIG9sZElubmVyQ2hpbGQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZWF2aW5nVk5vZGVzQ2FjaGVbU3RyaW5nKG9sZElubmVyQ2hpbGQua2V5KV0gPSBvbGRJbm5lckNoaWxkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBlYXJseSByZW1vdmFsIGNhbGxiYWNrXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsLl9sZWF2ZUNiID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWFybHlSZW1vdmUoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLl9sZWF2ZUNiID0gdW5kZWZpbmVkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGVudGVySG9va3MuZGVsYXllZExlYXZlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRlckhvb2tzLmRlbGF5ZWRMZWF2ZSA9IGRlbGF5ZWRMZWF2ZTtcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBjaGlsZDtccl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AgIC8vIGZvciBzYW1lIGVsZW1lbnQgKHYtc2hvdylcclxuICAgICAgICAgICAgaWYgKGVsLl9sZWF2ZUNiKSB7XHJcbiAgICAgICAgICAgICAgICBlbC5fbGVhdmVDYih0cnVlIC8qIGNhbmNlbGxlZCAqLyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gZm9yIHRvZ2dsZWQgZWxlbWVudCB3aXRoIHNhbWUga2V5ICh2LWlmKVxyXG4gICAgICAgICAgICBjb25zdCBsZWF2aW5nVk5vZGUgPSBsZWF2aW5nVk5vZGVzQ2FjaGVba2V5XTtcclxuICAgICAgICAgICAgaWYgKGxlYXZpbmdWTm9kZSAmJlxyXG4gICAgICAgICAgICAgICAgaXNTYW1lVk5vZGVUeXBlKHZub2RlLCBsZWF2aW5nVk5vZGUpICYmXHJcbiAgICAgICAgICAgICAgICBsZWF2aW5nVk5vZGUuZWwuX2xlYXZlQ2IpIHtcclxuICAgICAgICAgICAgICAgIC8vIGZvcmNlIGVhcmx5IHJlbW92YWwgKG5vdCBjYW5jZWxsZWQpXHJcbiAgICAgICAgICAgICAgICBsZWF2aW5nVk5vZGUuZWwuX2xlYXZlQ2IoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjYWxsSG9vayhob29rLCBbZWxdKTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGVudGVyKGVsKSB7XHJcbiAgICAgICAgICAgIGxldCBob29rID0gb25FbnRlcjtcclxuICAgICAgICAgICAgbGV0IGFmdGVySG9vayA9IG9uQWZ0ZXJFbnRlcjtcclxuICAgICAgICAgICAgbGV0IGNhbmNlbEhvb2sgPSBvbkVudGVyQ2FuY2VsbGVkO1xyXG4gICAgICAgICAgICBpZiAoIXN0YXRlLmlzTW91bnRlZCkge1xyXG4gICAgICAgICAgICAgICAgaWYgKGFwcGVhcikge1xyXG4gICAgICAgICAgICAgICAgICAgIGhvb2sgPSBvbkFwcGVhciB8fCBvbkVudGVyO1xyXG4gICAgICAgICAgICAgICAgICAgIGFmdGVySG9vayA9IG9uQWZ0ZXJBcHBlYXIgfHwgb25BZnRlckVudGVyO1xyXG4gICAgICAgICAgICAgICAgICAgIGNhbmNlbEhvb2sgPSBvbkFwcGVhckNhbmNlbGxlZCB8fCBvbkVudGVyQ2FuY2VsbGVkO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGxldCBjYWxsZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgY29uc3QgZG9uZSA9IChlbC5fZW50ZXJDYiA9IChjYW5jZWxsZWQpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChjYWxsZWQpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgY2FsbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIGlmIChjYW5jZWxsZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjYWxsSG9vayhjYW5jZWxIb29rLCBbZWxdKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhbGxIb29rKGFmdGVySG9vaywgW2VsXSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoaG9va3MuZGVsYXllZExlYXZlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaG9va3MuZGVsYXllZExlYXZlKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbC5fZW50ZXJDYiA9IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIGlmIChob29rKSB7XHJcbiAgICAgICAgICAgICAgICBob29rKGVsLCBkb25lKTtcclxuICAgICAgICAgICAgICAgIGlmIChob29rLmxlbmd0aCA8PSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZG9uZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgZG9uZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBsZWF2ZShlbCwgcmVtb3ZlKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGtleSA9IFN0cmluZyh2bm9kZS5rZXkpO1xyXG4gICAgICAgICAgICBpZiAoZWwuX2VudGVyQ2IpIHtcclxuICAgICAgICAgICAgICAgIGVsLl9lbnRlckNiKHRydWUgLyogY2FuY2VsbGVkICovKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoc3RhdGUuaXNVbm1vdW50aW5nKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVtb3ZlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FsbEhvb2sob25CZWZvcmVMZWF2ZSwgW2VsXSk7XHJcbiAgICAgICAgICAgIGxldCBjYWxsZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgY29uc3QgZG9uZSA9IChlbC5fbGVhdmVDYiA9IChjYW5jZWxsZWQpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChjYWxsZWQpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgY2FsbGVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIHJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGNhbmNlbGxlZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhbGxIb29rKG9uTGVhdmVDYW5jZWxsZWQsIFtlbF0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2FsbEhvb2sob25BZnRlckxlYXZlLCBbZWxdKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsLl9sZWF2ZUNiID0gdW5kZWZpbmVkO1xyXG4gICAgICAgICAgICAgICAgaWYgKGxlYXZpbmdWTm9kZXNDYWNoZVtrZXldID09PSB2bm9kZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBsZWF2aW5nVk5vZGVzQ2FjaGVba2V5XTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIGxlYXZpbmdWTm9kZXNDYWNoZVtrZXldID0gdm5vZGU7XHJcbiAgICAgICAgICAgIGlmIChvbkxlYXZlKSB7XHJcbiAgICAgICAgICAgICAgICBvbkxlYXZlKGVsLCBkb25lKTtcclxuICAgICAgICAgICAgICAgIGlmIChvbkxlYXZlLmxlbmd0aCA8PSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZG9uZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgZG9uZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBjbG9uZSh2bm9kZSkge1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzb2x2ZVRyYW5zaXRpb25Ib29rcyh2bm9kZSwgcHJvcHMsIHN0YXRlLCBpbnN0YW5jZSk7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIHJldHVybiBob29rcztcclxufVxyXG4vLyB0aGUgcGxhY2Vob2xkZXIgcmVhbGx5IG9ubHkgaGFuZGxlcyBvbmUgc3BlY2lhbCBjYXNlOiBLZWVwQWxpdmVcclxuLy8gaW4gdGhlIGNhc2Ugb2YgYSBLZWVwQWxpdmUgaW4gYSBsZWF2ZSBwaGFzZSB3ZSBuZW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SA9PiByZXNvbHZlKHJldHJ5KCkpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdXNlckZhaWwgPSAoKSA9PiByZWplY3QoZXJyKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJPbkVycm9yKGVyciwgdXNlclJldHJ5LCB1c2VyRmFpbCwgcmV0cmllcyArIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGVycjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKChjb21wKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXNSZXF1ZXN0ICE9PSBwZW5kaW5nUmVxdWVzdCAmJiBwZW5kaW5nUmVxdWVzdCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGVuZGluZ1JlcXVlc3Q7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgIWNvbXApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgd2FybihgQXN5bmMgY29tcG9uZW50IGxvYWRlciByZXNvbHZlZCB0byB1bmRlZmluZWQuIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYElmIHlvdSBhcmUgdXNpbmcgcmV0cnkoKSwgbWFrZSBzdXJlIHRvIHJldHVybiBpdHMgcmV0dXJuIHZhbHVlLmApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAvLyBpbnRlcm9wIG1vZHVsZSBkZWZhdWx0XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgKGNvbXAuX19lc01vZHVsZSB8fCBjb21wW1N5bWJvbC50b1N0cmluZ1RhZ10gPT09ICdNb2R1bGUnKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wID0gY29tcC5kZWZhdWx0O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGNvbXAgJiYgIWlzT2JqZWN0KGNvbXApICYmICFpc0Z1bmN0aW9uKGNvbXApKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBhc3luYyBjb21wb25lbnQgbG9hZCByZXN1bHQ6ICR7Y29tcH1gKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZWRDb21wID0gY29tcDtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29tcDtcclxuICAgICAgICAgICAgICAgIH0pKSk7XHJcbiAgICB9O1xyXG4gICAgcmV0dXJuIGRlZmluZUNvbXBvbmVudCh7XHJcbiAgICAgICAgbmFtZTogJ0FzeW5jQ29tcG9uZW50V3JhcHBlcicsXHJcbiAgICAgICAgX19hc3luY0xvYWRlcjogbG9hZCxcclxuICAgICAgICBnZXQgX19hc3luY1Jlc29sdmVkKCkge1xyXG4gICAgICAgICAgICByZXR1cm4gcmVzb2x2ZWRDb21wO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgc2V0dXAoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGluc3RhbmNlID0gY3VycmVudEluc3RhbmNlO1xyXG4gICAgICAgICAgICAvLyBhbHJlYWR5IHJlc29sdmVkXHJcbiAgICAgICAgICAgIGlmIChyZXNvbHZlZENvbXApIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiAoKSA9PiBjcmVhdGVJbm5lckNvbXAocmVzb2x2ZWRDb21wLCBpbnN0YW5jZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3Qgb25FcnJvciA9IChlcnIpID0+IHtcclxuICAgICAgICAgICAgICAgIHBlbmRpbmdSZXF1ZXN0ID0gbnVsbDtcclxuICAgICAgICAgICAgICAgIGhhbmRsZUVycm9yKGVyciwgaW5zdGFuY2UsIDEzIC8qIEFTWU5DX0NPTVBPTkVOVF9MT0FERVIgKi8sICFlcnJvckNvbXBvbmVudCAvKiBkbyBub3QgdGhyb3cgaW4gZGV2IGlmIHVzZXIgcHJvdmlkZWQgZXJyb3IgY29tcG9uZW50ICovKTtcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgLy8gc3VzcGVuc2UtY29udHJvbGxlZCBvciBTU1IuXHJcbiAgICAgICAgICAgIGlmICgoc3VzcGVuc2libGUgJiYgaW5zdGFuY2Uuc3VzcGVuc2UpIHx8XHJcbiAgICAgICAgICAgICAgICAoaXNJblNTUkNvbXBvbmVudFNldHVwKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGxvYWQoKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKGNvbXAgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAoKSA9PiBjcmVhdGVJbm5lckNvbXAoY29tcCwgaW5zdGFuY2UpO1xyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZXJyID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBvbkVycm9yKGVycik7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgpID0+IGVycm9yQ29tcG9uZW50XHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gY3JlYXRlVk5vZGUoZXJyb3JDb21wb25lbnQsIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yOiBlcnJcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsO1xyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgbG9hZGVkID0gcmVmKGZhbHNlKTtcclxuICAgICAgICAgICAgY29uc3QgZXJyb3IgPSByZWYoKTtcclxuICAgICAgICAgICAgY29uc3QgZGVsYXllZCA9IHJlZighIWRlbGF5KTtcclxuICAgICAgICAgICAgaWYgKGRlbGF5KSB7XHJcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBkZWxheWVkLnZhbHVlID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICB9LCBkZWxheSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKHRpbWVvdXQgIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFsb2FkZWQudmFsdWUgJiYgIWVycm9yLnZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGVyciA9IG5ldyBFcnJvcihgQXN5bmMgY29tcG9uZW50IHRpbWVkIG91dCBhZnRlciAke3RpbWVvdXR9bXMuYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uRXJyb3IoZXJyKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IudmFsdWUgPSBlcnI7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSwgdGltZW91dCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgbG9hZCgpXHJcbiAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBsb2FkZWQudmFsdWUgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGluc3RhbmNlLnBhcmVudCAmJiBpc0tlZXBBbGl2ZShpbnN0YW5jZS5wYXJlbnQudm5vZGUpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gcGFyZW50IGlzIGtlZXAtYWxpdmUsIGZvcmNlIHVwZGF0ZSBzbyB0aGUgbG9hZGVkIGNvbXBvbmVudCdzXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbmFtZSBpcyB0YWtlbiBpbnRvIGFjY291bnRcclxuICAgICAgICAgICAgICAgICAgICBxdWV1ZUpvYihpbnN0YW5jZS5wYXJlbnQudXBkYXRlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIC5jYXRjaChlcnIgPT4ge1xyXG4gICAgICAgICAgICAgICAgb25FcnJvcihlcnIpO1xyXG4gICAgICAgICAgICAgICAgZXJyb3IudmFsdWUgPSBlcnI7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICByZXR1cm4gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaWYgKGxvYWRlZC52YWx1ZSAmJiByZXNvbHZlZENvbXApIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3JlYXRlSW5uZXJDb21wKHJlc29sdmVkQ29tcCwgaW5zdGFuY2UpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoZXJyb3IudmFsdWUgJiYgZXJyb3JDb21wb25lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3JlYXRlVk5vZGUoZXJyb3JDb21wb25lbnQsIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3I6IGVycm9yLnZhbHVlXHJcbiAgICAgICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChsb2FkaW5nQ29tcG9uZW50ICYmICFkZWxheWVkLnZhbHVl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zLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZlY3QoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgaW5zdGFuY2UuaXNEZWFjdGl2YXRlZCA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGluc3RhbmNlLmEpIHtcclxuICAgICAgICAgICAgICAgICAgICBpbnZva2VBcnJheUZucyhpbnN0YW5jZS5hKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IHZub2RlSG9vayA9IHZub2RlLnByb3BzICYmIHZub2RlLnByb3BzLm9uVm5vZGVNb3VudGVkO1xyXG4gICAgICAgICAgICAgICAgaWYgKHZub2RlSG9vaykge1xyXG4gICAgICAgICAgICAgICAgICAgIGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIGluc3RhbmNlLnBhcmVudCwgdm5vZGUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBVcGRhdGUgY29tcG9uZW50cyB0cmVlXHJcbiAgICAgICAgICAgICAgICBkZXZ0b29sc0NvbXBvbmVudEFkZGVkKGluc3RhbmNlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH07XHJcbiAgICAgICAgc2hhcmVkQ29udGV4dC5kZWFjdGl2YXRlID0gKHZub2RlKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IGluc3RhbmNlID0gdm5vZGUuY29tcG9uZW50O1xyXG4gICAgICAgICAgICBtb3ZlKHZub2RlLCBzdG9yYWdlQ29udGFpbmVyLCBudWxsLCAxIC8qIExFQVZFICovLCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdCgoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaW5zdGFuY2UuZGEpIHtcclxuICAgICAgICAgICAgICAgICAgICBpbnZva2VBcnJheUZucyhpbnN0YW5jZS5kYSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCB2bm9kZUhvb2sgPSB2bm9kZS5wcm9wcyAmJiB2bm9kZS5wcm9wcy5vblZub2RlVW5tb3VudGVkO1xyXG4gICAgICAgICAgICAgICAgaWYgKHZub2RlSG9vaykge1xyXG4gICAgICAgICAgICAgICAgICAgIGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIGluc3RhbmNlLnBhcmVudCwgdm5vZGUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaW5zdGFuY2UuaXNEZWFjdGl2YXRlZCA9IHRydWU7XHJcbiAgICAgICAgICAgIH0sIHBhcmVudFN1c3BlbnNlKTtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB8fCBfX1ZVRV9QUk9EX0RFVlRPT0xTX18pIHtcclxuICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBjb21wb25lbnRzIHRyZWVcclxuICAgICAgICAgICAgICAgIGRldnRvb2xzQ29tcG9uZW50QWRkZWQoaW5zdGFuY2UpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgICAgICBmdW5jdGlvbiB1bm1vdW50KHZub2RlKSB7XHJcbiAgICAgICAgICAgIC8vIHJlc2V0IHRoZSBzaGFwZUZsYWcgc28gaXQgY2FuIGJlIHByb3Blcmx5IHVubW91bnRlZFxyXG4gICAgICAgICAgICByZXNldFNoYXBlRmxhZyh2bm9kZSk7XHJcbiAgICAgICAgICAgIF91bm1vdW50KHZub2RlLCBpbnN0YW5jZSwgcGFyZW50U3VzcGVuc2UpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmdW5jdGlvbiBwcnVuZUNhY2hlKGZpbHRlcikge1xyXG4gICAgICAgICAgICBjYWNoZS5mb3JFYWNoKCh2bm9kZSwga2V5KSA9PiB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBuYW1lID0gZ2V0Q29tcG9uZW50TmFtZSh2bm9kZS50eXBlKTtcclxuICAgICAgICAgICAgICAgIGlmIChuYW1lICYmICghZmlsdGVyIHx8ICFmaWx0ZXIobmFtZSkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJ1bmVDYWNoZUVudHJ5KGtleSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBmdW5jdGlvbiBwcnVuZUNhY2hlRW50cnkoa2V5KSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGNhY2hlZCA9IGNhY2hlLmdldChrZXkpO1xyXG4gICAgICAgICAgICBpZiAoIWN1cnJlbnQgfHwgY2FjaGVkLnR5cGUgIT09IGN1cnJlbnQudHlwZSkge1xyXG4gICAgICAgICAgICAgICAgdW5tb3VudChjYWNoZWQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGN1cnJlbnQpIHtcclxuICAgICAgICAgICAgICAgIC8vIGN1cnJlbnQgYWN0aXZlIGluc3RhbmNlIHNob3VsZCBubyBsb25nZXIgYmUga2VwdC1hbGl2ZS5cclxuICAgICAgICAgICAgICAgIC8vIHdlIGNhbid0IHVubW91bnQgaXQgbm93IGJ1dCBpdCBtaWdodCBiZSBsYXRlciwgc28gcmVzZXQgaXRzIGZsYWcgbm93LlxyXG4gICAgICAgICAgICAgICAgcmVzZXRTaGFwZUZsYWcoY3VycmVudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY2FjaGUuZGVsZXRlKGtleSk7XHJcbiAgICAgIC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VcGRhdGVkKGNhY2hlU3VidHJlZSk7XHJcbiAgICAgICAgb25CZWZvcmVVbm1vdW50KCgpID0+IHtcclxuICAgICAgICAgICAgY2FjaGUuZm9yRWFjaChjYWNoZWQgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeyBzdWJUcmVlLCBzdXNwZW5zZSB9ID0gaW5zdGFuY2U7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB2bm9kZSA9IGdldElubmVyQ2hpbGQoc3ViVHJlZSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY2FjaGVkLnR5cGUgPT09IHZub2RlLnR5cGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBjdXJyZW50IGluc3RhbmNlIHdpbGwgYmUgdW5tb3VudGVkIGFzIHBhcnQgb2Yga2VlcC1hbGl2ZSdzIHVubW91bnRcclxuICAgICAgICAgICAgICAgICAgICByZXNldFNoYXBlRmxhZyh2bm9kZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gYnV0IGludm9rZSBpdHMgZGVhY3RpdmF0ZWQgaG9vayBoZXJlXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGEgPSB2bm9kZS5jb21wb25lbnQuZGE7XHJcbiAgICAgICAgICAgICAgICAgICAgZGEgJiYgcXVldWVQb3N0UmVuZGVyRWZmZWN0KGRhLCBzdXNwZW5zZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdW5tb3VudChjYWNoZWQpO1xyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gKCkgPT4ge1xyXG4gICAgICAgICAgICBwZW5kaW5nQ2FjaGVLZXkgPSBudWxsO1xyXG4gICAgICAgICAgICBpZiAoIXNsb3RzLmRlZmF1bHQpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IGNoaWxkcmVuID0gc2xvdHMuZGVmYXVsdCgpO1xyXG4gICAgICAgICAgICBjb25zdCByYXdWTm9kZSA9IGNoaWxkcmVuWzBdO1xyXG4gICAgICAgICAgICBpZiAoY2hpbGRyZW4ubGVuZ3RoID4gMSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYEtlZXBBbGl2ZSBzaG91bGQgY29udGFpbiBleGFjdGx5IG9uZSBjb21wb25lbnQgY2hpbGQuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gbnVsbDtcclxuICAgICAgICAgICAgICAgIHJldHVybiBjaGlsZHJlbjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICghaXNWTm9kZShyYXdWTm9kZSkgfHxcclxuICAgICAgICAgICAgICAgICghKHJhd1ZOb2RlLnNoYXBlRmxhZyAmIDQgLyogU1RBVEVGVUxfQ09NUE9ORU5UICovKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgICEocmF3Vk5vZGUuc2hhcGVGbGFnICYgMTI4IC8qIFNVU1BFTlNFICovKSkpIHtcclxuICAgICAgICAgICAgICAgIGN1cnJlbnQgPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhd1ZOb2RlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGxldCB2bm9kZSA9IGdldElubmVyQ2hpbGQocmF3Vk5vZGUpO1xyXG4gICAgICAgICAgICBjb25zdCBjb21wID0gdm5vZGUudHlwZTtcclxuICAgICAgICAgICAgLy8gZm9yIGFzeW5jIGNvbXBvbmVudHMsIG5hbWUgY2hlY2sgc2hvdWxkIGJlIGJhc2VkIGluIGl0cyBsb2FkZWRcclxuICAgICAgICAgICAgLy8gaW5uZXIgY29tcG9uZW50IGlmIGF2YWlsYWJsZVxyXG4gICAgICAgICAgICBjb25zdCBuYW1lID0gZ2V0Q29tcG9uZW50TmFtZShpc0FzeW5jV3JhcHBlcih2bm9kZSlcclxuICAgICAgICAgICAgICAgID8gdm5vZGUudHlwZS5fX2FzeW5jUmVzb2x2ZWQgfHwge31cclxuICAgICAgICAgICAgICAgIDogY29tcCk7XHJcbiAgICAgICAgICAgIGNvbnN0IHsgaW5jbHVkZSwgZXhjbHVkZSwgbWF4IH0gPSBwcm9wcztcclxuICAgICAgICAgICAgaWYgKChpbmNsdWRlICYmICghbmFtZSB8fCAhbWF0Y2hlcyhpbmNsdWRlLCBuYW1lKSkpIHx8XHJcbiAgICAgICAgICAgICAgICAoZXhjbHVkZSAmJiBuYW1lICYmIG1hdGNoZXMoZXhjbHVkZSwgbmFtZSkpKSB7XHJcbiAgICAgICAgICAgICAgICBjdXJyZW50ID0gdm5vZGU7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcmF3Vk5vZGU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3Qga2V5ID0gdm5vZGUua2V5ID09IG51bGwgPyBjb21wIDogdm5vZGUua2V5O1xyXG4gICAgICAgICAgICBjb25zdCBjYWNoZWRWTm9kZSA9IGNhY2hlLmdldChrZXkpO1xyXG4gICAgICAgICAgICAvLyBjbG9uZSB2bm9kZSBpZiBpdCdzIHJldXNlZCBiZWNhdXNlIHdlIGFyZSBnb2luZyB0byBtdXRhdGUgaXRcclxuICAgICAgICAgICAgaWYgKHZub2RlLmVsKSB7XHJcbiAgICAgICAgICAgICAgICB2bm9kZSA9IGNsb25lVk5vZGUodm5vZGUpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHJhd1ZOb2RlLnNoYXBlRmxhZyAmIDEyOCAvKiBTVVNQRU5TRSAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJhd1ZOb2RlLnNzQ29udGVudCA9IHZub2RlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vICMxNTEzIGl0J3MgcG9zc2libGUgZm9yIHRoZSByZXR1cm5lZCB2bm9kZSB0byBiZSBjbG9uZWQgZHVlIHRvIGF0dHJcclxuICAgICAgICAgICAgLy8gZmFsbHRocm91Z2ggb3Igc2NvcGVJZCwgc28gdGhlIHZub2RlIGhlcmUgbWF5IG5vdCBiZSB0aGUgZmluYWwgdm5vZGVcclxuICAgICAgICAgICAgLy8gdGhhdCBpcyBtb3VudGVkLiBJbnN0ZWFkIG9mIGNhY2hpbmcgaXQgZGlyZWN0bHksIHdlIHN0b3JlIHRoZSBwZW5kaW5nXHJcbiAgICAgICAgICAgIC8vIGtleSBhbmQgY2FjaGUgYGluc3RhbmNlLnN1YlRyZWVgICh0aGUgbm9ybWFsaXplZCB2bm9kZSkgaW5cclxuICAgICAgICAgICAgLy8gYmVmb3JlTW91bnQvYmVmb3JlVXBkYXRlIGhvb2tzLlxyXG4gICAgICAgICAgICBwZW5kaW5nQ2FjaGVLZXkgPSBrZXk7XHJcbiAgICAgICAgICAgIGlmIChjYWNoZWRWTm9kZSkge1xyXG4gICAgICAgICAgICAgICAgLy8gY29weSBvdmVyIG1vdW50ZWQgc3RhdGVcclxuICAgICAgICAgICAgICAgIHZub2RlLmVsID0gY2FjaGVkVk5vZGUuZWw7XHJcbiAgICAgICAgICAgICAgICB2bm9kZS5jb21wb25lbnQgPSBjYWNoZWRWTm9kZS5jb21wb25lbnQ7XHJcbiAgICAgICAgICAgICAgICBpZiAodm5vZGUudHJhbnNpdGlvbikge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHJlY3Vyc2l2ZWx5IHVwZGF0ZSB0cmFuc2l0aW9uIGhvb2tzIG9uIHN1YlRyZWVcclxuICAgICAgICAgICAgICAgICAgICBzZXRUcmFuc2l0aW9uSG9va3Modm5vZGUsIHZub2RlLnRyYW5zaXRpb24pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gYXZvaWQgdm5vZGUgYmVpbmcgbW91bnRlZCBhcyBmcmVzaFxyXG4gICAgICAgICAgICAgICAgdm5vZGUuc2hhcGVGbGFnIHw9IDUxMiAvKiBDT01QT05FTlRfS0VQVF9BTElWRSAqLztcclxuICAgICAgICAgICAgICAgIC8vIG1ha2UgdGhpcyBrZXkgdGhlIGZyZXNoZXN0XHJcbiAgICAgICAgICAgICAgICBrZXlzLmRlbGV0ZShrZXkpO1xyXG4gICAgICAgICAgICAgICAga2V5cy5hZGQoa2V5KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGtleXMuYWRkKGtleSk7XHJcbiAgICAgICAgICAgICAgICAvLyBwcnVuZSBvbGRlc3QgZW50cnlcclxuICAgICAgICAgICAgICAgIGlmIChtYXggJiYga2V5cy5zaXplID4gcGFyc2VJbnQobWF4LCAxMCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBwcnVuZUNhY2hlRW50cnkoa2V5cy52YWx1ZXMoKS5uZXh0KCkudmFsdWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGF2b2lkIHZub2RlIGJlaW5nIHVubW91bnRlZFxyXG4gICAgICAgICAgICB2bm9kZS5zaGFwZUZsYWcgfD0gMjU2IC8qIENPTVBPTkVOVF9TSE9VTERfS0VFUF9BTElWRSAqLztcclxuICAgICAgICAgICAgY3VycmVudCA9IHZub2RlO1xyXG4gICAgICAgICAgICByZXR1cm4gcmF3Vk5vZGU7XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxufTtcclxuLy8gZXhwb3J0IHRoZSBwdWJsaWMgdHlwZSBmb3IgaC90c3ggaW5mZXJlbmNlXHJcbi8vIGFsc28gdG8gYXZvaWQgaW5saW5lIGltcG9ydCgpIGluIGdlbmVyYXRlZCBkLnRzIGZpbGVzXHJcbmNv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ICAgY29uc3Qgd3JhcHBlZEhvb2sgPSBob29rLl9fd2VoIHx8XHJcbiAgICAgICAgICAgIChob29rLl9fd2VoID0gKC4uLmFyZ3MpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmICh0YXJnZXQuaXNVbm1vdW50ZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBkaXNhYmxlIHRyYWNraW5nIGluc2lkZSBhbGwgbGlmZWN5Y2xlIGhvb2tzXHJcbiAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aGV5IGNhbiBwb3RlbnRpYWxseSBiZSBjYWxsZWQgaW5zaWRlIGVmZmVjdHMuXHJcbiAgICAgICAgICAgICAgICBwYXVzZVRyYWNraW5nKCk7XHJcbiAgICAgICAgICAgICAgICAvLyBTZXQgY3VycmVudEluc3RhbmNlIGR1cmluZyBob29rIGludm9jYXRpb24uXHJcbiAgICAgICAgICAgICAgICAvLyBUaGlzIGFzc3VtZXMgdGhlIGhvb2sgZG9lcyBub3Qgc3luY2hyb25vdXNseSB0cmlnZ2VyIG90aGVyIGhvb2tzLCB3aGljaFxyXG4gICAgICAgICAgICAgICAgLy8gY2FuIG9ubHkgYmUgZmFsc2Ugd2hlbiB0aGUgdXNlciBkb2VzIHNvbWV0aGluZyByZWFsbHkgZnVua3kuXHJcbiAgICAgICAgICAgICAgICBzZXRDdXJyZW50SW5zdGFuY2UodGFyZ2V0KTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHJlcyA9IGNhbGxXaXRoQXN5bmNFcnJvckhhbmRsaW5nKGhvb2ssIHRhcmdldCwgdHlwZSwgYXJncyk7XHJcbiAgICAgICAgICAgICAgICB1bnNldEN1cnJlbnRJbnN0YW5jZSgpO1xyXG4gICAgICAgICAgICAgICAgcmVzZXRUcmFja2luZygpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcztcclxuICAgICAgICAgICAgfSk7X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ICAgIGNvbnN0IG1ldGhvZEhhbmRsZXIgPSBtZXRob2RzW2tleV07XHJcbiAgICAgICAgICAgIGlmIChpc0Z1bmN0aW9uKG1ldGhvZEhhbmRsZXIpKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBJbiBkZXYgbW9kZSwgd2UgdXNlIHRoZSBgY3JlYXRlUmVuZGVyQ29udGV4dGAgZnVuY3Rpb24gdG8gZGVmaW5lXHJcbiAgICAgICAgICAgICAgICAvLyBtZXRob2RzIHRvIHRoZSBwcm94eSB0YXJnZXQsIGFuZCB0aG9zZSBhcmUgcmVhZC1vbmx5IGJ1dFxyXG4gICAgICAgICAgICAgICAgLy8gcmVjb25maWd1cmFibGUsIHNvIGl0IG5lZWRzIHRvIGJlIHJlZGVmaW5lZCBoZXJlXHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGN0eCwga2V5LCB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBtZXRob2RIYW5kbGVyLmJpbmQocHVibGljVGhpcyksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGFibGU6IHRydWVcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGN0eFtrZXldID0gbWV0aG9kSGFuZGxlci5iaW5kKHB1YmxpY1RoaXMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3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pIHJldHVybmVkIGEgUHJvbWlzZSAtIG5vdGUgZGF0YSgpIGNhbm5vdCBiZSBhc3luYzsgSWYgeW91IGAgK1xyXG4gICAgICAgICAgICAgICAgYGludGVuZCB0byBwZXJmb3JtIGRhdGEgZmV0Y2hpbmcgYmVmb3JlIGNvbXBvbmVudCByZW5kZXJzLCB1c2UgYCArXHJcbiAgICAgICAgICAgICAgICBgYXN5bmMgc2V0dXAoKSArIDxTdXNwZW5zZT4uYCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghaXNPYmplY3QoZGF0YSkpIHtcclxuICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIHdhcm4oYGRhdGEoKSBzaG91bGQgcmV0dXJuIGFuIG9iamVjdC5gKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGluc3RhbmNlLmRhdGEgPSByZWFjdGl2ZShkYXRhKTtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gZGF0YSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNoZWNrRHVwbGljYXRlUHJvcGVydGllcyhcIkRhdGFcIiAvKiBEQVRBICovLCBrZXkpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGV4cG9zZSBkYXRhIG9uIGN0eCBkdXJpbmcgZGV2XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleVswXSAhPT0gJyQnICYmIGtleVswXSAhPT0gJ18nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjdHgsIGtleSwge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdldDogKCkgPT4gZGF0YVtrZXldLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0OiBOT09QXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIC8vIHN0YXRlIGluaXRpYWxpemF0aW9uIGNvbXBsZXRlIGF0IHRoaXMgcG9pbnQgLSBzdGFydCBjYWNoaW5nIGFjY2Vzc1xyXG4gICAgc2hvdWxkQ2FjaGVBY2Nlc3MgPSB0cnVlO1xyXG4gICAgaWYgKGNvbXB1dGVkT3B0aW9ucykge1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIGNvbXB1dGVkT3B0aW9ucykge1xyXG4gICAgICAgICAgICBjb25zdCBvcHQgPSBjb21wdXRlZE9wdGlvbnNba2V5XTtcclxuICAgICAgICAgICAgY29uc3QgZ2V0ID0gaXNGdW5jdGlvbihvcHQpXHJcbiAgICAgICAgICAgICAgICA/IG9wdC5iaW5kKHB1YmxpY1RoaXMsIHB1YmxpY1RoaXMpXHJcbiAgICAgICAgICAgICAgICA6IGlzRnVuY3Rpb24ob3B0LmdldClcclxuICAgICAgICAgICAgICAgICAgICA/IG9wdC5nZXQuYmluZChwdWJsaWNUaGlzLCBwdWJsaWNUaGlzKVxyXG4gICAgICAgICAgICAgICAgICAgIDogTk9PUDtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiBnZXQgPT09IE5PT1ApIHtcclxuICAgICAgICAgICAgICAgIHdhcm4oYENvbXB1dGVkIHByb3BlcnR5IFwiJHtrZXl9XCIgaGFzIG5vIGdldHRlci5gKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCBzZXQgPSAhaXNGdW5jdGlvbihvcHQpICYmIGlzRnVuY3Rpb24ob3B0LnNldClcclxuICAgICAgICAgICAgICAgID8gb3B0LnNldC5iaW5kKHB1YmxpY1RoaXMpXHJcbiAgICAgICAgICAgICAgICA6IChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKVxyXG4gICAgICAgICAgICAgICAgICAgID8gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3YXJuKGBXcml0ZSBvcGVyYXRpb24gZmFpbGVkOiBjb21wdXRlZCBwcm9wZXJ0eSBcIiR7a2V5fVwiIGlzIHJlYWRvbmx5LmApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICA6IE5PT1A7XHJcbiAgICAgICAgICAgIGNvbnN0IGMgPSBjb21wdXRlZCh7XHJcbiAgICAgICAgICAgICAgICBnZXQsXHJcbiAgICAgICAgICAgICAgICBzZXRcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShjdHgsIGtleSwge1xyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgIGdldDogKCkgPT4gYy52YWx1ZSxcclxuICAgICAgICAgICAgICAgIHNldDogdiA9PiAoYy52YWx1ZSA9IHYpXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICBjaGVja0R1cGxpY2F0ZVByb3BlcnRpZXMoXCJDb21wdXRlZFwiIC8qIENPTVBVVEVEICovLCBrZXkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKHdhdGNoT3B0aW9ucykge1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIHdhdGNoT3B0aW9ucykge1xyXG4gICAgICAgICAgICBjcmVhdGVXYXRjaGVyKHdhdGNoT3B0aW9uc1trZXldLCBjdHgsIHB1YmxpY1RoaXMsIGtleSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKHByb3ZpZGVPcHRpb25zKSB7XHJcbiAgICAgICAgY29uc3QgcHJvdmlkZXMgPSBpc0Z1bmN0aW9uKHByb3ZpZGVPcHRpb25zKVxyXG4gICAgICAgICAgICA/IHByb3ZpZGVPcHRpb25zLmNhbGwocHVibGljVGhpcylcclxuICAgICAgICAgICAgOiBwcm92aWRlT3B0aW9ucztcclxuICAgICAgICBSZWZsZWN0Lm93bktleXMocHJvdmlkZXMpLmZvckVhY2goa2V5ID0+IHtcclxuICAgICAgICAgICAgcHJvdmlkZShrZXksIHByb3ZpZGVzW2tleV0pO1xyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgaWYgKGNyZWF0ZWQpIHtcclxuICAgICAgICBjYWxsSG9vayhjcmVhdGVkLCBpbnN0YW5jZSwgXCJjXCIgLyogQ1JFQVRFRCAqLyk7XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiByZWdpc3RlckxpZmVjeWNsZUhvb2socmVnaXN0ZXIsIGhvb2spIHtcclxuICAgICAgICBpZiAoaXNBcnJheShob29rKSkge1xyXG4gICAgICAgICAgICBob29rLmZvckVhY2goX2hvb2sgPT4gcmVnaXN0ZXIoX2hvb2suYmluZChwdWJsaWNUaGlzKSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChob29rKSB7XHJcbiAgICAgICAgICAgIHJlZ2lzdGVyKGhvb2suYmluZChwdWJsaWNUaGlzKSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmVnaXN0ZXJMaWZlY3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NlZCA9IHt9KTtcclxuICAgICAgICAgICAgZXhwb3NlLmZvckVhY2goa2V5ID0+IHtcclxuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShleHBvc2VkLCBrZXksIHtcclxuICAgICAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IHB1YmxpY1RoaXNba2V5XSxcclxuICAgICAgICAgICAgICAgICAgICBzZXQ6IHZhbCA9PiAocHVibGljVGhpc1trZXldID0gdmFsKVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICghaW5zdGFuY2UuZXhwb3NlZCkge1xyXG4gICAgICAgICAgICBpbnN0YW5jZS5leHBvc2VkID0ge307XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgLy8gb3B0aW9ucyB0aGF0IGFyZSBoYW5kbGVkIHdoZW4gY3JlYXRpbmcgdGhlIGluc3RhbmNlIGJ1dCBhbHNvIG5lZWQgdG8gYmVcclxuICAgIC8vIGFwcGxpZWQgZnJvbSBtaXhpbnNcclxuICAgIGlmIChyZW5kZXIgJiYgaW5zdGFuY2UucmVuZGVyID09PSBOT09QKSB7XHJcbiAgICAgICAgaW5zdGFuY2UucmVuZGVyID0gcmVuZGVyO1xyXG4gICAgfVxyXG4gICAgaWYgKGluaGVyaXRBdHRycyAhPSBudWxsKSB7XHJcbiAgICAgICAgaW5zdGFuY2UuaW5oZXJpdEF0dHJzID0gaW5oZXJpdEF0dHJzO1xyXG4gICAgfVxyXG4gICAgLy8gYXNzZXQgb3B0aW9ucy5cclxuICAgIGlmIChjb21wb25lbnRzKVxyXG4gICAgICAgIGluc3RhbmNlLmNvbXBvbmVudHMgPSBjb21wb25lbnRzO1xyXG4gICAgaWYgKGRpcmVjdGl2ZXMpXHJcbiAgICAgICAgaW5zdGFuY2UuZGlyZWN0aXZlcyA9IGRpcmVjdGl2ZXM7XHJcbn1cclxuZnVuY3Rpb24gcmVzb2x2ZUluamVjdGlvbnMoaW5qZWN0T3B0aW9ucywgY3R4LCBjaGVja0R1cGxpY2F0ZVByb3BlcnRpZXMgPSBOT09QLCB1bndyYXBSZWYgPSBmYWxzZSkge1xyXG4gICAgaWYgKGlzQXJyYXkoaW5qZWN0T3B0aW9ucykpIHtcclxuICAgICAgICBpbmplY3RPcHRpb25zID0gbm9ybWFsaXplSW5qZWN0KGluamVjdE9wdGlvbnMpO1xyXG4gICAgfVxyXG4gICAgZm9yIChjb25zdCBrZXkgaW4gaW5qZWN0T3B0aW9ucykge1xyXG4gICAgICAgIGNvbnN0IG9wdCA9IGluamVjdE9wdGlvbnNba2V5XTtcclxuICAgICAgICBsZXQgaW5qZWN0ZWQ7XHJcbiAgICAgICAgaWYgKGlzT2JqZWN0KG9wdCkpIHtcclxuICAgICAgICAgICAgaWYgKCdkZWZhdWx0JyBpbiBvcHQpIHtcclxuICAgICAgICAgICAgICAgIGluamVjdGVkID0gaW5qZWN0KG9wdC5mcm9tIHx8IGtleSwgb3B0LmRlZmF1bHQsIHRydWUgLyogdHJlYXQgZGVmYXVsdCBmdW5jdGlvbiBhcyBmYWN0b3J5ICovKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGluamVjdGVkID0gaW5qZWN0KG9wdC5mcm9tIHx8IGtleSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGluamVjdGVkID0gaW5qZWN0KG9wdCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChpc1JlZihpbmplY3RlZCkpIHtcclxuICAgICAgICAgICAgLy8gVE9ETyByZW1vdmUgdGhlIGNoZWNrIGluIDMuM1xyXG4gICAgICAgICAgICBpZiAodW53cmFwUmVmKSB7XHJcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoY3R4LCBrZXksIHtcclxuICAgICAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IGluamVjdGVkLnZhbHVlLFxyXG4gICAgICAgICAgICAgICAgICAgIHNldDogdiA9PiAoaW5qZWN0ZWQudmFsdWUgPSB2KVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihgaW5qZWN0ZWQgcHJvcGVydHkgXCIke2tleX1cIiBpcyBhIHJlZiBhbmQgd2lsbCBiZSBhdXRvLXVud3JhcHBlZCBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYGFuZCBubyBsb25nZXIgbmVlZHMgXFxgLnZhbHVlXFxgIGluIHRoZSBuZXh0IG1pbm9yIHJlbGVhc2UuIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgVG8gb3B0LWluIHRvIHRoZSBuZXcgYmVoYXZpb3Igbm93LCBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHNldCBcXGBhcHAuY29uZmlnLnVud3JhcEluamVjdGVkUmVmID0gdHJ1ZVxcYCAodGhpcyBjb25maWcgaXMgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGB0ZW1wb3JhcnkgYW5kIHdpbGwgbm90IGJlIG5lZWRlZCBpbiB0aGUgZnV0dXJlLilgKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGN0eFtrZXldID0gaW5qZWN0ZWQ7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAg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GxlciBzcGVjaWZpZWQgYnkga2V5IFwiJHtyYXd9XCJgLCBoYW5kbGVyKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBlbHNlIGlmIChpc0Z1bmN0aW9uKHJhdykpIHtcclxuICAgICAgICB3YXRjaChnZXR0ZXIsIHJhdy5iaW5kKHB1YmxpY1RoaXMpKTtcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzT2JqZWN0KHJhdykpIHtcclxuICAgICAgICBpZiAoaXNBcnJheShyYXcpKSB7XHJcbiAgICAgICAgICAgIHJhdy5mb3JFYWNoKHIgPT4gY3JlYXRlV2F0Y2hlcihyLCBjdHgsIHB1YmxpY1RoaXMsIGtleSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgaGFuZGxlciA9IGlzRnVuY3Rpb24ocmF3LmhhbmRsZXIpXHJcbiAgICAgICAgICAgICAgICA/IHJhdy5oYW5kbGVyLmJpbmQocHVibGljVGhpcylcclxuICAgICAgICAgICAgICAgIDogY3R4W3Jhdy5oYW5kbGVyXTtcclxuICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24oaGFuZGxlcikpIHtcclxuICAgICAgICAgICAgICAgIHdhdGNoKGdldHRlciwgaGFuZGxlciwgcmF3KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgIHdhcm4oYEludmFsaWQgd2F0Y2ggaGFuZGxlciBzcGVjaWZpZWQgYnkga2V5IFwiJHtyYXcuaGFuZGxlcn1cImAsIGhhbmRsZXIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAg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kgJiZcclxuICAgICAgICAob3B0aW1pemVkIHx8IHBhdGNoRmxhZyA+IDApICYmXHJcbiAgICAgICAgIShwYXRjaEZsYWcgJiAxNiAvKiBGVUxMX1BST1BTICovKSkge1xyXG4gICAgICAgIGlmIChwYXRjaEZsYWcgJiA4IC8qIFBST1BTICovKSB7XHJcbiAgICAgICAgICAgIC8vIENvbXBpbGVyLWdlbmVyYXRlZCBwcm9wcyAmIG5vIGtleXMgY2hhbmdlLCBqdXN0IHNldCB0aGUgdXBkYXRlZFxyXG4gICAgICAgICAgICAvLyB0aGUgcHJvcHMuXHJcbiAgICAgICAgICAgIGNvbnN0IHByb3BzVG9VcGRhdGUgPSBpbnN0YW5jZS52bm9kZS5keW5hbWljUHJvcHM7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcHJvcHNUb1VwZGF0ZS5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IHByb3BzVG9VcGRhdGVbaV07XHJcbiAgICAgICAgICAgICAgICAvLyBQUk9QUyBmbGFnIGd1YXJhbnRlZXMgcmF3UHJvcHMgdG8gYmUgbm9uLW51bGxcclxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcmF3UHJvcHNba2V5XTtcclxuICAgICAgICAgICAgICAgIGlmIChvcHRpb25zKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gYXR0ciAvIHByb3BzIHNlcGFyYXRpb24gd2FzIGRvbmUgb24gaW5pdCBhbmQgd2lsbCBiZSBjb25zaXN0ZW50XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhpcyBjb2RlIHBhdGgsIHNvIGp1c3QgY2hlY2sgaWYgYXR0cnMgaGF2ZSBpdC5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoaGFzT3duKGF0dHJzLCBrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gYXR0cnNba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnNba2V5XSA9IHZhbHVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2FtZWxpemVkS2V5ID0gY2FtZWxpemUoa2V5KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcHNbY2FtZWxpemVkS2V5XSA9IHJlc29sdmVQcm9wVmFsdWUob3B0aW9ucywgcmF3Q3VycmVudFByb3BzLCBjYW1lbGl6ZWRLZXksIHZhbHVlLCBpbnN0YW5jZSwgZmFsc2UgLyogaXNBYnNlbnQgKi8pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gYXR0cnNba2V5XSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhdHRyc1trZXldID0gdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc0F0dHJzQ2hhbmdlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgLy8gZnVsbCBwcm9wcyB1cGRhdGUuXHJcbiAgICAgICAgaWYgKHNldEZ1bGxQcm9wcyhpbnN0YW5jZSwgcmF3UHJvcHMsIHByb3BzLCBhdHRycykpIHtcclxuICAgICAgICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gaW4gY2FzZSBvZiBkeW5hbWljIHByb3BzLCBjaGVjayBpZiB3ZSBuZWVkIHRvIGRlbGV0ZSBrZXlzIGZyb21cclxuICAgICAgICAvLyB0aGUgcHJvcHMgb2JqZWN0XHJcbiAgICAgICAgbGV0IGtlYmFiS2V5O1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIHJhd0N1cnJlbnRQcm9wcykge1xyXG4gICAgICAgICAgICBpZiAoIXJhd1Byb3BzIHx8XHJcbiAgICAgICAgICAgICAgICAvLyBmb3IgY2FtZWxDYXNlXHJcbiAgICAgICAgICAgICAgICAoIWhhc093bihyYXdQcm9wcywga2V5KSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGl0J3MgcG9zc2libGUgdGhlIG9yaWdpbmFsIHByb3BzIHdhcyBwYXNzZWQgaW4gYXMga2ViYWItY2FzZVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFuZCBjb252ZXJ0ZWQgdG8gY2FtZWxDYXNlICgjOTU1KVxyXG4gICAgICAgICAgICAgICAgICAgICgoa2ViYWJLZXkgPSBoeXBoZW5hdGUoa2V5KSkgPT09IGtleSB8fCAhaGFzT3duKHJhd1Byb3BzLCBrZWJhYktleSkpKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKG9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAocmF3UHJldlByb3BzICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvciBjYW1lbENhc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgKHJhd1ByZXZQcm9wc1trZXldICE9PSB1bmRlZmluZWQgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZvciBrZWJhYi1jYXNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByYXdQcmV2UHJvcHNba2ViYWJLZXldICE9PSB1bmRlZmluZWQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHByb3BzW2tleV0gPSByZXNvbHZlUHJvcFZhbHVlKG9wdGlvbnMsIHJhd0N1cnJlbnRQcm9wcywga2V5LCB1bmRlZmluZWQsIGluc3RhbmNlLCB0cnVlIC8qIGlzQWJzZW50ICovKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcHJvcHNba2V5XTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBpbiB0aGUgY2FzZSBvZiBmdW5jdGlvbmFsIGNvbXBvbmVudCB3L28gcHJvcHMgZGVjbGFyYXRpb24sIHByb3BzIGFuZFxyXG4gICAgICAgIC8vIGF0dHJzIHBvaW50IHRvIHRoZSBzYW1lIG9iamVjdCBzbyBpdCBzaG91bGQgYWxyZWFkeSBoYXZlIGJlZW4gdXBkYXRlZC5cclxuICAgICAgICBpZiAoYXR0cnMgIT09IHJhd0N1cnJlbnRQcm9wcykge1xyXG4gICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiBhdHRycykge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFyYXdQcm9wcyB8fCAhaGFzT3duKHJhd1Byb3BzLCBrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGF0dHJzW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIC8vIHRyaWdnZXIgdXBkYXRlcyBmb3IgJGF0dHJzIGluIGNhc2UgaXQncyB1c2VkIGluIGNvbXBvbmVudCBzbG90c1xyXG4gICAgaWYgKGhhc0F0dHJzQ2hhbmdlZCkge1xyXG4gICAgICAgIHRyaWdnZXIoaW5zdGFuY2Us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3duKG9wdGlvbnMsIChjYW1lbEtleSA9IGNhbWVsaXplKGtleSkpKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFuZWVkQ2FzdEtleXMgfHwgIW5lZWRDYXN0S2V5cy5pbmNsdWRlcyhjYW1lbEtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBwcm9wc1tjYW1lbEtleV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIChyYXdDYXN0VmFsdWVzIHx8IChyYXdDYXN0VmFsdWVzID0ge30pKVtjYW1lbEtleV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICghaXNFbWl0TGlzdGVuZXIoaW5zdGFuY2UuZW1pdHNPcHRpb25zLCBrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IGF0dHJzW2tleV0pIHtcclxuICAgICAgICAgICAgICAgICAgICBhdHRyc1trZXldID0gdmFsdWU7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzQXR0cnNDaGFuZ2VkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGlmIChuZWVkQ2FzdEtleXMpIHtcclxuICAgICAgICBjb25zdCByYXdDdXJyZW50UHJvcHMgPSB0b1Jhdyhwcm9wcyk7XHJcbiAgICAgICAgY29uc3QgY2FzdFZhbHVlcyA9IHJhd0Nhc3RWYWx1ZXMgfHwgRU1QVFlfT0JKO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmVlZENhc3RLZXlzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGtleSA9IG5lZWRDYXN0S2V5c1tpXTtcclxuICAgICAgICAgICAgcHJvcHN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dmFsdWUgPSBwcm9wc0RlZmF1bHRzW2tleV0gPSBkZWZhdWx0VmFsdWUuY2FsbChudWxsLCBwcm9wcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgdW5zZXRDdXJyZW50SW5zdGFuY2UoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHZhbHVlID0gZGVmYXVsdFZhbHVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIGJvb2xlYW4gY2FzdGluZ1xyXG4gICAgICAgIGlmIChvcHRbMCAvKiBzaG91bGRDYXN0ICovXSkge1xyXG4gICAgICAgICAgICBpZiAoaXNBYnNlbnQgJiYgIWhhc0RlZmF1bHQpIHtcclxuICAgICAgICAgICAgICAgIHZhbHVlID0gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAob3B0WzEgLyogc2hvdWxkQ2FzdFRydWUgKi9dICYmXHJcbiAgICAgICAgICAgICAgICAodmFsdWUgPT09ICcnIHx8IHZhbHVlID09PSBoeXBoZW5hdGUoa2V5KSkpIHtcclxuICAgICAgICAgICAgICAgIHZhbHVlID0gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiB2YWx1ZTtcclxufVxyXG5mdW5jdGlvbiBub3JtYWxpemVQcm9wc09wdGlvbnMoY29tcCwgYXBwQ29udGV4dCwgYXNNaXhpbiA9IGZhbHNlKSB7XHJcbiAgICBjb25zdCBjYWNoZSA9IGFwcENvbnRleHQucHJvcHNDYWNoZTtcclxuICAgIGNvbnN0IGNhY2hlZCA9IGNhY2hlLmdldChjb21wKTtcclxuICAgIGlmIChjYWNoZWQpIHtcclxuICAgICAgICByZXR1cm4gY2FjaGVkO1xyXG4gICAgfVxyXG4gICAgY29uc3QgcmF3ID0gY29tcC5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ICAgICAgICBjb25zdCBvcHQgPSByYXdba2V5XTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHByb3AgPSAobm9ybWFsaXplZFtub3JtYWxpemVkS2V5XSA9XHJcbiAgICAgICAgICAgICAgICAgICAgaXNBcnJheShvcHQpIHx8IGlzRnVuY3Rpb24ob3B0KSA/IHsgdHlwZTogb3B0IH0gOiBvcHQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHByb3ApIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBib29sZWFuSW5kZXggPSBnZXRUeXBlSW5kZXgoQm9vbGVhbiwgcHJvcC50eXBlKTtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJpbmdJbmRleCA9IGdldFR5cGVJbmRleChTdHJpbmcsIHByb3AudHlwZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvcFswIC8qIHNob3VsZENhc3QgKi9dID0gYm9vbGVhbkluZGV4ID4gLTE7XHJcbiAgICAgICAgICAgICAgICAgICAgcHJvcFsxIC8qIHNob3VsZENhc3RUcnVlICovXSA9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZ0luZGV4IDwgMCB8fCBib29sZWFuSW5kZXggPCBzdHJpbmdJbmRleDtcclxuICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGUgcHJvcCBuZWVkcyBib29sZWFuIGNhc3Rpbmcgb3IgZGVmYXVsdCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChib29sZWFuSW5kZXggPiAtMSB8fCBoYXNPd24ocHJvcCwgJ2RlZmF1bHQnKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZWVkQ2FzdEtleXMucHVzaChub3JtYWxpemVkS2V5KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjb25zdCByZXMgPSBbbm9ybWFsaXplZ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lKHJhd1Nsb3QoLi4uYXJncykpO1xyXG4gICAgfSwgY3R4KTtcclxuICAgIG5vcm1hbGl6ZWQuX2MgPSBmYWxzZTtcclxuICAgIHJldHVybiBub3JtYWxpemVkO1xyXG59O1xyXG5jb25zdCBub3JtYWxpemVPYmplY3RTbG90cyA9IChyYXdTbG90cywgc2xvdHMsIGluc3RhbmNlKSA9PiB7XHJcbiAgICBjb25zdCBjdHggPSByYXdTbG90cy5fY3R4O1xyXG4gICAgZm9yIChjb25zdCBrZXkgaW4gcmF3U2xvdHMpIHtcclxuICAgICAgICBpZiAoaXNJbnRlcm5hbEtleShrZXkpKVxyXG4gICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICBjb25zdCB2YWx1ZSA9IHJhd1Nsb3RzW2tleV07XHJcbiAgICAgICAgaWYgKGlzRnVuY3Rpb24odmFsdWUpKSB7XHJcbiAgICAgICAgICAgIHNsb3RzW2tleV0gPSBub3JtYWxpemVTbG90KGtleSwgdmFsdWUsIGN0eCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHZhbHVlICE9IG51bGwpIHtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJlxyXG4gICAgICAgICAgICAgICAgIShmYWxzZSApKSB7XHJcbiAgICAgICAgICAgICAgICB3YXJuKGBOb24tZnVuY3Rpb24gdmFsdWUgZW5jb3VudGVyZWQgZm9yIHNsb3QgXCIke2tleX1cIi4gYCArXHJcbiAgICAgICAgICAgICAgICAgICAgYFByZWZlciBmdW5jdGlvbiBzbG90cyBmb3IgYmV0dGVyIHBlcmZvcm1hbmNlLmApO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IG5vcm1hbGl6ZWQgPSBub3JtYWxpemVTbG90VmFsdWUodmFsdWUpO1xyXG4gICAgICAgICAgICBzbG90c1trZXldID0gKCkgPT4gbm9ybWFsaXplZDtc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bCBpbnN0YW5jZVxyXG4gICAgICAgICAgICBpbnN0YW5jZS5zbG90cyA9IHRvUmF3KGNoaWxkcmVuKTtcclxuICAgICAgICAgICAgLy8gbWFrZSBjb21waWxlciBtYXJrZXIgbm9uLWVudW1lcmFibGVcclxuICAgICAgICAgICAgZGVmKGNoaWxkcmVuLCAnXycsIHR5cGUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgbm9ybWFsaXplT2JqZWN0U2xvdHMoY2hpbGRyZW4sIChpbnN0YW5jZS5zbG90cyA9IHt9KSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgaW5zdGFuY2Uuc2xvdHMgPSB7fTtcclxuICAgICAgICBpZiAoY2hpbGRyZW4pIHtcclxuICAgICAgICAgICAgbm9ybWFsaXplVk5vZGVTbG90cyhpbnN0YW5jZSwgY2hpbGRyZW4pO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGRlZihpbnN0YW5jZS5zbG90cywgSW50ZXJuYWxPYmplY3RLZXksIDEpO1xyXG59O1xyXG5jb25zdCB1cGRhdGVTbG90cyA9IChpbnN0YW5jZSwgY2hpbGRyZW4sIG9wdGltaXplZCkgPT4ge1xyXG4gICAgY29uc3QgeyB2bm9kZSwgc2xvdHMgfSA9IGluc3RhbmNlO1xyXG4gICAgbGV0IG5lZWREZWxldGlvbkNoZWNrID0gdHJ1ZTtcclxuICAgIGxldCBkZWxldGlvbkNvbXBhcmlzb25UYXJnZXQgPSBFTVBUWV9PQko7XHJcbiAgICBpZiAodm5vZGUuc2hhcGVGbGFnICYgMzIgLyogU0xPVFNfQ0hJTERSRU4gKi8pIHtcclxuICAgICAgICBjb25zdCB0eXBlID0gY2hpbGRyZW4uXztcclxuICAgICAgICBpZiAodHlwZSkge1xyXG4gICAgICAgICAgICAvLyBjb21waWxlZCBzbG90cy5cclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiBpc0htclVwZGF0aW5nKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBQYXJlbnQgd2FzIEhNUiB1cGRhdGVkIHNvIHNsb3QgY29udGVudCBtYXkgaGF2ZSBjaGFuZ2VkLlxyXG4gICAgICAgICAgICAgICAgLy8gZm9yY2UgdXBkYXRlIHNsb3RzIGFuZCBtYXJrIGluc3RhbmNlIGZvciBobXIgYXMgd2VsbFxyXG4gICAgICAgICAgICAgICAgZXh0ZW5kKHNsb3RzLCBjaGlsZHJlbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAob3B0aW1pemVkICYmIHR5cGUgPT09IDEgLyogU1RBQkxFICovKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBjb21waWxlZCBBTkQgc3RhYmxlLlxyXG4gICAgICAgICAgICAgICAgLy8gbm8gbmVlZCB0byB1cGRhdGUsIGFuZCBza2lwIHN0YWxlIHNsb3RzIHJlbW92YWwuXHJcbiAgICAgICAgICAgICAgICBuZWVkRGVsZXRpb25DaGVjayA9IGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gY29tcGlsZWQgYnV0IGR5bmFtaWMgKHYtaWYvdi1mb3Igb24gc2xvdHMpIC0gdXBkYXRlIHNsb3RzLCBidXQgc2tpcFxyXG4gICAgICAgICAgICAgICAgLy8gbm9ybWFsaXphdGlvbi5cclxuICAgICAgICAgICAgICAgIGV4dGVuZChzbG90cywgY2hpbGRyZW4pO1xyXG4gICAgICAgICAgICAgICAgLy8gIzI4OTNcclxuICAgICAgICAgICAgICAgIC8vIHdoZW4gcmVuZGVyaW5nIHRoZSBvcHRpbWl6ZWQgc2xvdHMgYnkgbWFudWFsbHkgd3JpdHRlbiByZW5kZXIgZnVuY3Rpb24sXHJcbiAgICAgICAgICAgICAgICAvLyB3Z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b2xkVmFsdWU6IHZvaWQgMCxcclxuICAgICAgICAgICAgYXJnLFxyXG4gICAgICAgICAgICBtb2RpZmllcnNcclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIHJldHVybiB2bm9kZTtcclxufVxyXG5mdW5jdGlvbiBpbnZva2VEaXJlY3RpdmVIb29rKHZub2RlLCBwcmV2Vk5vZGUsIGluc3RhbmNlLCBuYW1lKSB7XHJcbiAgICBjb25zdCBiaW5kaW5ncyA9IHZub2RlLmRpcnM7XHJcbiAgICBjb25zdCBvbGRCaW5kaW5ncyA9IHByZXZWTm9kZSAmJiBwcmV2Vk5vZGUuZGlycztcclxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmluZGluZ3MubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBiaW5kaW5nID0gYmluZGluZ3NbaV07XHJcbiAgICAgICAgaWYgKG9sZEJpbmRpbmdzKSB7XHJcbiAgICAgICAgICAgIGJpbmRpbmcub2xkVmFsdWUgPSBvbGRCaW5kaW5nc1tpXS52YWx1ZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgbGV0IGhvb2sgPSBiaW5kaW5nLmRpcltuYW1lXTtcclxuICAgICAgICBpZiAoaG9vaykge1xyXG4gICAgICAgICAgICAvLyBkaXNhYmxlIHRyYWNraW5nIGluc2lkZSBhbGwgbGlmZWN5Y2xlIGhvb2tzXHJcbiAgICAgICAgICAgIC8vIHNpbmNlIHRoZXkgY2FuIHBvdGVudGlhbGx5IGJlIGNhbGxlZCBpbnNpZGUgZWZmZWN0cy5cclxuICAgICAgICAgICAgcGF1c2VUcmFja2luZygpO1xyXG4gICAgICAgICAgICBjYWxsV2l0aEFzeW5jRXJyb3JIYW5kbGluZyhob29rLCBpbnN0YW5jZSwgOCAvKiBESVJFQ1RJVkVfSE9PSyAqLywgW1xyXG4gICAgICAgICAgICAgICAgdm5vZGUuZWwsXHJcbiAgICAgICAgICAgICAgICBiaW5kaW5nLFxyXG4gICAgICAgICAgICAgICAgdm5vZGUsXHJcbiAgICAgICAgICAgICAgICBwcmV2Vk5vZGVcclxuICAgICAgICAgICAgXSk7XHJcbiAgICAgICAgICAgIHJlc2V0VHJhY2tpbmcoKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cblxuZnVuY3Rpb24gY3JlYXRlQXBwQ29udGV4dCgpIHtcclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgYXBwOiBudWxsLFxyXG4gICAgICAgIGNvbmZpZzoge1xyXG4gICAgICAgICAgICBpc05hdGl2ZVRhZzogTk8sXHJcbiAgICAgICAgICAgIHBlcmZvcm1hbmNlOiBmYWxzZSxcclxuICAgICAgICAgICAgZ2xvYmFsUHJvcGVydGllczoge30sXHJcbiAgICAgICAgICAgIG9wdGlvbk1lcmdlU3RyYXRlZ2llczoge30sXHJcbiAgICAgICAgICAgIGVycm9ySGFuZGxlcjogdW5kZWZpbmVkLFxyXG4gICAgICAgICAgICB3YXJuSGFuZGxlcjogdW5kZWZpbmVkLFxyXG4gICAgICAgICAgICBjb21waWxlck9wdGlvbnM6IHt9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtaXhpbnM6IFtdLFxyXG4gICAgICAgIGNvbXBvbmVudHM6IHt9LFxyXG4gICAgICAgIGRpcmVjdGl2ZXM6IHt9LFxyXG4gICAgICAgIHByb3ZpZGVzOiBPYmplY3QuY3JlYXRlKG51bGwpLFxyXG4gICAgICAgIG9wdGlvbnNDYWNoZTogbmV3IFdlYWtNYXAoKSxcclxuICAgICAgICBwcm9wc0NhY2hlOiBuZXcgV2Vha01hcCgpLFxyXG4gICAgICAgIGVtaXRzQ2FjaGU6IG5ldyBXZWFrTWFwKClcclxuICAgIH07XHJcbn1cclxubGV0IHVpZCA9IDA7XHJcbmZ1bmN0aW9uIGNyZWF0ZUFwcEFQSShyZW5kZXIsIGh5ZHJhdGUpIHtcclxuICAgIHJldHVybiBmdW5jdGlvbiBjcmVhdGVBcHAocm9vdENvbXBvbmVudCwgcm9vdFByb3BzID0gbnVsbCkge1xyXG4gICAgICAgIGlmIChyb290UHJvcHMgIT0gbnVsbCAmJiAhaXNPYmplY3Qocm9vdFByb3BzKSkge1xyXG4gICAgICAgICAgICAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgd2Fybihgcm9vdCBwcm9wcyBwYXNzZWQgdG8gYXBwLm1vdW50KCkgbXVzdCBiZSBhbiBvYmplY3QuYCk7XHJcbiAgICAgICAgICAgIHJvb3RQcm9wcyA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGNvbnRleHQgPSBjcmVhdGVBcHBDb250ZXh0KCk7XHJcbiAgICAgICAgY29uc3QgaW5zdGFsbGVkUGx1Z2lucyA9IG5ldyBTZXQoKTtcclxuICAgICAgICBsZXQgaXNNb3VudGVkID0gZmFsc2U7XHJcbiAgICAgICAgY29uc3QgYXBwID0gKGNvbnRleHQuYXBwID0ge1xyXG4gICAgICAgICAgICBfdWlkOiB1aWQrKyxcclxuICAgICAgICAgICAgX2NvbXBvbmVudDogcm9vdENvbXBvbmVudCxcclxuICAgICAgICAgICAgX3Byb3BzOiByb290UHJvcHMsXHJcbiAgICAgICAgICAgIF9jb250YWluZXI6IG51bGwsXHJcbiAgICAgICAgICAgIF9jb250ZXh0OiBjb250ZXh0LFxyXG4gICAgICAgICAgICBfaW5zdGFuY2U6IG51bGwsXHJcbiAgICAgICAgICAgIHZlcnNpb24sXHJcbiAgICAgICAgICAgIGdldCBjb25maWcoKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gY29udGV4dC5jb25maWc7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHNldCBjb25maWcodikge1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYGFwcC5jb25maWcgY2Fubm90IGJlIHJlcGxhY2VkLiBNb2RpZnkgaW5kaXZpZHVhbCBvcHRpb25zIGluc3RlYWQuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHVzZShwbHVnaW4sIC4uLm9wdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgIGlmIChpbnN0YWxsZWRQbHVnaW5zLmhhcyhwbHVnaW4pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIHdhcm4oYFBsdWdpbiBoYXMgYWxyZWFkeSBiZWVuIGFwcGxpZWQgdG8gdGFyZ2V0IGFwcC5gKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHBsdWdpbiAmJiBpc0Z1bmN0aW9uKHBsdWdpbi5pbnN0YWxsKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbGxlZFBsdWdpbnMuYWRkKHBsdWdpbik7XHJcbiAgICAgICAgICAgICAgICAgICAgcGx1Z2luLmluc3RhbGwoYXBwLCAuLi5vcHRpb25zKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzRnVuY3Rpb24ocGx1Z2luKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbGxlZFBsdWdpbnMuYWRkKHBsdWdpbik7XHJcbiAgICAgICAgICAgICAgICAgICAgcGx1Z2luKGFwcCwgLi4ub3B0aW9ucyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICB3YXJuKGBBIHBsdWdpbiBtdXN0IGVpdGhlciBiZSBhIGZ1bmN0aW9uIG9yIGFuIG9iamVjdCB3aXRoIGFuIFwiaW5zdGFsbFwiIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgZnVuY3Rpb24uYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYXBwO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBtaXhpbihtaXhpbikge1xyXG4gICAgICAgICAgICAgICAgaWYgKF9fVlVFX09QVElPTlNfQVBJX18pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbnRleHQubWl4aW5zLmluY2x1ZGVzKG1peGluKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm1peGlucy5wdXNoKG1peGluKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ01peGluIGhhcyBhbHJlYWR5IGJlZW4gYXBwbGllZCB0byB0YXJnZXQgYXBwJyArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAobWl4aW4ubmFtZSA/IGA6ICR7bWl4aW4ubmFtZX1gIDogJycpKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICB3YXJuKCdNaXhpbnMgYXJlIG9ubHkgYXZhaWxhYmxlIGluIGJ1aWxkcyBzdXBwb3J0aW5nIE9wdGlvbnMgQVBJJyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gYXBwO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBjb21wb25lbnQobmFtZSwgY29tcG9uZW50KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdGVDb21wb25lbnROYW1lKG5hbWUsIGNvbnRleHQuY29uZmlnKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghY29tcG9uZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRleHQuY29tcG9uZW50c1tuYW1lXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgY29udGV4dC5jb21wb25lbnRzW25hbWVdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihgQ29tcG9uZW50IFwiJHtuYW1lfVwiIGhhcyBhbHJlYWR5IGJlZW4gcmVnaXN0ZXJlZCBpbiB0YXJnZXQgYXBwLmApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5jb21wb25lbnRzW25hbWVdID0gY29tcG9uZW50O1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFwcDtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZGlyZWN0aXZlKG5hbWUsIGRpcmVjdGl2ZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHZhbGlkYXRlRGlyZWN0aXZlTmFtZShuYW1lKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghZGlyZWN0aXZlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRleHQuZGlyZWN0aXZlc1tuYW1lXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgY29udGV4dC5kaXJlY3RpdmVzW25hbWVdKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybihgRGlyZWN0aXZlIFwiJHtuYW1lfVwiIGhhcyBhbHJlYWR5IGJlZW4gcmVnaXN0ZXJlZCBpbiB0YXJnZXQgYXBwLmApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5kaXJlY3RpdmVzW25hbWVdID0gZGlyZWN0aXZlO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFwcDtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgbW91bnQocm9vdENvbnRhaW5lciwgaXNIeWRyYXRlLCBpc1NWRykge1xyXG4gICAgICAgICAgICAgICAgaWYgKCFpc01vdW50ZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCB2bm9kZSA9IGNyZWF0ZVZOb2RlKHJvb3RDb21wb25lbnQsIHJvb3RQcm9wcyk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc3RvcmUgYXBwIGNvbnRleHQgb24gdGhlIHJvb3QgVk5vZGUuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyB3aWxsIGJlIHNldCBvbiB0aGUgcm9vdCBpbnN0YW5jZSBvbiBpbml0aWFsIG1vdW50LlxyXG4gICAgICAgICAgICAgICAgICAgIHZub2RlLmFwcENvbnRleHQgPSBjb250ZXh0O1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEhNUiByb290IHJlbG9hZFxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5yZWxvYWQgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXIoY2xvbmVWTm9kZSh2bm9kZSksIHJvb3RDb250YWluZXIsIGlzU1ZHKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzSHlkcmF0ZSAmJiBoeWRyYXRlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGh5ZHJhdGUodm5vZGUsIHJvb3RDb250YWluZXIpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyKHZub2RlLCByb290Q29udGFpbmVyLCBpc1NWRyk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlzTW91bnRlZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgYXBwLl9jb250YWluZXIgPSByb290Q29udGFpbmVyO1xyXG4gICAgICAgICAgICAgICAgICAgIHJvb3RDb250YWluZXIuX192dWVfYXBwX18gPSBhcHA7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB8fCBfX1ZVRV9QUk9EX0RFVlRPT0xTX18pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXBwLl9pbnN0YW5jZSA9IHZub2RlLmNvbXBvbmVudDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGV2dG9vbHNJbml0QXBwKGFwcCwgdmVyc2lvbik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRFeHBvc2VQcm94eSh2bm9kZS5jb21wb25lbnQpIHx8IHZub2RlLmNvbXBvbmVudC5wcm94eTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYEFwcCBoYXMgYWxyZWFkeSBiZWVuIG1vdW50ZWQuXFxuYCArXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBJZiB5b3Ugd2FudCB0byByZW1vdW50IHRoZSBzYW1lIGFwcCwgbW92ZSB5b3VyIGFwcCBjcmVhdGlvbiBsb2dpYyBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYGludG8gYSBmYWN0b3J5IGZ1bmN0aW9uIGFuZCBjcmVhdGUgZnJlc2ggYXBwIGluc3RhbmNlcyBmb3IgZWFjaCBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYG1vdW50IC0gZS5nLiBcXGBjb25zdCBjcmVhdGVNeUFwcCA9ICgpID0+IGNyZWF0ZUFwcChBcHApXFxgYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHVubW91bnQoKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNNb3VudGVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmVuZGVyKG51bGwsIGFwcC5fY29udGFpbmVyKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHx8IF9fVlVFX1BST0RfREVWVE9PTFNfXykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhcHAuX2luc3RhbmNlID0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGV2dG9vbHNVbm1vdW50QXBwKGFwcCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBhcHAuX2NvbnRhaW5lci5fX3Z1ZV9hcHBfXztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYENhbm5vdCB1bm1vdW50IGFuIGFwcCB0aGF0IGlzIG5vdCBtb3VudGVkLmApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBwcm92aWRlKGtleSwgdmFsdWUpIHtcclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYga2V5IGluIGNvbnRleHQucHJvdmlkZXMpIHtcclxuICAgICAgICAgICAgICAgICAgICB3YXJuKGBBcHAgYWxyZWFkeSBwcm92aWRlcyBwcm9wZXJ0eSB3aXRoIGtleSBcIiR7U3RyaW5nKGtleSl9XCIuIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgSXQgd2lsbCBiZSBvdmVyd3JpdHRlbiB3aXRoIHRoZSBuZXcgdmFsdWUuYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBUeXBlU2NyaXB0IGRvZXNuJ3QgYWxsb3cgc3ltYm9scyBhcyBpbmRleCB0eXBlXHJcbiAgICAgICAgICAgICAgICAvLyBodHRwczovL2dpdGh1Yi5jb20vTWljcm9zb2Z0L1R5cGVTY3JpcHQvaXNzdWVzLzI0NTg3XHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LnByb3ZpZGVzW2tleV0gPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgIHJldHVybiBhcHA7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgICAgICByZXR1cm4gYXBwO1xyXG4gICAgfTtcclxufVxuXG5sZXQgaGFzTWlzbWF0Y2ggPSBmYWxzZTtcclxuY29uc3QgaXNTVkdDb250YW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b21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBzbG90U2NvcGVJZHMsIGlzRnJhZ21lbnRTdGFydCk7XHJcbiAgICAgICAgY29uc3QgeyB0eXBlLCByZWYsIHNoYXBlRmxhZyB9ID0gdm5vZGU7XHJcbiAgICAgICAgY29uc3QgZG9tVHlwZSA9IG5vZGUubm9kZVR5cGU7XHJcbiAgICAgICAgdm5vZGUuZWwgPSBub2RlO1xyXG4gICAgICAgIGxldCBuZXh0Tm9kZSA9IG51bGw7XHJcbiAgICAgICAgc3dpdGNoICh0eXBlKSB7XHJcbiAgICAgICAgICAgIGNhc2UgVGV4dDpcclxuICAgICAgICAgICAgICAgIGlmIChkb21UeXBlICE9PSAzIC8qIFRFWFQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG9uTWlzbWF0Y2goKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChub2RlLmRhdGEgIT09IHZub2RlLmNoaWxkcmVuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc01pc21hdGNoID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuKGBIeWRyYXRpb24gdGV4dCBtaXNtYXRjaDpgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgXFxuLSBDbGllbnQ6ICR7SlNPTi5zdHJpbmdpZnkobm9kZS5kYXRhKX1gICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgXFxuLSBTZXJ2ZXI6ICR7SlNPTi5zdHJpbmdpZnkodm5vZGUuY2hpbGRyZW4pfWApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmRhdGEgPSB2bm9kZS5jaGlsZHJlbjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dE5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIENvbW1lbnQ6XHJcbiAgICAgICAgICAgICAgICBpZiAoZG9tVHlwZSAhPT0gOCAvKiBDT01NRU5UICovIHx8IGlzRnJhZ21lbnRTdGFydCkge1xyXG4gICAgICAgICAgICAgICAgICAgIG5leHROb2RlID0gb25NaXNtYXRjaCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dE5vZGUgPSBuZXh0U2libGluZyhub2RlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIFN0YXRpYzpcclxuICAgICAgICAgICAgICAgIGlmIChkb21UeXBlICE9PSAxIC8qIEVMRU1FTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG9uTWlzbWF0Y2goKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGRldGVybWluZSBhbmNob3IsIGFkb3B0IGNvbnRlbnRcclxuICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG5vZGU7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaWYgdGhlIHN0YXRpYyB2bm9kZSBoYXMgaXRzIGNvbnRlbnQgc3RyaXBwZWQgZHVyaW5nIGJ1aWxkLFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFkb3B0IGl0IGZyb20gdGhlIHNlcnZlci1yZW5kZXJlZCBIVE1MLlxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5lZWRUb0Fkb3B0Q29udGVudCA9ICF2bm9kZS5jaGlsZHJlbi5sZW5ndGg7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB2bm9kZS5zdGF0aWNDb3VudDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZWVkVG9BZG9wdENvbnRlbnQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2bm9kZS5jaGlsZHJlbiArPSBuZXh0Tm9kZS5vdXRlckhUTUw7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09PSB2bm9kZS5zdGF0aWNDb3VudCAtIDEpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZub2RlLmFuY2hvciA9IG5leHROb2RlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHROb2RlID0gbmV4dFNpYmxpbmcobmV4dE5vZGUpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV4dE5vZGU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBGcmFnbWVudDpcclxuICAgICAgICAgICAgICAgIGlmICghaXNGcmFnbWVudFN0YXJ0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dE5vZGUgPSBvbk1pc21hdGNoKCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IGh5ZHJhdGVGcmFnbWVudChub2RlLCB2bm9kZSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICBpZiAoc2hhcGVGbGFnICYgMSAvKiBFTEVNRU5UICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbVR5cGUgIT09IDEgLyogRUxFTUVOVCAqLyB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB2bm9kZS50eXBlLnRvTG93ZXJDYXNlKCkgIT09XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRhZ05hbWUudG9Mb3dlckNhc2UoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG9uTWlzbWF0Y2goKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHROb2RlID0gaHlkcmF0ZUVsZW1lbnQobm9kZSwgdm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFwZUZsYWcgJiA2IC8qIENPTVBPTkVOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gc2V0dGluZyB1cCB0aGUgcmVuZGVyIGVmZmVjdCwgaWYgdGhlIGluaXRpYWwgdm5vZGUgYWxyZWFkeVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGhhcyAuZWwgc2V0LCB0aGUgY29tcG9uZW50IHdpbGwgcGVyZm9ybSBoeWRyYXRpb24gaW5zdGVhZCBvZiBtb3VudFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG9uIGl0cyBzdWItdHJlZS5cclxuICAgICAgICAgICAgICAgICAgICB2bm9kZS5zbG90U2NvcGVJZHMgPSBzbG90U2NvcGVJZHM7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29udGFpbmVyID0gcGFyZW50Tm9kZShub2RlKTtcclxuICAgICAgICAgICAgICAgICAgICBtb3VudENvbXBvbmVudCh2bm9kZSwgY29udGFpbmVyLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWR0NvbnRhaW5lcihjb250YWluZXIpLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNvbXBvbmVudCBtYXkgYmUgYXN5bmMsIHNvIGluIHRoZSBjYXNlIG9mIGZyYWdtZW50cyB3ZSBjYW5ub3QgcmVseVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG9uIGNvbXBvbmVudCdzIHJlbmRlcmVkIG91dHB1dCB0byBkZXRlcm1pbmUgdGhlIGVuZCBvZiB0aGUgZnJhZ21lbnRcclxuICAgICAgICAgICAgICAgICAgICAvLyBpbnN0ZWFkLCB3ZSBkbyBhIGxvb2thaGVhZCB0byBmaW5kIHRoZSBlbmQgYW5jaG9yIG5vZGUuXHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dE5vZGUgPSBpc0ZyYWdtZW50U3RhcnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgPyBsb2NhdGVDbG9zaW5nQXN5bmNBbmNob3Iobm9kZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiBuZXh0U2libGluZyhub2RlKTtcclxuICAgICAgICAgICAgICAgICAgICAvLyAjMzc4N1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIGNvbXBvbmVudCBpcyBhc3luYywgaXQgbWF5IGdldCBtb3ZlZCAvIHVubW91bnRlZCBiZWZvcmUgaXRzXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaW5uZXIgY29tcG9uZW50IGlzIGxvYWRlZCwgc28gd2UgbmVlZCB0byBnaXZlIGl0IGEgcGxhY2Vob2xkZXJcclxuICAgICAgICAgICAgICAgICAgICAvLyB2bm9kZSB0aGF0IG1hdGNoZXMgaXRzIGFkb3B0ZWQgRE9NLlxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0FzeW5jV3JhcHBlcih2bm9kZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1YlRyZWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0ZyYWdtZW50U3RhcnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlRyZWUgPSBjcmVhdGVWTm9kZShGcmFnbWVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUcmVlLmFuY2hvciA9IG5leHROb2RlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBuZXh0Tm9kZS5wcmV2aW91c1NpYmxpbmdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGNvbnRhaW5lci5sYXN0Q2hpbGQ7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJUcmVlID1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLm5vZGVUeXBlID09PSAzID8gY3JlYXRlVGV4dFZOb2RlKCcnKSA6IGNyZWF0ZVZOb2RlKCdkaXYnKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJUcmVlLmVsID0gbm9kZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdm5vZGUuY29tcG9uZW50LnN1YlRyZWUgPSBzdWJUcmVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNoYXBlRmxhZyAmIDY0IC8qIFRFTEVQT1JUICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbVR5cGUgIT09IDggLyogQ09NTUVOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG9uTWlzbWF0Y2goKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5leHROb2RlID0gdm5vZGUudHlwZS5oeWRyYXRlKG5vZGUsIHZub2RlLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCwgcmVuZGVyZXJJbnRlcm5hbHMsIGh5ZHJhdGVDaGlsZHJlbik7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcGVGbGFnICYgMTI4IC8qIFNVU1BFTlNFICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV4dE5vZGUgPSB2bm9kZS50eXBlLmh5ZHJhdGUobm9kZSwgdm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHQ29udGFpbmVyKHBhcmVudE5vZGUobm9kZSkpLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCwgcmVuZGVyZXJJbnRlcm5hbHMsIGh5ZHJhdGVOb2RlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oJ0ludmFsaWQgSG9zdFZOb2RlIHR5cGU6JywgdHlwZSwgYCgke3R5cGVvZiB0eXBlfSlgKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHJlZiAhPSBudWxsKSB7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djcmVhdGVkJyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gcHJvcHNcclxuICAgICAgICAgICAgaWYgKHByb3BzKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoZm9yY2VQYXRjaFZhbHVlIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgIW9wdGltaXplZCB8fFxyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoRmxhZyAmICgxNiAvKiBGVUxMX1BST1BTICovIHwgMzIgLyogSFlEUkFURV9FVkVOVFMgKi8pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gcHJvcHMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChmb3JjZVBhdGNoVmFsdWUgJiYga2V5LmVuZHNXaXRoKCd2YWx1ZScpKSB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGlzT24oa2V5KSAmJiAhaXNSZXNlcnZlZFByb3Aoa2V5KSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGNoUHJvcChlbCwga2V5LCBudWxsLCBwcm9wc1trZXldLCBmYWxzZSwgdW5kZWZpbmVkLCBwYXJlbnRDb21wb25lbnQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocHJvcHMub25DbGljaykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIEZhc3QgcGF0aCBmb3IgY2xpY2sgbGlzdGVuZXJzICh3aGljaCBpcyBtb3N0IG9mdGVuKSB0byBhdm9pZFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGl0ZXJhdGluZyB0aHJvdWdoIHByb3BzLlxyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoUHJvcChlbCwgJ29uQ2xpY2snLCBudWxsLCBwcm9wcy5vbkNsaWNrLCBmYWxzZSwgdW5kZWZpbmVkLCBwYXJlbnRDb21wb25lbnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIHZub2RlIC8gZGlyZWN0aXZlIGhvb2tzXHJcbiAgICAgICAgICAgIGxldCB2bm9kZUhvb2tzO1xyXG4gICAgICAgICAgICBpZiAoKHZub2RlSG9va3MgPSBwcm9wcyAmJiBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpKSB7XHJcbiAgICAgICAgICAgICAgICBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rcywgcGFyZW50Q29tcG9uZW50LCB2bm9kZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGRpcnMpIHtcclxuICAgICAgICAgICAgICAgIGludm9rZURpcmVjdGl2ZUhvb2sodm5vZGUsIG51bGwsIHBhcmVudENvbXBvbmVudCwgJ2JlZm9yZU1vdW50Jyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCh2bm9kZUhvb2tzID0gcHJvcHMgJiYgcHJvcHMub25Wbm9kZU1vdW50ZWQpIHx8IGRpcnMpIHtcclxuICAgICAgICAgICAgICAgIHF1ZXVlRWZmZWN0V2l0aFN1c3BlbnNlKCgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICB2bm9kZUhvb2tzICYmIGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2tzLCBwYXJlbnRDb21wb25lbnQsIHZub2RlKTtcclxuICAgICAgICAgICAgICAgICAgICBkaXJzICYmIGludm9rZURpcmVjdGl2ZUhvb2sodm5vZGUsIG51bGwsIHBhcmVudENvbXBvbmVudCwgJ21vdW50ZWQnKTtcclxuICAgICAgICAgICAgICAgIH0sIHBhcmVudFN1c3BlbnNlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBjaGlsZHJlblxyXG4gICAgICAgICAgICBpZiAoc2hhcGVGbGFnICYgMTYgLyogQVJSQVlfQ0hJTERSRU4gKi8gJiZcclxuICAgICAgICAgICAgICAgIC8vIHNraXAgaWYgZWxlbWVudCBoYXMgaW5uZXJIVE1MIC8gdGV4dENvbnRlbnRcclxuICAgICAgICAgICAgICAgICEocHJvcHMgJiYgKHByb3BzLmlubmVySFRNTCB8fCBwcm9wcy50ZXh0Q29udGVudCkpKSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgbmV4dCA9IGh5ZHJhdGVDaGlsZHJlbihlbC5maXJzdENoaWxkLCB2bm9kZSwgZWwsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgICAgIGxldCBoYXNXYXJuZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIHdoaWxlIChuZXh0KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzTWlzbWF0Y2ggPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgIWhhc1dhcm5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3YXJuKGBIeWRyYXRpb24gY2hpbGRyZW4gbWlzbWF0Y2ggaW4gPCR7dm5vZGUudHlwZX0+OiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGBzZXJ2ZXIgcmVuZGVyZWQgZWxlbWVudCBjb250YWlucyBtb3JlIGNoaWxkIG5vZGVzIHRoYW4gY2xpZW50IHZkb20uYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhhc1dhcm5lZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIFRoZSBTU1JlZCBET00gY29udGFpbnMgbW9yZSBub2RlcyB0aGFuIGl0IHNob3VsZC4gUmVtb3ZlIHRoZW0uXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY3VyID0gbmV4dDtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gbmV4dC5uZXh0U2libGluZztcclxuICAgICAgICAgICAgICAgICAgICByZW1vdmUoY3VyKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChzaGFwZUZsYWcgJiA4IC8qIFRFWFRfQ0hJTERSRU4gKi8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChlbC50ZXh0Q29udGVudCAhPT0gdm5vZGUuY2hpbGRyZW4pIHtcclxuICAgICAgICAgICAgICAgICAgICBoYXNNaXNtYXRjaCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oYEh5ZHJhdGlvbiB0ZXh0IGNvbnRlbnQgbWlzbWF0Y2ggaW4gPCR7dm5vZGUudHlwZX0+OlxcbmAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYC0gQ2xpZW50OiAke2VsLnRleHRDb250ZW50fVxcbmAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYC0gU2VydmVyOiAke3Zub2RlLmNoaWxkcmVufWApO1xyXG4gICAgICAgICAgICAgICAgICAgIGVsLnRleHRDb250ZW50ID0gdm5vZGUuY2hpbGRyZW47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIGVsLm5leHRTaWJsaW5nO1xyXG4gICAgfTtcclxuICAgIGNvbnN0IGh5ZHJhdGVDaGlsZHJlbiA9IChub2RlLCBwYXJlbnRWTm9kZSwgY29udGFpbmVyLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCkgPT4ge1xyXG4gICAgICAgIG9wdGltaXplZCA9IG9wdGltaXplZCB8fCAhIXBhcmVudFZOb2RlLmR5bmFtaWNDaGlsZHJlbjtcclxuICAgICAgICBjb25zdCBjaGlsZHJlbiA9IHBhcmVudFZOb2RlLmNoaWxkcmVuO1xyXG4gICAgICAgIGNvbnN0IGwgPSBjaGlsZHJlbi5sZW5ndGg7XHJcbiAgICAgICAgbGV0IGhhc1dhcm5lZCA9IGZhbHNlO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHZub2RlID0gb3B0aW1pemVkXHJcbiAgICAgICAgICAgICAgICA/IGNoaWxkcmVuW2ldXHJcbiAgICAgICAgICAgICAgICA6IChjaGlsZHJlbltpXSA9IG5vcm1hbGl6ZVZOb2RlKGNoaWxkcmVuW2ldKSk7XHJcbiAgICAgICAgICAgIGlmIChub2RlKSB7XHJcbiAgICAgICAgICAgICAgICBub2RlID0gaHlkcmF0ZU5vZGUobm9kZSwgdm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICh2bm9kZS50eXBlID09PSBUZXh0ICYmICF2bm9kZS5jaGlsZHJlbikge1xyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBoYXNNaXNtYXRjaCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmICFoYXNXYXJuZWQpIHtcclxuICAgICAgICAgICAgICAgICAgICB3YXJuKGBIeWRyYXRpb24gY2hpbGRyZW4gbWlzbWF0Y2ggaW4gPCR7Y29udGFpbmVyLnRhZ05hbWUudG9Mb3dlckNhc2UoKX0+OiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYHNlcnZlciByZW5kZXJlZCBlbGVtZW50IGNvbnRhaW5zIGZld2VyIGNoaWxkIG5vZGVzIHRoYW4gY2xpZW50IHZkb20uYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzV2FybmVkID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIHRoZSBTU1JlZCBET00gZGlkbid0IGNvbnRhaW4gZW5vdWdoIG5vZGVzLiBNb3VudCB0aGUgbWlzc2luZyBvbmVzLlxyXG4gICAgICAgICAgICAgICAgcGF0Y2gobnVsbCwgdm5vZGUsIGNvbnRhaW5lciwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkdDb250YWluZXIoY29udGFpbmVyKSwgc2xvdFNjb3BlSWRzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbm9kZTtcclxuICAgIH07XHJcbiAgICBjb25zdCBoeWRyYXRlRnJhZ21lbnQgPSAobm9kZSwgdm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XHJcbiAgICAgICAgY29uc3QgeyBzbG90U2NvcGVJZHM6IGZyYWdtZW50U2xvdFNjb3BlSWRzIH0gPSB2bm9kZTtcclxuICAgICAgICBpZiAoZnJhZ21lbnRTbG90U2NvcGVJZHMpIHtcclxuICAgICAgICAgICAgc2xvdFNjb3BlSWRzID0gc2xvdFNjb3BlSWRzXHJcbiAgICAgICAgICAgICAgICA/IHNsb3RTY29wZUlkcy5jb25jYXQoZnJhZ21lbnRTbG90U2NvcGVJZHMpXHJcbiAgICAgICAgICAgICAgICA6IGZyYWdtZW50U2xvdFNjb3BlSWRzO1xyXG4gICAgICAgIH1cclxuICAgICA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zLCBpc0ZyYWdtZW50KSA9PiB7XHJcbiAgICAgICAgaGFzTWlzbWF0Y2ggPSB0cnVlO1xyXG4gICAgICAgIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJlxyXG4gICAgICAgICAgICB3YXJuKGBIeWRyYXRpb24gbm9kZSBtaXNtYXRjaDpcXG4tIENsaWVudCB2bm9kZTpgLCB2bm9kZS50eXBlLCBgXFxuLSBTZXJ2ZXIgcmVuZGVyZWQgRE9NOmAsIG5vZGUsIG5vZGUubm9kZVR5cGUgPT09IDMgLyogVEVYVCAqL1xyXG4gICAgICAgICAgICAgICAgPyBgKHRleHQpYFxyXG4gICAgICAgICAgICAgICAgOiBpc0NvbW1lbnQobm9kZSkgJiYgbm9kZS5kYXRhID09PSAnWydcclxuICAgICAgICAgICAgICAgICAgICA/IGAoc3RhcnQgb2YgZnJhZ21lbnQpYFxyXG4gICAgICAgICAgICAgICAgICAgIDogYGApO1xyXG4gICAgICAgIHZub2RlLmVsID0gbnVsbDtcclxuICAgICAgICBpZiAoaXNGcmFnbWVudCkge1xyXG4gICAgICAgICAgICAvLyByZW1vdmUgZXhjZXNzaXZlIGZyYWdtZW50IG5vZGVzXHJcbiAgICAgICAgICAgIGNvbnN0IGVuZCA9IGxvY2F0ZUNsb3NpbmdBc3luY0FuY2hvcihub2RlKTtcclxuICAgICAgICAgICAgd2hpbGUgKHRydWUpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG5leHQgPSBuZXh0U2libGluZyhub2RlKTtcclxuICAgICAgICAgICAgICAgIGlmIChuZXh0ICYmIG5leHQgIT09IGVuZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJlbW92ZShuZXh0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IG5leHQgPSBuZXh0U2libGluZyhub2RlKTtcclxuICAgICAgICBjb25zdCBjb250YWluZXIgPSBwYXJlbnROb2RlKG5vZGUpO1xyXG4gICAgICAgIHJlbW92ZShub2RlKTtcclxuICAgICAgICBwYXRjaChudWxsLCB2bm9kZSwgY29udGFpbmVyLCBuZXh0LCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWR0NvbnRhaW5lcihjb250YWluZXIpLCBzbG90U2NvcGVJZHMpO1xyXG4gICAgICAgIHJldHVybiBuZXh0O1xyXG4gICAgfTtcclxuICAgIGNvbnN0IGxvY2F0ZUNsb3NpbmdBc3luY0FuY2hvciA9IChub2RlKSA9PiB7XHJcbiAgICAgICAgbGV0IG1hdGNoID0gMDtcclxuICAgICAgICB3aGlsZSAobm9kZSkge1xyXG4gICAgICAgICAgICBub2RlID0gbmV4dFNpYmxpbmcobm9kZSk7XHJcbiAgICAgICAgICAgIGlmIChub2RlICYmIGlzQ29tbWVudChub2RlKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKG5vZGUuZGF0YSA9PT0gJ1snKVxyXG4gICAgICAgICAgICAgICAgICAgIG1hdGNoKys7XHJcbiAgICAgICAgICAgICAgICBpZiAobm9kZS5kYXRhID09PSAnXScpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2ggPT09IDApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5leHRTaWJsaW5nKG5vZGUpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF0Y2gtLTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIG5vZGU7XHJcbiAgICB9O1xyX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ICdwcm9kdWN0aW9uJykgJiYgaXNIbXJVcGRhdGluZyA/IGZhbHNlIDogISFuMi5keW5hbWljQ2hpbGRyZW4pID0+IHtcclxuICAgICAgICBpZiAobjEgPT09IG4yKSB7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gcGF0Y2hpbmcgJiBub3Qgc2FtZSB0eXBlLCB1bm1vdW50IG9sZCB0cmVlXHJcbiAgICAgICAgaWYgKG4xICYmICFpc1NhbWVWTm9kZVR5cGUobjEsIG4yKSkge1xyXG4gICAgICAgICAgICBhbmNob3IgPSBnZXROZXh0SG9zdE5vZGUobjEpO1xyXG4gICAgICAgICAgICB1bm1vdW50KG4xLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCB0cnVlKTtcclxuICAgICAgICAgICAgbjEgPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobjIucGF0Y2hGbGFnID09PSAtMiAvKiBCQUlMICovKSB7XHJcbiAgICAgICAgICAgIG9wdGltaXplZCA9IGZhbHNlO1xyXG4gICAgICAgICAgICBuMi5keW5hbWljQ2hpbGRyZW4gPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCB7IHR5cGUsIHJlZiwgc2hhcGVGbGFnIH0gPSBuMjtcclxuICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcclxuICAgICAgICAgICAgY2FzZSBUZXh0OlxyXG4gICAgICAgICAgICAgICAgcHJvY2Vzc1RleHQobjEsIG4yLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSBDb21tZW50OlxyXG4gICAgICAgICAgICAgICAgcHJvY2Vzc0NvbW1lbnROb2RlKG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IpO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgU3RhdGljOlxyXG4gICAgICAgICAgICAgICAgaWYgKG4xID09IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICBtb3VudFN0YXRpY05vZGUobjIsIGNvbnRhaW5lciwgYW5jaG9yLCBpc1NWRyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICBwYXRjaFN0YXRpY05vZGUobjEsIG4yLCBjb250YWluZXIsIGlzU1ZHKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIEZyYWdtZW50OlxyXG4gICAgICAgICAgICAgICAgcHJvY2Vzc0ZyYWdtZW50KG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgIGlmIChzaGFwZUZsYWcgJiAxIC8qIEVMRU1FTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzRWxlbWVudChuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hhcGVGbGFnICYgNiAvKiBDT01QT05FTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBwcm9jZXNzQ29tcG9uZW50KG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFwZUZsYWcgJiA2NCAvKiBURUxFUE9SVCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIHR5cGUucHJvY2VzcyhuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQsIGludGVybmFscyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGFwZUZsYWcgJiAxMjggLyogU1VTUEVOU0UgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICB0eXBlLnByb2Nlc3MobjEsIG4yLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkLCBpbnRlcm5hbHMpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgd2FybignSW52YWxpZCBWTm9kZSB0eXBlOicsIHR5cGUsIGAoJHt0eXBlb2YgdHlwZX0pYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIHNldCByZWZcclxuICAgICAgICBpZiAocmVmICE9IG51bGwgJiYgcGFyZW50Q29tcG9uZW50KSB7XHJcbiAgICAgICAgICAgIHNldFJlZihyZWYsIG4xICYmIG4xLnJlZiwgcGFyZW50U3VzcGVuc2UsIG4yIHx8IG4xLCAhbjIpO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBwcm9jZXNzVGV4dCA9IChuMSwgbjIsIGNvbnRhaW5lciwgYW5jaG9yKSA9PiB7XHJcbiAgICAgICAgaWYgKG4xID09IG51bGwpIHtcclxuICAgICAgICAgICAgaG9zdEluc2VydCgobjIuZWwgPSBob3N0Q3JlYXRlVGV4dChuMi5jaGlsZHJlbikpLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBjb25zdCBlbCA9IChuMi5lbCA9IG4xLmVsKTtcclxuICAgICAgICAgICAgaWYgKG4yLmNoaWxkcmVuICE9PSBuMS5jaGlsZHJlbikge1xyXG4gICAgICAgICAgICAgICAgaG9zdFNldFRleHQoZWwsIG4yLmNoaWxkcmVuKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBwcm9jZXNzQ29tbWVudE5vZGUgPSAobjEsIG4yLCBjb250YWluZXIsIGFuY2hvcikgPT4ge1xyXG4gICAgICAgIGlmIChuMSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIGhvc3RJbnNlcnQoKG4yLmVsID0gaG9zdENyZWF0ZUNvbW1lbnQobjIuY2hpbGRyZW4gfHwgJycpKSwgY29udGFpbmVyLCBhbmNob3IpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gdGhlcmUncyBubyBzdXBwb3J0IGZvciBkeW5hbWljIGNvbW1lbnRzXHJcbiAgICAgICAgICAgIG4yLmVsID0gbjEuZWw7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIGNvbnN0IG1vdW50U3RhdGljTm9kZSA9IChuMiwgY29udGFpbmVyLCBhbmNob3IsIGlzU1ZHKSA9PiB7XHJcbiAgICAgICAgW24yLmVsLCBuMi5hbmNob3JdID0gaG9zdEluc2VydFN0YXRpY0NvbnRlbnQobjIuY2hpbGRyZW4sIGNvbnRhaW5lciwgYW5jaG9yLCBpc1NWRyk7XHJcbiAgICB9O1xyXG4gICAgLyoqXHJcbiAgICAgKiBEZXYgLyBITVIgb25seVxyXG4gICAgICovXHJcbiAgICBjb25zdCBwYXRjaFN0YXRpY05vZGUgPSAobjEsIG4yLCBjb250YWluZXIsIGlzU1ZHKSA9PiB7XHJcbiAgICAgICAgLy8gc3RhdGljIG5vZGVzIGFyZSBvbmx5IHBhdGNoZWQgZHVyaW5nIGRldiBmb3IgSE1SXHJcbiAgICAgICAgaWYgKG4yLmNoaWxkcmVuICE9PSBuMS5jaGlsZHJlbikge1xyXG4gICAgICAgICAgICBjb25zdCBhbmNob3IgPSBob3N0TmV4dFNpYmxpbmcobjEuYW5jaG9yKTtcclxuICAgICAgICAgICAgLy8gcmVtb3ZlIGV4aXN0aW5nXHJcbiAgICAgICAgICAgIHJlbW92ZVN0YXRpY05vZGUobjEpO1xyXG4gICAgICAgICAgICBbbjIuZWwsIG4yLmFuY2hvcl0gPSBob3N0SW5zZXJ0U3RhdGljQ29udGVudChuMi5jaGlsZHJlbiwgY29udGFpbmVyLCBhbmNob3IsIGlzU1ZHKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIG4yLmVsID0gbjEuZWw7XHJcbiAgICAgICAgICAgIG4yLmFuY2hvciA9IG4xLmFuY2hvcjtcclxuICAgICAgICB9XHJcbiAgICB9O1xyXG4gICAgY29uc3QgbW92ZVN0YXRpY05vZGUgPSAoeyBlbCwgYW5jaG9yIH0sIGNvbnRhaW5lciwgbmV4dFNpYmxpbmcpID0+IHtcclxuICAgICAgICBsZXQgbmV4dDtcclxuICAgICAgICB3aGlsZSAoZWwgJiYgZWwgIT09IGFuY2hvcikge1xyXG4gICAgICAgICAgICBuZXh0ID0gaG9zdE5leHRTaWJsaW5nKGVsKTtcclxuICAgICAgICAgICAgaG9zdEluc2VydChlbCwgY29udGFpbmVyLCBuZXh0U2libGluZyk7XHJcbiAgICAgICAgICAgIGVsID0gbmV4dDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaG9zdEluc2VydChhbmNob3IsIGNvbnRhaW5lciwgbmV4dFNpYmxpbmcpO1xyXG4gICAgfTtcclxuICAgIGNvbnN0IHJlbW92ZVN0YXRpY05vZGUgPSAoeyBlbCwgYW5jaG9yIH0pID0+IHtcclxuICAgICAgICBsZXQgbmV4dDtcclxuICAgICAgICB3aGlsZSAoZWwgJiYgZWwgIT09IGFuY2hvcikge1xyXG4gICAgICAgICAgICBuZXh0ID0gaG9zdE5leHRTaWJsaW5nKGVsKTtcclxuICAgICAgICAgICAgaG9zdFJlbW92ZShlbCk7XHJcbiAgICAgICAgICAgIGVsID0gbmV4dDtcclxuICAgICAgICB9XHJcbiAgICAgICAgaG9zdFJlbW92ZShhbmNob3IpO1xyXG4gICAgfTtcclxuICAgIGNvbnN0IHByb2Nlc3NFbGVtZW50ID0gKG4xLCBuMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCkgPT4ge1xyXG4gICAgICAgIGlzU1ZHID0gaXNTVkcgfHwgbjIudHlwZSA9PT0gJ3N2Zyc7XHJcbiAgICAgICAgaWYgKG4xID09IG51bGwpIHtcclxuICAgICAgICAgICAgbW91bnRFbGVtZW50KG4yLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHBhdGNoRWxlbWVudChuMSwgbjIsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgfVxyXG4gIC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gICAgICAgICAgICAgICAgICAgaWYgKGtleSAhPT0gJ3ZhbHVlJyAmJiAhaXNSZXNlcnZlZFByb3Aoa2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBob3N0UGF0Y2hQcm9wKGVsLCBrZXksIG51bGwsIHByb3BzW2tleV0sIGlzU1ZHLCB2bm9kZS5jaGlsZHJlbiwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdW5tb3VudENoaWxkcmVuKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvKipcclxuICAgICAgICAgICAgICAgICAqIFNwZWNpYWwgY2FzZSBmb3Igc2V0dGluZyB2YWx1ZSBvbiBET00gZWxlbWVudHM6XHJcbiAgICAgICAgICAgICAgICAgKiAtIGl0IGNhbiBiZSBvcmRlci1zZW5zaXRpdmUgKGUuZy4gc2hvdWxkIGJlIHNldCAqYWZ0ZXIqIG1pbi9tYXgsICMyMzI1LCAjNDAyNClcclxuICAgICAgICAgICAgICAgICAqIC0gaXQgbmVlZHMgdG8gYmUgZm9yY2VkICgjMTQ3MSlcclxuICAgICAgICAgICAgICAgICAqICMyMzUzIHByb3Bvc2VzIGFkZGluZyBhbm90aGVyIHJlbmRlcmVyIG9wdGlvbiB0byBjb25maWd1cmUgdGhpcywgYnV0XHJcbiAgICAgICAgICAgICAgICAgKiB0aGUgcHJvcGVydGllcyBhZmZlY3RzIGFyZSBzbyBmaW5pdGUgaXQgaXMgd29ydGggc3BlY2lhbCBjYXNpbmcgaXRcclxuICAgICAgICAgICAgICAgICAqIGhlcmUgdG8gcmVkdWNlIHRoZSBjb21wbGV4aXR5LiAoU3BlY2lhbCBjYXNpbmcgaXQgYWxzbyBzaG91bGQgbm90XHJcbiAgICAgICAgICAgICAgICAgKiBhZmZlY3Qgbm9uLURPTSByZW5kZXJlcnMpXHJcbiAgICAgICAgICAgICAgICAgKi9cclxuICAgICAgICAgICAgICAgIGlmICgndmFsdWUnIGluIHByb3BzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgJ3ZhbHVlJywgbnVsbCwgcHJvcHMudmFsdWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCh2bm9kZUhvb2sgPSBwcm9wcy5vblZub2RlQmVmb3JlTW91bnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50Q29tcG9uZW50LCB2bm9kZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gc2NvcGVJZFxyXG4gICAgICAgICAgICBzZXRTY29wZUlkKGVsLCB2bm9kZSwgdm5vZGUuc2NvcGVJZCwgc2xvdFNjb3BlSWRzLCBwYXJlbnRDb21wb25lbnQpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHx8IF9fVlVFX1BST0RfREVWVE9PTFNfXykge1xyXG4gICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoZWwsICdfX3Zub2RlJywge1xyXG4gICAgICAgICAgICAgICAgdmFsdWU6IHZub2RlLFxyXG4gICAgICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2VcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShlbCwgJ19fdnVlUGFyZW50Q29tcG9uZW50Jywge1xyXG4gICAgICAgICAgICAgICAgdmFsdWU6IHBhcmVudENvbXBvbmVudCxcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IGZhbHNlXHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZGlycykge1xyXG4gICAgICAgICAgICBpbnZva2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bXBvbmVudCwgdm5vZGUpO1xyXG4gICAgICAgICAgICAgICAgbmVlZENhbGxUcmFuc2l0aW9uSG9va3MgJiYgdHJhbnNpdGlvbi5lbnRlcihlbCk7XHJcbiAgICAgICAgICAgICAgICBkaXJzICYmIGludm9rZURpcmVjdGl2ZUhvb2sodm5vZGUsIG51bGwsIHBhcmVudENvbXBvbmVudCwgJ21vdW50ZWQnKTtcclxuICAgICAgICAgICAgfSwgcGFyZW50U3VzcGVuc2UpO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBzZXRTY29wZUlkID0gKGVsLCB2bm9kZSwgc2NvcGVJZCwgc2xvdFNjb3BlSWRzLCBwYXJlbnRDb21wb25lbnQpID0+IHtcclxuICAgICAgICBpZiAoc2NvcGVJZCkge1xyXG4gICAgICAgICAgICBob3N0U2V0U2NvcGVJZChlbCwgc2NvcGVJZCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChzbG90U2NvcGVJZHMpIHtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzbG90U2NvcGVJZHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGhvc3RTZXRTY29wZUlkKGVsLCBzbG90U2NvcGVJZHNbaV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChwYXJlbnRDb21wb25lbnQpIHtcclxuICAgICAgICAgICAgbGV0IHN1YlRyZWUgPSBwYXJlbnRDb21wb25lbnQuc3ViVHJlZTtcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJlxyXG4gICAgICAgICAgICAgICAgc3ViVHJlZS5wYXRjaEZsYWcgPiAwICYmXHJcbiAgICAgICAgICAgICAgICBzdWJUcmVlLnBhdGNoRmxhZyAmIDIwNDggLyogREVWX1JPT1RfRlJBR01FTlQgKi8pIHtcclxuICAgICAgICAg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AgICAgICAgICAgICBpZiAob2xkUHJvcHMuY2xhc3MgIT09IG5ld1Byb3BzLmNsYXNzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhvc3RQYXRjaFByb3AoZWwsICdjbGFzcycsIG51bGwsIG5ld1Byb3BzLmNsYXNzLCBpc1NWRyk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gc3R5bGVcclxuICAgICAgICAgICAgICAgIC8vIHRoaXMgZmxhZyBpcyBtYXRjaGVkIHdoZW4gdGhlIGVsZW1lbnQgaGFzIGR5bmFtaWMgc3R5bGUgYmluZGluZ3NcclxuICAgICAgICAgICAgICAgIGlmIChwYXRjaEZsYWcgJiA0IC8qIFNUWUxFICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaG9zdFBhdGNoUHJvcChlbCwgJ3N0eWxlJywgb2xkUHJvcHMuc3R5bGUsIG5ld1Byb3BzLnN0eWxlLCBpc1NWRyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBwcm9wc1xyXG4gICAgICAgICAgICAgICAgLy8gVGhpcyBmbGFnIGlzIG1hdGNoZWQgd2hlbiB0aGUgZWxlbWVudCBoYXMgZHluYW1pYyBwcm9wL2F0dHIgYmluZGluZ3NcclxuICAgICAgICAgICAgICAgIC8vIG90aGVyIHRoYW4gY2xhc3MgYW5kIHN0eWxlLiBUaGUga2V5cyBvZiBkeW5hbWljIHByb3AvYXR0cnMgYXJlIHNhdmVkIGZvclxyXG4gICAgICAgICAgICAgICAgLy8gZmFzdGVyIGl0ZXJhdGlvbi5cclxuICAgICAgICAgICAgICAgIC8vIE5vdGUgZHluYW1pYyBrZXlzIGxpa2UgOltmb29dPVwiYmFyXCIgd2lsbCBjYXVzZSB0aGlzIG9wdGltaXphdGlvbiB0b1xyXG4gICAgICAgICAgICAgICAgLy8gYmFpbCBvdXQgYW5kIGdvIHRocm91Z2ggYSBmdWxsIGRpZmYgYmVjYXVzZSB3ZSBuZWVkIHRvIHVuc2V0IHRoZSBvbGQga2V5XHJcbiAgICAgICAgICAgICAgICBpZiAocGF0Y2hGbGFnICYgOCAvKiBQUk9QUyAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBmbGFnIGlzIHByZXNlbnQgdGhlbiBkeW5hbWljUHJvcHMgbXVzdCBiZSBub24tbnVsbFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb3BzVG9VcGRhdGUgPSBuMi5keW5hbWljUHJvcHM7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcm9wc1RvVXBkYXRlLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IHByb3BzVG9VcGRhdGVbaV07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHByZXYgPSBvbGRQcm9wc1trZXldO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBuZXh0ID0gbmV3UHJvcHNba2V5XTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gIzE0NzEgZm9yY2UgcGF0Y2ggdmFsdWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5leHQgIT09IHByZXYgfHwga2V5ID09PSAndmFsdWUnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBob3N0UGF0Y2hQcm9wKGVsLCBrZXksIHByZXYsIG5leHQsIGlzU1ZHLCBuMS5jaGlsZHJlbiwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdW5tb3VudENoaWxkcmVuKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyB0ZXh0XHJcbiAgICAgICAgICAgIC8vIFRoaXMgZmxhZyBpcyBtYXRjaGVkIHdoZW4gdGhlIGVsZW1lbnQgaGFzIG9ubHkgZHluYW1pYyB0ZXh0IGNoaWxkcmVuLlxyXG4gICAgICAgICAgICBpZiAocGF0Y2hGbGFnICYgMSAvKiBURVhUICovKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAobjEuY2hpbGRyZW4gIT09IG4yLmNoaWxkcmVuKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaG9zdFNldEVsZW1lbnRUZXh0KGVsLCBuMi5jaGlsZHJlbik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoIW9wdGltaXplZCAmJiBkeW5hbWljQ2hpbGRyZW4gPT0gbnVsbCkge1xyXG4gICAgICAgICAgICAvLyB1bm9wdGltaXplZCwgZnVsbCBkaWZmXHJcbiAgICAgICAgICAgIHBhdGNoUHJvcHMoZWwsIG4yLCBvbGRQcm9wcywgbmV3UHJvcHMsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCh2bm9kZUhvb2sgPSBuZXdQcm9wcy5vblZub2RlVXBkYXRlZCkgfHwgZGlycykge1xyXG4gICAgICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZlY3QoKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgdm5vZGVIb29rICYmIGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIHBhcmVudENvbXBvbmVudCwgbjIsIG4xKTtcclxuICAgICAgICAgICAgICAgIGRpcnMgJiYgaW52b2tlRGlyZWN0aXZlSG9vayhuMiwgbjEsIHBhcmVudENvbXBvbmVudCwgJ3VwZGF0ZWQnKTtcclxuICAgICAgICAgICAgfSwgcGFyZW50U3VzcGVuc2UpO1xyXG4gICAgICAgIH1cclxuICAgIH07XH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LCBuZXdQcm9wcywgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcpID0+IHtcclxuICAgICAgICBpZiAob2xkUHJvcHMgIT09IG5ld1Byb3BzKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIG5ld1Byb3BzKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBlbXB0eSBzdHJpbmcgaXMgbm90IHZhbGlkIHByb3BcclxuICAgICAgICAgICAgICAgIGlmIChpc1Jlc2VydmVkUHJvcChrZXkpKVxyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dCA9IG5ld1Byb3BzW2tleV07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBwcmV2ID0gb2xkUHJvcHNba2V5XTtcclxuICAgICAgICAgICAgICAgIC8vIGRlZmVyIHBhdGNoaW5nIHZhbHVlXHJcbiAgICAgICAgICAgICAgICBpZiAobmV4dCAhPT0gcHJldiAmJiBrZXkgIT09ICd2YWx1ZScpIHtcclxuICAgICAgICAgICAgICAgICAgICBob3N0UGF0Y2hQcm9wKGVsLCBrZXksIHByZXYsIG5leHQsIGlzU1ZHLCB2bm9kZS5jaGlsZHJlbiwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdW5tb3VudENoaWxkcmVuKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAob2xkUHJvcHMgIT09IEVNUFRZX09CSikge1xyXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgaW4gb2xkUHJvcHMpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWlzUmVzZXJ2ZWRQcm9wKGtleSkgJiYgIShrZXkgaW4gbmV3UHJvcHMpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGhvc3RQYXRjaFByb3AoZWwsIGtleSwgb2xkUHJv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4xLCBuMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChcclxuICAgICAgICAgICAgICAgIC8vICMyMDgwIGlmIHRoZSBzdGFibGUgZnJhZ21lbnQgaGFzIGEga2V5LCBpdCdzIGEgPHRlbXBsYXRlIHYtZm9yPiB0aGF0IG1heVxyXG4gICAgICAgICAgICAgICAgLy8gIGdldCBtb3ZlZCBhcm91bmQuIE1ha2Ugc3VyZSBhbGwgcm9vdCBsZXZlbCB2bm9kZXMgaW5oZXJpdCBlbC5cclxuICAgICAgICAgICAgICAgIC8vICMyMTM0IG9yIGlmIGl0J3MgYSBjb21wb25lbnQgcm9vdCwgaXQgbWF5IGFsc28gZ2V0IG1vdmVkIGFyb3VuZFxyXG4gICAgICAgICAgICAgICAgLy8gYXMgdGhlIGNvbXBvbmVudCBpcyBiZWluZyBtb3ZlZC5cclxuICAgICAgICAgICAgICAgIG4yLmtleSAhPSBudWxsIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgKHBhcmVudENvbXBvbmVudCAmJiBuMiA9PT0gcGFyZW50Q29tcG9uZW50LnN1YlRyZWUpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdHJhdmVyc2VTdGF0aWNDaGlsZHJlbihuMSwgbjIsIHRydWUgLyogc2hhbGxvdyAqLyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyBrZXllZCAvIHVua2V5ZWQsIG9yIG1hbnVhbCBmcmFnbWVudHMuXHJcbiAgICAgICAgICAgICAgICAvLyBmb3Iga2V5ZWQgJiB1bmtleWVkLCBzaW5jZSB0aGV5IGFyZSBjb21waWxlciBnZW5lcmF0ZWQgZnJvbSB2LWZvcixcclxuICAgICAgICAgICAgICAgIC8vIGVhY2ggY2hpbGQgaXMgZ3VhcmFudGVlZCB0byBiZSBhIGJsb2NrIHNvIHRoZSBmcmFnbWVudCB3aWxsIG5ldmVyXHJcbiAgICAgICAgICAgICAgICAvLyBoYXZlIGR5bmFtaWNDaGlsZHJlbi5cclxuICAgICAgICAgICAgICAgIHBhdGNoQ2hpbGRyZW4objEsIG4yLCBjb250YWluZXIsIGZyYWdtZW50RW5kQW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIGNvbnN0IHByb2Nlc3NDb21wb25lbnQgPSAobjEsIG4yLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKSA9PiB7XHJcbiAgICAgICAgbjIuc2xvdFNjb3BlSWRzID0gc2xvdFNjb3BlSWRzO1xyXG4gICAgICAgIGlmIChuMSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIGlmIChuMi5zaGFwZUZsYWcgJiA1MTIgLyogQ09NUE9ORU5UX0tFUFRfQUxJVkUgKi8pIHtcclxuICAgICAgICAgICAgICAgIHBhcmVudENvbXBvbmVudC5jdHguYWN0aXZhdGUobjIsIGNvbnRhaW5lciwgYW5jaG9yLCBpc1NWRywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG1vdW50Q29tcG9uZW50KG4yLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHVwZGF0ZUNvbXBvbmVudChuMSwgbjIsIG9wdGltaXplZCk7XH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4dChuMik7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB1cGRhdGVDb21wb25lbnRQcmVSZW5kZXIoaW5zdGFuY2UsIG4yLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHBvcFdhcm5pbmdDb250ZXh0KCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyBub3JtYWwgdXBkYXRlXHJcbiAgICAgICAgICAgICAgICBpbnN0YW5jZS5uZXh0ID0gbjI7XHJcbiAgICAgICAgICAgICAgICAvLyBpbiBjYXNlIHRoZSBjaGlsZCBjb21wb25lbnQgaXMgYWxzbyBxdWV1ZWQsIHJlbW92ZSBpdCB0byBhdm9pZFxyXG4gICAgICAgICAgICAgICAgLy8gZG91YmxlIHVwZGF0aW5nIHRoZSBzYW1lIGNoaWxkIGNvbXBvbmVudCBpbiB0aGUgc2FtZSBmbHVzaC5cclxuICAgICAgICAgICAgICAgIGludmFsaWRhdGVKb2IoaW5zdGFuY2UudXBkYXRlKTtcclxuICAgICAgICAgICAgICAgIC8vIGluc3RhbmNlLnVwZGF0ZSBpcyB0aGUgcmVhY3RpdmUgZWZmZWN0LlxyXG4gICAgICAgICAgICAgICAgaW5zdGFuY2UudXBkYXRlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIG5vIHVwZGF0ZSBuZWVkZWQuIGp1c3QgY29weSBvdmVyIHByb3BlcnRpZXNcclxuICAgICAgICAgICAgbjIuY29tcG9uZW50ID0gbjEuY29tcG9uZW50O1xyXG4gICAgICAgICAgICBuMi5lbCA9IG4xLmVsO1xyXG4gICAgICAgICAgICBpbnN0YW5jZS52bm9kZSA9IG4yO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBzZXR1cFJlbmRlckVmZmVjdCA9IChpbnN0YW5jZSwgaW5pdGlhbFZOb2RlLCBjb250YWluZXIsIGFuY2hvciwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBvcHRpbWl6ZWQpID0+IHtcclxuICAgICAgICBjb25zdCBjb21wb25lbnRVcGRhdGVGbiA9ICgpID0+IHtcclxuICAgICAgICAgICAgaWYgKCFpbnN0YW5jZS5pc01vdW50ZWQpIHtcclxuICAgICAgICAgICAgICAgIGxldCB2bm9kZUhvb2s7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IGVsLCBwcm9wcyB9ID0gaW5pdGlhbFZOb2RlO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgeyBibSwgbSwgcGFyZW50IH0gPSBpbnN0YW5jZTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGlzQXN5bmNXcmFwcGVyVk5vZGUgPSBpc0FzeW5jV3JhcHBlcihpbml0aWFsVk5vZGUpO1xyXG4gICAgICAgICAgICAgICAgZWZmZWN0LmFsbG93UmVjdXJzZSA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgLy8gYmVmb3JlTW91bnQgaG9va1xyXG4gICAgICAgICAgICAgICAgaWYgKGJtKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaW52b2tlQXJyYXlGbnMoYm0pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gb25Wbm9kZUJlZm9yZU1vdW50XHJcbiAgICAgICAgICAgICAgICBpZiAoIWlzQXN5bmNXcmFwcGVyVk5vZGUgJiZcclxuICAgICAgICAgICAgICAgICAgICAodm5vZGVIb29rID0gcHJvcHMgJiYgcHJvcHMub25Wbm9kZUJlZm9yZU1vdW50KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGludm9rZVZOb2RlSG9vayh2bm9kZUhvb2ssIHBhcmVudCwgaW5pdGlhbFZOb2RlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVmZmVjdC5hbGxvd1JlY3Vyc2UgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGVsICYmIGh5ZHJhdGVOb2RlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdm5vZGUgaGFzIGFkb3B0ZWQgaG9zdCBub2RlIC0gcGVyZm9ybSBoeWRyYXRpb24gaW5zdGVhZCBvZiBtb3VudC5cclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBoeWRyYXRlU3ViVHJlZSA9ICgpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaW5zdGFuY2Uuc3ViVHJlZSA9IHJlbmRlckNvbXBvbmVudFJvb3QoaW5zdGFuY2UpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRNZWFzdXJlKGluc3RhbmNlLCBgaHlkcmF0ZWApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGh5ZHJhdGVOb2RlKGVsLCBpbnN0YW5jZS5zdWJUcmVlLCBpbnN0YW5jZSwgcGFyZW50U3VzcGVuc2UsIG51bGwpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRNZWFzdXJlKGluc3RhbmNlLCBgaHlkcmF0ZWApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNBc3luY1dyYXBwZXJWTm9kZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsVk5vZGUudHlwZS5fX2FzeW5jTG9hZGVyKCkudGhlbihcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90ZTogd2UgYXJlIG1vdmluZyB0aGUgcmVuZGVyIGNhbGwgaW50byBhbiBhc3luYyBjYWxsYmFjayxcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2hpY2ggbWVhbnMgaXQgd29uJ3QgdHJhY2sgZGVwZW5kZW5jaWVzIC0gYnV0IGl0J3Mgb2sgYmVjYXVzZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBhIHNlcnZlci1yZW5kZXJlZCBhc3luYyB3cmFwcGVyIGlzIGFscmVhZHkgaW4gcmVzb2x2ZWQgc3RhdGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5kIGl0IHdpbGwgbmV2ZXIgbmVlZCB0byBjaGFuZ2UuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICgpID0+ICFpbnN0YW5jZS5pc1VubW91bnRlZCAmJiBoeWRyYXRlU3ViVHJlZSgpKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGh5ZHJhdGVTdWJUcmVlKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGByZW5kZXJgKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3ViVHJlZSA9IChpbnN0YW5jZS5zdWJUcmVlID0gcmVuZGVyQ29tcG9uZW50Um9vdChpbnN0YW5jZSkpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW5kTWVhc3VyZShpbnN0YW5jZSwgYHJlbmRlcmApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0TWVhc3VyZShpbnN0YW5jZSwgYHBhdGNoYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoKG51bGwsIHN1YlRyZWUsIGNvbnRhaW5lciwgYW5jaG9yLCBpbnN0YW5jZSwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpbml0aWFsVk5vZGUuZWwgPSBzdWJUcmVlLmVsO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gbW91bnRlZCBob29rXHJcbiAgICAgICAgICAgICAgICBpZiAobSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHF1ZXVlUG9zdFJlbmRlckVmZmVjdChtLCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBvblZub2RlTW91bnRlZFxyXG4gICAgICAgICAgICAgICAgaWYgKCFpc0FzeW5jV3JhcHBlclZOb2RlICYmXHJcbiAgICAgICAgICAgICAgICAgICAgKHZub2RlSG9vayA9IHByb3BzICYmIHByb3BzLm9uVm5vZGVNb3VudGVkKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNjb3BlZEluaXRpYWxWTm9kZSA9IGluaXRpYWxWTm9kZTtcclxuICAgICAgICAgICAgICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZlY3QoKCkgPT4gaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50LCBzY29wZWRJbml0aWFsVk5vZGUpLCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBhY3RpdmF0ZWQgaG9vayBmb3Iga2VlcC1hbGl2ZSByb290cy5cclxuICAgICAgICAgICAgICAgIC8vICMxNzQyIGFjdGl2YXRlZCBob29rIG11c3QgYmUgYWNjZXNzZWQgYWZ0ZXIgZmlyc3QgcmVuZGVyXHJcbiAgICAgICAgICAgICAgICAvLyBzaW5jZSB0aGUgaG9vayBtYXkgYmUgaW5qZWN0ZWQgYnkgYSBjaGlsZCBrZWVwLWFsaXZlXHJcbiAgICAgICAgICAgICAgICBpZiAoaW5pdGlhbFZOb2RlLnNoYXBlRmxhZyAmIDI1NiAvKiBDT01QT05FTlRfU0hPVUxEX0tFRVBfQUxJVkUgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBpbnN0YW5jZS5hICYmIHF1ZXVlUG9zdFJlbmRlckVmZmVjdChpbnN0YW5jZS5hLCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpbnN0YW5jZS5pc01vdW50ZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB8fCBfX1ZVRV9QUk9EX0RFVlRPT0xTX18pIHtcclxuICAgICAgICAgICAgICAgICAgICBkZXZ0b29sc0NvbXBvbmVudEFkZGVkKGluc3RhbmNlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vICMyNDU4OiBkZWZlcmVuY2UgbW91bnQtb25seSBvYmplY3QgcGFyYW1ldGVycyB0byBwcmV2ZW50IG1lbWxlYWtzXHJcbiAgICAgICAgICAgICAgICBpbml0aWFsVk5vZGUgPSBjb250YWluZXIgPSBhbmNob3IgPSBudWxsO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gdXBkYXRlQ29tcG9uZW50XHJcbiAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIHRyaWdnZXJlZCBieSBtdXRhdGlvbiBvZiBjb21wb25lbnQncyBvd24gc3RhdGUgKG5leHQ6IG51bGwpXHJcbiAgICAgICAgICAgICAgICAvLyBPUiBwYXJlbnQgY2FsbGluZyBwcm9jZXNzQ29tcG9uZW50IChuZXh0OiBWTm9kZSlcclxuICAgICAgICAgICAgICAgIGxldCB7IG5leHQsIGJ1LCB1LCBwYXJlbnQsIHZub2RlIH0gPSBpbnN0YW5jZTtcclxuICAgICAgICAgICAgICAgIGxldCBvcmlnaW5OZXh0ID0gbmV4dDtcclxuICAgICAgICAgICAgICAgIGxldCB2bm9kZUhvb2s7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcHVzaFdhcm5pbmdDb250ZXh0KG5leHQgfHwgaW5zdGFuY2Uudm5vZGUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gRGlzYWxsb3cgY29tcG9uZW50IGVmZmVjdCByZWN1cnNpb24gZHVyaW5nIHByZS1saWZlY3ljbGUgaG9va3MuXHJcbiAgICAgICAgICAgICAgICBlZmZlY3QuYWxsb3dSZWN1cnNlID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICBpZiAobmV4dCkge1xyXG4gICAgICAgICAgICAgICAgICAgIG5leHQuZWwgPSB2bm9kZS5lbDtcclxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb21wb25lbnRQcmVSZW5kZXIoaW5zdGFuY2UsIG5leHQsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBuZXh0ID0gdm5vZGU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBiZWZvcmVVcGRhdGUgaG9va1xyXG4gICAgICAgICAgICAgICAgaWYgKGJ1KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaW52b2tlQXJyYXlGbnMoYnUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gb25Wbm9kZUJlZm9yZVVwZGF0ZVxyXG4gICAgICAgICAgICAgICAgaWYgKCh2bm9kZUhvb2sgPSBuZXh0LnByb3BzICYmIG5leHQucHJvcHMub25Wbm9kZUJlZm9yZVVwZGF0ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnQsIG5leHQsIHZub2RlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVmZmVjdC5hbGxvd1JlY3Vyc2UgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgLy8gcmVuZGVyXHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhcnRNZWFzdXJlKGluc3RhbmNlLCBgcmVuZGVyYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCBuZXh0VHJlZSA9IHJlbmRlckNvbXBvbmVudFJvb3QoaW5zdGFuY2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGVuZE1lYXN1cmUoaW5zdGFuY2UsIGByZW5kZXJgKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0IHByZXZUcmVlID0gaW5zdGFuY2Uuc3ViVHJlZTtcclxuICAgICAgICAgICAgICAgIGluc3RhbmNlLnN1YlRyZWUgPSBuZXh0VHJlZTtcclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBwYXRjaGApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgcGF0Y2gocHJldlRyZWUsIG5leHRUcmVlLCBcclxuICAgICAgIC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clxuICAgICAgICAgICAgICAgIGlmICh1KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KHUsIHBhcmVudFN1c3BlbnNlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIG9uVm5vZGVVcGRhdGVkXHJcbiAgICAgICAgICAgICAgICBpZiAoKHZub2RlSG9vayA9IG5leHQucHJvcHMgJiYgbmV4dC5wcm9wcy5vblZub2RlVXBkYXRlZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBxdWV1ZVBvc3RSZW5kZXJFZmZlY3QoKCkgPT4gaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50LCBuZXh0LCB2bm9kZSksIHBhcmVudFN1c3BlbnNlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgfHwgX19WVUVfUFJPRF9ERVZUT09MU19fKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZGV2dG9vbHNDb21wb25lbnRVcGRhdGVkKGluc3RhbmNlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICBwb3BXYXJuaW5nQ29udGV4dCgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgICAgICAvLyBjcmVhdGUgcmVhY3RpdmUgZWZmZWN0IGZvciByZW5kZXJpbmdcclxuICAgICAgICBjb25zdCBlZmZlY3QgPSBuZXcgUmVhY3RpdmVFZmZlY3QoY29tcG9uZW50VXBkYXRlRm4sICgpID0+IHF1ZXVlSm9iKGluc3RhbmNlLnVwZGF0ZSksIGluc3RhbmNlLnNjb3BlIC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JlbiBoYXMgMyBwb3NzaWJpbGl0aWVzOiB0ZXh0LCBhcnJheSBvciBubyBjaGlsZHJlbi5cclxuICAgICAgICBpZiAoc2hhcGVGbGFnICYgOCAvKiBURVhUX0NISUxEUkVOICovKSB7XHJcbiAgICAgICAgICAgIC8vIHRleHQgY2hpbGRyZW4gZmFzdCBwYXRoXHJcbiAgICAgICAgICAgIGlmIChwcmV2U2hhcGVGbGFnICYgMTYgLyogQVJSQVlfQ0hJTERSRU4gKi8pIHtcclxuICAgICAgICAgICAgICAgIHVubW91bnRDaGlsZHJlbihjMSwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGMyICE9PSBjMSkge1xyXG4gICAgICAgICAgICAgICAgaG9zdFNldEVsZW1lbnRUZXh0KGNvbnRhaW5lciwgYzIpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAocHJldlNoYXBlRmxhZyAmIDE2IC8qIEFSUkFZX0NISUxEUkVOICovKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBwcmV2IGNoaWxkcmVuIHdhcyBhcnJheVxyXG4gICAgICAgICAgICAgICAgaWYgKHNoYXBlRmxhZyAmIDE2IC8qIEFSUkFZX0NISUxEUkVOICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdHdvIGFycmF5cywgY2Fubm90IGFzc3VtZSBhbnl0aGluZywgZG8gZnVsbCBkaWZmXHJcbiAgICAgICAgICAgICAgICAgICAgcGF0Y2hLZXllZENoaWxkcmVuKGMxLCBjMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBubyBuZXcgY2hpbGRyZW4sIGp1c3QgdW5tb3VudCBvbGRcclxuICAgICAgICAgICAgICAgICAgICB1bm1vdW50Q2hpbGRyZW4oYzEsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gcHJldiBjaGlsZHJlbiB3YXMgdGV4dCBPUiBudWxsXHJcbiAgICAgICAgICAgICAgICAvLyBuZXcgY2hpbGRyZW4gaXMgYXJyYXkgT1IgbnVsbFxyXG4gICAgICAgICAgICAgICAgaWYgKHByZXZTaGFwZUZsYWcgJiA4IC8qIFRFWFRfQ0hJTERSRU4gKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBob3N0U2V0RWxlbWVudFRleHQoY29udGFpbmVyLCAnJyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBtb3VudCBuZXcgaWYgYXJyYXlcclxuICAgICAgICAgICAgICAgIGlmIChzaGFwZUZsYWcgJiAxNiAvKiBBUlJBWV9DSElMRFJFTiAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIG1vdW50Q2hpbGRyZW4oYzIsIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIGNvbnN0IHBhdGNoVW5rZXllZENoaWxkcmVuID0gKGMxLCBjMiwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJ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VyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCwgY29tbW9uTGVuZ3RoKTtcclxuICAgICAgICB9XHJcbiAgICB9O1xyXG4gICAgLy8gY2FuIGJlIGFsbC1rZXllZCBvciBtaXhlZFxyXG4gICAgY29uc3QgcGF0Y2hLZXllZENoaWxkcmVuID0gKGMxLCBjMiwgY29udGFpbmVyLCBwYXJlbnRBbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCkgPT4ge1xyXG4gICAgICAgIGxldCBpID0gMDtcclxuICAgICAgICBjb25zdCBsMiA9IGMyLmxlbmd0aDtcclxuICAgICAgICBsZXQgZTEgPSBjMS5sZW5ndGggLSAxOyAvLyBwcmV2IGVuZGluZyBpbmRleFxyXG4gICAgICAgIGxldCBlMiA9IGwyIC0gMTsgLy8gbmV4dCBlbmRpbmcgaW5kZXhcclxuICAgICAgICAvLyAxLiBzeW5jIGZyb20gc3RhcnRcclxuICAgICAgICAvLyAoYSBiKSBjXHJcbiAgICAgICAgLy8gKGEgYikgZCBlXHJcbiAgICAgICAgd2hpbGUgKGkgPD0gZTEgJiYgaSA8PSBlMikge1xyXG4gICAgICAgICAgICBjb25zdCBuMSA9IGMxW2ldO1xyXG4gICAgICAgICAgICBjb25zdCBuMiA9IChjMltpXSA9IG9wdGltaXplZFxyXG4gICAgICAgICAgICAgICAgPyBjbG9uZUlmTW91bnRlZChjMltpXSlcclxuICAgICAgICAgICAgICAgIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pKTtcclxuICAgICAgICAgICAgaWYgKGlzU2FtZVZOb2RlVHlwZShuMSwgbjIpKSB7XHJcbiAgICAgICAgICAgICAgICBwYXRjaChuMSwgbjIsIGNvbnRhaW5lciwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGkrKztcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gMi4gc3luYyBmcm9tIGVuZFxyXG4gICAgICAgIC8vIGEgKGIgYylcclxuICAgICAgICAvLyBkIGUgKGIgYylcclxuICAgICAgICB3aGlsZSAoaSA8PSBlMSAmJiBpIDw9IGUyKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG4xID0gYzFbZTFdO1xyXG4gICAgICAgICAgICBjb25zdCBuMiA9IChjMltlMl0gPSBvcHRpbWl6ZWRcclxuICAgICAgICAgICAgICAgID8gY2xvbmVJZk1vdW50ZWQoYzJbZTJdKVxyXG4gICAgICAgICAgICAgICAgOiBub3JtYWxpemVWTm9kZShjMltlMl0pKTtcclxuICAgICAgICAgICAgaWYgKGlzU2FtZVZOb2RlVHlwZShuMSwgbjIpKSB7XHJcbiAgICAgICAgICAgICAgICBwYXRjaChuMSwgbjIsIGNvbnRhaW5lciwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgaXNTVkcsIHNsb3RTY29wZUlkcywgb3B0aW1pemVkKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGUxLS07XHJcbiAgICAgICAgICAgIGUyLS07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIDMuIGNvbW1vbiBzZXF1ZW5jZSArIG1vdW50XHJcbiAgICAgICAgLy8gKGEgYilcclxuICAgICAgICAvLyAoYSBiKSBjXHJcbiAgICAgICAgLy8gaSA9IDIsIGUxID0gMSwgZTIgPSAyXHJcbiAgICAgICAgLy8gKGEgYilcclxuICAgICAgICAvLyBjIChhIGIpXHJcbiAgICAgICAgLy8gaSA9IDAsIGUxID0gLTEsIGUyID0gMFxyXG4gICAgICAgIGlmIChpID4gZTEpIHtcclxuICAgICAgICAgICAgaWYgKGkgPD0gZTIpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG5leHRQb3MgPSBlMiArIDE7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBhbmNob3IgPSBuZXh0UG9zIDwgbDIgPyBjMltuZXh0UG9zXS5lbCA6IHBhcmVudEFuY2hvcjtcclxuICAgICAgICAgICAgICAgIHdoaWxlIChpIDw9IGUyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcGF0Y2gobnVsbCwgKGMyW2ldID0gb3B0aW1pemVkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gY2xvbmVJZk1vdW50ZWQoYzJbaV0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pKSwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaSsrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIDQuIGNvbW1vbiBzZXF1ZW5jZSArIHVubW91bnRcclxuICAgICAgICAvLyAoYSBiKSBjXHJcbiAgICAgICAgLy8gKGEgYilcclxuICAgICAgICAvLyBpID0gMiwgZTEgPSAyLCBlMiA9IDFcclxuICAgICAgICAvLyBhIChiIGMpXHJcbiAgICAgICAgLy8gKGIgYylcclxuICAgICAgICAvLyBpID0gMCwgZTEgPSAwLCBlMiA9IC0xXHJcbiAgICAgICAgZWxzZSBpZiAoaSA+IGUyKSB7XHJcbiAgICAgICAgICAgIHdoaWxlIChpIDw9IGUxKSB7XHJcbiAgICAgICAgICAgICAgICB1bm1vdW50KGMxW2ldLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCB0cnVlKTtcclxuICAgICAgICAgICAgICAgIGkrKztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyA1LiB1bmtub3duIHNlcXVlbmNlXHJcbiAgICAgICAgLy8gW2kgLi4uIGUxICsgMV06IGEgYiBbYyBkIGVdIGYgZ1xyXG4gICAgICAgIC8vIFtpIC4uLiBlMiArIDFdOiBhIGIgW2UgZCBjIGhdIGYgZ1xyXG4gICAgICAgIC8vIGkgPSAyLCBlMSA9IDQsIGUyID0gNVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBjb25zdCBzMSA9IGk7IC8vIHByZXYgc3RhcnRpbmcgaW5kZXhcclxuICAgICAgICAgICAgY29uc3QgczIgPSBpOyAvLyBuZXh0IHN0YXJ0aW5nIGluZGV4XHJcbiAgICAgICAgICAgIC8vIDUuMSBidWlsZCBrZXk6aW5kZXggbWFwIGZvciBuZXdDaGlsZHJlblxyXG4gICAgICAgICAgICBjb25zdCBrZXlUb05ld0luZGV4TWFwID0gbmV3IE1hcCgpO1xyXG4gICAgICAgICAgICBmb3IgKGkgPSBzMjsgaSA8PSBlMjsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBuZXh0Q2hpbGQgPSAoYzJbaV0gPSBvcHRpbWl6ZWRcclxuICAgICAgICAgICAgICAgICAgICA/IGNsb25lSWZNb3VudGVkKGMyW2ldKVxyXG4gICAgICAgICAgICAgICAgICAgIDogbm9ybWFsaXplVk5vZGUoYzJbaV0pKTtcclxuICAgICAgICAgICAgICAgIGlmIChuZXh0Q2hpbGQua2V5ICE9IG51bGwpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGtleVRvTmV3SW5kZXhNYXAuaGFzKG5leHRDaGlsZC5rZXkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oYER1cGxpY2F0ZSBrZXlzIGZvdW5kIGR1cmluZyB1cGRhdGU6YCwgSlNPTi5zdHJpbmdpZnkobmV4dENoaWxkLmtleSksIGBNYWtlIHN1cmUga2V5cyBhcmUgdW5pcXVlLmApO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBrZXlUb05ld0luZGV4TWFwLnNldChuZXh0Q2hpbGQua2V5LCBpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyA1LjIgbG9vcCB0aHJvdWdoIG9sZCBjaGlsZHJlbiBsZWZ0IHRvIGJlIHBhdGNoZWQgYW5kIHRyeSB0byBwYXRjaFxyXG4gICAgICAgICAgICAvLyBtYXRjaGluZyBub2RlcyAmIHJlbW92ZSBub2RlcyB0aGF0IGFyZSBubyBsb25nZXIgcHJlc2VudFxyXG4gICAgICAgICAgICBsZXQgajtcclxuICAgICAgICAgICAgbGV0IHBhdGNoZWQgPSAwO1xyXG4gICAgICAgICAgICBjb25zdCB0b0JlUGF0Y2hlZCA9IGUyIC0gczIgKyAxO1xyXG4gICAgICAgICAgICBsZXQgbW92ZWQgPSBmYWxzZTtcclxuICAgICAgICAgICAgLy8gdXNlZCB0byB0cmFjayB3aGV0aGVyIGFueSBub2RlIGhhcyBtb3ZlZFxyXG4gICAgICAgICAgICBsZXQgbWF4TmV3SW5kZXhTb0ZhciA9IDA7XHJcbiAgICAgICAgICAgIC8vIHdvcmtzIGFzIE1hcDxuZXdJbmRleCwgb2xkSW5kZXg+XHJcbiAgICAgICAgICAgIC8vIE5vdGUgdGhhdCBvbGRJbmRleCBpcyBvZmZzZXQgYnkgKzFcclxuICAgICAgICAgICAgLy8gYW5kIG9sZEluZGV4ID0gMCBpcyBhIHNwZWNpYWwgdmFsdWUgaW5kaWNhdGluZyB0aGUgbmV3IG5vZGUgaGFzXHJcbiAgICAgICAgICAgIC8vIG5vIGNvcnJlc3BvbmRpbmcgb2xkIG5vZGUuXHJcbiAgICAgICAgICAgIC8vIHVzZWQgZm9yIGRldGVybWluaW5nIGxvbmdlc3Qgc3RhYmxlIHN1YnNlcXVlbmNlXHJcbiAgICAgICAgICAgIGNvbnN0IG5ld0luZGV4VG9PbGRJbmRleE1hcCA9IG5ldyBBcnJheSh0b0JlUGF0Y2hlZCk7XHJcbiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCB0b0JlUGF0Y2hlZDsgaSsrKVxyXG4gICAgICAgICAgICAgICAgbmV3SW5kZXhUb09sZEluZGV4TWFwW2ldID0gMDtcclxuICAgICAgICAgICAgZm9yIChpID0gczE7IGkgPD0gZTE7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcHJldkNoaWxkID0gYzFbaV07XHJcbiAgICAgICAgICAgICAgICBpZiAocGF0Y2hlZCA+PSB0b0JlUGF0Y2hlZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFsbCBuZXcgY2hpbGRyZW4gaGF2ZSBiZWVuIHBhdGNoZWQgc28gdGhpcyBjYW4gb25seSBiZSBhIHJlbW92YWxcclxuICAgICAgICAgICAgICAgICAgICB1bm1vdW50KHByZXZDaGlsZCwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBsZXQgbmV3SW5kZXg7XHJcbiAgICAgICAgICAgICAgICBpZiAocHJldkNoaWxkLmtleSAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3SW5kZXggPSBrZXlUb05ld0luZGV4TWFwLmdldChwcmV2Q2hpbGQua2V5KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGtleS1sZXNzIG5vZGUsIHRyeSB0byBsb2NhdGUgYSBrZXktbGVzcyBub2RlIG9mIHRoZSBzYW1lIHR5cGVcclxuICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBzMjsgaiA8PSBlMjsgaisrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdJbmRleFRvT2xkSW5kZXhNYXBbaiAtIHMyXSA9PT0gMCAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTYW1lVk5vZGVUeXBlKHByZXZDaGlsZCwgYzJbal0pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdJbmRleCA9IGo7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChuZXdJbmRleCA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdW5tb3VudChwcmV2Q2hpbGQsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3SW5kZXhUb09sZEluZGV4TWFwW25ld0luZGV4IC0gczJdID0gaSArIDE7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5ld0luZGV4ID49IG1heE5ld0luZGV4U29GYXIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWF4TmV3SW5kZXhTb0ZhciA9IG5ld0luZGV4O1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbW92ZWQgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBwYXRjaChwcmV2Q2hpbGQsIGMyW25ld0luZGV4XSwgY29udGFpbmVyLCBudWxsLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoZWQrKztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyA1LjMgbW92ZSBhbmQgbW91bnRcclxuICAgICAgICAgICAgLy8gZ2VuZXJhdGUgbG9uZ2VzdCBzdGFibGUgc3Vic2VxdWVuY2Ugb25seSB3aGVuIG5vZGVzIGhhdmUgbW92ZWRcclxuICAgICAgICAgICAgY29uc3QgaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2UgPSBtb3ZlZFxyXG4gICAgICAgICAgICAgICAgPyBnZXRTZXF1ZW5jZShuZXdJbmRleFRvT2xkSW5kZXhNYXApXHJcbiAgICAgICAgICAgICAgICA6IEVNUFRZX0FSUjtcclxuICAgICAgICAgICAgaiA9IGluY3JlYXNpbmdOZXdJbmRleFNlcXVlbmNlLmxlbmd0aCAtIDE7XHJcbiAgICAgICAgICAgIC8vIGxvb3BpbmcgYmFja3dhcmRzIHNvIHRoYXQgd2UgY2FuIHVzZSBsYXN0IHBhdGNoZWQgbm9kZSBhcyBhbmNob3JcclxuICAgICAgICAgICAgZm9yIChpID0gdG9CZVBhdGNoZWQgLSAxOyBpID49IDA7IGktLSkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dEluZGV4ID0gczIgKyBpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgbmV4dENoaWxkID0gYzJbbmV4dEluZGV4XTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGFuY2hvciA9IG5leHRJbmRleCArIDEgPCBsMiA/IGMyW25leHRJbmRleCArIDFdLmVsIDogcGFyZW50QW5jaG9yO1xyXG4gICAgICAgICAgICAgICAgaWYgKG5ld0luZGV4VG9PbGRJbmRleE1hcFtpXSA9PT0gMCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIG1vdW50IG5ld1xyXG4gICAgICAgICAgICAgICAgICAgIHBhdGNoKG51bGwsIG5leHRDaGlsZCwgY29udGFpbmVyLCBhbmNob3IsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGlzU1ZHLCBzbG90U2NvcGVJZHMsIG9wdGltaXplZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChtb3ZlZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIG1vdmUgaWY6XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmUgaXMgbm8gc3RhYmxlIHN1YnNlcXVlbmNlIChlLmcuIGEgcmV2ZXJzZSlcclxuICAgICAgICAgICAgICAgICAgICAvLyBPUiBjdXJyZW50IG5vZGUgaXMgbm90IGFtb25nIHRoZSBzdGFibGUgc2VxdWVuY2VcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaiA8IDAgfHwgaSAhPT0gaW5jcmVhc2luZ05ld0luZGV4U2VxdWVuY2Vbal0pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbW92ZShuZXh0Q2hpbGQsIGNvbnRhaW5lciwgYW5jaG9yLCAyIC8qIFJFT1JERVIgKi8pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgai0tO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBtb3ZlID0gKHZub2RlLCBjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUsIHBhcmVudFN1c3BlbnNlID0gbnVsbCkgPT4ge1xyXG4gICAgICAgIGNvbnN0IHsgZWwsIHR5cGUsIHRyYW5zaXRpb24sIGNoaWxkcmVuLCBzaGFwZUZsYWcgfSA9IHZub2RlO1xyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiA2IC8qIENPTVBPTkVOVCAqLykge1xyXG4gICAgICAgICAgICBtb3ZlKHZub2RlLmNvbXBvbmVudC5zdWJUcmVlLCBjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiAxMjggLyogU1VTUEVOU0UgKi8pIHtcclxuICAgICAgICAgICAgdm5vZGUuc3VzcGVuc2UubW92ZShjb250YWluZXIsIGFuY2hvciwgbW92ZVR5cGUpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiA2NCAvKiBURUxFUE9SVCAqLykge1xyXG4gICAgICAgICAgICB0eXBlLm1vdmUodm5vZGUsIGNvbnRhaW5lciwgYW5jaG9yLCBpbnRlcm5hbHMpO1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0eXBlID09PSBGcmFnbWVudCkge1xyXG4gICAgICAgICAgICBob3N0SW5zZXJ0KGVsLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIG1vdmUoY2hpbGRyZW5baV0sIGNvbnRhaW5lciwgYW5jaG9yLCBtb3ZlVHlwZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaG9zdEluc2VydCh2bm9kZS5hbmNob3IsIGNvbnRhaW5lciwgYW5jaG9yKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodHlwZSA9PT0gU3RhdGljKSB7XHJcbiAgICAgICAgICAgIG1vdmVTdGF0aWNOb2RlKHZub2RlLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gc2luZ2xlIG5vZGVzXHJcbiAgICAgICAgY29uc3QgbmVlZFRyYW5zaXRpb24gPSBtb3ZlVHlwZSAhPT0gMiAvKiBSRU9SREVSICovICYmXHJcbiAgICAgICAgICAgIHNoYXBlRmxhZyAmIDEgLyogRUxFTUVOVCAqLyAmJlxyXG4gICAgICAgICAgICB0cmFuc2l0aW9uO1xyXG4gICAgICAgIGlmIChuZWVkVHJhbnNpdGlvbikge1xyXG4gICAgICAgICAgICBpZiAobW92ZVR5cGUgPT09IDAgLyogRU5URVIgKi8pIHtcclxuICAgICAgICAgICAgICAgIHRyYW5zaXRpb24uYmVmb3JlRW50ZXIoZWwpO1xyXG4gICAgICAgICAgICAgICAgaG9zdEluc2VydChlbCwgY29udGFpbmVyLCBhbmNob3IpO1xyXG4gICAgICAgICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KCgpID0+IHRyYW5zaXRpb24uZW50ZXIoZWwpLCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IGxlYXZlLCBkZWxheUxlYXZlLCBhZnRlckxlYXZlIH0gPSB0cmFuc2l0aW9uO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcmVtb3ZlID0gKCkgPT4gaG9zdEluc2VydChlbCwgY29udGFpbmVyLCBhbmNob3IpO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcGVyZm9ybUxlYXZlID0gKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGxlYXZlKGVsLCAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBhZnRlckxlYXZlICYmIGFmdGVyTGVhdmUoKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICBpZiAoZGVsYXlMZWF2ZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGRlbGF5TGVhdmUoZWwsIHJlbW92ZSwgcGVyZm9ybUxlYXZlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIHBlcmZvcm1MZWF2ZSgpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBob3N0SW5zZXJ0KGVsLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIGNvbnN0IHVubW91bnQgPSAodm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGRvUmVtb3ZlID0gZmFsc2UsIG9wdGltaXplZCA9IGZhbHNlKSA9PiB7XHJcbiAgICAgICAgY29uc3QgeyB0eXBlLCBwcm9wcywgcmVmLCBjaGlsZHJlbiwgZHluYW1pY0NoaWxkcmVuLCBzaGFwZUZsYWcsIHBhdGNoRmxhZywgZGlycyB9ID0gdm5vZGU7XHJcbiAgICAgICAgLy8gdW5zZXQgcmVmXHJcbiAgICAgICAgaWYgKHJlZiAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgIHNldFJlZihyZWYsIG51bGwsIHBhcmVudFN1c3BlbnNlLCB2bm9kZSwgdHJ1ZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiAyNTYgLyogQ09NUE9ORU5UX1NIT1VMRF9LRUVQX0FMSVZFICovKSB7XHJcbiAgICAgICAgICAgIHBhcmVudENvbXBvbmVudC5jdHguZGVhY3RpdmF0ZSh2bm9kZSk7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3Qgc2hvdWxkSW52b2tlRGlycyA9IHNoYXBlRmxhZyAmIDEgLyogRUxFTUVOVCAqLyAmJiBkaXJzO1xyXG4gICAgICAgIGNvbnN0IHNob3VsZEludm9rZVZub2RlSG9vayA9ICFpc0FzeW5jV3JhcHBlcih2bm9kZSk7XHJcbiAgICAgICAgbGV0IHZub2RlSG9vaztcclxuICAgICAgICBpZiAoc2hvdWxkSW52b2tlVm5vZGVIb29rICYmXHJcbiAgICAgICAgICAgICh2bm9kZUhvb2sgPSBwcm9wcyAmJiBwcm9wcy5vblZub2RlQmVmb3JlVW5tb3VudCkpIHtcclxuICAgICAgICAgICAgaW52b2tlVk5vZGVIb29rKHZub2RlSG9vaywgcGFyZW50Q29tcG9uZW50LCB2bm9kZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiA2IC8qIENPTVBPTkVOVCAqLykge1xyXG4gICAgICAgICAgICB1bm1vdW50Q29tcG9uZW50KHZub2RlLmNvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGRvUmVtb3ZlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGlmIChzaGFwZUZsYWcgJiAxMjggLyogU1VTUEVOU0UgKi8pIHtcclxuICAgICAgICAgICAgICAgIHZub2RlLnN1c3BlbnNlLnVubW91bnQocGFyZW50U3VzcGVuc2UsIGRvUmVtb3ZlKTtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoc2hvdWxkSW52b2tlRGlycykge1xyXG4gICAgICAgICAgICAgICAgaW52b2tlRGlyZWN0aXZlSG9vayh2bm9kZSwgbnVsbCwgcGFyZW50Q29tcG9uZW50LCAnYmVmb3JlVW5tb3VudCcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChzaGFwZUZsYWcgJiA2NCAvKiBURUxFUE9SVCAqLykge1xyXG4gICAgICAgICAgICAgICAgdm5vZGUudHlwZS5yZW1vdmUodm5vZGUsIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIG9wdGltaXplZCwgaW50ZXJuYWxzLCBkb1JlbW92ZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoZHluYW1pY0NoaWxkcmVuICYmXHJcbiAgICAgICAgICAgICAgICAvLyAjMTE1MzogZmFzdCBwYXRoIHNob3VsZCBub3QgYmUgdGFrZW4gZm9yIG5vbi1zdGFibGUgKHYtZm9yKSBmcmFnbWVudHNcclxuICAgICAgICAgICAgICAgICh0eXBlICE9PSBGcmFnbWVudCB8fFxyXG4gICAgICAgICAgICAgICAgICAgIChwYXRjaEZsYWcgPiAwICYmIHBhdGNoRmxhZyAmIDY0IC8qIFNUQUJMRV9GUkFHTUVOVCAqLykpKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBmYXN0IHBhdGggZm9yIGJsb2NrIG5vZGVzOiBvbmx5IG5lZWQgdG8gdW5tb3VudCBkeW5hbWljIGNoaWxkcmVuLlxyXG4gICAgICAgICAgICAgICAgdW5tb3VudENoaWxkcmVuKGR5bmFtaWNDaGlsZHJlbiwgcGFyZW50Q29tcG9uZW50LCBwYXJlbnRTdXNwZW5zZSwgZmFsc2UsIHRydWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlID09PSBGcmFnbWVudCAmJlxyXG4gICAgICAgICAgICAgICAgcGF0Y2hGbGFnICZcclxuICAgICAgICAgICAgICAgICAgICAoMTI4IC8qIEtFWUVEX0ZSQUdNRU5UICovIHwgMjU2IC8qIFVOS0VZRURfRlJBR01FTlQgKi8pKSB8fFxyXG4gICAgICAgICAgICAgICAgKCFvcHRpbWl6ZWQgJiYgc2hhcGVGbGFnICYgMTYgLyogQVJSQVlfQ0hJTERSRU4gKi8pKSB7XHJcbiAgICAgICAgICAgICAgICB1bm1vdW50Q2hpbGRyZW4oY2hpbGRyZW4sIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChkb1JlbW92ZSkge1xyXG4gICAgICAgICAgICAgICAgcmVtb3ZlKHZub2RlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoKHNob3VsZEludm9rZVZub2RlSG9vayAmJlxyXG4gICAgICAgICAgICAodm5vZGVIb29rID0gcHJvcHMgJiYgcHJvcHMub25Wbm9kZVVubW91bnRlZCkpIHx8XHJcbiAgICAgICAgICAgIHNob3VsZEludm9rZURpcnMpIHtcclxuICAgICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KCgpID0+IHtcclxuICAgICAgICAgICAgICAgIHZub2RlSG9vayAmJiBpbnZva2VWTm9kZUhvb2sodm5vZGVIb29rLCBwYXJlbnRDb21wb25lbnQsIHZub2RlKTtcclxuICAgICAgICAgICAgICAgIHNob3VsZEludm9rZURpcnMgJiZcclxuICAgICAgICAgICAgICAgICAgICBpbnZva2VEaXJlY3RpdmVIb29rKHZub2RlLCBudWxsLCBwYXJlbnRDb21wb25lbnQsICd1bm1vdW50ZWQnKTtcclxuICAgICAgICAgICAgfSwgcGFyZW50U3VzcGVuc2UpO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCByZW1vdmUgPSB2bm9kZSA9PiB7XHJcbiAgICAgICAgY29uc3QgeyB0eXBlLCBlbCwgYW5jaG9yLCB0cmFuc2l0aW9uIH0gPSB2bm9kZTtcclxuICAgICAgICBpZiAodHlwZSA9PT0gRnJhZ21lbnQpIHtcclxuICAgICAgICAgICAgcmVtb3ZlRnJhZ21lbnQoZWwsIGFuY2hvcik7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHR5cGUgPT09IFN0YXRpYykge1xyXG4gICAgICAgICAgICByZW1vdmVTdGF0aWNOb2RlKHZub2RlKTtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCBwZXJmb3JtUmVtb3ZlID0gKCkgPT4ge1xyXG4gICAgICAgICAgICBob3N0UmVtb3ZlKGVsKTtcclxuICAgICAgICAgICAgaWYgKHRyYW5zaXRpb24gJiYgIXRyYW5zaXRpb24ucGVyc2lzdGVkICYmIHRyYW5zaXRpb24uYWZ0ZXJMZWF2ZSkge1xyXG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvbi5hZnRlckxlYXZlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIGlmICh2bm9kZS5zaGFwZUZsYWcgJiAxIC8qIEVMRU1FTlQgKi8gJiZcclxuICAgICAgICAgICAgdHJhbnNpdGlvbiAmJlxyXG4gICAgICAgICAgICAhdHJhbnNpdGlvbi5wZXJzaXN0ZWQpIHtcclxuICAgICAgICAgICAgY29uc3QgeyBsZWF2ZSwgZGVsYXlMZWF2ZSB9ID0gdHJhbnNpdGlvbjtcclxuICAgICAgICAgICAgY29uc3QgcGVyZm9ybUxlYXZlID0gKCkgPT4gbGVhdmUoZWwsIHBlcmZvcm1SZW1vdmUpO1xyXG4gICAgICAgICAgICBpZiAoZGVsYXlMZWF2ZSkge1xyXG4gICAgICAgICAgICAgICAgZGVsYXlMZWF2ZSh2bm9kZS5lbCwgcGVyZm9ybVJlbW92ZSwgcGVyZm9ybUxlYXZlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHBlcmZvcm1MZWF2ZSg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xkcmVuLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIHVubW91bnQoY2hpbGRyZW5baV0sIHBhcmVudENvbXBvbmVudCwgcGFyZW50U3VzcGVuc2UsIGRvUmVtb3ZlLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBjb25zdCBnZXROZXh0SG9zdE5vZGUgPSB2bm9kZSA9PiB7XHJcbiAgICAgICAgaWYgKHZub2RlLnNoYXBlRmxhZyAmIDYgLyogQ09NUE9ORU5UICovKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBnZXROZXh0SG9zdE5vZGUodm5vZGUuY29tcG9uZW50LnN1YlRyZWUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAodm5vZGUuc2hhcGVGbGFnICYgMTI4IC8qIFNVU1BFTlNFICovKSB7XHJcbiAgICAgICAgICAgIHJldHVybiB2bm9kZS5zdXNwZW5zZS5uZXh0KCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBob3N0TmV4dFNpYmxpbmcoKHZub2RlLmFuY2hvciB8fCB2bm9kZS5lbCkpO1xyXG4gICAgfTtcclxuICAgIGNvbnN0IHJlbmRlciA9ICh2bm9kZSwgY29udGFpbmVyLCBpc1NWRykgPT4ge1xyXG4gICAgICAgIGlmICh2bm9kZSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIGlmIChjb250YWluZXIuX3Zub2RlKSB7XHJcbiAgICAgICAgICAgICAgICB1bm1vdW50KGNvbnRhaW5lci5fdm5vZGUsIG51bGwsIG51bGwsIHRydWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBwYXRjaChjb250YWluZXIuX3Zub2RlIHx8IG51bGwsIHZub2RlLCBjb250YWluZXIsIG51bGwsIG51bGwsIG51bGwsIGlzU1ZHKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZmx1c2hQb3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BvbGRSYXdSZWYgJiYgb2xkUmF3UmVmLnI7XHJcbiAgICBjb25zdCByZWZzID0gb3duZXIucmVmcyA9PT0gRU1QVFlfT0JKID8gKG93bmVyLnJlZnMgPSB7fSkgOiBvd25lci5yZWZzO1xyXG4gICAgY29uc3Qgc2V0dXBTdGF0ZSA9IG93bmVyLnNldHVwU3RhdGU7XHJcbiAgICAvLyBkeW5hbWljIHJlZiBjaGFuZ2VkLiB1bnNldCBvbGQgcmVmXHJcbiAgICBpZiAob2xkUmVmICE9IG51bGwgJiYgb2xkUmVmICE9PSByZWYpIHtcclxuICAgICAgICBpZiAoaXNTdHJpbmcob2xkUmVmKSkge1xyXG4gICAgICAgICAgICByZWZzW29sZFJlZl0gPSBudWxsO1xyXG4gICAgICAgICAgICBpZiAoaGFzT3duKHNldHVwU3RhdGUsIG9sZFJlZikpIHtcclxuICAgICAgICAgICAgICAgIHNldHVwU3RhdGVbb2xkUmVmXSA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoaXNSZWYob2xkUmVmKSkge1xyXG4gICAgICAgICAgICBvbGRSZWYudmFsdWUgPSBudWxsO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGlmIChpc1N0cmluZyhyZWYpKSB7XHJcbiAgICAgICAgY29uc3QgZG9TZXQgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHJlZnNbcmVmXSA9IHZhbHVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChoYXNPd24oc2V0dXBTdGF0ZSwgcmVmKSkge1xyXG4gICAgICAgICAgICAgICAgc2V0dXBTdGF0ZVtyZWZdID0gdmFsdWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG4gICAgICAgIC8vICMxNzg5OiBmb3Igbm9uLW51bGwgdmFsdWVzLCBzZXQgdGhlbSBhZnRlciByZW5kZXJcclxuICAgICAgICAvLyBudWxsIHZhbHVlcyBtZWFucyB0aGlzIGlzIHVubW91bnQgYW5kIGl0IHNob3VsZCBub3Qgb3ZlcndyaXRlIGFub3RoZXJcclxuICAgICAgICAvLyByZWYgd2l0aCB0aGUgc2FtZSBrZXlcclxuICAgICAgICBpZiAodmFsdWUpIHtcclxuICAgICAgICAgICAgZG9TZXQuaWQgPSAtMTtcclxuICAgICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KGRvU2V0LCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBkb1NldCgpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzUmVmKHJlZikpIHtcclxuICAgICAgICBjb25zdCBkb1NldCA9ICgpID0+IHtcclxuICAgICAgICAgICAgcmVmLnZhbHVlID0gdmFsdWU7XHJcbiAgICAgICAgfTtcclxuICAgICAgICBpZiAodmFsdWUpIHtcclxuICAgICAgICAgICAgZG9TZXQuaWQgPSAtMTtcclxuICAgICAgICAgICAgcXVldWVQb3N0UmVuZGVyRWZmZWN0KGRvU2V0LCBwYXJlbnRTdXNwZW5zZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBkb1NldCgpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzRnVuY3Rpb24ocmVmKSkge1xyXG4gICAgICAgIGNhbGxXaXRoRXJyb3JIYW5kbGluZyhyZWYsIG93bmVyLCAxMiAvKiBGVU5DVElPTl9SRUYgKi8sIFt2YWx1ZSwgcmVmc10pO1xyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgd2FybignSW52YWxpZCB0ZW1wbGF0ZSByZWYgdHlwZTonLCB2YWx1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kge1xyXG4gICAgY29uc3QgY2gxID0gbjEuY2hpbGRyZW47XHJcbiAgICBjb25zdCBjaDIgPSBuMi5jaGlsZHJlbjtcclxuICAgIGlmIChpc0FycmF5KGNoMSkgJiYgaXNBcnJheShjaDIpKSB7XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaDEubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgLy8gdGhpcyBpcyBvbmx5IGNhbGxlZCBpbiB0aGUgb3B0aW1pemVkIHBhdGggc28gYXJyYXkgY2hpbGRyZW4gYXJlXHJcbiAgICAgICAgICAgIC8vIGd1YXJhbnRlZWQgdG8gYmUgdm5vZGVzXHJcbiAgICAgICAgICAgIGNvbnN0IGMxID0gY2gxW2ldO1xyXG4gICAgICAgICAgICBsZXQgYzIgPSBjaDJbaV07XHJcbiAgICAgICAgICAgIGlmIChjMi5zaGFwZUZsYWcgJiAxIC8qIEVMRU1FTlQgKi8gJiYgIWMyLmR5bmFtaWNDaGlsZHJlbikge1xyXG4gICAgICAgICAgICAgICAgaWYgKGMyLnBhdGNoRmxhZyA8PSAwIHx8IGMyLnBhdGNoRmxhZyA9PT0gMzIgLyogSFlEUkFURV9FVkVOVFMgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBjMiA9IGNoMltpXSA9IGNsb25lSWZNb3VudGVkKGNoMltpXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgYzIuZWwgPSBjMS5lbDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghc2hhbGxvdylcclxuICAgICAgICAgICAgICAgICAgICB0cmF2ZXJzZVN0YXRpY0NoaWxkcmVuKGMxLCBjMik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gYWxzbyBpbmhlcml0IGZvciBjb21tZW50IG5vZGVzLCBidXQgbm90IHBsYWNlaG9sZGVycyAoZS5nLiB2LWlmIHdoaWNoXHJcbiAgICAgICAgICAgIC8vIHdvdWxkIGhhdmUgcmVjZWl2ZWQgLmVsIGR1cmluZyBibG9jayBwYXRjaClcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiBjMi50eXBlID09PSBDb21tZW50ICYmICFjMi5lbCkge1xyXG4gICAgICAgICAgICAgICAgYzIuZWwgPSBjMS5lbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG4vLyBodHRwczovL2VuLndpa2lwZWRpYS5vcmcvd2lraS9Mb25nZXN0X2luY3JlYXNpbmdfc3Vic2VxdWVuY2VcclxuZnVuY3Rpb24gZ2V0U2VxdWVuY2UoYXJyKSB7XHJcbiAgICBjb25zdCBwID0gYXJyLnNsaWNlKCk7XHJcbiAgICBjb25zdCByZXN1bHQgPSBbMF07XHJcbiAgICBsZXQgaSwgaiwgdSwgdiwgYztcclxuICAgIGNvbnN0IGxlbiA9IGFyci5sZW5ndGg7XHJcbiAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyBpKyspIHtcclxuICAgICAgICBjb25zdCBhcnJJID0gYXJyW2ldO1xyXG4gICAgICAgIGlmIChhcnJJICE9PSAwKSB7XHJcbiAgICAgICAgICAgIGogPSByZXN1bHRbcmVzdWx0Lmxlbmd0aCAtIDFdO1xyXG4gICAgICAgICAgICBpZiAoYXJyW2pdIDwgYXJySSkge1xyXG4gICAgICAgICAgICAgICAgcFtpXSA9IGo7XHJcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaChpKTtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHUgPSAwO1xyXG4gICAgICAgICAgICB2ID0gcmVzdWx0Lmxlbmd0aCAtIDE7XHJcbiAgICAgICAgICAgIHdoaWxlICh1IDwgdikge1xyXG4gICAgICAgICAgICAgICAgYyA9ICh1ICsgdikgPj4gMTtcclxuICAgICAgICAgICAgICAgIGlmIChhcnJbcmVzdWx0W2NdXSA8IGFyckkpIHtcclxuICAgICAgICAgICAgICAgICAgICB1ID0gYyArIDE7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB2ID0gYztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoYXJySSA8IGFycltyZXN1bHRbdV1dKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodSA+IDApIHtcclxuICAgICAgICAgICAgICAgICAgICBwW2ldID0gcmVzdWx0W3UgLSAxXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHJlc3VsdFt1XSA9IGk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB1ID0gcmVzdWx0Lmxlbmd0aDtcclxuICAgIHYgPSByZXN1bHRbdSAtIDFdO1xyXG4gICAgd2hpbGUgKHUtLSA+IDApIHtcclxuICAgICAgICByZXN1bHRbdV0gPSB2O1xyXG4gICAgICAgIHYgPSBwW3ZdO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIHJlc3VsdDtcclxufVxuXG5jb25zdCBpc1RlbGVwb3J0ID0gKHR5cGUpID0+IHR5cGUuX19pc1RlbGVwb3J0O1xyXG5jb25zdCBpc1RlbGVwb3J0RGlzYWJsZWQgPSAocHJvcHMpID0+IHByb3BzICYmIChwcm9wcy5kaXNhYmxlZCB8fCBwcm9wcy5kaXNhYmxlZCA9PT0gJycpO1xyXG5jb25zdCBpc1RhcmdldFNWRyA9ICh0YXJnZXQpID0+IHR5cGVvZiBTVkdFbGVtZW50ICE9PSAndW5kZWZpbmVkJyAmJiB0YXJnZXQgaW5zdGFuY2VvZiBTVkdFbGVtZW50O1xyXG5jb25zdCByZXNvbHZlVGFyZ2V0ID0gKHByb3BzLCBzZWxlY3QpID0+IHtcclxuICAgIGNvbnN0IHRhcmdldFNlbGVjdG9yID0gcHJvcHMgJiYgcHJvcHMudG87XHJcbiAgICBpZiAoaXNTdHJpbmcodGFyZ2V0U2VsZWN0b3IpKSB7XHJcbiAgICAgICAgaWYgKCFzZWxlY3QpIHtcclxuICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICB3YXJuKGBDdXJyZW50IHJlbmRlcmVyIGRvZXMgbm90IHN1cHBvcnQgc3RyaW5nIHRhcmdldCBmb3IgVGVsZXBvcnRzLiBgICtcclxuICAgICAgICAgICAgICAgICAgICBgKG1pc3NpbmcgcXVlcnlTZWxlY3RvciByZW5kZXJlciBvcHRpb24pYCk7XHJcbiAgICAgICAgICAgIHJldHVybiBudWxsO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3QgdGFyZ2V0ID0gc2VsZWN0KHRhcmdldFNlbGVjdG9yKTtcclxuICAgICAgICAgICAgaWYgKCF0YXJnZXQpIHtcclxuICAgICAgICAgICAgICAgIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIHdhcm4oYEZhaWxlZCB0byBsb2NhdGUgVGVsZXBvcnQgdGFyZ2V0IHdpdGggc2VsZWN0b3IgXCIke3RhcmdldFNlbGVjdG9yfVwiLiBgICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYE5vdGUgdGhlIHRhcmdldCBlbGVtZW50IG11c3QgZXhpc3QgYmVmb3JlIHRoZSBjb21wb25lbnQgaXMgbW91bnRlZCAtIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBgaS5lLiB0aGUgdGFyZ2V0IGNhbm5vdCBiZSByZW5kZXJlZCBieSB0aGUgY29tcG9uZW50IGl0c2VsZiwgYW5kIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgICAgIC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jtcclxuICAgICAgICAvLyAjMzMwMlxyXG4gICAgICAgIC8vIEhNUiB1cGRhdGVkLCBmb3JjZSBmdWxsIGRpZmZcclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGlzSG1yVXBkYXRpbmcpIHtcclxuICAgICAgICAgICAgb3B0aW1pemVkID0gZmFsc2U7XHJcbiAgICAgICAgICAgIGR5bmFtaWNDaGlsZHJlbiA9IG51bGw7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChuMSA9PSBudWxsKSB7XHJcbiAgICAgICAgICAgIC8vIGluc2VydCBhbmNob3JzIGluIHRoZSBtYWluIHZpZXdcclxuICAgICAgICAgICAgY29uc3QgcGxhY2Vob2xkZXIgPSAobjIuZWwgPSAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJylcclxuICAgICAgICAgICAgICAgID8gY3JlYXRlQ29tbWVudCgndGVsZXBvcnQgc3RhcnQnKVxyXG4gICAgICAgICAgICAgICAgOiBjcmVhdGVUZXh0KCcnKSk7XHJcbiAgICAgICAgICAgIGNvbnN0IG1haW5BbmNob3IgPSAobjIuYW5jaG9yID0gKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpXHJcbiAgICAgICAgICAgICAgICA/IGNyZWF0ZUNvbW1lbnQoJ3RlbGVwb3J0IGVuZCcpXHJcbiAgICAgICAgICAgICAgICA6IGNyZWF0ZVRleHQoJycpKTtcclxuICAgICAgICAgICAgaW5zZXJ0KHBsYWNlaG9sZGVyLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgICAgIGluc2VydChtYWluQW5jaG9yLCBjb250YWluZXIsIGFuY2hvcik7XHJcbiAgICAgICAgICAgIGNvbnN0IHRhcmdldCA9IChuMi50YXJnZXQgPSByZXNvbHZlVGFyZ2V0KG4yLnByb3BzLCBxdWVyeVNlbGVjdG9yKSk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRhcmdldEFuY2hvciA9IChuMi50YXJnZXRBbmNob3IgPSBjcmVhdGVUZXh0KCcnKSk7XHJcbiAgICAgICAgICAgIGlmICh0YXJnZXQpIHtcclxuICAgICAgICAgICAgICAgIGluc2VydCh0YXJnZXRBbmNob3IsIHRhcmdldCk7XHJcbiAgICAgICAgICAgICAgICAvLyAjMjY1MiB3ZSBjb3VsZCBiZSB0ZWxlcG9ydGluZyBmcm9tIGEgbm9uLVNWRyB0cmVlIGludG8gYW4gU1ZHIHRyZWVcclxuICAgICAgICAgICAgICAgIGlzU1ZHID0gaXNTVkcgfHwgaXNUYXJnZXRTVkcodGFyZ2V0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgIWRpc2FibGVkKSB7XHJcbiAgICAgICAgICAgICAgICB3YXJuKCdJbnZhbGlkIFRlbGVwb3J0IHRhcmdldCBvbiBtb3VudDonLCB0YXJnZXQsIGAoJHt0eXBlb2YgdGFyZ2V0fSlgKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCBtb3VudCA9IChjb250YWluZXIsIGFuY2hvcikgPT4ge1xyXG4gICAgICAgICAgICAgICAgLy8gVGVsZXBvcnQgKmFsd2F5cyogaGFzIEFycmF5IGNoaWxkcmVuLiBUaGlzIGlzIGVuZm9yY2VkIGluIGJvdGggdGhlXHJcbiAgICAgICAgICAgICAgICAvLyBjb21waWxlciBhbmQgdm5vZGUgY2hpbGRyZW4gbm9ybWFsaXphdGlvbi5cclxuICAgICAgICAgICAgICAgIGlmIChzaGFwZUZsYWcgJiAxNiAvKiBBUlJBWV9DSElMRFJFTiAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIG1vdW50Q2hpbGRyZW4oY2hpbGRyZW4sIGNvbnRhaW5lciwgYW5jaG9yLCBwYXJlbnRDb21wb25lbnQsIHBhcmVudFN1c3BlbnNlLCBpc1NWRywgc2xvdFNjb3BlSWRzLCBvcHRpbWl6ZWQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICBpZiAoZGlzYWJsZWQpIHtcclxuICAgICAgICAgICAgICAgIG1vdW50KGNvbnRhaW5lciwgbWFpbkFuY2hvcik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAodGFyZ2V0KSB7XHJcbiAgICAgICAgICAgICAgICBtb3VudCh0YXJnZXQsIHRhcmdldEFuY2hvcik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIHVwZGF0ZSBjb250ZW50XHJcbiAgICAgICAgICAgIG4yLmVsID0gbjEuZWw7XHJcbiAgICAgICAgICAgIGNvbnN0IG1haW5BbmNob3IgPSAobjIuYW5jaG9yID0gbjEuYW5jaG9yKTtcclxuICAgICAgICAgICAgY29uc3QgdGFyZ2V0ID0gKG4yLnRhcmdldCA9IG4xLnRhcmdldCk7XHJcbiAgICAgICAgICAgIGNvbnN0IHRhcmdldEFuY2hvciA9IChuMi50YXJnZXRBbmNob3IgPSBuMS50YXJnZXRBbmNob3IpO1xyXG4gICAgICAgICAgICBjb25zdCB3YXNEaXNhYmxlZCA9IGlzVGVsZXBvcnREaXNhYmxlZChuMS5wcm9wcyk7XHJcbiAgICAgICAgICAgIGNvbnN0IGN1cnJlbnRDb250YWluZXIgPSB3YXNEaXNhYmxlZCA/IGNvbnRhaW5lciA6IHRhcmdldDtcclxuICAgICAgICAgICAgY29uc3QgY3VycmVudEFuY2hvciA9IHdhc0Rpc2FibGVkID8gbWFpbkFuY2hvciA6IHRhcmdldEFuY2hvcjtcclxuICAgICAgICAgICAgaXNTVkcgPSBpc1NWRyB8fCBpc1RhcmdldFNWRyh0YXJnZXQpO1xyXG4gICAgICAgICAg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ibGVkIC0+IGRpc2FibGVkXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbW92ZSBpbnRvIG1haW4gY29udGFpbmVyXHJcbiAgICAgICAgICAgICAgICAgICAgbW92ZVRlbGVwb3J0KG4yLCBjb250YWluZXIsIG1haW5BbmNob3IsIGludGVybmFscywgMSAvKiBUT0dHTEUgKi8pO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gdGFyZ2V0IGNoYW5nZWRcclxuICAgICAgICAgICAgICAgIGlmICgobjIucHJvcHMgJiYgbjIucHJvcHMudG8pICE9PSAobjEucHJvcHMgJiYgbjEucHJvcHMudG8pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV4dFRhcmdldCA9IChuMi50YXJnZXQgPSByZXNvbHZlVGFyZ2V0KG4yLnByb3BzLCBxdWVyeVNlbGVjdG9yKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRUYXJnZXQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbW92ZVRlbGVwb3J0KG4yLCBuZXh0VGFyZ2V0LCBudWxsLCBpbnRlcm5hbHMsIDAgLyogVEFSR0VUX0NIQU5HRSAqLyk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3YXJuKCdJbnZhbGlkIFRlbGVwb3J0IHRhcmdldCBvbiB1cGRhdGU6JywgdGFyZ2V0LCBgKCR7dHlwZW9mIHRhcmdldH0pYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAod2FzRGlzYWJsZWQpIHtcclxu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gICAgICAgICAgICAgICAgc2VsZk5hbWUgPT09IGNhbWVsaXplKG5hbWUpIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZk5hbWUgPT09IGNhcGl0YWxpemUoY2FtZWxpemUobmFtZSkpKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIENvbXBvbmVudDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCByZXMgPSBcclxuICAgICAgICAvLyBsb2NhbCByZWdpc3RyYXRpb25cclxuICAgICAgICAvLyBjaGVjayBpbnN0YW5jZVt0eXBlXSBmaXJzdCB3aGljaCBpcyByZXNvbHZlZCBmb3Igb3B0aW9ucyBBUElcclxuICAgICAgICByZXNvbHZlKGluc3RhbmNlW3R5cGVdIHx8IENvbXBvbmVudFt0eXBlXSwgbmFtZSkgfHxcclxuICAgICAgICAgICAgLy8gZ2xvYmFsIHJlZ2lzdHJhdGlvblxyXG4gICAgICAgICAgICByZXNvbHZlKGluc3RhbmNlLmFwcENvbnRleHRbdHlwZV0sIG5hbWUpO1xyXG4gICAgICAgIGlmICghcmVzICYmIG1heWJlU2VsZlJlZmVyZW5jZSkge1xyXG4gICAgICAgICAgICAvLyBmYWxsYmFjayB0byBpbXBsaWNpdCBzZWxmLXJlZmVyZW5jZVxyXG4gICAgICAgICAgICByZXR1cm4gQ29tcG9uZW50O1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIHdhcm5NaXNzaW5nICYmICFyZXMpIHtcclxuICAgICAgICAgICAgY29uc3QgZXh0cmEgPSB0eXBlID09PSBDT01QT05FTlRTXHJcbiAgICAgICAgICAgICAgICA/IGBcXG5JZiB0aGlzIGlzIGEgbmF0aXZlIGN1c3RvbSBlbGVtZW50LCBtYWtlIHN1cmUgdG8gZXhjbHVkZSBpdCBmcm9tIGAgK1xyXG4gICAgICAgICAgICAgICAgICAgI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WTm9kZTogdHJ1ZSxcclxuICAgICAgICBfX3Zfc2tpcDogdHJ1ZSxcclxuICAgICAgICB0eXBlLFxyXG4gICAgICAgIHByb3BzLFxyXG4gICAgICAgIGtleTogcHJvcHMgJiYgbm9ybWFsaXplS2V5KHByb3BzKSxcclxuICAgICAgICByZWY6IHByb3BzICYmIG5vcm1hbGl6ZVJlZihwcm9wcyksXHJcbiAgICAgICAgc2NvcGVJZDogY3VycmVudFNjb3BlSWQsXHJcbiAgICAgICAgc2xvdFNjb3BlSWRzOiBudWxsLFxyXG4gICAgICAgIGNoaWxkcmVuLFxyXG4gICAgICAgIGNvbXBvbmVudDogbnVsbCxcclxuICAgICAgICBzdXNwZW5zZTogbnVsbCxcclxuICAgICAgICBzc0NvbnRlbnQ6IG51bGwsXHJcbiAgICAgICAgc3NGYWxsYmFjazogbnVsbCxcclxuICAgICAgICBkaXJzOiBudWxsLFxyXG4gICAgICAgIHRyYW5zaXRpb246IG51bGwsXHJcbiAgICAgICAgZWw6IG51bGwsXHJcbiAgICAgICAgYW5jaG9yOiBudWxsLFxyXG4gICAgICAgIHRhcmdldDogbnVsbCxcclxuICAgICAgICB0YXJnZXRBbmNob3I6IG51bGwsXHJcbiAgICAgICAgc3RhdGljQ291bnQ6IDAsXHJcbiAgICAgICAgc2hhcGVGbGFnLFxyXG4gICAgICAgIHBhdGNoRmxhZyxcclxuICAgICAgICBkeW5hbWljUHJvcHMsXHJcbiAgICAgICAgZHluYW1pY0NoaWxkcmVuOiBudWxsLFxyXG4gICAgICAgIGFwcENvbnRleHQ6IG51bGxcclxuICAgIH07XHJcbiAgICBpZiAobmVlZEZ1bGxDaGlsZHJlbk5vcm1hbGl6YXRpb24pIHtcclxuICAgICAgICBub3JtYWxpemVDaGlsZHJlbih2bm9kZSwgY2hpbGRyZW4pO1xyXG4gICAgICAgIC8vIG5vcm1hbGl6ZSBzdXNwZW5zZSBjaGlsZHJlblxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiAxMjgg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LyogRUxFTUVOVCAqL1xyXG4gICAgICAgIDogaXNTdXNwZW5zZSh0eXBlKVxyXG4gICAgICAgICAgICA/IDEyOCAvKiBTVVNQRU5TRSAqL1xyXG4gICAgICAgICAgICA6IGlzVGVsZXBvcnQodHlwZSlcclxuICAgICAgICAgICAgICAgID8gNjQgLyogVEVMRVBPUlQgKi9cclxuICAgICAgICAgICAgICAgIDogaXNPYmplY3QodHlwZSlcclxuICAgICAgICAgICAgICAgICAgICA/IDQgLyogU1RBVEVGVUxfQ09NUE9ORU5UICovXHJcbiAgICAgICAgICAgICAgICAgICAgOiBpc0Z1bmN0aW9uKHR5cGUpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gMiAvKiBGVU5DVElPTkFMX0NPTVBPTkVOVCAqL1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IDA7XHJcbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIHNoYXBlRmxhZyAmIDQgLyogU1RBVEVGVUxfQ09NUE9ORU5UICovICYmIGlzUHJveHkodHlwZSkpIHtcclxuICAgICAgICB0eXBlID0gdG9SYXcodHlwZSk7XHJcbiAgICAgICAgd2FybihgVnVlIHJlY2VpdmVkIGEgQ29tcG9uZW50IHdoaWNoIHdhcyBtYWRlIGEgcmVhY3RpdmUgb2JqZWN0LiBUaGlzIGNhbiBgICtcclxuICAgICAgICAgICAgYGxlYWQgdG8gdW5uZWNlc3NhcnkgcGVyZm9ybWFuY2Ugb3ZlcmhlYWQsIGFuZCBzaG91bGQgYmUgYXZvaWRlZCBieSBgICtcclxuICAgICAgICAgICAgYG1hcmtpbmcgdGhlIGNvbXBvbmVudCB3aXRoIFxcYG1hcmtSYXdcXGAgb3IgdXNpbmcgXFxgc2hhbGxvd1JlZlxcYCBgICtcclxuICAgICAgICAgICAgYGluc3RlYWQgb2YgXFxgcmVmXFxgLmAsIGBcXG5Db21wb25lbnQgdGhhdCB3YXMgbWFkZSByZ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ICBpZiAoc2xvdCkge1xyXG4gICAgICAgICAgICAgICAgLy8gX2MgbWFya2VyIGlzIGFkZGVkIGJ5IHdpdGhDdHgoKSBpbmRpY2F0aW5nIHRoaXMgaXMgYSBjb21waWxlZCBzbG90XHJcbiAgICAgICAgICAgICAgICBzbG90Ll9jICYmIChzbG90Ll9kID0gZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgbm9ybWFsaXplQ2hpbGRyZW4odm5vZGUsIHNsb3QoKSk7XHJcbiAgICAgICAgICAgICAgICBzbG90Ll9jICYmIChzbG90Ll9kID0gdHJ1ZSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdHlwZSA9IDMyIC8qIFNMT1RTX0NISUxEUkVOICovO1xyXG4gICAgICAgICAgICBjb25zdCBzbG90RmxhZyA9IGNoaWxkcmVuLl87XHJcbiAgICAgICAgICAgIGlmICghc2xvdEZsYWcgJiYgIShJbnRlcm5hbE9iamVjdEtleSBpbiBjaGlsZHJlbikpIHtcclxuICAgICAgICAgICAgICAgIGNoaWxkcmVuLl9jdHggPSBjdXJyZW50UmVuZGVyaW5nSW5zdGFuY2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoc2xvdEZsYWcgPT09IDMgLyogRk9SV0FSREVEICovICYmIGN1cnJlbnRSZW5kZXJpbmdJbnN0YW5jZSkge1xyXG4gICAgICAgICAgICAgICAgLy8gYSBjaGlsZCBjb21wb25lbnQgcmVjZWl2ZXMgZm9yd2FyZGVkIHNsb3RzIGZyb20gdGhlIHBhcmVudC5cclxuICAgICAgICAgICAgICAgIC8vIGl0cyBzbG90IHR5cGUgaXMgZGV0ZXJtaW5lZCBieSBpdHMgcGFyZW50J3Mgc2xvdCB0eXBlLlxyXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRSZW5kZXJpbmdJbnN0YW5jZS5zbG90cy5fID09PSAxIC8qIFNUQUJMRSAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuLl8gPSAxIC8qIFNUQUJMRSAqLztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuLl8gPSAyIC8qIERZTkFNSUMgKi87XHJcbiAgICAgICAgICAgICAgICAgICAgdm5vZGUucGF0Y2hGbGFnIHw9IDEwMjQgLyogRFlOQU1JQ19TTE9UUyAqLztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzRnVuY3Rpb24oY2hpbGRyZW4pKSB7XHJcbiAgICAgICAgY2hpbGRyZW4gPSB7IGRlZmF1bHQ6IGNoaWxkcmVuLCBfY3R4OiBjdXJyZW50UmVuZGVyaW5nSW5zdGFuY2UgfTtcclxuICAgICAgICB0eXBlID0gMzIgLyogU0xPVFNfQ0hJTERSRU4gKi87XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICBjaGlsZHJlbiA9IFN0cmluZyhjaGlsZHJlbik7XHJcbiAgICAgICAgLy8gZm9yY2UgdGVsZXBvcnQgY2hpbGRyZW4gdG8gYXJyYXkgc28gaXQgY2FuIGJlIG1vdmVkIGFyb3VuZFxyXG4gICAgICAgIGlmIChzaGFwZUZsYWcgJiA2NCAvKiBURUxFUE9SVCAqLykge1xyXG4gICAgICAgICAgICB0eXBlID0gMTYgLyogQVJSQVlfQ0hJTERSRU4gKi87XHJcbiAgICAgICAgICAgIGNoaWxkcmVuID0gW2NyZWF0ZVRleHRWTm9kZShjaGlsZHJlbildO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgdHlwZSA9IDggLyogVEVYVF9DSElMRFJFTiAqLztcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICB2bm9kZS5jaGlsZHJlbiA9IGNoaWxkcmVuO1xyXG4gICAgdm5vZGUuc2hhcGVGbGFnIHw9IHR5cGU7XHJcbn1cclxuZnVuY3Rpb24gbWVyZ2VQcm9wcyguLi5hcmdzKSB7XHJcbiAgICBjb25zdCByZXQgPSB7fTtcclxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJncy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIGNvbnN0IHRvTWVyZ2UgPSBhcmdzW2ldO1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIHRvTWVyZ2UpIHtcclxuICAgICAgICAgICAgaWYgKGtleSA9PT0gJ2NsYXNzJykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHJldC5jbGFzcyAhPT0gdG9NZXJnZS5jbGFzcykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldC5jbGFzcyA9IG5vcm1hbGl6ZUNsYXNzKFtyZXQuY2xhc3MsIHRvTWVyZ2UuY2xhc3NdKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChrZXkgPT09ICdzdHlsZScpIHtcclxuICAgICAgICAgICAgICAgIHJldC5zdHlsZSA9IG5vcm1hbGl6ZVN0eWxlKFtyZXQuc3R5bGUsIHRvTWVyZ2Uuc3R5bGVdKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChpc09uKGtleSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGV4aXN0aW5nID0gcmV0W2tleV07XHJcbiAgICAgICAgICAgICAgICBjb25zdCBpbmNvbWluZyA9IHRvTWVyZ2Vba2V5XTtcclxuICAgICAgICAgICAgICAgIGlmIChleGlzdGluZyAhPT0gaW5jb21pbmcgJiZcclxuICAgICAgICAgICAgICAgICAgICAhKGlzQXJyYXkoZXhpc3RpbmcpICYmIGV4aXN0aW5nLmluY2x1ZGVzKGluY29taW5nKSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXRba2V5XSA9IGV4aXN0aW5nXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gW10uY29uY2F0KGV4aXN0aW5nLCBpbmNvbWluZylcclxuICAgICAgICAgICAgICAgICAgICAgICAgOiBpbmNvbWluZztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChrZXkgIT09ICcnKSB7XHJcbiAgICAgICAgICAgICAgICByZXRba2V5XSA9IHRvTWVyZ2Vba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiByZXQ7XHJcbn1cblxuLyoqXHJcbiAqIEFjdHVhbCBpbXBsZW1lbnRhdGlvblxyXG4gKi9cclxuZnVuY3Rpb24gcmVuZGVyTGlzdChzb3VyY2UsIHJlbmRlckl0ZW0sIGNhY2hlLCBpbmRleCkge1xyXG4gICAgbGV0IHJldDtcclxuICAgIGNvbnN0IGNhY2hlZCA9IChjYWNoZSAmJiBjYWNoZVtpbmRleF0pO1xyXG4gICAgaWYgKGlzQXJyYXkoc291cmNlKSB8fCBpc1N0cmluZyhzb3VyY2UpKSB7XHJcbiAgICAgICAgcmV0ID0gbmV3IEFycmF5KHNvdXJjZS5sZW5ndGgpO1xyXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsID0gc291cmNlLmxlbmd0aDsgaSA8IGw7IGkrKykge1xyXG4gICAgICAgICAgICByZXRbaV0gPSByZW5kZXJJdGVtKHNvdXJjZVtpXSwgaSwgdW5kZWZpbmVkLCBjYWNoZWQgJiYgY2FjaGVkW2ldKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBlbHNlIGlmICh0eXBlb2Ygc291cmNlID09PSAnbnVtYmVyJykge1xyXG4gICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgIU51bWJlci5pc0ludGVnZXIoc291cmNlKSkge1xyXG4gICAgICAgICAgICB3YXJuKGBUaGUgdi1mb3IgcmFuZ2UgZXhwZWN0IGFuIGludGVnZXIgdmFsdWUgYnV0IGdvdCAke3NvdXJjZX0uYCk7XHJcbiAgICAgICAgICAgIHJldHVybiBbXTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0ID0gbmV3IEFycmF5KHNvdXJjZSk7XHJcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3VyY2U7IGkrKykge1xyXG4gICAgICAgICAgICByZXRbaV0gPSByZW5kZXJJdGVtKGkgKyAxLCBpLCB1bmRlZmluZWQsIGNhY2hlZCAmJiBjYWNoZWRbaV0pO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzT2JqZWN0KHNvdXJjZSkpIHtcclxuICAgICAgICBpZiAoc291cmNlW1N5bWJvbC5pdGVyYXRvcl0pIHtcclxuICAgICAgICAgICAgcmV0ID0gQXJyYXkuZnJvbShzb3VyY2UsIChpdGVtLCBpKSA9PiByZW5kZXJJdGVtKGl0ZW0sIGksIHVuZGVmaW5lZCwgY2FjaGVkICYmIGNhY2hlZFtpXSkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKHNvdXJjZSk7XHJcbiAgICAgICAgICAgIHJldCA9IG5ldyBBcnJheShrZXlzLmxlbmd0aCk7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwLCBsID0ga2V5cy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGtleXNbaV07XHJcbiAgICAgICAgICAgICAgICByZXRbaV0gPSByZW5kZXJJdGVtKHNvdXJjZVtrZXldLCBrZXksIGksIGNhY2hlZCAmJiBjYWNoZWRbaV0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAg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IGFuZCBpcyBhIG1ham9yIGhvdHNwb3QuIFRoZSBtb3N0IGV4cGVuc2l2ZSBwYXJ0IG9mIHRoaXNcclxuICAgICAgICAvLyBpcyB0aGUgbXVsdGlwbGUgaGFzT3duKCkgY2FsbHMuIEl0J3MgbXVjaCBmYXN0ZXIgdG8gZG8gYSBzaW1wbGUgcHJvcGVydHlcclxuICAgICAgICAvLyBhY2Nlc3Mgb24gYSBwbGFpbiBvYmplY3QsIHNvIHdlIHVzZSBhbiBhY2Nlc3NDYWNoZSBvYmplY3QgKHdpdGggbnVsbFxyXG4gICAgICAgIC8vIHByb3RvdHlwZSkgdG8gbWVtb2l6ZSB3aGF0IGFjY2VzcyB0eXBlIGEga2V5IGNvcnJlc3BvbmRzIHRvLlxyXG4gICAgICAgIGxldCBub3JtYWxpemVkUHJvcHM7XHJcbiAgICAgICAgaWYgKGtleVswXSAhPT0gJyQnKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG4gPSBhY2Nlc3NDYWNoZVtrZXldO1xyXG4gICAgICAgICAgICBpZiAobiAhPT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKG4pIHtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDAgLyogU0VUVVAgKi86XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXR1cFN0YXRlW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAxIC8qIERBVEEgKi86XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRhW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAzIC8qIENPTlRFWFQgKi86XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdHhba2V5XTtcclxuICAgICAgICAgICAgICAgICAgICBjYXNlIDIgLyogUFJPUFMgKi86XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9wc1trZXldO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGRlZmF1bHQ6IGp1c3QgZmFsbHRocm91Z2hcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChzZXR1cFN0YXRlICE9PSBFTVBUWV9PQkogJiYgaGFzT3duKHNldHVwU3RhdGUsIGtleSkpIHtcclxuICAgICAgICAgICAgICAgIGFjY2Vzc0NhY2hlW2tleV0gPSAwIC8qIFNFVFVQICovO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHNldHVwU3RhdGVba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChkYXRhICE9PSBFTVBUWV9PQkogJiYgaGFzT3duKGRhdGEsIGtleSkpIHtcclxuICAgICAgICAgICAgICAgIGFjY2Vzc0NhY2hlW2tleV0gPSAxIC8qIERBVEEgKi87XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZGF0YVtrZXldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKFxyXG4gICAgICAgICAgICAvLyBvbmx5IGNhY2hlIG90aGVyIHByb3BlcnRpZXMgd2hlbiBpbnN0YW5jZSBoYXMgZGVjbGFyZWQgKHRodXMgc3RhYmxlKVxyXG4gICAgICAgICAgICAvLyBwcm9wc1xyXG4gICAgICAgICAgICAobm9ybWFsaXplZFByb3BzID0gaW5zdGFuY2UucHJvcHNPcHRpb25zWzBdKSAmJlxyXG4gICAgICAgICAgICAgICAgaGFzT3duKG5vcm1hbGl6ZWRQcm9wcywga2V5KSkge1xyXG4gICAgICAgICAgICAgICAgYWNjZXNzQ2FjaGVba2V5XSA9IDIgLyogUFJPUFMgKi87XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcHJvcHNba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjdHggIT09IEVNUFRZX09CSiAmJiBoYXNPd24oY3R4LCBrZXkpKSB7XHJcbiAgICAgICAgICAgICAgICBhY2Nlc3NDYWNoZVtrZXldID0gMyAvKiBDT05URVhUICovO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGN0eFtrZXldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKCFfX1ZVRV9PUFRJT05TX0FQSV9fIHx8IHNob3VsZENhY2hlQWNjZXNzKSB7XHJcbiAgICAgICAgICAgICAgICBhY2Nlc3NDYWNoZVtrZXldID0gNCAvKiBPVEhFUiAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCBwdWJsaWNHZXR0ZXIgPSBwdWJsaWNQcm9wZXJ0aWVzTWFwW2tleV07XHJcbiAgICAgICAgbGV0IGNzc01vZHVsZSwgZ2xvYmFsUHJvcGVydGllcztcclxuICAgICAgICAvLyBwdWJsaWMgJHh4eCBwcm9wZXJ0aWVzXHJcbiAgICAgICAgaWYgKHB1YmxpY0dldHRlcikge1xyXG4gICAgICAgICAgICBpZiAoa2V5ID09PSAnJGF0dHJzJykge1xyXG4gICAgICAgICAgICAgICAgdHJhY2soaW5zdGFuY2UsIFwiZ2V0XCIgLyogR0VUICovLCBrZXkpO1xyXG4gICAgICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIG1hcmtBdHRyc0FjY2Vzc2VkKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHB1YmxpY0dldHRlcihpbnN0YW5jZSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKFxyXG4gICAgICAgIC8vIGNzcyBtb2R1bGUgKGluamVjdGVkIGJ5IHZ1ZS1sb2FkZXIpXHJcbiAgICAgICAgKGNzc01vZHVsZSA9IHR5cGUuX19jc3NNb2R1bGVzKSAmJlxyXG4gICAgICAgICAgICAoY3NzTW9kdWxlID0gY3NzTW9kdWxlW2tleV0pKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBjc3NNb2R1bGU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGN0eCAhPT0gRU1QVFlfT0JKICYmIGhhc093bihjdHgsIGtleSkpIHtcclxuICAgICAgICAgICAgLy8gdXNlciBtYXkgc2V0IGN1c3RvbSBwcm9wZXJ0aWVzIHRvIGB0aGlzYCB0aGF0IHN0YXJ0IHdpdGggYCRgXHJcbiAgICAgICAgICAgIGFjY2Vzc0NhY2hlW2tleV0gPSAzIC8qIENPTlRFWFQgKi87XHJcbiAgICAgICAgICAgIHJldHVybiBjdHhba2V5XTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoXHJcbiAgICAgICAgLy8gZ2xvYmFsIHByb3BlcnRpZXNcclxuICAgICAgICAoKGdsb2JhbFByb3BlcnRpZXMgPSBhcHBDb250ZXh0LmNvbmZpZy5nbG9iYWxQcm9wZXJ0aWVzKSxcclxuICAgICAgICAgICAgaGFzT3duKGdsb2JhbFByb3BlcnRpZXMsIGtleSkpKSB7XHJcbiAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBnbG9iYWxQcm9wZXJ0aWVzW2tleV07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgIGN1cnJlbnRSZW5kZXJpbmdJbnN0YW5jZSAmJlxyXG4gICAgICAgICAgICAoIWlzU3RyaW5nKGtleSkgfHxcclxuICAgICAgICAgICAgICAgIC8vICMxMDkxIGF2b2lkIGludGVybmFsIGlzUmVmL2lzVk5vZGUgY2hlY2tzIG9uIGNvbXBvbmVudCBpbnN0YW5jZSBsZWFkaW5nXHJcbiAgICAgICAgICAgICAgICAvLyB0byBpbmZpbml0ZSB3YXJuaW5nIGxvb3BcclxuICAgICAgICAgICAgICAgI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xQcm9wZXJ0aWVzKSB7XHJcbiAgICAgICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoY3R4LCBrZXksIHtcclxuICAgICAgICAgICAgICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxyXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgICAgICAgICB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjdHhba2V5XSA9IHZhbHVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgfSxcclxuICAgIGhhcyh7IF86IHsgZGF0YSwgc2V0dXBTdGF0ZSwgYWNjZXNzQ2FjaGUsIGN0eCwgYXBwQ29udGV4dCwgcHJvcHNPcHRpb25zIH0gfSwga2V5KSB7XHJcbiAgICAgICAgbGV0IG5vcm1hbGl6ZWRQcm9wcztcclxuICAgICAgICByZXR1cm4gKGFjY2Vzc0NhY2hlW2tleV0gIT09IHVuZGVmaW5lZCB8fFxyXG4gICAgICAgICAgICAoZGF0YSAhPT0gRU1QVFlfT0JKICYmIGhhc093bihkYXRhLCBrZXkpKSB8fFxyXG4gICAgICAgICAgICAoc2V0dXBTdGF0ZSAhPT0gRU1QVFlfT0JKICYmIGhhc093bihzZXR1cFN0YXRlLCBrZXkpKSB8fFxyXG4gICAgICAgICAgICAoKG5vcm1hbGl6ZWRQcm9wcyA9IHByb3BzT3B0aW9uc1swXSkgJiYgaGFzT3duKG5vcm1hbGl6ZWRQcm9wcywga2V5KSkgfHxcclxuICAgICAgICAgICAgaGFzT3duKGN0eCwga2V5KSB8fFxyXG4gICAgICAgICAgICBoYXNPd24ocHVibGljUHJvcGVydGllc01hcCwga2V5KSB8fFxyXG4gICAgICAgICAgICBoYXNPd24oYXBwQ29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yXG4gICAgLy8gZXhwb3NlIHB1YmxpYyBwcm9wZXJ0aWVzXHJcbiAgICBPYmplY3Qua2V5cyhwdWJsaWNQcm9wZXJ0aWVzTWFwKS5mb3JFYWNoKGtleSA9PiB7XHJcbiAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHRhcmdldCwga2V5LCB7XHJcbiAgICAgICAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcclxuICAgICAgICAgICAgZW51bWVyYWJsZTogZmFsc2UsXHJcbiAgICAgICAgICAgIGdldDogKCkgPT4gcHVibGljUHJvcGVydGllc01hcFtrZXldKGluc3RhbmNlKSxcclxuICAgICAgICAgICAgLy8gaW50ZXJjZXB0ZWQgYnkgdGhlIHByb3h5IHNvIG5vIG5lZWQgZm9yIGltcGxlbWVudGF0aW9uLFxyXG4gICAgICAgICAgICAvLyBidXQgbmVlZGVkIHRvIHByZXZlbnQgc2V0IGVycm9yc1xyXG4gICAgICAgICAgICBzZXQ6IE5PT1BcclxuICAgICAgICB9KTtcclxuICAgIH0pO1xyXG4gICAgcmV0dXJuIHRhcmdldDtcclxufVxyXG4vLyBkZXYgb25seVxyXG5mdW5jdGlvbiBleHBvc2VQcm9wc09uUmVuZGVyQ29udGV4dChpbnN0YW5jZSkge1xyXG4gICAgY29uc3QgeyBjdHgsIHByb3BzT3B0aW9uczogW3Byb3BzT3B0aW9uc10gfSA9IGluc3RhbmNlO1xyXG4gICAgaWYgKHByb3BzT3B0aW9ucykge1xyXG4gICAgICAgIE9iamVjdC5rZXlzKHByb3BzT3B0aW9ucykuZm9yRWFjaChrZXkgPT4ge1xyXG4gICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoY3R4LCBrZXksIHtcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IGluc3RhbmNlLnByb3BzW2tleV0sXHJcbiAgICAgICAgICAgICAgICBzZXQ6IE5PT1BcclxuICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuLy8gZGV2IG9ubHlcclxuZnVuY3Rpb24gZXhwb3NlU2V0dXBTdGF0ZU9uUmVuZGVyQ29udGV4dChpbnN0YW5jZSkge1xyXG4gICAgY29uc3QgeyBjdHgsIHNldHVwU3RhdGUgfSA9IGluc3RhbmNlO1xyXG4gICAgT2JqZWN0LmtleXModG9SYXcoc2V0dXBTdGF0ZSkpLmZvckVhY2goa2V5ID0+IHtcclxuICAgICAgICBpZiAoIXNldHVwU3RhdGUuX19pc1NjcmlwdFNldHVwKSB7XHJcbiAgICAgICAgICAgIGlmIChrZXlbMF0gPT09ICckJyB8fCBrZXlbMF0gPT09ICdfJykge1xyXG4gICAgICAgICAgICAgICAgd2Fybihgc2V0dXAoKSByZXR1cm4gcHJvcGVydHkgJHtKU09OLnN0cmluZ2lmeShrZXkpfSBzaG91bGQgbm90IHN0YXJ0IHdpdGggXCIkXCIgb3IgXCJfXCIgYCArXHJcbiAgICAgICAgICAgICAgICAgICAgYHdoaWNoIGFyZSByZXNlcnZlZCBwcmVmaXhlcyBmb3IgVnVlIGludGVybmFscy5gKTtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoY3R4LCBrZXksIHtcclxuICAgICAgICAgICAgICAgIGVudW1lcmFibGU6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBjb25maWd1cmFibGU6IHRydWUsXHJcbiAgICAgICAgICAgICAgICBnZXQ6ICgpID0+IHNldHVwU3RhdGVba2V5XSxcclxuICAgICAgICAgICAgICAgIHNldDogTk9PUFxyXG4gICAgICAgICAgICB9KTtcclxuICAgICAgICB9XHJcbiAgICB9KTtcclxufVxuXG5jb25zdCBlbXB0eUFwcENvbnRleHQgPSBjcmVhdGVBcHBDb250ZXh0KCk7XHJcbmxldCB1aWQkMSA9IDA7XHJcbmZ1bmN0aW9uIGNyZWF0ZUNvbXBvbmVudEluc3RhbmNlKHZub2RlLCBwYXJlbnQsIHN1c3BlbnNlKSB7XHJcbiAgICBjb25zdCB0eXBlID0gdm5vZGUudHlwZTtcclxuICAgIC8vIGluaGVyaXQgcGFyZW50IGFwcCBjb250ZXh0IC0gb3IgLSBpZiByb290LCBhZG9wdCBmcm9tIHJvb3Qgdm5vZGVcclxuICAgIGNvbnN0IGFwcENvbnRleHQgPSAocGFyZW50ID8gcGFyZW50LmFwcENvbnRleHQgOiB2bm9kZS5hcHBDb250ZXh0KSB8fCBlbXB0eUFwcENvbnRleHQ7XHJcbiAgICBjb25zdCBpbnN0YW5jZSA9IHtcclxuICAgICAgICB1aWQ6IHVpZCQxKyssXHJcbiAgICAgICAgdm5vZGUsXHJcbiAgICAgICAgdHlwZSxcclxuICAgICAgICBwYXJlbnQsXHJcbiAgICAgICAgYXBwQ29udGV4dCxcclxuICAgICAgICByb290OiBudWxsLFxyXG4gICAgICAgIG5leHQ6IG51bGwsXHJcbiAgICAgICAgc3ViVHJlZTogbnVsbCxcclxuICAgICAgICB1cGRhdGU6IG51bGwsXHJcbiAgICAgICAgc2NvcGU6IG5ldyBFZmZlY3RTY29wZSh0cnVlIC8qIGRldGFjaGVkICovKSxcclxuICAgICAgICByZW5kZXI6IG51bGwsXHJcbiAgICAgICAgcHJveHk6IG51bGwsXHJcbiAgICAgICAgZXhwb3NlZDogbnVsbCxcclxuICAgICAgICBleHBvc2VQcm94eTogbnVsbCxcclxuICAgICAgICB3aXRoUHJveHk6IG51bGwsXHJcbiAgICAgICAgcHJvdmlkZXM6IHBhcmVudCA/IHBhcmVudC5wcm92aWRlcyA6IE9iamVjdC5jcmVhdGUoYXBwQ29udGV4dC5wcm92aWRlcyksXHJcbiAgICAgICAgYWNjZXNzQ2FjaGU6IG51bGwsXHJcbiAgICAgICAgcmVuZGVyQ2FjaGU6IFtdLFxyXG4gICAgICAgIC8vIGxvY2FsIHJlc292bGVkIGFzc2V0c1xyXG4gICAgICAgIGNvbXBvbmVudHM6IG51bGwsXHJcbiAgICAgICAgZGlyZWN0aXZlczogbnVsbCxcclxuICAgICAgICAvLyByZXNvbHZlZCBwcm9wcyBhbmQgZW1pdHMgb3B0aW9uc1xyXG4gICAgICAgIHByb3BzT3B0aW9uczogbm9ybWFsaXplUHJvcHNPcHRpb25zKHR5cGUsIGFwcENvbnRleHQpLFxyXG4gICAgICAgIGVtaXRzT3B0aW9uczogbm9ybWFsaXplRW1pdHNPcHRpb25zKHR5cGUsIGFwcENvbnRleHQpLFxyXG4gICAgICAgIC8vIGVtaXRcclxuICAgICAgICBlbWl0OiBudWxsLFxyXG4gICAgICAgIGVtaXR0ZWQ6IG51bGwsXHJcbiAgICAgICAgLy8gcHJvcHMgZGVmYXVsdCB2YWx1ZVxyXG4gICAgICAgIHByb3BzRGVmYXVsdHM6IEVNUFRZX09CSixcclxuICAgICAgICAvLyBpbmhlcml0QXR0cnNcclxuICAgICAgICBpbmhlcml0QXR0cnM6IHR5cGUuaW5oZXJpdEF0dHJzLFxyXG4gICAgICAgIC8vIHN0YXRlXHJcbiAgICAgICAgY3R4OiBFTVBUWV9PQkosXHJcbiAgICAgICAgZGF0YTogRU1QVFlfT0JKLFxyXG4gICAgICAgIHByb3BzOiBFTVBUWV9PQkosXHJcbiAgICAgICAgYXR0cnM6IEVNUFRZX09CSixcclxuICAgICAgICBzbG90czogRU1QVFlfT0JKLFxyXG4gICAgICAgIHJlZnM6IEVNUFRZX09CSixcclxuICAgICAgICBzZXR1cFN0YXRlOiBFTVBUWV9PQkosXHJcbiAgICAgICAgc2V0dXBDb250ZXh0OiBudWxsLFxyXG4gICAgICAgIC8vIHN1c3BlbnNlIHJlbGF0ZWRcclxuICAgICAgICBzdXNwZW5zZSxcclxuICAgICAgICBzdXNwZW5zZUlkOiBzdXNwZW5zZSA/IHN1c3BlbnNlLnBlbmRpbmdJZCA6IDAsXHJcbiAgICAgICAgYXN5bmNEZXA6IG51bGwsXHJcbiAgICAgICAgYXN5bmNSZXNvbHZlZDogZmFsc2UsXHJcbiAgICAgICAgLy8gbGlmZWN5Y2xlIGhvb2tzXHJcbiAgICAgICAgLy8gbm90IHVzaW5nIGVudW1zIGhlcmUgYmVjYXVzZSBpdCByZXN1bHRzIGluIGNvbXB1dGVkIHByb3BlcnRpZXNcclxuICAgICAgICBpc01vdW50ZWQ6IGZhbHNlLFxyXG4gICAgICAgIGlzVW5tb3VudGVkOiBmYWxzZSxcclxuICAgICAgICBpc0RlYWN0aXZhdGVkOiBmYWxzZSxcclxuICAgICAgICBiYzogbnVsbCxcclxuICAgICAgICBjOiBudWxsLFxyXG4gICAgICAgIGJtOiBudWxsLFxyXG4gICAgICAgIG06IG51bGwsXHJcbiAgICAgICAgYnU6IG51bGwsXHJcbiAgICAgICAgdTogbnVsbCxcclxuICAgICAgICB1bTogbnVsbCxcclxuICAgICAgICBidW06IG51bGwsXHJcbiAgICAgICAgZGE6IG51bGwsXHJcbiAgICAgICAgYTogbnVsbCxcclxuICAgICAgICBydGc6IG51bGwsXHJcbiAgICAgICAgcnRjOiBudWxsLFxyXG4gICAgICAgIGVjOiBudWxsLFxyXG4gICAgICAgIHNwOiBudWxsXHJcbiAgICB9O1xyXG4gICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgIGluc3RhbmNlLmN0eCA9IGNyZWF0ZURldlJlbmRlckNvbnRleHQoaW5zdGFuY2UpO1xyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgaW5zdGFuY2UuY3R4ID0geyBfOiBpbnN0YW5jZSB9O1xyXG4gICAgfVxyXG4gICAgaW5zdGFuY2Uucm9vdCA9IHBhcmVudCA/IHBhcmVudC5yb290IDogaW5zdGFuY2U7XHJcbiAgICBpbnN0YW5jZS5lbWl0ID0gZW1pdCQ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iAgICAgICAgaWYgKENvbXBvbmVudC5uYW1lKSB7XHJcbiAgICAgICAgICAgIHZhbGlkYXRlQ29tcG9uZW50TmFtZShDb21wb25lbnQubmFtZSwgaW5zdGFuY2UuYXBwQ29udGV4dC5jb25maWcpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoQ29tcG9uZW50LmNvbXBvbmVudHMpIHtcclxuICAgICAgICAgICAgY29uc3QgbmFtZXMgPSBPYmplY3Qua2V5cyhDb21wb25lbnQuY29tcG9uZW50cyk7XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbmFtZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHZhbGlkYXRlQ29tcG9uZW50TmFtZShuYW1lc1tpXSwgaW5zdGFuY2UuYXBwQ29udGV4dC5jb25maWcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChDb21wb25lbnQuZGlyZWN0aXZlcykge1xyXG4gICAgICAgICAgICBjb25zdCBuYW1lcyA9IE9iamVjdC5rZXlzKENvbXBvbmVudC5kaXJlY3RpdmVzKTtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBuYW1lcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgdmFsaWRhdGVEaXJlY3RpdmVOYW1lKG5hbWVzW2ldKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoQ29tcG9uZW50LmNvbXBpbGVyT3B0aW9ucyAmJiBpc1J1bnRpbWVPbmx5KCkpIHtcclxuICAgICAgICAgICAgd2FybihgXCJjb21waWxlck9wdGlvbnNcIiBpcyBvbmx5IHN1cHBvcnRlZCB3aGVuIHVzaW5nIGEgYnVpbGQgb2YgVnVlIHRoYXQgYCArXHJcbiAgICAgICAgICAgICAgICBgaW5jbHVkZXMgdGhlIHJ1bnRpbWUgY29tcGlsZXIuIFNpbmNlIHlvdS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tpbmcoKTtcclxuICAgICAgICBjb25zdCBzZXR1cFJlc3VsdCA9IGNhbGxXaXRoRXJyb3JIYW5kbGluZyhzZXR1cCwgaW5zdGFuY2UsIDAgLyogU0VUVVBfRlVOQ1RJT04gKi8sIFsocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgPyBzaGFsbG93UmVhZG9ubHkoaW5zdGFuY2UucHJvcHMpIDogaW5zdGFuY2UucHJvcHMsIHNldHVwQ29udGV4dF0pO1xyXG4gICAgICAgIHJlc2V0VHJhY2tpbmcoKTtcclxuICAgICAgICB1bnNldEN1cnJlbnRJbnN0YW5jZSgpO1xyXG4gICAgICAgIGlmIChpc1Byb21pc2Uoc2V0dXBSZXN1bHQpKSB7XHJcbiAgICAgICAgICAgIHNldHVwUmVzdWx0LnRoZW4odW5zZXRDdXJyZW50SW5zdGFuY2UsIHVuc2V0Q3VycmVudEluc3RhbmNlKTtcclxuICAgICAgICAgICAgaWYgKGlzU1NSKSB7XHJcbiAgICAgICAgICAgICAgICAvLyByZXR1cm4gdGhlIHByb21pc2Ugc28gc2VydmVyLXJlbmRlcmVyIGNhbiB3YWl0IG9uIGl0XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gc2V0dXBSZXN1bHRcclxuICAgICAgICAgICAgICAgICAgICAudGhlbigocmVzb2x2ZWRSZXN1bHQpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBoYW5kbGVTZXR1cFJlc3VsdChpbnN0YW5jZSwgcmVzb2x2ZWRSZXN1bHQsIGlzU1NSKTtcclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoKGUgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIGhhbmRsZUVycm9yKGUsIGluc3RhbmNlLCAwIC8qIFNFVFVQX0ZVTkNUSU9OICovKTtcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVs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W9uIG5vcm1hbGl6YXRpb25cclxuICAgIC8vIGNvdWxkIGJlIGFscmVhZHkgc2V0IHdoZW4gcmV0dXJuZWQgZnJvbSBzZXR1cCgpXHJcbiAgICBpZiAoIWluc3RhbmNlLnJlbmRlcikge1xyXG4gICAgICAgIC8vIG9ubHkgZG8gb24tdGhlLWZseSBjb21waWxlIGlmIG5vdCBpbiBTU1IgLSBTU1Igb24tdGhlLWZseSBjb21wbGlhdGlvblxyXG4gICAgICAgIC8vIGlzIGRvbmUgYnkgc2VydmVyLXJlbmRlcmVyXHJcbiAgICAgICAgaWYgKCFpc1NTUiAmJiBjb21waWxlICYmICFDb21wb25lbnQucmVuZGVyKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHRlbXBsYXRlID0gQ29tcG9uZW50LnRlbXBsYXRlO1xyXG4gICAgICAgICAgICBpZiAodGVtcGxhdGUpIHtcclxuICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGFydE1lYXN1cmUoaW5zdGFuY2UsIGBjb21waWxlYCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IGlzQ3VzdG9tRWxlbWVudCwgY29tcGlsZXJPcHRpb25zIH0gPSBpbnN0YW5jZS5hcHBDb250ZXh0LmNvbmZpZztcclxuICAgICAgICAgICAgICAgIGNvbnN0IHsgZGVsaW1pdGVycywgY29tcGlsZXJPcHRpb25zOiBjb21wb25lbnRDb21waWxlck9wdGlvbnMgfSA9IENvbXBvbmVudDtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGZpbmFsQ29tcGlsZXJPcHRpb25zID0gZXh0ZW5kKGV4dGVuZCh7XHJcbiAgICAgICAgICAgICAgICAgICAgaXNDdXN0b21FbGVtZW50LFxyXG4gICAgICAgICAgICAgICAgICAgIGRlbGltaXRlcnNcclxuICAgICAgICAgICAg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5jdGlvbi5gKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gY3JlYXRlQXR0cnNQcm94eShpbnN0YW5jZSkge1xyXG4gICAgcmV0dXJuIG5ldyBQcm94eShpbnN0YW5jZS5hdHRycywgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpXHJcbiAgICAgICAgPyB7XHJcbiAgICAgICAgICAgIGdldCh0YXJnZXQsIGtleSkge1xyXG4gICAgICAgICAgICAgICAgbWFya0F0dHJzQWNjZXNzZWQoKTtcclxuICAgICAgICAgICAgICAgIHRyYWNrKGluc3RhbmNlLCBcImdldFwiIC8qIEdFVCAqLywgJyRhdHRycycpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRhcmdldFtrZXldO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzZXQoKSB7XHJcbiAgICAgICAgICAgICAgICB3YXJuKGBzZXR1cENvbnRleHQuYXR0cnMgaXMgcmVhZG9ubHkuYCk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGRlbGV0ZVByb3BlcnR5KCkge1xyXG4gICAgICAgICAgICAgICAgd2Fybihgc2V0dXBDb250ZXh0LmF0dHJzIGlzIHJlYWRvbmx5LmApO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIDoge1xyXG4gICAgICAgICAgICBnZXQodGFyZ2V0LCBrZXkpIHtcclxuICAgICAgICAgICAgICAgIHRyYWNrKGluc3RhbmNlLCBcImdldFwiIC8qIEdFVCAqLywgJyRhdHRycycpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRhcmdldFtrZXldO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbn1cclxuZnVuY3Rpb24gY3JlYXRlU2V0dXBDb250ZXh0KGluc3RhbmNlKSB7XHJcbiAgICBjb25zdCBleHBvc2UgPSBleHBvc2VkID0+IHtcclxuICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGluc3RhbmNlLmV4cG9zZWQpIHtcclxuICAgICAgICAgICAgd2FybihgZXhwb3NlKCkgc2hvdWxkIGJlIGNhbGxlZCBvbmx5IG9uY2UgcGVyIHNldHVwKCkuYCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGluc3RhbmNlLmV4cG9zZWQgPSBleHBvc2VkIHx8IHt9O1xyXG4gICAgfTtcclxuICAgIGxldCBhdHRycztcclxuICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAvLyBXZSB1c2UgZ2V0dGVycyBpbiBkZXYgaW4gY2FzZSBsaWJzIGxpa2UgdGVzdC11dGlscyBvdmVyd3JpdGUgaW5zdGFuY2VcclxuICAgICAgICAvLyBwcm9wZXJ0aWVzIChvdmVyd3JpdGVzIHNob3VsZCBub3QgYmUgZG9uZSBpbiBwcm9kKVxyXG4gICAgICAgIHJldHVybiBPYmplY3QuZnJlZXplKHtcclxuICAgICAgICAgICAgZ2V0IGF0dHJzKCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGF0dHJzIHx8IChhdHRycyA9IGNyZWF0ZUF0dHJzUHJveHkoaW5zdGFuY2UpKTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZ2V0IHNsb3RzKCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHNoYWxsb3dSZWFkb25seShpbnN0YW5jZS5zbG90cyk7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGdldCBlbWl0KCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIChldmVudCwgLi4uYXJncykgPT4gaW5zdGFuY2UuZW1pdChldmVudCwgLi4uYXJncyk7XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGV4cG9zZVxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgZ2V0IGF0dHJzKCkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGF0dHJzIHx8IChhdHRycyA9IGNyZWF0ZUF0dHJzUHJveHkoaW5zdGFuY2UpKTtcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc2xvdHM6IGluc3RhbmNlLnNsb3RzLFxyXG4gICAgICAgICAgICBlbWl0OiBpbnN0YW5jZS5lbWl0LFxyXG4gICAgICAgICAgICBleHBvc2VcclxuICAgICAgICB9O1xyXG4gICAgfVxyXG59XHJcbmZ1bmN0aW9uIGdldEV4cG9zZVByb3h5KGluc3RhbmNlKSB7XHJcbiAgICBpZiAoaW5zdGFuY2UuZXhwb3NlZCkge1xyXG4gICAgICAgIHJldHVybiAoaW5zdGFuY2UuZXhwb3NlUHJveHkgfHxcclxuICAgICAgICAgICAgKGluc3RhbmNlLmV4cG9zZVByb3h5ID0gbmV3IFByb3h5KHByb3h5UmVmcyhtYXJrUmF3KGluc3RhbmNlLmV4cG9zZWQpKSwge1xyXG4gICAgICAgICAgICAgICAgZ2V0KHRhcmdldCwga2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleSBpbiB0YXJnZXQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRhcmdldFtrZXldO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChrZXkgaW4gcHVibGljUHJvcGVydGllc01hcCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVibGljUHJvcGVydGllc01hcFtrZXldKGluc3RhbmNlKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcb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cbiAgICAvLyBkdXJpbmcgcGF0Y2gsIGxlYWRpbmcgdG8gaW5maW5pdGUgcmVjdXJzaW9uLlxyXG4gICAgcGF1c2VUcmFja2luZygpO1xyXG4gICAgY29uc3QgaW5zdGFuY2UgPSBzdGFjay5sZW5ndGggPyBzdGFja1tzdGFjay5sZW5ndGggLSAxXS5jb21wb25lbnQgOiBudWxsO1xyXG4gICAgY29uc3QgYXBwV2FybkhhbmRsZXIgPSBpbnN0YW5jZSAmJiBpbnN0YW5jZS5hcHBDb250ZXh0LmNvbmZpZy53YXJuSGFuZGxlcjtcclxuICAgIGNvbnN0IHRyYWNlID0gZ2V0Q29tcG9uZW50VHJhY2UoKTtcclxuICAgIGlmIChhcHBXYXJuSGFuZGxlcikge1xyXG4gICAgICAgIGNhbGxXaXRoRXJyb3JIYW5kbGluZyhhcHBXYXJuSGFuZGxlciwgaW5zdGFuY2UsIDExIC8qIEFQUF9XQVJOX0hBTkRMRVIgKi8sIFtcclxuICAgICAgICAgICAgbXNnICsgYXJncy5qb2luKCcnKSxcclxuICAgICAgICAgICAgaW5zdGFuY2UgJiYgaW5zdGFuY2UucHJveHksXHJcbiAgICAgICAgICAgIHRyYWNlXHJcbiAgICAgICAgICAgICAgICAubWFwKCh7IHZub2RlIH0pID0+IGBhdCA8JHtmb3JtYXRDb21wb25lbnROYW1lKGluc3RhbmNlLCB2bm9kZS50eXBlKX0+YClcclxuICAgICAgICAgICAgICAgIC5qb2luKCdcXG4nKSxcclxuICAgICAgICAgICAgdHJhY2VcclxuICAgICAgICBdKTtcclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gICAgICAgIGNvbnN0IHdhcm5BcmdzID0gW2BbVnVlIHdhcm5dOiAke21zZ31gLCAuLi5hcmdzXTtcclxuICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgaWYgKi9cclxuICAgICAgICBpZiAodHJhY2UubGVuZ3RoICYmXHJcbiAgICAgICAgICAgIC8vIGF2b2lkIHNwYW1taW5nIGN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XG4gICAgICAgIC8vIGluIHByb2R1Y3Rpb24gdGhlIGhvb2sgcmVjZWl2ZXMgb25seSB0aGUgZXJyb3IgY29kZVxyXG4gICAgICAgIGNvbnN0IGVycm9ySW5mbyA9IChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSA/IEVycm9yVHlwZVN0cmluZ3NbdHlwZV0gOiB0eXBlO1xyXG4gICAgICAgIHdoaWxlIChjdXIpIHtcclxuICAgICAgICAgICAgY29uc3QgZXJyb3JDYXB0dXJlZEhvb2tzID0gY3VyLmVjO1xyXG4gICAgICAgICAgICBpZiAoZXJyb3JDYXB0dXJlZEhvb2tzKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGVycm9yQ2FwdHVyZWRIb29rcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvckNhcHR1cmVkSG9va3NbaV0oZXJyLCBleHBvc2VkSW5zdGFuY2UsIGVycm9ySW5mbykgPT09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY3VyID0gY3VyLnBhcmVudDtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gYXBwLWxldmVsIGhhbmRsaW5nXHJcbiAgICAgICAgY29uc3QgYXBwRXJyb3JIYW5kbGVyID0gaW5zdGFuY2UuYXBwQ29udGV4dC5jb25maWcuZXJyb3JIYW5kbGVyO1xyXG4gICAgICAgIGlmIChhcHBFcnJvckhhbmRsZXIpIHtcclxuICAgICAgICAgICAgY2FsbFdpdGhFcnJvckhhbmRsaW5nKGFwcEVycm9ySGFuZGxlciwgbnVsbCwgMTAgLyogQVBQX0VSUk9SX0hBTkRMRVIgKi8sIFtlcnIsIGV4cG9zZWRJbnN0YW5jZSwgZXJyb3JJbmZvXSk7XHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBsb2dFcnJvcihlcnIsIHR5cGUsIGNvbnRleHRWTm9kZSwgdGhyb3dJbkRldik7XHJcbn1cclxuZnVuY3Rpb24gbG9nRXJyb3IoZXJyLCB0eXBlLCBjb250ZXh0Vk5vZGUsIHRocm93SW5EZXYgPSB0cnVlKSB7XHJcbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgY29uc3QgaW5mbyA9IEVycm9yVHlwZVN0cmluZ3NbdHlwZV07XHJcbiAgICAgICAgaWYgKGNvbnRleHRWTm9kZSkge1xyXG4gICAgICAgICAgICBwdXNoV2FybmluZ0NvbnRleHQoY29udGV4dFZOb2RlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgd2FybihgVW5oYW5kbGVkIGVycm9yJHtpbmZvID8gYCBkdXJpbmcgZXhlY3V0aW9uIG9mICR7aW5mb31gIDogYGB9YCk7XHJcbiAgICAgICAgaWYgKGNvbnRleHRWTm9kZSkge1xyXG4gICAgICAgICAgICBwb3BXYXJuaW5nQ29udGV4dCgpO1xyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBjcmFzaCBpbiBkZXYgYnkgZGVmYXVsdCBzbyBpdCdzIG1vcmUgbm90aWNlYWJsZVxyXG4gICAgICAgIGlmICh0aHJvd0luRGV2KSB7XHJcbiAgICAgICAgICAgIHRocm93IGVycjtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICAvLyByZWNvdmVyIGluIHByb2QgdG8gcmVkdWNlIHRoZSBpbXBhY3Qgb24gZW5kLXVzZXJcclxuICAgICAgICBjb25zb2xlLmVycm9yK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KSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGpvYiA9IHF1ZXVlW2ZsdXNoSW5kZXhdO1xyXG4gICAgICAgICAgICBpZiAoam9iICYmIGpvYi5hY3RpdmUgIT09IGZhbHNlKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIGNoZWNrKGpvYikpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKGBydW5uaW5nOmAsIGpvYi5pZClcclxuICAgICAgICAgICAgICAgIGNhbGxXaXRoRXJyb3JIYW5kbGluZyhqb2IsIG51bGwsIDE0IC8qIFNDSEVEVUxFUiAqLyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBmaW5hbGx5IHtcclxuICAgICAgICBmbHVzaEluZGV4ID0gMDtcclxuICAgICAgICBxdWV1ZS5sZW5ndGggPSAwO1xyXG4gICAgICAgIGZsdXNoUG9zdEZsdXNoQ2JzKHNlZW4pO1xyXG4gICAgICAgIGlzRmx1c2hpbmcgPSBmYWxzZTtcclxuICAgICAgICBjdXJyZW50Rmx1c2hQcm9taXNlID0gbnVsbDtcclxuICAgICAgICAvLyBzb21lIHBvc3RGbHVzaENiIHF1ZXVlZCBqb2JzIVxyXG4gICAgICAgIC8vIGtlZXAgZmx1c2hpbmcgdW50aWwgaXQgZHJhaW5zLlxyXG4gICAgICAgIGlmIChxdWV1ZS5sZW5ndGggfHxcclxuICAgICAgICAgICAgcGVuZGluZ1ByZUZsdXNoQ2JzLmxlbmd0aCB8fFxyXG4gICAgICAgICAgICBwZW5kaW5nUG9zdEZsdXNoQ2JzLmxlbmd0aCkge1xyXG4gICAgICAgICAgICBmbHVzaEpvYnMoc2Vlbik7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XHJcbmZ1bmN0aW9uIGNoZWNrUmVjdXJzaXZlVXBkYXRlcyhzZWVuLCBmbikge1xyXG4gICAgaWYgKCFzZWVuLmhhcyhmbikpIHtcclxuICAgICAgICBzZWVuLnNldChmbiwgMSk7XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICBjb25zdCBjb3VudCA9IHNlZW4uZ2V0KGZuKTtcclxuICAgICAgICBpZiAoY291bnQgPiBSRUNVUlNJT05fTElNSVQpIHtcclxuICAgICAgICAgICAgY29uc3QgaW5zdGFuY2UgPSBmbi5vd25lckluc3RhbmNlO1xyXG4gICAgICAgICAgICBjb25zdCBjb21wb25lbnROYW1lID0gaW5zdGFuY2UgJiYgZ2V0Q29tcG9uZW50TmFtZShpbnN0YW5jZS50eXBlKTtcclxuICAgICAgICAgICAgd2FybihgTWF4aW11bSByZWN1cnNpdmUgdXBkYXRlcyBleGNlZWRlZCR7Y29tcG9uZW50TmFtZSA/IGAgaW4gY29tcG9uZW50IDwke2NvbXBvbmVudE5hbWV9PmAgOiBgYH0uIGAgK1xyXG4gICAgICAgICAgICAgICAgYFRoaXMgbWVhbnMgeW91IGhhdmUgYSByZWFjdGl2ZSBlZmZlY3QgdGhhdCBpcyBtdXRhdGluZyBpdHMgb3duIGAgK1xyXG4gICAgICAgICAgICAgICAgYGRlcGVuZGVuY2llcyBhbmQgdGh1cyByZWN1cnNpdmVseSB0cmlnZ2VyaW5nIGl0c2VsZi4gUG9zc2libGUgc291cmNlcyBgICtcclxuICAgICAgICAgICAgICAgIGBpbmNsdWRlIGNvbXBvbmVudCB0ZW1wbGF0ZSwgcmVuZGVyIGZ1bmN0aW9uLCB1cGRhdGVkIGhvb2sgb3IgYCArXHJcbiAgICAgICAgICAgICAgICBgd2F0Y2hlciBzb3VyY2UgZnVuY3Rpb24uYCk7XHJcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgc2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IgPSAoKSA9PiBzb3VyY2UubWFwKHMgPT4ge1xyXG4gICAgICAgICAgICBpZiAoaXNSZWYocykpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBzLnZhbHVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGlzUmVhY3RpdmUocykpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cmF2ZXJzZShzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChpc0Z1bmN0aW9uKHMpKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gY2FsbFdpdGhFcnJvckhhbmRsaW5nKHMsIGluc3RhbmNlLCAyIC8qIFdBVENIX0dFVFRFUiAqLyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgd2FybkludmFsaWRTb3VyY2Uocyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKGlzRnVuY3Rpb24oc291cmNlKSkge1xyXG4gICAgICAgIGlmIChjYikge1xyXG4gICAgICAgICAgICAvLyBnZXR0ZXIgd2l0aCBjYlxyXG4gICAgICAgICAgICBnZXR0ZXIgPSAoKSA9PiBjYWxsV2l0aEVycm9ySGFuZGxpbmcoc291cmNlLCBpbnN0YW5jZSwgMiAvKiBXQVRDSF9HRVRURVIgKi8pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gbm8gY2IgLT4gc2ltcGxlIGVmZmVjdFxyXG4gICAgICAgICAgICBnZXR0ZXIgPSAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaW5zdGFuY2UgJiYgaW5zdGFuY2UuaXNVbm1vdW50ZWQpIHtcclxuICAgICAgICAgICA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biAgICBpZiAoaXNJblNTUkNvbXBvbmVudFNldHVwKSB7XHJcbiAgICAgICAgLy8gd2Ugd2lsbCBhbHNvIG5vdCBjYWxsIHRoZSBpbnZhbGlkYXRlIGNhbGxiYWNrICgrIHJ1bm5lciBpcyBub3Qgc2V0IHVwKVxyXG4gICAgICAgIG9uSW52YWxpZGF0ZSA9IE5PT1A7XHJcbiAgICAgICAgaWYgKCFjYikge1xyXG4gICAgICAgICAgICBnZXR0ZXIoKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoaW1tZWRpYXRlKSB7XHJcbiAgICAgICAgICAgIGNhbGxXaXRoQXN5bmNFcnJvckhhbmRsaW5nKGNiLCBpbnN0YW5jZSwgMyAvKiBXQVRDSF9DQUxMQkFDSyAqLywgW1xyXG4gICAgICAgICAgICAgICAgZ2V0dGVyKCksXHJcbiAgICAgICAgICAgICAgICBpc011bHRpU291cmNlID8gW10gOiB1bmRlZmluZWQsXHJcbiAgICAgICAgICAgICAgICBvbkludmFsaWRhdGVcclxuICAgICAgICAgICAgXSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBOT09QO1xyXG4gICAgfVxyXG4gICAgbGV0IG9sZFZhbHVlID0gaXNNdWx0aVNvdXJjZSA/IFtdIDogSU5JVElBTF9XQVRDSEVSX1ZBTFVFO1xyXG4gICAgY29uc3Qgam9iID0gKCkgPT4ge1xyXG4gICAgICAgIGlmICghZWZmZWN0LmFjdGl2ZSkge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjYikge1xyXG4gICAgICAgICAgICAvLyB3YXRjaChzb3VyY2UsIGNiKVxyXG4gICAgICAgICAgICBjb25zdCBuZXdWYWx1ZSA9IGVmZmVjdC5ydW4oKTtcclxuICAgICAgICAgICAgaWYgKGRlZXAgfHxcclxuICAgICAgICAgICAgICAgIGZvcmNlVHJpZ2dlciB8fFxyXG4gICAgICAgICAgICAgICAgKGlzTXVsdGlTb3VyY2VcclxuICAgICAgICAgICAgICAgICAgICA/IG5ld1ZhbHVlLnNvbWUoKHYsIGkpID0+IGhhc0NoYW5nZWQodiwgb2xkVmFsdWVbaV0pKVxyXG4gICAgICAgICAgICAgICAgICAgIDogaGFzQ2hhbmdlZChuZXdWYWx1ZSwgb2xkVmFsdWUpKSB8fFxyXG4gICAgICAgICAgICAgICAgKGZhbHNlICApKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBjbGVhbnVwIGJlZm9yZSBydW5uaW5nIGNiIGFnYWluXHJcbiAgICAgICAgICAgICAgICBpZiAoY2xlYW51cCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNsZWFudXAoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNhbGxXaXRoQXN5bmNFcnJvckhhbmRsaW5nKGNiLCBpbnN0YW5jZSwgMyAvKiBXQVRDSF9DQUxMQkFDSyAqLywgW1xyXG4gICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlLFxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHBhc3MgdW5kZWZpbmVkIGFzIHRoZSBvbGQgdmFsdWUgd2hlbiBpdCdzIGNoYW5nZWQgZm9yIHRoZSBmaXJzdCB0aW1lXHJcbiAgICAgICAgICAgICAgICAgICAgb2xkVmFsdWUgPT09IElOSVRJQUxfV0FUQ0hFUl9WQUxVRSA/IHVuZGVmaW5lZCA6IG9sZFZhbHVlLFxyXG4gICAgICAgICAgICAgICAgICAgIG9uSW52YWxpZGF0ZVxyXG4gICAgICAgICAgICAgICAgXSk7XHJcbiAgICAgICAgICAgICAgICBvbGRWYWx1ZSA9IG5ld1ZhbHVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAvLyB3YXRjaEVmZmVjdFxyXG4gICAgICAgICAgICBlZmZlY3QucnVuKCk7XHJcbiAgICAgICAgfVxyXG4gICAgfTtc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cmluZ1N0eWxlID0geyBzdHlsZTogJ2NvbG9yOiNiNjJlMjQnIH07XHJcbiAgICBjb25zdCBrZXl3b3JkU3R5bGUgPSB7IHN0eWxlOiAnY29sb3I6IzlkMjg4YycgfTtcclxuICAgIC8vIGN1c3RvbSBmb3JtYXR0ZXIgZm9yIENocm9tZVxyXG4gICAgLy8gaHR0cHM6Ly93d3cubWF0dHpldW5lcnQuY29tLzIwMTYvMDIvMTkvY3VzdG9tLWNocm9tZS1kZXZ0b29scy1vYmplY3QtZm9ybWF0dGVycy5odG1sXHJcbiAgICBjb25zdCBmb3JtYXR0ZXIgPSB7XHJcbiAgICAgICAgaGVhZGVyKG9iaikge1xyXG4gICAgICAgICAgICAvLyBUT0RPIGFsc28gZm9ybWF0IENvbXBvbmVudFB1YmxpY0luc3RhbmNlICYgY3R4LnNsb3RzL2F0dHJzIGluIHNldHVwXHJcbiAgICAgICAgICAgIGlmICghaXNPYmplY3Qob2JqKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG9iai5fX2lzVnVlKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gWydkaXYnLCB2dWVTdHlsZSwgYFZ1ZUluc3RhbmNlYF07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaXNSZWYob2JqKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIFtcclxuICAgICAgICAgICAgICAgICAgICAnZGl2JyxcclxuICAgICAgICAgICAgICAgICAgICB7fSxcclxuICAgICAgICAgICAgICAgICAgICBbJ3NwYW4nLCB2dWVTdHlsZSwgZ2VuUmVmRmxhZyhvYmopXSxcclxuICAgICAgICAgICAgICAgICAgICAnPCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0VmFsdWUob2JqLnZhbHVlKSxcclxuICAgICAgICAgICAgICAgICAgICBgPmBcclxuICAgICAgICAgICAgICAgIF07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaXNSZWFjdGl2ZShvYmopKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xyXG4gICAgICAgICAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICAgICAgICAgIHt9LFxyXG4gICAgICAgICAgICAgICAgICAgIFsnc3BhbicsIHZ1ZVN0eWxlLCAnUmVhY3RpdmUnXSxcclxuICAgICAgICAgICAgICAgICAgICAnPCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0VmFsdWUob2JqKSxcclxuICAgICAgICAgICAgICAgICAgICBgPiR7aXNSZWFkb25seShvYmopID8gYCAocmVhZG9ubHkpYCA6IGBgfWBcclxuICAgICAgICAgICAgICAgIF07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaXNSZWFkb25seShvYmopKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gW1xyXG4gICAgICAgICAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICAgICAgICAgIHt9LFxyXG4gICAgICAgICAgICAgICAgICAgIFsnc3BhbicsIHZ1ZVN0eWxlLCAnUmVhZG9ubHknXSxcclxuICAgICAgICAgICAgICAgICAgICAnPCcsXHJcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0VmFsdWUob2JqKSxcclxuICAgICAgICAgICAgICAgICAgICAnPidcclxuICAgICAgICAgICAgICAgIF07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIG51bGw7XHJcbiAgICAgICAgfSxcclxuICAgICAgICBoYXNCb2R5KG9iaikge1xyXG4gICAgICAgICAgICByZXR1cm4gb2JqICYmIG9iai5fX2lzVnVlO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgYm9keShvYmopIHtcclxuICAgICAgICAgICAgaWYgKG9iaiAmJiBvYmouX19pc1Z1ZSkge1xyXG4gICAgICAgICAgICAgICA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XG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCBpbmplY3RlZCA9IGV4dHJhY3RLZXlzKGluc3RhbmNlLCAnaW5qZWN0Jyk7XHJcbiAgICAgICAgaWYgKGluamVjdGVkKSB7XHJcbiAgICAgICAgICAgIGJsb2Nrcy5wdXNoKGNyZWF0ZUluc3RhbmNlQmxvY2soJ2luamVjdGVkJywgaW5qZWN0ZWQpKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgYmxvY2tzLnB1c2goW1xyXG4gICAgICAgICAgICAnZGl2JyxcclxuICAgICAgICAgICAge30sXHJcbiAgICAgICAgICAgIFtcclxuICAgICAgICAgICAgICAgICdzcGFuJyxcclxuICAgICAgICAgICAgICAgIHtcclxuICAgICAgICAgICAgICAgICAgICBzdHlsZToga2V5d29yZFN0eWxlLnN0eWxlICsgJztvcGFjaXR5OjAuNjYnXHJcbiAgICAgICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICAgICAgJyQgKGludGVybmFsKTogJ1xyXG4gICAgICAgICAgICBdLFxyXG4gICAgICAgICAgICBbJ29iamVjdCcsIHsgb2JqZWN0OiBpbnN0YW5jZSB9XVxyXG4gICAgICAgIF0pO1xyXG4gICAgICAgIHJldHVybiBibG9ja3M7XHJcbiAgICB9XHJcbiAgICBmdW5jdGlvbiBjcmVhdGVJbnN0YW5jZUJsb2NrKHR5cGUsIHRhcmdldCkge1xyXG4gICAgICAgIHRhcmdldCA9IGV4dGVuZCh7fSwgdGFyZ2V0KTtcclxuICAgICAgICBpZiAoIU9iamVjdC5rZXlzKHRhcmdldCkubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBbJ3NwYW4nLCB7fV07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICB7IHN0eWxlOiAnbGluZS1oZWlnaHQ6MS4yNWVtO21hcmdpbi1ib3R0b206MC42ZW0nIH0sXHJcbiAgICAgICAgICAgIFtcclxuICAgICAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlOiAnY29sb3I6IzQ3NjU4MidcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICB0eXBlXHJcbiAgICAgICAgICAgIF0sXHJcbiAgICAgICAgICAgIFtcclxuICAgICAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICAgICAge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlOiAncGFkZGluZy1sZWZ0OjEuMjVlbSdcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAuLi5PYmplY3Qua2V5cyh0YXJnZXQpLm1hcChrZXkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXYnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB7fSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgWydzcGFuJywga2V5d29yZFN0eWxlLCBrZXkgKyAnOiAnXSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0VmFsdWUodGFyZ2V0W2tleV0sIGZhbHNlKVxyXG4gICAgICAgICAgICAgICAgICAgIF07XHJcbiAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICBdXHJcbiAgICAgICAgXTtcclxuICAgIH1cclxuICAgIGZ1bmN0aW9uIGZvcm1hdFZhbHVlKHYsIGFzUmF3ID0gdHJ1ZSkge1xyXG4gICAgICAgIGlmICh0eXBlb2YgdiA9PT0gJ251bWJlcicpIHtcclxuICAgICAgICAgICAgcmV0dXJuIFsnc3BhbicsIG51bWJlclN0eWxlLCB2XTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAodHlwZW9mIHYgPT09ICdzdHJpbmcnKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBbJ3NwYW4nLCBzdHJpbmdTdHlsZSwgSlNPTi5zdHJpbmdpZnkodildO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICh0eXBlb2YgdiA9PT0gJ2Jvb2xlYW4nKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBbJ3NwYW4nLCBrZXl3b3JkU3R5bGUsIHZdO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpc09iamVjdCh2KSkge1xyXG4gICAgICAgICAgICByZXR1cm4gWydvYmplY3QnLCB7IG9iamVjdDogYXNSYXcgPyB0b1Jhdyh2KSA6IHYgfV07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICByZXR1cm4gWydzcGFuJywgc3RyaW5nU3R5bGUsIFN0cmluZyh2KV07XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gZXh0cmFjdEtleXMoaW5zdGFuY2UsIHR5cGUpIHtcclxuICAgICAgICBjb25zdCBDb21wID0gaW5zdGFuY2UudHlwZTtcclxuICAgICAgICBpZiAoaXNGdW5jdGlvbihDb21wKSkge1xyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNvbnN0IGV4dHJhY3RlZCA9IHt9O1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIGluc3RhbmNlLmN0eCkge1xyXG4gICAgICAgICAgICBpZiAoaXNLZXlPZlR5cGUoQ29tcCwga2V5LCB0eXBlKSkge1xyXG4gICAgICAgICAgICAgICAgZXh0cmFjdGVkW2tleV0gPSBpbnN0YW5jZS5jdHhba2V5XTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gZXh0cmFjdGVkO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gaXNLZXlPZlR5cGUoQ29tcCwga2V5LCB0eXBlKSB7XHJcbiAgICAgICAgY29uc3Qgb3B0cyA9IENvbXBbdHlwZV07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cnVzdGVkIHRlbXBsYXRlcywgdGhpcyBpcyBzYWZlLlxyXG4gICAgaW5zZXJ0U3RhdGljQ29udGVudChjb250ZW50LCBwYXJlbnQsIGFuY2hvciwgaXNTVkcpIHtcclxuICAgICAgICAvLyA8cGFyZW50PiBiZWZvcmUgfCBmaXJzdCAuLi4gbGFzdCB8IGFuY2hvciA8L3BhcmVudD5cclxuICAgICAgICBjb25zdCBiZWZvcmUgPSBhbmNob3IgPyBhbmNob3IucHJldmlvdXNTaWJsaW5nIDogcGFyZW50Lmxhc3RDaGlsZDtcclxuICAgICAgICBsZXQgdGVtcGxhdGUgPSBzdGF0aWNUZW1wbGF0ZUNhY2hlLmdldChjb250ZW50KTtcclxuICAgICAgICBpZiAoIXRlbXBsYXRlKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHQgPSBkb2MuY3JlYXRlRWxlbWVudCgndGVtcGxhdGUnKTtcclxuICAgICAgICAgICAgdC5pbm5lckhUTUwgPSBpc1NWRyA/IGA8c3ZnPiR7Y29udGVudH08L3N2Zz5gIDogY29udGVudDtcclxuICAgICAgICAgICAgdGVtcGxhdGUgPSB0LmNvbnRlbnQ7XHJcbiAgICAgICAgICAgIGlmIChpc1NWRykge1xyXG4gICAgICAgICAgICAgICAgLy8gcmVtb3ZlIG91dGVyIHN2ZyB3cmFwcGVyXHJcbiAgICAgICAgICAgICAgICBjb25zdCB3cmFwcGVyID0gdGVtcGxhdGUuZmlyc3RDaGlsZDtcclxuICAgICAgICAgICAgICAgIHdoaWxlICh3cmFwcGVyLmZpcnN0Q2hpbGQpIHtcclxuICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZS5hcHBlbmRDaGlsZCh3cmFwcGVyLmZpcnN0Q2hpbGQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgdGVtcGxhdGUucmVtb3ZlQ2hpbGQod3JhcHBlcik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc3RhdGljVGVt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ZSwgLi4udHJhbnNpdGlvbkNsYXNzZXNdIDogWy4uLnRyYW5zaXRpb25DbGFzc2VzXSkuam9pbignICcpO1xyXG4gICAgfVxyXG4gICAgaWYgKHZhbHVlID09IG51bGwpIHtcclxuICAgICAgICBlbC5yZW1vdmVBdHRyaWJ1dGUoJ2NsYXNzJyk7XHJcbiAgICB9XHJcbiAgICBlbHNlIGlmIChpc1NWRykge1xyXG4gICAgICAgIGVsLnNldEF0dHJpYnV0ZSgnY2xhc3MnLCB2YWx1ZSk7XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICBlbC5jbGFzc05hbWUgPSB2YWx1ZTtcclxuICAgIH1cclxufVxuXG5mdW5jdGlvbiBwYXRjaFN0eWxlKGVsLCBwcmV2LCBuZXh0KSB7XHJcbiAgICBjb25zdCBzdHlsZSA9IGVsLnN0eWxlO1xyXG4gICAgY29uc3QgaXNDc3NTdHJpbmcgPSBpc1N0cmluZyhuZXh0KTtcclxuICAgIGlmIChuZXh0ICYmICFpc0Nzc1N0cmluZykge1xyXG4gICAgICAgIGZvciAoY29uc3Qga2V5IGluIG5leHQpIHtcclxuICAgICAgICAgICAgc2V0U3R5bGUoc3R5bGUsIGtleSwgbmV4dFtrZXldKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKHByZXYgJiYgIWlzU3RyaW5nKHByZXYpKSB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3Qga2V5IGluIHByZXYpIHtcclxuICAgICAgICAgICAgICAgIGlmIChuZXh0W2tleV0gPT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHNldFN0eWxlKHN0eWxlLCBrZXksICcnKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gICAgICAgIGNvbnN0IGN1cnJlbnREaXNwbGF5ID0gc3R5bGUuZGlzcGxheTtcclxuICAgICAgICBpZiAoaXN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cy5fY29ubmVjdGVkKSB7XHJcbiAgICAgICAgICAgICAgICByZW5kZXIobnVsbCwgdGhpcy5zaGFkb3dSb290KTtcclxuICAgICAgICAgICAgICAgIHRoaXMuX2luc3RhbmNlID0gbnVsbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfVxyXG4gICAgLyoqXHJcbiAgICAgKiByZXNvbHZlIGlubmVyIGNvbXBvbmVudCBkZWZpbml0aW9uIChoYW5kbGUgcG9zc2libGUgYXN5bmMgY29tcG9uZW50KVxyXG4gICAgICovXHJcbiAgICBfcmVzb2x2ZURlZigpIHtcclxuICAgICAgICBpZiAodGhpcy5fcmVzb2x2ZWQpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLl9yZXNvbHZlZCA9IHRydWU7XHJcbiAgICAgICAgLy8gc2V0IGluaXRpYWwgYXR0cnNcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRoaXMuYXR0cmlidXRlcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICB0aGlzLl9zZXRBdHRyKHRoaXMuYXR0cmlidXRlc1tpXS5uYW1lKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gd2F0Y2ggZnV0dXJlIGF0dHIgY2hhbmdlc1xyXG4gICAgICAgIG5ldyBNdXRhdGlvbk9ic2VydmVyKG11dGF0aW9ucyA9PiB7XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgbSBvZiBtdXRhdGlvbnMpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMuX3NldEF0dHIobS5hdHRyaWJ1dGVOYW1lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pLm9ic2VydmUodGhpcywgeyBhdHRyaWJ1dGVzOiB0cnVlIH0pO1xyXG4gICAgICAgIGNvbnN0IHJlc29sdmUgPSAoZGVmKSA9PiB7XHJcbiAgICAgICAgICAgIGNvbnN0IHsgcHJvcHMsIHN0eWxlcyB9ID0gZGVmO1xyXG4gICAgICAgICAgICBjb25zdCBoYXNPcHRpb25zID0gIWlzQXJyYXkocHJvcHMpO1xyXG4gICAgICAgICAgICBjb25zdCByYXdLZXlzID0gcHJvcHMgPyAoaGFzT3B0aW9ucyA/IE9iamVjdC5rZXlzKHByb3BzKSA6IHByb3BzKSA6IFtdO1xyXG4gICAgICAgICAgICAvLyBjYXN0IE51bWJlci10eXBlIHByb3BzIHNldCBiZWZvcmUgcmVzb2x2ZVxyXG4gICAgICAgICAgICBsZXQgbnVtYmVyUHJvcHM7XHJcbiAgICAgICAgICAgIGlmIChoYXNPcHRpb25zKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiB0aGlzLl9wcm9wcykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG9wdCA9IHByb3BzW2tleV07XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wdCA9PT0gTnVtYmVyIHx8IChvcHQgJiYgb3B0LnR5cGUgPT09IE51bWJlcikpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJvcHNba2V5XSA9IHRvTnVtYmVyKHRoaXMuX3Byb3BzW2tleV0pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAobnVtYmVyUHJvcHMgfHwgKG51bWJlclByb3BzID0gT2JqZWN0LmNyZWF0ZShudWxsKSkpW2tleV0gPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB0aGlzLl9udW1iZXJQcm9wcyA9IG51bWJlclByb3BzO1xyXG4gICAgICAgICAgICAvLyBjaGVjayBpZiB0aGVyZSBhcmUgcHJvcHMgc2V0IHByZS11cGdyYWRlIG9yIGNvbm5lY3RcclxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgb2YgT2JqZWN0LmtleXModGhpcykpIHtcclxuICAgICAgICAgICAgICAgIGlmIChrZXlbMF0gIT09ICdfJykge1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NldFByb3Aoa2V5LCB0aGlzW2tleV0sIHRydWUsIGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBkZWZpbmluZyBnZXR0ZXIvc2V0dGVycyBvbiBwcm90b3R5cGVcclxuICAgICAgICAgICAgZm9yIChjb25zdCBrZXkgb2YgcmF3S2V5cy5tYXAoY2FtZWxpemUkMSkpIHtcclxuICAgICAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLCBrZXksIHtcclxuICAgICAgICAgICAgICAgICAgICBnZXQoKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9nZXRQcm9wKGtleSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgICAgICAgICBzZXQodmFsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3NldFByb3Aoa2V5LCB2YWwpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIGFwcGx5IENTU1xyXG4gICAgICAgICAgICB0aGlzLl9hcHBseVN0eWxlcyhzdHlsZXMpO1xyXG4gICAgICAgICAgICAvLyBpbml0aWFsIHJlbmRlclxyXG4gICAgICAgICAgICB0aGlzLl91cGRhdGUoKTtcclxuICAgICAgICB9O1xyXG4gICAgICAgIGNvbnN0IGFzeW5jRGVmID0gdGhpcy5fZGVmLl9fYXN5bmNMb2FkZXI7XHJcbiAgICAgICAgaWYgKGFzeW5jRGVmKSB7XHJcbiAgICAgICAgICAgIGFzeW5jRGVmKCkudGhlbihyZXNvbHZlKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIHJlc29sdmUodGhpcy5fZGVmKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBfc2V0QXR0cihrZXkpIHtcclxuICAgICAgICBsZXQgdmFsdWUgPSB0aGlzLmdldEF0dHJpYnV0ZShrZXkpO1xyXG4gICAgICAgIGlmICh0aGlzLl9udW1iZXJQcm9wcyAmJiB0aGlzLl9udW1iZXJQcm9wc1trZXldKSB7XHJcbiAgICAgICAgICAgIHZhbHVlID0gdG9OdW1iZXIodmFsdWUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICB0aGlzLl9zZXRQcm9wKGNhbWVsaXplJDEoa2V5KSwgdmFsdWUsIGZhbHNlKTtcclxuICAgIH1cclxuICAgIC8qKlxyXG4gICAgICogQGludGVybmFsXHJcbiAgICAgKi9cclxuICAgIF9nZXRQcm9wKGtleSkge1xyXG4gICAgICAgIHJldHVybiB0aGlzLl9wcm9wc1trZXldO1xyXG4gICAgfVxyXG4gICAgLyoqXHJcbiAgICAgKiBAaW50ZXJuYWxcclxuICAgICAqL1xyXG4gICAgX3NldFByb3Aoa2V5LCB2YWwsIHNob3VsZFJlZmxlY3QgPSB0cnVlLCBzaG91bGRVcGRhdGUgPSB0cnVlKSB7XHJcbiAgICAgICAgaWYgKHZhbCAhPT0gdGhpcy5fcHJvcHNba2V5XSkge1xyXG4gICAgICAgICAgICB0aGlzLl9wcm9wc1trZXldID0gdmFsO1xyXG4gICAgICAgICAgICBpZiAoc2hvdWxkVXBkYXRlICYmIHRoaXMuX2luc3RhbmNlKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLl91cGRhdGUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyByZWZsZWN0XHJcbiAgICAgICAgICAgIGlmIChzaG91bGRSZWZsZWN0KSB7XHJcbiAgICAgICAgICAgICAgICBpZiAodmFsID09PSB0cnVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoaHlwaGVuYXRlKGtleSksICcnKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKHR5cGVvZiB2YWwgPT09ICdzdHJpbmcnIHx8IHR5cGVvZiB2YWwgPT09ICdudW1iZXInKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBdHRyaWJ1dGUoaHlwaGVuYXRlKGtleSksIHZhbCArICcnKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCF2YWwpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUF0dHJpYnV0ZShoeXBoZW5hdGUoa2V5KSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBfdXBkYXRlKCkge1xyXG4gICAgICAgIHJlbmRlcih0aGlzLl9jcmVhdGVWTm9kZSgpLCB0aGlzLnNoYWRvd1Jvb3QpO1xyXG4gICAgfVxyXG4gICAgX2NyZWF0ZVZOb2RlKCkge1xyXG4gICAgICAgIGNvbnN0IHZub2RlID0gY3JlYXRlVk5vZGUodGhpcy5fZGVmLCBleHRlbmQoe30sIHRoaXMuX3Byb3BzKSk7XHJcbiAgICAgICAgaWYgKCF0aGlzLl9pbnN0YW5jZSkge1xyXG4gICAgICAgICAgICB2bm9kZS5jZSA9IGluc3RhbmNlID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMuX2luc3RhbmNlID0gaW5zdGFuY2U7XHJcbiAgICAgICAgICAgICAgICBpbnN0YW5jZS5pc0NFID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIC8vIEhNUlxyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLmNlUmVsb2FkID0gbmV3U3R5bGVzID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWxhd3lzIHJlc2V0IHN0eWxlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fc3R5bGVzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdHlsZXMuZm9yRWFjaChzID0+IHRoaXMuc2hhZG93Um9vdC5yZW1vdmVDaGlsZChzKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9zdHlsZXMubGVuZ3RoID0gMDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9hcHBseVN0eWxlcyhuZXdTdHlsZXMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGFuIGFzeW5jIGNvbXBvbmVudCwgY2VSZWxvYWQgaXMgY2FsbGVkIGZyb20gdGhlIGlubmVyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbXBvbmVudCBzbyBubyBuZWVkIHRvIHJlbG9hZCB0aGUgYXN5bmMgd3JhcHBlclxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX2RlZi5fX2FzeW5jTG9hZGVyKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZWxvYWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2luc3RhbmNlID0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX3VwZGF0ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIGludGVyY2VwdCBlbWl0XHJcbiAgICAgICAgICAgICAgICBpbnN0YW5jZS5lbWl0ID0gKGV2ZW50LCAuLi5hcmdzKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KG5ldyBDdXN0b21FdmVudChldmVudCwge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXRhaWw6IGFyZ3NcclxuICAgICAgICAgICAgICAgICAgICB9KSk7XHJcbiAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgLy8gbG9jYXRlIG5lYXJlc3QgVnVlIGN1c3RvbSBlbGVtZW50IHBhcmVudCBmb3IgcHJvdmlkZS9pbmplY3RcclxuICAgICAgICAgICAgICAgIGxldCBwYXJlbnQgPSB0aGlzO1xyXG4gICAgICAgICAgICAgICAgd2hpbGUgKChwYXJlbnQgPVxyXG4gICAgICAgICAgICAgICAgICAgIHBhcmVudCAmJiAocGFyZW50LnBhcmVudE5vZGUgfHwgcGFyZW50Lmhvc3QpKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQgaW5zdGFuY2VvZiBWdWVFbGVtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGluc3RhbmNlLnBhcmVudCA9IHBhcmVudC5faW5zdGFuY2U7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHZub2RlO1xyXG4gICAgfVxyXG4gICAgX2FwcGx5U3R5bGVzKHN0eWxlcykge1xyXG4gICAgICAgIGlmIChzdHlsZXMpIHtcclxuICAgICAgICAgICAgc3R5bGVzLmZvckVhY2goY3NzID0+IHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHMgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzdHlsZScpO1xyXG4gICAgICAgICAgICAgICAgcy50ZXh0Q29udGVudCA9IGNzcztcclxuICAgICAgICAgICAgICAgIHRoaXMuc2hhZG93Um9vdC5hcH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RlLnR5cGUgPT09IEZyYWdtZW50KSB7XHJcbiAgICAgICAgdm5vZGUuY2hpbGRyZW4uZm9yRWFjaChjID0+IHNldFZhcnNPblZOb2RlKGMsIHZhcnMpKTtcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKHZub2RlLnR5cGUgPT09IFN0YXRpYykge1xyXG4gICAgICAgIGxldCB7IGVsLCBhbmNob3IgfSA9IHZub2RlO1xyXG4gICAgICAgIHdoaWxlIChlbCkge1xyXG4gICAgICAgICAgICBzZXRWYXJzT25Ob2RlKGVsLCB2YXJzKTtcclxuICAgICAgICAgICAgaWYgKGVsID09PSBhbmNob3IpXHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgZWwgPSBlbC5uZXh0U2libGluZztcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gc2V0VmFyc09uTm9kZShlbCwgdmFycykge1xyXG4gICAgaWYgKGVsLm5vZGVUeXBlID09PSAxKSB7XHJcbiAgICAgICAgY29uc3Qgc3R5bGUgPSBlbC5zdHlsZTtcclxuICAgICAgICBmb3IgKGNvbnN0IGtleSBpbiB2YXJzKSB7XHJcbiAgICAgICAgICAgIHN0eWxlLnNldFByb3BlcnR5KGAtLSR7a2V5fWAsIHZhcnNba2V5XSk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG59XG5cbmNvbnN0IFRSQU5TSVRJT04gPSAndHJhbnNpdGlvbic7XHJcbmNvbnN0IEFOSU1BVElPTiA9ICdhbmltYXRpb24nO1xyXG4vLyBET00gVHJhbnNpdGlvbiBpcyBhIGhpZ2hlci1vcmRlci1jb21wb25lbnQgYmFzZWQgb24gdGhlIHBsYXRmb3JtLWFnbm9zdGljXHJcbi8vIGJhc2UgVHJhbnNpdGlvbiBjb21wb25lbnQsIHdpdGggRE9NLXNwZWNpZmljIGxvZ2ljLlxyXG5jb25zdCBUcmFuc2l0aW9uID0gKHByb3BzLCB7IHNsb3RzIH0pID0+IGgoQm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cbiAqIHdpdGggY3VzdG9tIEhPQ3MuXHJcbiAqL1xyXG5jb25zdCBjYWxsSG9vayA9IChob29rLCBhcmdzID0gW10pID0+IHtcclxuICAgIGlmIChpc0FycmF5KGhvb2spKSB7XHJcbiAgICAgICAgaG9vay5mb3JFYWNoKGggPT4gaCguLi5hcmdzKSk7XHJcbiAgICB9XHJcbiAgICBlbHNlIGlmIChob29rKSB7XHJcbiAgICAgICAgaG9vayguLi5hcmdzKTtcclxuICAgIH1cclxufTtcclxuLyoqXHJcbiAqIENoZWNrIGlmIGEgaG9vayBleHBlY3RzIGEgY2FsbGJhY2sgKDJuZCBhcmcpLCB3aGljaCBtZWFucyB0aGUgdXNlclxyXG4gKiBpbnRlbmRzIHRvIGV4cGxpY2l0bHkgY29udHJvbCB0aGUgZW5kIG9mIHRoZSB0cmFuc2l0aW9uLlxyXG4gKi9cclxuY29uc3QgaGFzRXhwbGljaXRDYWxsYmFjayA9IChob29rKSA9PiB7XHJcbiAgICByZXR1cm4gaG9va1xyXG4gICAgICAgID8gaXNBcnJheShob29rKVxyXG4gICAgICAgICAgICA/IGhvb2suc29tZShoID0+IGgubGVuZ3RoID4gMSlcclxuICAgICAgICAgICAgOiBob29rLmxlbmd0aCA+IDFcclxuICAgICAgICA6IGZhbHNlO1xyXG59O1xyXG5mdW5jdGlvbiByZXNvbHZlVHJhbnNpdGlvblByb3BzKHJhd1Byb3BzKSB7XHJcbiAgICBjb25zdCBiYXNlUHJvcHMgPSB7fTtcclxuICAgIGZvciAoY29uc3Qga2V5IGluIHJhd1Byb3BzKSB7XHJcbiAgICAgICAgaWYgKCEoa2V5IGluIERPTVRyYW5zaXRpb25Qcm9wc1ZhbGlkYXRvcnMpKSB7XHJcbiAgICAgICAgICAgIGJhc2VQcm9wc1trZXldID0gcmF3UHJvcHNba2V5XTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBpZiAocmF3UHJvcHMuY3NzID09PSBmYWxzZSkge1xyXG4gICAgICAgIHJldH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ZWxheXMsIGFuaW1hdGlvbkR1cmF0aW9ucyk7XHJcbiAgICBsZXQgdHlwZSA9IG51bGw7XHJcbiAgICBsZXQgdGltZW91dCA9IDA7XHJcbiAgICBsZXQgcHJvcENvdW50ID0gMDtcclxuICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xyXG4gICAgaWYgKGV4cGVjdGVkVHlwZSA9PT0gVFJBTlNJVElPTikge1xyXG4gICAgICAgIGlmICh0cmFuc2l0aW9uVGltZW91dCA+IDApIHtcclxuICAgICAgICAgICAgdHlwZSA9IFRSQU5TSVRJT047XHJcbiAgICAgICAgICAgIHRpbWVvdXQgPSB0cmFuc2l0aW9uVGltZW91dDtcclxuICAgICAgICAgICAgcHJvcENvdW50ID0gdHJhbnNpdGlvbkR1cmF0aW9ucy5sZW5ndGg7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAoZXhwZWN0ZWRUeXBlID09PSBBTklNQVRJT04pIHtcclxuICAgICAgICBpZiAoYW5pbWF0aW9uVGltZW91dCA+IDApIHtcclxuICAgICAgICAgICAgdHlwZSA9IEFOSU1BVElPTjtcclxuICAgICAgICAgICAgdGltZW91dCA9IGFuaW1hdGlvblRpbWVvdXQ7XHJcbiAgICAgICAgICAgIHByb3BDb3VudCA9IGFuaW1hdGlvbkR1cmF0aW9ucy5sZW5ndGg7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgdGltZW91dCA9IE1hdGgubWF4KHRyYW5zaXRpb25UaW1lb3V0LCBhbmltYXRpb25UaW1lb3V0KTtcclxuICAgICAgICB0eXBlID1cclxuICAgICAgICAgICAgdGltZW91dCA+IDBcclxuICAgICAgICAgICAgICAgID8gdHJhbnNpdGlvblRpbWVvdXQgPiBhbmltYXRpb25UaW1lb3V0XHJcbiAgICAgICAgICAgICAgICAgICAgPyBUUkFOU0lUSU9OXHJcbiAgICAgICAgICAgICAgICAgICAgOiBBTkl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bmcgaW4gcG9zaXRpb25cclxuICAgICAgICAgICAgZm9yY2VSZWZsb3coKTtcclxuICAgICAgICAgICAgbW92ZWRDaGlsZHJlbi5mb3JFYWNoKGMgPT4ge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgZWwgPSBjLmVsO1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3R5bGUgPSBlbC5zdHlsZTtcclxuICAgICAgICAgICAgICAgIGFkZFRyYW5zaXRpb25DbGFzcyhlbCwgbW92ZUNsYXNzKTtcclxuICAgICAgICAgICAgICAgIHN0eWxlLnRyYW5zZm9ybSA9IHN0eWxlLndlYmtpdFRyYW5zZm9ybSA9IHN0eWxlLnRyYW5zaXRpb25EdXJhdGlvbiA9ICcnO1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY2IgPSAoZWwuX21vdmVDYiA9IChlKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGUgJiYgZS50YXJnZXQgIT09IGVsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlIHx8IC90cmFuc2Zvcm0kLy50ZXN0KGUucHJvcGVydHlOYW1lKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbC5yZW1vdmVFdmVudExpc3RlbmVyKCd0cmFuc2l0aW9uZW5kJywgY2IpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbC5fbW92ZUNiID0gbnVsbDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlVHJhbnNpdGlvbkNsYXNzKGVsLCBtb3ZlQ2xhc3MpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgZWwuYWRkRXZlbnRMaXN0ZW5lcigndHJhbnNpdGlvbmVuZCcsIGNiKTtcclxuICAgICAgICAgICAgfSk7XHJcbiAgIC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GRFdmVudExpc3RlbmVyKGVsLCAnY2hhbmdlJywgb25Db21wb3NpdGlvbkVuZCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIC8vIHNldCB2YWx1ZSBvbiBtb3VudGVkIHNvIGl0J3MgYWZ0ZXIgbWluL21heCBmb3IgdHlwZT1cInJhbmdlXCJcclxuICAgIG1vdW50ZWQoZWwsIHsgdmFsdWUgfSkge1xyXG4gICAgICAgIGVsLnZhbHVlID0gdmFsdWUgPT0gbnVsbCA/ICcnIDogdmFsdWU7XHJcbiAgICB9LFxyXG4gICAgYmVmb3JlVXBkYXRlKGVsLCB7IHZhbHVlLCBtb2RpZmllcnM6IHsgbGF6eSwgdHJpbSwgbnVtYmVyIH0gfSwgdm5vZGUpIHtcclxuICAgICAgICBlbC5fYXNzaWduID0gZ2V0TW9kZWxBc3NpZ25lcih2bm9kZSk7XHJcbiAgICAgICAgLy8gYXZvaWQgY2xlYXJpbmcgdW5yZXNvbHZlZCB0ZXh0LiAjMjMwMlxyXG4gICAgICAgIGlmIChlbC5jb21wb3NpbmcpXHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICBpZiAoZG9jdW1lbnQuYWN0aXZlRWxlbWVudCA9PT0gZWwpIHtcclxuICAgICAgICAgICAgaWYgKGxhenkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodHJpbSAmJiBlbC52YWx1ZS50cmltKCkgPT09IHZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKChudW1iZXIgfHwgZWwudHlwZSA9PT0gJ251bWJlcicpICYmIHRvTnVtYmVyKGVsLnZhbHVlKSA9PT0gdmFsdWUpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBjb25zdCBuZXdWY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ICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoIWNoZWNrZWQgJiYgZm91bmQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBmaWx0ZXJlZCA9IFsuLi5tb2RlbFZhbHVlXTtcclxuICAgICAgICAgICAgICAgICAgICBmaWx0ZXJlZC5zcGxpY2UoaW5kZXgsIDEpO1xyXG4gICAgICAgICAgICAgICAgICAgIGFzc2lnbihmaWx0ZXJlZCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoaXNTZXQobW9kZWxWYWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNsb25lZCA9IG5ldyBTZXQobW9kZWxWYWx1ZSk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY2hlY2tlZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNsb25lZC5hZGQoZWxlbWVudFZhbHVlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGNsb25lZC5kZWxldGUoZWxlbWVudFZhbHVlKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGFzc2lnbihjbG9uZWQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgYXNzaWduKGdldENoZWNrYm94VmFsdWUoZWwsIGNoZWNrZWQpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0pO1xyXG4gICAgfSxcclxuICAgIC8vIHNldCBpbml0aWFsIGNoZWNrZWQgb24gbW91bnQgdG8gd2FpdCBmb3IgdHJ1ZS12YWx1ZS9mYWxzZS12YWx1ZVxyXG4gICAgbW91bnRlZDogc2V0Q2hlY2tlZCxcclxuICAgIGJlZm9yZVVwZGF0ZShlbCwgYmluZGluZywgdm5vZGUpIHtccl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sKHZhbHVlKS5zbGljZSg4LCAtMSl9LmApO1xyXG4gICAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIGZvciAobGV0IGkgPSAwLCBsID0gZWwub3B0aW9ucy5sZW5ndGg7IGkgPCBsOyBpKyspIHtcclxuICAgICAgICBjb25zdCBvcHRpb24gPSBlbC5vcHRpb25zW2ldO1xyXG4gICAgICAgIGNvbnN0IG9wdGlvblZhbHVlID0gZ2V0VmFsdWUob3B0aW9uKTtcclxuICAgICAgICBpZiAoaXNNdWx0aXBsZSkge1xyXG4gICAgICAgICAgICBpZiAoaXNBcnJheSh2YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIG9wdGlvbi5zZWxlY3RlZCA9IGxvb3NlSW5kZXhPZih2YWx1ZSwgb3B0aW9uVmFsdWUpID4gLTE7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBvcHRpb24uc2VsZWN0ZWQgPSB2YWx1ZS5oYXMob3B0aW9uVmFsdWUpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBpZiAobG9vc2VFcXVhbChnZXRWYWx1ZShvcHRpb24pLCB2YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIGlmIChlbC5zZWxlY3RlZEluZGV4ICE9PSBpKVxyXG4gICAgICAgICAgICAgICAgICAgIGVsLnNlbGVjdGVkSW5kZXggPSBpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKCFpc011bHRpcGxlICYmIGVsLnNlbGVjdGVkSW5kZXggIT09IC0xKSB7XHJcbiAgICAgICAgZWwuc2VsZWN0ZWRJbmRleCA9IC0xO1xyXG4gICAgfVxyXG59XHJcbi8vIHJldHJpZXZlIHJhdyB2YWx1ZSBzZXQgdmlhIDp2Y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gdm5vZGUsIHByZXZWTm9kZSwgJ3VwZGF0ZWQnKTtcclxuICAgIH1cclxufTtcclxuZnVuY3Rpb24gY2FsbE1vZGVsSG9vayhlbCwgYmluZGluZywgdm5vZGUsIHByZXZWTm9kZSwgaG9vaykge1xyXG4gICAgbGV0IG1vZGVsVG9Vc2U7XHJcbiAgICBzd2l0Y2ggKGVsLnRhZ05hbWUpIHtcclxuICAgICAgICBjYXNlICdTRUxFQ1QnOlxyXG4gICAgICAgICAgICBtb2RlbFRvVXNlID0gdk1vZGVsU2VsZWN0O1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdURVhUQVJFQSc6XHJcbiAgICAgICAgICAgIG1vZGVsVG9Vc2UgPSB2TW9kZWxUZXh0O1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICBzd2l0Y2ggKHZub2RlLnByb3BzICYmIHZub2RlLnByb3BzLnR5cGUpIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgJ2NoZWNrYm94JzpcclxuICAgICAgICAgICAgICAgICAgICBtb2RlbFRvVXNlID0gdk1vZGVsQ2hlY2tib3g7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICBjYXNlICdyYWRpbyc6XHJcbiAgICAgICAgICAgICAgICAgICAgbW9kZWxUb1VzZSA9IHZNb2RlbFJhZGlvO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgICAgICAgICBtb2RlbFRvVXNlID0gdk1vZGVsVGV4dDtcclxuICAgICAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgY29uc3QgZm4gPSBtb2RlbFRvVXNlW2hvb2tdO1xyXG4gICAgZm4gJiYgZm4oZWwsIGJpbmRpbmcsIHZub2RlLCBwcmV2Vk5vZGUpO1xyXG59XHJcbi8vIFNTUiB2bm9kZSB0cmFuc2Zvcm1zLCBvbmx5IHVzZWQgd2hlbiB1c2VyIGluY2x1ZGVzIGNsaWVudC1vcmllbnRlZCByZW5kZXJcclxuLy8gZnVuY3Rpb24gaW4gU1NSXHJcbmZ1bmN0aW9uIGluaXRWTW9kZWxGb3JTU1IoKSB7XHJcbiAgICB2TW9kZWxUZXh0LmdldFNTUlByb3BzID0gKHsgdmFsdWUgfSkgPT4gKHsgdmFsdWUgfSk7XHJcbiAgICB2TW9kZWxSYWRpby5nZXRTU1JQcm9wcyA9ICh7IHZhbHVlIH0sIHZub2RlKSA9PiB7XHJcbiAgICAgICAgaWYgKHZub2RlLnByb3BzICYmIGxvb3NlRXF1YWwodm5vZGUucHJvcHMudmFsdWUsIHZhbHVlKSkge1xyXG4gICAgICAgICAgICByZXR1cm4geyBjaGVja2VkOiB0cnVlIH07XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxuICAgIHZNb2RlbENoZWNrYm94LmdldFNTUlByb3BzID0gKHsgdmFsdWUgfSwgdm5vZGUpID0+IHtcclxuICAgICAgICBpZiAoaXNBcnJheSh2YWx1ZSkpIHtcclxuICAgICAgICAgICAgaWYgKHZub2RlLnByb3BzICYmIGxvb3NlSW5kZXhPZih2YWx1ZSwgdm5vZGUucHJvcHMudmFsdWUpID4gLTEpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB7IGNoZWNrZWQ6IHRydWUgfTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpc1NldCh2YWx1ZSkpIHtcclxuICAgICAgICAgICAgaWYgKHZub2RlLnByb3BzICYmIHZhbHVlLmhhcyh2bm9kZS5wcm9wcy52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB7IGNoZWNrZWQ6IHRydWUgfTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICh2YWx1ZSkge1xyXG4gICAgICAgICAgICByZXR1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yXG4gICAgICAgIH1cclxuICAgIH07XHJcbn07XG5cbmNvbnN0IHZTaG93ID0ge1xyXG4gICAgYmVmb3JlTW91bnQoZWwsIHsgdmFsdWUgfSwgeyB0cmFuc2l0aW9uIH0pIHtcclxuICAgICAgICBlbC5fdm9kID0gZWwuc3R5bGUuZGlzcGxheSA9PT0gJ25vbmUnID8gJycgOiBlbC5zdHlsZS5kaXNwbGF5O1xyXG4gICAgICAgIGlmICh0cmFuc2l0aW9uICYmIHZhbHVlKSB7XHJcbiAgICAgICAgICAgIHRyYW5zaXRpb24uYmVmb3JlRW50ZXIoZWwpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgc2V0RGlzcGxheShlbCwgdmFsdWUpO1xyXG4gICAgICAgIH1cclxuICAgIH0sXHJcbiAgICBtb3VudGVkKGVsLCB7IHZhbHVlIH0sIHsgdHJhbnNpdGlvbiB9KSB7XHJcbiAgICAgICAgaWYgKHRyYW5zaXRpb24gJiYgdmFsdWUpIHtcclxuICAgICAgICAgICAgdHJhbnNpdGlvbi5lbnRlcihlbCk7XHJcbiAgICAgICAgfVxyXG4gICAgfSxcclxuICAgIHVwZGF0ZWQoZWwsIHsgdmFsdWUsIG9sZFZhbHVlIH0sIHsgdHJhbnNpdGlvbiB9KSB7XHJcbiAgICAgICAgaWYgKCF2YWx1ZSA9PT0gIW9sZFZhbHVlKVxyXG4gICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgaWYgKHRyYW5zaXRpb24pIHtcclxuICAgICAgICAgICAgaWYgKHZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICB0cmFuc2l0aW9uLmJlZm9yZUVudGVyKGVsKTtcclxuICAgICAgICAgICAgICAgIHNldERpc3BsYXkoZWwsIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgdHJhbnNpdGlvbi5lbnRlcihlbCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgIC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G1vdW50aW5nXHJcbiAgICAgICAgY29udGFpbmVyLmlubmVySFRNTCA9ICcnO1xyXG4gICAgICAgIGNvbnN0IHByb3h5ID0gbW91bnQoY29udGFpbmVyLCBmYWxzZSwgY29udGFpbmVyIGluc3RhbmNlb2YgU1ZHRWxlbWVudCk7XHJcbiAgICAgICAgaWYgKGNvbnRhaW5lciBpbnN0YW5jZW9mIEVsZW1lbnQpIHtcclxuICAgICAgICAgICAgY29udGFpbmVyLnJlbW92ZUF0dHJpYnV0ZSgndi1jbG9haycpO1xyXG4gICAgICAgICAgICBjb250YWluZXIuc2V0QXR0cmlidXRlKCdkYXRhLXYtYXBwJywgJycpO1xyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gcHJveHk7XHJcbiAgICB9O1xyXG4gICAgcmV0dXJuIGFwcDtcclxufSk7XHJcbmNvbnN0IGNyZWF0ZVNTUkFwcCA9ICgoLi4uYXJncykgPT4ge1xyXG4gICAgY29uc3QgYXBwID0gZW5zdXJlSHlkcmF0aW9uUmVuZGVyZXIoKS5jcmVhdGVBcHAoLi4uYXJncyk7XHJcbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgaW5qZWN0TmF0aXZlVGFnQ2hlY2soYXBwKTtcclxuICAgICAgICBpbmplY3RDb21waWxlck9wdGlvbnNDaGVjayhhcHApO1xyXG4gICAgfVxyXG4gICAgY29uc3QgeyBtb3VudCB9ID0gYXBwO1xyXG4gICAgYXBwLm1vdW50ID0gKGNvbnRhaW5lck9yU2VsZWN0b3IpID0+IHtcclxuICAgICAgICBjb25zdCBjb250YWluZXIgPSBub3JtYWxpemVDb250YWluZXIoY29udGFpbmVyT3JTZWxlY3Rvcik7XHJcbiAgICAgICAgaWYgKGNvbnRhaW5lcikge1xyXG4gICAgICAgICAgICByZXR1cm4gbW91bnQoY29udGFpbmVyLCB0cnVlLCBjb250YWluZXIgaW5zdGFuY2VvZiB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x1Z2luLXZ1ZSNleGFtcGxlLWZvci1wYXNzaW5nLW9wdGlvbnMtdG8tdnVlY29tcGlsZXItZG9tYDtcclxuICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoYXBwLmNvbmZpZywgJ2NvbXBpbGVyT3B0aW9ucycsIHtcclxuICAgICAgICAgICAgZ2V0KCkge1xyXG4gICAgICAgICAgICAgICAgd2Fybihtc2cpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbXBpbGVyT3B0aW9ucztcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc2V0KCkge1xyXG4gICAgICAgICAgICAgICAgd2Fybihtc2cpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gbm9ybWFsaXplQ29udGFpbmVyKGNvbnRhaW5lcikge1xyXG4gICAgaWYgKGlzU3RyaW5nKGNvbnRhaW5lcikpIHtcclxuICAgICAgICBjb25zdCByZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKGNvbnRhaW5lcik7XHJcbiAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiAhcmVzKSB7XHJcbiAgICAgICAgICAgIHdhcm4oYEZhaWxlZCB0byBtb3VudCBhcHA6IG1vdW50IHRhcmdldCBzZWxlY3RvciBcIiR7Y29udGFpbmVyfVwiIHJldHVybmVkIG51bGwuYCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiByZXM7XHJcbiAgICB9XHJcbiAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgd2luZG93LlNoYWRvd1Jvb3QgJiZcclxuICAgICAgICBjb250YWluZXIgaW5zdGFuY2VvZiB3aW5kb3cuU2hhZG93Um9vdCAmJlxyXG4gICAgICAgIGNvbnRhaW5lci5tb2RlID09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gLyogUk9PVCAqLyxcclxuICAgICAgICBjaGlsZHJlbixcclxuICAgICAgICBoZWxwZXJzOiBbXSxcclxuICAgICAgICBjb21wb25lbnRzOiBbXSxcclxuICAgICAgICBkaXJlY3RpdmVzOiBbXSxcclxuICAgICAgICBob2lzdHM6IFtdLFxyXG4gICAgICAgIGltcG9ydHM6IFtdLFxyXG4gICAgICAgIGNhY2hlZDogMCxcclxuICAgICAgICB0ZW1wczogMCxcclxuICAgICAgICBjb2RlZ2VuTm9kZTogdW5kZWZpbmVkLFxyXG4gICAgICAgIGxvY1xyXG4gICAgfTtcclxufVxyXG5mdW5jdGlvbiBjcmVhdGVWTm9kZUNhbGwoY29udGV4dCwgdGFnLCBwcm9wcywgY2hpbGRyZW4sIHBhdGNoRmxhZywgZHluYW1pY1Byb3BzLCBkaXJlY3RpdmVzLCBpc0Jsb2NrID0gZmFsc2UsIGRpc2FibGVUcmFja2luZyA9IGZhbHNlLCBpc0NvbXBvbmVudCA9IGZhbHNlLCBsb2MgPSBsb2NTdHViKSB7XHJcbiAgICBpZiAoY29udGV4dCkge1xyXG4gICAgICAgIGlmIChpc0Jsb2NrKSB7XHJcbiAgICAgICAgICAgIGNvbnRleHQuaGVscGVyKE9QRU5fQkxPQ0spO1xyXG4gICAgICAgICAgICBjb250ZXh0LmhlbHBlcihnZXRWTm9kZUJsb2NrSGVscGVyKGNvbnRleHQuaW5TU1IsIGlzQ29tcG9uZW50KSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBjb250ZXh0LmhlbHBlcihnZXRWTm9kZUhlbHBlcihjb250ZXh0LmluU1NSLCBpc0NvbXBvbmVudCkpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZGlyZWN0aXZlcykge1xyXG4gICAgICAgICAgICBjb250ZXh0LmhlbHBlcihXSVRIX0RJUkVDVElWRVMpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiB7XHJcbiA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GF0aCA9IHBhdGgudHJpbSgpLnJlcGxhY2Uod2hpdGVzcGFjZVJFLCBzID0+IHMudHJpbSgpKTtcclxuICAgIGxldCBzdGF0ZSA9IDAgLyogaW5NZW1iZXJFeHAgKi87XHJcbiAgICBsZXQgc3RhdGVTdGFjayA9IFtdO1xyXG4gICAgbGV0IGN1cnJlbnRPcGVuQnJhY2tldENvdW50ID0gMDtcclxuICAgIGxldCBjdXJyZW50T3BlblBhcmVuc0NvdW50ID0gMDtcclxuICAgIGxldCBjdXJyZW50U3RyaW5nVHlwZSA9IG51bGw7XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHBhdGgubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBjaGFyID0gcGF0aC5jaGFyQXQoaSk7XHJcbiAgICAgICAgc3dpdGNoIChzdGF0ZSkge1xyXG4gICAgICAgICAgICBjYXNlIDAgLyogaW5NZW1iZXJFeHAgKi86XHJcbiAgICAgICAgICAgICAgICBpZiAoY2hhciA9PT0gJ1snKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhdGVTdGFjay5wdXNoKHN0YXRlKTtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IDEgLyogaW5CcmFja2V0cyAqLztcclxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50T3BlbkJyYWNrZXRDb3VudCsrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY2hhciA9PT0gJygnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhdGVTdGFjay5wdXNoKHN0YXRlKTtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IDIgLyogaW5QYXJlbnMgKi87XHJcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudE9wZW5QYXJlbnNDb3VudCsrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoIShpID09PSAwID8gdmFsaWRGaXJzdElkZW50Q2hhclJFIDogdmFsaWRJZGVudENoYXJSRSkudGVzdChjaGFyKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIDEgLyogaW5CcmFja2V0cyAqLzpcclxuICAgICAgICAgICAgICAgIGlmIChjaGFyID09PSBgJ2AgfHwgY2hhciA9PT0gYFwiYCB8fCBjaGFyID09PSAnYCcpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZVN0YWNrLnB1c2goc3RhdGUpO1xyXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlID0gMyAvKiBpblN0cmluZyAqLztcclxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50U3RyaW5nVHlwZSA9IGNoYXI7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmIChjaGFyID09PSBgW2ApIHtcclxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50T3BlbkJyYWNrZXRDb3VudCsrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY2hhciA9PT0gYF1gKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEtLWN1cnJlbnRPcGVuQnJhY2tldENvdW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gc3RhdGVTdGFjay5wb3AoKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAyIC8qIGluUGFyZW5zICovOlxyXG4gICAgICAgICAgICAgICAgaWYgKGNoYXIgPT09IGAnYCB8fCBjaGFyID09PSBgXCJgIHx8IGNoYXIgPT09ICdgJykge1xyXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlU3RhY2sucHVzaChzdGF0ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSAzIC8qIGluU3RyaW5nICovO1xyXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRTdHJpbmdUeXBlID0gY2hhcjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNoYXIgPT09IGAoYCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbnRPcGVuUGFyZW5zQ291bnQrKztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNoYXIgPT09IGApYCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBleHAgZW5kcyBhcyBhIGNhbGwgdGhlbiBpdCBzaG91bGQgbm90IGJlIGNvbnNpZGVyZWQgdmFsaWRcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gcGF0aC5sZW5ndGggLSAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEtLWN1cnJlbnRPcGVuUGFyZW5zQ291bnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBzdGF0ZVN0YWNrLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIDMgLyogaW5TdHJpbmcgKi86XHJcbiAgICAgICAgICAgICAgICBpZiAoY2hhciA9PT0gY3VycmVudFN0cmluZ1R5cGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IHN0YXRlU3RhY2sucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY3VycmVudFN0cmluZ1R5cGUgPSBudWxsO1xyXG4gICAgICAgICAgICAgICA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aXRpb24pIHtcclxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IobXNnIHx8IGB1bmV4cGVjdGVkIGNvbXBpbGVyIGNvbmRpdGlvbmApO1xyXG4gICAgfVxyXG59XHJcbmZ1bmN0aW9uIGZpbmREaXIobm9kZSwgbmFtZSwgYWxsb3dFbXB0eSA9IGZhbHNlKSB7XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUucHJvcHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBwID0gbm9kZS5wcm9wc1tpXTtcclxuICAgICAgICBpZiAocC50eXBlID09PSA3IC8qIERJUkVDVElWRSAqLyAmJlxyXG4gICAgICAgICAgICAoYWxsb3dFbXB0eSB8fCBwLmV4cCkgJiZcclxuICAgICAgICAgICAgKGlzU3RyaW5nKG5hbWUpID8gcC5uYW1lID09PSBuYW1lIDogbmFtZS50ZXN0KHAubmFtZSkpKSB7XHJcbiAgICAgICAgICAgIHJldHVybiBwO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG5mdW5jdGlvbiBmaW5kUHJvcChub2RlLCBuYW1lLCBkeW5hbWljT25seSA9IGZhbHNlLCBhbGxvd0VtcHR5ID0gZmFsc2UpIHtcclxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbm9kZS5wcm9wcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgIGNvbnN0IHAgPSBub2RlLnByb3BzW2ldO1xyXG4gICAgICAgIGlmIChwLnR5cGUgPT09IDYgLyogQVRUUklCVVRFICovKSB7XHJcbiAgICAgICAgICAgIGlmIChkeW5hbWljT25seSlcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICBpZiAocC5uYW1lID09PSBuYW1lICYmIChwLnZhbHVlIHx8IGFsbG93RW1wdHkpKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gcDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHN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RXhwcmVzc2lvbihbcHJvcF0pLFxyXG4gICAgICAgICAgICAgICAgICAgIHByb3BzXHJcbiAgICAgICAgICAgICAgICBdKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHByb3BzLmFyZ3VtZW50cy51bnNoaWZ0KGNyZWF0ZU9iamVjdEV4cHJlc3Npb24oW3Byb3BdKSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgIXByb3BzV2l0aEluamVjdGlvbiAmJiAocHJvcHNXaXRoSW5qZWN0aW9uID0gcHJvcHMpO1xyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAocHJvcHMudHlwZSA9PT0gMTUgLyogSlNfT0JKRUNUX0VYUFJFU1NJT04gKi8pIHtcclxuICAgICAgICBsZXQgYWxyZWFkeUV4aXN0cyA9IGZhbHNlO1xyXG4gICAgICAgIC8vIGNoZWNrIGV4aXN0aW5nIGtleSB0byBhdm9pZCBvdmVycmlkaW5nIHVzZXIgcHJvdmlkZWQga2V5c1xyXG4gICAgICAgIGlmIChwcm9wLmtleS50eXBlID09PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHByb3BLZXlOYW1lID0gcHJvcC5rZXkuY29udGVudDtcclxuICAgICAgICAgICAgYWxyZWFkeUV4aXN0cyA9IHByb3BzLnByb3BlcnRpZXMuc29tZShwID0+IHAua2V5LnR5cGUgPT09IDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi8gJiZcclxuICAgICAgICAgICAgICAgIHAua2V5LmNvbnRlbnQgPT09IHByb3BLZXlOYW1lKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKCFhbHJlYWR5RXhpc3RzKSB7XHJcbiAgICAgICAgICAgIHByb3BzLnByb3BlcnRpZXMudW5zaGlmdChwcm9wKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcHJvcHNXaXRo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gICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgIH1cclxuICAgIHN3aXRjaCAobm9kZS50eXBlKSB7XHJcbiAgICAgICAgY2FzZSAxIC8qIEVMRU1FTlQgKi86XHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbm9kZS5wcm9wcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcCA9IG5vZGUucHJvcHNbaV07XHJcbiAgICAgICAgICAgICAgICBpZiAocC50eXBlID09PSA3IC8qIERJUkVDVElWRSAqLyAmJlxyXG4gICAgICAgICAgICAgICAgICAgIChoYXNTY29wZVJlZihwLmFyZywgaWRzKSB8fCBoYXNTY29wZVJlZihwLmV4cCwgaWRzKSkpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICByZXR1cm4gbm9kZS5jaGlsZHJlbi5zb21lKGMgPT4gaGFzU2NvcGVSZWYoYywgaWRzKSk7XHJcbiAgICAgICAgY2FzZSAxMSAvKiBGT1IgKi86XHJcbiAgICAgICAgICAgIGlmIChoYXNTY29wZVJlZihub2RlLnNvdXJjZSwgaWRzKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuY2hpbGRyZW4uc29tZShjID0+IGhhc1Njb3BlUmVmKGMsIGlkcykpO1xyXG4gICAgICAgIGNhc2UgOSAvKiBJRiAqLzpcclxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuYnJhbmNoZXMuc29tZShiID0+IGhhc1Njb3BlUmVmKGIsIGlkcykpO1xyXG4gICAgICAgIGNhc2UgMTAgLyogSUZfQlJBTkNIICovOlxyXG4gICAgICAgICAgICBpZiAoaGFzU2NvcGVSZWYobm9kZS5jb25kaXRpb24sIGlkcykpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIHJldHVybiBub2RlLmNoaWxkcmVuLnNvbWUoYyA9PiBoYXNTY29wZVJlZihjLCBpZHMpKTtcclxuICAgICAgICBjYXNlIDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIHJldHVybiAoIW5vZGUuaXNTdGF0aWMgJiZcclxuICAgICAgICAgICAgICAgIGlzU2ltcGxlSWRlbnRpZmllcihub2RlLmNvbnRlbnQpICYmXHJcbiAgICAgICAgICAgICAgICAhIWlkc1tub2RlLmNvbnRlbnRdKTtcclxuICAgICAgICBjYXNlIDggLyogQ09NUE9VTkRfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuY2hpbGRyZW4uc29tZShjID0+IGlzT2JqZWN0KGMpICYmIGhhc1Njb3BlUmVmKGMsIGlkcykpO1xyXG4gICAgICAgIGNhc2UgNSAvKiBJTlRFUlBPTEFUSU9OICovOlxyXG4gICAgICAgIGNhc2UgMTIgLyogVEVYVF9DQUxMICovOlxyXG4gICAgICAgICAgICByZXR1cm4gaGFzU2NvcGVSZWYobm9kZS5jb250ZW50LCBpZHMpO1xyXG4gICAgICAgIGNhc2UgMiAvKiBURVhUICovOlxyXG4gICAgICAgIGNhc2UgMyAvKiBDT01NRU5UICovOlxyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkgO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gZ2V0TWVtb2VkVk5vZGVDYWxsKG5vZGUpIHtcclxuICAgIGlmIChub2RlLnR5cGUgPT09IDE0IC8qIEpTX0NBTExfRVhQUkVTU0lPTiAqL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0KGNvbnRlbnQsIHJhd09wdGlvbnMpIHtcclxuICAgIGNvbnN0IG9wdGlvbnMgPSBleHRlbmQoe30sIGRlZmF1bHRQYXJzZXJPcHRpb25zKTtcclxuICAgIGxldCBrZXk7XHJcbiAgICBmb3IgKGtleSBpbiByYXdPcHRpb25zKSB7XHJcbiAgICAgICAgLy8gQHRzLWlnbm9yZVxyXG4gICAgICAgIG9wdGlvbnNba2V5XSA9XHJcbiAgICAgICAgICAgIHJhd09wdGlvbnNba2V5XSA9PT0gdW5kZWZpbmVkXHJcbiAgICAgICAgICAgICAgICA/IGRlZmF1bHRQYXJzZXJPcHRpb25zW2tleV1cclxuICAgICAgICAgICAgICAgIDogcmF3T3B0aW9uc1trZXldO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIHtcclxuICAgICAgICBvcHRpb25zLFxyXG4gICAgICAgIGNvbHVtbjogMSxcclxuICAgICAgICBsaW5lOiAxLFxyXG4gICAgICAgIG9mZnNldDogMCxcclxuICAgICAgICBvcmlnaW5hbFNvdXJjZTogY29udGVudCxcclxuICAgICAgICBzb3VyY2U6IGNvbnRlbnQsXHJcbiAgICAgICAgaW5QcmU6IGZhbHNlLFxyXG4gICAgICAgIGluVlByZTogZmFsc2UsXHJcbiAgICAgICAgb25XYXJuOiBvcHRpb25zLm9uV2FyblxyXG4gICAgfTtcclxufVxyXG5mdW5jdGlvbiBwYXJzZUNoaWxkcmVuKGNvbnRleHQsIG1vZGUsIGFuY2VzdG9ycykge1xyXG4gICAgY29uc3QgcGFyZW50ID0gbGFzdChhbmNlc3RvcnMpO1xyXG4gICAgY29uc3QgbnMgPSBwYXJlbnQgPyBwYXJlbnQubnMgOiAwIC8qIEhUTUwgKi87XHJcbiAgICBjb25zdCBub2RlcyA9IFtdO1xyXG4gICAgd2hpbGUgKCFpc0VuZChjb250ZXh0LCBtb2RlLCBhbmNlc3RvcnMpKSB7XHJcbiAgICAgICAgY29uc3QgcyA9IGNvbnRleHQuc291cmNlO1xyXG4gICAgICAgIGxldCBub2RlID0gdW5kZWZpbmVkO1xyXG4gICAgICAgIGlmIChtb2RlID09PSAwIC8qIERBVEEgKi8gfHwgbW9kZSA9PT0gMSAvKiBSQ0RBVEEgKi8pIHtcclxuICAgICAgICAgICAgaWYgKCFjb250ZXh0LmluVlByZSAmJiBzdGFydHNXaXRoKHMsIGNvbnRleHQub3B0aW9ucy5kZWxpbWl0ZXJzWzBdKSkge1xyXG4gICAgICAgICAgICAgICAgLy8gJ3t7J1xyXG4gICAgICAgICAgICAgICAgbm9kZSA9IHBhcnNlSW50ZXJwb2xhdGlvbihjb250ZXh0LCBtb2RlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChtb2RlID09PSAwIC8qIERBVEEgKi8gJiYgc1swXSA9PT0gJzwnKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBodHRwczovL2h0bWwuc3BlYy53aGF0d2cub3JnL211bHRpcGFnZS9wYXJzaW5nLmh0bWwjdGFnLW9wZW4tc3RhdGVcclxuICAgICAgICAgICAgICAgIGlmIChzLmxlbmd0aCA9PT0gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcihjb250ZXh0LCA1IC8qIEVPRl9CRUZPUkVfVEFHX05BTUUgKi8sIDEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc1sxXSA9PT0gJyEnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9odG1sLnNwZWMud2hhdHdnLm9yZy9tdWx0aXBhZ2UvcGFyc2luZy5odG1sI21hcmt1cC1kZWNsYXJhdGlvbi1vcGVuLXN0YXRlXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXJ0c1dpdGgocywgJzwhLS0nKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlID0gcGFyc2VDb21tZW50KGNvbnRleHQpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzdGFydHNXaXRoKHMsICc8IURPQ1RZUEUnKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBJZ25vcmUgRE9DVFlQRSBieSBhIGxpbWl0YXRpb24uXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgPSBwYXJzZUJvZ3VzQ29tbWVudChjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc3RhcnRzV2l0aChzLCAnPCFbQ0RBVEFbJykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5zICE9PSAwIC8qIEhUTUwgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUgPSBwYXJzZUNEQVRBKGNvbnRleHQsIGFuY2VzdG9ycyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgMSAvKiBDREFUQV9JTl9IVE1MX0NPTlRFTlQgKi8pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSA9IHBhcnNlQm9ndXNDb21tZW50KGNvbnRleHQpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgMTEgLyogSU5DT1JSRUNUTFlfT1BFTkVEX0NPTU1FTlQgKi8pO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlID0gcGFyc2VCb2d1c0NvbW1lbnQoY29udGV4dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc1sxXSA9PT0gJy8nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9odG1sLnNwZWMud2hhdHdnLm9yZy9tdWx0aXBhZ2UvcGFyc2luZy5odG1sI2VuZC10YWctb3Blbi1zdGF0ZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChzLmxlbmd0aCA9PT0gMikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgNSAvKiBFT0ZfQkVGT1JFX1RBR19OQU1FICovLCAyKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc1syXSA9PT0gJz4nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVtaXRFcnJvcihjb250ZXh0LCAxNCAvKiBNSVNTSU5HX0VORF9UQUdfTkFNRSAqLywgMik7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkdmFuY2VCeShjb250ZXh0LCAzKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKC9bYS16XS9pLnRlc3Qoc1syXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKGNvbnRleHQsIDIzIC8qIFhfSU5WQUxJRF9FTkRfVEFHICovKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VUYWcoY29udGV4dCwgMSAvKiBFbmQgKi8sIHBhcmVudCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKGNvbnRleHQsIDEyIC8qIElOVkFMSURfRklSU1RfQ0hBUkFDVEVSX09GX1RBR19OQU1FICovLCAyKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSA9IHBhcnNlQm9ndXNDb21tZW50KGNvbnRleHQpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKC9bYS16XS9pLnRlc3Qoc1sxXSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGFyc2VFbGVtZW50KGNvbnRleHQsIGFuY2VzdG9ycyk7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gMi54IDx0ZW1wbGF0ZT4gd2l0aCBubyBkaXJlY3RpdmUgY29tcGF0XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX05BVElWRV9URU1QTEFURVwiIC8qIENPTVBJTEVSX05BVElWRV9URU1QTEFURSAqLywgY29udGV4dCkgJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRhZyA9PT0gJ3RlbXBsYXRlJyAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAhbm9kZS5wcm9wcy5zb21lKHAgPT4gcC50eXBlID09PSA3IC8qIERJUkVDVElWRSAqLyAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTcGVjaWFsVGVtcGxhdGVEaXJlY3RpdmUocC5uYW1lKSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuRGVwcmVjYXRpb24oXCJDT01QSUxFUl9OQVRJVkVfVEVNUExBVEVcIiAvKiBDT01QSUxFUl9OQVRJVkVfVEVNUExBVEUgKi8sIGNvbnRleHQsIG5vZGUubG9jKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSA9IG5vZGUuY2hpbGRyZW47XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc1sxXSA9PT0gJz8nKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZW1pdEVycm9yKGNvbnRleHQsIDIxIC8qIFVORVhQRUNURURfUVVFU1RJT05fTUFSS19JTlNURUFEX09GX1RBR19OQU1FICovLCAxKTtcclxuICAgICAgICAgICAgICAgICAgICBub2RlID0gcGFyc2VCb2d1c0NvbW1lbnQoY29udGV4dCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgMTIgLyogSU5WQUxJRF9GSVJTVF9DSEFSQUNURVJfT0ZfVEFHX05BTUUgKi8sIDEpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghbm9kZSkge1xyXG4gICAgICAgICAgICBub2RlID0gcGFyc2VUZXh0KGNvbnRleHQsIG1vZGUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaXNBcnJheShub2RlKSkge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHB1c2hOb2RlKG5vZGVzLCBub2RlW2ldKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgcHVzaE5vZGUobm9kZXMsIG5vZGUpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIC8vIFdoaXRlc3BhY2UgaGFuZGxpbmcgc3RyYXRlZ3kgbGlrZSB2MlxyXG4gICAgbGV0IHJlbW92ZWRXaGl0ZXNwYWNlID0gZmFsc2U7XHJcbiAgICBpZiAobW9kZSAhPT0gMiAvKiBSQVdURVhUICovICYmIG1vZGUgIT09IDEgLyogUkNEQVRBICovKSB7XHJcbiAgICAgICAgY29uc3Qgc2hvdWxkQ29uZGVuc2UgPSBjb250ZXh0Lm9wdGlvbnMud2hpdGVzcGFjZSAhPT0gJ3ByZXNlcnZlJztcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGVzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG5vZGUgPSBub2Rlc1tpXTtcclxuICAgICAgICAgICAgaWYgKCFjb250ZXh0LmluUHJlICYmIG5vZGUudHlwZSA9PT0gMiAvKiBURVhUICovKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIS9bXlxcdFxcclxcblxcZiBdLy50ZXN0KG5vZGUuY29udGVudCkpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBwcmV2ID0gbm9kZXNbaSAtIDFdO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG5leHQgPSBub2Rlc1tpICsgMV07XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIGlmOlxyXG4gICAgICAgICAgICAgICAgICAgIC8vIC0gdGhlIHdoaXRlc3BhY2UgaXMgdGhlIGZpcnN0IG9yIGxhc3Qgbm9kZSwgb3I6XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gLSAoY29uZGVuc2UgbW9kZSkgdGhlIHdoaXRlc3BhY2UgaXMgYWRqYWNlbnQgdG8gYSBjb21tZW50LCBvcjpcclxuICAgICAgICAgICAgICAgICAgICAvLyAtIChjb25kZW5zZSBtb2RlKSB0aGUgd2hpdGVzcGFjZSBpcyBiZXR3ZWVuIHR3byBlbGVtZW50cyBBTkQgY29udGFpbnMgbmV3bGluZVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICghcHJldiB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAhbmV4dCB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAoc2hvdWxkQ29uZGVuc2UgJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwcmV2LnR5cGUgPT09IDMgLyogQ09NTUVOVCAqLyB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQudHlwZSA9PT0gMyAvKiBDT01NRU5UICovIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHByZXYudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9bXFxyXFxuXS8udGVzdChub2RlLmNvbnRlbnQpKSkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZWRXaGl0ZXNwYWNlID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZXNbaV0gPSBudWxsO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB0aGUgd2hpdGVzcGFjZSBpcyBjb25kZW5zZWQgaW50byBhIHNpbmdsZSBzcGFjZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmNvbnRlbnQgPSAnICc7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hvdWxkQ29uZGVuc2UpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBpbiBjb25kZW5zZSBtb2RlLCBjb25zZWN1dGl2ZSB3aGl0ZXNwYWNlcyBpbiB0ZXh0IGFyZSBjb25kZW5zZWRcclxuICAgICAgICAgICAgICAgICAgICAvLyBkb3duIHRvIGEgc2luZ2xlIHNwYWNlLlxyXG4gICAgICAgICAgICAgICAgICAgIG5vZGUuY29udGVudCA9IG5vZGUuY29udGVudC5yZXBsYWNlKC9bXFx0XFxyXFxuXFxmIF0rL2csICcgJyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gUmVtb3ZlIGNvbW1lbnQgbm9kZXMgaWYgZGVzaXJlZCBieSBjb25maWd1cmF0aW9uLlxyXG4gICAgICAgICAgICBlbHNlIGlmIChub2RlLnR5cGUgPT09IDMgLyogQ09NTUVOVCAqLyAmJiAhY29udGV4dC5vcHRpb25zLmNvbW1lbnRzKSB7XHJcbiAgICAgICAgICAgICAgICByZW1vdmVkV2hpdGVzcGFjZSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICBub2Rlc1tpXSA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGNvbnRleHQuaW5QcmUgJiYgcGFyZW50ICYmIGNvbnRleHQub3B0aW9ucy5pc1ByZVRhZyhwYXJlbnQudGFnKSkge1xyXG4gICAgICAgICAgICAvLyByZW1vdmUgbGVhZGluZyBuZXdsaW5lIHBlciBodG1sIHNwZWNcclxuICAgICAgICAgICAgLy8gaHR0cHM6Ly9odG1sLnNwZWMud2hhdHdnLm9yZy9tdWx0aXBhZ2UvZ3JvdXBpbmctY29udGVudC5odG1sI3RoZS1wcmUtZWxlbWVudFxyXG4gICAgICAgICAgICBjb25zdCBmaXJzdCA9IG5vZGVzWzBdO1xyXG4gICAgICAgICAgICBpZiAoZmlyc3QgJiYgZmlyc3QudHlwZSA9PT0gMiAvKiBURVhUICovKSB7XHJcbiAgICAgICAgICAgICAgICBmaXJzdC5jb250ZW50ID0gZmlyc3QuY29udGVudC5yZXBsYWNlKC9eXFxyP1xcbi8sICcnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuIC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SU5FX1RFTVBMQVRFXCIgLyogQ09NUElMRVJfSU5MSU5FX1RFTVBMQVRFICovLCBjb250ZXh0LCBpbmxpbmVUZW1wbGF0ZVByb3AubG9jKSkge1xyXG4gICAgICAgICAgICBjb25zdCBsb2MgPSBnZXRTZWxlY3Rpb24oY29udGV4dCwgZWxlbWVudC5sb2MuZW5kKTtcclxuICAgICAgICAgICAgaW5saW5lVGVtcGxhdGVQcm9wLnZhbHVlID0ge1xyXG4gICAgICAgICAgICAgICAgdHlwZTogMiAvKiBURVhUICovLFxyXG4gICAgICAgICAgICAgICAgY29udGVudDogbG9jLnNvdXJjZSxcclxuICAgICAgICAgICAgICAgIGxvY1xyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsZW1lbnQuY2hpbGRyZW4gPSBjaGlsZHJlbjtcclxuICAgIC8vIEVuZCB0YWcuXHJcbiAgICBpZiAoc3RhcnRzV2l0aEVuZFRhZ09wZW4oY29udGV4dC5zb3VyY2UsIGVsZW1lbnQudGFnKSkge1xyXG4gICAgICAgIHBhcnNlVGFnKGNvbnRleHQsIDEgLyogRW5kICovLCBwYXJlbnQpO1xyXG4gICAgfVxyXG4gICAgZWxzZSB7XHJcbiAgICAgICAgZW1pdEVycm9yKGNvbnRleHQsIDI0IC8qIFhfTUlTU0lOR19FTkRfVEFHICovLCAwLCBlbGVtZW50LmxvYy5zdGFydCk7XHJcbiAgICAgICAgaWYgKGNvbnRleHQuc291cmNlLmxlbmd0aCA9PT0gMCAmJiBlbGVtZW50LnRhZy50b0xvd2VyQ2FzZSgpID09PSAnc2NyaXB0Jykge1xyXG4gICAgICAgICAgICBjb25zdCBmaXJzdCA9IGNoaWxkcmVuWzBdO1xyXG4gICAgICAgICAgICBpZiAoZmlyc3QgJiYgc3RhcnRzV2l0aChmaXJzdC5sb2Muc291cmNlLCAnPCEtLScpKSB7XHJcbiAgICAgICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgOCAvK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lID09PSAnaWYnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzSWYgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAocC5uYW1lID09PSAnZm9yJykge1xyXG4gICAgICAgICAgICAgICAgICAgIGhhc0ZvciA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGhhc0lmICYmIGhhc0Zvcikge1xyXG4gICAgICAgICAgICAgICAgd2FybkRlcHJlY2F0aW9uKFwiQ09NUElMRVJfVl9JRl9WX0ZPUl9QUkVDRURFTkNFXCIgLyogQ09NUElMRVJfVl9JRl9WX0ZPUl9QUkVDRURFTkNFICovLCBjb250ZXh0LCBnZXRTZWxlY3Rpb24oY29udGV4dCwgc3RhcnQpKTtcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgbGV0IHRhZ1R5cGUgPSAwIC8qIEVMRU1FTlQgKi87XHJcbiAgICBpZiAoIWNvbnRleHQuaW5WUHJlKSB7XHJcbiAgICAgICAgaWYgKHRhZyA9PT0gJ3Nsb3QnKSB7XHJcbiAgICAgICAgICAgIHRhZ1R5cGUgPSAyIC8qIFNMT1QgKi87XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHRhZyA9PT0gJ3RlbXBsYXRlJykge1xyXG4gICAgICAgICAgICBpZiAocHJvcHMuc29tZShwID0+IHAudHlwZSA9PT0gNyAvKiBESVJFQ1RJVkUgKi8gJiYgaXNTcGVjaWFsVGVtcGxhdGVEaXJlY3RpdmUocC5uYW1lKSkpIHtcclxuICAgICAgICAgICAgICAgIHRhZ1R5cGUgPSAzIC8qIFRFTVBMQVRFICovO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGlzQ29tcG9uZW50KHRhZywgcHJvcHMsIGNvbnRleHQpKSB7XHJcbiAgICAgICAgICAgIHRhZ1R5cGUgPSAxIC8qIENPTVBPTkVOVCAqLztcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICAgIHR5cGU6IDEgLyogRUxFTUVOVCAqLyxcclxuICAgICAgICBucyxcclxuICAgICAgICB0YWcsXHJcbiAgICAgICAgdGFnVHlwZSxcclxuICAgICAgICBwcm9wcyxcclxuICAgICAgICBpc1NlbGZDbG9zaW5nLFxyXG4gICAgICAgIGNoaWxkcmVuOiBbXSxcclxuICAgICAgICBsb2M6IGdldFNlbGVjdGlvbihjb250ZXh0LCBzdGFydCksXHJcbiAgICAgICAgY29kZWdlbk5vZGU6IHVuZGVmaW5lZCAvLyB0byBiZSBjcmVhdGVkIGR1cmluZyB0cmFuc2Zvcm0gcGhhc2VcclxuICAgIH07XHJcbn1cclxuZnVuY3Rpb24gaXNDb21wb25lbnQodGFnLCBwcm9wcywgY29udGV4dCkge1xyXG4gICAgY29uc3Qgb3B0aW9ucyA9IGNvbnRleHQub3B0aW9ucztcclxuICAgIGlmIChvcHRpb25zLmlzQ3VzdG9tRWxlbWVudCh0YWcpKSB7XHJcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgfVxyXG4gICAgaWYgKHRhZyA9PT0gJ2NvbXBvbmVudCcgfHxcclxuICAgICAgICAvXltBLVpdLy50ZXN0KHRhZykgfHxcclxuICAgICAgICBpc0NvcmVDb21wb25lbnQodGFnKSB8fFxyXG4gICAgICAgIChvcHRpb25zLmlzQnVpbHRJbkNvbXBvbmVudCAmJiBvcHRpb25zLmlzQnVpbHRJbkNvbXBvbmVudCh0YWcpKSB8fFxyXG4gICAgICAgIChvcHRpb25zLmlzTmF0aXZlVGFnICYmICFvcHRpb25zLmlzTmF0aXZlVGFnKHRhZykpKSB7XHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICB9XHJcbiAgICAvLyBhdCB0aGlzIHBvaW50IHRoZSB0YWcgc2hvdWxkIGJlIGEgbmF0aXZlIHRhZywgYnV0IGNoZWNrIGZvciBwb3RlbnRpYWwgXCJpc1wiXHJcbiAgICAvLyBjYXN0aW5nXHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHByb3BzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgY29uc3QgcCA9IHByb3BzW2ldO1xyXG4gICAgICAgIGlmIChwLnR5cGUgPT09IDYgLyogQVRUUklCVVRFICovKSB7XHJcbiAgICAgICAgICAgIGlmIChwLm5hbWUgPT09ICdpcycgJiYgcC52YWx1ZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHAudmFsdWUuY29udGVudC5zdGFydHNXaXRoKCd2dWU6JykpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNoZWNrQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX0lTX09OX0VMRU1FTlRcIiAvKiBDT01QSUxFUl9JU19PTl9FTEVNRU5UICovLCBjb250ZXh0LCBwLmxvYykpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gZGlyZWN0aXZlXHJcbiAgICAgICAgICAgIC8vIHYtaXMgKFRPRE8gRGVwcmVjYXRlKVxyXG4gICAgICAgICAgICBpZiAocC5uYW1lID09PSAnaXMnKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChcclxuICAgICAgICAgICAgLy8gOmlzIG9uIHBsYWluIGVsZW1lbnQgLSBvbmx5IHRyZWF0IGFzIGNvbXBvbmVudCBpbiBjb21wYXQgbW9kZVxyXG4gICAgICAgICAgICBwLm5hbWUgPT09ICdiaW5kJyAmJlxyXG4gICAgICAgICAgICAgICAgaXNCaW5kS2V5KHAuYXJnLCAnaXMnKSAmJlxyXG4gICAgICAgICAgICAgICAgdHJ1ZSAmJlxyXG4gICAgICAgICAgICAgICAgY2hlY2tDb21wYXRFbmFibGVkKFwiQ09NUElMRVJfSVNfT05fRUxFTUVOVFwiIC8qIENPTVBJTEVSX0lTX09OX0VMRU1FTlQgKi8sIGNvbnRleHQsIHAubG9jKSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gcGFyc2VBdHRyaWJ1dGVzKGNvbnRleHQsIHR5cGUpIHtcclxuICAgIGNvbnN0IHByb3BzID0gW107XHJcbiAgICBjb25zdCBhdHRyaWJ1dGVOYW1lcyA9IG5ldyBTZXQoKTtcclxuICAgIHdoaWxlIChjb250ZXh0LnNvdXJjZS5sZW5ndGggPiAwICYmXHJcbiAgICAgICAgIXN0YXJ0c1dpdGgoY29udGV4dC5zb3VyY2UsICc+JykgJiZcclxuICAgICAgICAhc3RhcnRzV2l0aChjb250ZXh0LnNvdXJjZSwgJy8+JykpIHtcclxuICAgICAgICBpZiAoc3RhcnRzV2l0aChjb250ZXh0LnNvdXJjZSwgJy8nKSkge1xyXG4gICAgICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgMjIgLyogVU5FWFBFQ1RFRF9TT0xJRFVTX0lOX1RBRyAqLyk7XHJcbiAgICAgICAgICAgIGFkdmFuY2VCeShjb250ZXh0LCAxKTtcclxuICAgICAgICAgICAgYWR2YW5jZVNwYWNlcyhjb250ZXh0KTtcclxuICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh0eXBlID09PSAxIC8qIEVuZCAqLykge1xyXG4gICAgICA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EpO1xyXG4gICAgICAgIGFkdmFuY2VTcGFjZXMoY29udGV4dCk7XHJcbiAgICAgICAgdmFsdWUgPSBwYXJzZUF0dHJpYnV0ZVZhbHVlKGNvbnRleHQpO1xyXG4gICAgICAgIGlmICghdmFsdWUpIHtcclxuICAgICAgICAgICAgZW1pdEVycm9yKGNvbnRleHQsIDEzIC8qIE1JU1NJTkdfQVRUUklCVVRFX1ZBTFVFICovKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBjb25zdCBsb2MgPSBnZXRTZWxlY3Rpb24oY29udGV4dCwgc3RhcnQpO1xyXG4gICAgaWYgKCFjb250ZXh0LmluVlByZSAmJiAvXih2LVtBLVphLXowLTktXXw6fFxcLnxAfCMpLy50ZXN0KG5hbWUpKSB7XHJcbiAgICAgICAgY29uc3QgbWF0Y2ggPSAvKD86XnYtKFthLXowLTktXSspKT8oPzooPzo6fF5cXC58XkB8XiMpKFxcW1teXFxdXStcXF18W15cXC5dKykpPyguKyk/JC9pLmV4ZWMobmFtZSk7XHJcbiAgICAgICAgbGV0IGlzUHJvcFNob3J0aGFuZCA9IHN0YXJ0c1dpdGgobmFtZSwgJy4nKTtcclxuICAgICAgICBsZXQgZGlyTmFtZSA9IG1hdGNoWzFdIHx8XHJcbiAgICAgICAgICAgIChpc1Byb3BTaG9ydGhhbmQgfHwgc3RhcnRzV2l0aChuYW1lLCAnOicpXHJcbiAgICAgICAgICAgICAgICA/ICdiaW5kJ1xyXG4gICAgICAgICAgICAgICAgOiBzdGFydHNXaXRoKG5hbWUsICdAJylcclxuICAgICAgICAgICAgICAgICAgICA/ICdvbidcclxuICAgICAgICAgICAgICAgICAgICA6ICdzbG90Jyk7XHJcbiAgICAgICAgbGV0IGFyZztcclxuICAgICAgICBpZiAobWF0Y2hbMl0pIHtcclxuICAgICAgICAgICAgY29uc3QgaXNTbG90ID0gZGlyTmFtZSA9PT0gJ3Nsb3QnO1xyXG4gICAgICAgICAgICBjb25zdCBzdGFydE9mZnNldC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2ZWx5IG9uIHNsb3RcclxuICAgICAgICAgICAgICAgIC8vIG5hbWVzIGNvbnRhaW5pbmcgZG90cy4gdi1zbG90IGRvZXNuJ3QgaGF2ZSBhbnkgbW9kaWZpZXJzIGFuZCBWdWUgMi54XHJcbiAgICAgICAgICAgICAgICAvLyBzdXBwb3J0cyBzdWNoIHVzYWdlIHNvIHdlIGFyZSBrZWVwaW5nIGl0IGNvbnNpc3RlbnQgd2l0aCAyLnguXHJcbiAgICAgICAgICAgICAgICBjb250ZW50ICs9IG1hdGNoWzNdIHx8ICcnO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGFyZyA9IHtcclxuICAgICAgICAgICAgICAgIHR5cGU6IDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi8sXHJcbiAgICAgICAgICAgICAgICBjb250ZW50LFxyXG4gICAgICAgICAgICAgICAgaXNTdGF0aWMsXHJcbiAgICAgICAgICAgICAgICBjb25zdFR5cGU6IGlzU3RhdGljXHJcbiAgICAgICAgICAgICAgICAgICAgPyAzIC8qIENBTl9TVFJJTkdJRlkgKi9cclxuICAgICAgICAgICAgICAgICAgICA6IDAgLyogTk9UX0NPTlNUQU5UICovLFxyXG4gICAgICAgICAgICAgICAgbG9jXHJcbiAgICAgICAgICAgIH07XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICh2YWx1ZSAmJiB2YWx1ZS5pc1F1b3RlZCkge1xyXG4gICAgICAgICAgICBjb25zdCB2YWx1ZUxvYyA9IHZhbHVlLmxvYztcclxuICAgICAgICAgICAgdmFsdWVMb2Muc3RhcnQub2Zmc2V0Kys7XHJcbiAgICAgICAgICAgIHZhbHVlTG9jLnN0YXJ0LmNvbHVtbisrO1xyXG4gICAgICAgICAgICB2YWx1ZUxvYy5lbmQgPSBhZHZhbmNlUG9zaXRpb25XaXRoQ2xvbmUodmFsdWVMb2Muc3RhcnQsIHZhbHVlLmNvbnRlbnQpO1xyXG4gICAgICAgICAgICB2YWx1ZUxvYy5z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xuICAgICAgICAgICAgdHlwZTogNyAvKiBESVJFQ1RJVkUgKi8sXHJcbiAgICAgICAgICAgIG5hbWU6IGRpck5hbWUsXHJcbiAgICAgICAgICAgIGV4cDogdmFsdWUgJiYge1xyXG4gICAgICAgICAgICAgICAgdHlwZTogNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLyxcclxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHZhbHVlLmNvbnRlbnQsXHJcbiAgICAgICAgICAgICAgICBpc1N0YXRpYzogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICAvLyBUcmVhdCBhcyBub24tY29uc3RhbnQgYnkgZGVmYXVsdC4gVGhpcyBjYW4gYmUgcG90ZW50aWFsbHkgc2V0IHRvXHJcbiAgICAgICAgICAgICAgICAvLyBvdGhlciB2YWx1ZXMgYnkgYHRyYW5zZm9ybUV4cHJlc3Npb25gIHRvIG1ha2UgaXQgZWxpZ2libGUgZm9yIGhvaXN0aW5nLlxyXG4gICAgICAgICAgICAgICAgY29uc3RUeXBlOiAwIC8qIE5PVF9DT05TVEFOVCAqLyxcclxuICAgICAgICAgICAgICAgIGxvYzogdmFsdWUubG9jXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGFyZyxcclxuICAgICAgICAgICAgbW9kaWZpZXJzLFxyXG4gICAgICAgICAgICBsb2NcclxuICAgICAgICB9O1xyXG4gICAgfVxyXG4gICAgLy8gbWlzc2luZyBkaXJlY3RpdmUgbmFtZSBvciBpbGxlZ2FsIGRpcmVjdGl2ZSBuYW1lXHJcbiAgICBpZiAoIWNvbnRleHQuaW5WUHJlICYmIHN0YXJ0c1dpdGgobmFtZSwgJ3YtJykpIHtcclxuICAgICAgICBlbWl0RXJyb3IoY29udGV4dCwgMjYgLyogWF9NSVNTSU5HX0RJUkVDVElWRV9OQU1FICovKTtcclxuICAgIH1cclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgdHlwZTogNiAvKiBBVFRSSUJVVEUgKi8sXHJcbiAgICAgICAgbmFtZSxcclxuICAgICAgICB2YWx1ZTogdmFsdWUgJiYge1xyXG4gICAgICAgICAgICB0eXBlOiAyIC8qIFRFWFQgKi8sXHJcbiAgICAgICAgICAgIGNvbnRlbnQ6IHZhbHVlLmNvbnRlbnQsXHJcbiAgICAgICAgICAgIGxvYzogdmFsdWUubG9jXHJcbiAgICAgICAgfSxcclxuICAgICAgICBsb2NcclxuICAgIH07XHJcbn1cclxuZnVuY3Rpb24gcGFyc2VBdHRyaWJ1dGVWYWx1ZShjb250ZXh0KSB7XHJcbiAgICBjb25zdCBzdGFydCA9IGdldEN1cnNvcihjb250ZXh0KTtcclxuICAgIGxldCBjb250ZW50O1xyXG4gICAgY29uc3QgcXVvdGUgPSBjb250ZXh0LnNvdXJjZVswXTtcclxuICAgIGNvbnN0IGlzUXVvdGVkID0gcXVvdGUgPT09IGBcImAgfHwgcXVvdGUgPT09IGAnYDtcclxuICAgIGlmIChpc1F1b3RlZCkge1xyXG4gICAgICAgIC8vIFF1b3RlZCB2YWx1ZS5cclxuICAgICAgICBhZHZhbmNlQnkoY29udGV4dCwgMSk7XHJcbiAgICAgICAgY29uc3QgZW5kSW5kZXggPSBjb250ZXh0LnNvdXJjZS5pbmRleE9mKHF1b3RlKTtcclxuICAgICAgICBpZiAoZW5kSW5kZXggPT09IC0xKSB7XHJcbiAgICAgICAgICAgIGNvbnRlbnQgPSBwYXJzZVRleHREYXRhKGNvbnRleHQsIGNvbnRleHQuc291cmNlLmxlbmd0aCwgNCAvKiBBVFRSSUJVVEVfVkFMVUUgKi8pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgY29udGVudCA9IHBhcnNlVGV4dERhdGEoY29udGV4dCwgZW5kSW5kZXgsIDQgLyogQVRUUklCVVRFX1ZBTFVFICovKTtcclxuICAgICAgICAgICAgYWR2YW5jZUJ5KGNvbnRleHQsIDEpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGV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ICAgICAgY2FzZSAwIC8qIERBVEEgKi86XHJcbiAgICAgICAgICAgIGlmIChzdGFydHNXaXRoKHMsICc8LycpKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBwcm9iYWJseSBiYWQgcGVyZm9ybWFuY2VcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBhbmNlc3RvcnMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3RhcnRzV2l0aEVuZFRhZ09wZW4ocywgYW5jZXN0b3JzW2ldLnRhZykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMSAvKiBSQ0RBVEEgKi86XHJcbiAgICAgICAgY2FzZSAyIC8qIFJBV1RFWFQgKi86IHtcclxuICAgICAgICAgICAgY29uc3QgcGFyZW50ID0gbGFzdChhbmNlc3RvcnMpO1xyXG4gICAgICAgICAgICBpZiAocGFyZW50ICYmIHN0YXJ0c1dpdGhFbmRUYWdPcGVuKHMsIHBhcmVudC50YWcpKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgY2FzZSAzIC8qIENEQVRBICovOlxyXG4gICAgICAgICAgICBpZiAoc3RhcnRzV2l0aChzLCAnXV0+JykpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuICFzO1xyXG59XHJcbmZ1bmN0aW9uIHN0YXJ0c1dpdGhFbmRUYWdPcGVuKHNvdX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dGluZy5cclxuICAgICAgICBpZiAoY2hpbGQudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovICYmXHJcbiAgICAgICAgICAgIGNoaWxkLnRhZ1R5cGUgPT09IDAgLyogRUxFTUVOVCAqLykge1xyXG4gICAgICAgICAgICBjb25zdCBjb25zdGFudFR5cGUgPSBkb05vdEhvaXN0Tm9kZVxyXG4gICAgICAgICAgICAgICAgPyAwIC8qIE5PVF9DT05TVEFOVCAqL1xyXG4gICAgICAgICAgICAgICAgOiBnZXRDb25zdGFudFR5cGUoY2hpbGQsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBpZiAoY29uc3RhbnRUeXBlID4gMCAvKiBOT1RfQ09OU1RBTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgIGlmIChjb25zdGFudFR5cGUgPCAzIC8qIENBTl9TVFJJTkdJRlkgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBjYW5TdHJpbmdpZnkgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChjb25zdGFudFR5cGUgPj0gMiAvKiBDQU5fSE9JU1QgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBjaGlsZC5jb2RlZ2VuTm9kZS5wYXRjaEZsYWcgPVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAtMSAvKiBIT0lTVEVEICovICsgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSA/IGAgLyogSE9JU1RFRCAqL2AgOiBgYCk7XHJcbiAgICAgICAgICAgICAgICAgICAgY2hpbGQuY29kZWdlbk5vZGUgPSBjb250ZXh0LmhvaXN0KGNoaWxkLmNvZGVnZW5Ob2RlKTtcclxuICAgICAgICAgICAgICAgICAgICBob2lzdGVkQ291bnQrKztcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIG5vZGUgbWF5IGNvbnRhaW4gZHluYW1pYyBjaGlsZHJlbiwgYnV0IGl0cyBwcm9wcyBtYXkgYmUgZWxpZ2libGUgZm9yXHJcbiAgICAgICAgICAgICAgICAvLyBob2lzdGluZy5cclxuICAgICAgICAgICAgICAgIGNvbnN0IGNvZGVnZW5Ob2RlID0gY2hpbGQuY29kZWdlbk5vZGU7XHJcbiAgICAgICAgICAgICAgICBpZiAoY29kZWdlbk5vZGUudHlwZSA9PT0gMTMgLyogVk5PREVfQ0FMTCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZsYWcgPSBnZXRQYXRjaEZsYWcoY29kZWdlbk5vZGUpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICgoIWZsYWcgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9PT0gNTEyIC8qIE5FRURfUEFUQ0ggKi8gfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9PT0gMSAvKiBURVhUICovKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRHZW5lcmF0ZWRQcm9wc0NvbnN0YW50VHlwZShjaGlsZCwgY29udGV4dCkgPj1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgLyogQ0FOX0hPSVNUICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb3BzID0gZ2V0Tm9kZVByb3BzKGNoaWxkKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByb3BzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlZ2VuTm9kZS5wcm9wcyA9IGNvbnRleHQuaG9pc3QocHJvcHMpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlZ2VuTm9kZS5keW5hbWljUHJvcHMpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZWdlbk5vZGUuZHluYW1pY1Byb3BzID0gY29udGV4dC5ob2lzdChjb2RlZ2VuTm9kZS5keW5hbWljUHJvcHMpO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChjaGlsZC50eXBlID09PSAxMiAvKiBURVhUX0NBTEwgKi8pIHtcclxuICAgICAgICAgICAgY29uc3QgY29udGVudFR5cGUgPSBnZXRDb25zdGFudFR5cGUoY2hpbGQuY29udGVudCwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGlmIChjb250ZW50VHlwZSA+IDApIHtcclxuICAgICAgICAgICAgICAgIGlmIChjb250ZW50VHlwZSA8IDMgLyogQ0FOX1NUUklOR0lGWSAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNhblN0cmluZ2lmeSA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRlbnRUeXBlID49IDIgLyogQ0FOX0hPSVNUICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY2hpbGQuY29kZWdlbk5vZGUgPSBjb250ZXh0LmhvaXN0KGNoaWxkLmNvZGVnZW5Ob2RlKTtcclxuICAgICAgICAgICAgICAgICAgICBob2lzdGVkQ291bnQrKztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyB3YWxrIGZ1cnRoZXJcclxuICAgICAgICBpZiAoY2hpbGQudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IGlzQ29tcG9uZW50ID0gY2hpbGQudGFnVHlwZSA9PT0gMSAvKiBDT01QT05FTlQgKi87XHJcbiAgICAgICAgICAgIGlmIChpc0NvbXBvbmVudCkge1xyXG4gICAgICAgICAgICAgICAgY29udGV4dC5zY29wZXMudlNsb3QrKztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB3YWxrKGNoaWxkLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgaWYgKGlzQ29tcG9uZW50KSB7XHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LnNjb3Blcy52U2xvdC0tO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGNoaWxkLnR5cGUgPT09IDExIC8qIEZPUiAqLykge1xyXG4gICAgICAgICAgICAvLyBEbyBub3QgaG9pc3Qgdi1mb3Igc2luZ2xlIGNoaWxkIGJlY2F1c2UgaXQgaGFzIHRvIGJlIGEgYmxvY2tcclxuICAgICAgICAgICAgd2FsayhjaGlsZCwgY29udGV4dCwgY2hpbGQuY2hpbGRyZW4ubGVuZ3RoID09PSAxKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoY2hpbGQudHlwZSA9PT0gOSAvKiBJRiAqLykge1xyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNoaWxkLmJyYW5jaGVzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBEbyBub3QgaG9pc3Qgdi1pZiBzaW5nbGUgY2hpbGQgYmVjYXVzZSBpdCBoYXMgdG8gYmUgYSBibG9ja1xyXG4gICAgICAgICAgICAgICAgd2FsayhjaGlsZC5icmFuY2hlc1tpXSwgY29udGV4dCwgY2hpbGQuYnJhbmNoZXNbaV0uY2hpbGRyZW4ubGVuZ3RoID09PSAxKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGlmIChjYW5TdHJpbmdpZnkgJiYgaG9pc3RlZENvdW50ICYmIGNvbnRleHQudHJhbnNmb3JtSG9pc3QpIHtcclxuICAgICAgICBjb250ZXh0LnRyYW5zZm9ybUhvaXN0KGNoaWxkcmV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HRvIGJlIHN1cmUuXHJcbiAgICAgICAgICAgICAgICBjb25zdCBnZW5lcmF0ZWRQcm9wc1R5cGUgPSBnZXRHZW5lcmF0ZWRQcm9wc0NvbnN0YW50VHlwZShub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgIGlmIChnZW5lcmF0ZWRQcm9wc1R5cGUgPT09IDAgLyogTk9UX0NPTlNUQU5UICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3RhbnRDYWNoZS5zZXQobm9kZSwgMCAvKiBOT1RfQ09OU1RBTlQgKi8pO1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8qIE5PVF9DT05TVEFOVCAqLztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChnZW5lcmF0ZWRQcm9wc1R5cGUgPCByZXR1cm5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuVHlwZSA9IGdlbmVyYXRlZFByb3BzVHlwZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIC8vIDIuIGl0cyBjaGlsZHJlbi5cclxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbm9kZS5jaGlsZHJlbi5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoaWxkVHlwZSA9IGdldENvbnN0YW50VHlwZShub2RlLmNoaWxkcmVuW2ldLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoY2hpbGRUeXBlID09PSAwIC8qIE5PVF9DT05TVEFOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdGFudENhY2hlLnNldChub2RlLCAwIC8qIE5PVF9DT05TVEFOVCAqLyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwIC8qIE5PVF9DT05TVEFOVCAqLztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkVHlwZSA8IHJldHVyblR5cGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuVHlwZSA9IGNoaWxkVHlwZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyAzLiBpZiB0aGUgdHlwZSBpcyBub3QgYWxyZWFkeSBDQU5fU0tJUF9QQVRDSCB3aGljaCBpcyB0aGUgbG93ZXN0IG5vbi0wXHJcbiAgICAgICAgICAgICAgICAvLyB0eXBlLCBjaGVjayBpZiBhbnkgb2YgdGhlIHByb3BzIGNhbiBjYXVzZSB0aGUgdHlwZSB0byBiZSBsb3dlcmVkXHJcbiAgICAgICAgICAgICAgICAvLyB3ZSBjYW4gc2tpcCBjYW5fcGF0Y2ggYmVjYXVzZSBpdCdzIGd1YXJhbnRlZWQgYnkgdGhlIGFic2VuY2Ugb2YgYVxyXG4gICAgICAgICAgICAgICAgLy8gcGF0Y2hGbGFnLlxyXG4gICAgICAgICAgICAgICAgaWYgKHJldHVyblR5cGUgPiAxIC8qIENBTl9TS0lQX1BBVENIICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBub2RlLnByb3BzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHAgPSBub2RlLnByb3BzW2ldO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocC50eXBlID09PSA3IC8qIERJUkVDVElWRSAqLyAmJiBwLm5hbWUgPT09ICdiaW5kJyAmJiBwLmV4cCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhwVHlwZSA9IGdldENvbnN0YW50VHlwZShwLmV4cCwgY29udGV4dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXhwVHlwZSA9PT0gMCAvKiBOT1RfQ09OU1RBTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdGFudENhY2hlLnNldChub2RlLCAwIC8qIE5PVF9DT05TVEFOVCAqLyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogTk9UX0NPTlNUQU5UICovO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4cFR5cGUgPCByZXR1cm5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuVHlwZSA9IGV4cFR5cGU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBvbmx5IHN2Zy9mb3JlaWduT2JqZWN0IGNvdWxkIGJlIGJsb2NrIGhlcmUsIGhvd2V2ZXIgaWYgdGhleSBhcmVcclxuICAgICAgICAgICAgICAgIC8vIHN0YXRpYyB0aGVuIHRoZXkgZG9uJ3QgbmVlZCB0byBiZSBibG9ja3Mgc2luY2UgdGhlcmUgd2lsbCBiZSBub1xyXG4gICAgICAgICAgICAgICAgLy8gbmVzdGVkIHVwZGF0ZXMuXHJcbiAgICAgICAgICAgICAgICBpZiAoY29kZWdlbk5vZGUuaXNCbG9jaykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucmVtb3ZlSGVscGVyKE9QRU5fQkxPQ0spO1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQucmVtb3ZlSGVscGVyKGdldFZOb2RlQmxvY2tIZWxwZXIoY29udGV4dC5pblNTUiwgY29kZWdlbk5vZGUuaXNDb21wb25lbnQpKTtcclxuICAgICAgICAgICAgICAgICAgICBjb2RlZ2VuTm9kZS5pc0Jsb2NrID0gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5oZWxwZXIoZ2V0Vk5vZGVIZWxwZXIoY29udGV4dC5pblNTUiwgY29kZWdlbk5vZGUuaXNDb21wb25lbnQpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnN0YW50Q2FjaGUuc2V0KG5vZGUsIHJldHVyblR5cGUpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJldHVyblR5cGU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdGFudENhY2hlLnNldChub2RlLCAwIC8qIE5PVF9DT05TVEFOVCAqLyk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gMCAvKiBOT1RfQ09OU1RBTlQgKi87XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICBjYXNlIDIgLyogVEVYVCAqLzpcclxuICAgICAgICBjYXNlIDMgLyogQ09NTUVOVCAqLzpcclxuICAgICAgICAgICAgcmV0dXJuIDMgLyogQ0FOX1NUUklOR0lGWSAqLztcclxuICAgICAgICBjYXNlIDkgLyogSUYgKi86XHJcbiAgICAgICAgY2FzZSAxMSAvKiBGT1IgKi86XHJcbiAgICAgICAgY2FzZSAxMCAvKiBJRl9CUkFOQ0ggKi86XHJcbiAgICAgICAgICAgIHJldHVybiAwIC8qIE5PVF9DT05TVEFOVCAqLztcclxuICAgICAgICBjYXNlIDUgLyogSU5URVJQT0xBVElPTiAqLzpcclxuICAgICAgICBjYXNlIDEyIC8qIFRFWFRfQ0FMTCAqLzpcclxuICAgICAgICAgICAgcmV0dXJuIGdldENvbnN0YW50VHlwZShub2RlLmNvbnRlbnQsIGNvbnRleHQpO1xyXG4gICAgICAgIGNhc2UgNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgcmV0dXJuIG5vZGUuY29uc3RUeXBlO1xyXG4gICAgICAgIGNhc2UgOCAvKiBDT01QT1VORF9FWFBSRVNTSU9OICovOlxyXG4gICAgICAgICAgICBsZXQgcmV0dXJuVHlwZSA9IDMgLyogQ0FOX1NUUklOR0lGWSAqLztcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBub2RlLmNoaWxkcmVuLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjaGlsZCA9IG5vZGUuY2hpbGRyZW5baV07XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNTdHJpbmcoY2hpbGQpIHx8IGlzU3ltYm9sKGNoaWxkKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29uc3QgY2hpbGRUeXBlID0gZ2V0Q29uc3RhbnRUeXBlKGNoaWxkLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgIGlmIChjaGlsZFR5cGUgPT09IDAgLyogTk9UX0NPTlNUQU5UICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDAgLyogTk9UX0NPTlNUQU5UICovO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoY2hpbGRUeXBlIDwgcmV0dXJuVHlwZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblR5cGUgPSBjaGlsZFR5cGU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIHJldHVyblR5cGU7XHJcbiAgICAgICAgZGVmYXVsdDpcclxuICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkgO1xyXG4gICAgICAgICAgICByZXR1cm4gMCAvKiBOT1RfQ09OU1RBTlQgKi87XHJcbiAgICB9XHJcbn1cclxuY29uc3QgYWxsb3dIb2lzdGVkSG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N0YW50VHlwZShub2RlLCBjb250ZXh0KSB7XHJcbiAgICBsZXQgcmV0dXJuVHlwZSA9IDMgLyogQ0FOX1NUUklOR0lGWSAqLztcclxuICAgIGNvbnN0IHByb3BzID0gZ2V0Tm9kZVByb3BzKG5vZGUpO1xyXG4gICAgaWYgKHByb3BzICYmIHByb3BzLnR5cGUgPT09IDE1IC8qIEpTX09CSkVDVF9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgY29uc3QgeyBwcm9wZXJ0aWVzIH0gPSBwcm9wcztcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHByb3BlcnRpZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgY29uc3QgeyBrZXksIHZhbHVlIH0gPSBwcm9wZXJ0aWVzW2ldO1xyXG4gICAgICAgICAgICBjb25zdCBrZXlUeXBlID0gZ2V0Q29uc3RhbnRUeXBlKGtleSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGlmIChrZXlUeXBlID09PSAwIC8qIE5PVF9DT05TVEFOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGtleVR5cGU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGtleVR5cGUgPCByZXR1cm5UeXBlKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm5UeXBlID0ga2V5VHlwZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBsZXQgdmFsdWVUeXBlO1xyXG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLykge1xyXG4gICAgICAgICAgICAgICAgdmFsdWVUeXBlID0gZ2V0Q29uc3RhbnRUeXBlKHZhbHVlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmICh2YWx1ZS50eXBlID09PSAxNCAvKiBKU19DQUxMX0VYUFJFU1NJT04gKi8pIHtcclxuICAg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U6IG5hbWVNYXRjaCAmJiBjYXBpdGFsaXplKGNhbWVsaXplJDEobmFtZU1hdGNoWzFdKSksXHJcbiAgICAgICAgcHJlZml4SWRlbnRpZmllcnMsXHJcbiAgICAgICAgaG9pc3RTdGF0aWMsXHJcbiAgICAgICAgY2FjaGVIYW5kbGVycyxcclxuICAgICAgICBub2RlVHJhbnNmb3JtcyxcclxuICAgICAgICBkaXJlY3RpdmVUcmFuc2Zvcm1zLFxyXG4gICAgICAgIHRyYW5zZm9ybUhvaXN0LFxyXG4gICAgICAgIGlzQnVpbHRJbkNvbXBvbmVudCxcclxuICAgICAgICBpc0N1c3RvbUVsZW1lbnQsXHJcbiAgICAgICAgZXhwcmVzc2lvblBsdWdpbnMsXHJcbiAgICAgICAgc2NvcGVJZCxcclxuICAgICAgICBzbG90dGVkLFxyXG4gICAgICAgIHNzcixcclxuICAgICAgICBpblNTUixcclxuICAgICAgICBzc3JDc3NWYXJzLFxyXG4gICAgICAgIGJpbmRpbmdNZXRhZGF0YSxcclxuICAgICAgICBpbmxpbmUsXHJcbiAgICAgICAgaXNUUyxcclxuICAgICAgICBvbkVycm9yLFxyXG4gICAgICAgIG9uV2FybixcclxuICAgICAgICBjb21wYXRDb25maWcsXHJcbiAgICAgICAgLy8gc3RhdGVcclxuICAgICAgICByb290LFxyXG4gICAgICAgIGhlbHBlcnM6IG5ldyBNYXAoKSxcclxuICAgICAgICBjb21wb25lbnRzOiBuZXcgU2V0KCksXHJcbiAgICAgICAgZGlyZWN0aXZlczogbmV3IFNldCgpLFxyXG4gICAgICAgIGhvaXN0czogW10sXHJcbiAgICAgICAgaW1wb3J0czogW10sXHJcbiAgICAgICAgY29uc3RhbnRDYWNoZTogbmV3IE1hcCgpLFxyXG4gICAgICAgIHRlbXBzOiAwLFxyXG4gICAgICAgIGNhY2hlZDogMCxcclxuICAgICAgICBpZGVudGlmaWVyczogT2JqZWN0LmNyZWF0ZShudWxsKSxcclxuICAgICAgICBzY29wZXM6IHtcclxuICAgICAgICAgICAgdkZvcjogMCxcclxuICAgICAgICAgICAgdlNsb3Q6IDAsXHJcbiAgICAgICAgICAgIHZQcmU6IDAsXHJcbiAgICAgICAgICAgIHZPbmNlOiAwXHJcbiAgICAgICAgfSxcclxuICAgICAgICBwYXJlbnQ6IG51bGwsXHJcbiAgICAgICAgY3VycmVudE5vZGU6IHJvb3QsXHJcbiAgICAgICAgY2hpbGRJbmRleDogMCxcclxuICAgICAgICBpblZPbmNlOiBmYWxzZSxcclxuICAgICAgICAvLyBtZXRob2RzXHJcbiAgICAgICAgaGVscGVyKG5hbWUpIHtcclxuICAgICAgICAgICAgY29uc3QgY291bnQgPSBjb250ZXh0LmhlbHBlcnMuZ2V0KG5hbWUpIHx8IDA7XHJcbiAgICAgICAgICAgIGNvbnRleHQuaGVscGVycy5zZXQobmFtZSwgY291bnQgKyAxKTtcclxuICAgICAgICAgICAgcmV0dXJuIG5hbWU7XHJcbiAgICAgICAgfSxcclxuICAgICAgICByZW1vdmVIZWxwZXIobmFtZSkge1xyXG4gICAgICAgICAgICBjb25zdCBjb3VudCA9IGNvbnRleHQuaGVscGVycy5nZXQobmFtZSk7XHJcbiAgICAgICAgICAgIGlmIChjb3VudCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY3VycmVudENvdW50ID0gY291bnQgLSAxO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFjdXJyZW50Q291bnQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmhlbHBlcnMuZGVsZXRlKG5hbWUpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5oZWxwZXJzLnNldChuYW1lLCBjdXJyZW50Q291bnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBoZWxwZXJTdHJpbmcobmFtZSkge1xyXG4gICAgICAgICAgICByZXR1cm4gYF8ke2hlbHBlck5hbWVNYXBbY29udGV4dC5oZWxwZXIobmFtZSldfWA7XHJcbiAgICAgICAgfSxcclxuICAgICAgICByZXBsYWNlTm9kZShub2RlKSB7XHJcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoIWNvbnRleHQuY3VycmVudE5vZGUpIHtcclxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYE5vZGUgYmVpbmcgcmVwbGFjZWQgaXMgYWxyZWFkeSByZW1vdmVkLmApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCFjb250ZXh0LnBhcmVudCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQ2Fubm90IHJlcGxhY2Ugcm9vdCBub2RlLmApO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnRleHQucGFyZW50LmNoaWxkcmVuW2NvbnRleHQuY2hpbGRJbmRleF0gPSBjb250ZXh0LmN1cnJlbnROb2RlID0gbm9kZTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHJlbW92ZU5vZGUobm9kZSkge1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmICFjb250ZXh0LnBhcmVudCkge1xyXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBDYW5ub3QgcmVtb3ZlIHJvb3Qgbm9kZS5gKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBjb25zdCBsaXN0ID0gY29udGV4dC5wYXJlbnQuY2hpbGRyZW47XHJcbiAgICAgICAgICAgIGNvbnN0IHJlbW92YWxJbmRleCA9IG5vZGVcclxuICAgICAgICAgICAgICAgID8gbGlzdC5pbmRleE9mKG5vZGUpXHJcbiAgICAgICAgICAgICAgICA6IGNvbnRleHQuY3VycmVudE5vZGVcclxuICAgICAgICAgICAgICAgICAgICA/IGNvbnRleHQuY2hpbGRJbmRleFxyXG4gICAgICAgICAgICAgICAgICAgIDogLTE7XHJcbiAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBpZiAqL1xyXG4gICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmIHJlbW92YWxJbmRleCA8IDApIHtcclxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgbm9kZSBiZWluZyByZW1vdmVkIGlzIG5vdCBhIGNoaWxkIG9mIGN1cnJlbnQgcGFyZW50YCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCFub2RlIHx8IG5vZGUgPT09IGNvbnRleHQuY3VycmVudE5vZGUpIHtcclxuICAgICAgICAgICAgICAgIC8vIGN1cnJlbnQgbm9kZSByZW1vdmVkXHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnROb2RlID0gbnVsbDtcclxuICAgICAgICAgICAgICAgIGNvbnRleHQub25Ob2RlUmVtb3ZlZCgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gc2libGluZyBub2RlIHJlbW92ZWRcclxuICAgICAgICAgICAgICAgIGlmIChjb250ZXh0LmNoaWxkSW5kZXggPiByZW1vdmFsSW5kZXgpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmNoaWxkSW5kZXgtLTtcclxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm9uTm9kZVJlbW92ZWQoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAg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XhpdCkge1xyXG4gICAgICAgICAgICBpZiAoaXNBcnJheShvbkV4aXQpKSB7XHJcbiAgICAgICAgICAgICAgICBleGl0Rm5zLnB1c2goLi4ub25FeGl0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIGV4aXRGbnMucHVzaChvbkV4aXQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmICghY29udGV4dC5jdXJyZW50Tm9kZSkge1xyXG4gICAgICAgICAgICAvLyBub2RlIHdhcyByZW1vdmVkXHJcbiAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIC8vIG5vZGUgbWF5IGhhdmUgYmVlbiByZXBsYWNlZFxyXG4gICAgICAgICAgICBub2RlID0gY29udGV4dC5jdXJyZW50Tm9kZTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBzd2l0Y2ggKG5vZGUudHlwZSkge1xyXG4gICAgICAgIGNhc2UgMyAvKiBDT01NRU5UICovOlxyXG4gICAgICAgICAgICBpZiAoIWNvbnRleHQuc3NyKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBpbmplY3QgaW1wb3J0IGZvciB0aGUgQ29tbWVudCBzeW1ib2wsIHdoaWNoIGlzIG5lZWRlZCBmb3IgY3JlYXRpbmdcclxuICAgICAgICAgICAgICAgIC8vIGNvbW1lbnQgbm9kZXMgd2l0aCBgY3JlYXRlVk5vZGVgXHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LmhlbHBlcihDUkVBVEVfQ09NTUVOVCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSA1IC8qIElOVEVSUE9MQVRJT04gKi86XHJcbiAgICAgICAgICAgIC8vIG5vIG5lZWQgdG8gdHJhdmVyc2UsIGJ1dCB3ZSBuZWVkIHRvIGluamVjdCB0b1N0cmluZyBoZWxwZXJcclxuICAgICAgICAgICAgaWYgKCFjb250ZXh0LnNzcikge1xyXG4gICAgICAgICAgICAgICAgY29udGV4dC5oZWxwZXIoVE9fRElTUExBWV9TVFJJTkcpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIC8vIGZvciBjb250YWluZXIgdHlwZXMsIGZ1cnRoZXIgdHJhdmVyc2UgZG93bndhcmRzXHJcbiAgICAgICAgY2FzZSA5IC8qIElGICovOlxyXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUuYnJhbmNoZXMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIHRyYXZlcnNlTm9kZShub2RlLmJyYW5jaGVzW2ldLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDEwIC8qIElGX0JSQU5DSCAqLzpcclxuICAgICAgICBjYXNlIDExIC8qIEZPUiAqLzpcclxuICAgICAgICBjYXNlIDEgLyogRUxFTUVOVCAqLzpcclxuICAgICAgICBjYXNlIDAgLyogUk9PVCAqLzpcclxuICAgICAgICAgICAgdHJhdmVyc2VDaGlsZHJlbihub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICB9XHJcbiAgICAvLyBleGl0IHRyYW5zZm9ybXNcclxuICAgIGNvbnRleHQuY3VycmVudE5vZGUgPSBub2RlO1xyXG4gICAgbGV0IGkgPSBleGl0Rm5zLmxlbmd0aDtcclxuICAgIHdoaWxlIChpLS0pIHtcclxuICAgICAgICBleGl0Rm5zW2ldKCk7XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gY3JlYXRlU3RydWN0dXJhbERpcmVjdGl2ZVRyYW5zZm9ybShuYW1lLCBmbikge1xyXG4gICAgY29uc3QgbWF0Y2hlcyA9IGlzU3RyaW5nKG5hbWUpXHJcbiAgICAgICAgPyAobikgPT4gbiA9PT0gbmFtZVxyXG4gICAgICAgIDogKG4pID0+IG5hbWUudGVzdChuKTtcclxuICAgIHJldHVybiAobm9kZSwgY29udGV4dCkgPT4ge1xyXG4gICAgICAgIGlmIChub2RlLnR5cGUgPT09IDEgLyogRUxFTUVOVCAqLykge1xyXG4gICAgICAgICAgICBjb25zdCB7IHByb3BzIH0gPSBub2RlO1xyXG4gICAgICAgICAgICAvLyBzdHJ1Y3R1cmFsIGRpcmVjdGl2ZSB0cmFuc2Zvcm1zIGFyZSBub3QgY29uY2VybmVkIHdpdGggc2xvdHNcclxuICAgICAgICAgICAgLy8gYXMgdGhleSBhcmUgaGFuZGxlZCBzZXBhcmF0ZWx5IGluIHZTbG90LnRzXHJcbiAgICAgICAgICAgIGlmIChub2RlLnRhZ1R5cGUgPT09IDMgLyogVEVNUExBVEUgKi8gJiYgcHJvcHMuc29tZShpc1ZTbG90KSkge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IGV4aXRGbnMgPSBbXTtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcm9wcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgcHJvcCA9IHByb3BzW2ldO1xyXG4gICAgICAgICAgICAgICAgaWYgKHByb3AudHlwZSA9PT0gNyAvKiBESVJFQ1RJVkUgKi8gJiYgbWF0Y2hlcyhwcm9wLm5hbWUpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc3RydWN0dXJhbCBkaXJlY3RpdmVzIGFyZSByZW1vdmVkIHRvIGF2b2lkIGluZmluaXRlIHJlY3Vyc2lvblxyXG4gICAgICAgICAgICAgICAgICAgIC8vIGFsc28gd2UgcmVtb3ZlIHRoZW0gKmJlZm9yZSogYXBwbHlpbmcgc28gdGhhdCBpdCBjYW4gZnVydGhlclxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHRyYXZlcnNlIGl0c2VsZiBpbiBjYXNlIGl0IG1vdmVzIHRoZSBub2RlIGFyb3VuZFxyXG4gICAgICAgICAgICAgICAgICAgIHByb3BzLnNwbGljZShpLCAxKTtcclxuICAgICAgICAgICAgICAgICAgICBpLS07XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgb25FeGl0ID0gZm4obm9kZSwgcHJvcCwgY29udGV4dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9uRXhpdClcclxuICAgICAgICAgICAgICAgICAgICAgICAgZXhpdEZucy5wdXNoKG9uRXhpdCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGV4aXRGbnM7XHJcbiAgICAgICAgfVxyXG4gICAgfTtcclxufVxuXG5jb25zdCBQVVJFX0FOTk9UQVRJT04gPSBgLyojX19QVVJFX18qL2A7XHJcbmZ1bmN0aW9uIGNyZWF0ZUNvZGVnZW5Db250ZXh0KGFzdCwgeyBtb2RlID0gJ2Z1bmN0aW9uJywgcHJlZml4SWRlbnRpZmllcnMgPSBtb2RlID09PSAnbW9kdWxlJywgc291cmNlTWFwID0gZmFsc2UsIGZpbGVuYW1lID0gYHRlbXBsYXRlLnZ1ZS5odG1sYCwgc2NvcGVJZCA9IG51bGwsIG9wdGltaXplSW1wb3J0cyA9IGZhbHNlLCBydW50aW1lR2xvYmFsTmFtZSA9IGBWdWVgLCBydW50aW1lTW9kdWxlTmFtZSA9IGB2dWVgLCBzc3JSdW50aW1lTW9kdWxlTmFtZSA9ICd2dWUvc2VydmVyLXJlbmRlcmVyJywgc3NyID0gZmFsc2UsIGlzVFMgPSBmYWxzZSwgaW5TU1IgPSBmYWxzZSB9KSB7XHJcbiAgICBjb25zdCBjb250ZXh0ID0ge1xyXG4gICAgICAgIG1vZGUsXHJcbiAgICAgICAgcHJlZml4SWRlbnRpZmllcnMsXHJcbiAgICAgICAgc291cmNlTWFwLFxyXG4gICAgICAgIGZpbGVuYW1lLFxyXG4gICAgICAgIHNjb3BlSWQsXHJcbiAgICAgICAgb3B0aW1pemVJbXBvcnRzLFxyXG4gICAgICAgIHJ1bnRpbWVHbG9iYWxOYW1lLFxyXG4gICAgICAgIHJ1bnRpbWVNb2R1bGVOYW1lLFxyXG4gICAgICAgIHNzclJ1bnRpbWVNb2R1bGVOYW1lLFxyXG4gICAgICAgIHNzcixcclxuICAgICAgICBpc1RTLFxyXG4gICAgICAgIGluU1NSLFxyXG4gICAgICAgIHNvdXJjZTogYXN0LmxvYy5zb3VyY2UsXHJcbiAgICAgICAgY29kZTogYGAsXHJcbiAgICAgICAgY29sdW1uOiAxLFxyXG4gICAgICAgIGxpbmU6IDEsXHJcbiAgICAgICAgb2Zmc2V0OiAwLFxyXG4gICAgICAgIGluZGVudExldmVsOiAwLFxyXG4gICAgICAgIHB1cmU6IGZhbHNlLFxyXG4gICAgICAgIG1hcDogdW5kZWZpbmVkLFxyXG4gICAgICAgIGhlbHBlcihrZXkpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGBfJHtoZWxwZXJOYW1lTWFwW2tleV19YDtcclxuICAgICAgICB9LFxyXG4gICAgICAgIHB1c2goY29kZSwgbm9kZSkge1xyXG4gICAgICAgICAgICBjb250ZXh0LmNvZGUgKz0gY29kZTtcclxuICAgICAgICB9LFxyXG4gICAgICAgIGluZGVudCgpIHtcclxuICAgICAgICAgICAgbmV3bGluZSgrK2NvbnRleHQuaW5kZW50TGV2ZWwpO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgZGVpbmRlbnQod2l0aG91dE5ld0xpbmUgPSBmYWxzZSkge1xyXG4gICAgICAgICAgICBpZiAod2l0aG91dE5ld0xpbmUpIHtcclxuICAgICAgICAgICAgICAgIC0tY29udGV4dC5pbmRlbnRMZXZlbDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIG5ld2xpbm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WZ0ZWQgb3V0IG9mIHRoZSBmdW5jdGlvbiAtIHdlIG5lZWRcclxuICAgICAgICAgICAgLy8gdG8gcHJvdmlkZSB0aGUgaGVscGVyIGhlcmUuXHJcbiAgICAgICAgICAgIGlmIChhc3QuaG9pc3RzLmxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgY29uc3Qgc3RhdGljSGVscGVycyA9IFtcclxuICAgICAgICAgICAgICAgICAgICBDUkVBVEVfVk5PREUsXHJcbiAgICAgICAgICAgICAgICAgICAgQ1JFQVRFX0VMRU1FTlRfVk5PREUsXHJcbiAgICAgICAgICAgICAgICAgICAgQ1JFQVRFX0NPTU1FTlQsXHJcbiAgICAgICAgICAgICAgICAgICAgQ1JFQVRFX1RFWFQsXHJcbiAgICAgICAgICAgICAgICAgICAgQ1JFQVRFX1NUQVRJQ1xyXG4gICAgICAgICAgICAgICAgXVxyXG4gICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoaGVscGVyID0+IGFzdC5oZWxwZXJzLmluY2x1ZGVzKGhlbHBlcikpXHJcbiAgICAgICAgICAgICAgICAgICAgLm1hcChhbGlhc0hlbHBlcilcclxuICAgICAgICAgICAgICAgICAgICAuam9pbignLCAnKTtcclxuICAgICAgICAgICAgICAgIHB1c2goYGNvbnN0IHsgJHtzdGF0aWNIZWxwZXJzfSB9ID0gX1Z1ZVxcbmApO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZ2VuSG9pc3RzKGFzdC5ob2lzdHMsIGNvbnRleHQpO1xyXG4gICAgbmV3bGluZSgpO1xyXG4gICAgcHVzaChgcmV0dXJuIGApO1xyXG59XHJcbmZ1bmN0aW9uIGdlbkFzc2V0cyhhc3NldHMsIHR5cGUsIHsgaGVscGVyLCBwdXNoLCBuZXdsaW5lLCBpc1RTIH0pIHtcclxuICAgIGNvbnN0IHJlc29sdmVyID0gaGVscGVyKHR5cGUgPT09ICdmaWx0ZXInXHJcbiAgICAgICAgP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gaGVscGVyLCBzY29wZUlkLCBtb2RlIH0gPSBjb250ZXh0O1xyXG4gICAgbmV3bGluZSgpO1xyXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBob2lzdHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBleHAgPSBob2lzdHNbaV07XHJcbiAgICAgICAgaWYgKGV4cCkge1xyXG4gICAgICAgICAgICBwdXNoKGBjb25zdCBfaG9pc3RlZF8ke2kgKyAxfSA9ICR7YGB9YCk7XHJcbiAgICAgICAgICAgIGdlbk5vZGUoZXhwLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgbmV3bGluZSgpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGNvbnRleHQucHVyZSA9IGZhbHNlO1xyXG59XHJcbmZ1bmN0aW9uIGlzVGV4dCQxKG4pIHtcclxuICAgIHJldHVybiAoaXNTdHJpbmcobikgfHxcclxuICAgICAgICBuLnR5cGUgPT09IDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi8gfHxcclxuICAgICAgICBuLnR5cGUgPT09IDIgLyogVEVYVCAqLyB8fFxyXG4gICAgICAgIG4udHlwZSA9PT0gNSAvKiBJTlRFUlBPTEFUSU9OICovIHx8XHJcbiAgICAgICAgbi50eXBlID09PSA4IC8qIENPTVBPVU5EX0VYUFJFU1NJT04gKi8pO1xyXG59XHJcbmZ1bmN0aW9uIGdlbk5vZGVMaXN0QXNBcnJheShub2RlcywgY29udGV4dCkge1xyXG4gICAgY29uc3QgbXVsdGlsaW5lcyA9IG5vZGVzLmxlbmd0aCA+IDMgfHxcclxuICAgICAgICAoKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkgJiYgbm9kZXMuc29tZShuID0+IGlzQXJyYXkobikgfHwgIWlzVGV4dCQxKG4pKSk7XHJcbiAgICBjb250ZXh0LnB1c2goYFtgKTtcclxuICAgIG11bHRpbGluZXMgJiYgY29udGV4dC5pbmRlbnQoKTtcclxuICAgIGdlbk5vZGVMaXN0KG5vZGVzLCBjb250ZXh0LCBtdWx0aWxpbmVzKTtcclxuICAgIG11bHRpbGluZXMgJiYgY29udGV4dC5kZWluZGVudCgpO1xyXG4gICAgY29udGV4dC5wdXNoKGBdYCk7XHJcbn1cclxuZnVuY3Rpb24gZ2VuTm9kZUxpc3Qobm9kZXMsIGNvbnRleHQsIG11bHRpbGluZXMgPSBmYWxzZSwgY29tbWEgPSB0cnVlKSB7XHJcbiAgICBjb25zdCB7IHB1c2gsIG5ld2xpbmUgfSA9IGNvbnRleHQ7XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGVzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgY29uc3Qgbm9kZSA9IG5vZGVzW2ldO1xyXG4gICAgICAgIGlmIChpc1N0cmluZyhub2RlKSkge1xyXG4gICAgICAgICAgICBwdXNoKG5vZGUpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpc0FycmF5KG5vZGUpKSB7XHJcbiAgICAgICAgICAgIGdlbk5vZGVMaXN0QXNBcnJheShub2RlLCBjb250ZXh0KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGdlbk5vZGUobm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChpIDwgbm9kZXMubGVuZ3RoIC0gMSkge1xyXG4gICAgICAgICAgICBpZiAobXVsdGlsaW5lcykge1xyXG4gICAgICAgICAgICAgICAgY29tbWEgJiYgcHVzaCgnLCcpO1xyXG4gICAgICAgICAgICAgICAgbmV3bGluZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgY29tbWEgJiYgcHVzaCgnLCAnKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgIH1cclxufVxyXG5mdW5jdGlvbiBnZW5Ob2RlKG5vZGUsIGNvbnRleHQpIHtcclxuICAgIGlmIChpc1N0cmluZyhub2RlKSkge1xyXG4gICAgICAgIGNvbnRleHQucHVzaChub2RlKTtcclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICBpZiAoaXNTeW1ib2wobm9kZSkpIHtcclxuICAgICAgICBjb250ZXh0LnB1c2goY29udGV4dC5oZWxwZXIobm9kZSkpO1xyXG4gICAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIHN3aXRjaCAobm9kZS50eXBlKSB7XHJcbiAgICAgICAgY2FzZSAxIC8qIEVMRU1FTlQgKi86XHJcbiAgICAgICAgY2FzZSA5IC8qIElGICovOlxyXG4gICAgICAgIGNhc2UgMTEgLyogRk9SICovOlxyXG4gICAgICAgICAgICAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiZcclxuICAgICAgICAgICAgICAgIGFzc2VydChub2RlLmNvZGVnZW5Ob2RlICE9IG51bGwsIGBDb2RlZ2VuIG5vZGUgaXMgbWlzc2luZyBmb3IgZWxlbWVudC9pZi9mb3Igbm9kZS4gYCArXHJcbiAgICAgICAgICAgICAgICAgICAgYEFwcGx5IGFwcHJvcHJpYXRlIHRyYW5zZm9ybXMgZmlyc3QuYCk7XHJcbiAgICAgICAgICAgIGdlbk5vZGUobm9kZS5jb2RlZ2VuTm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMiAvKiBURVhUICovOlxyXG4gICAgICAgICAgICBnZW5UZXh0KG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIGdlbkV4cHJlc3Npb24obm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgNSAvKiBJTlRFUlBPTEFUSU9OICovOlxyXG4gICAgICAgICAgICBnZW5JbnRlcnBvbGF0aW9uKG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDEyIC8qIFRFWFRfQ0FMTCAqLzpcclxuICAgICAgICAgICAgZ2VuTm9kZShub2RlLmNvZGVnZW5Ob2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSA4IC8qIENPTVBPVU5EX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIGdlbkNvbXBvdW5kRXhwcmVzc2lvbihub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAzIC8qIENPTU1FTlQgKi86XHJcbiAgICAgICAgICAgIGdlbkNvbW1lbnQobm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMTMgLyogVk5PREVfQ0FMTCAqLzpcclxuICAgICAgICAgICAgZ2VuVk5vZGVDYWxsKG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDE0IC8qIEpTX0NBTExfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgZ2VuQ2FsbEV4cHJlc3Npb24obm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMTUgLyogSlNfT0JKRUNUX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIGdlbk9iamVjdEV4cHJlc3Npb24obm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMTcgLyogSlNfQVJSQVlfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgZ2VuQXJyYXlFeHByZXNzaW9uKG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDE4IC8qIEpTX0ZVTkNUSU9OX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIGdlbkZ1bmN0aW9uRXhwcmVzc2lvbihub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAxOSAvKiBKU19DT05ESVRJT05BTF9FWFBSRVNTSU9OICovOlxyXG4gICAgICAgICAgICBnZW5Db25kaXRpb25hbEV4cHJlc3Npb24obm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMjAgLyogSlNfQ0FDSEVfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgZ2VuQ2FjaGVFeHByZXNzaW9uKG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDIxIC8qIEpTX0JMT0NLX1NUQVRFTUVOVCAqLzpcclxuICAgICAgICAgICAgZ2VuTm9kZUxpc3Qobm9kZS5ib2R5LCBjb250ZXh0LCB0cnVlLCBmYWxzZSk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIC8vIFNTUiBvbmx5IHR5cGVzXHJcbiAgICAgICAgY2FzZSAyMiAvKiBKU19URU1QTEFURV9MSVRFUkFMICovOlxyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIDIzIC8qIEpTX0lGX1NUQVRFTUVOVCAqLzpcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAyNCAvKiBKU19BU1NJR05NRU5UX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgMjUgLyogSlNfU0VRVUVOQ0VfRVhQUkVTU0lPTiAqLzpcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAyNiAvKiBKU19SRVRVUk5fU1RBV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24obm9kZSwgY29udGV4dCkge1xyXG4gICAgY29uc3QgeyBwdXNoLCBoZWxwZXIsIHB1cmUgfSA9IGNvbnRleHQ7XHJcbiAgICBjb25zdCBjYWxsZWUgPSBpc1N0cmluZyhub2RlLmNhbGxlZSkgPyBub2RlLmNhbGxlZSA6IGhlbHBlcihub2RlLmNhbGxlZSk7XHJcbiAgICBpZiAocHVyZSkge1xyXG4gICAgICAgIHB1c2goUFVSRV9BTk5PVEFUSU9OKTtcclxuICAgIH1cclxuICAgIHB1c2goY2FsbGVlICsgYChgLCBub2RlKTtcclxuICAgIGdlbk5vZGVMaXN0KG5vZGUuYXJndW1lbnRzLCBjb250ZXh0KTtcclxuICAgIHB1c2goYClgKTtcclxufVxyXG5mdW5jdGlvbiBnZW5PYmplY3RFeHByZXNzaW9uKG5vZGUsIGNvbnRleHQpIHtcclxuICAgIGNvbnN0IHsgcHVzaCwgaW5kZW50LCBkZWluZGVudCwgbmV3bGluZSB9ID0gY29udGV4dDtcclxuICAgIGNvbnN0IHsgcHJvcGVydGllcyB9ID0gbm9kZTtcclxuICAgIGlmICghcHJvcGVydGllcy5sZW5ndGgpIHtcclxuICAgICAgICBwdXNoKGB7fWAsIG5vZGUpO1xyXG4gICAgICAgIHJldHVybjtcclxuICAgIH1cclxuICAgIGNvbnN0IG11bHRpbGluZXMgPSBwcm9wZXJ0aWVzLmxlbmd0aCA+IDEgfHxcclxuICAgICAgICAoKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSkgJiZcclxuICAgICAgICAgICAgcHJvcGVydGllcy5zb21lKHAgPT4gcC52YWx1ZS50eXBlICE9PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovKSk7XHJcbiAgICBwdXNoKG11bHRpbGluZXMgPyBge2AgOiBgeyBgKTtcclxuICAgIG11bHRpbGluZXMgJiYgaW5kZW50KCk7XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHByb3BlcnRpZXMubGVu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xwZXJOYW1lTWFwW1dJVEhfQ1RYXX0oYCk7XHJcbiAgICB9XHJcbiAgICBwdXNoKGAoYCwgbm9kZSk7XHJcbiAgICBpZiAoaXNBcnJheShwYXJhbXMpKSB7XHJcbiAgICAgICAgZ2VuTm9kZUxpc3QocGFyYW1zLCBjb250ZXh0KTtcclxuICAgIH1cclxuICAgIGVsc2UgaWYgKHBhcmFtcykge1xyXG4gICAgICAgIGdlbk5vZGUocGFyYW1zLCBjb250ZXh0KTtcclxuICAgIH1cclxuICAgIHB1c2goYCkgPT4gYCk7XHJcbiAgICBpZiAobmV3bGluZSB8fCBib2R5KSB7XHJcbiAgICAgICAgcHVzaChge2ApO1xyXG4gICAgICAgIGluZGVudCgpO1xyXG4gICAgfVxyXG4gICAgaWYgKHJldHVybnMpIHtcclxuICAgICAgICBpZiAobmV3bGluZSkge1xyXG4gICAgICAgICAgICBwdXNoKGByZXR1cm4gYCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChpc0FycmF5KHJldHVybnMpKSB7XHJcbiAgICAgICAgICAgIGdlbk5vZGVMaXN0QXNBcnJheShyZXR1cm5zLCBjb250ZXh0KTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgIGdlbk5vZGUocmV0dXJucywgY29udGV4dCk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAoYm9keSkge1xyXG4gICAgICAgIGdlbk5vZGUoYm9keSwgY29udGV4dCk7XHJcbiAgICB9XHJcbiAgICBpZiAobmV3bGluZSB8fCBib2R5KSB7XHJcbiAgICAgICAgZGVpbmRlbnQoKTtcclxuICAgICAgICBwdXNoKGB9YCk7XHJcbiAgICB9XHJcbiAgICBpZiAoaXNTbG90KSB7XHJcbiAgICAgICAgaWYgKG5vZGUuaXNOb25TY29wZWRTbG90KSB7XHJcbiAgICAgICAgICAgIHB1c2goYCwgdW5kZWZpbmVkLCB0cnVlYCk7XHJcbiAgICA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uICAgICAgICBwdXNoKGBfY2FjaGVbJHtub2RlLmluZGV4fV1gKTtcclxuICAgICAgICBkZWluZGVudCgpO1xyXG4gICAgfVxyXG4gICAgcHVzaChgKWApO1xyXG59XG5cbmZ1bmN0aW9uIHdhbGtJZGVudGlmaWVycyhyb290LCBvbklkZW50aWZpZXIsIGluY2x1ZGVBbGwgPSBmYWxzZSwgcGFyZW50U3RhY2sgPSBbXSwga25vd25JZHMgPSBPYmplY3QuY3JlYXRlKG51bGwpKSB7XHJcbiAgICB7XHJcbiAgICAgICAgcmV0dXJuO1xyXG4gICAgfVxyXG59XHJcbmZ1bmN0aW9uIGlzUmVmZXJlbmNlZElkZW50aWZpZXIoaWQsIHBhcmVudCwgcGFyZW50U3RhY2spIHtcclxuICAgIHtcclxuICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gaXNJbkRlc3RydWN0dXJlQXNzaWdubWVudChwYXJlbnQsIHBhcmVudFN0YWNrKSB7XHJcbiAgICBpZiAocGFyZW50ICYmXHJcbiAgICAgICAgKHBhcmVudC50eXBlID09PSAnT2JqZWN0UHJvcGVydHknIHx8IHBhcmVudC50eXBlID09PSAnQXJyYXlQYXR0ZXJuJykpIHtcclxuICAgICAgICBsZXQgaSA9IHBhcmVudFN0YWNrLmxlbmd0aDtcclxuICAgICAgICB3aGlsZSAoaS0tKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHAgPSBwYXJlbnRTdGFja1tpXTtcclxuICAgICAgICAgICAgaWYgKHAudHlwZSA9PT0gJ0Fzc2lnbm1lbnRFeHByZXNzaW9uJykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAocC50eXBlICE9PSAnT2JqZWN0UHJvcGVydHknICYmICFwLnR5cGUuZW5kc1dpdGgoJ1BhdHRlcm4nKSkge1xyXG4gICAgICAgICAgICAgICAgYnJlYW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AgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgb25JZGVudChzdG10LmlkKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gZXh0cmFjdElkZW50aWZpZXJzKHBhcmFtLCBub2RlcyA9IFtdKSB7XHJcbiAgICBzd2l0Y2ggKHBhcmFtLnR5cGUpIHtcclxuICAgICAgICBjYXNlICdJZGVudGlmaWVyJzpcclxuICAgICAgICAgICAgbm9kZXMucHVzaChwYXJhbSk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgJ01lbWJlckV4cHJlc3Npb24nOlxyXG4gICAgICAgICAgICBsZXQgb2JqZWN0ID0gcGFyYW07XHJcbiAgICAgICAgICAgIHdoaWxlIChvYmplY3QudHlwZSA9PT0gJ01lbWJlckV4cHJlc3Npb24nKSB7XHJcbiAgICAgICAgICAgICAgICBvYmplY3QgPSBvYmplY3Qub2JqZWN0O1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIG5vZGVzLnB1c2gob2JqZWN0KTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAnT2JqZWN0UGF0dGVybic6XHJcbiAgICAgICAgICAgIGZvciAoY29uc3QgcHJvcCBvZiBwYXJhbS5wcm9wZXJ0aWVzKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAocHJvcC50eXBlID09PSAnUmVzdEVsZW1lbnQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgZXh0cmFjdElkZW50aWZpZXJzKHByb3AuYXJndW1lbnQsIG5vZGVzKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhY3RJZGVudGlmaWVycyhwcm9wLnZhbHVlLCBub2Rlcyk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSAnQXJyYXlQYXR0ZXJuJzpcclxuICAgICAgICAgICAgcGFyYW0uZWxlbWVudHMuZm9yRWFjaChlbGVtZW50ID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChlbGVtZW50KVxyXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhY3RJZGVudGlmaWVycyhlbGVtZW50LCBub2Rlcyk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdSZXN0RWxlbWVudCc6XHJcbiAgICAgICAgICAgIGV4dHJhY3RJZGVudGlmaWVycyhwYXJhbS5hcmd1bWVudCwgbm9kZXMpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlICdBc3NpZ25tZW50UGF0dGVybic6XHJcbiAgICAgICAgICAgIGV4dHJhY3RJZGVudGlmaWVycyhwYXJhbS5sZWZ0LCBub2Rlcyk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIG5vZGVzO1xyXG59XHJcbmNvbnN0IGlzRnVuY3Rpb25UeXBlID0gKG5vZGUpID0+IHtcclxuICAgIHJldHVybiAvRnVuY3Rpb24oPzpFeHByZXNzaW9ufERlY2xhcmF0aW9uKSR8TWV0aG9kJC8udGVzdChub2RlLnR5cGUpO1xyXG59O1xyXG5jb25zdCBpc1N0YXRpY1Byb3BlcnR5ID0gKG5vZGUpID0+IG5vZGUgJiZcclxuICAgIChub2RlLnR5cGUgPT09ICdPYmplY3RQcm9wZXJ0eScgfHwgbm9kZS50eXBlID09PSAnT2JqZWN0TWV0aG9kJykgJiZcclxuICAgICFub2RlLmNvbXB1dGVkO1xyXG5jb25zdCBpc1N0YXRpY1Byb3BlcnR5S2V5ID0gKG5vZGUsIHBhcmVudCkgPT4gaXNTdGF0aWNQcm9wZXJ0eShwYXJlbnQpICYmIHBhcmVudC5rZXkgPT09IG5vZGU7XG5cbi8vIHR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MsIHNpbmNlIGNoYWluZWQgdi1pZi9lbHNlIGJyYW5jaGVzIGFyZVxyXG4gICAgICAgIC8vIHJlbmRlcmVkIGF0IHRoZSBzYW1lIGRlcHRoXHJcbiAgICAgICAgY29uc3Qgc2libGluZ3MgPSBjb250ZXh0LnBhcmVudC5jaGlsZHJlbjtcclxuICAgICAgICBsZXQgaSA9IHNpYmxpbmdzLmluZGV4T2YoaWZOb2RlKTtcclxuICAgICAgICBsZXQga2V5ID0gMDtcclxuICAgICAgICB3aGlsZSAoaS0tID49IDApIHtcclxuICAgICAgICAgICAgY29uc3Qgc2libGluZyA9IHNpYmxpbmdzW2ldO1xyXG4gICAgICAgICAgICBpZiAoc2libGluZyAmJiBzaWJsaW5nLnR5cGUgPT09IDkgLyogSUYgKi8pIHtcclxuICAgICAgICAgICAgICAgIGtleSArPSBzaWJsaW5nLmJyYW5jaGVzLmxlbmd0aDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICAvLyBFeGl0IGNhbGxiYWNrLiBDb21wbGV0ZSB0aGUgY29kZWdlbk5vZGUgd2hlbiBhbGwgY2hpbGRyZW4gaGF2ZSBiZWVuXHJcbiAgICAgICAgLy8gdHJhbnNmb3JtZWQuXHJcbiAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgaWYgKGlzUm9vdCkge1xyXG4gICAgICAgICAgICAgICAgaWZOb2RlLmNvZGVnZW5Ob2RlID0gY3JlYXRlQ29kZWdlbk5vZGVGb3JCcmFuY2goYnJhbmNoLCBrZXksIGNvbnRleHQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gYXR0YWNoIHRoaXMgYnJhbmNoJ3MgY29kZWdlbiBub2RlIHRvIHRoZSB2LWlmIHJvb3QuXHJcbiAgICAgICAgICAgICAgICBjb25zdCBwYXJlbnRDb25kaXRpb24gPSBnZXRQYXJlbnRDb25kaXRpb24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ZSwgZGlyKTtcclxuICAgICAgICBjb25zdCBpZk5vZGUgPSB7XHJcbiAgICAgICAgICAgIHR5cGU6IDkgLyogSUYgKi8sXHJcbiAgICAgICAgICAgIGxvYzogbm9kZS5sb2MsXHJcbiAgICAgICAgICAgIGJyYW5jaGVzOiBbYnJhbmNoXVxyXG4gICAgICAgIH07XHJcbiAgICAgICAgY29udGV4dC5yZXBsYWNlTm9kZShpZk5vZGUpO1xyXG4gICAgICAgIGlmIChwcm9jZXNzQ29kZWdlbikge1xyXG4gICAgICAgICAgICByZXR1cm4gcHJvY2Vzc0NvZGVnZW4oaWZOb2RlLCBicmFuY2gsIHRydWUpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gICAgICAgIC8vIGxvY2F0ZSB0aGUgYWRqYWNlbnQgdi1pZlxyXG4gICAgICAgIGNvbnN0IHNpYmxpbmdzID0gY29udGV4dC5wYXJlbnQuY2hpbGRyZW47XHJcbiAgICAgICAgY29uc3QgY29tbWVudHMgPSBbXTtcclxuICAgICAgICBsZXQgaSA9IHNpYmxpbmdzLmluZGV4T2Yobm9kZSk7XHJcbiAgICAgICAgd2hpbGUgKGktLSA+PSAtMSkge1xyXG4gICAgICAgICAgICBjb25zdCBzaWJsaW5nID0gc2libGluZ3NbaV07XHJcbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgc2libGluZyAmJiBzaWJsaW5nLnR5cGUgPT09IDMgLyogQ09NTUVOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgY29udGV4dC5yZW1vdmVOb2RlKHNpYmxpbmcpO1xyXG4gICAgICAgICAgICAgICAgY29tbWVudHMudW5zaGlmdChzaWJsaW5nKTtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChzaWJsaW5nICYmXHJcbiAgICAgICAgICAgICAgICBzaWJsaW5nLnR5cGUgPT09IDIgLyogVEVYVCAqLyAmJlxyXG4gICAgICAgICAgICAgICAgIXNpYmxpbmcuY29udGVudC50cmltKCkubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LnJlbW92ZU5vZGUoc2libGluZyk7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoc2libGluZyAmJiBzaWJsaW5nLnR5cGUgPT09IDkgLyogSUYgKi8pIHtcclxuICAgICAgICAgICAgICAgIC8vIENoZWNrIGlmIHYtZWxzZSB3YXMgZm9sbG93ZWQgYnkgdi1lbHNlLWlmXHJcbiAgICAgICAgICAgICAgICBpZiAoZGlyLm5hbWUgPT09ICdlbHNlLWlmJyAmJlxyXG4gICAgICAgICAgICAgICAgICAgIHNpYmxpbmcuYnJhbmNoZXNbc2libGluZy5icmFuY2hlcy5sZW5ndGggLSAxXS5jb25kaXRpb24gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQub25FcnJvcihjcmVhdGVDb21waWxlckVycm9yKDMwIC8qIFhfVl9FTFNFX05PX0FESkFDRU5UX0lGICovLCBub2RlLmxvYykpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gbW92ZSB0aGUgbm9kZSB0byB0aGUgaWYgbm9kZSdzIGJyYW5jaGVzXHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LnJlbW92ZU5vZGUoKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGJyYW5jaCA9IGNyZWF0ZUlmQnJhbmNoKG5vZGUsIGRpcik7XHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgY29tbWVudHMubGVuZ3RoICYmXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gIzM2MTkgaWdub3JlIGNvbW1lbnRzIGlmIHRoZSB2LWlmIGlzIGRpcmVjdCBjaGlsZCBvZiA8dHJhbnNpdGlvbj5cclxuICAgICAgICAgICAgICAgICAgICAhKGNvbnRleHQucGFyZW50ICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRleHQucGFyZW50LnR5cGUgPT09IDEgLyogRUxFTUVOVCAqLyAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpc0J1aWx0SW5UeXBlKGNvbnRleHQucGFyZW50LnRhZywgJ3RyYW5zaXRpb24nKSkpIHtcclxuICAgICAgICAgICAgICAgICAgICBicmFuY2guY2hpbGRyZW4gPSBbLi4uY29tbWVudHMsIC4uLmJyYW5jaC5jaGlsZHJlbl07XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAvLyBjaGVjayBpZiB1c2VyIGlzIGZvcmNpbmcgc2FtZSBrZXkgb24gZGlmZmVyZW50IGJyYW5jaGVzXHJcbiAgICAgICAgICAgICAgICBpZiAoKHByb2Nlc3MuZW52Lk5PREVfRU5WICE9PSAncHJvZHVjdGlvbicpIHx8ICF0cnVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gYnJhbmNoLnVzZXJLZXk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGtleSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzaWJsaW5nLmJyYW5jaGVzLmZvckVhY2goKHsgdXNlcktleSB9KSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTYW1lS2V5KHVzZXJLZXksIGtleSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcigyOSAvKiBYX1ZfSUZfU0FNRV9LRVkgKi8sIGJyYW5jaC51c2VyS2V5LmxvYykpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBzaWJsaW5nLmJyYW5jaGVzLnB1c2goYnJhbmNoKTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IG9uRXhpdCA9IHByb2Nlc3NDb2RlZ2VuICYmIHByb2Nlc3NDb2RlZ2VuKHNpYmxpbmcsIGJyYW5jaCwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgLy8gc2luY2UgdGhlIGJyYW5jaCB3YXMgcmVtb3ZlZCwgaXQgd2lsbCBub3QgYmUgdHJhdmVyc2VkLlxyXG4gICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHRvIHRyYXZlcnNlIGhlcmUuXHJcbiAgICAgICAgICAgICAgICB0cmF2ZXJzZU5vZGUoYnJhbmNoLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgIC8vIGNhbGwgb24gZXhpdFxyXG4gICAgICAgICAgICAgICAgaWYgKG9uRXhpdClcclxuICAgICAgICAgICAgICAgICAgICBvbkV4aXQoKTtcclxuICAgICAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB0byByZXNldCBjdXJyZW50Tm9kZSBhZnRlciB0cmF2ZXJzYWwgdG8gaW5kaWNhdGUgdGhpc1xyXG4gICAgICAgICAgICAgICAgLy8gbm9kZSBoYXMgYmVlbiByZW1vdmVkLlxyXG4gICAgICAgICAgICAgICAgY29udGV4dC5jdXJyZW50Tm9kZSA9IG51bGw7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcigzMCAvKiBYX1ZfRUxTRV9OT19BREpBQ0VOVF9JRiAqLywgbm9kZS5sb2MpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICA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gICAgZWxzZSB7XHJcbiAgICAgICAgLy8gZGlyZWN0aXZlXHJcbiAgICAgICAgY29uc3QgZXhwID0gYS5leHA7XHJcbiAgICAgICAgY29uc3QgYnJhbmNoRXhwID0gYi5leHA7XHJcbiAgICAgICAgaWYgKGV4cC50eXBlICE9PSBicmFuY2hFeHAudHlwZSkge1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChleHAudHlwZSAhPT0gNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLyB8fFxyXG4gICAgICAgICAgICBleHAuaXNTdGF0aWMgIT09IGJyYW5jaEV4cC5pc1N0YXRpYyB8fFxyXG4gICAgICAgICAgICBleHAuY29udGVudCAhPT0gYnJhbmNoRXhwLmNvbnRlbnQpIHtcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiB0cnVlO1xyXG59XHJcbmZ1bmN0aW9uIGdldFBhcmVudENvbmRpdGlvbihub2RlKSB7XHJcbiAgICB3aGlsZSAodHJ1ZSkge1xyXG4gICAgICAgIGlmIChub2RlLnR5cGUgPT09IDE5IC8qIEpTX0NPTkRJVElPTkFMX0VYUFJFU1NJT04gKi8pIHtcclxuICAgICAgICAgICAgaWYgKG5vZGUuYWx0ZXJuYXRlLnR5cGUgPT09IDE5IC8qIEpTX0NPTkRJVElPTkFMX0VYUFJFU1NJT04gKi8pIHtcclxuICAgICAgICAgICAgICAgIG5vZGUgPSBub2RlLmFsdGVybmF0ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiBub2RlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKG5vZGUudHlwZSA9PT0gMjAgLyogSlNfQ0FDSEVfRVhQUkVTU0lPTiAqLykge1xyXG4gICAgICAg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hpbGRyZW4gaGF2ZSBiZWVuIHRyYXZlcnNlZFxyXG4gICAgICAgICAgICBsZXQgY2hpbGRCbG9jaztcclxuICAgICAgICAgICAgY29uc3QgaXNUZW1wbGF0ZSA9IGlzVGVtcGxhdGVOb2RlKG5vZGUpO1xyXG4gICAgICAgICAgICBjb25zdCB7IGNoaWxkcmVuIH0gPSBmb3JOb2RlO1xyXG4gICAgICAgICAgICAvLyBjaGVjayA8dGVtcGxhdGUgdi1mb3I+IGtleSBwbGFjZW1lbnRcclxuICAgICAgICAgICAgaWYgKCgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgfHwgIXRydWUpICYmIGlzVGVtcGxhdGUpIHtcclxuICAgICAgICAgICAgICAgIG5vZGUuY2hpbGRyZW4uc29tZShjID0+IHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoYy50eXBlID09PSAxIC8qIEVMRU1FTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0gZmluZFByb3AoYywgJ2tleScpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoa2V5KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcigzMyAvKiBYX1ZfRk9SX1RFTVBMQVRFX0tFWV9QTEFDRU1FTlQgKi8sIGtleS5sb2MpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgY29uc3QgbmVlZEZyYWdtZW50V3JhcHBlciA9IGNoaWxkcmVuLmxlbmd0aCAhPT0gMSB8fCBjaGlsZHJlblswXS50eXBlICE9PSAxIC8qIEVMRU1FTlQgKi87XHJcbiAgICAgICAgICAgIGNvbnN0IHNsb3RPdXRsZXQgPSBpc1Nsb3RPdXRsZXQobm9kZSlcclxuICAgICAgICAgICAgICAgID8gbm9kZVxyXG4gICAgICAgICAgICAgICAgOiBpc1RlbXBsYXRlICYmXHJcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jaGlsZHJlbi5sZW5ndGggPT09IDEgJiZcclxuICAgICAgICAgICAgICAgICAgICBpc1Nsb3RPdXRsZXQobm9kZS5jaGlsZHJlblswXSlcclxuICAgICAgICAgICAgICAgICAgICA/IG5vZGUuY2hpbGRyZW5bMF0gLy8gYXBpLWV4dHJhY3RvciBzb21laG93IGZhaWxzIHRvIGluZmVyIHRoaXNcclxuICAgICAgICAgICAgICAgICAgICA6IG51bGw7XHJcbiAgICAgICAgICAgIGlmIChzbG90T3V0bGV0KSB7XHJcbiAgICAgICAgICAgICAgICAvLyA8c2xvdCB2LWZvcj1cIi4uLlwiPiBvciA8dGVtcGxhdGUgdi1mb3I9XCIuLi5cIj48c2xvdC8+PC90ZW1wbGF0ZT5cclxuICAgICAgICAgICAgICAgIGNoaWxkQmxvY2sgPSBzbG90T3V0bGV0LmNvZGVnZW5Ob2RlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzVGVtcGxhdGUgJiYga2V5UHJvcGVydHkpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyA8dGVtcGxhdGUgdi1mb3I9XCIuLi5cIiA6a2V5PVwiLi4uXCI+PHNsb3QvPjwvdGVtcGxhdGU+XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBpbmplY3QgdGhlIGtleSB0byB0aGUgcmVuZGVyU2xvdCgpIGNhbGwuXHJcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlIHByb3BzIGZvciByZW5kZXJTbG90IGlzIHBhc3NlZCBhcyB0aGUgM3JkIGFyZ3VtZW50LlxyXG4gICAgICAgICAgICAgICAgICAgIGluamVjdFByb3AoY2hpbGRCbG9jaywga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2NrLlxyXG4gICAgICAgICAgICAgICAgY2hpbGRCbG9jayA9IGNoaWxkcmVuWzBdXHJcbiAgICAgICAgICAgICAgICAgICAgLmNvZGVnZW5Ob2RlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzVGVtcGxhdGUgJiYga2V5UHJvcGVydHkpIHtcclxuICAgICAgICAgICAgICAgICAgICBpbmplY3RQcm9wKGNoaWxkQmxvY2ssIGtleVByb3BlcnR5LCBjb250ZXh0KTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmIChjaGlsZEJsb2NrLmlzQmxvY2sgIT09ICFpc1N0YWJsZUZyYWdtZW50KSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkQmxvY2suaXNCbG9jaykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzd2l0Y2ggZnJvbSBibG9jayB0byB2bm9kZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICByZW1vdmVIZWxwZXIoT1BFTl9CTE9DSyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUhlbHBlcihnZXRWTm9kZUJsb2NrSGVscGVyKGNvbnRleHQuaW5TU1IsIGNoaWxkQmxvY2suaXNDb21wb25lbnQpKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN3aXRjaCBmcm9tIHZub2RlIHRvIGJsb2NrXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUhlbHBlcihnZXRWTm9kZUhlbHBlcihjb250ZXh0LmluU1NSLCBjaGlsZEJsb2NrLmlzQ29tcG9uZW50KSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY2hpbGRCbG9jay5pc0Jsb2NrID0gIWlzU3RhYmxlRnJhZ21lbnQ7XHJcbiAgICAgICAgICAgICAgICBpZiAoY2hpbGRCbG9jay5pc0Jsb2NrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGVscGVyKE9QRU5fQkxPQ0spO1xyXG4gICAgICAgICAgICAgICAgICAgIGhlbHBlcihnZXRWTm9kZUJsb2NrSGVscGVyKGNvbnRleHQuaW5TU1IsIGNoaWxkQmxvY2suaXNDb21wb25lbnQpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgIGhlbHBlcihnZXRWTm9kZUhlbHBlcihjb250ZXh0LmluU1NSLCBjaGlsZEJsb2NrLmlzQ29tcG9uZW50KSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKG1lbW8pIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGxvb3AgPSBjcmVhdGVGdW5jdGlvbkV4cHJlc3Npb24oY3JlYXRlRm9yTG9vcFBhcmFtcyhmb3JOb2RlLnBhcnNlUmVzdWx0LCBbXHJcbiAgICAgICAgICAgICAgICAgICAgY3JlYXRlU2ltcGxlRXhwcmVzc2lvbihgX2NhY2hlZGApXHJcbiAgICAgICAgICAgICAgICBdKSk7XHJcbiAgICAgICAgICAgICAgICBsb29wLmJvZHkgPSBjcmVhdGVCbG9ja1N0YXRlbWVudChbXHJcbiAgICAgICAgICAgICAgICAgICAgY3JlYXRlQ29tcG91bmRFeHByZXNzaW9uKFtgY29uc3QgX21lbW8gPSAoYCwgbWVtby5leHAsIGApYF0pLFxyXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZUNvbXBvdW5kRXhwcmVzc2lvbihbXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGBpZiAoX2NhY2hlZGAsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC4uLihrZXlFeHAgPyBbYCAmJiBfY2FjaGVkLmtleSA9PT0gYCwga2V5RXhwXSA6I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IChrZXlDb250ZW50KSB7XHJcbiAgICAgICAgICAgIGtleU9mZnNldCA9IGV4cC5pbmRleE9mKGtleUNvbnRlbnQsIHRyaW1tZWRPZmZzZXQgKyB2YWx1ZUNvbnRlbnQubGVuZ3RoKTtcclxuICAgICAgICAgICAgcmVzdWx0LmtleSA9IGNyZWF0ZUFsaWFzRXhwcmVzc2lvbihsb2MsIGtleUNvbnRlbnQsIGtleU9mZnNldCk7XHJcbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgdHJ1ZSkge1xyXG4gICAgICAgICAgICAgICAgdmFsaWRhdGVCcm93c2VyRXhwcmVzc2lvbihyZXN1bHQua2V5LCBjb250ZXh0LCB0cnVlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoaXRlcmF0b3JNYXRjaFsyXSkge1xyXG4gICAgICAgICAgICBjb25zdCBpbmRleENvbnRlbnQgPSBpdGVyYXRvck1hdGNoWzJdLnRyaW0oKTtcclxuICAgICAgICAgICAgaWYgKGluZGV4Q29udGVudCkge1xyXG4gICAgICAgICAgICAgICAgcmVzdWx0LmluZGV4ID0gY3JlYXRlQWxpYXNFeHByZXNzaW9uKGxvYywgaW5kZXhDb250ZW50LCBleHAuaW5kZXhPZihpbmRleENvbnRlbnQsIHJlc3VsdC5rZXlcclxuICAgICAgICAgICAgICAgICAgICA/IGtleU9mZnNldCArIGtleUNvbnRlbnQubGVuZ3RoXHJcbiAgICAgICAgICAgICAgICAgICAgOiB0cmltbWVkT2Zmc2V0ICsgdmFsdWVDb250ZW50Lmxlbmd0aCkpO1xyXG4gICAgICAgICAgICAgICAgaWYgKChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiB0cnVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdmFsaWRhdGVCcm93c2VyRXhwcmVzc2lvbihyZXN1bHQu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zbG90TG9jKTtcclxuICAgICAgICAvLyBjaGVjayBpZiB0aGlzIHNsb3QgaXMgY29uZGl0aW9uYWwgKHYtaWYvdi1mb3IpXHJcbiAgICAgICAgbGV0IHZJZjtcclxuICAgICAgICBsZXQgdkVsc2U7XHJcbiAgICAgICAgbGV0IHZGb3I7XHJcbiAgICAgICAgaWYgKCh2SWYgPSBmaW5kRGlyKHNsb3RFbGVtZW50LCAnaWYnKSkpIHtcclxuICAgICAgICAgICAgaGFzRHluYW1pY1Nsb3RzID0gdHJ1ZTtcclxuICAgICAgICAgICAgZHluYW1pY1Nsb3RzLnB1c2goY3JlYXRlQ29uZGl0aW9uYWxFeHByZXNzaW9uKHZJZi5leHAsIGJ1aWxkRHluYW1pY1Nsb3Qoc2xvdE5hbWUsIHNsb3RGdW5jdGlvbiksIGRlZmF1bHRGYWxsYmFjaykpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICgodkVsc2UgPSBmaW5kRGlyKHNsb3RFbGVtZW50LCAvXmVsc2UoLWlmKT8kLywgdHJ1ZSAvKiBhbGxvd0VtcHR5ICovKSkpIHtcclxuICAgICAgICAgICAgLy8gZmluZCBhZGphY2VudCB2LWlmXHJcbiAgICAgICAgICAgIGxldCBqID0gaTtcclxuICAgICAgICAgICAgbGV0IHByZXY7XHJcbiAgICAgICAgICAgIHdoaWxlIChqLS0pIHtcclxuICAgICAgICAgICAgICAgIHByZXYgPSBjaGlsZHJlbltqXTtcclxuICAgICAgICAgICAgICAgIGlmIChwcmV2LnR5cGUgIT09IDMgLyogQ09NTUVOVCAqLykge1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChwcmV2ICYmIGlzVGVtcGxhdGVOb2RlKHByZXYpICYmIGZpbmREaXIocHJldiwgJ2lmJykpIHtcclxuICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBub2RlXHJ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AgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAvLyBjaGVjayBkdXBsaWNhdGUgc3RhdGljIG5hbWVzXHJcbiAgICAgICAgICAgIGlmIChzdGF0aWNTbG90TmFtZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHNlZW5TbG90TmFtZXMuaGFzKHN0YXRpY1Nsb3ROYW1lKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnRleHQub25FcnJvcihjcmVhdGVDb21waWxlckVycm9yKDM4IC8qIFhfVl9TTE9UX0RVUExJQ0FURV9TTE9UX05BTUVTICovLCBkaXJMb2MpKTtcclxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHNlZW5TbG90TmFtZXMuYWRkKHN0YXRpY1Nsb3ROYW1lKTtcclxuICAgICAgICAgICAgICAgIGlmIChzdGF0aWNTbG90TmFtZSA9PT0gJ2RlZmF1bHQnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzTmFtZWREZWZhdWx0U2xvdCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgc2xvdHNQcm9wZXJ0aWVzLnB1c2goY3JlYXRlT2JqZWN0UHJvcGVydHkoc2xvdE5hbWUsIHNsb3RGdW5jdGlvbikpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIGlmICghb25Db21wb25lbnRTbG90KSB7XHJcbiAgICAgICAgY29uc3QgYnVpbGREZWZhdWx0U2xvdFByb3BlcnR5ID0gKHByb3BzLCBjaGlsZHJlbikgPT4ge1xyXG4gICAgICAgICAgICBjb25zdCBmbiA9IGJ1aWxkU2xvdEZuKHByb3BzLCBjaGlsZHJlbiwgbG9jKTtcclxuICAgICAgICAgICAgaWYgKGNvbnRleHQuY29tcGF0Q29uZmlnKSB7XHJcbiAgICAgICAgICAgICAgICBmbi5pc05vblNjb3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xlbmd0aCkge1xyXG4gICAgICAgIHNsb3RzID0gY3JlYXRlQ2FsbEV4cHJlc3Npb24oY29udGV4dC5oZWxwZXIoQ1JFQVRFX1NMT1RTKSwgW1xyXG4gICAgICAgICAgICBzbG90cyxcclxuICAgICAgICAgICAgY3JlYXRlQXJyYXlFeHByZXNzaW9uKGR5bmFtaWNTbG90cylcclxuICAgICAgICBdKTtcclxuICAgIH1cclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgc2xvdHMsXHJcbiAgICAgICAgaGFzRHluYW1pY1Nsb3RzXHJcbiAgICB9O1xyXG59XHJcbmZ1bmN0aW9uIGJ1aWxkRHluYW1pY1Nsb3QobmFtZSwgZm4pIHtcclxuICAgIHJldHVybiBjcmVhdGVPYmplY3RFeHByZXNzaW9uKFtcclxuICAgICAgICBjcmVhdGVPYmplY3RQcm9wZXJ0eShgbmFtZWAsIG5hbWUpLFxyXG4gICAgICAgIGNyZWF0ZU9iamVjdFByb3BlcnR5KGBmbmAsIGZuKVxyXG4gICAgXSk7XHJcbn1cclxuZnVuY3Rpb24gaGFzRm9yd2FyZGVkU2xvdHMoY2hpbGRyZW4pIHtcclxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBjaGlsZCA9IGNoaWxkcmVuW2ldO1xyXG4gICAgICAgIHN3aXRjaCAoY2hpbGQudHlwZSkge1xyXG4gICAgICAgICAgICBjYXNlIDEgLyogRUxFTUVOVCAqLzpcclxuICAgICAgICAgICAgICAgIGlmIChjaGlsZC50YWdUeXBlID09PSAyIC8qIFNMT1QgKi8gfHxcclxuICAgICAgICAgICAgICAgICAgICBoYXNGb3J3YXJkZWRTbG90cyhjaGlsZC5jaGlsZHJlbikpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBjYXNlIDkgLyogSUYgKi86XHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzRm9yd2FyZGVkU2xvdHMoY2hpbGQuYnJhbmNoZXMpKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGNhc2UgMTAgLyogSUZfQlJBTkNIICovOlxyXG4gICAgICAgICAgICBjYXNlIDExIC8qIEZPUiAqLzpcclxuICAgICAgICAgICAgICAgIGlmIChoYXNGb3J3YXJkZWRTbG90cyhjaGlsZC5jaGlsZHJlbikpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gZmFsc2U7XHJcbn1cclxuZnVuY3Rpb24gaXNOb25XaGl0ZXNwYWNlQ29udGVudChub2RlKSB7XHJcbiAgICBpZiAobm9kZS50eXBlICE9PSAyIC8qIFRFWFQgKi8gJiYgbm9kZS50eXBlICE9PSAxMiAvKiBURVhUX0NBTEwgKi8pXHJcbiAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICByZXR1cm4gbm9kZS50eXBlID09PSAyIC8qIFRFWFQgKi9cclxuICAgICAgICA/ICEhbm9kZS5jb250ZW50LnRyaW0oKVxyXG4gICAgICAgIDogaXNOb25XaGl0ZXNwYWNlQ29udGVudChub2RlLmNvbnRlbnQpO1xyXG59XG5cbi8vIHNvbWUgZGlyZWN0aXZlIHRyYW5zZm9ybXMgKGUuZy4gdi1tb2RlbCkgbWF5IHJldHVybiBhIHN5bWJvbCBmb3IgcnVudGltZVxyXG4vLyBpbXBvcnQsIHdoaWNoIHNob3VsZCBiZSB1c2VkIGluc3RlYWQgb2YgYSByZXNvbHZlRGlyZWN0aXZlIGNhbGwuXHJcbmNvbnN0IGRpcmVjdGl2ZUltcG9ydE1hcCA9IG5ldyBXZW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dXQgb2YgY29yZVxyXG4gICAgICAgICAgICAgICAgLy8gbGVhZHMgdG8gdG9vIG11Y2ggdW5uZWNlc3NhcnkgY29tcGxleGl0eS5cclxuICAgICAgICAgICAgICAgICh0YWcgPT09ICdzdmcnIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgdGFnID09PSAnZm9yZWlnbk9iamVjdCcgfHxcclxuICAgICAgICAgICAgICAgICAgICAvLyAjOTM4OiBlbGVtZW50cyB3aXRoIGR5bmFtaWMga2V5cyBzaG91bGQgYmUgZm9yY2VkIGludG8gYmxvY2tzXHJcbiAgICAgICAgICAgICAgICAgICAgZmluZFByb3Aobm9kZSwgJ2tleScsIHRydWUpKSk7XHJcbiAgICAgICAgLy8gcHJvcHNcclxuICAgICAgICBpZiAocHJvcHMubGVuZ3RoID4gMCkge1xyXG4gICAgICAgICAgICBjb25zdCBwcm9wc0J1aWxkUmVzdWx0ID0gYnVpbGRQcm9wcyhub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgdm5vZGVQcm9wcyA9IHByb3BzQnVpbGRSZXN1bHQucHJvcHM7XHJcbiAgICAgICAgICAgIHBhdGNoRmxhZyA9IHByb3BzQnVpbGRSZXN1bHQucGF0Y2hGbGFnO1xyXG4gICAgICAgICAgICBkeW5hbWljUHJvcE5hbWVzID0gcHJvcHNCdWlsZFJlc3VsdC5keW5hbWljUHJvcE5hbWVzO1xyXG4gICAgICAgICAgICBjb25zdCBkaXJlY3RpdmVzID0gcHJvcHNCdWlsZFJlc3VsdC5kaXJlY3RpdmVzO1xyXG4gICAgICAgICAgICB2bm9kZURpcmVjdGl2ZXMgPVxyXG4gICAgICAgICAgICAgICAgZGlyZWN0aXZlcyAmJiBkaXJlY3RpdmVzLmxlbmd0aFxyXG4gICAgICAgICAgICAgICAgICAgID8gY3JlYXRlQXJyYXlFeHByZXNzaW9uKGRpcmVjdGl2ZXMubWFwKGRpciA9PiBidWlsZERpcmVjdGl2ZUFyZ3MoZGlyLCBjb250ZXh0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AgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgbm9kZS5jaGlsZHJlbi5sZW5ndGggPiAxKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5vbkVycm9yKGNyZWF0ZUNvbXBpbGVyRXJyb3IoNDUgLyogWF9LRUVQX0FMSVZFX0lOVkFMSURfQ0hJTERSRU4gKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IG5vZGUuY2hpbGRyZW5bMF0ubG9jLnN0YXJ0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IG5vZGUuY2hpbGRyZW5bbm9kZS5jaGlsZHJlbi5sZW5ndGggLSAxXS5sb2MuZW5kLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICcnXHJcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IHNob3VsZEJ1aWxkQXNTbG90cyA9IGlzQ29tcG9uZW50ICYmXHJcbiAgICAgICAgICAgICAgICAvLyBUZWxlcG9ydCBpcyBub3QgYSByZWFsIGNvbXBvbmVudCBhbmQgaGFzIGRlZGljYXRlZCBydW50aW1lIGhhbmRsaW5nXHJcbiAgICAgICAgICAgICAgICB2bm9kZVRhZyAhPT0gVEVMRVBPUlQgJiZcclxuICAgICAgICAgICAgICAgIC8vIGV4cGxhaW5lZCBhYm92ZS5cclxuICAgICAgICAgICAgICAgIHZub2RlVGFnICE9PSBLRUVQX0FMSVZFO1xyXG4gICAgICAgICAgICBpZiAoc2hvdWxkQnVpbGRBc1Nsb3RzKSB7XHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IHNsb3RzLCBoYXNEeW5hbWljU2xvdHMgfSA9IGJ1aWxkU2xvdHMobm9kZSwgY29udGV4dCk7XHJcbiAgICAgICAgICAgICAgICB2bm9kZUNoaWxkcmVuID0gc2xvdHM7XHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzRHluYW1pY1Nsb3RzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcGF0Y2hGbGFnIHw9IDEwMjQgLyogRFlOQU1JQ19TTE9UUyAqLztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChub2RlLmNoaWxkcmVuLmxlbmd0aCA9PT0gMSAmJiB2bm9kZVRhZyAhPT0gVEVMRVBPUlQpIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gbm9kZS5jaGlsZHJlblswXTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBjaGlsZC50eXBlO1xyXG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgZm9yIGR5bmFtaWMgdGV4dCBjaGlsZHJlblxyXG4gICAgICAgICAgICAgICAgY29uc3QgaGFzRHluYW1pY1RleHRDaGlsZCA9IHR5cGUgPT09IDUgLyogSU5URVJQT0xBVElPTiAqLyB8fFxyXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPT09IDggLyogQ09NUE9VTkRfRVhQUkVTU0lPTiAqLztcclxuICAgICAgICAgICAgICAgIGlmIChoYXNEeW5hbWljVGV4dENoaWxkICYmXHJcbiAgICAgICAgICAgICAgICAgICAgZ2V0Q29uc3RhbnRUeXBlKGNoaWxkLCBjb250ZXh0KSA9PT0gMCAvKiBOT1RfQ09OU1RBTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBwYXRjaEZsYWcgfD0gMSAvKiBURVhUICovO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgLy8gcGFzcyBkaXJlY3RseSBpZiB0aGUgb25seSBjaGlsZCBpcyBhIHRleHQgbm9kZVxyXG4gICAgICAgICAgICAgICAgLy8gKHBsYWluIC8gaW50ZXJwb2xhdGlvbiAvIGV4cHJlc3Npb24pXHJcbiAgICAgICAgICAgICAgICBpZiAoaGFzRHluYW1pY1RleHRDaGlsZCB8fCB0eXBlID09PSAyIC8qIFRFWFQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICB2bm9kZUNoaWxkcmVuID0gY2hpbGQ7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB2bm9kZUNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHZub2RlQ2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIC8vIHBhdGNoRmxhZyAmIGR5bmFtaWNQcm9wTmFtZXNcclxuICAgICAgICBpZiAocGF0Y2hGbGFnICE9PSAwKSB7XHJcbiAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgIGlmIChwYXRjaEZsYWcgPCAwKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gc3BlY2lhbCBmbGFncyAobmVnYXRpdmUgYW5kIG11dHVhbGx5IGV4Y2x1c2l2ZSlcclxuICAgICAgICAgICAgICAgICAgICB2bm9kZVBhdGNoRmxhZyA9IHBhdGNoRmxhZyArIGAgLyogJHtQYXRjaEZsYWdOYW1lc1twYXRjaEZsYWddfSAqL2A7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBiaXR3aXNlIGZsYWdzXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxhZ05hbWVzID0gT2JqZWN0LmtleXMoUGF0Y2hGbGFnTmFtZXMpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoTnVtYmVyKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKG4gPT4gbiA+IDAgJiYgcGF0Y2hGbGFnICYgbilcclxuICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChuID0+IFBhdGNoRmxhZ05hbWVzW25dKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAuam9pbihgLCBgKTtcclxuICAgICAgICAgICAgICAgICAgICB2bm9kZVBhdGNoRmxhZyA9IHBhdGNoRmxhZyArIGAgLyogJHtmbGFnTmFtZXN9ICovYDtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgIHZub2RlUGF0Y2hGbGFnID0gU3RyaW5nKHBhdGNoRmxhZyk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGR5bmFtaWNQcm9wTmFtZXMgJiYgZHluYW1pY1Byb3BOYW1lcy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgICAgIHZub2RlRHluYW1pY1Byb3BzID0gc3RyaW5naWZ5RHluYW1pY1Byb3BOYW1lcyhkeW5hbWljUHJvcE5hbWVzKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBub2RlLmNvZGVnZW5Ob2RlID0gY3JlYXRlVk5vZGVDYWxsKGNvbnRleHQsIHZub2RlVGFnLCB2bm9kZVByb3BzLCB2bm9kZUNoaWxkcmVuLCB2bm9kZVBhdGNoRmxhZywgdm5vZGVEeW5hbWljUHJvcHMsIHZub2RlRGlyZWN0aXZlcywgISFzaG91bGRVc2VCbG9jaywgZmFsc2UgLyogZGlzYWJsZVRyYWNraW5nICovLCBpc0NvbXBvbmVudCwgbm9kZS5sb2MpO1xyXG4gICAgfTtcclxufTtcclxuZnVuY3Rpb24gcmVzb2x2ZUNvbXBvbmVudFR5cGUobm9kZSwgY29udGV4dCwgc3NyID0gZmFsc2UpIHtcclxuICAgIGxldCB7IHRhZyB9ID0gbm9kZTtcclxuICAgIC8vIDEuIGR5bmFtaWMgY29tcG9uZW50XHJcbiAgICBjb25zdCBpc0V4cGxpY2l0RHluYW1pYyA9IGlzQ29tcG9uZW50VGFnKHRhZyk7XHJcbiAgICBjb25zdCBpc1Byb3AgPSBmaW5kUHJvcChub2RlLCAnaXMnKTtcclxuICAgIGlmIChpc1Byb3ApIHtcclxuICAgICAgICBpZiAoaXNFeHBsaWNpdER5bmFtaWMgfHxcclxuICAgICAgICAgICAgKGlzQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX0lTX09OX0VMRU1FTlRcIiAvKiBDT01QSUxFUl9JU19PTl9FTEVNRU5UICovLCBjb250ZXh0KSkpIHtcclxuICAgICAgICAgICAgY29uc3QgZXhwID0gaXNQcm9wLnR5cGUgPT09IDYgLyogQVRUUklCVVRFICovXHJcbiAgICAgICAgICAgICAgICA/IGlzUHJvcC52YWx1ZSAmJiBjcmVhdGVTaW1wbGVFeHByZXNzaW9uKGlzUHJvcC52YWx1ZS5jb250ZW50LCB0cnVlKVxyXG4gICAgICAgICAgICAgICAgOiBpc1Byb3AuZXhwO1xyXG4gICAgICAgICAgICBpZiAoZXhwKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gY3JlYXRlQ2FsbEV4cHJlc3Npb24oY29udGV4dC5oZWxwZXIoUkVTT0xWRV9EWU5BTUlDX0NPTVBPTkVOVCksIFtcclxuICAgICAgICAgICAgICAgICAgICBleHBcclxuICAgICAgICAgICAgICAgIF0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGlzUHJvcC50eXBlID09PSA2IC8qIEFUVFJJQlVURSAqLyAmJlxyXG4gICAgICAgICAgICBpc1Byb3AudmFsdWUuY29udGVudC5zdGFydHNXaXRoKCd2dWU6JykpIHtcclxuICAgICAgICAgICAgLy8gPGJ1dHRvbiBpcz1cInZ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JiBpc1Jlc2VydmVkUHJvcChuYW1lKSkge1xyXG4gICAgICAgICAgICAgICAgaGFzVm5vZGVIb29rID0gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodmFsdWUudHlwZSA9PT0gMjAgLyogSlNfQ0FDSEVfRVhQUkVTU0lPTiAqLyB8fFxyXG4gICAgICAgICAgICAgICAgKCh2YWx1ZS50eXBlID09PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgdmFsdWUudHlwZSA9PT0gOCAvKiBDT01QT1VORF9FWFBSRVNTSU9OICovKSAmJlxyXG4gICAgICAgICAgICAgICAgICAgIGdldENvbnN0YW50VHlwZSh2YWx1ZSwgY29udGV4dCkgPiAwKSkge1xyXG4gICAgICAgICAgICAgICAgLy8gc2tpcCBpZiB0aGUgcHJvcCBpcyBhIGNhY2hlZCBoYW5kbGVyIG9yIGhhcyBjb25zdGFudCB2YWx1ZVxyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChuYW1lID09PSAncmVmJykge1xyXG4gICAgICAgICAgICAgICAgaGFzUmVmID0gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChuYW1lID09PSAnY2xhc3MnKSB7XHJcbiAgICAgICAgICAgICAgICBoYXNDbGFzc0JpbmRpbmcgPSB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKG5hbWUgPT09ICdzdHlsZScpIHtcclxuICAgICAgICAgICAgICAgIGhhc1N0eWxlQmluZGluZyA9IHRydWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAobmFtZSAhPT0gJ2tleScgJiYgIWR5bmFtaWNQcm9wTmFtZXMuaW5jbHVkZXMobmFtZSkpIHtcclxuICAgICAgICAgICAgICAgIGR5bmFtaWNQcm9wTmFtZXMucHVzaChuYW1lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyB0cmVhdCB0aGUgZHluYW1pYyBjbGFzcyBhbmQgc3R5bGUgYmluZGluZyBvZiB0aGUgY29tcG9uZW50IGFzIGR5bmFtaWMgcHJvcHNcclxuICAgICAgICAgICAgaWYgKGlzQ29tcG9uZW50ICYmXHJcbiAgICAgICAgICAgICAgICAobmFtZSA9PT0gJ2NsYXNzJyB8fCBuYW1lID09PSAnc3R5bGUnKSAmJlxyXG4gICAgICAgICAgICAgICAgIWR5bmFtaWNQcm9wTmFtZXMuaW5jbHVkZXMobmFtZSkpIHtcclxuICAgICAgICAgICAgICAgIGR5bmFtaWNQcm9wTmFtZXMucHVzaChuYW1lKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgaGFzRHluYW1pY0tleXMgPSB0cnVlO1xyXG4gICAgICAgIH1cclxuICAgIH07XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHByb3BzLmxlbmd0aDsgaSsrKSB7XHJcbiAgICAgICAgLy8gc3RhdGljIGF0dHJpYnV0ZVxyXG4gICAgICAgIGNvbnN0IHByb3AgPSBwcm9wc1tpXTtcclxuICAgICAgICBpZiAocHJvcC50eXBlID09PSA2IC8qIEFUVFJJQlVURSAqLykge1xyXG4gICAgICAgICAgICBjb25zdCB7IGxvYywgbmFtZSwgdmFsdWUgfSA9IHByb3A7XHJcbiAgICAgICAgICAgIGxldCB2YWx1ZU5vZGUgPSBjcmVhdGVTaW1wbGVFeHByZXNzaW9uKHZhbHVlID8gdmFsdWUuY29udGVudCA6ICcnLCB0cnVlLCB2YWx1ZSA/IHZhbHVlLmxvYyA6IGxvYyk7XHJcbiAgICAgICAgICAgIGlmIChuYW1lID09PSAncmVmJykge1xyXG4gICAgICAgICAgICAgICAgaGFzUmVmID0gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBza2lwIGlzIG9uIDxjb21wb25lbnQ+LCBvciBpcz1cInZ1ZTp4eHhcIlxyXG4gICAgICAgICAgICBpZiAobmFtZSA9PT0gJ2lzJyAmJlxyXG4gICAgICAgICAgICAgICAgKGlzQ29tcG9uZW50VGFnKHRhZykgfHxcclxuICAgICAgICAgICAgICAgICAgICAodmFsdWUgJiYgdmFsdWUuY29udGVudC5zdGFydHNXaXRoKCd2dWU6JykpIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgKGlzQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX0lTX09OX0VMRU1FTlRcIiAvKiBDT01QSUxFUl9JU19PTl9FTEVNRU5UICovLCBjb250ZXh0KSkpKSB7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBwcm9wZXJ0aWVzLnB1c2goY3JlYXRlT2JqZWN0UHJvcGVydHkoY3JlYXRlU2ltcGxlRXhwcmVzc2lvbihuYW1lLCB0cnVlLCBnZXRJbm5lclJhbmdlKGxvYywgMCwgbmFtZS5sZW5ndGgpKSwgdmFsdWVOb2RlKSk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAvLyBkaXJlY3RpdmVzXHJcbiAgICAgICAgICAgIGNvbnN0IHsgbmFtZSwgYXJnLCBleHAsIGxvYyB9ID0gcHJvcDtcclxuICAgICAgICAgICAgY29uc3QgaXNWQmluZCA9IG5hbWUgPT09ICdiaW5kJztcclxuICAgICAgICAgICAgY29uc3QgaXNWT24gPSBuYW1lID09PSAnb24nO1xyXG4gICAgICAgICAgICAvLyBza2lwIHYtc2xvdCAtIGl0IGlzIGhhbmRsZWQgYnkgaXRzIGRlZGljYXRlZCB0cmFuc2Zvcm0uXHJcbiAgICAgICAgICAgIGlmIChuYW1lID09PSAnc2xvdCcpIHtcclxuICAgICAgICAgICAgICAgIGlmICghaXNDb21wb25lbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcig0MCAvKiBYX1ZfU0xPVF9NSVNQTEFDRUQgKi8sIGxvYykpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gc2tpcCB2LW9uY2Uvdi1tZW1vIC0gdGhleSBhcmUgaGFuZGxlZCBieSBkZWRpY2F0ZWQgdHJhbnNmb3Jtcy5cclxuICAgICAgICAgICAgaWYgKG5hbWUgPT09ICdvbmNlJyB8fCBuYW1lID09PSAnbWVtbycpIHtcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIC8vIHNraXAgdi1pcyBhbmQgOmlzIG9uIDxjb21wb25lbnQ+XHJcbiAgICAgICAgICAgIGlmIChuYW1lID09PSAnaXMnIHx8XHJcbiAgICAgICAgICAgICAgICAoaXNWQmluZCAmJlxyXG4gICAgICAgICAgICAgICAgICAgIGlzQmluZEtleShhcmcsICdpcycpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgKGlzQ29tcG9uZW50VGFnKHRhZykgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgKGlzQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX0lTX09OX0VMRU1FTlRcIiAvKiBDT01QSUxFUl9JU19PTl9FTEVNRU5UICovLCBjb250ZXh0KSkpKSkge1xyXG4gICAgICAgICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gc2tpcCB2LW9uIGluIFNTUiBjb21waWxhdGlvblxyXG4gICAgICAgICAgICBpZiAoaXNWT24gJiYgc3NyKSB7XHJcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2UgZm9yIHYtYmluZCBhbmQgdi1vbiB3aXRoIG5vIGFyZ3VtZW50XHJcbiAgICAgICAgICAgIGlmICghYXJnICYmIChpc1ZCaW5kIHx8IGlzVk9uKSkge1xyXG4gICAgICAgICAgICAgICAgaGFzRHluYW1pY0tleXMgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgaWYgKGV4cCkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmxlbmd0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBtZXJnZUFyZ3MucHVzaChjcmVhdGVPYmplY3RFeHByZXNzaW9uKGRlZHVwZVByb3BlcnRpZXMocHJvcGVydGllcyksIGVsZW1lbnRMb2MpKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcyA9IFtdO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNWQmluZCkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAyLnggdi1iaW5kIG9iamVjdCBvcmRlciBjb21wYXRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYXNPdmVycmlkYWJsZUtleXMgPSBtZXJnZUFyZ3Muc29tZShhcmcgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJnLnR5cGUgPT09IDE1IC8qIEpTX09CSkVDVF9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJnLnByb3BlcnRpZXMuc29tZSgoeyBrZXkgfSkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXkudHlwZSAhPT0gNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLyB8fFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAha2V5LmlzU3RhdGljKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGtleS5jb250ZW50ICE9PSAnY2xhc3MnICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleS5jb250ZW50ICE9PSAnc3R5bGUnICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFpc09uKGtleS5jb250ZW50KSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGR5bmFtaWMgZXhwcmVzc2lvblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzT3ZlcnJpZGFibGVLZXlzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrQ29tcGF0RW5hYmxlZChcIkNPTVBJTEVSX1ZfQklORF9PQkpFQ1RfT1JERVJcIiAvKiBDT01QSUxFUl9WX0JJTkRfT0JKRUNUX09SREVSICovLCBjb250ZXh0LCBsb2MpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0NvbXBhdEVuYWJsZWQoXCJDT01QSUxFUl9WX0JJTkRfT0JKRUNUX09SREVSXCIgLyogQ09NUElMRVJfVl9CSU5EX09CSkVDVF9PUkRFUiAqLywgY29udGV4dCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZUFyZ3MudW5zaGlmdChleHApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlQXJncy5wdXNoKGV4cCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB2LW9uPVwib2JqXCIgLT4gdG9IYW5kbGVycyhvYmopXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlQXJncy5wdXNoKHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDE0IC8qIEpTX0NBTExfRVhQUkVTU0lPTiAqLyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvYyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxlZTogY29udGV4dC5oZWxwZXIoVE9fSEFORExFUlMpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJndW1lbnRzOiBbZXhwXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcihpc1ZCaW5kXHJcbiAgICAgICAgICAgICAgICAgICAgICAgID8gMzQgLyogWF9WX0JJTkRfTk9fRVhQUkVTU0lPTiAqL1xyXG4gICAgICAgICAgICAgICAgICAgICAgICA6IDM1IC8qIFhfVl9PTl9OT19FWFBSRVNTSU9OICovLCBsb2MpKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGNvbnN0IGRpcmVjdGl2ZVRyYW5zZm9ybSA9IGNvbnRleHQuZGlyZWN0aXZlVHJhbnNmb3Jtc1tuYW1lXTtcclxuICAgICAgICAgICAgaWYgKGRpcmVjdGl2ZVRyYW5zZm9ybSkge1xyXG4gICAgICAgICAgICAgICAgLy8gaGFzIGJ1aWx0LWluIGRpcmVjdGl2ZSB0cmFuc2Zvcm0uXHJcbiAgICAgICAgICAgICAgICBjb25zdCB7IHByb3BzLCBuZWVkUnVudGltZSB9ID0gZGlyZWN0aXZlVHJhbnNmb3JtKHByb3AsIG5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICAgICAgIXNzciAmJiBwcm9wcy5mb3JFYWNoKGFuYWx5emVQYXRjaEZsYWcpO1xyXG4gICAgICAgICAgICAgICAgcHJvcGVydGllcy5wdXNoKC4uLnByb3BzKTtcclxuICAgICAgICAgICAgICAgIGlmIChuZWVkUnVudGltZSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJ1bnRpbWVEaXJlY3RpdmVzLnB1c2gocHJvcCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzU3ltYm9sKG5lZWRSdW50aW1lKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBkaXJlY3RpdmVJbXBvcnRNYXAuc2V0KHByb3AsIG5lZWRSdW50aW1lKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAvLyBubyBidWlsdC1pbiB0cmFuc2Zvcm0sIHRoaXMgaXMgYSB1c2VyIGN1c3RvbSBkaXJlY3RpdmUuXHJcbiAgICAgICAgICAgICAgICBydW50aW1lRGlyZWN0aXZlcy5wdXNoKHByb3ApO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChwcm9wLnR5cGUgPT09IDYgLyogQVRUUklCVVRFICovICYmXHJcbiAgICAgICAgICAgIHByb3AubmFtZSA9PT0gJ3JlZicgJiZcclxuICAgICAgICAgICAgY29udGV4dC5zY29wZXMudkZvciA+IDAgJiZcclxuICAgICAgICAgICAgY2hlY2tDb21wYXRFbmFibGVkKFwiQ09NUElMRVJfVl9GT1JfUkVGXCIgLyogQ09NUElMRVJfVl9GT1JfUkVGICovLCBjb250ZXh0LCBwcm9wLmxvYykpIHtcclxuICAgICAgICAgICAgcHJvcGVydGllcy5wdXNoKGNyZWF0ZU9iamVjdFByb3BlcnR5KGNyZWF0ZVNpbXBsZUV4cHJlc3Npb24oJ3JlZkluRm9yJywgdHJ1ZSksIGNyZWF0ZVNpbXBsZUV4cHJlc3Npb24oJ3RydWUnLCBmYWxzZSkpKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBsZXQgcHJvcHNFeHByZXNzaW9uID0gdW5kZWZpbmVkO1xyXG4gICAgLy8gaGFzIHYtYmluZD1cIm9iamVjdFwiIG9yIHYtb249XCJvYmplY3RcIiwgd3JhcCB3aXRoIG1lcmdlUHJvcHNcclxuICAgIGlmIChtZXJnZUFyZ3MubGVuZ3RoKSB7XHJcbiAgICAgICAgaWYgKHBy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1xyXG4gICAgICAgICAgICAgICAgbGV0IGNsYXNzS2V5SW5kZXggPSAtMTtcclxuICAgICAgICAgICAgICAgIGxldCBzdHlsZUtleUluZGV4ID0gLTE7XHJcbiAgICAgICAgICAgICAgICBsZXQgaGFzRHluYW1pY0tleSA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwcm9wc0V4cHJlc3Npb24ucHJvcGVydGllcy5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IHByb3BzRXhwcmVzc2lvbi5wcm9wZXJ0aWVzW2ldLmtleTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNTdGF0aWNFeHAoa2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoa2V5LmNvbnRlbnQgPT09ICdjbGFzcycpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzS2V5SW5kZXggPSBpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGtleS5jb250ZW50ID09PSAnc3R5bGUnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZUtleUluZGV4ID0gaTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgha2V5LmlzSGFuZGxlcktleSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBoYXNEeW5hbWljS2V5ID0gdHJ1ZTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBjb25zdCBjbGFzc1Byb3AgPSBwcm9wc0V4cHJlc3Npb24ucHJvcGVydGllc1tjbGFzc0tleUluZGV4XTtcclxuICAgICAgICAgICAgICAgIGNvbnN0IHN0eWxlUHJvcCA9IHByb3BzRXhwcmVzc2lvbi5wcm9wZXJ0aWVzW3N0eWxlS2V5SW5kZXhdO1xyXG4gICAgICAgICAgICAgICAgLy8gbm8gZHluYW1pYyBrZXlcclxuICAgICAgICAgICAgICAgIGlmICghaGFzRHluYW1pY0tleSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChjbGFzc1Byb3AgJiYgIWlzU3RhdGljRXhwKGNsYXNzUHJvcC52YWx1ZSkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2xhc3NQcm9wLnZhbHVlID0gY3JlYXRlQ2FsbEV4cHJlc3Npb24oY29udGV4dC5oZWxwZXIoTk9STUFMSVpFX0NMQVNTKSwgW2NsYXNzUHJvcC52YWx1ZV0pO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAoc3R5bGVQcm9wICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICFpc1N0YXRpY0V4cChzdHlsZVByb3AudmFsdWUpICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzdGF0aWMgc3R5bGUgaXMgY29tcGlsZWQgaW50byBhbiBvYmplY3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNvIHVzZSBgaGFzU3R5bGVCaW5kaW5nYCB0byBlbnN1cmUgdGhhdCBpdCBpcyBhIGR5bmFtaWMgc3R5bGUgYmluZGluZ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAoaGFzU3R5bGVCaW5kaW5nIHx8XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2LWJpbmQ6c3R5bGUgYW5kIHN0eWxlIGJvdGggZXhpc3QsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2LWJpbmQ6c3R5bGUgd2l0aCBzdGF0aWMgbGl0ZXJhbCBvYmplY3RcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0eWxlUHJvcC52YWx1ZS50eXBlID09PSAxNyAvKiBKU19BUlJBWV9FWFBSRVNTSU9OICovKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZVByb3AudmFsdWUgPSBjcmVhdGVDYWxsRXhwcmVzc2lvbihjb250ZXh0LmhlbHBlcihOT1JNQUxJWkVfU1RZTEUpLCBbc3R5bGVQcm9wLnZhbHVlXSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZHluYW1pYyBrZXkgYmluZGluZywgd3JhcCB3aXRoIGBub3JtYWxpemVQcm9wc2BcclxuICAgICAgICAgICAgICAgICAgICBwcm9wc0V4cHJlc3Npb24gPSBjcmVhdGVDYWxsRXhwcmVzc2lvbihjb250ZXh0LmhlbHBlcihOT1JNQUxJWkVfUFJPUFMpLCBbcHJvcHNFeHByZXNzaW9uXSk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgY2FzZSAxNCAvKiBKU19DQUxMX0VYUFJFU1NJT04gKi86XHJcbiAgICAgICAgICAgICAgICAvLyBtZXJnZVByb3BzIGNhbGwsIGRvIG5vdGhpbmdcclxuICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICBkZWZhdWx0OlxyXG4gICAgICAgICAgICAgICAgLy8gc2luZ2xlIHYtYmluZFxyXG4gICAgICAgICAgICAgICAgcHJvcHNFeHByZXNzaW9uID0gY3JlYXRlQ2FsbEV4cHJlc3Npb24oY29udGV4dC5oZWxwZXIoTk9STUFMSVpFX1BST1BTKSwgW1xyXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZUNhbGxFeHByZXNzaW9uKGNvbnRleHQuaGVscGVyKEdVQVJEX1JFQUNUSVZFX1BST1BTKSwgW1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9wc0V4c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dXRsZXQobm9kZSkpIHtcclxuICAgICAgICBjb25zdCB7IGNoaWxkcmVuLCBsb2MgfSA9IG5vZGU7XHJcbiAgICAgICAgY29uc3QgeyBzbG90TmFtZSwgc2xvdFByb3BzIH0gPSBwcm9jZXNzU2xvdE91dGxldChub2RlLCBjb250ZXh0KTtcclxuICAgICAgICBjb25zdCBzbG90QXJncyA9IFtcclxuICAgICAgICAgICAgY29udGV4dC5wcmVmaXhJZGVudGlmaWVycyA/IGBfY3R4LiRzbG90c2AgOiBgJHNsb3RzYCxcclxuICAgICAgICAgICAgc2xvdE5hbWUsXHJcbiAgICAgICAgICAgICd7fScsXHJcbiAgICAgICAgICAgICd1bmRlZmluZWQnLFxyXG4gICAgICAgICAgICAndHJ1ZSdcclxuICAgICAgICBdO1xyXG4gICAgICAgIGxldCBleHBlY3RlZExlbiA9IDI7XHJcbiAgICAgICAgaWYgKHNsb3RQcm9wcykge1xyXG4gICAgICAgICAgICBzbG90QXJnc1syXSA9IHNsb3RQcm9wcztcclxuICAgICAgICAgICAgZXhwZWN0ZWRMZW4gPSAzO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoY2hpbGRyZW4ubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgIHNsb3RBcmdzWzNdID0gY3JlYXRlRnVuY3Rpb25FeHByZXNzaW9uKFtdLCBjaGlsZHJlbiwgZmFsc2UsIGZhbHNlLCBsb2MpO1xyXG4gICAgICAgICAgICBleHBlY3RlZExlbiA9IDQ7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGlmIChjb250ZXh0LnNjb3BlSWQgJiYgIWNvbnRleHQuc2xvdHRlZCkge1xyXG4gICAgICAgICAgICBleHBlY3RlZExlbiA9IDU7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHNsb3RBcmdzLnNwbGljZShleHBlY3RlZExlbik7IC8vIHJlbW92ZSB1bnVzZWQgYXJndW1lbnRzXHJcbiAgICAgICAgbm9kZS5jb2RlZ2VuTm9kZSA9IGNyZWF0ZUNhbGxFeHByZXNzaW9uKGNvbnRleHQuaGVscGVyKFJFTkRFUl9TTE9UKSwgc2xvdEFyZ3MsIGxvYyk7XHJcbiAgICB9XHJcbn07XHJcbmZ1bmN0aW9uIHByb2Nlc3NTbG90T3V0bGV0KG5vZGUsIGNvbnRleHQpIHtcclxuICAgIGxldCBzbG90TmFtZSA9IGBcImRlZmF1bHRcImA7XHJcbiAgICBsZXQgc2xvdFByb3BzID0gdW5kZWZpbmVkO1xyXG4gICAgY29uc3Qgbm9uTmFtZVByb3BzID0gW107XHJcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUucHJvcHMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBjb25zdCBwID0gbm9kZS5wcm9wc1tpXTtcclxuICAgICAgICBpZiAocC50eXBlID09PSA2IC8qIEFUVFJJQlVURSAqLykge1xyXG4gICAgICAgICAgICBpZiAocC52YWx1ZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHAubmFtZSA9PT0gJ25hbWUnKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2xvdE5hbWUgPSBKU09OLnN0cmluZ2lmeShwLnZhbHVlLmNvbnRlbnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcC5uYW1lID0gY2FtZWxpemUocC5uYW1lKTtcclxuICAgICAgICAgICAgICAgICAgICBub25OYW1lUHJvcHMucHVzaChwKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgaWYgKHAubmFtZSA9PT0gJ2JpbmQnICYmIGlzQmluZEtleShwLmFyZywgJ25hbWUnKSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHAuZXhwKVxyXG4gICAgICAgICAgICAgICAgICAgIHNsb3ROYW1lID0gcC5leHA7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBpZiAocC5uYW1lID09PSAnYmluZCcgJiYgcC5hcmcgJiYgaXNTdGF0aWNFeHAocC5hcmcpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcC5hcmcuY29udGVudCA9IGNhbWVsaXplKHAuYXJnLmNvbnRlbnQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgbm9uTmFtZVByb3BzLnB1c2gocCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBpZiAobm9uTmFtZVByb3BzLmxlbmd0aCA+IDApIHtcclxuICAgICAgICBjb25zdCB7IHByb3BzLCBkaXJlY3RpdmVzIH0gPSBidWlsZFByb3BzKG5vZGUsIGNvbnRleHQsIG5vbk5hbWVQcm9wcyk7XHJcbiAgICAgICAgc2xvdFByb3BzID0gcHJvcHM7XHJcbiAgICAgICAgaWYgKGRpcmVjdGl2ZXMubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgIGNvbnRleHQub25FcnJvcihjcmVhdGVDb21waWxlckVycm9yKDM2IC8qIFhfVl9TTE9UX1VORVhQRUNURURfRElSRUNUSVZFX09OX1NMT1RfT1VUTEVUICovLCBkaXJlY3RpdmVzWzBdLmxvYykpO1xyXG4gICAgICAgIH1cclxuICAgIH1cclxuICAgIHJldHVybiB7XHJcbiAgICAgICAgc2xvdE5hbWUsXHJcbiAgICAgICAgc2xvdFByb3BzXHJcbiAgICB9O1xyXG59XG5cbmNvbnN0IGZuRXhwUkUgPSAvXlxccyooW1xcdyRfXSt8KGFzeW5jXFxzKik/XFwoW14pXSo/XFwpKVxccyo9PnxeXFxzKihhc3luY1xccyspP2Z1bmN0aW9uKD86XFxzK1tcXHckXSspP1xccypcXCgvO1xyXG5jb25zdCB0cmFuc2Zvcm1PbiA9IChkaXIsIG5vZGUsIGNvbnRleHQsIGF1Z21lbnRvcikgPT4ge1xyXG4gICAgY29uc3QgeyBsb2MsIG1vZGlmaWVycywgYXJnIH0gPSBkaXI7XHJcbiAgICBpZiAoIWRpci5leHAgJiYgIW1vZGlmaWVycy5sZW5ndGgpIHtcclxuICAgICAgICBjb250ZXh0Lm9uRXJyb3IoY3JlYXRlQ29tcGlsZXJFcnJvcigzNSAvKiBYX1ZfT05fTk9fRVhQUkVTU0lPTiAqLywgbG9jKSk7XHJcbiAgICB9XHJcbiAgICBsZXQgZXZlbnROYW1lO1xyXG4gICAgaWYgKGFyZy50eXBlID09PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgaWYgKGFyZy5pc1N0YXRpYykge1xyXG4gICAgICAgICAgICBjb25zdCByYXdOYW1lID0gYXJnLmNvbnRlbnQ7XHJcbiAgICAgICAgICAgIC8vIGZvciBhbGwgZXZlbnQgbGlzdGVuZXJzLCBhdXRvIGNvbnZlcnQgaXQgdG8gY2FtZWxDYXNlLiBTZWUgaXNzdWUgIzIyNDlcclxuICAgICAgICAgICAgZXZlbnROYW1lID0gY3JlYXRlU2ltcGxlRXhwcmVzc2lvbih0b0hhbmRsZXJLZXkoY2FtZWxpemUkMShyYXdOYW1lKSksIHRydWUsIGFyZy5sb2MpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gIzIzODhcclxuICAgICAgICAgICAgZXZlbnROYW1lID0gY3JlYXRlQ29tcG91bmRFeHByZXNzaW9uKFtcclxuICAgICAgICAgICAgICAgIGAke2NvbnRleHQuaGVscGVyU3RyaW5nKFRPX0hBTkRMRVJfS0VZKX0oYCxcclxuICAgICAgICAgICAgICAgIGFyZyxcclxuICAgICAgICAgICAgICAgIGApYFxyXG4gICAgICAgICAgICBdKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICAvLyBhbHJlYWR5IGEgY29tcG91bmQgZXhwcmVzc2lvbi5cclxuICAgICAgICB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5jIGlzIHJlcGxhY2VkIGJ5IHYtbW9kZWw6YXJnXHJcbiAgICBpZiAobW9kaWZpZXJzLmluY2x1ZGVzKCdjYW1lbCcpKSB7XHJcbiAgICAgICAgaWYgKGFyZy50eXBlID09PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgICAgIGlmIChhcmcuaXNTdGF0aWMpIHtcclxuICAgICAgICAgICAgICAgIGFyZy5jb250ZW50ID0gY2FtZWxpemUkMShhcmcuY29udGVudCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBhcmcuY29udGVudCA9IGAke2NvbnRleHQuaGVscGVyU3RyaW5nKENBTUVMSVpFKX0oJHthcmcuY29udGVudH0pYDtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgYXJnLmNoaWxkcmVuLnVuc2hpZnQoYCR7Y29udGV4dC5oZWxwZXJTdHJpbmcoQ0FNRUxJWkUpfShgKTtcclxuICAgICAgICAgICAgYXJnLmNoaWxkcmVuLnB1c2goYClgKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbiAgICBpZiAoIWNvbnRleHQuaW5TU1IpIHtcclxuICAgICAgICBpZiAobW9kaWZpZXJzLmluY2x1ZGVzKCdwcm9wJykpIHtcclxuICAgICAgICAgICAgaW5qZWN0UHJlZml4KGFyZywgJy4nKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKG1vZGlmaWVycy5pbmNsdWRlcygnYXR0cicpKSB7XHJcbiAgICAgICAgICAgIGluamVjdFByZWZpeChhcmcsICdeJyk7XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKCFleHAgfHxcclxuICAgICAgICAoZXhwLnR5cGUgPT09IDQgLyogU0lNUExFX0VYUFJFU1NJT04gKi8gJiYgIWV4cC5jb250ZW50LnRyaW0oKSkpIHtcclxu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BzaW5nbGUgZXhwcmVzc2lvbiBub2RlIGFzIGNoaWxkLlxyXG5jb25zdCB0cmFuc2Zvcm1UZXh0ID0gKG5vZGUsIGNvbnRleHQpID0+IHtcclxuICAgIGlmIChub2RlLnR5cGUgPT09IDAgLyogUk9PVCAqLyB8fFxyXG4gICAgICAgIG5vZGUudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovIHx8XHJcbiAgICAgICAgbm9kZS50eXBlID09PSAxMSAvKiBGT1IgKi8gfHxcclxuICAgICAgICBub2RlLnR5cGUgPT09IDEwIC8qIElGX0JSQU5DSCAqLykge1xyXG4gICAgICAgIC8vIHBlcmZvcm0gdGhlIHRyYW5zZm9ybSBvbiBub2RlIGV4aXQgc28gdGhhdCBhbGwgZXhwcmVzc2lvbnMgaGF2ZSBhbHJlYWR5XHJcbiAgICAgICAgLy8gYmVlbiBwcm9jZXNzZWQuXHJcbiAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgY29uc3QgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuO1xyXG4gICAgICAgICAgICBsZXQgY3VycmVudENvbnRhaW5lciA9IHVuZGVmaW5lZDtcclxuICAgICAgICAgICAgbGV0IGhhc1RleHQgPSBmYWxzZTtcclxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGlsZHJlbi5sZW5ndGg7IGkrKykge1xyXG4gICAgICAgICAgICAgICAgY29uc3QgY2hpbGQgPSBjaGlsZHJlbltpXTtcclxuICAgICAgICAgICAgICAgIGlmIChpc1RleHQoY2hpbGQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaGFzVGV4dCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IGkgKyAxOyBqIDwgY2hpbGRyZW4ubGVuZ3RoOyBqKyspIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbmV4dCA9IGNoaWxkcmVuW2pdO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNUZXh0KG5leHQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWN1cnJlbnRDb250YWluZXIpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Q29udGFpbmVyID0gY2hpbGRyZW5baV0gPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDggLyogQ09NUE9VTkRfRVhQUkVTU0lPTiAqLyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9jOiBjaGlsZC5sb2MsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuOiBbY2hpbGRdXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1lcmdlIGFkamFjZW50IHRleHQgbm9kZSBpbnRvIGN1cnJlbnRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRDb250YWluZXIuY2hpbGRyZW4ucHVzaChgICsgYCwgbmV4dCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbi5zcGxpY2UoaiwgMSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLS07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50Q29udGFpbmVyID0gdW5kZWZpbmVkO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCFoYXNUZXh0IHx8XHJcbiAgICAgICAgICAgICAgICAvLyBpZiB0aGlzIGlzIGEgcGxhaW4gZWxlbWVudCB3aXRoIGEgc2luZ2xlIHRleHQgY2hpbGQsIGxlYXZlIGl0XHJcbiAgICAgICAgICAgICAgICAvLyBhcy1pcyBzaW5jZSB0aGUgcnVudGltZSBoYXMgZGVkaWNhdGVkIGZhc3QgcGF0aCBmb3IgdGhpcyBieSBkaXJlY3RseVxyXG4gICAgICAgICAgICAgICAgLy8gc2V0dGluZyB0ZXh0Q29udGVudCBvZiB0aGUgZWxlbWVudC5cclxuICAgICAgICAgICAgICAgIC8vIGZvciBjb21wb25lbnQgcm9vdCBpdCdzIGFsd2F5cyBub3JtYWxpemVkIGFueXdheS5cclxuICAgICAgICAgICAgICAgIChjaGlsZHJlbi5sZW5ndGggPT09IDEgJiZcclxuICAgICAgICAgICAgICAgICAgICAobm9kZS50eXBlID09PSAwIC8qIFJPT1QgKi8gfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgKG5vZGUudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLnRhZ1R5cGUgPT09IDAgLyogRUxFTUVOVCAqLyAmJlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIzM3NTZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGN1c3RvbSBkaXJlY3RpdmVzIGNhbiBwb3RlbnRpYWxseSBhZGQgRE9NIGVsZW1lbnRzIGFyYml0cmFyaWx5LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2UgbmVlZCB0byBhdm9pZCBzZXR0aW5nIHRleHRDb250ZW50IG9mIHRoZSBlbGVtZW50IGF0IHJ1bnRpbWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIGF2b2lkIGFjY2lkZW50YWxseSBvdmVyd3JpdGluZyB0aGUgRE9NIGVsZW1lbnRzIGFkZGVkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBieSB0aGUgdXNlciB0aHJvdWdoIGN1c3RvbSBkaXJlY3RpdmVzLlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIW5vZGUucHJvcHMuZmluZChwID0+IHAudHlwZSA9PT0gNyAvKiBESVJFQ1RJVkUgKi8gJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhY29udGV4dC5kaXJlY3RpdmVUcmFuc2Zvcm1zW3AubmFtZV0pICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbiBjb21wYXQgbW9kZSwgPHRlbXBsYXRlPiB0YWdzIHdpdGggbm8gc3BlY2lhbCBkaXJlY3RpdmVzXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aWxsIGJlIHJlbmRlcmVkIGFzIGEgZnJhZ21lbnQgc28gaXRzIGNoaWxkcmVuIG11c3QgYmVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnZlcnRlZCBpbnRvIHZub2Rlcy5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICEobm9kZS50YWcgPT09ICd0ZW1wbGF0ZScpKSkpKSB7XHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgLy8gcHJlLWNvbnZlcnQgdGV4dCBub2RlcyBpbnRvIGNyZWF0ZVRleHRWTm9kZSh0ZXh0KSBjYWxscyB0byBhdm9pZFxyXG4gICAgICAgICAgICAvLyBydW50aW1lIG5vcm1hbGl6YXRpb24uXHJcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gY2hpbGRyZW5baV07XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNUZXh0KGNoaWxkKSB8fCBjaGlsZC50eXBlID09PSA4IC8qIENPTVBPVU5EX0VYUFJFU1NJT04gKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBjb25zdCBjYWxsQXJncyA9IFtdO1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIGNyZWF0ZVRleHRWTm9kZSBkZWZhdWx0cyB0byBzaW5nbGUgd2hpdGVzcGFjZSwgc28gaWYgaXQgaXMgYVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIHNpbmdsZSBzcGFjZSB0aGUgY29kZSBjb3VsZCBiZSBhbiBlbXB0eSBjYWxsIHRvIHNhdmUgYnl0ZXMuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNoaWxkLnR5cGUgIT09IDIgLyogVEVYVCAqLyB8fCBjaGlsZC5jb250ZW50ICE9PSAnICcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbEFyZ3MucHVzaChjaGlsZCk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIC8vIG1hcmsgZHluYW1pYyB0ZXh0IHdpdGggZmxhZyBzbyBpdCBnZXRzIHBhdGNoZWQgaW5zaWRlIGEgYmxvY2tcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbnRleHQuc3NyICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldENvbnN0YW50VHlwZShjaGlsZCwgY29udGV4dCkgPT09IDAgLyogTk9UX0NPTlNUQU5UICovKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxBcmdzLnB1c2goMSAvKiBURVhUICovICtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgPyBgIC8qICR7UGF0Y2hGbGFnTmFtZXNbMSAvKiBURVhUICovXX0gKi9gIDogYGApKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgY2hpbGRyZW5baV0gPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDEyIC8qIFRFWFRfQ0FMTCAqLyxcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogY2hpbGQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxvYzogY2hpbGQubG9jLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlZ2VuTm9kZTogY3JlYXRlQ2FsbEV4cHJlc3Npb24oY29udGV4dC5oZWxwZXIoQ1JFQVRFX1RFWFQpLCBjYWxsQXJncylcclxuICAgICAgICAgICAgICAgICAgICB9O1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxufTtcblxuY29uc3Qgc2VlbiA9IG5ldyBXZWFrU2V0KCk7XHJcbmNvbnN0IHRyYW5zZm9ybU9uY2UgPSAobm9kZSwgY29udGV4dCkgPT4ge1xyXG4gICAgaWYgKG5vZGUudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovICYmIGZpbmREaXIobm9kZSwgJ29uY2UnLCB0cnVlKSkge1xyXG4gICAgICAgIGlmIChzZWVuLmhhcyhub2RlKSB8fCBjb250ZXh0LmluVk9uY2UpIHtcclxuICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgIH1cclxuICAgICAgICBzZWVuLmFkZChub2RlKTtcclxuICAgICAgICBjb250ZXh0LmluVk9uY2UgPSB0cnVlO1xyXG4gICAgICAgIGNvbnRleHQuaGVscGVyKFNFVF9CTE9DS19UUkFDS0lORyk7XHJcbiAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgY29udGV4dC5pblZPbmNlID0gZmFsc2U7XHJcbiAgICAgICAgICAgIGNvbnN0IGN1ciA9IGNvbnRleHQuY3VycmVudE5vZGU7XHJcbiAgICAgICAgICAgIGlmIChjdXIuY29kZWdlbk5vZGUpIHtcclxuICAgICAgICAgICAgICAgIGN1ci5jb2Rl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aWREaXZpc2lvbkNoYXJSRSA9IC9bXFx3KS4rXFwtXyRcXF1dLztcclxuY29uc3QgdHJhbnNmb3JtRmlsdGVyID0gKG5vZGUsIGNvbnRleHQpID0+IHtcclxuICAgIGlmICghaXNDb21wYXRFbmFibGVkKFwiQ09NUElMRVJfRklMVEVSXCIgLyogQ09NUElMRVJfRklMVEVSUyAqLywgY29udGV4dCkpIHtcclxuICAgICAgICByZXR1cm47XHJcbiAgICB9XHJcbiAgICBpZiAobm9kZS50eXBlID09PSA1IC8qIElOVEVSUE9MQVRJT04gKi8pIHtcclxuICAgICAgICAvLyBmaWx0ZXIgcmV3cml0ZSBpcyBhcHBsaWVkIGJlZm9yZSBleHByZXNzaW9uIHRyYW5zZm9ybSBzbyBvbmx5XHJcbiAgICAgICAgLy8gc2ltcGxlIGV4cHJlc3Npb25zIGFyZSBwb3NzaWJsZSBhdCB0aGlzIHN0YWdlXHJcbiAgICAgICAgcmV3cml0ZUZpbHRlcihub2RlLmNvbnRlbnQsIGNvbnRleHQpO1xyXG4gICAgfVxyXG4gICAgaWYgKG5vZGUudHlwZSA9PT0gMSAvKiBFTEVNRU5UICovKSB7XHJcbiAgICAgICAgbm9kZS5wcm9wcy5mb3JFYWNoKChwcm9wKSA9PiB7XHJcbiAgICAgICAgICAgIGlmIChwcm9wLnR5cGUgPT09IDcgLyogRElSRUNUSVZFICovICYmXHJcbiAgICAgICAgICAgICAgICBwcm9wLm5hbWUgIT09ICdmb3InICYmXHJcbiAgICAgICAgICAgICAgICBwcm9wLmV4cCkge1xyXG4gICAgICAgICAgICAgICAgcmV3cml0ZUZpbHRlcihwcm9wLmV4cCwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9KTtcclxuICAgIH1cclxufTtcclxuZnVuY3Rpb24gcmV3cml0ZUZpbHRlcihub2RlLCBjb250ZXh0KSB7XHJcbiAgICBpZiAobm9kZS50eXBlID09PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovKSB7XHJcbiAgICAgICAgcGFyc2VGaWx0ZXIobm9kZSwgY29udGV4dCk7XHJcbiAgICB9XHJcbiAgICBlbHNlIHtcclxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG5vZGUuY2hpbGRyZW4ubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgY29uc3QgY2hpbGQgPSBub2RlLmNoaWxkcmVuW2ldO1xyXG4gICAgICAgICAgICBpZiAodHlwZW9mIGNoaWxkICE9PSAnb2JqZWN0JylcclxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xyXG4gICAgICAgICAgICBpZiAoY2hpbGQudHlwZSA9PT0gNCAvKiBTSU1QTEVfRVhQUkVTU0lPTiAqLykge1xyXG4gICAgICAgICAgICAgICAgcGFyc2VGaWx0ZXIoY2hpbGQsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGNoaWxkLnR5cGUgPT09IDggLyogQ09NUE9VTkRfRVhQUkVTU0lPTiAqLykge1xyXG4gICAgICAgICAgICAgICAgcmV3cml0ZUZpbHRlcihub2RlLCBjb250ZXh0KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBlbHNlIGlmIChjaGlsZC50eXBlID09PSA1IC8qIElOVEVSUE9MQVRJT04gKi8pIHtcclxuICAgICAgICAgICAgICAgIHJld3JpdGVGaWx0ZXIoY2hpbGQuY29udGVudCwgY29udGV4dCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gcGFyc2VGaWx0ZXIobm9kZSwgY29udGV4dCkge1xyXG4gICAgY29uc3QgZXhwID0gbm9kZS5jb250ZW50O1xyXG4gICAgbGV0IGluU2luZ2xlID0gZmFsc2U7XHJcbiAgICBsZXQgaW5Eb3VibGUgPSBmYWxzZTtcclxuICAgIGxldCBpblRlbXBsYXRlU3RyaW5nID0gZmFsc2U7XHJcbiAgICBsZXQgaW5SZWdleCA9IGZhbHNlO1xyXG4gICAgbGV0IGN1cmx5ID0gMDtcclxuICAgIGxldCBzcXVhcmUgPSAwO1xyXG4gICAgbGV0IHBhcmVuID0gMDtcclxuICAgIGxldCBsYXN0RmlsdGVySW5kZXggPSAwO1xyXG4gICAgbGV0IGMsIHByZXYsIGksIGV4cHJlc3Npb24sIGZpbHRlcnMgPSBbXTtcclxuICAgIGZvciAoaSA9IDA7IGkgPCBleHAubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBwcmV2ID0gYztcclxuICAgICAgICBjID0gZXhwLmNoYXJDb2RlQXQoaSk7XHJcbiAgICAgICAgaWYgKGluU2luZ2xlKSB7XHJcbiAgICAgICAgICAgIGlmIChjID09PSAweDI3ICYmIHByZXYgIT09IDB4NWMpXHJcbiAgICAgICAgICAgICAgICBpblNpbmdsZSA9IGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpbkRvdWJsZSkge1xyXG4gICAgICAgICAgICBpZiAoYyA9PT0gMHgyMiAmJiBwcmV2ICE9PSAweDVjKVxyXG4gICAgICAgICAgICAgICAgaW5Eb3VibGUgPSBmYWxzZTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoaW5UZW1wbGF0ZVN0cmluZykge1xyXG4gICAgICAgICAgICBpZiAoYyA9PT0gMHg2MCAmJiBwcmV2ICE9PSAweDVjKVxyXG4gICAgICAgICAgICAgICAgaW5UZW1wbGF0ZVN0cmluZyA9IGZhbHNlO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmIChpblJlZ2V4KSB7XHJcbiAgICAgICAgICAgIGlmIChjID09PSAweDJmICYmIHByZXYgIT09IDB4NWMpXHJcbiAgICAgICAgICAgICAgICBpblJlZ2V4ID0gZmFsc2U7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKGMgPT09IDB4N2MgJiYgLy8gcGlwZVxyXG4gICAgICAgICAgICBleHAuY2hhckNvZGVBdChpICsgMSkgIT09IDB4N2MgJiZcclxuICAgICAgICAgICAgZXhwLmNoYXJDb2RlQXQoaSAtIDEpICE9PSAweDdjICYmXHJcbiAgICAgICAgICAgICFjdXJseSAmJlxyXG4gICAgICAgICAgICAhc3F1YXJlICYmXHJcbiAgICAgICAgICAgICFwYXJlbikge1xyXG4gICAgICAgICAgICBpZiAoZXhwcmVzc2lvbiA9PT0gdW5kZWZpbmVkKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBmaXJzdCBmaWx0ZXIsIGVuZCBvZiBleHByZXNzaW9uXHJcbiAgICAgICAgICAgICAgICBsYXN0RmlsdGVySW5kZXggPSBpICsgMTtcclxuICAgICAgICAgICAgICAgIGV4cHJlc3Npb24gPSBleHAuc2xpY2UoMCwgaSkudHJpbSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgcHVzaEZpbHRlcigpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICBzd2l0Y2ggKGMpIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMHgyMjpcclxuICAgICAgICAgICAgICAgICAgICBpbkRvdWJsZSA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8vIFwiXHJcbiAgICAgICAgICAgICAgICBjYXNlIDB4Mjc6XHJcbiAgICAgICAgICAgICAgICAgICAgaW5TaW5nbGUgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyAnXHJcbiAgICAgICAgICAgICAgICBjYXNlIDB4NjA6XHJcbiAgICAgICAgICAgICAgICAgICAgaW5UZW1wbGF0ZVN0cmluZyA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8vIGBcclxuICAgICAgICAgICAgICAgIGNhc2UgMHgyODpcclxuICAgICAgICAgICAgICAgICAgICBwYXJlbisrO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyAoXHJcbiAgICAgICAgICAgICAgICBjYXNlIDB4Mjk6XHJcbiAgICAgICAgICAgICAgICAgICAgcGFyZW4tLTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhazsgLy8gKVxyXG4gICAgICAgICAgICAgICAgY2FzZSAweDViOlxyXG4gICAgICAgICAgICAgICAgICAgIHNxdWFyZSsrO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyBbXHJcbiAgICAgICAgICAgICAgICBjYXNlIDB4NWQ6XHJcbiAgICAgICAgICAgICAgICAgICAgc3F1YXJlLS07XHJcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7IC8vIF1cclxuICAgICAgICAgICAgICAgIGNhc2UgMHg3YjpcclxuICAgICAgICAgICAgICAgICAgICBjdXJseSsrO1xyXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvLyB7XHJcbiAgICAgICAgICAgICAgICBjYXNlIDB4N2Q6XHJcbiAgICAgICAgICAgICAgICAgICAgY3VybHktLTtcclxuICAgICAgICAgICAgICAgICAgICBicmVhazsgLy8gfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChjID09PSAweDJmKSB7XHJcbiAgICAgICAgICAgICAgICAvLyAvXHJcbiAgICAgICAgICAgICAgICBsZXQgaiA9IGkgLSAxO1xyXG4gICAgICAgICAgICAgICAgbGV0IHA7XHJcbiAgICAgICAgICAgICAgICAvLyBmaW5kIGZpcnN0IG5vbi13aGl0ZXNwYWNlIHByZXYgY2hhclxyXG4gICAgICAgICAgICAgICAgZm9yICg7IGogPj0gMDsgai0tKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcCA9IGV4cC5jaGFyQXQoaik7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHAgIT09ICcgJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIXAgfHwgIXZhbGlkRGl2aXNpb25DaGFyUkUudGVzdChwKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGluUmVnZXggPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgaWYgKGV4cHJlc3Npb24gPT09IHVuZGVmaW5lZCkge1xyXG4gICAgICAgIGV4cHJlc3Npb24gPSBleHAuc2xpY2UoMCwgaSkudHJpbSgpO1xyXG4gICAgfVxyXG4gICAgZWxzZSBpZiAobGFzdEZpbHRlckluZGV4ICE9PSAwKSB7XHJcbiAgICAgICAgcHVzaEZpbHRlcigpO1xyXG4gICAgfVxyXG4gICAgZnVuY3Rpb24gcHVzaEZpbHRlcigpIHtcclxuICAgICAgICBmaWx0ZXJzLnB1c2goZXhwLnNsaWNlKGxhc3RGaWx0ZXJJbmRleCwgaSkudHJpbSgpKTtcclxuICAgICAgICBsYXN0RmlsdGVySW5kZXggPSBpICsgMTtcclxuICAgIH1cclxuICAgIGlmIChmaWx0ZXJzLmxlbmd0aCkge1xyXG4gICAgICAgIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJlxyXG4gICAgICAgICAgICB3YXJuRGVwcmVjYXRpb24oXCJDT01QSUxFUl9GSUxURVJcIiAvKiBDT01QSUxFUl9GSUxURVJTICovLCBjb250ZXh0LCBub2RlLmxvYyk7XHJcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IGZpbHRlcnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICAgICAgZXhwcmVzc2lvbiA9IHdyYXBGaWx0ZXIoZXhwcmVzc2lvbiwgZmlsdGVyc1tpXSwgY29udGV4dCk7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIG5vZGUuY29udGVudCA9IGV4cHJlc3Npb247XHJcbiAgICB9XHJcbn1cclxuZnVuY3Rpb24gd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vZGVnZW5Ob2RlIHx8XHJcbiAgICAgICAgICAgICAgICBjb250ZXh0LmN1cnJlbnROb2RlLmNvZGVnZW5Ob2RlO1xyXG4gICAgICAgICAgICBpZiAoY29kZWdlbk5vZGUgJiYgY29kZWdlbk5vZGUudHlwZSA9PT0gMTMgLyogVk5PREVfQ0FMTCAqLykge1xyXG4gICAgICAgICAgICAgICAgLy8gbm9uLWNvbXBvbmVudCBzdWIgdHJlZSBzaG91bGQgYmUgdHVybmVkIGludG8gYSBibG9ja1xyXG4gICAgICAgICAgICAgICAgaWYgKG5vZGUudGFnVHlwZSAhPT0gMSAvKiBDT01QT05FTlQgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICBtYWtlQmxvY2soY29kZWdlbk5vZGUsIGNvbnRleHQpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgbm9kZS5jb2RlZ2VuTm9kZSA9IGNyZWF0ZUNhbGxFeHByZXNzaW9uKGNvbnRleHQuaGVscGVyKFdJVEhfTUVNTyksIFtcclxuICAgICAgICAgICAgICAgICAgICBkaXIuZXhwLFxyXG4gICAgICAgICAgICAgICAgICAgIGNyZWF0ZUZ1bmN0aW9uRXhwcmVzc2lvbih1bmRlZmluZWQsIGNvZGVnZW5Ob2RlKSxcclxuICAgICAgICAgICAgICAgICAgICBgX2NhY2hlYCxcclxuICAgICAgICAgICAgICAgICAgICBTdHJpbmcoY29udGV4dC5jYWNoZWQrKylcclxuICAgICAgICAgICAgICAgIF0pO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfTtcclxuICAgIH1cclxufTtcblxuZnVuY3Rpb24gZ2V0QmFzZVRyYW5zZm9ybVByZXNldChwcmVmaXhJZGVudGlmaWVycykge1xyXG4gICAgcmV0dXJuIFtcclxuICAgICAgICBbXHJcbiAgICAgICAgICAgIHRyYW5zZm9ybU9uY2UsXHJcbiAgICAgICAgICAgIHRyYW5zZm9ybUlmLFxyXG4gICAgICAgICAgICB0cmFuc2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Z2V0TmFtZXNwYWNlKHRhZywgcGFyZW50KSB7XHJcbiAgICAgICAgbGV0IG5zID0gcGFyZW50ID8gcGFyZW50Lm5zIDogMCAvKiBIVE1MICovO1xyXG4gICAgICAgIGlmIChwYXJlbnQgJiYgbnMgPT09IDIgLyogTUFUSF9NTCAqLykge1xyXG4gICAgICAgICAgICBpZiAocGFyZW50LnRhZyA9PT0gJ2Fubm90YXRpb24teG1sJykge1xyXG4gICAgICAgICAgICAgICAgaWYgKHRhZyA9PT0gJ3N2ZycpIHtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gMSAvKiBTVkcgKi87XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAocGFyZW50LnByb3BzLnNvbWUoYSA9PiBhLnR5cGUgPT09IDYgLyogQVRUUklCVVRFICovICYmXHJcbiAgICAgICAgICAgICAgICAgICAgYS5uYW1lID09PSAnZW5jb2RpbmcnICYmXHJcbiAgICAgICAgICAgICAgICAgICAgYS52YWx1ZSAhPSBudWxsICYmXHJcbiAgICAgICAgICAgICAgICAgICAgKGEudmFsdWUuY29udGVudCA9PT0gJ3RleHQvaHRtbCcgfHxcclxuICAgICAgICAgICAgICAgICAgICAgICAgYS52YWx1ZS5jb250ZW50ID09PSAnYXBwbGljYXRpb24veGh0bWwreG1sJykpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbnMgPSAwIC8qIEhUTUwgKi87XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgZWxzZSBpZiAoL15tKD86W2lvbnNdfHRleHQpJC8udGVzdChwYXJlbnQudGFnKSAmJlxyXG4gICAgICAgICAgICAgICAgdGFnICE9PSAnbWdseXBoJyAmJlxyXG4gICAgICAgICAgICAgICAgdGFnICE9PSAnbWFsaWdubWFyaycpIHtcclxuICAgICAgICAgICAgICAgIG5zID0gMCAvKiBIVE1MICovO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKHBhcmVudCAmJiBucyA9PT0gMSAvKiBTVkcgKi8pIHtcclxuICAgICAgICAgICAgaWYgKHBhcmVudC50YWcgPT09ICdmb3JlaWduT2JqZWN0JyB8fFxyXG4gICAgICAgICAgICAgICAgcGFyZW50LnRhZyA9PT0gJ2Rlc2MnIHx8XHJcbiAgICAgICAgICAgICAgICBwYXJlbnQudGFnID09PSAndGl0bGUnKSB7XHJcbiAgICAgICAgICAgICAgICBucyA9IDAgLyogSFRNTCAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobnMgPT09IDAgLyogSFRNTCAqLykge1xyXG4gICAgICAgICAgICBpZiAodGFnID09PSAnc3ZnJykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIDEgLyogU1ZHICovO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICh0YWcgPT09ICdtYXRoJykge1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuIDIgLyogTUFUSF9NTCAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICByZXR1cm4gbnM7XHJcbiAgICB9LFxyXG4gICAgLy8gaHR0cHM6Ly9odG1sLnNwZWMud2hhdHdnLm9yZy9tdWx0aXBhZ2UvcGFyc2luZy5odG1sI3BhcnNpbmctaHRtbC1mcmFnbWVudHNcclxuICAgIGdldFRleHRNb2RlKHsgdGFnLCBucyB9KSB7XHJcbiAgICAgICAgaWYgKG5zID09PSAwIC8qIEhUTUwgKi8pIHtcclxuICAgICAgICAgICAgaWYgKHRhZyA9PT0gJ3RleHRhcmVhJyB8fCB0YWcgPT09ICd0aXRsZScpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiAxIC8qIFJDREFUQSAqLztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoaXNSYXdUZXh0Q29udGFpbmVyKHRhZykpIHtcclxuICAgICAgICAgICAgIC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W50KSB7XHJcbiAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBmaW5kUHJvcChub2RlLCBgdHlwZWApO1xyXG4gICAgICAgICAgICBpZiAodHlwZSkge1xyXG4gICAgICAgICAgICAgICAgaWYgKHR5cGUudHlwZSA9PT0gNyAvKiBESVJFQ1RJVkUgKi8pIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyA6dHlwZT1cImZvb1wiXHJcbiAgICAgICAgICAgICAgICAgICAgZGlyZWN0aXZlVG9Vc2UgPSBWX01PREVMX0RZTkFNSUM7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0eXBlLnZhbHVlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh0eXBlLnZhbHVlLmNvbnRlbnQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncmFkaW8nOlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlyZWN0aXZlVG9Vc2UgPSBWX01PREVMX1JBRElPO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2NoZWNrYm94JzpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcmVjdGl2ZVRvVXNlID0gVl9NT0RFTF9DSEVDS0JPWDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdmaWxlJzpcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzSW52YWxpZFR5cGUgPSB0cnVlO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dC5vbkVycm9yKGNyZWF0ZURPTUNvbXBpbGVyRXJyb3IoNTYgLyogWF9WX01PREVMX09OX0ZJTEVfSU5QVVRfRUxFTUVOVCAqLywgZGlyLmxvYykpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0ZXh0IHR5cGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSAmJiBjaGVja0R1cGxpY2F0ZWRWYWx1ZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2UgaWYgKGhhc0R5bmFtaWNLZXlWQmluZChub2RlKSkge1xyXG4gICAgICAgICAgICAgICAgLy8gZWxlbWVudCBoYXMgYmluZGluZ3Mgd2l0aCBkeW5hbWljIGtleXMsIHdoaWNoIGNhbiBwb3NzaWJseSBjb250YWluXHJcbiAgICAgICAgICAgICAgICAvLyBcInR5cGVcIi5cclxuICAgICAgICAgICAgICAgIGRpcmVjdGl2ZVRvVXNlID0gVl9NT0RFTF9EWU5BTUlDO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gdGV4dCB0eXBlXHJcbiAgICAgICAgICAgICAgICAocHJvY2Vzcy5lbnYuTk9ERV9FTlYgIT09ICdwcm9kdWN0aW9uJykgJiYgY2hlY2tEdXBsaWNhdGVkVmFsdWUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIGlmICh0YWcgPT09ICdzZWxlY3QnKSB7XHJcbiAgICAgICAgICAgIGRpcmVjdGl2ZVRvVXNlID0gVl9NT0RFTF9TRUxFQ1Q7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAvLyB0ZXh0YXJlYVxyXG4g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RpZmllciA9PT0gJ25hdGl2ZScgJiZcclxuICAgICAgICAgICAgY2hlY2tDb21wYXRFbmFibGVkKFwiQ09NUElMRVJfVl9PTl9OQVRJVkVcIiAvKiBDT01QSUxFUl9WX09OX05BVElWRSAqLywgY29udGV4dCwgbG9jKSkge1xyXG4gICAgICAgICAgICBldmVudE9wdGlvbk1vZGlmaWVycy5wdXNoKG1vZGlmaWVyKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgZWxzZSBpZiAoaXNFdmVudE9wdGlvbk1vZGlmaWVyKG1vZGlmaWVyKSkge1xyXG4gICAgICAgICAgICAvLyBldmVudE9wdGlvbk1vZGlmaWVyczogbW9kaWZpZXJzIGZvciBhZGRFdmVudExpc3RlbmVyKCkgb3B0aW9ucyxcclxuICAgICAgICAgICAgLy8gZS5nLiAucGFzc2l2ZSAmIC5jYXB0dXJlXHJcbiAgICAgICAgICAgIGV2ZW50T3B0aW9uTW9kaWZpZXJzLnB1c2gobW9kaWZpZXIpO1xyXG4gICAgICAgIH1cclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gcnVudGltZU1vZGlmaWVyczogbW9kaWZpZXJzIHRoYXQgbmVlZHMgcnVudGltZSBndWFyZHNcclxuICAgICAgICAgICAgaWYgKG1heWJlS2V5TW9kaWZpZXIobW9kaWZpZXIpKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNTdGF0aWNFeHAoa2V5KSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc0tleWJvYXJkRXZlbnQoa2V5LmNvbnRlbnQpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGtleU1vZGlmaWVycy5wdXNoKG1vZGlmaWVyKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vbktleU1vZGlmaWVycy5wdXNoKG1vZGlmaWVyKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICBrZXlNb2RpZmllcnMucHVzaChtb2RpZmllcik7XHJcbiAgICAgICAgICAgICAgICAgICAgbm9uS2V5TW9kaWZpZXJzLnB1c2gobW9kaWZpZXIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgaWYgKGlzTm9uS2V5TW9kaWZpZXIobW9kaWZpZXIpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbm9uS2V5TW9kaWZpZXJzLnB1c2gobW9kaWZpZXIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgICAga2V5TW9kaWZpZXJzLnB1c2gobW9kaWZpZXIpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG4gICAgcmV0dXJuIHtcclxuICAgICAgICBrZXlNb2RpZmllcnMsXHJcbiAgICAgICAgbm9uS2V5TW9kaWZpZXJzLFxyXG4gICAgICAgIGV2ZW50T3B0aW9uTW9kaWZpZXJzXHJcbiAgICB9O1xyXG59O1xyXG5jb25zdCB0cmFuc2Zvcm1DbGljayA9IChrZXksIGV2ZW50KSA9PiB7XHJcbiAgICBjb25zdCBpc1N0YXRpY0NsaWNrID0gaXNTdGF0aWNFeHAoa2V5KSAmJiBrZXkuY29udGVudC50b0xvd2VyQ2FzZSgpID09PSAnb25jbGljayc7XHJcbiAgICByZXR1cm4gaXNTdGF0aWNDbGlja1xyXG4gICAgICAgID8gY3JlYXRlU2ltcGxlRXhwcmVzc2lvbihldmVudCwgdHJ1ZSlcclxuICAgICAgICA6IGtleS50eXBlICE9PSA0IC8qIFNJTVBMRV9FWFBSRVNTSU9OICovXHJcbiAgICAgICAgICAgID8gY3JlYXRlQ29tcG91bmRFeHByZXNzaW9uKFtcclxuICAgICAgICAgICAgICAgIGAoYCxcclxuICAgICAgICAgICAgICAgIGtleSxcclxuICAgICAgICAgICAgICAgIGApID09PSBcIm9uQ2xpY2tcIiA/IFwiJHtldmVudH1cIiA6IChgLFxyXG4gICAgICAgICAgICAgICAga2V5LFxyXG4gICAgICAgICAgICAgICAgYClgXHJcbiAgICAgICAgICAgIF0pXHJcbiAgICAgICAgICAgIDoga2V5O1xyXG59O1xyXG5jb25zdCB0cmFuc2Zvcm1PbiA9IChkaXIsIG5vZGUsIGNvbnRleHQpID0+IHtcclxuICAgIHJldHVybiB0cmFuc2Zvcm1PbiQxKGRpciwgbm9kZSwgY29udGV4dCwgYmFzZVJlc3VsdCA9PiB7XHJcbiAgICAgICAgY29uc3QgeyBtb2RpZmllcnMgfSA9IGRpcjtcclxuICAgICAgICBpZiAoIW1vZGlmaWVycy5sZW5ndGgpXHJcbiAgICAgICAgICAgIHJldHVybiBiYXNlUmVzdWx0O1xyXG4gICAgICAgIGxldCB7IGtleSwgdmFsdWU6IGhhbmRsZXJFeHAgfSA9IGJhc2VSZXN1bHQucHJvcHNbMF07XHJcbiAgICAgICAgY29uc3QgeyBrZXlNb2RpZmllcnMsIG5vbktleU1vZGlmaWVycywgZXZlbnRPcHRpb25Nb2RpZmllcnMgfSA9IHJlc29sdmVNb2RpZmllcnMoa2V5LCBtb2RpZmllcnMsIGNvbnRleHQsIGRpci5sb2MpO1xyXG4gICAgICAgIC8vIG5vcm1hbGl6ZSBjbGljay5yaWdodCBhbmQgY2xpY2subWlkZGxlIHNpbmNlIHRoZXkgZG9uJ3QgYWN0dWFsbHkgZmlyZVxyXG4gICAgICAgIGlmIChub25LZXlNb2RpZmllcnMuaW5jbHVkZXMoJ3JpZ2h0JykpIHtcclxuICAgICAgICAgICAga2V5ID0gdHJhbnNmb3JtQ2xpY2soa2V5LCBgb25Db250ZXh0bWVudWApO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobm9uS2V5TW9kaWZpZXJzLmluY2x1ZGVzKCdtaWRkbGUnKSkge1xyXG4gICAgICAgICAgICBrZXkgPSB0cmFuc2Zvcm1DbGljayhrZXksIGBvbk1vdXNldXBgKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKG5vbktleU1vZGlmaWVycy5sZW5ndGgpIHtcclxuICAgICAgICAgICAgaGFuZGxlckV4cCA9IGNyZWF0ZUNhbGxFeHByZXNzaW9uKGNvbnRleHQuaGVscGVyKFZfT05fV0lUSF9NT0RJRklFUlMpLCBbXHJcbiAgICAgICAgICAgICAgICBoYW5kbGVyRXhwLFxyXG4gICAgICAgICAgICAgICAgSlNPTi5zdHJpbmdpZnkobm9uS2V5TW9kaWZpZXJzKVxyXG4gICAgICAgICAgICBdKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgaWYgKGtleU1vZGlmaWVycy5sZW5ndGggJiZcclxuICAgICAgICAgICAgLy8gaWYgZXZlbnQgbmFtZSBpcyBkeW5hbWljLCBhbHdheXMgd3JhcCB3aXRoIGtleXMgZ3VhcmRcclxuICAgICAgICAgICAgKCFpc1N0YXRpY0V4cChrZXkpIHx8IGlzS2V5Ym9hcmRFdmVudChrZXkuY29udGVudCkpKSB7XHJcbiAgICAgICAgICAgIGhhbmRsZXJFeHAgPSBjcmVhdGVDYWxsRXhwcmVzc2lvbihjb250ZXh0LmhlbHBlcihWX09OX1dJVEhfS0VZUyksIFtcclxuICAgICAgICAgICAgICAgIGhhbmRsZXJFeHAsXHJcbiAgICAgICAgICAgICAgICBKU09OLnN0cmluZ2lmeShrZXlNb2RpZmllcnMpXHJcbiAgICAgICAgICAgIF0pO1xyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAoZXZlbnRPcHRpb25Nb2RpZmllcnMubGVuZ3RoKSB7XHJcbiAgICAgICAgICAgIGNvbnN0IG1vZGlmaWVyUG9zdGZpeCA9IGV2ZW50T3B0aW9uTW9kaWZpZXJzLm1hcChjYXBpdGFsaXplKS5qb2luKCcnKTtcclxuICAgICAgICAgICAga2V5ID0gaXNTdGF0aWNFeHAoa2V5KVxyXG4gICAgICAgICAgICAgICAgPyBjcmVhdGVTaW1wbGVFeHByZXNzaW9uKGAke2tleS5jb250ZW50fSR7bW9kaWZpZXJQb3N0Zml4fWAsIHRydWUpXHJcbiAgICAgICAgICAgICAgICA6IGNyZWF0ZUNvbXBvdW5kRXhwcmVzc2lvbihbYChgLCBrZXksIGApICsgXCIke21vZGlmaWVyUG9zdGZpeH1cImBdKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgcHJvcHM6IFtjcmVhdGVPYmplY3RQcm9wZXJ0eShrZXksIGhhbmRsZXJFeHApXVxyXG4gICAgICAgIH07XHJcbiAgICB9KTtcclxufTtcblxuY29uc3QgdHJhbnNmb3JtU2hvdyA9IChkaXIsIG5vZGUsIGNvbnRleHQpID0+IHtcclxuICAgIGNvbnN0IHsgZXhwLCBsb2MgfSA9IGRpcjtcclxuICAgIGlmICghZXhwKSB7XHJcbiAgICAgICAgY29udGV4dC5vbkVycm9yKGNyZWF0ZURPTUNvbXBpbGVyRXJyb3IoNTggLyogWF9WX1NIT1dfTk9fRVhQUkVTU0lPTiAqLywgbG9jKSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4ge1xyXG4gICAgICAgIHByb3BzOiBbXSxcclxuICAgICAgICBuZWVkUnVudGltZTogY29udGV4dC5oZWxwZXIoVl9TSE9XKVxyXG4gICAgfTtcclxufTtcblxuY29uc3Qgd2FyblRyYW5zaXRpb25DaGlsZHJlbiA9IChub2RlLCBjb250ZXh0KSA9PiB7XHJcbiAgICBpZiAobm9kZS50eXBlID09PSAxIC8qIEVMRU1FTlQgKi8gJiZcclxuICAgICAgICBub2RlLnRhZ1R5cGUgPT09IDEgLyogQ09NUE9ORU5UICovKSB7XHJcbiAgICAgICAgY29uc3QgY29tcG9uZW50ID0gY29udGV4dC5pc0J1aWx0SW5Db21wb25lbnQobm9kZS50YWcpO1xyXG4gICAgICAgIGlmIChjb21wb25lbnQgPT09IFRSQU5TSVRJT04pIHtcclxuICAgICAgICAgICAgcmV0dXJuICgpID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChub2RlLmNoaWxkcmVuLmxlbmd0aCAmJiBoYXNNdWx0aXBsZUNoaWxkcmVuKG5vZGUpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udGV4dC5vbkVycm9yKGNyZWF0ZURPTUNvbXBpbGVyRXJyb3IoNTkgLyogWF9UUkFOU0lUSU9OX0lOVkFMSURfQ0hJTERSRU4gKi8sIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQ6IG5vZGUuY2hpbGRyZW5bMF0ubG9jLnN0YXJ0LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBlbmQ6IG5vZGUuY2hpbGRyZW5bbm9kZS5jaGlsZHJlbi5sZW5ndGggLSAxXS5sb2MuZW5kLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2U6ICcnXHJcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9O1xyXG4gICAgICAgIH1cclxuICAgIH1cclxufTtcclxuZnVuY3Rpb24gaGFzTXVsdGlwbGVDaGlsZHJlbihub2RlKSB7XHJcbiAgICAvLyAjMTM1MiBmaWx0ZXIgb3V0IHBvdGVudGlhbCBjb21tZW50IG5vZGVzLlxyXG4gICAgY29uc3QgY2hpbGRyZW4gPSAobm9kZS5jaGlsZHJlbiA9IG5vZGUuY2hpbGRyZW4uZmlsdGVyKGMgPT4gYy50eXBlICE9PSAzIC8qIENPTU1FTlQgKi8gJiZcclxuICAgICAgICAhKGMudHlwZSA9PT0gMiAvKiBURVhUICovICYmICFjLmNvbnRlbnQudHJpbSgpKSkpO1xyXG4gICAgY29uc3QgY2hpbGQgPSBjaGlsZHJlblswXTtccl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Vyci5sb2Muc3RhcnQub2Zmc2V0LCBlcnIubG9jLmVuZC5vZmZzZXQpO1xyXG4gICAgICAgIHdhcm4oY29kZUZyYW1lID8gYCR7bWVzc2FnZX1cXG4ke2NvZGVGcmFtZX1gIDogbWVzc2FnZSk7XHJcbiAgICB9XHJcbiAgICAvLyBUaGUgd2lsZGNhcmQgaW1wb3J0IHJlc3VsdHMgaW4gYSBodWdlIG9iamVjdCB3aXRoIGV2ZXJ5IGV4cG9ydFxyXG4gICAgLy8gd2l0aCBrZXlzIHRoYXQgY2Fubm90IGJlIG1hbmdsZWQsIGFuZCBjYW4gYmUgcXVpdGUgaGVhdnkgc2l6ZS13aXNlLlxyXG4gICAgLy8gSW4gdGhlIGdsb2JhbCBidWlsZCB3ZSBrbm93IGBWdWVgIGlzIGF2YWlsYWJsZSBnbG9iYWxseSBzbyB3ZSBjYW4gYXZvaWRcclxuICAgIC8vIHRoZSB3aWxkY2FyZCBvYmplY3QuXHJcbiAgICBjb25zdCByZW5kZXIgPSAobmV3IEZ1bmN0aW9uKCdWdWUnLCBjb2RlKShydW50aW1lRG9tKSk7XHJcbiAgICByZW5kZXIuX3JjID0gdHJ1ZTtcclxuICAgIHJldHVybiAoY29tcGlsZUNhY2hlW2tleV0gPSByZW5kZXIpO1xyXG59XHJcbnJlZ2lzdGVyUnVudGltZUNvbXBpbGVyKGNvbXBpbGVUb0Z1bmN0aW9uKTtcblxuZXhwb3J0IHsgY29tcGlsZVRvRnVuY3Rpb24gYXMgY29tcGlsZSB9O1xuIl0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5166\n")},9050:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";eval('// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n "VERSION": () => (/* reexport */ VERSION),\n "after": () => (/* reexport */ after),\n "all": () => (/* reexport */ every),\n "allKeys": () => (/* reexport */ allKeys),\n "any": () => (/* reexport */ some),\n "assign": () => (/* reexport */ extendOwn),\n "before": () => (/* reexport */ before),\n "bind": () => (/* reexport */ bind),\n "bindAll": () => (/* reexport */ bindAll),\n "chain": () => (/* reexport */ chain),\n "chunk": () => (/* reexport */ chunk),\n "clone": () => (/* reexport */ clone),\n "collect": () => (/* reexport */ map),\n "compact": () => (/* reexport */ compact),\n "compose": () => (/* reexport */ compose),\n "constant": () => (/* reexport */ constant),\n "contains": () => (/* reexport */ contains),\n "countBy": () => (/* reexport */ countBy),\n "create": () => (/* reexport */ create),\n "debounce": () => (/* reexport */ debounce),\n "default": () => (/* reexport */ index_default),\n "defaults": () => (/* reexport */ defaults),\n "defer": () => (/* reexport */ defer),\n "delay": () => (/* reexport */ delay),\n "detect": () => (/* reexport */ find),\n "difference": () => (/* reexport */ difference),\n "drop": () => (/* reexport */ rest),\n "each": () => (/* reexport */ each),\n "escape": () => (/* reexport */ modules_escape),\n "every": () => (/* reexport */ every),\n "extend": () => (/* reexport */ extend),\n "extendOwn": () => (/* reexport */ extendOwn),\n "filter": () => (/* reexport */ filter),\n "find": () => (/* reexport */ find),\n "findIndex": () => (/* reexport */ findIndex),\n "findKey": () => (/* reexport */ findKey),\n "findLastIndex": () => (/* reexport */ findLastIndex),\n "findWhere": () => (/* reexport */ findWhere),\n "first": () => (/* reexport */ first),\n "flatten": () => (/* reexport */ flatten_flatten),\n "foldl": () => (/* reexport */ reduce),\n "foldr": () => (/* reexport */ reduceRight),\n "forEach": () => (/* reexport */ each),\n "functions": () => (/* reexport */ functions),\n "get": () => (/* reexport */ get),\n "groupBy": () => (/* reexport */ groupBy),\n "has": () => (/* reexport */ has_has),\n "head": () => (/* reexport */ first),\n "identity": () => (/* reexport */ identity),\n "include": () => (/* reexport */ contains),\n "includes": () => (/* reexport */ contains),\n "indexBy": () => (/* reexport */ indexBy),\n "indexOf": () => (/* reexport */ indexOf),\n "initial": () => (/* reexport */ initial),\n "inject": () => (/* reexport */ reduce),\n "intersection": () => (/* reexport */ intersection),\n "invert": () => (/* reexport */ invert),\n "invoke": () => (/* reexport */ invoke),\n "isArguments": () => (/* reexport */ modules_isArguments),\n "isArray": () => (/* reexport */ isArray),\n "isArrayBuffer": () => (/* reexport */ isArrayBuffer),\n "isBoolean": () => (/* reexport */ isBoolean),\n "isDataView": () => (/* reexport */ modules_isDataView),\n "isDate": () => (/* reexport */ isDate),\n "isElement": () => (/* reexport */ isElement),\n "isEmpty": () => (/* reexport */ isEmpty),\n "isEqual": () => (/* reexport */ isEqual),\n "isError": () => (/* reexport */ isError),\n "isFinite": () => (/* reexport */ isFinite_isFinite),\n "isFunction": () => (/* reexport */ modules_isFunction),\n "isMap": () => (/* reexport */ isMap),\n "isMatch": () => (/* reexport */ isMatch),\n "isNaN": () => (/* reexport */ isNaN_isNaN),\n "isNull": () => (/* reexport */ isNull),\n "isNumber": () => (/* reexport */ isNumber),\n "isObject": () => (/* reexport */ isObject),\n "isRegExp": () => (/* reexport */ isRegExp),\n "isSet": () => (/* reexport */ isSet),\n "isString": () => (/* reexport */ isString),\n "isSymbol": () => (/* reexport */ isSymbol),\n "isTypedArray": () => (/* reexport */ modules_isTypedArray),\n "isUndefined": () => (/* reexport */ isUndefined),\n "isWeakMap": () => (/* reexport */ isWeakMap),\n "isWeakSet": () => (/* reexport */ isWeakSet),\n "iteratee": () => (/* reexport */ iteratee),\n "keys": () => (/* reexport */ keys),\n "last": () => (/* reexport */ last),\n "lastIndexOf": () => (/* reexport */ lastIndexOf),\n "map": () => (/* reexport */ map),\n "mapObject": () => (/* reexport */ mapObject),\n "matcher": () => (/* reexport */ matcher),\n "matches": () => (/* reexport */ matcher),\n "max": () => (/* reexport */ max),\n "memoize": () => (/* reexport */ memoize),\n "methods": () => (/* reexport */ functions),\n "min": () => (/* reexport */ min),\n "mixin": () => (/* reexport */ mixin),\n "negate": () => (/* reexport */ negate),\n "noop": () => (/* reexport */ noop),\n "now": () => (/* reexport */ now),\n "object": () => (/* reexport */ object),\n "omit": () => (/* reexport */ omit),\n "once": () => (/* reexport */ once),\n "pairs": () => (/* reexport */ pairs),\n "partial": () => (/* reexport */ modules_partial),\n "partition": () => (/* reexport */ partition),\n "pick": () => (/* reexport */ pick),\n "pluck": () => (/* reexport */ pluck),\n "property": () => (/* reexport */ property),\n "propertyOf": () => (/* reexport */ propertyOf),\n "random": () => (/* reexport */ random),\n "range": () => (/* reexport */ range),\n "reduce": () => (/* reexport */ reduce),\n "reduceRight": () => (/* reexport */ reduceRight),\n "reject": () => (/* reexport */ reject),\n "rest": () => (/* reexport */ rest),\n "restArguments": () => (/* reexport */ restArguments),\n "result": () => (/* reexport */ result),\n "sample": () => (/* reexport */ sample),\n "select": () => (/* reexport */ filter),\n "shuffle": () => (/* reexport */ shuffle),\n "size": () => (/* reexport */ size),\n "some": () => (/* reexport */ some),\n "sortBy": () => (/* reexport */ sortBy),\n "sortedIndex": () => (/* reexport */ sortedIndex),\n "tail": () => (/* reexport */ rest),\n "take": () => (/* reexport */ first),\n "tap": () => (/* reexport */ tap),\n "template": () => (/* reexport */ template),\n "templateSettings": () => (/* reexport */ templateSettings),\n "throttle": () => (/* reexport */ throttle),\n "times": () => (/* reexport */ times),\n "toArray": () => (/* reexport */ toArray),\n "toPath": () => (/* reexport */ toPath),\n "transpose": () => (/* reexport */ unzip),\n "unescape": () => (/* reexport */ modules_unescape),\n "union": () => (/* reexport */ union),\n "uniq": () => (/* reexport */ uniq),\n "unique": () => (/* reexport */ uniq),\n "uniqueId": () => (/* reexport */ uniqueId),\n "unzip": () => (/* reexport */ unzip),\n "values": () => (/* reexport */ values),\n "where": () => (/* reexport */ where),\n "without": () => (/* reexport */ without),\n "wrap": () => (/* reexport */ wrap),\n "zip": () => (/* reexport */ zip)\n});\n\n// NAMESPACE OBJECT: ./node_modules/underscore/modules/index.js\nvar modules_namespaceObject = {};\n__webpack_require__.r(modules_namespaceObject);\n__webpack_require__.d(modules_namespaceObject, {\n "VERSION": () => (VERSION),\n "after": () => (after),\n "all": () => (every),\n "allKeys": () => (allKeys),\n "any": () => (some),\n "assign": () => (extendOwn),\n "before": () => (before),\n "bind": () => (bind),\n "bindAll": () => (bindAll),\n "chain": () => (chain),\n "chunk": () => (chunk),\n "clone": () => (clone),\n "collect": () => (map),\n "compact": () => (compact),\n "compose": () => (compose),\n "constant": () => (constant),\n "contains": () => (contains),\n "countBy": () => (countBy),\n "create": () => (create),\n "debounce": () => (debounce),\n "default": () => (underscore_array_methods),\n "defaults": () => (defaults),\n "defer": () => (defer),\n "delay": () => (delay),\n "detect": () => (find),\n "difference": () => (difference),\n "drop": () => (rest),\n "each": () => (each),\n "escape": () => (modules_escape),\n "every": () => (every),\n "extend": () => (extend),\n "extendOwn": () => (extendOwn),\n "filter": () => (filter),\n "find": () => (find),\n "findIndex": () => (findIndex),\n "findKey": () => (findKey),\n "findLastIndex": () => (findLastIndex),\n "findWhere": () => (findWhere),\n "first": () => (first),\n "flatten": () => (flatten_flatten),\n "foldl": () => (reduce),\n "foldr": () => (reduceRight),\n "forEach": () => (each),\n "functions": () => (functions),\n "get": () => (get),\n "groupBy": () => (groupBy),\n "has": () => (has_has),\n "head": () => (first),\n "identity": () => (identity),\n "include": () => (contains),\n "includes": () => (contains),\n "indexBy": () => (indexBy),\n "indexOf": () => (indexOf),\n "initial": () => (initial),\n "inject": () => (reduce),\n "intersection": () => (intersection),\n "invert": () => (invert),\n "invoke": () => (invoke),\n "isArguments": () => (modules_isArguments),\n "isArray": () => (isArray),\n "isArrayBuffer": () => (isArrayBuffer),\n "isBoolean": () => (isBoolean),\n "isDataView": () => (modules_isDataView),\n "isDate": () => (isDate),\n "isElement": () => (isElement),\n "isEmpty": () => (isEmpty),\n "isEqual": () => (isEqual),\n "isError": () => (isError),\n "isFinite": () => (isFinite_isFinite),\n "isFunction": () => (modules_isFunction),\n "isMap": () => (isMap),\n "isMatch": () => (isMatch),\n "isNaN": () => (isNaN_isNaN),\n "isNull": () => (isNull),\n "isNumber": () => (isNumber),\n "isObject": () => (isObject),\n "isRegExp": () => (isRegExp),\n "isSet": () => (isSet),\n "isString": () => (isString),\n "isSymbol": () => (isSymbol),\n "isTypedArray": () => (modules_isTypedArray),\n "isUndefined": () => (isUndefined),\n "isWeakMap": () => (isWeakMap),\n "isWeakSet": () => (isWeakSet),\n "iteratee": () => (iteratee),\n "keys": () => (keys),\n "last": () => (last),\n "lastIndexOf": () => (lastIndexOf),\n "map": () => (map),\n "mapObject": () => (mapObject),\n "matcher": () => (matcher),\n "matches": () => (matcher),\n "max": () => (max),\n "memoize": () => (memoize),\n "methods": () => (functions),\n "min": () => (min),\n "mixin": () => (mixin),\n "negate": () => (negate),\n "noop": () => (noop),\n "now": () => (now),\n "object": () => (object),\n "omit": () => (omit),\n "once": () => (once),\n "pairs": () => (pairs),\n "partial": () => (modules_partial),\n "partition": () => (partition),\n "pick": () => (pick),\n "pluck": () => (pluck),\n "property": () => (property),\n "propertyOf": () => (propertyOf),\n "random": () => (random),\n "range": () => (range),\n "reduce": () => (reduce),\n "reduceRight": () => (reduceRight),\n "reject": () => (reject),\n "rest": () => (rest),\n "restArguments": () => (restArguments),\n "result": () => (result),\n "sample": () => (sample),\n "select": () => (filter),\n "shuffle": () => (shuffle),\n "size": () => (size),\n "some": () => (some),\n "sortBy": () => (sortBy),\n "sortedIndex": () => (sortedIndex),\n "tail": () => (rest),\n "take": () => (first),\n "tap": () => (tap),\n "template": () => (template),\n "templateSettings": () => (templateSettings),\n "throttle": () => (throttle),\n "times": () => (times),\n "toArray": () => (toArray),\n "toPath": () => (toPath),\n "transpose": () => (unzip),\n "unescape": () => (modules_unescape),\n "union": () => (union),\n "uniq": () => (uniq),\n "unique": () => (uniq),\n "uniqueId": () => (uniqueId),\n "unzip": () => (unzip),\n "values": () => (values),\n "where": () => (where),\n "without": () => (without),\n "wrap": () => (wrap),\n "zip": () => (zip)\n});\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_setup.js\n// Current version.\nvar VERSION = \'1.13.6\';\n\n// Establish the root object, `window` (`self`) in the browser, `global`\n// on the server, or `this` in some virtual machines. We use `self`\n// instead of `window` for `WebWorker` support.\nvar root = (typeof self == \'object\' && self.self === self && self) ||\n (typeof global == \'object\' && global.global === global && global) ||\n Function(\'return this\')() ||\n {};\n\n// Save bytes in the minified (but not gzipped) version:\nvar ArrayProto = Array.prototype, ObjProto = Object.prototype;\nvar SymbolProto = typeof Symbol !== \'undefined\' ? Symbol.prototype : null;\n\n// Create quick reference variables for speed access to core prototypes.\nvar push = ArrayProto.push,\n slice = ArrayProto.slice,\n _setup_toString = ObjProto.toString,\n _setup_hasOwnProperty = ObjProto.hasOwnProperty;\n\n// Modern feature detection.\nvar supportsArrayBuffer = typeof ArrayBuffer !== \'undefined\',\n supportsDataView = typeof DataView !== \'undefined\';\n\n// All **ECMAScript 5+** native function implementations that we hope to use\n// are declared here.\nvar nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create,\n nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;\n\n// Create references to these builtin functions because we override them.\nvar _isNaN = isNaN,\n _isFinite = isFinite;\n\n// Keys in IE < 9 that won\'t be iterated by `for key in ...` and thus missed.\nvar hasEnumBug = !{toString: null}.propertyIsEnumerable(\'toString\');\nvar nonEnumerableProps = [\'valueOf\', \'isPrototypeOf\', \'toString\',\n \'propertyIsEnumerable\', \'hasOwnProperty\', \'toLocaleString\'];\n\n// The largest integer that can be represented exactly.\nvar MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/restArguments.js\n// Some functions take a variable number of arguments, or a few expected\n// arguments at the beginning and then a variable number of values to operate\n// on. This helper accumulates all remaining arguments past the function’s\n// argument length (or an explicit `startIndex`), into an array that becomes\n// the last argument. Similar to ES6’s "rest parameter".\nfunction restArguments(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isObject.js\n// Is a given variable an object?\nfunction isObject(obj) {\n var type = typeof obj;\n return type === \'function\' || (type === \'object\' && !!obj);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNull.js\n// Is a given value equal to null?\nfunction isNull(obj) {\n return obj === null;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isUndefined.js\n// Is a given variable undefined?\nfunction isUndefined(obj) {\n return obj === void 0;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isBoolean.js\n\n\n// Is a given value a boolean?\nfunction isBoolean(obj) {\n return obj === true || obj === false || _setup_toString.call(obj) === \'[object Boolean]\';\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isElement.js\n// Is a given value a DOM element?\nfunction isElement(obj) {\n return !!(obj && obj.nodeType === 1);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_tagTester.js\n\n\n// Internal function for creating a `toString`-based type tester.\nfunction tagTester(name) {\n var tag = \'[object \' + name + \']\';\n return function(obj) {\n return _setup_toString.call(obj) === tag;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isString.js\n\n\n/* harmony default export */ const isString = (tagTester(\'String\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNumber.js\n\n\n/* harmony default export */ const isNumber = (tagTester(\'Number\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isDate.js\n\n\n/* harmony default export */ const isDate = (tagTester(\'Date\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isRegExp.js\n\n\n/* harmony default export */ const isRegExp = (tagTester(\'RegExp\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isError.js\n\n\n/* harmony default export */ const isError = (tagTester(\'Error\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isSymbol.js\n\n\n/* harmony default export */ const isSymbol = (tagTester(\'Symbol\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArrayBuffer.js\n\n\n/* harmony default export */ const isArrayBuffer = (tagTester(\'ArrayBuffer\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isFunction.js\n\n\n\nvar isFunction = tagTester(\'Function\');\n\n// Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old\n// v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\nvar nodelist = root.document && root.document.childNodes;\nif ( true && typeof Int8Array != \'object\' && typeof nodelist != \'function\') {\n isFunction = function(obj) {\n return typeof obj == \'function\' || false;\n };\n}\n\n/* harmony default export */ const modules_isFunction = (isFunction);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_hasObjectTag.js\n\n\n/* harmony default export */ const _hasObjectTag = (tagTester(\'Object\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_stringTagBug.js\n\n\n\n// In IE 10 - Edge 13, `DataView` has string tag `\'[object Object]\'`.\n// In IE 11, the most common among them, this problem also applies to\n// `Map`, `WeakMap` and `Set`.\nvar hasStringTagBug = (\n supportsDataView && _hasObjectTag(new DataView(new ArrayBuffer(8)))\n ),\n isIE11 = (typeof Map !== \'undefined\' && _hasObjectTag(new Map));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isDataView.js\n\n\n\n\n\nvar isDataView = tagTester(\'DataView\');\n\n// In IE 10 - Edge 13, we need a different heuristic\n// to determine whether an object is a `DataView`.\nfunction ie10IsDataView(obj) {\n return obj != null && modules_isFunction(obj.getInt8) && isArrayBuffer(obj.buffer);\n}\n\n/* harmony default export */ const modules_isDataView = (hasStringTagBug ? ie10IsDataView : isDataView);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArray.js\n\n\n\n// Is a given value an array?\n// Delegates to ECMA5\'s native `Array.isArray`.\n/* harmony default export */ const isArray = (nativeIsArray || tagTester(\'Array\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_has.js\n\n\n// Internal function to check whether `key` is an own property name of `obj`.\nfunction has(obj, key) {\n return obj != null && _setup_hasOwnProperty.call(obj, key);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isArguments.js\n\n\n\nvar isArguments = tagTester(\'Arguments\');\n\n// Define a fallback version of the method in browsers (ahem, IE < 9), where\n// there isn\'t any inspectable "Arguments" type.\n(function() {\n if (!isArguments(arguments)) {\n isArguments = function(obj) {\n return has(obj, \'callee\');\n };\n }\n}());\n\n/* harmony default export */ const modules_isArguments = (isArguments);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isFinite.js\n\n\n\n// Is a given object a finite number?\nfunction isFinite_isFinite(obj) {\n return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isNaN.js\n\n\n\n// Is the given value `NaN`?\nfunction isNaN_isNaN(obj) {\n return isNumber(obj) && _isNaN(obj);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/constant.js\n// Predicate-generating function. Often useful outside of Underscore.\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createSizePropertyCheck.js\n\n\n// Common internal logic for `isArrayLike` and `isBufferLike`.\nfunction createSizePropertyCheck(getSizeProperty) {\n return function(collection) {\n var sizeProperty = getSizeProperty(collection);\n return typeof sizeProperty == \'number\' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;\n }\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_shallowProperty.js\n// Internal helper to generate a function to obtain property `key` from `obj`.\nfunction shallowProperty(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_getByteLength.js\n\n\n// Internal helper to obtain the `byteLength` property of an object.\n/* harmony default export */ const _getByteLength = (shallowProperty(\'byteLength\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_isBufferLike.js\n\n\n\n// Internal helper to determine whether we should spend extensive checks against\n// `ArrayBuffer` et al.\n/* harmony default export */ const _isBufferLike = (createSizePropertyCheck(_getByteLength));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isTypedArray.js\n\n\n\n\n\n// Is a given value a typed array?\nvar typedArrayPattern = /\\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\\]/;\nfunction isTypedArray(obj) {\n // `ArrayBuffer.isView` is the most future-proof, so use it when available.\n // Otherwise, fall back on the above regular expression.\n return nativeIsView ? (nativeIsView(obj) && !modules_isDataView(obj)) :\n _isBufferLike(obj) && typedArrayPattern.test(_setup_toString.call(obj));\n}\n\n/* harmony default export */ const modules_isTypedArray = (supportsArrayBuffer ? isTypedArray : constant(false));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_getLength.js\n\n\n// Internal helper to obtain the `length` property of an object.\n/* harmony default export */ const _getLength = (shallowProperty(\'length\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_collectNonEnumProps.js\n\n\n\n\n// Internal helper to create a simple lookup structure.\n// `collectNonEnumProps` used to depend on `_.contains`, but this led to\n// circular imports. `emulatedSet` is a one-off solution that only works for\n// arrays of strings.\nfunction emulatedSet(keys) {\n var hash = {};\n for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;\n return {\n contains: function(key) { return hash[key] === true; },\n push: function(key) {\n hash[key] = true;\n return keys.push(key);\n }\n };\n}\n\n// Internal helper. Checks `keys` for the presence of keys in IE < 9 that won\'t\n// be iterated by `for key in ...` and thus missed. Extends `keys` in place if\n// needed.\nfunction collectNonEnumProps(obj, keys) {\n keys = emulatedSet(keys);\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = (modules_isFunction(constructor) && constructor.prototype) || ObjProto;\n\n // Constructor is a special case.\n var prop = \'constructor\';\n if (has(obj, prop) && !keys.contains(prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {\n keys.push(prop);\n }\n }\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/keys.js\n\n\n\n\n\n// Retrieve the names of an object\'s own properties.\n// Delegates to **ECMAScript 5**\'s native `Object.keys`.\nfunction keys(obj) {\n if (!isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isEmpty.js\n\n\n\n\n\n\n// Is a given array, string, or object empty?\n// An "empty" object has no enumerable own-properties.\nfunction isEmpty(obj) {\n if (obj == null) return true;\n // Skip the more expensive `toString`-based type checks if `obj` has no\n // `.length`.\n var length = _getLength(obj);\n if (typeof length == \'number\' && (\n isArray(obj) || isString(obj) || modules_isArguments(obj)\n )) return length === 0;\n return _getLength(keys(obj)) === 0;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isMatch.js\n\n\n// Returns whether an object has a given set of `key:value` pairs.\nfunction isMatch(object, attrs) {\n var _keys = keys(attrs), length = _keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/underscore.js\n\n\n// If Underscore is called as a function, it returns a wrapped object that can\n// be used OO-style. This wrapper holds altered versions of all functions added\n// through `_.mixin`. Wrapped objects may be chained.\nfunction _(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n}\n\n_.VERSION = VERSION;\n\n// Extracts the result from a wrapped and chained object.\n_.prototype.value = function() {\n return this._wrapped;\n};\n\n// Provide unwrapping proxies for some methods used in engine operations\n// such as arithmetic and JSON stringification.\n_.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n_.prototype.toString = function() {\n return String(this._wrapped);\n};\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_toBufferView.js\n\n\n// Internal function to wrap or shallow-copy an ArrayBuffer,\n// typed array or DataView to a new view, reusing the buffer.\nfunction toBufferView(bufferSource) {\n return new Uint8Array(\n bufferSource.buffer || bufferSource,\n bufferSource.byteOffset || 0,\n _getByteLength(bufferSource)\n );\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isEqual.js\n\n\n\n\n\n\n\n\n\n\n\n// We use this string twice, so give it a name for minification.\nvar tagDataView = \'[object DataView]\';\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction eq(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren\'t identical.\n // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== \'function\' && type !== \'object\' && typeof b != \'object\') return false;\n return deepEq(a, b, aStack, bStack);\n}\n\n// Internal recursive comparison function for `_.isEqual`.\nfunction deepEq(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = _setup_toString.call(a);\n if (className !== _setup_toString.call(b)) return false;\n // Work around a bug in IE 10 - Edge 13.\n if (hasStringTagBug && className == \'[object Object]\' && modules_isDataView(a)) {\n if (!modules_isDataView(b)) return false;\n className = tagDataView;\n }\n switch (className) {\n // These types are compared by value.\n case \'[object RegExp]\':\n // RegExps are coerced to strings for comparison (Note: \'\' + /a/i === \'/a/i\')\n case \'[object String]\':\n // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is\n // equivalent to `new String("5")`.\n return \'\' + a === \'\' + b;\n case \'[object Number]\':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case \'[object Date]\':\n case \'[object Boolean]\':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case \'[object Symbol]\':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n case \'[object ArrayBuffer]\':\n case tagDataView:\n // Coerce to typed array so we can fall through.\n return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);\n }\n\n var areArrays = className === \'[object Array]\';\n if (!areArrays && modules_isTypedArray(a)) {\n var byteLength = _getByteLength(a);\n if (byteLength !== _getByteLength(b)) return false;\n if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;\n areArrays = true;\n }\n if (!areArrays) {\n if (typeof a != \'object\' || typeof b != \'object\') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(modules_isFunction(aCtor) && aCtor instanceof aCtor &&\n modules_isFunction(bCtor) && bCtor instanceof bCtor)\n && (\'constructor\' in a && \'constructor\' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It\'s done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var _keys = keys(a), key;\n length = _keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = _keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n}\n\n// Perform a deep comparison to check if two objects are equal.\nfunction isEqual(a, b) {\n return eq(a, b);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/allKeys.js\n\n\n\n\n// Retrieve all the enumerable property names of an object.\nfunction allKeys(obj) {\n if (!isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_methodFingerprint.js\n\n\n\n\n// Since the regular `Object.prototype.toString` type tests don\'t work for\n// some types in IE 11, we use a fingerprinting heuristic instead, based\n// on the methods. It\'s not great, but it\'s the best we got.\n// The fingerprint method lists are defined below.\nfunction ie11fingerprint(methods) {\n var length = _getLength(methods);\n return function(obj) {\n if (obj == null) return false;\n // `Map`, `WeakMap` and `Set` have no enumerable keys.\n var keys = allKeys(obj);\n if (_getLength(keys)) return false;\n for (var i = 0; i < length; i++) {\n if (!modules_isFunction(obj[methods[i]])) return false;\n }\n // If we are testing against `WeakMap`, we need to ensure that\n // `obj` doesn\'t have a `forEach` method in order to distinguish\n // it from a regular `Map`.\n return methods !== weakMapMethods || !modules_isFunction(obj[forEachName]);\n };\n}\n\n// In the interest of compact minification, we write\n// each string in the fingerprints only once.\nvar forEachName = \'forEach\',\n hasName = \'has\',\n commonInit = [\'clear\', \'delete\'],\n mapTail = [\'get\', hasName, \'set\'];\n\n// `Map`, `WeakMap` and `Set` each have slightly different\n// combinations of the above sublists.\nvar mapMethods = commonInit.concat(forEachName, mapTail),\n weakMapMethods = commonInit.concat(mapTail),\n setMethods = [\'add\'].concat(commonInit, forEachName, hasName);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isMap.js\n\n\n\n\n/* harmony default export */ const isMap = (isIE11 ? ie11fingerprint(mapMethods) : tagTester(\'Map\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isWeakMap.js\n\n\n\n\n/* harmony default export */ const isWeakMap = (isIE11 ? ie11fingerprint(weakMapMethods) : tagTester(\'WeakMap\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isSet.js\n\n\n\n\n/* harmony default export */ const isSet = (isIE11 ? ie11fingerprint(setMethods) : tagTester(\'Set\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/isWeakSet.js\n\n\n/* harmony default export */ const isWeakSet = (tagTester(\'WeakSet\'));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/values.js\n\n\n// Retrieve the values of an object\'s properties.\nfunction values(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[_keys[i]];\n }\n return values;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/pairs.js\n\n\n// Convert an object into a list of `[key, value]` pairs.\n// The opposite of `_.object` with one argument.\nfunction pairs(obj) {\n var _keys = keys(obj);\n var length = _keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [_keys[i], obj[_keys[i]]];\n }\n return pairs;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/invert.js\n\n\n// Invert the keys and values of an object. The values must be serializable.\nfunction invert(obj) {\n var result = {};\n var _keys = keys(obj);\n for (var i = 0, length = _keys.length; i < length; i++) {\n result[obj[_keys[i]]] = _keys[i];\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/functions.js\n\n\n// Return a sorted list of the function names available on the object.\nfunction functions(obj) {\n var names = [];\n for (var key in obj) {\n if (modules_isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createAssigner.js\n// An internal function for creating assigner functions.\nfunction createAssigner(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/extend.js\n\n\n\n// Extend a given object with all the properties in passed-in object(s).\n/* harmony default export */ const extend = (createAssigner(allKeys));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/extendOwn.js\n\n\n\n// Assigns a given object with all the own properties in the passed-in\n// object(s).\n// (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n/* harmony default export */ const extendOwn = (createAssigner(keys));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/defaults.js\n\n\n\n// Fill in a given object with default properties.\n/* harmony default export */ const defaults = (createAssigner(allKeys, true));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_baseCreate.js\n\n\n\n// Create a naked function reference for surrogate-prototype-swapping.\nfunction ctor() {\n return function(){};\n}\n\n// An internal function for creating a new object that inherits from another.\nfunction baseCreate(prototype) {\n if (!isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n var Ctor = ctor();\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/create.js\n\n\n\n// Creates an object that inherits from the given prototype object.\n// If additional properties are provided then they will be added to the\n// created object.\nfunction create(prototype, props) {\n var result = baseCreate(prototype);\n if (props) extendOwn(result, props);\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/clone.js\n\n\n\n\n// Create a (shallow-cloned) duplicate of an object.\nfunction clone(obj) {\n if (!isObject(obj)) return obj;\n return isArray(obj) ? obj.slice() : extend({}, obj);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/tap.js\n// Invokes `interceptor` with the `obj` and then returns `obj`.\n// The primary purpose of this method is to "tap into" a method chain, in\n// order to perform operations on intermediate results within the chain.\nfunction tap(obj, interceptor) {\n interceptor(obj);\n return obj;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/toPath.js\n\n\n\n// Normalize a (deep) property `path` to array.\n// Like `_.iteratee`, this function can be customized.\nfunction toPath(path) {\n return isArray(path) ? path : [path];\n}\n_.toPath = toPath;\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_toPath.js\n\n\n\n// Internal wrapper for `_.toPath` to enable minification.\n// Similar to `cb` for `_.iteratee`.\nfunction _toPath_toPath(path) {\n return _.toPath(path);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_deepGet.js\n// Internal function to obtain a nested property in `obj` along `path`.\nfunction deepGet(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/get.js\n\n\n\n\n// Get the value of the (deep) property on `path` from `object`.\n// If any property in `path` does not exist or if the value is\n// `undefined`, return `defaultValue` instead.\n// The `path` is normalized through `_.toPath`.\nfunction get(object, path, defaultValue) {\n var value = deepGet(object, _toPath_toPath(path));\n return isUndefined(value) ? defaultValue : value;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/has.js\n\n\n\n// Shortcut function for checking if an object has a given property directly on\n// itself (in other words, not on a prototype). Unlike the internal `has`\n// function, this public version can also traverse nested properties.\nfunction has_has(obj, path) {\n path = _toPath_toPath(path);\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (!has(obj, key)) return false;\n obj = obj[key];\n }\n return !!length;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/identity.js\n// Keep the identity function around for default iteratees.\nfunction identity(value) {\n return value;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/matcher.js\n\n\n\n// Returns a predicate for checking whether an object has a given set of\n// `key:value` pairs.\nfunction matcher(attrs) {\n attrs = extendOwn({}, attrs);\n return function(obj) {\n return isMatch(obj, attrs);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/property.js\n\n\n\n// Creates a function that, when passed an object, will traverse that object’s\n// properties down the given `path`, specified as an array of keys or indices.\nfunction property(path) {\n path = _toPath_toPath(path);\n return function(obj) {\n return deepGet(obj, path);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_optimizeCb.js\n// Internal function that returns an efficient (for current engines) version\n// of the passed-in callback, to be repeatedly applied in other Underscore\n// functions.\nfunction optimizeCb(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_baseIteratee.js\n\n\n\n\n\n\n\n\n// An internal function to generate callbacks that can be applied to each\n// element in a collection, returning the desired result — either `_.identity`,\n// an arbitrary callback, a property matcher, or a property accessor.\nfunction baseIteratee(value, context, argCount) {\n if (value == null) return identity;\n if (modules_isFunction(value)) return optimizeCb(value, context, argCount);\n if (isObject(value) && !isArray(value)) return matcher(value);\n return property(value);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/iteratee.js\n\n\n\n// External wrapper for our callback generator. Users may customize\n// `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n// This abstraction hides the internal-only `argCount` argument.\nfunction iteratee(value, context) {\n return baseIteratee(value, context, Infinity);\n}\n_.iteratee = iteratee;\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_cb.js\n\n\n\n\n// The function we call internally to generate a callback. It invokes\n// `_.iteratee` if overridden, otherwise `baseIteratee`.\nfunction cb(value, context, argCount) {\n if (_.iteratee !== iteratee) return _.iteratee(value, context);\n return baseIteratee(value, context, argCount);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/mapObject.js\n\n\n\n// Returns the results of applying the `iteratee` to each element of `obj`.\n// In contrast to `_.map` it returns an object.\nfunction mapObject(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = keys(obj),\n length = _keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = _keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/noop.js\n// Predicate-generating function. Often useful outside of Underscore.\nfunction noop(){}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/propertyOf.js\n\n\n\n// Generates a function for a given object that returns a given property.\nfunction propertyOf(obj) {\n if (obj == null) return noop;\n return function(path) {\n return get(obj, path);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/times.js\n\n\n// Run a function **n** times.\nfunction times(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/random.js\n// Return a random integer between `min` and `max` (inclusive).\nfunction random(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/now.js\n// A (possibly faster) way to get the current timestamp as an integer.\n/* harmony default export */ const now = (Date.now || function() {\n return new Date().getTime();\n});\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createEscaper.js\n\n\n// Internal helper to generate functions for escaping and unescaping strings\n// to/from HTML interpolation.\nfunction createEscaper(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = \'(?:\' + keys(map).join(\'|\') + \')\';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, \'g\');\n return function(string) {\n string = string == null ? \'\' : \'\' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_escapeMap.js\n// Internal list of HTML entities for escaping.\n/* harmony default export */ const _escapeMap = ({\n \'&\': \'&\',\n \'<\': \'<\',\n \'>\': \'>\',\n \'"\': \'"\',\n "\'": \''\',\n \'`\': \'`\'\n});\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/escape.js\n\n\n\n// Function for escaping strings to HTML interpolation.\n/* harmony default export */ const modules_escape = (createEscaper(_escapeMap));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_unescapeMap.js\n\n\n\n// Internal list of HTML entities for unescaping.\n/* harmony default export */ const _unescapeMap = (invert(_escapeMap));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/unescape.js\n\n\n\n// Function for unescaping strings from HTML interpolation.\n/* harmony default export */ const modules_unescape = (createEscaper(_unescapeMap));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/templateSettings.js\n\n\n// By default, Underscore uses ERB-style template delimiters. Change the\n// following template settings to use alternative delimiters.\n/* harmony default export */ const templateSettings = (_.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n});\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/template.js\n\n\n\n\n// When customizing `_.templateSettings`, if you don\'t want to define an\n// interpolation, evaluation or escaping regex, we need one that is\n// guaranteed not to match.\nvar noMatch = /(.)^/;\n\n// Certain characters need to be escaped so that they can be put into a\n// string literal.\nvar escapes = {\n "\'": "\'",\n \'\\\\\': \'\\\\\',\n \'\\r\': \'r\',\n \'\\n\': \'n\',\n \'\\u2028\': \'u2028\',\n \'\\u2029\': \'u2029\'\n};\n\nvar escapeRegExp = /\\\\|\'|\\r|\\n|\\u2028|\\u2029/g;\n\nfunction escapeChar(match) {\n return \'\\\\\' + escapes[match];\n}\n\n// In order to prevent third-party code injection through\n// `_.templateSettings.variable`, we test it against the following regular\n// expression. It is intentionally a bit more liberal than just matching valid\n// identifiers, but still prevents possible loopholes through defaults or\n// destructuring assignment.\nvar bareIdentifier = /^\\s*(\\w|\\$)+\\s*$/;\n\n// JavaScript micro-templating, similar to John Resig\'s implementation.\n// Underscore templating handles arbitrary delimiters, preserves whitespace,\n// and correctly escapes quotes within interpolated code.\n// NB: `oldSettings` only exists for backwards compatibility.\nfunction template(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join(\'|\') + \'|$\', \'g\');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = "__p+=\'";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += "\'+\\n((__t=(" + escape + "))==null?\'\':_.escape(__t))+\\n\'";\n } else if (interpolate) {\n source += "\'+\\n((__t=(" + interpolate + "))==null?\'\':__t)+\\n\'";\n } else if (evaluate) {\n source += "\';\\n" + evaluate + "\\n__p+=\'";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += "\';\\n";\n\n var argument = settings.variable;\n if (argument) {\n // Insure against third-party code injection. (CVE-2021-23358)\n if (!bareIdentifier.test(argument)) throw new Error(\n \'variable is not a bare identifier: \' + argument\n );\n } else {\n // If a variable is not specified, place data values in local scope.\n source = \'with(obj||{}){\\n\' + source + \'}\\n\';\n argument = \'obj\';\n }\n\n source = "var __t,__p=\'\',__j=Array.prototype.join," +\n "print=function(){__p+=__j.call(arguments,\'\');};\\n" +\n source + \'return __p;\\n\';\n\n var render;\n try {\n render = new Function(argument, \'_\', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n template.source = \'function(\' + argument + \'){\\n\' + source + \'}\';\n\n return template;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/result.js\n\n\n\n// Traverses the children of `obj` along `path`. If a child is a function, it\n// is invoked with its parent as context. Returns the value of the final\n// child, or `fallback` if any child is undefined.\nfunction result(obj, path, fallback) {\n path = _toPath_toPath(path);\n var length = path.length;\n if (!length) {\n return modules_isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don\'t continue iterating.\n }\n obj = modules_isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/uniqueId.js\n// Generate a unique integer id (unique within the entire client session).\n// Useful for temporary DOM ids.\nvar idCounter = 0;\nfunction uniqueId(prefix) {\n var id = ++idCounter + \'\';\n return prefix ? prefix + id : id;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/chain.js\n\n\n// Start chaining a wrapped Underscore object.\nfunction chain(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_executeBound.js\n\n\n\n// Internal function to execute `sourceFunc` bound to `context` with optional\n// `args`. Determines whether to execute a function as a constructor or as a\n// normal function.\nfunction executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/partial.js\n\n\n\n\n// Partially apply a function by creating a version that has had some of its\n// arguments pre-filled, without changing its dynamic `this` context. `_` acts\n// as a placeholder by default, allowing any combination of arguments to be\n// pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\nvar partial = restArguments(function(func, boundArgs) {\n var placeholder = partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n});\n\npartial.placeholder = _;\n/* harmony default export */ const modules_partial = (partial);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/bind.js\n\n\n\n\n// Create a function bound to a given object (assigning `this`, and arguments,\n// optionally).\n/* harmony default export */ const bind = (restArguments(function(func, context, args) {\n if (!modules_isFunction(func)) throw new TypeError(\'Bind must be called on a function\');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_isArrayLike.js\n\n\n\n// Internal helper for collection methods to determine whether a collection\n// should be iterated as an array or as an object.\n// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n/* harmony default export */ const _isArrayLike = (createSizePropertyCheck(_getLength));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_flatten.js\n\n\n\n\n\n// Internal implementation of a recursive `flatten` function.\nfunction flatten(input, depth, strict, output) {\n output = output || [];\n if (!depth && depth !== 0) {\n depth = Infinity;\n } else if (depth <= 0) {\n return output.concat(input);\n }\n var idx = output.length;\n for (var i = 0, length = _getLength(input); i < length; i++) {\n var value = input[i];\n if (_isArrayLike(value) && (isArray(value) || modules_isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (depth > 1) {\n flatten(value, depth - 1, strict, output);\n idx = output.length;\n } else {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/bindAll.js\n\n\n\n\n// Bind a number of an object\'s methods to that object. Remaining arguments\n// are the method names to be bound. Useful for ensuring that all callbacks\n// defined on an object belong to it.\n/* harmony default export */ const bindAll = (restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error(\'bindAll must be passed function names\');\n while (index--) {\n var key = keys[index];\n obj[key] = bind(obj[key], obj);\n }\n return obj;\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/memoize.js\n\n\n// Memoize an expensive function by storing its results.\nfunction memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = \'\' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/delay.js\n\n\n// Delays a function for the given number of milliseconds, and then calls\n// it with the arguments supplied.\n/* harmony default export */ const delay = (restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/defer.js\n\n\n\n\n// Defers a function, scheduling it to run after the current call stack has\n// cleared.\n/* harmony default export */ const defer = (modules_partial(delay, _, 1));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/throttle.js\n\n\n// Returns a function, that, when invoked, will only be triggered at most once\n// during a given window of time. Normally, the throttled function will run\n// as much as it can, without ever going more than once per `wait` duration;\n// but if you\'d like to disable the execution on the leading edge, pass\n// `{leading: false}`. To disable execution on the trailing edge, ditto.\nfunction throttle(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var _now = now();\n if (!previous && options.leading === false) previous = _now;\n var remaining = wait - (_now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = _now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/debounce.js\n\n\n\n// When a sequence of calls of the returned function ends, the argument\n// function is triggered. The end of a sequence is defined by the `wait`\n// parameter. If `immediate` is passed, the argument function will be\n// triggered at the beginning of the sequence instead of at the end.\nfunction debounce(func, wait, immediate) {\n var timeout, previous, args, result, context;\n\n var later = function() {\n var passed = now() - previous;\n if (wait > passed) {\n timeout = setTimeout(later, wait - passed);\n } else {\n timeout = null;\n if (!immediate) result = func.apply(context, args);\n // This check is needed because `func` can recursively invoke `debounced`.\n if (!timeout) args = context = null;\n }\n };\n\n var debounced = restArguments(function(_args) {\n context = this;\n args = _args;\n previous = now();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n if (immediate) result = func.apply(context, args);\n }\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = args = context = null;\n };\n\n return debounced;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/wrap.js\n\n\n// Returns the first function passed as an argument to the second,\n// allowing you to adjust arguments, run code before and after, and\n// conditionally execute the original function.\nfunction wrap(func, wrapper) {\n return modules_partial(wrapper, func);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/negate.js\n// Returns a negated version of the passed-in predicate.\nfunction negate(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/compose.js\n// Returns a function that is the composition of a list of functions, each\n// consuming the return value of the function that follows.\nfunction compose() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/after.js\n// Returns a function that will only be executed on and after the Nth call.\nfunction after(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/before.js\n// Returns a function that will only be executed up to (but not including) the\n// Nth call.\nfunction before(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/once.js\n\n\n\n// Returns a function that will be executed at most one time, no matter how\n// often you call it. Useful for lazy initialization.\n/* harmony default export */ const once = (modules_partial(before, 2));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/findKey.js\n\n\n\n// Returns the first key on an object that passes a truth test.\nfunction findKey(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = keys(obj), key;\n for (var i = 0, length = _keys.length; i < length; i++) {\n key = _keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createPredicateIndexFinder.js\n\n\n\n// Internal function to generate `_.findIndex` and `_.findLastIndex`.\nfunction createPredicateIndexFinder(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = _getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/findIndex.js\n\n\n// Returns the first index on an array-like that passes a truth test.\n/* harmony default export */ const findIndex = (createPredicateIndexFinder(1));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/findLastIndex.js\n\n\n// Returns the last index on an array-like that passes a truth test.\n/* harmony default export */ const findLastIndex = (createPredicateIndexFinder(-1));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/sortedIndex.js\n\n\n\n// Use a comparator function to figure out the smallest index at which\n// an object should be inserted so as to maintain order. Uses binary search.\nfunction sortedIndex(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = _getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createIndexFinder.js\n\n\n\n\n// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.\nfunction createIndexFinder(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = _getLength(array);\n if (typeof idx == \'number\') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), isNaN_isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/indexOf.js\n\n\n\n\n// Return the position of the first occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n// If the array is large and already in sort order, pass `true`\n// for **isSorted** to use binary search.\n/* harmony default export */ const indexOf = (createIndexFinder(1, findIndex, sortedIndex));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/lastIndexOf.js\n\n\n\n// Return the position of the last occurrence of an item in an array,\n// or -1 if the item is not included in the array.\n/* harmony default export */ const lastIndexOf = (createIndexFinder(-1, findLastIndex));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/find.js\n\n\n\n\n// Return the first value which passes a truth test.\nfunction find(obj, predicate, context) {\n var keyFinder = _isArrayLike(obj) ? findIndex : findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/findWhere.js\n\n\n\n// Convenience version of a common use case of `_.find`: getting the first\n// object containing specific `key:value` pairs.\nfunction findWhere(obj, attrs) {\n return find(obj, matcher(attrs));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/each.js\n\n\n\n\n// The cornerstone for collection functions, an `each`\n// implementation, aka `forEach`.\n// Handles raw objects in addition to array-likes. Treats all\n// sparse array-likes as if they were dense.\nfunction each(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (_isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var _keys = keys(obj);\n for (i = 0, length = _keys.length; i < length; i++) {\n iteratee(obj[_keys[i]], _keys[i], obj);\n }\n }\n return obj;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/map.js\n\n\n\n\n// Return the results of applying the iteratee to each element.\nfunction map(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var _keys = !_isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_createReduce.js\n\n\n\n\n// Internal helper to create a reducing function, iterating left or right.\nfunction createReduce(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var _keys = !_isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[_keys ? _keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = _keys ? _keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/reduce.js\n\n\n// **Reduce** builds up a single result from a list of values, aka `inject`,\n// or `foldl`.\n/* harmony default export */ const reduce = (createReduce(1));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/reduceRight.js\n\n\n// The right-associative version of reduce, also known as `foldr`.\n/* harmony default export */ const reduceRight = (createReduce(-1));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/filter.js\n\n\n\n// Return all the elements that pass a truth test.\nfunction filter(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/reject.js\n\n\n\n\n// Return all the elements for which a truth test fails.\nfunction reject(obj, predicate, context) {\n return filter(obj, negate(cb(predicate)), context);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/every.js\n\n\n\n\n// Determine whether all of the elements pass a truth test.\nfunction every(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !_isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/some.js\n\n\n\n\n// Determine if at least one element in the object passes a truth test.\nfunction some(obj, predicate, context) {\n predicate = cb(predicate, context);\n var _keys = !_isArrayLike(obj) && keys(obj),\n length = (_keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = _keys ? _keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/contains.js\n\n\n\n\n// Determine if the array or object contains a given item (using `===`).\nfunction contains(obj, item, fromIndex, guard) {\n if (!_isArrayLike(obj)) obj = values(obj);\n if (typeof fromIndex != \'number\' || guard) fromIndex = 0;\n return indexOf(obj, item, fromIndex) >= 0;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/invoke.js\n\n\n\n\n\n\n// Invoke a method (with arguments) on every item in a collection.\n/* harmony default export */ const invoke = (restArguments(function(obj, path, args) {\n var contextPath, func;\n if (modules_isFunction(path)) {\n func = path;\n } else {\n path = _toPath_toPath(path);\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/pluck.js\n\n\n\n// Convenience version of a common use case of `_.map`: fetching a property.\nfunction pluck(obj, key) {\n return map(obj, property(key));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/where.js\n\n\n\n// Convenience version of a common use case of `_.filter`: selecting only\n// objects containing specific `key:value` pairs.\nfunction where(obj, attrs) {\n return filter(obj, matcher(attrs));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/max.js\n\n\n\n\n\n// Return the maximum element (or element-based computation).\nfunction max(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == \'number\' && typeof obj[0] != \'object\' && obj != null)) {\n obj = _isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/min.js\n\n\n\n\n\n// Return the minimum element (or element-based computation).\nfunction min(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || (typeof iteratee == \'number\' && typeof obj[0] != \'object\' && obj != null)) {\n obj = _isArrayLike(obj) ? obj : values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || (computed === Infinity && result === Infinity)) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/toArray.js\n\n\n\n\n\n\n\n\n// Safely create a real, live array from anything iterable.\nvar reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\nfunction toArray(obj) {\n if (!obj) return [];\n if (isArray(obj)) return slice.call(obj);\n if (isString(obj)) {\n // Keep surrogate pair characters together.\n return obj.match(reStrSymbol);\n }\n if (_isArrayLike(obj)) return map(obj, identity);\n return values(obj);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/sample.js\n\n\n\n\n\n\n// Sample **n** random values from a collection using the modern version of the\n// [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n// If **n** is not specified, returns a single random element.\n// The internal `guard` argument allows it to work with `_.map`.\nfunction sample(obj, n, guard) {\n if (n == null || guard) {\n if (!_isArrayLike(obj)) obj = values(obj);\n return obj[random(obj.length - 1)];\n }\n var sample = toArray(obj);\n var length = _getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/shuffle.js\n\n\n// Shuffle a collection.\nfunction shuffle(obj) {\n return sample(obj, Infinity);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/sortBy.js\n\n\n\n\n// Sort the object\'s values by a criterion produced by an iteratee.\nfunction sortBy(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return pluck(map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), \'value\');\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_group.js\n\n\n\n// An internal function used for aggregate "group by" operations.\nfunction group(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/groupBy.js\n\n\n\n// Groups the object\'s values by a criterion. Pass either a string attribute\n// to group by, or a function that returns the criterion.\n/* harmony default export */ const groupBy = (group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/indexBy.js\n\n\n// Indexes the object\'s values by a criterion, similar to `_.groupBy`, but for\n// when you know that your index values will be unique.\n/* harmony default export */ const indexBy = (group(function(result, value, key) {\n result[key] = value;\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/countBy.js\n\n\n\n// Counts instances of an object that group by a certain criterion. Pass\n// either a string attribute to count by, or a function that returns the\n// criterion.\n/* harmony default export */ const countBy = (group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/partition.js\n\n\n// Split a collection into two arrays: one whose elements all pass the given\n// truth test, and one whose elements all do not pass the truth test.\n/* harmony default export */ const partition = (group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n}, true));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/size.js\n\n\n\n// Return the number of elements in a collection.\nfunction size(obj) {\n if (obj == null) return 0;\n return _isArrayLike(obj) ? obj.length : keys(obj).length;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_keyInObj.js\n// Internal `_.pick` helper function to determine whether `key` is an enumerable\n// property name of `obj`.\nfunction keyInObj(value, key, obj) {\n return key in obj;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/pick.js\n\n\n\n\n\n\n\n// Return a copy of the object only containing the allowed properties.\n/* harmony default export */ const pick = (restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (modules_isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/omit.js\n\n\n\n\n\n\n\n\n// Return a copy of the object without the disallowed properties.\n/* harmony default export */ const omit = (restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (modules_isFunction(iteratee)) {\n iteratee = negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !contains(keys, key);\n };\n }\n return pick(obj, iteratee, context);\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/initial.js\n\n\n// Returns everything but the last entry of the array. Especially useful on\n// the arguments object. Passing **n** will return all the values in\n// the array, excluding the last N.\nfunction initial(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/first.js\n\n\n// Get the first element of an array. Passing **n** will return the first N\n// values in the array. The **guard** check allows it to work with `_.map`.\nfunction first(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[0];\n return initial(array, array.length - n);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/rest.js\n\n\n// Returns everything but the first entry of the `array`. Especially useful on\n// the `arguments` object. Passing an **n** will return the rest N values in the\n// `array`.\nfunction rest(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/last.js\n\n\n// Get the last element of an array. Passing **n** will return the last N\n// values in the array.\nfunction last(array, n, guard) {\n if (array == null || array.length < 1) return n == null || guard ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return rest(array, Math.max(0, array.length - n));\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/compact.js\n\n\n// Trim out all falsy values from an array.\nfunction compact(array) {\n return filter(array, Boolean);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/flatten.js\n\n\n// Flatten out an array, either recursively (by default), or up to `depth`.\n// Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.\nfunction flatten_flatten(array, depth) {\n return flatten(array, depth, false);\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/difference.js\n\n\n\n\n\n// Take the difference between one array and a number of other arrays.\n// Only the elements present in just the first array will remain.\n/* harmony default export */ const difference = (restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return filter(array, function(value){\n return !contains(rest, value);\n });\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/without.js\n\n\n\n// Return a version of the array that does not contain the specified value(s).\n/* harmony default export */ const without = (restArguments(function(array, otherArrays) {\n return difference(array, otherArrays);\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/uniq.js\n\n\n\n\n\n// Produce a duplicate-free version of the array. If the array has already\n// been sorted, you have the option of using a faster algorithm.\n// The faster algorithm will not work with an iteratee if the iteratee\n// is not a one-to-one function, so providing an iteratee will disable\n// the faster algorithm.\nfunction uniq(array, isSorted, iteratee, context) {\n if (!isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = _getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/union.js\n\n\n\n\n// Produce an array that contains the union: each distinct element from all of\n// the passed-in arrays.\n/* harmony default export */ const union = (restArguments(function(arrays) {\n return uniq(flatten(arrays, true, true));\n}));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/intersection.js\n\n\n\n// Produce an array that contains every item shared between all the\n// passed-in arrays.\nfunction intersection(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = _getLength(array); i < length; i++) {\n var item = array[i];\n if (contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/unzip.js\n\n\n\n\n// Complement of zip. Unzip accepts an array of arrays and groups\n// each array\'s elements on shared indices.\nfunction unzip(array) {\n var length = (array && max(array, _getLength).length) || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = pluck(array, index);\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/zip.js\n\n\n\n// Zip together multiple lists into a single array -- elements that share\n// an index go together.\n/* harmony default export */ const zip = (restArguments(unzip));\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/object.js\n\n\n// Converts lists into objects. Pass either a single array of `[key, value]`\n// pairs, or two parallel arrays of the same length -- one of keys, and one of\n// the corresponding values. Passing by pairs is the reverse of `_.pairs`.\nfunction object(list, values) {\n var result = {};\n for (var i = 0, length = _getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/range.js\n// Generate an integer Array containing an arithmetic progression. A port of\n// the native Python `range()` function. See\n// [the Python documentation](https://docs.python.org/library/functions.html#range).\nfunction range(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/chunk.js\n\n\n// Chunk a single array into multiple arrays, each containing `count` or fewer\n// items.\nfunction chunk(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/_chainResult.js\n\n\n// Helper function to continue chaining intermediate results.\nfunction chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/mixin.js\n\n\n\n\n\n\n// Add your own custom functions to the Underscore object.\nfunction mixin(obj) {\n each(functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n}\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/underscore-array-methods.js\n\n\n\n\n\n// Add all mutator `Array` functions to the wrapper.\neach([\'pop\', \'push\', \'reverse\', \'shift\', \'sort\', \'splice\', \'unshift\'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) {\n method.apply(obj, arguments);\n if ((name === \'shift\' || name === \'splice\') && obj.length === 0) {\n delete obj[0];\n }\n }\n return chainResult(this, obj);\n };\n});\n\n// Add all accessor `Array` functions to the wrapper.\neach([\'concat\', \'join\', \'slice\'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n if (obj != null) obj = method.apply(obj, arguments);\n return chainResult(this, obj);\n };\n});\n\n/* harmony default export */ const underscore_array_methods = (_);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/index.js\n// Named Exports\n// =============\n\n// Underscore.js 1.13.6\n// https://underscorejs.org\n// (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n// Baseline setup.\n\n\n\n// Object Functions\n// ----------------\n// Our most fundamental functions operate on any JavaScript object.\n// Most functions in Underscore depend on at least one function in this section.\n\n// A group of functions that check the types of core JavaScript values.\n// These are often informally referred to as the "isType" functions.\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// Functions that treat an object as a dictionary of key-value pairs.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Utility Functions\n// -----------------\n// A bit of a grab bag: Predicate-generating functions for use with filters and\n// loops, string escaping and templating, create random numbers and unique ids,\n// and functions that facilitate Underscore\'s chaining and iteration conventions.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Function (ahem) Functions\n// -------------------------\n// These functions take a function as an argument and return a new function\n// as the result. Also known as higher-order functions.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Finders\n// -------\n// Functions that extract (the position of) a single element from an object\n// or array based on some criterion.\n\n\n\n\n\n\n\n\n\n// Collection Functions\n// --------------------\n// Functions that work on any collection of elements: either an array, or\n// an object of key-value pairs.\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// `_.pick` and `_.omit` are actually object functions, but we put\n// them here in order to create a more natural reading order in the\n// monolithic build as they depend on `_.contains`.\n\n\n\n// Array Functions\n// ---------------\n// Functions that operate on arrays (and array-likes) only, because they’re\n// expressed in terms of operations on an ordered list of values.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// OOP\n// ---\n// These modules support the "object-oriented" calling style. See also\n// `underscore.js` and `index-default.js`.\n\n\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/index-default.js\n// Default Export\n// ==============\n// In this module, we mix our bundled exports into the `_` object and export\n// the result. This is analogous to setting `module.exports = _` in CommonJS.\n// Hence, this module is also the entry point of our UMD bundle and the package\n// entry point for CommonJS and AMD users. In other words, this is (the source\n// of) the module you are interfacing with when you do any of the following:\n//\n// ```js\n// // CommonJS\n// var _ = require(\'underscore\');\n//\n// // AMD\n// define([\'underscore\'], function(_) {...});\n//\n// // UMD in the browser\n// // _ is available as a global variable\n// ```\n\n\n\n// Add all of the Underscore functions to the wrapper object.\nvar index_default_ = mixin(modules_namespaceObject);\n// Legacy Node.js API.\nindex_default_._ = index_default_;\n// Export the Underscore API.\n/* harmony default export */ const index_default = (index_default_);\n\n;// CONCATENATED MODULE: ./node_modules/underscore/modules/index-all.js\n// ESM Exports\n// ===========\n// This module is the package entry point for ES module users. In other words,\n// it is the module they are interfacing with when they import from the whole\n// package instead of from a submodule, like this:\n//\n// ```js\n// import { map } from \'underscore\';\n// ```\n//\n// The difference with `./index-default`, which is the package entry point for\n// CommonJS, AMD and UMD users, is purely technical. In ES modules, named and\n// default exports are considered to be siblings, so when you have a default\n// export, its properties are not automatically available as named exports. For\n// this reason, we re-export the named exports in addition to providing the same\n// default export as in `./index-default`.\n\n\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTA1MC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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