"/**\n * Copyright (C) 2021 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\n// adapted from https://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily\n\n// up: 38, down: 40, spacebar: 32, pageup: 33, pagedown: 34, end: 35, home: 36\nconst keys = {38: 1, 40: 1, 32: 1, 33: 1, 34: 1, 35: 1, 36: 1};\n\nfunction preventDefault(e) {\n e.preventDefault();\n}\n\nfunction preventDefaultForScrollKeys(e) {\n if (keys[e.keyCode]) {\n preventDefault(e);\n return false;\n }\n}\n\n// modern Chrome requires { passive: false } when adding event\nlet supportsPassive = false;\ntry {\n window.addEventListener('test', null, Object.defineProperty({}, 'passive', {\n get: function() { supportsPassive = true; }\n }));\n} catch (e) {}\n\nconst wheelOpt = supportsPassive ? {passive: false} : false;\nconst wheelEvent = 'onwheel' in document.createElement('div') ? 'wheel' : 'mousewheel';\n\nexport function disableScrolling() {\n window.addEventListener('DOMMouseScroll', preventDefault, false); // older FF\n window.addEventListener(wheelEvent, preventDefault, wheelOpt); // modern desktop\n window.addEventListener('touchmove', preventDefault, wheelOpt); // mobile\n window.addEventListener('keydown', preventDefaultForScrollKeys, false);\n}\n\nexport function enableScrolling() {\n window.removeEventListener('DOMMouseScroll', preventDefault, false);\n window.removeEventListener(wheelEvent, preventDefault, wheelOpt);\n window.removeEventListener('touchmove', preventDefault, wheelOpt);\n window.removeEventListener('keydown', preventDefaultForScrollKeys, false);\n}\n",
"/*!\n * Intro.js v4.2.2\n * https://introjs.com\n *\n * Copyright (C) 2012-2021 Afshin Mehrabani (@afshinmeh).\n * https://raw.githubusercontent.com/usablica/intro.js/master/license.md\n *\n * Date: Fri, 27 Aug 2021 12:07:05 GMT\n */\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.introJs = factory());\n}(this, (function () { 'use strict';\n\n function _typeof(obj) {\n\"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n /**\n * Overwrites obj1's values with obj2's and adds obj2's if non existent in obj1\n * via: http://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically\n *\n * @param obj1\n * @param obj2\n * @returns obj3 a new object based on obj1 and obj2\n */\n function mergeOptions(obj1, obj2) {\n var obj3 = {};\n var attrname;\n\n for (attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n\n for (attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n\n return obj3;\n }\n\n /**\n * Mark any object with an incrementing number\n * used for keeping track of objects\n *\n * @param Object obj Any object or DOM Element\n * @param String key\n * @return Object\n */\n var stamp = function () {\n var keys = {};\n return function stamp(obj) {\n var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"introjs-stamp\";\n // each group increments from 0\n keys[key] = keys[key] || 0; // stamp only once per object\n\n if (obj[key] === undefined) {\n // increment key for each new object\n obj[key] = keys[key]++;\n }\n\n return obj[key];\n };\n }();\n\n /**\n * Iterates arrays\n *\n * @param {Array} arr\n * @param {Function} forEachFnc\n * @param {Function} [completeFnc]\n * @return {Null}\n */\n function forEach(arr, forEachFnc, completeFnc) {\n // in case arr is an empty query selector node list\n if (arr) {\n for (var i = 0, len = arr.length; i < len; i++) {\n forEachFnc(arr[i], i);\n }\n }\n\n if (typeof completeFnc === \"function\") {\n completeFnc();\n }\n }\n\n /**\n * DOMEvent Handles all DOM events\n *\n * methods:\n *\n * on - add event handler\n * off - remove event\n */\n\n var DOMEvent = function () {\n function DOMEvent() {\n var events_key = \"introjs_event\";\n /**\n * Gets a unique ID for an event listener\n *\n * @param obj Object\n * @param type event type\n * @param listener Function\n * @param context Object\n * @return String\n */\n\n this._id = function (obj, type, listener, context) {\n return type + stamp(listener) + (context ? \"_\".concat(stamp(context)) : \"\");\n };\n /**\n * Adds event listener\n *\n * @param obj Object obj\n * @param type String\n * @param listener Function\n * @param context Object\n * @param useCapture Boolean\n * @return null\n */\n\n\n this.on = function (obj, type, listener, context, useCapture) {\n var id = this._id.apply(this, arguments);\n\n var handler = function handler(e) {\n return listener.call(context || obj, e || window.event);\n };\n\n if (\"addEventListener\" in obj) {\n obj.addEventListener(type, handler, useCapture);\n } else if (\"attachEvent\" in obj) {\n obj.attachEvent(\"on\".concat(type), handler);\n }\n\n obj[events_key] = obj[events_key] || {};\n obj[events_key][id] = handler;\n };\n /**\n * Removes event listener\n *\n * @param obj Object\n * @param type String\n * @param listener Function\n * @param context Object\n * @param useCapture Boolean\n * @return null\n */\n\n\n this.off = function (obj, type, listener, context, useCapture) {\n var id = this._id.apply(this, arguments);\n\n var handler = obj[events_key] && obj[events_key][id];\n\n if (!handler) {\n return;\n }\n\n if (\"removeEventListener\" in obj) {\n obj.removeEventListener(type, handler, useCapture);\n } else if (\"detachEvent\" in obj) {\n obj.detachEvent(\"on\".concat(type), handler);\n }\n\n obj[events_key][id] = null;\n };\n }\n\n return new DOMEvent();\n }();\n\n var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n function createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n }\n\n var check = function (it) {\n return it && it.Math == Math && it;\n };\n\n // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n var global_1 =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n var fails = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n };\n\n // Detect IE8's incomplete defineProperty implementation\n var descriptors = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;\n });\n\n var $propertyIsEnumerable = {}.propertyIsEnumerable;\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;\n\n // Nashorn ~ JDK8 bug\n var NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n // `Object.prototype.propertyIsEnumerable` method implementation\n // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\n var f$4 = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor$1(this, V);\n return !!descriptor && descriptor.enumerable;\n } : $propertyIsEnumerable;\n\n var objectPropertyIsEnumerable = {\n\tf: f$4\n };\n\n var createPropertyDescriptor = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n };\n\n var toString = {}.toString;\n\n var classofRaw = function (it) {\n return toString.call(it).slice(8, -1);\n };\n\n var split = ''.split;\n\n // fallback for non-array-like ES3 and non-enumerable old V8 strings\n var indexedObject = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !Object('z').propertyIsEnumerable(0);\n }) ? function (it) {\n return classofRaw(it) == 'String' ? split.call(it, '') : Object(it);\n } : Object;\n\n // `RequireObjectCoercible` abstract operation\n // https://tc39.es/ecma262/#sec-requireobjectcoercible\n var requireObjectCoercible = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n };\n\n // toObject with fallback for non-array-like ES3 strings\n\n\n\n var toIndexedObject = function (it) {\n return indexedObject(requireObjectCoercible(it));\n };\n\n var isObject = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n };\n\n var aFunction$1 = function (variable) {\n return typeof variable == 'function' ? variable : undefined;\n };\n\n var getBuiltIn = function (namespace, method) {\n return arguments.length < 2 ? aFunction$1(global_1[namespace]) : global_1[namespace] && global_1[namespace][method];\n };\n\n var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';\n\n var process = global_1.process;\n var Deno = global_1.Deno;\n var versions = process && process.versions || Deno && Deno.version;\n var v8 = versions && versions.v8;\n var match, version$1;\n\n if (v8) {\n match = v8.split('.');\n version$1 = match[0] < 4 ? 1 : match[0] + match[1];\n } else if (engineUserAgent) {\n match = engineUserAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = engineUserAgent.match(/Chrome\\/(\\d+)/);\n if (match) version$1 = match[1];\n }\n }\n\n var engineV8Version = version$1 && +version$1;\n\n /* eslint-disable es/no-symbol -- required for testing */\n\n\n\n // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\n var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol();\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n return !String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && engineV8Version && engineV8Version < 41;\n });\n\n /* eslint-disable es/no-symbol -- required for testing */\n\n\n var useSymbolAsUid = nativeSymbol\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n var isSymbol = useSymbolAsUid ? function (it) {\n return typeof it == 'symbol';\n } : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;\n };\n\n // `OrdinaryToPrimitive` abstract operation\n // https://tc39.es/ecma262/#sec-ordinarytoprimitive\n var ordinaryToPrimitive = function (input, pref) {\n var fn, val;\n if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;\n if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n };\n\n var setGlobal = function (key, value) {\n try {\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(global_1, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global_1[key] = value;\n } return value;\n };\n\n var SHARED = '__core-js_shared__';\n var store$1 = global_1[SHARED] || setGlobal(SHARED, {});\n\n var sharedStore = store$1;\n\n var shared = createCommonjsModule(function (module) {\n (module.exports = function (key, value) {\n return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});\n })('versions', []).push({\n version: '3.16.1',\n mode: 'global',\n copyright: '\u00a9 2021 Denis Pushkarev (zloirock.ru)'\n });\n });\n\n // `ToObject` abstract operation\n // https://tc39.es/ecma262/#sec-toobject\n var toObject = function (argument) {\n return Object(requireObjectCoercible(argument));\n };\n\n var hasOwnProperty = {}.hasOwnProperty;\n\n var has$1 = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty.call(toObject(it), key);\n };\n\n var id = 0;\n var postfix = Math.random();\n\n var uid = function (key) {\n return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);\n };\n\n var WellKnownSymbolsStore = shared('wks');\n var Symbol$1 = global_1.Symbol;\n var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;\n\n var wellKnownSymbol = function (name) {\n if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {\n if (nativeSymbol && has$1(Symbol$1, name)) {\n WellKnownSymbolsStore[name] = Symbol$1[name];\n } else {\n WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);\n }\n } return WellKnownSymbolsStore[name];\n };\n\n var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n // `ToPrimitive` abstract operation\n // https://tc39.es/ecma262/#sec-toprimitive\n var toPrimitive = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = input[TO_PRIMITIVE];\n var result;\n if (exoticToPrim !== undefined) {\n if (pref === undefined) pref = 'default';\n result = exoticToPrim.call(input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n };\n\n // `ToPropertyKey` abstract operation\n // https://tc39.es/ecma262/#sec-topropertykey\n var toPropertyKey = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : String(key);\n };\n\n var document$1 = global_1.document;\n // typeof document.createElement is 'object' in old IE\n var EXISTS = isObject(document$1) && isObject(document$1.createElement);\n\n var documentCreateElement = function (it) {\n return EXISTS ? document$1.createElement(it) : {};\n };\n\n // Thank's IE8 for his funny defineProperty\n var ie8DomDefine = !descriptors && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- requied for testing\n return Object.defineProperty(documentCreateElement('div'), 'a', {\n get: function () { return 7; }\n }).a != 7;\n });\n\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n // `Object.getOwnPropertyDescriptor` method\n // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\n var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (ie8DomDefine) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (has$1(O, P)) return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(O, P), O[P]);\n };\n\n var objectGetOwnPropertyDescriptor = {\n\tf: f$3\n };\n\n var anObject = function (it) {\n if (!isObject(it)) {\n throw TypeError(String(it) + ' is not an object');\n } return it;\n };\n\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n var $defineProperty = Object.defineProperty;\n\n // `Object.defineProperty` method\n // https://tc39.es/ecma262/#sec-object.defineproperty\n var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (ie8DomDefine) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n };\n\n var objectDefineProperty = {\n\tf: f$2\n };\n\n var createNonEnumerableProperty = descriptors ? function (object, key, value) {\n return objectDefineProperty.f(object, key, createPropertyDescriptor(1, value));\n } : function (object, key, value) {\n object[key] = value;\n return object;\n };\n\n var functionToString = Function.toString;\n\n // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper\n if (typeof sharedStore.inspectSource != 'function') {\n sharedStore.inspectSource = function (it) {\n return functionToString.call(it);\n };\n }\n\n var inspectSource = sharedStore.inspectSource;\n\n var WeakMap$1 = global_1.WeakMap;\n\n var nativeWeakMap = typeof WeakMap$1 === 'function' && /native code/.test(inspectSource(WeakMap$1));\n\n var keys = shared('keys');\n\n var sharedKey = function (key) {\n return keys[key] || (keys[key] = uid(key));\n };\n\n var hiddenKeys$1 = {};\n\n var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';\n var WeakMap = global_1.WeakMap;\n var set, get, has;\n\n var enforce = function (it) {\n return has(it) ? get(it) : set(it, {});\n };\n\n var getterFor = function (TYPE) {\n return function (it) {\n var state;\n if (!isObject(it) || (state = get(it)).type !== TYPE) {\n throw TypeError('Incompatible receiver, ' + TYPE + ' required');\n } return state;\n };\n };\n\n if (nativeWeakMap || sharedStore.state) {\n var store = sharedStore.state || (sharedStore.state = new WeakMap());\n var wmget = store.get;\n var wmhas = store.has;\n var wmset = store.set;\n set = function (it, metadata) {\n if (wmhas.call(store, it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n wmset.call(store, it, metadata);\n return metadata;\n };\n get = function (it) {\n return wmget.call(store, it) || {};\n };\n has = function (it) {\n return wmhas.call(store, it);\n };\n } else {\n var STATE = sharedKey('state');\n hiddenKeys$1[STATE] = true;\n set = function (it, metadata) {\n if (has$1(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);\n metadata.facade = it;\n createNonEnumerableProperty(it, STATE, metadata);\n return metadata;\n };\n get = function (it) {\n return has$1(it, STATE) ? it[STATE] : {};\n };\n has = function (it) {\n return has$1(it, STATE);\n };\n }\n\n var internalState = {\n set: set,\n get: get,\n has: has,\n enforce: enforce,\n getterFor: getterFor\n };\n\n var redefine = createCommonjsModule(function (module) {\n var getInternalState = internalState.get;\n var enforceInternalState = internalState.enforce;\n var TEMPLATE = String(String).split('String');\n\n (module.exports = function (O, key, value, options) {\n var unsafe = options ? !!options.unsafe : false;\n var simple = options ? !!options.enumerable : false;\n var noTargetGet = options ? !!options.noTargetGet : false;\n var state;\n if (typeof value == 'function') {\n if (typeof key == 'string' && !has$1(value, 'name')) {\n createNonEnumerableProperty(value, 'name', key);\n }\n state = enforceInternalState(value);\n if (!state.source) {\n state.source = TEMPLATE.join(typeof key == 'string' ? key : '');\n }\n }\n if (O === global_1) {\n if (simple) O[key] = value;\n else setGlobal(key, value);\n return;\n } else if (!unsafe) {\n delete O[key];\n } else if (!noTargetGet && O[key]) {\n simple = true;\n }\n if (simple) O[key] = value;\n else createNonEnumerableProperty(O, key, value);\n // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n })(Function.prototype, 'toString', function toString() {\n return typeof this == 'function' && getInternalState(this).source || inspectSource(this);\n });\n });\n\n var ceil = Math.ceil;\n var floor$2 = Math.floor;\n\n // `ToInteger` abstract operation\n // https://tc39.es/ecma262/#sec-tointeger\n var toInteger = function (argument) {\n return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor$2 : ceil)(argument);\n };\n\n var min$4 = Math.min;\n\n // `ToLength` abstract operation\n // https://tc39.es/ecma262/#sec-tolength\n var toLength = function (argument) {\n return argument > 0 ? min$4(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991\n };\n\n var max$3 = Math.max;\n var min$3 = Math.min;\n\n // Helper for a popular repeating case of the spec:\n // Let integer be ? ToInteger(index).\n // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).\n var toAbsoluteIndex = function (index, length) {\n var integer = toInteger(index);\n return integer < 0 ? max$3(integer + length, 0) : min$3(integer, length);\n };\n\n // `Array.prototype.{ indexOf, includes }` methods implementation\n var createMethod$2 = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIndexedObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare -- NaN check\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare -- NaN check\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) {\n if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n };\n\n var arrayIncludes = {\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n includes: createMethod$2(true),\n // `Array.prototype.indexOf` method\n // https://tc39.es/ecma262/#sec-array.prototype.indexof\n indexOf: createMethod$2(false)\n };\n\n var indexOf = arrayIncludes.indexOf;\n\n\n var objectKeysInternal = function (object, names) {\n var O = toIndexedObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) !has$1(hiddenKeys$1, key) && has$1(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has$1(O, key = names[i++])) {\n ~indexOf(result, key) || result.push(key);\n }\n return result;\n };\n\n // IE8- don't enum bug keys\n var enumBugKeys = [\n 'constructor',\n 'hasOwnProperty',\n 'isPrototypeOf',\n 'propertyIsEnumerable',\n 'toLocaleString',\n 'toString',\n 'valueOf'\n ];\n\n var hiddenKeys = enumBugKeys.concat('length', 'prototype');\n\n // `Object.getOwnPropertyNames` method\n // https://tc39.es/ecma262/#sec-object.getownpropertynames\n // eslint-disable-next-line es/no-object-getownpropertynames -- safe\n var f$1 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return objectKeysInternal(O, hiddenKeys);\n };\n\n var objectGetOwnPropertyNames = {\n\tf: f$1\n };\n\n // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe\n var f = Object.getOwnPropertySymbols;\n\n var objectGetOwnPropertySymbols = {\n\tf: f\n };\n\n // all object keys, includes non-enumerable and symbols\n var ownKeys = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {\n var keys = objectGetOwnPropertyNames.f(anObject(it));\n var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;\n return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;\n };\n\n var copyConstructorProperties = function (target, source) {\n var keys = ownKeys(source);\n var defineProperty = objectDefineProperty.f;\n var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!has$1(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));\n }\n };\n\n var replacement = /#|\\.prototype\\./;\n\n var isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value == POLYFILL ? true\n : value == NATIVE ? false\n : typeof detection == 'function' ? fails(detection)\n : !!detection;\n };\n\n var normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n };\n\n var data = isForced.data = {};\n var NATIVE = isForced.NATIVE = 'N';\n var POLYFILL = isForced.POLYFILL = 'P';\n\n var isForced_1 = isForced;\n\n var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;\n\n\n\n\n\n\n /*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.noTargetGet - prevent calling a getter on target\n */\n var _export = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var FORCED, target, key, targetProperty, sourceProperty, descriptor;\n if (GLOBAL) {\n target = global_1;\n } else if (STATIC) {\n target = global_1[TARGET] || setGlobal(TARGET, {});\n } else {\n target = (global_1[TARGET] || {}).prototype;\n }\n if (target) for (key in source) {\n sourceProperty = source[key];\n if (options.noTargetGet) {\n descriptor = getOwnPropertyDescriptor(target, key);\n targetProperty = descriptor && descriptor.value;\n } else targetProperty = target[key];\n FORCED = isForced_1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contained in target\n if (!FORCED && targetProperty !== undefined) {\n if (typeof sourceProperty === typeof targetProperty) continue;\n copyConstructorProperties(sourceProperty, targetProperty);\n }\n // add a flag to not completely full polyfills\n if (options.sham || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(sourceProperty, 'sham', true);\n }\n // extend global\n redefine(target, key, sourceProperty, options);\n }\n };\n\n var toString_1 = function (argument) {\n if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');\n return String(argument);\n };\n\n // `RegExp.prototype.flags` getter implementation\n // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags\n var regexpFlags = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.dotAll) result += 's';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n };\n\n // babel-minify transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError,\n var RE = function (s, f) {\n return RegExp(s, f);\n };\n\n var UNSUPPORTED_Y$2 = fails(function () {\n var re = RE('a', 'y');\n re.lastIndex = 2;\n return re.exec('abcd') != null;\n });\n\n var BROKEN_CARET = fails(function () {\n // https://bugzilla.mozilla.org/show_bug.cgi?id=773687\n var re = RE('^r', 'gy');\n re.lastIndex = 2;\n return re.exec('str') != null;\n });\n\n var regexpStickyHelpers = {\n\tUNSUPPORTED_Y: UNSUPPORTED_Y$2,\n\tBROKEN_CARET: BROKEN_CARET\n };\n\n // `Object.keys` method\n // https://tc39.es/ecma262/#sec-object.keys\n // eslint-disable-next-line es/no-object-keys -- safe\n var objectKeys = Object.keys || function keys(O) {\n return objectKeysInternal(O, enumBugKeys);\n };\n\n // `Object.defineProperties` method\n // https://tc39.es/ecma262/#sec-object.defineproperties\n // eslint-disable-next-line es/no-object-defineproperties -- safe\n var objectDefineProperties = descriptors ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = objectKeys(Properties);\n var length = keys.length;\n var index = 0;\n var key;\n while (length > index) objectDefineProperty.f(O, key = keys[index++], Properties[key]);\n return O;\n };\n\n var html = getBuiltIn('document', 'documentElement');\n\n /* global ActiveXObject -- old IE, WSH */\n\n\n\n\n\n\n\n\n var GT = '>';\n var LT = '<';\n var PROTOTYPE = 'prototype';\n var SCRIPT = 'script';\n var IE_PROTO = sharedKey('IE_PROTO');\n\n var EmptyConstructor = function () { /* empty */ };\n\n var scriptTag = function (content) {\n return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;\n };\n\n // Create object with fake `null` prototype: use ActiveX Object with cleared prototype\n var NullProtoObjectViaActiveX = function (activeXDocument) {\n activeXDocument.write(scriptTag(''));\n activeXDocument.close();\n var temp = activeXDocument.parentWindow.Object;\n activeXDocument = null; // avoid memory leak\n return temp;\n };\n\n // Create object with fake `null` prototype: use iframe Object with cleared prototype\n var NullProtoObjectViaIFrame = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = documentCreateElement('iframe');\n var JS = 'java' + SCRIPT + ':';\n var iframeDocument;\n if (iframe.style) {\n iframe.style.display = 'none';\n html.appendChild(iframe);\n // https://github.com/zloirock/core-js/issues/475\n iframe.src = String(JS);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(scriptTag('document.F=Object'));\n iframeDocument.close();\n return iframeDocument.F;\n }\n };\n\n // Check for document.domain and active x support\n // No need to use active x approach when document.domain is not set\n // see https://github.com/es-shims/es5-shim/issues/150\n // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346\n // avoid IE GC bug\n var activeXDocument;\n var NullProtoObject = function () {\n try {\n activeXDocument = new ActiveXObject('htmlfile');\n } catch (error) { /* ignore */ }\n NullProtoObject = document.domain && activeXDocument ?\n NullProtoObjectViaActiveX(activeXDocument) : // old IE\n NullProtoObjectViaIFrame() ||\n NullProtoObjectViaActiveX(activeXDocument); // WSH\n var length = enumBugKeys.length;\n while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];\n return NullProtoObject();\n };\n\n hiddenKeys$1[IE_PROTO] = true;\n\n // `Object.create` method\n // https://tc39.es/ecma262/#sec-object.create\n var objectCreate = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n EmptyConstructor[PROTOTYPE] = anObject(O);\n result = new EmptyConstructor();\n EmptyConstructor[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = NullProtoObject();\n return Properties === undefined ? result : objectDefineProperties(result, Properties);\n };\n\n var regexpUnsupportedDotAll = fails(function () {\n // babel-minify transpiles RegExp('.', 's') -> /./s and it causes SyntaxError\n var re = RegExp('.', (typeof '').charAt(0));\n return !(re.dotAll && re.exec('\\n') && re.flags === 's');\n });\n\n var regexpUnsupportedNcg = fails(function () {\n // babel-minify transpiles RegExp('.', 'g') -> /./g and it causes SyntaxError\n var re = RegExp('(?<a>b)', (typeof '').charAt(5));\n return re.exec('b').groups.a !== 'b' ||\n 'b'.replace(re, '$<a>c') !== 'bc';\n });\n\n /* eslint-disable regexp/no-assertion-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */\n /* eslint-disable regexp/no-useless-quantifier -- testing */\n\n\n\n\n\n var getInternalState = internalState.get;\n\n\n\n var nativeExec = RegExp.prototype.exec;\n var nativeReplace = shared('native-string-replace', String.prototype.replace);\n\n var patchedExec = nativeExec;\n\n var UPDATES_LAST_INDEX_WRONG = (function () {\n var re1 = /a/;\n var re2 = /b*/g;\n nativeExec.call(re1, 'a');\n nativeExec.call(re2, 'a');\n return re1.lastIndex !== 0 || re2.lastIndex !== 0;\n })();\n\n var UNSUPPORTED_Y$1 = regexpStickyHelpers.UNSUPPORTED_Y || regexpStickyHelpers.BROKEN_CARET;\n\n // nonparticipating capturing group, copied from es5-shim's String#split patch.\n var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;\n\n var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y$1 || regexpUnsupportedDotAll || regexpUnsupportedNcg;\n\n if (PATCH) {\n // eslint-disable-next-line max-statements -- TODO\n patchedExec = function exec(string) {\n var re = this;\n var state = getInternalState(re);\n var str = toString_1(string);\n var raw = state.raw;\n var result, reCopy, lastIndex, match, i, object, group;\n\n if (raw) {\n raw.lastIndex = re.lastIndex;\n result = patchedExec.call(raw, str);\n re.lastIndex = raw.lastIndex;\n return result;\n }\n\n var groups = state.groups;\n var sticky = UNSUPPORTED_Y$1 && re.sticky;\n var flags = regexpFlags.call(re);\n var source = re.source;\n var charsAdded = 0;\n var strCopy = str;\n\n if (sticky) {\n flags = flags.replace('y', '');\n if (flags.indexOf('g') === -1) {\n flags += 'g';\n }\n\n strCopy = str.slice(re.lastIndex);\n // Support anchored sticky behavior.\n if (re.lastIndex > 0 && (!re.multiline || re.multiline && str.charAt(re.lastIndex - 1) !== '\\n')) {\n source = '(?: ' + source + ')';\n strCopy = ' ' + strCopy;\n charsAdded++;\n }\n // ^(? + rx + ) is needed, in combination with some str slicing, to\n // simulate the 'y' flag.\n reCopy = new RegExp('^(?:' + source + ')', flags);\n }\n\n if (NPCG_INCLUDED) {\n reCopy = new RegExp('^' + source + '$(?!\\\\s)', flags);\n }\n if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;\n\n match = nativeExec.call(sticky ? reCopy : re, strCopy);\n\n if (sticky) {\n if (match) {\n match.input = match.input.slice(charsAdded);\n match[0] = match[0].slice(charsAdded);\n match.index = re.lastIndex;\n re.lastIndex += match[0].length;\n } else re.lastIndex = 0;\n } else if (UPDATES_LAST_INDEX_WRONG && match) {\n re.lastIndex = re.global ? match.index + match[0].length : lastIndex;\n }\n if (NPCG_INCLUDED && match && match.length > 1) {\n // Fix browsers whose `exec` methods don't consistently return `undefined`\n // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/\n nativeReplace.call(match[0], reCopy, function () {\n for (i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undefined) match[i] = undefined;\n }\n });\n }\n\n if (match && groups) {\n match.groups = object = objectCreate(null);\n for (i = 0; i < groups.length; i++) {\n group = groups[i];\n object[group[0]] = match[group[1]];\n }\n }\n\n return match;\n };\n }\n\n var regexpExec = patchedExec;\n\n // `RegExp.prototype.exec` method\n // https://tc39.es/ecma262/#sec-regexp.prototype.exec\n _export({ target: 'RegExp', proto: true, forced: /./.exec !== regexpExec }, {\n exec: regexpExec\n });\n\n // TODO: Remove from `core-js@4` since it's moved to entry points\n\n\n\n\n\n\n\n var SPECIES$4 = wellKnownSymbol('species');\n var RegExpPrototype$1 = RegExp.prototype;\n\n var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {\n var SYMBOL = wellKnownSymbol(KEY);\n\n var DELEGATES_TO_SYMBOL = !fails(function () {\n // String methods call symbol-named RegEp methods\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n });\n\n var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {\n // Symbol-named RegExp methods call .exec\n var execCalled = false;\n var re = /a/;\n\n if (KEY === 'split') {\n // We can't use real regex here since it causes deoptimization\n // and serious performance degradation in V8\n // https://github.com/zloirock/core-js/issues/306\n re = {};\n // RegExp[@@split] doesn't call the regex's exec method, but first creates\n // a new one. We need to return the patched regex when creating the new one.\n re.constructor = {};\n re.constructor[SPECIES$4] = function () { return re; };\n re.flags = '';\n re[SYMBOL] = /./[SYMBOL];\n }\n\n re.exec = function () { execCalled = true; return null; };\n\n re[SYMBOL]('');\n return !execCalled;\n });\n\n if (\n !DELEGATES_TO_SYMBOL ||\n !DELEGATES_TO_EXEC ||\n FORCED\n ) {\n var nativeRegExpMethod = /./[SYMBOL];\n var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {\n var $exec = regexp.exec;\n if ($exec === regexpExec || $exec === RegExpPrototype$1.exec) {\n if (DELEGATES_TO_SYMBOL && !forceStringMethod) {\n // The native String method already delegates to @@method (this\n // polyfilled function), leasing to infinite recursion.\n // We avoid it by directly calling the native @@method method.\n return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };\n }\n return { done: true, value: nativeMethod.call(str, regexp, arg2) };\n }\n return { done: false };\n });\n\n redefine(String.prototype, KEY, methods[0]);\n redefine(RegExpPrototype$1, SYMBOL, methods[1]);\n }\n\n if (SHAM) createNonEnumerableProperty(RegExpPrototype$1[SYMBOL], 'sham', true);\n };\n\n // `String.prototype.codePointAt` methods implementation\n var createMethod$1 = function (CONVERT_TO_STRING) {\n return function ($this, pos) {\n var S = toString_1(requireObjectCoercible($this));\n var position = toInteger(pos);\n var size = S.length;\n var first, second;\n if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;\n first = S.charCodeAt(position);\n return first < 0xD800 || first > 0xDBFF || position + 1 === size\n || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF\n ? CONVERT_TO_STRING ? S.charAt(position) : first\n : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;\n };\n };\n\n var stringMultibyte = {\n // `String.prototype.codePointAt` method\n // https://tc39.es/ecma262/#sec-string.prototype.codepointat\n codeAt: createMethod$1(false),\n // `String.prototype.at` method\n // https://github.com/mathiasbynens/String.prototype.at\n charAt: createMethod$1(true)\n };\n\n var charAt = stringMultibyte.charAt;\n\n // `AdvanceStringIndex` abstract operation\n // https://tc39.es/ecma262/#sec-advancestringindex\n var advanceStringIndex = function (S, index, unicode) {\n return index + (unicode ? charAt(S, index).length : 1);\n };\n\n // `RegExpExec` abstract operation\n // https://tc39.es/ecma262/#sec-regexpexec\n var regexpExecAbstract = function (R, S) {\n var exec = R.exec;\n if (typeof exec === 'function') {\n var result = exec.call(R, S);\n if (typeof result !== 'object') {\n throw TypeError('RegExp exec method returned something other than an Object or null');\n }\n return result;\n }\n\n if (classofRaw(R) !== 'RegExp') {\n throw TypeError('RegExp#exec called on incompatible receiver');\n }\n\n return regexpExec.call(R, S);\n };\n\n // @@match logic\n fixRegexpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = regexp == undefined ? undefined : regexp[MATCH];\n return matcher !== undefined ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString_1(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString_1(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regexpExecAbstract(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regexpExecAbstract(rx, S)) !== null) {\n var matchStr = toString_1(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n });\n\n // `IsArray` abstract operation\n // https://tc39.es/ecma262/#sec-isarray\n // eslint-disable-next-line es/no-array-isarray -- safe\n var isArray = Array.isArray || function isArray(arg) {\n return classofRaw(arg) == 'Array';\n };\n\n var createProperty = function (object, key, value) {\n var propertyKey = toPropertyKey(key);\n if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));\n else object[propertyKey] = value;\n };\n\n var SPECIES$3 = wellKnownSymbol('species');\n\n // a part of `ArraySpeciesCreate` abstract operation\n // https://tc39.es/ecma262/#sec-arrayspeciescreate\n var arraySpeciesConstructor = function (originalArray) {\n var C;\n if (isArray(originalArray)) {\n C = originalArray.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n else if (isObject(C)) {\n C = C[SPECIES$3];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n };\n\n // `ArraySpeciesCreate` abstract operation\n // https://tc39.es/ecma262/#sec-arrayspeciescreate\n var arraySpeciesCreate = function (originalArray, length) {\n return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);\n };\n\n var SPECIES$2 = wellKnownSymbol('species');\n\n var arrayMethodHasSpeciesSupport = function (METHOD_NAME) {\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/677\n return engineV8Version >= 51 || !fails(function () {\n var array = [];\n var constructor = array.constructor = {};\n constructor[SPECIES$2] = function () {\n return { foo: 1 };\n };\n return array[METHOD_NAME](Boolean).foo !== 1;\n });\n };\n\n var IS_CONCAT_SPREADABLE = wellKnownSymbol('isConcatSpreadable');\n var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;\n var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';\n\n // We can't use this feature detection in V8 since it causes\n // deoptimization and serious performance degradation\n // https://github.com/zloirock/core-js/issues/679\n var IS_CONCAT_SPREADABLE_SUPPORT = engineV8Version >= 51 || !fails(function () {\n var array = [];\n array[IS_CONCAT_SPREADABLE] = false;\n return array.concat()[0] !== array;\n });\n\n var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('concat');\n\n var isConcatSpreadable = function (O) {\n if (!isObject(O)) return false;\n var spreadable = O[IS_CONCAT_SPREADABLE];\n return spreadable !== undefined ? !!spreadable : isArray(O);\n };\n\n var FORCED$1 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;\n\n // `Array.prototype.concat` method\n // https://tc39.es/ecma262/#sec-array.prototype.concat\n // with adding support of @@isConcatSpreadable and @@species\n _export({ target: 'Array', proto: true, forced: FORCED$1 }, {\n // eslint-disable-next-line no-unused-vars -- required for `.length`\n concat: function concat(arg) {\n var O = toObject(this);\n var A = arraySpeciesCreate(O, 0);\n var n = 0;\n var i, k, length, len, E;\n for (i = -1, length = arguments.length; i < length; i++) {\n E = i === -1 ? O : arguments[i];\n if (isConcatSpreadable(E)) {\n len = toLength(E.length);\n if (n + len > MAX_SAFE_INTEGER$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n for (k = 0; k < len; k++, n++) if (k in E) createProperty(A, n, E[k]);\n } else {\n if (n >= MAX_SAFE_INTEGER$1) throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);\n createProperty(A, n++, E);\n }\n }\n A.length = n;\n return A;\n }\n });\n\n var TO_STRING_TAG$1 = wellKnownSymbol('toStringTag');\n var test$1 = {};\n\n test$1[TO_STRING_TAG$1] = 'z';\n\n var toStringTagSupport = String(test$1) === '[object z]';\n\n var TO_STRING_TAG = wellKnownSymbol('toStringTag');\n // ES3 wrong here\n var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n // fallback for IE11 Script Access Denied error\n var tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n };\n\n // getting tag from ES6+ `Object.prototype.toString`\n var classof = toStringTagSupport ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result;\n };\n\n // `Object.prototype.toString` method implementation\n // https://tc39.es/ecma262/#sec-object.prototype.tostring\n var objectToString = toStringTagSupport ? {}.toString : function toString() {\n return '[object ' + classof(this) + ']';\n };\n\n // `Object.prototype.toString` method\n // https://tc39.es/ecma262/#sec-object.prototype.tostring\n if (!toStringTagSupport) {\n redefine(Object.prototype, 'toString', objectToString, { unsafe: true });\n }\n\n var TO_STRING = 'toString';\n var RegExpPrototype = RegExp.prototype;\n var nativeToString = RegExpPrototype[TO_STRING];\n\n var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });\n // FF44- RegExp#toString has a wrong name\n var INCORRECT_NAME = nativeToString.name != TO_STRING;\n\n // `RegExp.prototype.toString` method\n // https://tc39.es/ecma262/#sec-regexp.prototype.tostring\n if (NOT_GENERIC || INCORRECT_NAME) {\n redefine(RegExp.prototype, TO_STRING, function toString() {\n var R = anObject(this);\n var p = toString_1(R.source);\n var rf = R.flags;\n var f = toString_1(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? regexpFlags.call(R) : rf);\n return '/' + p + '/' + f;\n }, { unsafe: true });\n }\n\n var MATCH$1 = wellKnownSymbol('match');\n\n // `IsRegExp` abstract operation\n // https://tc39.es/ecma262/#sec-isregexp\n var isRegexp = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classofRaw(it) == 'RegExp');\n };\n\n var aFunction = function (it) {\n if (typeof it != 'function') {\n throw TypeError(String(it) + ' is not a function');\n } return it;\n };\n\n var SPECIES$1 = wellKnownSymbol('species');\n\n // `SpeciesConstructor` abstract operation\n // https://tc39.es/ecma262/#sec-speciesconstructor\n var speciesConstructor = function (O, defaultConstructor) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES$1]) == undefined ? defaultConstructor : aFunction(S);\n };\n\n var UNSUPPORTED_Y = regexpStickyHelpers.UNSUPPORTED_Y;\n var arrayPush = [].push;\n var min$2 = Math.min;\n var MAX_UINT32 = 0xFFFFFFFF;\n\n // Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n // Weex JS has frozen built-in prototypes, so use try / catch wrapper\n var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n });\n\n // @@split logic\n fixRegexpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit;\n if (\n 'abbc'.split(/(b)*/)[1] == 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length != 4 ||\n 'ab'.split(/(?:ab)*/).length != 2 ||\n '.'.split(/(.?)(.?)/).length != 4 ||\n // eslint-disable-next-line regexp/no-assertion-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length\n ) {\n // based on es5-shim implementation, need to rework it\n internalSplit = function (separator, limit) {\n var string = toString_1(requireObjectCoercible(this));\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (separator === undefined) return [string];\n // If `separator` is not a regex, use native split\n if (!isRegexp(separator)) {\n return nativeSplit.call(string, separator, lim);\n }\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var match, lastIndex, lastLength;\n while (match = regexpExec.call(separatorCopy, string)) {\n lastIndex = separatorCopy.lastIndex;\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1));\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= lim) break;\n }\n if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop\n }\n if (lastLastIndex === string.length) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output.length > lim ? output.slice(0, lim) : output;\n };\n // Chakra, V8\n } else if ('0'.split(undefined, 0).length) {\n internalSplit = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);\n };\n } else internalSplit = nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = separator == undefined ? undefined : separator[SPLIT];\n return splitter !== undefined\n ? splitter.call(separator, O, limit)\n : internalSplit.call(toString_1(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString_1(string);\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n\n if (res.done) return res.value;\n\n var C = speciesConstructor(rx, RegExp);\n\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return regexpExecAbstract(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = regexpExecAbstract(splitter, UNSUPPORTED_Y ? S.slice(q) : S);\n var e;\n if (\n z === null ||\n (e = min$2(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n A.push(S.slice(p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n A.push(z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n A.push(S.slice(p));\n return A;\n }\n ];\n }, !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n\n /**\n * Append a class to an element\n *\n * @api private\n * @method _addClass\n * @param {Object} element\n * @param {String} className\n * @returns null\n */\n\n function addClass(element, className) {\n if (element instanceof SVGElement) {\n // svg\n var pre = element.getAttribute(\"class\") || \"\";\n\n if (!pre.match(className)) {\n // check if element doesn't already have className\n element.setAttribute(\"class\", \"\".concat(pre, \"\").concat(className));\n }\n } else {\n if (element.classList !== undefined) {\n // check for modern classList property\n var classes = className.split(\"\");\n forEach(classes, function (cls) {\n element.classList.add(cls);\n });\n } else if (!element.className.match(className)) {\n // check if element doesn't already have className\n element.className += \"\".concat(className);\n }\n }\n }\n\n /**\n * Get an element CSS property on the page\n * Thanks to JavaScript Kit: http://www.javascriptkit.com/dhtmltutors/dhtmlcascade4.shtml\n *\n * @api private\n * @method _getPropValue\n * @param {Object} element\n * @param {String} propName\n * @returns string property value\n */\n function getPropValue(element, propName) {\n var propValue = \"\";\n\n if (element.currentStyle) {\n //IE\n propValue = element.currentStyle[propName];\n } else if (document.defaultView && document.defaultView.getComputedStyle) {\n //Others\n propValue = document.defaultView.getComputedStyle(element, null).getPropertyValue(propName);\n } //Prevent exception in IE\n\n\n if (propValue && propValue.toLowerCase) {\n return propValue.toLowerCase();\n } else {\n return propValue;\n }\n }\n\n /**\n * To set the show element\n * This function set a relative (in most cases) position and changes the z-index\n *\n * @api private\n * @method _setShowElement\n * @param {Object} targetElement\n */\n\n function setShowElement(_ref) {\n var element = _ref.element;\n addClass(element, \"introjs-showElement\");\n var currentElementPosition = getPropValue(element, \"position\");\n\n if (currentElementPosition !== \"absolute\" && currentElementPosition !== \"relative\" && currentElementPosition !== \"sticky\" && currentElementPosition !== \"fixed\") {\n //change to new intro item\n addClass(element, \"introjs-relativePosition\");\n }\n }\n\n /**\n * Find the nearest scrollable parent\n * copied from https://stackoverflow.com/questions/35939886/find-first-scrollable-parent\n *\n * @param Element element\n * @return Element\n */\n function getScrollParent(element) {\n var style = window.getComputedStyle(element);\n var excludeStaticParent = style.position === \"absolute\";\n var overflowRegex = /(auto|scroll)/;\n if (style.position === \"fixed\") return document.body;\n\n for (var parent = element; parent = parent.parentElement;) {\n style = window.getComputedStyle(parent);\n\n if (excludeStaticParent && style.position === \"static\") {\n continue;\n }\n\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) return parent;\n }\n\n return document.body;\n }\n\n /**\n * scroll a scrollable element to a child element\n *\n * @param {Object} targetElement\n */\n\n function scrollParentToElement(targetElement) {\n var element = targetElement.element;\n if (!this._options.scrollToElement) return;\n var parent = getScrollParent(element);\n if (parent === document.body) return;\n parent.scrollTop = element.offsetTop - parent.offsetTop;\n }\n\n /**\n * Provides a cross-browser way to get the screen dimensions\n * via: http://stackoverflow.com/questions/5864467/internet-explorer-innerheight\n *\n * @api private\n * @method _getWinSize\n * @returns {Object} width and height attributes\n */\n function getWinSize() {\n if (window.innerWidth !== undefined) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n } else {\n var D = document.documentElement;\n return {\n width: D.clientWidth,\n height: D.clientHeight\n };\n }\n }\n\n /**\n * Check to see if the element is in the viewport or not\n * http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport\n *\n * @api private\n * @method _elementInViewport\n * @param {Object} el\n */\n function elementInViewport(el) {\n var rect = el.getBoundingClientRect();\n return rect.top >= 0 && rect.left >= 0 && rect.bottom + 80 <= window.innerHeight && // add 80 to get the text right\n rect.right <= window.innerWidth;\n }\n\n /**\n * To change the scroll of `window` after highlighting an element\n *\n * @api private\n * @param {String} scrollTo\n * @param {Object} targetElement\n * @param {Object} tooltipLayer\n */\n\n function scrollTo(scrollTo, _ref, tooltipLayer) {\n var element = _ref.element;\n if (scrollTo === \"off\") return;\n var rect;\n if (!this._options.scrollToElement) return;\n\n if (scrollTo === \"tooltip\") {\n rect = tooltipLayer.getBoundingClientRect();\n } else {\n rect = element.getBoundingClientRect();\n }\n\n if (!elementInViewport(element)) {\n var winHeight = getWinSize().height;\n var top = rect.bottom - (rect.bottom - rect.top); // TODO (afshinm): do we need scroll padding now?\n // I have changed the scroll option and now it scrolls the window to\n // the center of the target element or tooltip.\n\n if (top < 0 || element.clientHeight > winHeight) {\n window.scrollBy(0, rect.top - (winHeight / 2 - rect.height / 2) - this._options.scrollPadding); // 30px padding from edge to look nice\n //Scroll down\n } else {\n window.scrollBy(0, rect.top - (winHeight / 2 - rect.height / 2) + this._options.scrollPadding); // 30px padding from edge to look nice\n }\n }\n }\n\n /**\n * Setting anchors to behave like buttons\n *\n * @api private\n * @method _setAnchorAsButton\n */\n function setAnchorAsButton(anchor) {\n anchor.setAttribute(\"role\", \"button\");\n anchor.tabIndex = 0;\n }\n\n // eslint-disable-next-line es/no-object-assign -- safe\n var $assign = Object.assign;\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n var defineProperty = Object.defineProperty;\n\n // `Object.assign` method\n // https://tc39.es/ecma262/#sec-object.assign\n var objectAssign = !$assign || fails(function () {\n // should have correct order of operations (Edge bug)\n if (descriptors && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {\n enumerable: true,\n get: function () {\n defineProperty(this, 'b', {\n value: 3,\n enumerable: false\n });\n }\n }), { b: 2 })).b !== 1) return true;\n // should work with symbols and should have deterministic property order (V8 bug)\n var A = {};\n var B = {};\n // eslint-disable-next-line es/no-symbol -- safe\n var symbol = Symbol();\n var alphabet = 'abcdefghijklmnopqrst';\n A[symbol] = 7;\n alphabet.split('').forEach(function (chr) { B[chr] = chr; });\n return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;\n }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`\n var T = toObject(target);\n var argumentsLength = arguments.length;\n var index = 1;\n var getOwnPropertySymbols = objectGetOwnPropertySymbols.f;\n var propertyIsEnumerable = objectPropertyIsEnumerable.f;\n while (argumentsLength > index) {\n var S = indexedObject(arguments[index++]);\n var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!descriptors || propertyIsEnumerable.call(S, key)) T[key] = S[key];\n }\n } return T;\n } : $assign;\n\n // `Object.assign` method\n // https://tc39.es/ecma262/#sec-object.assign\n // eslint-disable-next-line es/no-object-assign -- required for testing\n _export({ target: 'Object', stat: true, forced: Object.assign !== objectAssign }, {\n assign: objectAssign\n });\n\n /**\n * Checks to see if target element (or parents) position is fixed or not\n *\n * @api private\n * @method _isFixed\n * @param {Object} element\n * @returns Boolean\n */\n\n function isFixed(element) {\n var p = element.parentNode;\n\n if (!p || p.nodeName === \"HTML\") {\n return false;\n }\n\n if (getPropValue(element, \"position\") === \"fixed\") {\n return true;\n }\n\n return isFixed(p);\n }\n\n /**\n * Get an element position on the page relative to another element (or body)\n * Thanks to `meouw`: http://stackoverflow.com/a/442474/375966\n *\n * @api private\n * @method getOffset\n * @param {Object} element\n * @param {Object} relativeEl\n * @returns Element's position info\n */\n\n function getOffset(element, relativeEl) {\n var body = document.body;\n var docEl = document.documentElement;\n var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop;\n var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft;\n relativeEl = relativeEl || body;\n var x = element.getBoundingClientRect();\n var xr = relativeEl.getBoundingClientRect();\n var relativeElPosition = getPropValue(relativeEl, \"position\");\n var obj = {\n width: x.width,\n height: x.height\n };\n\n if (relativeEl.tagName.toLowerCase() !== \"body\" && relativeElPosition === \"relative\" || relativeElPosition === \"sticky\") {\n // when the container of our target element is _not_ body and has either \"relative\" or \"sticky\" position, we should not\n // consider the scroll position but we need to include the relative x/y of the container element\n return Object.assign(obj, {\n top: x.top - xr.top,\n left: x.left - xr.left\n });\n } else {\n if (isFixed(element)) {\n return Object.assign(obj, {\n top: x.top,\n left: x.left\n });\n } else {\n return Object.assign(obj, {\n top: x.top + scrollTop,\n left: x.left + scrollLeft\n });\n }\n }\n }\n\n var floor$1 = Math.floor;\n var replace = ''.replace;\n var SUBSTITUTION_SYMBOLS = /\\$([$&'`]|\\d{1,2}|<[^>]*>)/g;\n var SUBSTITUTION_SYMBOLS_NO_NAMED = /\\$([$&'`]|\\d{1,2})/g;\n\n // `GetSubstitution` abstract operation\n // https://tc39.es/ecma262/#sec-getsubstitution\n var getSubstitution = function (matched, str, position, captures, namedCaptures, replacement) {\n var tailPos = position + matched.length;\n var m = captures.length;\n var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;\n if (namedCaptures !== undefined) {\n namedCaptures = toObject(namedCaptures);\n symbols = SUBSTITUTION_SYMBOLS;\n }\n return replace.call(replacement, symbols, function (match, ch) {\n var capture;\n switch (ch.charAt(0)) {\n case '$': return '$';\n case '&': return matched;\n case '`': return str.slice(0, position);\n case \"'\": return str.slice(tailPos);\n case '<':\n capture = namedCaptures[ch.slice(1, -1)];\n break;\n default: // \\d\\d?\n var n = +ch;\n if (n === 0) return match;\n if (n > m) {\n var f = floor$1(n / 10);\n if (f === 0) return match;\n if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);\n return match;\n }\n capture = captures[n - 1];\n }\n return capture === undefined ? '' : capture;\n });\n };\n\n var REPLACE = wellKnownSymbol('replace');\n var max$2 = Math.max;\n var min$1 = Math.min;\n\n var maybeToString = function (it) {\n return it === undefined ? it : String(it);\n };\n\n // IE <= 11 replaces $0 with the whole match, as if it was $&\n // https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0\n var REPLACE_KEEPS_$0 = (function () {\n // eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing\n return 'a'.replace(/./, '$0') === '$0';\n })();\n\n // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string\n var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {\n if (/./[REPLACE]) {\n return /./[REPLACE]('a', '$0') === '';\n }\n return false;\n })();\n\n var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {\n var re = /./;\n re.exec = function () {\n var result = [];\n result.groups = { a: '7' };\n return result;\n };\n return ''.replace(re, '$<a>') !== '7';\n });\n\n // @@replace logic\n fixRegexpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {\n var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';\n\n return [\n // `String.prototype.replace` method\n // https://tc39.es/ecma262/#sec-string.prototype.replace\n function replace(searchValue, replaceValue) {\n var O = requireObjectCoercible(this);\n var replacer = searchValue == undefined ? undefined : searchValue[REPLACE];\n return replacer !== undefined\n ? replacer.call(searchValue, O, replaceValue)\n : nativeReplace.call(toString_1(O), searchValue, replaceValue);\n },\n // `RegExp.prototype[@@replace]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace\n function (string, replaceValue) {\n var rx = anObject(this);\n var S = toString_1(string);\n\n if (\n typeof replaceValue === 'string' &&\n replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1 &&\n replaceValue.indexOf('$<') === -1\n ) {\n var res = maybeCallNative(nativeReplace, rx, S, replaceValue);\n if (res.done) return res.value;\n }\n\n var functionalReplace = typeof replaceValue === 'function';\n if (!functionalReplace) replaceValue = toString_1(replaceValue);\n\n var global = rx.global;\n if (global) {\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n }\n var results = [];\n while (true) {\n var result = regexpExecAbstract(rx, S);\n if (result === null) break;\n\n results.push(result);\n if (!global) break;\n\n var matchStr = toString_1(result[0]);\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n }\n\n var accumulatedResult = '';\n var nextSourcePosition = 0;\n for (var i = 0; i < results.length; i++) {\n result = results[i];\n\n var matched = toString_1(result[0]);\n var position = max$2(min$1(toInteger(result.index), S.length), 0);\n var captures = [];\n // NOTE: This is equivalent to\n // captures = result.slice(1).map(maybeToString)\n // but for some reason `nativeSlice.call(result, 1, result.length)` (called in\n // the slice polyfill when slicing native arrays) \"doesn't work\" in safari 9 and\n // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.\n for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));\n var namedCaptures = result.groups;\n if (functionalReplace) {\n var replacerArgs = [matched].concat(captures, position, S);\n if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);\n var replacement = toString_1(replaceValue.apply(undefined, replacerArgs));\n } else {\n replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);\n }\n if (position >= nextSourcePosition) {\n accumulatedResult += S.slice(nextSourcePosition, position) + replacement;\n nextSourcePosition = position + matched.length;\n }\n }\n return accumulatedResult + S.slice(nextSourcePosition);\n }\n ];\n }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);\n\n /**\n * Remove a class from an element\n *\n * @api private\n * @method _removeClass\n * @param {Object} element\n * @param {RegExp|String} classNameRegex can be regex or string\n * @returns null\n */\n function removeClass(element, classNameRegex) {\n if (element instanceof SVGElement) {\n var pre = element.getAttribute(\"class\") || \"\";\n element.setAttribute(\"class\", pre.replace(classNameRegex, \"\").replace(/^\\s+|\\s+$/g, \"\"));\n } else {\n element.className = element.className.replace(classNameRegex, \"\").replace(/^\\s+|\\s+$/g, \"\");\n }\n }\n\n /**\n * Sets the style of an DOM element\n *\n * @param {Object} element\n * @param {Object|string} style\n * @return null\n */\n function setStyle(element, style) {\n var cssText = \"\";\n\n if (element.style.cssText) {\n cssText += element.style.cssText;\n }\n\n if (typeof style === \"string\") {\n cssText += style;\n } else {\n for (var rule in style) {\n cssText += \"\".concat(rule, \":\").concat(style[rule], \";\");\n }\n }\n\n element.style.cssText = cssText;\n }\n\n /**\n * Update the position of the helper layer on the screen\n *\n * @api private\n * @method _setHelperLayerPosition\n * @param {Object} helperLayer\n */\n\n function setHelperLayerPosition(helperLayer) {\n if (helperLayer) {\n //prevent error when `this._currentStep` in undefined\n if (!this._introItems[this._currentStep]) return;\n var currentElement = this._introItems[this._currentStep];\n var elementPosition = getOffset(currentElement.element, this._targetElement);\n var widthHeightPadding = this._options.helperElementPadding; // If the target element is fixed, the tooltip should be fixed as well.\n // Otherwise, remove a fixed class that may be left over from the previous\n // step.\n\n if (isFixed(currentElement.element)) {\n addClass(helperLayer, \"introjs-fixedTooltip\");\n } else {\n removeClass(helperLayer, \"introjs-fixedTooltip\");\n }\n\n if (currentElement.position === \"floating\") {\n widthHeightPadding = 0;\n } //set new position to helper layer\n\n\n setStyle(helperLayer, {\n width: \"\".concat(elementPosition.width + widthHeightPadding, \"px\"),\n height: \"\".concat(elementPosition.height + widthHeightPadding, \"px\"),\n top: \"\".concat(elementPosition.top - widthHeightPadding / 2, \"px\"),\n left: \"\".concat(elementPosition.left - widthHeightPadding / 2, \"px\")\n });\n }\n }\n\n var UNSCOPABLES = wellKnownSymbol('unscopables');\n var ArrayPrototype = Array.prototype;\n\n // Array.prototype[@@unscopables]\n // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\n if (ArrayPrototype[UNSCOPABLES] == undefined) {\n objectDefineProperty.f(ArrayPrototype, UNSCOPABLES, {\n configurable: true,\n value: objectCreate(null)\n });\n }\n\n // add a key to Array.prototype[@@unscopables]\n var addToUnscopables = function (key) {\n ArrayPrototype[UNSCOPABLES][key] = true;\n };\n\n var $includes = arrayIncludes.includes;\n\n\n // `Array.prototype.includes` method\n // https://tc39.es/ecma262/#sec-array.prototype.includes\n _export({ target: 'Array', proto: true }, {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n\n // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\n addToUnscopables('includes');\n\n var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport('slice');\n\n var SPECIES = wellKnownSymbol('species');\n var nativeSlice = [].slice;\n var max$1 = Math.max;\n\n // `Array.prototype.slice` method\n // https://tc39.es/ecma262/#sec-array.prototype.slice\n // fallback for not array-like ES3 strings and DOM objects\n _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {\n slice: function slice(start, end) {\n var O = toIndexedObject(this);\n var length = toLength(O.length);\n var k = toAbsoluteIndex(start, length);\n var fin = toAbsoluteIndex(end === undefined ? length : end, length);\n // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible\n var Constructor, result, n;\n if (isArray(O)) {\n Constructor = O.constructor;\n // cross-realm fallback\n if (typeof Constructor == 'function' && (Constructor === Array || isArray(Constructor.prototype))) {\n Constructor = undefined;\n } else if (isObject(Constructor)) {\n Constructor = Constructor[SPECIES];\n if (Constructor === null) Constructor = undefined;\n }\n if (Constructor === Array || Constructor === undefined) {\n return nativeSlice.call(O, k, fin);\n }\n }\n result = new (Constructor === undefined ? Array : Constructor)(max$1(fin - k, 0));\n for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);\n result.length = n;\n return result;\n }\n });\n\n var notARegexp = function (it) {\n if (isRegexp(it)) {\n throw TypeError(\"The method doesn't accept regular expressions\");\n } return it;\n };\n\n var MATCH = wellKnownSymbol('match');\n\n var correctIsRegexpLogic = function (METHOD_NAME) {\n var regexp = /./;\n try {\n '/./'[METHOD_NAME](regexp);\n } catch (error1) {\n try {\n regexp[MATCH] = false;\n return '/./'[METHOD_NAME](regexp);\n } catch (error2) { /* empty */ }\n } return false;\n };\n\n // `String.prototype.includes` method\n // https://tc39.es/ecma262/#sec-string.prototype.includes\n _export({ target: 'String', proto: true, forced: !correctIsRegexpLogic('includes') }, {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~toString_1(requireObjectCoercible(this))\n .indexOf(toString_1(notARegexp(searchString)), arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n\n var arrayMethodIsStrict = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing\n method.call(null, argument || function () { throw 1; }, 1);\n });\n };\n\n var nativeJoin = [].join;\n\n var ES3_STRINGS = indexedObject != Object;\n var STRICT_METHOD$1 = arrayMethodIsStrict('join', ',');\n\n // `Array.prototype.join` method\n // https://tc39.es/ecma262/#sec-array.prototype.join\n _export({ target: 'Array', proto: true, forced: ES3_STRINGS || !STRICT_METHOD$1 }, {\n join: function join(separator) {\n return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator);\n }\n });\n\n // optional / simple context binding\n var functionBindContext = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 0: return function () {\n return fn.call(that);\n };\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n };\n\n var push = [].push;\n\n // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation\n var createMethod = function (TYPE) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var IS_FILTER_REJECT = TYPE == 7;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n return function ($this, callbackfn, that, specificCreate) {\n var O = toObject($this);\n var self = indexedObject(O);\n var boundFunction = functionBindContext(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var create = specificCreate || arraySpeciesCreate;\n var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;\n var value, result;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n value = self[index];\n result = boundFunction(value, index, O);\n if (TYPE) {\n if (IS_MAP) target[index] = result; // map\n else if (result) switch (TYPE) {\n case 3: return true; // some\n case 5: return value; // find\n case 6: return index; // findIndex\n case 2: push.call(target, value); // filter\n } else switch (TYPE) {\n case 4: return false; // every\n case 7: push.call(target, value); // filterReject\n }\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;\n };\n };\n\n var arrayIteration = {\n // `Array.prototype.forEach` method\n // https://tc39.es/ecma262/#sec-array.prototype.foreach\n forEach: createMethod(0),\n // `Array.prototype.map` method\n // https://tc39.es/ecma262/#sec-array.prototype.map\n map: createMethod(1),\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n filter: createMethod(2),\n // `Array.prototype.some` method\n // https://tc39.es/ecma262/#sec-array.prototype.some\n some: createMethod(3),\n // `Array.prototype.every` method\n // https://tc39.es/ecma262/#sec-array.prototype.every\n every: createMethod(4),\n // `Array.prototype.find` method\n // https://tc39.es/ecma262/#sec-array.prototype.find\n find: createMethod(5),\n // `Array.prototype.findIndex` method\n // https://tc39.es/ecma262/#sec-array.prototype.findIndex\n findIndex: createMethod(6),\n // `Array.prototype.filterReject` method\n // https://github.com/tc39/proposal-array-filtering\n filterReject: createMethod(7)\n };\n\n var $filter = arrayIteration.filter;\n\n\n var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport('filter');\n\n // `Array.prototype.filter` method\n // https://tc39.es/ecma262/#sec-array.prototype.filter\n // with adding support of @@species\n _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n });\n\n /**\n * Set tooltip left so it doesn't go off the right side of the window\n *\n * @return boolean true, if tooltipLayerStyleLeft is ok. false, otherwise.\n */\n function checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer) {\n if (targetOffset.left + tooltipLayerStyleLeft + tooltipOffset.width > windowSize.width) {\n // off the right side of the window\n tooltipLayer.style.left = \"\".concat(windowSize.width - tooltipOffset.width - targetOffset.left, \"px\");\n return false;\n }\n\n tooltipLayer.style.left = \"\".concat(tooltipLayerStyleLeft, \"px\");\n return true;\n }\n\n /**\n * Set tooltip right so it doesn't go off the left side of the window\n *\n * @return boolean true, if tooltipLayerStyleRight is ok. false, otherwise.\n */\n function checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer) {\n if (targetOffset.left + targetOffset.width - tooltipLayerStyleRight - tooltipOffset.width < 0) {\n // off the left side of the window\n tooltipLayer.style.left = \"\".concat(-targetOffset.left, \"px\");\n return false;\n }\n\n tooltipLayer.style.right = \"\".concat(tooltipLayerStyleRight, \"px\");\n return true;\n }\n\n var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');\n\n var max = Math.max;\n var min = Math.min;\n var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;\n var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded';\n\n // `Array.prototype.splice` method\n // https://tc39.es/ecma262/#sec-array.prototype.splice\n // with adding support of @@species\n _export({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {\n splice: function splice(start, deleteCount /* , ...items */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var actualStart = toAbsoluteIndex(start, len);\n var argumentsLength = arguments.length;\n var insertCount, actualDeleteCount, A, k, from, to;\n if (argumentsLength === 0) {\n insertCount = actualDeleteCount = 0;\n } else if (argumentsLength === 1) {\n insertCount = 0;\n actualDeleteCount = len - actualStart;\n } else {\n insertCount = argumentsLength - 2;\n actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);\n }\n if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {\n throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);\n }\n A = arraySpeciesCreate(O, actualDeleteCount);\n for (k = 0; k < actualDeleteCount; k++) {\n from = actualStart + k;\n if (from in O) createProperty(A, k, O[from]);\n }\n A.length = actualDeleteCount;\n if (insertCount < actualDeleteCount) {\n for (k = actualStart; k < len - actualDeleteCount; k++) {\n from = k + actualDeleteCount;\n to = k + insertCount;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];\n } else if (insertCount > actualDeleteCount) {\n for (k = len - actualDeleteCount; k > actualStart; k--) {\n from = k + actualDeleteCount - 1;\n to = k + insertCount - 1;\n if (from in O) O[to] = O[from];\n else delete O[to];\n }\n }\n for (k = 0; k < insertCount; k++) {\n O[k + actualStart] = arguments[k + 2];\n }\n O.length = len - actualDeleteCount + insertCount;\n return A;\n }\n });\n\n /**\n * Remove an entry from a string array if it's there, does nothing if it isn't there.\n *\n * @param {Array} stringArray\n * @param {String} stringToRemove\n */\n function removeEntry(stringArray, stringToRemove) {\n if (stringArray.includes(stringToRemove)) {\n stringArray.splice(stringArray.indexOf(stringToRemove), 1);\n }\n }\n\n /**\n * auto-determine alignment\n * @param {Integer} offsetLeft\n * @param {Integer} tooltipWidth\n * @param {Object} windowSize\n * @param {String} desiredAlignment\n * @return {String} calculatedAlignment\n */\n\n function _determineAutoAlignment(offsetLeft, tooltipWidth, _ref, desiredAlignment) {\n var width = _ref.width;\n var halfTooltipWidth = tooltipWidth / 2;\n var winWidth = Math.min(width, window.screen.width);\n var possibleAlignments = [\"-left-aligned\", \"-middle-aligned\", \"-right-aligned\"];\n var calculatedAlignment = \"\"; // valid left must be at least a tooltipWidth\n // away from right side\n\n if (winWidth - offsetLeft < tooltipWidth) {\n removeEntry(possibleAlignments, \"-left-aligned\");\n } // valid middle must be at least half\n // width away from both sides\n\n\n if (offsetLeft < halfTooltipWidth || winWidth - offsetLeft < halfTooltipWidth) {\n removeEntry(possibleAlignments, \"-middle-aligned\");\n } // valid right must be at least a tooltipWidth\n // width away from left side\n\n\n if (offsetLeft < tooltipWidth) {\n removeEntry(possibleAlignments, \"-right-aligned\");\n }\n\n if (possibleAlignments.length) {\n if (possibleAlignments.includes(desiredAlignment)) {\n // the desired alignment is valid\n calculatedAlignment = desiredAlignment;\n } else {\n // pick the first valid position, in order\n calculatedAlignment = possibleAlignments[0];\n }\n } else {\n // if screen width is too small\n // for ANY alignment, middle is\n // probably the best for visibility\n calculatedAlignment = \"-middle-aligned\";\n }\n\n return calculatedAlignment;\n }\n /**\n * Determines the position of the tooltip based on the position precedence and availability\n * of screen space.\n *\n * @param {Object} targetElement\n * @param {Object} tooltipLayer\n * @param {String} desiredTooltipPosition\n * @return {String} calculatedPosition\n */\n\n\n function _determineAutoPosition(targetElement, tooltipLayer, desiredTooltipPosition) {\n // Take a clone of position precedence. These will be the available\n var possiblePositions = this._options.positionPrecedence.slice();\n\n var windowSize = getWinSize();\n var tooltipHeight = getOffset(tooltipLayer).height + 10;\n var tooltipWidth = getOffset(tooltipLayer).width + 20;\n var targetElementRect = targetElement.getBoundingClientRect(); // If we check all the possible areas, and there are no valid places for the tooltip, the element\n // must take up most of the screen real estate. Show the tooltip floating in the middle of the screen.\n\n var calculatedPosition = \"floating\";\n /*\n * auto determine position\n */\n // Check for space below\n\n if (targetElementRect.bottom + tooltipHeight > windowSize.height) {\n removeEntry(possiblePositions, \"bottom\");\n } // Check for space above\n\n\n if (targetElementRect.top - tooltipHeight < 0) {\n removeEntry(possiblePositions, \"top\");\n } // Check for space to the right\n\n\n if (targetElementRect.right + tooltipWidth > windowSize.width) {\n removeEntry(possiblePositions, \"right\");\n } // Check for space to the left\n\n\n if (targetElementRect.left - tooltipWidth < 0) {\n removeEntry(possiblePositions, \"left\");\n } // @var {String} ex: 'right-aligned'\n\n\n var desiredAlignment = function (pos) {\n var hyphenIndex = pos.indexOf(\"-\");\n\n if (hyphenIndex !== -1) {\n // has alignment\n return pos.substr(hyphenIndex);\n }\n\n return \"\";\n }(desiredTooltipPosition || \"\"); // strip alignment from position\n\n\n if (desiredTooltipPosition) {\n // ex: \"bottom-right-aligned\"\n // should return 'bottom'\n desiredTooltipPosition = desiredTooltipPosition.split(\"-\")[0];\n }\n\n if (possiblePositions.length) {\n if (possiblePositions.includes(desiredTooltipPosition)) {\n // If the requested position is in the list, choose that\n calculatedPosition = desiredTooltipPosition;\n } else {\n // Pick the first valid position, in order\n calculatedPosition = possiblePositions[0];\n }\n } // only top and bottom positions have optional alignments\n\n\n if ([\"top\", \"bottom\"].includes(calculatedPosition)) {\n calculatedPosition += _determineAutoAlignment(targetElementRect.left, tooltipWidth, windowSize, desiredAlignment);\n }\n\n return calculatedPosition;\n }\n /**\n * Render tooltip box in the page\n *\n * @api private\n * @method placeTooltip\n * @param {HTMLElement} targetElement\n * @param {HTMLElement} tooltipLayer\n * @param {HTMLElement} arrowLayer\n * @param {Boolean} hintMode\n */\n\n\n function placeTooltip(targetElement, tooltipLayer, arrowLayer, hintMode) {\n var tooltipCssClass = \"\";\n var currentStepObj;\n var tooltipOffset;\n var targetOffset;\n var windowSize;\n var currentTooltipPosition;\n hintMode = hintMode || false; //reset the old style\n\n tooltipLayer.style.top = null;\n tooltipLayer.style.right = null;\n tooltipLayer.style.bottom = null;\n tooltipLayer.style.left = null;\n tooltipLayer.style.marginLeft = null;\n tooltipLayer.style.marginTop = null;\n arrowLayer.style.display = \"inherit\"; //prevent error when `this._currentStep` is undefined\n\n if (!this._introItems[this._currentStep]) return; //if we have a custom css class for each step\n\n currentStepObj = this._introItems[this._currentStep];\n\n if (typeof currentStepObj.tooltipClass === \"string\") {\n tooltipCssClass = currentStepObj.tooltipClass;\n } else {\n tooltipCssClass = this._options.tooltipClass;\n }\n\n tooltipLayer.className = [\"introjs-tooltip\", tooltipCssClass].filter(Boolean).join(\"\");\n tooltipLayer.setAttribute(\"role\", \"dialog\");\n currentTooltipPosition = this._introItems[this._currentStep].position; // Floating is always valid, no point in calculating\n\n if (currentTooltipPosition !== \"floating\" && this._options.autoPosition) {\n currentTooltipPosition = _determineAutoPosition.call(this, targetElement, tooltipLayer, currentTooltipPosition);\n }\n\n var tooltipLayerStyleLeft;\n targetOffset = getOffset(targetElement);\n tooltipOffset = getOffset(tooltipLayer);\n windowSize = getWinSize();\n addClass(tooltipLayer, \"introjs-\".concat(currentTooltipPosition));\n\n switch (currentTooltipPosition) {\n case \"top-right-aligned\":\n arrowLayer.className = \"introjs-arrow bottom-right\";\n var tooltipLayerStyleRight = 0;\n checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer);\n tooltipLayer.style.bottom = \"\".concat(targetOffset.height + 20, \"px\");\n break;\n\n case \"top-middle-aligned\":\n arrowLayer.className = \"introjs-arrow bottom-middle\";\n var tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipOffset.width / 2; // a fix for middle aligned hints\n\n if (hintMode) {\n tooltipLayerStyleLeftRight += 5;\n }\n\n if (checkLeft(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, tooltipLayer)) {\n tooltipLayer.style.right = null;\n checkRight(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, windowSize, tooltipLayer);\n }\n\n tooltipLayer.style.bottom = \"\".concat(targetOffset.height + 20, \"px\");\n break;\n\n case \"top-left-aligned\": // top-left-aligned is the same as the default top\n\n case \"top\":\n arrowLayer.className = \"introjs-arrow bottom\";\n tooltipLayerStyleLeft = hintMode ? 0 : 15;\n checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\n tooltipLayer.style.bottom = \"\".concat(targetOffset.height + 20, \"px\");\n break;\n\n case \"right\":\n tooltipLayer.style.left = \"\".concat(targetOffset.width + 20, \"px\");\n\n if (targetOffset.top + tooltipOffset.height > windowSize.height) {\n // In this case, right would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n arrowLayer.className = \"introjs-arrow left-bottom\";\n tooltipLayer.style.top = \"-\".concat(tooltipOffset.height - targetOffset.height - 20, \"px\");\n } else {\n arrowLayer.className = \"introjs-arrow left\";\n }\n\n break;\n\n case \"left\":\n if (!hintMode && this._options.showStepNumbers === true) {\n tooltipLayer.style.top = \"15px\";\n }\n\n if (targetOffset.top + tooltipOffset.height > windowSize.height) {\n // In this case, left would have fallen below the bottom of the screen.\n // Modify so that the bottom of the tooltip connects with the target\n tooltipLayer.style.top = \"-\".concat(tooltipOffset.height - targetOffset.height - 20, \"px\");\n arrowLayer.className = \"introjs-arrow right-bottom\";\n } else {\n arrowLayer.className = \"introjs-arrow right\";\n }\n\n tooltipLayer.style.right = \"\".concat(targetOffset.width + 20, \"px\");\n break;\n\n case \"floating\":\n arrowLayer.style.display = \"none\"; //we have to adjust the top and left of layer manually for intro items without element\n\n tooltipLayer.style.left = \"50%\";\n tooltipLayer.style.top = \"50%\";\n tooltipLayer.style.marginLeft = \"-\".concat(tooltipOffset.width / 2, \"px\");\n tooltipLayer.style.marginTop = \"-\".concat(tooltipOffset.height / 2, \"px\");\n break;\n\n case \"bottom-right-aligned\":\n arrowLayer.className = \"introjs-arrow top-right\";\n tooltipLayerStyleRight = 0;\n checkLeft(targetOffset, tooltipLayerStyleRight, tooltipOffset, tooltipLayer);\n tooltipLayer.style.top = \"\".concat(targetOffset.height + 20, \"px\");\n break;\n\n case \"bottom-middle-aligned\":\n arrowLayer.className = \"introjs-arrow top-middle\";\n tooltipLayerStyleLeftRight = targetOffset.width / 2 - tooltipOffset.width / 2; // a fix for middle aligned hints\n\n if (hintMode) {\n tooltipLayerStyleLeftRight += 5;\n }\n\n if (checkLeft(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, tooltipLayer)) {\n tooltipLayer.style.right = null;\n checkRight(targetOffset, tooltipLayerStyleLeftRight, tooltipOffset, windowSize, tooltipLayer);\n }\n\n tooltipLayer.style.top = \"\".concat(targetOffset.height + 20, \"px\");\n break;\n // case 'bottom-left-aligned':\n // Bottom-left-aligned is the same as the default bottom\n // case 'bottom':\n // Bottom going to follow the default behavior\n\n default:\n arrowLayer.className = \"introjs-arrow top\";\n tooltipLayerStyleLeft = 0;\n checkRight(targetOffset, tooltipLayerStyleLeft, tooltipOffset, windowSize, tooltipLayer);\n tooltipLayer.style.top = \"\".concat(targetOffset.height + 20, \"px\");\n }\n }\n\n /**\n * To remove all show element(s)\n *\n * @api private\n * @method _removeShowElement\n */\n\n function removeShowElement() {\n var elms = document.querySelectorAll(\".introjs-showElement\");\n forEach(elms, function (elm) {\n removeClass(elm, /introjs-[a-zA-Z]+/g);\n });\n }\n\n function _createElement(tagname, attrs) {\n var element = document.createElement(tagname);\n attrs = attrs || {}; // regex for matching attributes that need to be set with setAttribute\n\n var setAttRegex = /^(?:role|data-|aria-)/;\n\n for (var k in attrs) {\n var v = attrs[k];\n\n if (k === \"style\") {\n setStyle(element, v);\n } else if (k.match(setAttRegex)) {\n element.setAttribute(k, v);\n } else {\n element[k] = v;\n }\n }\n\n return element;\n }\n\n /**\n * Appends `element` to `parentElement`\n *\n * @param {Element} parentElement\n * @param {Element} element\n * @param {Boolean} [animate=false]\n */\n\n function appendChild(parentElement, element, animate) {\n if (animate) {\n var existingOpacity = element.style.opacity || \"1\";\n setStyle(element, {\n opacity: \"0\"\n });\n window.setTimeout(function () {\n setStyle(element, {\n opacity: existingOpacity\n });\n }, 10);\n }\n\n parentElement.appendChild(element);\n }\n\n /**\n * Gets the current progress percentage\n *\n * @api private\n * @method _getProgress\n * @returns current progress percentage\n */\n\n function _getProgress() {\n // Steps are 0 indexed\n var currentStep = parseInt(this._currentStep + 1, 10);\n return currentStep / this._introItems.length * 100;\n }\n /**\n * Add disableinteraction layer and adjust the size and position of the layer\n *\n * @api private\n * @method _disableInteraction\n */\n\n\n function _disableInteraction() {\n var disableInteractionLayer = document.querySelector(\".introjs-disableInteraction\");\n\n if (disableInteractionLayer === null) {\n disableInteractionLayer = _createElement(\"div\", {\n className: \"introjs-disableInteraction\"\n });\n\n this._targetElement.appendChild(disableInteractionLayer);\n }\n\n setHelperLayerPosition.call(this, disableInteractionLayer);\n }\n /**\n * Creates the bullets layer\n * @returns HTMLElement\n * @private\n */\n\n\n function _createBullets(targetElement) {\n var self = this;\n var bulletsLayer = _createElement(\"div\", {\n className: \"introjs-bullets\"\n });\n\n if (this._options.showBullets === false) {\n bulletsLayer.style.display = \"none\";\n }\n\n var ulContainer = _createElement(\"ul\");\n ulContainer.setAttribute(\"role\", \"tablist\");\n\n var anchorClick = function anchorClick() {\n self.goToStep(this.getAttribute(\"data-stepnumber\"));\n };\n\n forEach(this._introItems, function (_ref, i) {\n var step = _ref.step;\n var innerLi = _createElement(\"li\");\n var anchorLink = _createElement(\"a\");\n innerLi.setAttribute(\"role\", \"presentation\");\n anchorLink.setAttribute(\"role\", \"tab\");\n anchorLink.onclick = anchorClick;\n\n if (i === targetElement.step - 1) {\n anchorLink.className = \"active\";\n }\n\n setAnchorAsButton(anchorLink);\n anchorLink.innerHTML = \" \";\n anchorLink.setAttribute(\"data-stepnumber\", step);\n innerLi.appendChild(anchorLink);\n ulContainer.appendChild(innerLi);\n });\n bulletsLayer.appendChild(ulContainer);\n return bulletsLayer;\n }\n /**\n * Deletes and recreates the bullets layer\n * @param oldReferenceLayer\n * @param targetElement\n * @private\n */\n\n\n function _recreateBullets(oldReferenceLayer, targetElement) {\n if (this._options.showBullets) {\n var existing = document.querySelector(\".introjs-bullets\");\n existing.parentNode.replaceChild(_createBullets.call(this, targetElement), existing);\n }\n }\n /**\n * Updates the bullets\n *\n * @param oldReferenceLayer\n * @param targetElement\n */\n\n function _updateBullets(oldReferenceLayer, targetElement) {\n if (this._options.showBullets) {\n oldReferenceLayer.querySelector(\".introjs-bullets li > a.active\").className = \"\";\n oldReferenceLayer.querySelector(\".introjs-bullets li > a[data-stepnumber=\\\"\".concat(targetElement.step, \"\\\"]\")).className = \"active\";\n }\n }\n /**\n * Creates the progress-bar layer and elements\n * @returns {*}\n * @private\n */\n\n\n function _createProgressBar() {\n var progressLayer = _createElement(\"div\");\n progressLayer.className = \"introjs-progress\";\n\n if (this._options.showProgress === false) {\n progressLayer.style.display = \"none\";\n }\n\n var progressBar = _createElement(\"div\", {\n className: \"introjs-progressbar\"\n });\n\n if (this._options.progressBarAdditionalClass) {\n progressBar.className += \"\" + this._options.progressBarAdditionalClass;\n }\n\n progressBar.setAttribute(\"role\", \"progress\");\n progressBar.setAttribute(\"aria-valuemin\", 0);\n progressBar.setAttribute(\"aria-valuemax\", 100);\n progressBar.setAttribute(\"aria-valuenow\", _getProgress.call(this));\n progressBar.style.cssText = \"width:\".concat(_getProgress.call(this), \"%;\");\n progressLayer.appendChild(progressBar);\n return progressLayer;\n }\n /**\n * Updates an existing progress bar variables\n * @param oldReferenceLayer\n * @private\n */\n\n\n function _updateProgressBar(oldReferenceLayer) {\n oldReferenceLayer.querySelector(\".introjs-progress .introjs-progressbar\").style.cssText = \"width:\".concat(_getProgress.call(this), \"%;\");\n oldReferenceLayer.querySelector(\".introjs-progress .introjs-progressbar\").setAttribute(\"aria-valuenow\", _getProgress.call(this));\n }\n /**\n * Show an element on the page\n *\n * @api private\n * @method _showElement\n * @param {Object} targetElement\n */\n\n function _showElement(targetElement) {\n var _this = this;\n\n if (typeof this._introChangeCallback !== \"undefined\") {\n this._introChangeCallback.call(this, targetElement.element);\n }\n\n var self = this;\n var oldHelperLayer = document.querySelector(\".introjs-helperLayer\");\n var oldReferenceLayer = document.querySelector(\".introjs-tooltipReferenceLayer\");\n var highlightClass = \"introjs-helperLayer\";\n var nextTooltipButton;\n var prevTooltipButton;\n var skipTooltipButton; //check for a current step highlight class\n\n if (typeof targetElement.highlightClass === \"string\") {\n highlightClass += \"\".concat(targetElement.highlightClass);\n } //check for options highlight class\n\n\n if (typeof this._options.highlightClass === \"string\") {\n highlightClass += \"\".concat(this._options.highlightClass);\n }\n\n if (oldHelperLayer !== null && oldReferenceLayer !== null) {\n var oldHelperNumberLayer = oldReferenceLayer.querySelector(\".introjs-helperNumberLayer\");\n var oldtooltipLayer = oldReferenceLayer.querySelector(\".introjs-tooltiptext\");\n var oldTooltipTitleLayer = oldReferenceLayer.querySelector(\".introjs-tooltip-title\");\n var oldArrowLayer = oldReferenceLayer.querySelector(\".introjs-arrow\");\n var oldtooltipContainer = oldReferenceLayer.querySelector(\".introjs-tooltip\");\n skipTooltipButton = oldReferenceLayer.querySelector(\".introjs-skipbutton\");\n prevTooltipButton = oldReferenceLayer.querySelector(\".introjs-prevbutton\");\n nextTooltipButton = oldReferenceLayer.querySelector(\".introjs-nextbutton\"); //update or reset the helper highlight class\n\n oldHelperLayer.className = highlightClass; //hide the tooltip\n\n oldtooltipContainer.style.opacity = 0;\n oldtooltipContainer.style.display = \"none\"; // if the target element is within a scrollable element\n\n scrollParentToElement.call(self, targetElement); // set new position to helper layer\n\n setHelperLayerPosition.call(self, oldHelperLayer);\n setHelperLayerPosition.call(self, oldReferenceLayer); //remove old classes if the element still exist\n\n removeShowElement(); //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation\n\n if (self._lastShowElementTimer) {\n window.clearTimeout(self._lastShowElementTimer);\n }\n\n self._lastShowElementTimer = window.setTimeout(function () {\n // set current step to the label\n if (oldHelperNumberLayer !== null) {\n oldHelperNumberLayer.innerHTML = \"\".concat(targetElement.step, \" of \").concat(_this._introItems.length);\n } // set current tooltip text\n\n\n oldtooltipLayer.innerHTML = targetElement.intro; // set current tooltip title\n\n oldTooltipTitleLayer.innerHTML = targetElement.title; //set the tooltip position\n\n oldtooltipContainer.style.display = \"block\";\n placeTooltip.call(self, targetElement.element, oldtooltipContainer, oldArrowLayer); //change active bullet\n\n _updateBullets.call(self, oldReferenceLayer, targetElement);\n\n _updateProgressBar.call(self, oldReferenceLayer); //show the tooltip\n\n\n oldtooltipContainer.style.opacity = 1; //reset button focus\n\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null && /introjs-donebutton/gi.test(nextTooltipButton.className)) {\n // skip button is now \"done\" button\n nextTooltipButton.focus();\n } else if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n //still in the tour, focus on next\n nextTooltipButton.focus();\n } // change the scroll of the window, if needed\n\n\n scrollTo.call(self, targetElement.scrollTo, targetElement, oldtooltipLayer);\n }, 350); // end of old element if-else condition\n } else {\n var helperLayer = _createElement(\"div\", {\n className: highlightClass\n });\n var referenceLayer = _createElement(\"div\", {\n className: \"introjs-tooltipReferenceLayer\"\n });\n var arrowLayer = _createElement(\"div\", {\n className: \"introjs-arrow\"\n });\n var tooltipLayer = _createElement(\"div\", {\n className: \"introjs-tooltip\"\n });\n var tooltipTextLayer = _createElement(\"div\", {\n className: \"introjs-tooltiptext\"\n });\n var tooltipHeaderLayer = _createElement(\"div\", {\n className: \"introjs-tooltip-header\"\n });\n var tooltipTitleLayer = _createElement(\"h1\", {\n className: \"introjs-tooltip-title\"\n });\n var buttonsLayer = _createElement(\"div\");\n setStyle(helperLayer, {\n\"box-shadow\": \"0 0 1px 2px rgba(33, 33, 33, 0.8), rgba(33, 33, 33, \".concat(self._options.overlayOpacity.toString(), \") 0 0 0 5000px\")\n }); // target is within a scrollable element\n\n scrollParentToElement.call(self, targetElement); //set new position to helper layer\n\n setHelperLayerPosition.call(self, helperLayer);\n setHelperLayerPosition.call(self, referenceLayer); //add helper layer to target element\n\n appendChild(this._targetElement, helperLayer, true);\n appendChild(this._targetElement, referenceLayer);\n tooltipTextLayer.innerHTML = targetElement.intro;\n tooltipTitleLayer.innerHTML = targetElement.title;\n buttonsLayer.className = \"introjs-tooltipbuttons\";\n\n if (this._options.showButtons === false) {\n buttonsLayer.style.display = \"none\";\n }\n\n tooltipHeaderLayer.appendChild(tooltipTitleLayer);\n tooltipLayer.appendChild(tooltipHeaderLayer);\n tooltipLayer.appendChild(tooltipTextLayer);\n tooltipLayer.appendChild(_createBullets.call(this, targetElement));\n tooltipLayer.appendChild(_createProgressBar.call(this)); // add helper layer number\n\n var helperNumberLayer = _createElement(\"div\");\n\n if (this._options.showStepNumbers === true) {\n helperNumberLayer.className = \"introjs-helperNumberLayer\";\n helperNumberLayer.innerHTML = \"\".concat(targetElement.step, \" of \").concat(this._introItems.length);\n tooltipLayer.appendChild(helperNumberLayer);\n }\n\n tooltipLayer.appendChild(arrowLayer);\n referenceLayer.appendChild(tooltipLayer); //next button\n\n nextTooltipButton = _createElement(\"a\");\n\n nextTooltipButton.onclick = function () {\n if (self._introItems.length - 1 !== self._currentStep) {\n nextStep.call(self);\n } else if (/introjs-donebutton/gi.test(nextTooltipButton.className)) {\n if (typeof self._introCompleteCallback === \"function\") {\n self._introCompleteCallback.call(self);\n }\n\n exitIntro.call(self, self._targetElement);\n }\n };\n\n setAnchorAsButton(nextTooltipButton);\n nextTooltipButton.innerHTML = this._options.nextLabel; //previous button\n\n prevTooltipButton = _createElement(\"a\");\n\n prevTooltipButton.onclick = function () {\n if (self._currentStep !== 0) {\n previousStep.call(self);\n }\n };\n\n setAnchorAsButton(prevTooltipButton);\n prevTooltipButton.innerHTML = this._options.prevLabel; //skip button\n\n skipTooltipButton = _createElement(\"a\", {\n className: \"introjs-skipbutton\"\n });\n setAnchorAsButton(skipTooltipButton);\n skipTooltipButton.innerHTML = this._options.skipLabel;\n\n skipTooltipButton.onclick = function () {\n if (self._introItems.length - 1 === self._currentStep && typeof self._introCompleteCallback === \"function\") {\n self._introCompleteCallback.call(self);\n }\n\n if (typeof self._introSkipCallback === \"function\") {\n self._introSkipCallback.call(self);\n }\n\n exitIntro.call(self, self._targetElement);\n };\n\n tooltipHeaderLayer.appendChild(skipTooltipButton); //in order to prevent displaying previous button always\n\n if (this._introItems.length > 1) {\n buttonsLayer.appendChild(prevTooltipButton);\n } // we always need the next button because this\n // button changes to \"Done\" in the last step of the tour\n\n\n buttonsLayer.appendChild(nextTooltipButton);\n tooltipLayer.appendChild(buttonsLayer); //set proper position\n\n placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer); // change the scroll of the window, if needed\n\n scrollTo.call(this, targetElement.scrollTo, targetElement, tooltipLayer); //end of new element if-else condition\n } // removing previous disable interaction layer\n\n\n var disableInteractionLayer = self._targetElement.querySelector(\".introjs-disableInteraction\");\n\n if (disableInteractionLayer) {\n disableInteractionLayer.parentNode.removeChild(disableInteractionLayer);\n } //disable interaction\n\n\n if (targetElement.disableInteraction) {\n _disableInteraction.call(self);\n } // when it's the first step of tour\n\n\n if (this._currentStep === 0 && this._introItems.length > 1) {\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n nextTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-nextbutton\");\n nextTooltipButton.innerHTML = this._options.nextLabel;\n }\n\n if (this._options.hidePrev === true) {\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n prevTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-prevbutton introjs-hidden\");\n }\n\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n addClass(nextTooltipButton, \"introjs-fullbutton\");\n }\n } else {\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n prevTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-prevbutton introjs-disabled\");\n }\n }\n } else if (this._introItems.length - 1 === this._currentStep || this._introItems.length === 1) {\n // last step of tour\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n prevTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-prevbutton\");\n }\n\n if (this._options.hideNext === true) {\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n nextTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-nextbutton introjs-hidden\");\n }\n\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n addClass(prevTooltipButton, \"introjs-fullbutton\");\n }\n } else {\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n if (this._options.nextToDone === true) {\n nextTooltipButton.innerHTML = this._options.doneLabel;\n addClass(nextTooltipButton, \"\".concat(this._options.buttonClass, \" introjs-nextbutton introjs-donebutton\"));\n } else {\n nextTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-nextbutton introjs-disabled\");\n }\n }\n }\n } else {\n // steps between start and end\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n prevTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-prevbutton\");\n }\n\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n nextTooltipButton.className = \"\".concat(this._options.buttonClass, \" introjs-nextbutton\");\n nextTooltipButton.innerHTML = this._options.nextLabel;\n }\n }\n\n if (typeof prevTooltipButton !== \"undefined\" && prevTooltipButton !== null) {\n prevTooltipButton.setAttribute(\"role\", \"button\");\n }\n\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n nextTooltipButton.setAttribute(\"role\", \"button\");\n }\n\n if (typeof skipTooltipButton !== \"undefined\" && skipTooltipButton !== null) {\n skipTooltipButton.setAttribute(\"role\", \"button\");\n } //Set focus on \"next\" button, so that hitting Enter always moves you onto the next step\n\n\n if (typeof nextTooltipButton !== \"undefined\" && nextTooltipButton !== null) {\n nextTooltipButton.focus();\n }\n\n setShowElement(targetElement);\n\n if (typeof this._introAfterChangeCallback !== \"undefined\") {\n this._introAfterChangeCallback.call(this, targetElement.element);\n }\n }\n\n /**\n * Go to specific step of introduction\n *\n * @api private\n * @method _goToStep\n */\n\n function goToStep(step) {\n //because steps starts with zero\n this._currentStep = step - 2;\n\n if (typeof this._introItems !== \"undefined\") {\n nextStep.call(this);\n }\n }\n /**\n * Go to the specific step of introduction with the explicit [data-step] number\n *\n * @api private\n * @method _goToStepNumber\n */\n\n function goToStepNumber(step) {\n this._currentStepNumber = step;\n\n if (typeof this._introItems !== \"undefined\") {\n nextStep.call(this);\n }\n }\n /**\n * Go to next step on intro\n *\n * @api private\n * @method _nextStep\n */\n\n function nextStep() {\n var _this = this;\n\n this._direction = \"forward\";\n\n if (typeof this._currentStepNumber !== \"undefined\") {\n forEach(this._introItems, function (_ref, i) {\n var step = _ref.step;\n\n if (step === _this._currentStepNumber) {\n _this._currentStep = i - 1;\n _this._currentStepNumber = undefined;\n }\n });\n }\n\n if (typeof this._currentStep === \"undefined\") {\n this._currentStep = 0;\n } else {\n ++this._currentStep;\n }\n\n var nextStep = this._introItems[this._currentStep];\n var continueStep = true;\n\n if (typeof this._introBeforeChangeCallback !== \"undefined\") {\n continueStep = this._introBeforeChangeCallback.call(this, nextStep && nextStep.element);\n } // if `onbeforechange` returned `false`, stop displaying the element\n\n\n if (continueStep === false) {\n --this._currentStep;\n return false;\n }\n\n if (this._introItems.length <= this._currentStep) {\n //end of the intro\n //check if any callback is defined\n if (typeof this._introCompleteCallback === \"function\") {\n this._introCompleteCallback.call(this);\n }\n\n exitIntro.call(this, this._targetElement);\n return;\n }\n\n _showElement.call(this, nextStep);\n }\n /**\n * Go to previous step on intro\n *\n * @api private\n * @method _previousStep\n */\n\n function previousStep() {\n this._direction = \"backward\";\n\n if (this._currentStep === 0) {\n return false;\n }\n\n --this._currentStep;\n var nextStep = this._introItems[this._currentStep];\n var continueStep = true;\n\n if (typeof this._introBeforeChangeCallback !== \"undefined\") {\n continueStep = this._introBeforeChangeCallback.call(this, nextStep && nextStep.element);\n } // if `onbeforechange` returned `false`, stop displaying the element\n\n\n if (continueStep === false) {\n ++this._currentStep;\n return false;\n }\n\n _showElement.call(this, nextStep);\n }\n /**\n * Returns the current step of the intro\n *\n * @returns {number | boolean}\n */\n\n function currentStep() {\n return this._currentStep;\n }\n\n /**\n * on keyCode:\n * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n * This feature has been removed from the Web standards.\n * Though some browsers may still support it, it is in\n * the process of being dropped.\n * Instead, you should use KeyboardEvent.code,\n * if it's implemented.\n *\n * jQuery's approach is to test for\n * (1) e.which, then\n * (2) e.charCode, then\n * (3) e.keyCode\n * https://github.com/jquery/jquery/blob/a6b0705294d336ae2f63f7276de0da1195495363/src/event.js#L638\n *\n * @param type var\n * @return type\n */\n\n function onKeyDown(e) {\n var code = e.code === undefined ? e.which : e.code; // if e.which is null\n\n if (code === null) {\n code = e.charCode === null ? e.keyCode : e.charCode;\n }\n\n if ((code === \"Escape\" || code === 27) && this._options.exitOnEsc === true) {\n //escape key pressed, exit the intro\n //check if exit callback is defined\n exitIntro.call(this, this._targetElement);\n } else if (code === \"ArrowLeft\" || code === 37) {\n //left arrow\n previousStep.call(this);\n } else if (code === \"ArrowRight\" || code === 39) {\n //right arrow\n nextStep.call(this);\n } else if (code === \"Enter\" || code === \"NumpadEnter\" || code === 13) {\n //srcElement === ie\n var target = e.target || e.srcElement;\n\n if (target && target.className.match(\"introjs-prevbutton\")) {\n //user hit enter while focusing on previous button\n previousStep.call(this);\n } else if (target && target.className.match(\"introjs-skipbutton\")) {\n //user hit enter while focusing on skip button\n if (this._introItems.length - 1 === this._currentStep && typeof this._introCompleteCallback === \"function\") {\n this._introCompleteCallback.call(this);\n }\n\n exitIntro.call(this, this._targetElement);\n } else if (target && target.getAttribute(\"data-stepnumber\")) {\n // user hit enter while focusing on step bullet\n target.click();\n } else {\n //default behavior for responding to enter\n nextStep.call(this);\n } //prevent default behaviour on hitting Enter, to prevent steps being skipped in some browsers\n\n\n if (e.preventDefault) {\n e.preventDefault();\n } else {\n e.returnValue = false;\n }\n }\n }\n\n /*\n * makes a copy of the object\n * @api private\n * @method _cloneObject\n */\n function cloneObject(object) {\n if (object === null || _typeof(object) !== \"object\" || typeof object.nodeType !== \"undefined\") {\n return object;\n }\n\n var temp = {};\n\n for (var key in object) {\n if (typeof window.jQuery !== \"undefined\" && object[key] instanceof window.jQuery) {\n temp[key] = object[key];\n } else {\n temp[key] = cloneObject(object[key]);\n }\n }\n\n return temp;\n }\n\n /**\n * Get a queryselector within the hint wrapper\n *\n * @param {String} selector\n * @return {NodeList|Array}\n */\n\n function hintQuerySelectorAll(selector) {\n var hintsWrapper = document.querySelector(\".introjs-hints\");\n return hintsWrapper ? hintsWrapper.querySelectorAll(selector) : [];\n }\n /**\n * Hide a hint\n *\n * @api private\n * @method hideHint\n */\n\n function hideHint(stepId) {\n var hint = hintQuerySelectorAll(\".introjs-hint[data-step=\\\"\".concat(stepId, \"\\\"]\"))[0];\n removeHintTooltip.call(this);\n\n if (hint) {\n addClass(hint, \"introjs-hidehint\");\n } // call the callback function (if any)\n\n\n if (typeof this._hintCloseCallback !== \"undefined\") {\n this._hintCloseCallback.call(this, stepId);\n }\n }\n /**\n * Hide all hints\n *\n * @api private\n * @method hideHints\n */\n\n function hideHints() {\n var _this = this;\n\n var hints = hintQuerySelectorAll(\".introjs-hint\");\n forEach(hints, function (hint) {\n hideHint.call(_this, hint.getAttribute(\"data-step\"));\n });\n }\n /**\n * Show all hints\n *\n * @api private\n * @method _showHints\n */\n\n function showHints() {\n var _this2 = this;\n\n var hints = hintQuerySelectorAll(\".introjs-hint\");\n\n if (hints && hints.length) {\n forEach(hints, function (hint) {\n showHint.call(_this2, hint.getAttribute(\"data-step\"));\n });\n } else {\n populateHints.call(this, this._targetElement);\n }\n }\n /**\n * Show a hint\n *\n * @api private\n * @method showHint\n */\n\n function showHint(stepId) {\n var hint = hintQuerySelectorAll(\".introjs-hint[data-step=\\\"\".concat(stepId, \"\\\"]\"))[0];\n\n if (hint) {\n removeClass(hint, /introjs-hidehint/g);\n }\n }\n /**\n * Removes all hint elements on the page\n * Useful when you want to destroy the elements and add them again (e.g. a modal or popup)\n *\n * @api private\n * @method removeHints\n */\n\n function removeHints() {\n var _this3 = this;\n\n var hints = hintQuerySelectorAll(\".introjs-hint\");\n forEach(hints, function (hint) {\n removeHint.call(_this3, hint.getAttribute(\"data-step\"));\n });\n }\n /**\n * Remove one single hint element from the page\n * Useful when you want to destroy the element and add them again (e.g. a modal or popup)\n * Use removeHints if you want to remove all elements.\n *\n * @api private\n * @method removeHint\n */\n\n function removeHint(stepId) {\n var hint = hintQuerySelectorAll(\".introjs-hint[data-step=\\\"\".concat(stepId, \"\\\"]\"))[0];\n\n if (hint) {\n hint.parentNode.removeChild(hint);\n }\n }\n /**\n * Add all available hints to the page\n *\n * @api private\n * @method addHints\n */\n\n function addHints() {\n var _this4 = this;\n\n var self = this;\n var hintsWrapper = document.querySelector(\".introjs-hints\");\n\n if (hintsWrapper === null) {\n hintsWrapper = _createElement(\"div\", {\n className: \"introjs-hints\"\n });\n }\n /**\n * Returns an event handler unique to the hint iteration\n *\n * @param {Integer} i\n * @return {Function}\n */\n\n\n var getHintClick = function getHintClick(i) {\n return function (e) {\n var evt = e ? e : window.event;\n\n if (evt.stopPropagation) {\n evt.stopPropagation();\n }\n\n if (evt.cancelBubble !== null) {\n evt.cancelBubble = true;\n }\n\n showHintDialog.call(self, i);\n };\n };\n\n forEach(this._introItems, function (item, i) {\n // avoid append a hint twice\n if (document.querySelector(\".introjs-hint[data-step=\\\"\".concat(i, \"\\\"]\"))) {\n return;\n }\n\n var hint = _createElement(\"a\", {\n className: \"introjs-hint\"\n });\n setAnchorAsButton(hint);\n hint.onclick = getHintClick(i);\n\n if (!item.hintAnimation) {\n addClass(hint, \"introjs-hint-no-anim\");\n } // hint's position should be fixed if the target element's position is fixed\n\n\n if (isFixed(item.element)) {\n addClass(hint, \"introjs-fixedhint\");\n }\n\n var hintDot = _createElement(\"div\", {\n className: \"introjs-hint-dot\"\n });\n var hintPulse = _createElement(\"div\", {\n className: \"introjs-hint-pulse\"\n });\n hint.appendChild(hintDot);\n hint.appendChild(hintPulse);\n hint.setAttribute(\"data-step\", i); // we swap the hint element with target element\n // because _setHelperLayerPosition uses `element` property\n\n item.targetElement = item.element;\n item.element = hint; // align the hint position\n\n alignHintPosition.call(_this4, item.hintPosition, hint, item.targetElement);\n hintsWrapper.appendChild(hint);\n }); // adding the hints wrapper\n\n document.body.appendChild(hintsWrapper); // call the callback function (if any)\n\n if (typeof this._hintsAddedCallback !== \"undefined\") {\n this._hintsAddedCallback.call(this);\n }\n }\n /**\n * Aligns hint position\n *\n * @api private\n * @method alignHintPosition\n * @param {String} position\n * @param {Object} hint\n * @param {Object} element\n */\n\n function alignHintPosition(position, _ref, element) {\n var style = _ref.style;\n // get/calculate offset of target element\n var offset = getOffset.call(this, element);\n var iconWidth = 20;\n var iconHeight = 20; // align the hint element\n\n switch (position) {\n default:\n case \"top-left\":\n style.left = \"\".concat(offset.left, \"px\");\n style.top = \"\".concat(offset.top, \"px\");\n break;\n\n case \"top-right\":\n style.left = \"\".concat(offset.left + offset.width - iconWidth, \"px\");\n style.top = \"\".concat(offset.top, \"px\");\n break;\n\n case \"bottom-left\":\n style.left = \"\".concat(offset.left, \"px\");\n style.top = \"\".concat(offset.top + offset.height - iconHeight, \"px\");\n break;\n\n case \"bottom-right\":\n style.left = \"\".concat(offset.left + offset.width - iconWidth, \"px\");\n style.top = \"\".concat(offset.top + offset.height - iconHeight, \"px\");\n break;\n\n case \"middle-left\":\n style.left = \"\".concat(offset.left, \"px\");\n style.top = \"\".concat(offset.top + (offset.height - iconHeight) / 2, \"px\");\n break;\n\n case \"middle-right\":\n style.left = \"\".concat(offset.left + offset.width - iconWidth, \"px\");\n style.top = \"\".concat(offset.top + (offset.height - iconHeight) / 2, \"px\");\n break;\n\n case \"middle-middle\":\n style.left = \"\".concat(offset.left + (offset.width - iconWidth) / 2, \"px\");\n style.top = \"\".concat(offset.top + (offset.height - iconHeight) / 2, \"px\");\n break;\n\n case \"bottom-middle\":\n style.left = \"\".concat(offset.left + (offset.width - iconWidth) / 2, \"px\");\n style.top = \"\".concat(offset.top + offset.height - iconHeight, \"px\");\n break;\n\n case \"top-middle\":\n style.left = \"\".concat(offset.left + (offset.width - iconWidth) / 2, \"px\");\n style.top = \"\".concat(offset.top, \"px\");\n break;\n }\n }\n /**\n * Triggers when user clicks on the hint element\n *\n * @api private\n * @method _showHintDialog\n * @param {Number} stepId\n */\n\n function showHintDialog(stepId) {\n var hintElement = document.querySelector(\".introjs-hint[data-step=\\\"\".concat(stepId, \"\\\"]\"));\n var item = this._introItems[stepId]; // call the callback function (if any)\n\n if (typeof this._hintClickCallback !== \"undefined\") {\n this._hintClickCallback.call(this, hintElement, item, stepId);\n } // remove all open tooltips\n\n\n var removedStep = removeHintTooltip.call(this); // to toggle the tooltip\n\n if (parseInt(removedStep, 10) === stepId) {\n return;\n }\n\n var tooltipLayer = _createElement(\"div\", {\n className: \"introjs-tooltip\"\n });\n var tooltipTextLayer = _createElement(\"div\");\n var arrowLayer = _createElement(\"div\");\n var referenceLayer = _createElement(\"div\");\n\n tooltipLayer.onclick = function (e) {\n //IE9 & Other Browsers\n if (e.stopPropagation) {\n e.stopPropagation();\n } //IE8 and Lower\n else {\n e.cancelBubble = true;\n }\n };\n\n tooltipTextLayer.className = \"introjs-tooltiptext\";\n var tooltipWrapper = _createElement(\"p\");\n tooltipWrapper.innerHTML = item.hint;\n var closeButton = _createElement(\"a\");\n closeButton.className = this._options.buttonClass;\n closeButton.setAttribute(\"role\", \"button\");\n closeButton.innerHTML = this._options.hintButtonLabel;\n closeButton.onclick = hideHint.bind(this, stepId);\n tooltipTextLayer.appendChild(tooltipWrapper);\n tooltipTextLayer.appendChild(closeButton);\n arrowLayer.className = \"introjs-arrow\";\n tooltipLayer.appendChild(arrowLayer);\n tooltipLayer.appendChild(tooltipTextLayer); // set current step for _placeTooltip function\n\n this._currentStep = hintElement.getAttribute(\"data-step\"); // align reference layer position\n\n referenceLayer.className = \"introjs-tooltipReferenceLayer introjs-hintReference\";\n referenceLayer.setAttribute(\"data-step\", hintElement.getAttribute(\"data-step\"));\n setHelperLayerPosition.call(this, referenceLayer);\n referenceLayer.appendChild(tooltipLayer);\n document.body.appendChild(referenceLayer); //set proper position\n\n placeTooltip.call(this, hintElement, tooltipLayer, arrowLayer, true);\n }\n /**\n * Removes open hint (tooltip hint)\n *\n * @api private\n * @method _removeHintTooltip\n */\n\n function removeHintTooltip() {\n var tooltip = document.querySelector(\".introjs-hintReference\");\n\n if (tooltip) {\n var step = tooltip.getAttribute(\"data-step\");\n tooltip.parentNode.removeChild(tooltip);\n return step;\n }\n }\n /**\n * Start parsing hint items\n *\n * @api private\n * @param {Object} targetElm\n * @method _startHint\n */\n\n function populateHints(targetElm) {\n var _this5 = this;\n\n this._introItems = [];\n\n if (this._options.hints) {\n forEach(this._options.hints, function (hint) {\n var currentItem = cloneObject(hint);\n\n if (typeof currentItem.element === \"string\") {\n //grab the element with given selector from the page\n currentItem.element = document.querySelector(currentItem.element);\n }\n\n currentItem.hintPosition = currentItem.hintPosition || _this5._options.hintPosition;\n currentItem.hintAnimation = currentItem.hintAnimation || _this5._options.hintAnimation;\n\n if (currentItem.element !== null) {\n _this5._introItems.push(currentItem);\n }\n });\n } else {\n var hints = targetElm.querySelectorAll(\"*[data-hint]\");\n\n if (!hints || !hints.length) {\n return false;\n } //first add intro items with data-step\n\n\n forEach(hints, function (currentElement) {\n // hint animation\n var hintAnimation = currentElement.getAttribute(\"data-hintanimation\");\n\n if (hintAnimation) {\n hintAnimation = hintAnimation === \"true\";\n } else {\n hintAnimation = _this5._options.hintAnimation;\n }\n\n _this5._introItems.push({\n element: currentElement,\n hint: currentElement.getAttribute(\"data-hint\"),\n hintPosition: currentElement.getAttribute(\"data-hintposition\") || _this5._options.hintPosition,\n hintAnimation: hintAnimation,\n tooltipClass: currentElement.getAttribute(\"data-tooltipclass\"),\n position: currentElement.getAttribute(\"data-position\") || _this5._options.tooltipPosition\n });\n });\n }\n\n addHints.call(this);\n /*\n todo:\n these events should be removed at some point\n */\n\n DOMEvent.on(document, \"click\", removeHintTooltip, this, false);\n DOMEvent.on(window, \"resize\", reAlignHints, this, true);\n }\n /**\n * Re-aligns all hint elements\n *\n * @api private\n * @method _reAlignHints\n */\n\n function reAlignHints() {\n var _this6 = this;\n\n forEach(this._introItems, function (_ref2) {\n var targetElement = _ref2.targetElement,\n hintPosition = _ref2.hintPosition,\n element = _ref2.element;\n\n if (typeof targetElement === \"undefined\") {\n return;\n }\n\n alignHintPosition.call(_this6, hintPosition, element, targetElement);\n });\n }\n\n // TODO: use something more complex like timsort?\n var floor = Math.floor;\n\n var mergeSort = function (array, comparefn) {\n var length = array.length;\n var middle = floor(length / 2);\n return length < 8 ? insertionSort(array, comparefn) : merge(\n mergeSort(array.slice(0, middle), comparefn),\n mergeSort(array.slice(middle), comparefn),\n comparefn\n );\n };\n\n var insertionSort = function (array, comparefn) {\n var length = array.length;\n var i = 1;\n var element, j;\n\n while (i < length) {\n j = i;\n element = array[i];\n while (j && comparefn(array[j - 1], element) > 0) {\n array[j] = array[--j];\n }\n if (j !== i++) array[j] = element;\n } return array;\n };\n\n var merge = function (left, right, comparefn) {\n var llength = left.length;\n var rlength = right.length;\n var lindex = 0;\n var rindex = 0;\n var result = [];\n\n while (lindex < llength || rindex < rlength) {\n if (lindex < llength && rindex < rlength) {\n result.push(comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]);\n } else {\n result.push(lindex < llength ? left[lindex++] : right[rindex++]);\n }\n } return result;\n };\n\n var arraySort = mergeSort;\n\n var firefox = engineUserAgent.match(/firefox\\/(\\d+)/i);\n\n var engineFfVersion = !!firefox && +firefox[1];\n\n var engineIsIeOrEdge = /MSIE|Trident/.test(engineUserAgent);\n\n var webkit = engineUserAgent.match(/AppleWebKit\\/(\\d+)\\./);\n\n var engineWebkitVersion = !!webkit && +webkit[1];\n\n var test = [];\n var nativeSort = test.sort;\n\n // IE8-\n var FAILS_ON_UNDEFINED = fails(function () {\n test.sort(undefined);\n });\n // V8 bug\n var FAILS_ON_NULL = fails(function () {\n test.sort(null);\n });\n // Old WebKit\n var STRICT_METHOD = arrayMethodIsStrict('sort');\n\n var STABLE_SORT = !fails(function () {\n // feature detection can be too slow, so check engines versions\n if (engineV8Version) return engineV8Version < 70;\n if (engineFfVersion && engineFfVersion > 3) return;\n if (engineIsIeOrEdge) return true;\n if (engineWebkitVersion) return engineWebkitVersion < 603;\n\n var result = '';\n var code, chr, value, index;\n\n // generate an array with more 512 elements (Chakra and old V8 fails only in this case)\n for (code = 65; code < 76; code++) {\n chr = String.fromCharCode(code);\n\n switch (code) {\n case 66: case 69: case 70: case 72: value = 3; break;\n case 68: case 71: value = 4; break;\n default: value = 2;\n }\n\n for (index = 0; index < 47; index++) {\n test.push({ k: chr + index, v: value });\n }\n }\n\n test.sort(function (a, b) { return b.v - a.v; });\n\n for (index = 0; index < test.length; index++) {\n chr = test[index].k.charAt(0);\n if (result.charAt(result.length - 1) !== chr) result += chr;\n }\n\n return result !== 'DGBEFHACIJK';\n });\n\n var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;\n\n var getSortCompare = function (comparefn) {\n return function (x, y) {\n if (y === undefined) return -1;\n if (x === undefined) return 1;\n if (comparefn !== undefined) return +comparefn(x, y) || 0;\n return toString_1(x) > toString_1(y) ? 1 : -1;\n };\n };\n\n // `Array.prototype.sort` method\n // https://tc39.es/ecma262/#sec-array.prototype.sort\n _export({ target: 'Array', proto: true, forced: FORCED }, {\n sort: function sort(comparefn) {\n if (comparefn !== undefined) aFunction(comparefn);\n\n var array = toObject(this);\n\n if (STABLE_SORT) return comparefn === undefined ? nativeSort.call(array) : nativeSort.call(array, comparefn);\n\n var items = [];\n var arrayLength = toLength(array.length);\n var itemsLength, index;\n\n for (index = 0; index < arrayLength; index++) {\n if (index in array) items.push(array[index]);\n }\n\n items = arraySort(items, getSortCompare(comparefn));\n itemsLength = items.length;\n index = 0;\n\n while (index < itemsLength) array[index] = items[index++];\n while (index < arrayLength) delete array[index++];\n\n return array;\n }\n });\n\n /**\n * Finds all Intro steps from the data-* attributes and the options.steps array\n *\n * @api private\n * @param targetElm\n * @returns {[]}\n */\n\n function fetchIntroSteps(targetElm) {\n var _this = this;\n\n var allIntroSteps = targetElm.querySelectorAll(\"*[data-intro]\");\n var introItems = [];\n\n if (this._options.steps) {\n //use steps passed programmatically\n forEach(this._options.steps, function (step) {\n var currentItem = cloneObject(step); //set the step\n\n currentItem.step = introItems.length + 1;\n currentItem.title = currentItem.title || \"\"; //use querySelector function only when developer used CSS selector\n\n if (typeof currentItem.element === \"string\") {\n //grab the element with given selector from the page\n currentItem.element = document.querySelector(currentItem.element);\n } //intro without element\n\n\n if (typeof currentItem.element === \"undefined\" || currentItem.element === null) {\n var floatingElementQuery = document.querySelector(\".introjsFloatingElement\");\n\n if (floatingElementQuery === null) {\n floatingElementQuery = _createElement(\"div\", {\n className: \"introjsFloatingElement\"\n });\n document.body.appendChild(floatingElementQuery);\n }\n\n currentItem.element = floatingElementQuery;\n currentItem.position = \"floating\";\n }\n\n currentItem.position = currentItem.position || _this._options.tooltipPosition;\n currentItem.scrollTo = currentItem.scrollTo || _this._options.scrollTo;\n\n if (typeof currentItem.disableInteraction === \"undefined\") {\n currentItem.disableInteraction = _this._options.disableInteraction;\n }\n\n if (currentItem.element !== null) {\n introItems.push(currentItem);\n }\n });\n } else {\n //use steps from data-* annotations\n var elmsLength = allIntroSteps.length;\n var disableInteraction; //if there's no element to intro\n\n if (elmsLength < 1) {\n return [];\n }\n\n forEach(allIntroSteps, function (currentElement) {\n // start intro for groups of elements\n if (_this._options.group && currentElement.getAttribute(\"data-intro-group\") !== _this._options.group) {\n return;\n } // skip hidden elements\n\n\n if (currentElement.style.display === \"none\") {\n return;\n }\n\n var step = parseInt(currentElement.getAttribute(\"data-step\"), 10);\n\n if (currentElement.hasAttribute(\"data-disable-interaction\")) {\n disableInteraction = !!currentElement.getAttribute(\"data-disable-interaction\");\n } else {\n disableInteraction = _this._options.disableInteraction;\n }\n\n if (step > 0) {\n introItems[step - 1] = {\n element: currentElement,\n title: currentElement.getAttribute(\"data-title\") || \"\",\n intro: currentElement.getAttribute(\"data-intro\"),\n step: parseInt(currentElement.getAttribute(\"data-step\"), 10),\n tooltipClass: currentElement.getAttribute(\"data-tooltipclass\"),\n highlightClass: currentElement.getAttribute(\"data-highlightclass\"),\n position: currentElement.getAttribute(\"data-position\") || _this._options.tooltipPosition,\n scrollTo: currentElement.getAttribute(\"data-scrollto\") || _this._options.scrollTo,\n disableInteraction: disableInteraction\n };\n }\n }); //next add intro items without data-step\n //todo: we need a cleanup here, two loops are redundant\n\n var nextStep = 0;\n forEach(allIntroSteps, function (currentElement) {\n // start intro for groups of elements\n if (_this._options.group && currentElement.getAttribute(\"data-intro-group\") !== _this._options.group) {\n return;\n }\n\n if (currentElement.getAttribute(\"data-step\") === null) {\n while (true) {\n if (typeof introItems[nextStep] === \"undefined\") {\n break;\n } else {\n nextStep++;\n }\n }\n\n if (currentElement.hasAttribute(\"data-disable-interaction\")) {\n disableInteraction = !!currentElement.getAttribute(\"data-disable-interaction\");\n } else {\n disableInteraction = _this._options.disableInteraction;\n }\n\n introItems[nextStep] = {\n element: currentElement,\n title: currentElement.getAttribute(\"data-title\") || \"\",\n intro: currentElement.getAttribute(\"data-intro\"),\n step: nextStep + 1,\n tooltipClass: currentElement.getAttribute(\"data-tooltipclass\"),\n highlightClass: currentElement.getAttribute(\"data-highlightclass\"),\n position: currentElement.getAttribute(\"data-position\") || _this._options.tooltipPosition,\n scrollTo: currentElement.getAttribute(\"data-scrollto\") || _this._options.scrollTo,\n disableInteraction: disableInteraction\n };\n }\n });\n } //removing undefined/null elements\n\n\n var tempIntroItems = [];\n\n for (var z = 0; z < introItems.length; z++) {\n if (introItems[z]) {\n // copy non-falsy values to the end of the array\n tempIntroItems.push(introItems[z]);\n }\n }\n\n introItems = tempIntroItems; //Ok, sort all items with given steps\n\n introItems.sort(function (a, b) {\n return a.step - b.step;\n });\n return introItems;\n }\n\n /**\n * Update placement of the intro objects on the screen\n * @api private\n * @param {boolean} refreshSteps to refresh the intro steps as well\n */\n\n function refresh(refreshSteps) {\n var referenceLayer = document.querySelector(\".introjs-tooltipReferenceLayer\");\n var helperLayer = document.querySelector(\".introjs-helperLayer\");\n var disableInteractionLayer = document.querySelector(\".introjs-disableInteraction\"); // re-align intros\n\n setHelperLayerPosition.call(this, helperLayer);\n setHelperLayerPosition.call(this, referenceLayer);\n setHelperLayerPosition.call(this, disableInteractionLayer);\n\n if (refreshSteps) {\n this._introItems = fetchIntroSteps.call(this, this._targetElement);\n\n _recreateBullets.call(this, referenceLayer, this._introItems[this._currentStep]);\n\n _updateProgressBar.call(this, referenceLayer);\n } // re-align tooltip\n\n\n if (this._currentStep !== undefined && this._currentStep !== null) {\n var oldArrowLayer = document.querySelector(\".introjs-arrow\");\n var oldtooltipContainer = document.querySelector(\".introjs-tooltip\");\n placeTooltip.call(this, this._introItems[this._currentStep].element, oldtooltipContainer, oldArrowLayer);\n } //re-align hints\n\n\n reAlignHints.call(this);\n return this;\n }\n\n function onResize() {\n refresh.call(this);\n }\n\n /**\n * Removes `element` from `parentElement`\n *\n * @param {Element} element\n * @param {Boolean} [animate=false]\n */\n\n function removeChild(element, animate) {\n if (!element || !element.parentElement) return;\n var parentElement = element.parentElement;\n\n if (animate) {\n setStyle(element, {\n opacity: \"0\"\n });\n window.setTimeout(function () {\n try {\n // removeChild(..) throws an exception if the child has already been removed (https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild)\n // this try-catch is added to make sure this function doesn't throw an exception if the child has been removed\n // this scenario can happen when start()/exit() is called multiple times and the helperLayer is removed by the\n // previous exit() call (note: this is a timeout)\n parentElement.removeChild(element);\n } catch (e) {}\n }, 500);\n } else {\n parentElement.removeChild(element);\n }\n }\n\n /**\n * Exit from intro\n *\n * @api private\n * @method _exitIntro\n * @param {Object} targetElement\n * @param {Boolean} force - Setting to `true` will skip the result of beforeExit callback\n */\n\n function exitIntro(targetElement, force) {\n var continueExit = true; // calling onbeforeexit callback\n //\n // If this callback return `false`, it would halt the process\n\n if (this._introBeforeExitCallback !== undefined) {\n continueExit = this._introBeforeExitCallback.call(this);\n } // skip this check if `force` parameter is `true`\n // otherwise, if `onbeforeexit` returned `false`, don't exit the intro\n\n\n if (!force && continueExit === false) return; // remove overlay layers from the page\n\n var overlayLayers = targetElement.querySelectorAll(\".introjs-overlay\");\n\n if (overlayLayers && overlayLayers.length) {\n forEach(overlayLayers, function (overlayLayer) {\n return removeChild(overlayLayer);\n });\n } //remove all helper layers\n\n\n var helperLayer = targetElement.querySelector(\".introjs-helperLayer\");\n removeChild(helperLayer, true);\n var referenceLayer = targetElement.querySelector(\".introjs-tooltipReferenceLayer\");\n removeChild(referenceLayer); //remove disableInteractionLayer\n\n var disableInteractionLayer = targetElement.querySelector(\".introjs-disableInteraction\");\n removeChild(disableInteractionLayer); //remove intro floating element\n\n var floatingElement = document.querySelector(\".introjsFloatingElement\");\n removeChild(floatingElement);\n removeShowElement(); //clean listeners\n\n DOMEvent.off(window, \"keydown\", onKeyDown, this, true);\n DOMEvent.off(window, \"resize\", onResize, this, true); //check if any callback is defined\n\n if (this._introExitCallback !== undefined) {\n this._introExitCallback.call(this);\n } //set the step to zero\n\n\n this._currentStep = undefined;\n }\n\n /**\n * Add overlay layer to the page\n *\n * @api private\n * @method _addOverlayLayer\n * @param {Object} targetElm\n */\n\n function addOverlayLayer(targetElm) {\n var _this = this;\n\n var overlayLayer = _createElement(\"div\", {\n className: \"introjs-overlay\"\n });\n setStyle(overlayLayer, {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n position: \"fixed\"\n });\n targetElm.appendChild(overlayLayer);\n\n if (this._options.exitOnOverlayClick === true) {\n setStyle(overlayLayer, {\n cursor: \"pointer\"\n });\n\n overlayLayer.onclick = function () {\n exitIntro.call(_this, targetElm);\n };\n }\n\n return true;\n }\n\n /**\n * Initiate a new introduction/guide from an element in the page\n *\n * @api private\n * @method introForElement\n * @param {Object} targetElm\n * @returns {Boolean} Success or not?\n */\n\n function introForElement(targetElm) {\n //set it to the introJs object\n var steps = fetchIntroSteps.call(this, targetElm);\n\n if (steps.length === 0) {\n return false;\n }\n\n this._introItems = steps; //add overlay layer to the page\n\n if (addOverlayLayer.call(this, targetElm)) {\n //then, start the show\n nextStep.call(this);\n\n if (this._options.keyboardNavigation) {\n DOMEvent.on(window, \"keydown\", onKeyDown, this, true);\n } //for window resize\n\n\n DOMEvent.on(window, \"resize\", onResize, this, true);\n }\n\n return false;\n }\n\n var version = \"4.2.2\";\n\n /**\n * IntroJs main class\n *\n * @class IntroJs\n */\n\n function IntroJs(obj) {\n this._targetElement = obj;\n this._introItems = [];\n this._options = {\n /* Next button label in tooltip box */\n nextLabel: \"Next\",\n\n /* Previous button label in tooltip box */\n prevLabel: \"Back\",\n\n /* Skip button label in tooltip box */\n skipLabel: \"\u00d7\",\n\n /* Done button label in tooltip box */\n doneLabel: \"Done\",\n\n /* Hide previous button in the first step? Otherwise, it will be disabled button. */\n hidePrev: false,\n\n /* Hide next button in the last step? Otherwise, it will be disabled button (note: this will also hide the \"Done\" button) */\n hideNext: false,\n\n /* Change the Next button to Done in the last step of the intro? otherwise, it will render a disabled button */\n nextToDone: true,\n\n /* Default tooltip box position */\n tooltipPosition: \"bottom\",\n\n /* Next CSS class for tooltip boxes */\n tooltipClass: \"\",\n\n /* Start intro for a group of elements */\n group: \"\",\n\n /* CSS class that is added to the helperLayer */\n highlightClass: \"\",\n\n /* Close introduction when pressing Escape button? */\n exitOnEsc: true,\n\n /* Close introduction when clicking on overlay layer? */\n exitOnOverlayClick: true,\n\n /* Show step numbers in introduction? */\n showStepNumbers: false,\n\n /* Let user use keyboard to navigate the tour? */\n keyboardNavigation: true,\n\n /* Show tour control buttons? */\n showButtons: true,\n\n /* Show tour bullets? */\n showBullets: true,\n\n /* Show tour progress? */\n showProgress: false,\n\n /* Scroll to highlighted element? */\n scrollToElement: true,\n\n /*\n * Should we scroll the tooltip or target element?\n *\n * Options are: 'element' or 'tooltip'\n */\n scrollTo: \"element\",\n\n /* Padding to add after scrolling when element is not in the viewport (in pixels) */\n scrollPadding: 30,\n\n /* Set the overlay opacity */\n overlayOpacity: 0.5,\n\n /* To determine the tooltip position automatically based on the window.width/height */\n autoPosition: true,\n\n /* Precedence of positions, when auto is enabled */\n positionPrecedence: [\"bottom\", \"top\", \"right\", \"left\"],\n\n /* Disable an interaction with element? */\n disableInteraction: false,\n\n /* Set how much padding to be used around helper element */\n helperElementPadding: 10,\n\n /* Default hint position */\n hintPosition: \"top-middle\",\n\n /* Hint button label */\n hintButtonLabel: \"Got it\",\n\n /* Adding animation to hints? */\n hintAnimation: true,\n\n /* additional classes to put on the buttons */\n buttonClass: \"introjs-button\",\n\n /* additional classes to put on progress bar */\n progressBarAdditionalClass: false\n };\n }\n\n var introJs = function introJs(targetElm) {\n var instance;\n\n if (_typeof(targetElm) === \"object\") {\n //Ok, create a new instance\n instance = new IntroJs(targetElm);\n } else if (typeof targetElm === \"string\") {\n //select the target element with query selector\n var targetElement = document.querySelector(targetElm);\n\n if (targetElement) {\n instance = new IntroJs(targetElement);\n } else {\n throw new Error(\"There is no element with given selector.\");\n }\n } else {\n instance = new IntroJs(document.body);\n } // add instance to list of _instances\n // passing group to stamp to increment\n // from 0 onward somewhat reliably\n\n\n introJs.instances[stamp(instance, \"introjs-instance\")] = instance;\n return instance;\n };\n /**\n * Current IntroJs version\n *\n * @property version\n * @type String\n */\n\n\n introJs.version = version;\n /**\n * key-val object helper for introJs instances\n *\n * @property instances\n * @type Object\n */\n\n introJs.instances = {}; //Prototype\n\n introJs.fn = IntroJs.prototype = {\n clone: function clone() {\n return new IntroJs(this);\n },\n setOption: function setOption(option, value) {\n this._options[option] = value;\n return this;\n },\n setOptions: function setOptions(options) {\n this._options = mergeOptions(this._options, options);\n return this;\n },\n start: function start() {\n introForElement.call(this, this._targetElement);\n return this;\n },\n goToStep: function goToStep$1(step) {\n goToStep.call(this, step);\n\n return this;\n },\n addStep: function addStep(options) {\n if (!this._options.steps) {\n this._options.steps = [];\n }\n\n this._options.steps.push(options);\n\n return this;\n },\n addSteps: function addSteps(steps) {\n if (!steps.length) return;\n\n for (var index = 0; index < steps.length; index++) {\n this.addStep(steps[index]);\n }\n\n return this;\n },\n goToStepNumber: function goToStepNumber$1(step) {\n goToStepNumber.call(this, step);\n\n return this;\n },\n nextStep: function nextStep$1() {\n nextStep.call(this);\n\n return this;\n },\n previousStep: function previousStep$1() {\n previousStep.call(this);\n\n return this;\n },\n currentStep: function currentStep$1() {\n return currentStep.call(this);\n },\n exit: function exit(force) {\n exitIntro.call(this, this._targetElement, force);\n return this;\n },\n refresh: function refresh$1(refreshSteps) {\n refresh.call(this, refreshSteps);\n\n return this;\n },\n onbeforechange: function onbeforechange(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introBeforeChangeCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onbeforechange was not a function\");\n }\n\n return this;\n },\n onchange: function onchange(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introChangeCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onchange was not a function.\");\n }\n\n return this;\n },\n onafterchange: function onafterchange(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introAfterChangeCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onafterchange was not a function\");\n }\n\n return this;\n },\n oncomplete: function oncomplete(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introCompleteCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for oncomplete was not a function.\");\n }\n\n return this;\n },\n onhintsadded: function onhintsadded(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._hintsAddedCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onhintsadded was not a function.\");\n }\n\n return this;\n },\n onhintclick: function onhintclick(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._hintClickCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onhintclick was not a function.\");\n }\n\n return this;\n },\n onhintclose: function onhintclose(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._hintCloseCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onhintclose was not a function.\");\n }\n\n return this;\n },\n onexit: function onexit(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introExitCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onexit was not a function.\");\n }\n\n return this;\n },\n onskip: function onskip(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introSkipCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onskip was not a function.\");\n }\n\n return this;\n },\n onbeforeexit: function onbeforeexit(providedCallback) {\n if (typeof providedCallback === \"function\") {\n this._introBeforeExitCallback = providedCallback;\n } else {\n throw new Error(\"Provided callback for onbeforeexit was not a function.\");\n }\n\n return this;\n },\n addHints: function addHints() {\n populateHints.call(this, this._targetElement);\n return this;\n },\n hideHint: function hideHint$1(stepId) {\n hideHint.call(this, stepId);\n\n return this;\n },\n hideHints: function hideHints$1() {\n hideHints.call(this);\n\n return this;\n },\n showHint: function showHint$1(stepId) {\n showHint.call(this, stepId);\n\n return this;\n },\n showHints: function showHints$1() {\n showHints.call(this);\n\n return this;\n },\n removeHints: function removeHints$1() {\n removeHints.call(this);\n\n return this;\n },\n removeHint: function removeHint$1(stepId) {\n removeHint().call(this, stepId);\n\n return this;\n },\n showHintDialog: function showHintDialog$1(stepId) {\n showHintDialog.call(this, stepId);\n\n return this;\n }\n };\n\n return introJs;\n\n})));\n",
"// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n",
"/**\n * Copyright (C) 2021 The Software Heritage developers\n * See the AUTHORS file at the top-level directory of this distribution\n * License: GNU Affero General Public License version 3, or any later version\n * See top-level LICENSE file for more information\n */\n\nimport * as introJs from 'intro.js';\nimport 'intro.js/introjs.css';\nimport './swh-introjs.css';\nimport guidedTourSteps from './guided-tour-steps.yaml';\nimport {disableScrolling, enableScrolling} from 'utils/scrolling';\n\nlet guidedTour = [];\nlet tour = null;\nlet previousElement = null;\n// we use a origin available both in production and swh-web tests\n// environment to ease tour testing\nconst originUrl = 'https://github.com/memononen/libtess2';\n\nfunction openSWHIDsTabBeforeNextStep() {\n window.scrollTo(0, 0);\n if (!$('#swh-identifiers').tabSlideOut('isOpen')) {\n $('.introjs-helperLayer, .introjs-tooltipReferenceLayer').hide();\n $('#swh-identifiers').tabSlideOut('open');\n setTimeout(() => {\n $('.introjs-helperLayer, .introjs-tooltipReferenceLayer').show();\n tour.nextStep();\n }, 500);\n return false;\n }\n return true;\n}\n\n// init guided tour configuration when page loads in order\n// to hack on it in cypress tests\n$(() => {\n // tour is defined by an array of objects containing:\n // - URL of page to run a tour\n // - intro.js configuration with tour steps\n // - optional intro.js callback function for tour interactivity\n guidedTour = [\n {\n url: Urls.swh_web_homepage(),\n introJsOptions: {\n disableInteraction: true,\n scrollToElement: false,\n steps: guidedTourSteps.homepage\n }\n },\n {\n url: `${Urls.browse_origin_directory()}?origin_url=${originUrl}`,\n introJsOptions: {\n disableInteraction: true,\n scrollToElement: false,\n steps: guidedTourSteps.browseOrigin\n },\n onBeforeChange: function(targetElement) {\n // open SWHIDs tab before its tour step\n if (targetElement && targetElement.id === 'swh-identifiers') {\n return openSWHIDsTabBeforeNextStep();\n }\n return true;\n }\n },\n {\n url: `${Urls.browse_origin_content()}?origin_url=${originUrl}&path=Example/example.c`,\n introJsOptions: {\n steps: guidedTourSteps.browseContent\n },\n onBeforeChange: function(targetElement) {\n const lineNumberStart = 11;\n const lineNumberEnd = 17;\n if (targetElement && $(targetElement).hasClass('swhid')) {\n return openSWHIDsTabBeforeNextStep();\n // forbid move to next step until user clicks on line numbers\n } else if (targetElement && targetElement.dataset.lineNumber === `${lineNumberEnd}`) {\n const background = $(`.hljs-ln-numbers[data-line-number=\"${lineNumberStart}\"]`).css('background-color');\n const canGoNext = background !== 'rgba(0, 0, 0, 0)';\n if (!canGoNext && $('#swh-next-step-disabled').length === 0) {\n $('.introjs-tooltiptext').append(\n `<p id=\"swh-next-step-disabled\" style=\"color: red; font-weight: bold\">\n You need to select the line number before proceeding to<br/>next step.\n </p>`);\n }\n previousElement = targetElement;\n return canGoNext;\n } else if (previousElement && previousElement.dataset.lineNumber === `${lineNumberEnd}`) {\n let canGoNext = true;\n for (let i = lineNumberStart; i <= lineNumberEnd; ++i) {\n const background = $(`.hljs-ln-numbers[data-line-number=\"${i}\"]`).css('background-color');\n canGoNext = canGoNext && background !== 'rgba(0, 0, 0, 0)';\n if (!canGoNext) {\n swh.webapp.resetHighlightedLines();\n swh.webapp.scrollToLine(swh.webapp.highlightLine(lineNumberStart, true));\n if ($('#swh-next-step-disabled').length === 0) {\n $('.introjs-tooltiptext').append(\n `<p id=\"swh-next-step-disabled\" style=\"color: red; font-weight: bold\">\n You need to select the line numbers range from ${lineNumberStart}\n to ${lineNumberEnd} before proceeding to next step.\n </p>`);\n }\n break;\n }\n }\n return canGoNext;\n }\n previousElement = targetElement;\n return true;\n }\n }\n ];\n // init guided tour on page if guided_tour query parameter is present\n const searchParams = new URLSearchParams(window.location.search);\n if (searchParams && searchParams.has('guided_tour')) {\n initGuidedTour(parseInt(searchParams.get('guided_tour')));\n }\n});\n\nexport function getGuidedTour() {\n return guidedTour;\n}\n\nexport function guidedTourButtonClick(event) {\n event.preventDefault();\n initGuidedTour();\n}\n\nexport function initGuidedTour(page = 0) {\n if (page >= guidedTour.length) {\n return;\n }\n const pageUrl = new URL(window.location.origin + guidedTour[page].url);\n const currentUrl = new URL(window.location.href);\n const guidedTourNext = currentUrl.searchParams.get('guided_tour_next');\n currentUrl.searchParams.delete('guided_tour');\n currentUrl.searchParams.delete('guided_tour_next');\n const pageUrlStr = decodeURIComponent(pageUrl.toString());\n const currentUrlStr = decodeURIComponent(currentUrl.toString());\n if (currentUrlStr !== pageUrlStr) {\n // go to guided tour page URL if current one does not match\n pageUrl.searchParams.set('guided_tour', page);\n if (page === 0) {\n // user will be redirected to the page he was at the end of the tour\n pageUrl.searchParams.set('guided_tour_next', currentUrlStr);\n }\n window.location = decodeURIComponent(pageUrl.toString());\n } else {\n // create intro.js guided tour and configure it\n tour = introJs().setOptions(guidedTour[page].introJsOptions);\n tour.setOptions({\n 'exitOnOverlayClick': false,\n 'showBullets': false\n });\n if (page < guidedTour.length - 1) {\n // if not on the last page of the tour, rename next button label\n // and schedule next page loading when clicking on it\n tour.setOption('doneLabel', 'Next page')\n .onexit(() => {\n // re-enable page scrolling when exiting tour\n enableScrolling();\n })\n .oncomplete(() => {\n const nextPageUrl = new URL(window.location.origin + guidedTour[page + 1].url);\n nextPageUrl.searchParams.set('guided_tour', page + 1);\n if (guidedTourNext) {\n nextPageUrl.searchParams.set('guided_tour_next', guidedTourNext);\n } else if (page === 0) {\n nextPageUrl.searchParams.set('guided_tour_next', currentUrlStr);\n }\n window.location.href = decodeURIComponent(nextPageUrl.toString());\n });\n } else {\n tour.oncomplete(() => {\n enableScrolling(); // re-enable page scrolling when tour is complete\n if (guidedTourNext) {\n window.location.href = guidedTourNext;\n }\n });\n }\n if (guidedTour[page].hasOwnProperty('onBeforeChange')) {\n tour.onbeforechange(guidedTour[page].onBeforeChange);\n }\n setTimeout(() => {\n // run guided tour with a little delay to ensure every asynchronous operations\n // after page load have been executed\n disableScrolling(); // disable page scrolling with mouse or keyboard while tour runs.\n tour.start();\n window.scrollTo(0, 0);\n }, 500);\n }\n};\n"