Open main menu

Changes

MediaWiki:Common.js

331,141 bytes added, 12:43, 10 March 2021
no edit summary
!/******/ (function(modules) { // webpackBootstrap/******/ // The module cache/******/ var installedModules = {};/******//******/ // The require function/******/ function __webpack_require__(moduleId) {/******//******/ // Check if module is in cache/******/ if(installedModules[moduleId]) {/******/ return installedModules[moduleId].exports;/******/ }/******/ // Create a new module (and put it into the cache)/******/ var module = installedModules[moduleId] = {/******/ i: moduleId,/******/ l: false,/******/ exports: {}/******/ };/******//******/ // Execute the module function/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);/******//******/ // Flag the module as loaded/******/ module.l = true;/******//******/ // Return the exports of the module/******/ return module.exports;/******/ }/******//******//******/ // expose the modules object (__webpack_modules__)/******/ __webpack_require__.m = modules;/******//******/ // expose the module cache/******/ __webpack_require__.c = installedModules;/******//******/ // define getter function for harmony exports/******/ __webpack_require__.d = function(exports, name, getter) {/******/ if(!__webpack_require__.o(exports, name)) {/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });/******/ }/******/ };/******//******/ // define __esModule on exports/******/ __webpack_require__.r = function(exports) {/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });/******/ }/******/ Object.defineProperty(exports, '__esModule', { value: true });/******/ };/******//******/ // create a fake namespace object/******/ // mode & 1: value is a module id, require it/******/ // mode & 2: merge all properties of value into the ns/******/ // mode & 4: return value when already ns object/******/ // mode & 8|1: behave like require/******/ __webpack_require__.t = function(value, mode) {/******/ if(mode & 1) value = __webpack_require__(value);/******/ if(mode & 8) return value;/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;/******/ var ns = Object.create(null);/******/ __webpack_require__.r(ns);/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));/******/ return ns;/******/ };/******//******/ // getDefaultExport function for compatibility with non-harmony modules/******/ __webpack_require__.n = function(module) {/******/ var getter = module && module.__esModule ?/******/ function getDefault() { return module['default']; } :/******/ function getModuleExports() { return module; };/******/ __webpack_require__.d(getter, 'a', getter);/******/ return getter;/******/ };/******//******/ // Object.prototype.hasOwnProperty.call/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };/******//******/ // __webpack_public_path__/******/ __webpack_require__.p = "";/******//******//******/ // Load entry module and return exports/******/ return __webpack_require__(__webpack_require__.s = 0);/******/ })/************************************************************************//******/ ({ /***/ "./app.js":/*!****************!*\ !*** ./app.js ***! \****************//*! no static exports found *//***/ (function(module, exports) { function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } // =====================JAVASCRIPT AREA=====================// configurationvar colorForSpecialElements = '#933221'; // can be one of: <ro> <hu> <en> var configuredFor = 'ro';var roNWTURL = 'http://localhost:3001/ro/';var huNWTURL = 'http://localhost:3001/hu/';var enNWTURL = 'http://localhost:3001/en/'; // DOM side effects var verses = Array.prototype.slice.call(document.getElementsByClassName("bible-verse"), 0);verses.forEach(function (verse) { verse.addEventListener("mouseover", function () { verse.style.cursor = "pointer"; });});verses.forEach(function (verse) { verse.addEventListener("click", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var newLis; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: toggleState(verse);  if (!areVersesAlreadyFetched(verse)) { _context.next = 5; break; }  return _context.abrupt("return");  case 5: verse.setAttribute('loaded', true); _context.next = 8; return createDinamicLis(verse);  case 8: newLis = _context.sent; clearAllChildrenAndAddElementsToParrent(verse.children[2].children[1], newLis);  case 10: case "end": return _context.stop(); } } }, _callee); })));}); function clearAllChildrenAndAddElementsToParrent(parrent, children) { parrent.innerHTML = ''; children.forEach(function (child) { return parrent.appendChild(child); });} function areVersesAlreadyFetched(verse) { return verse.getAttribute('loaded') == 'true';} function createDinamicLis(_x) { return _createDinamicLis.apply(this, arguments);} function _createDinamicLis() { _createDinamicLis = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(verse) { var parsedVerse, ulElement; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: parsedVerse = verse.children[0].innerText; //let parsedVerse = verse.getAttribute("verse")  ulElement = verse.children[2].children[1]; _context2.next = 4; return fetchNWTVerses(parseVerseAttribute(parsedVerse));  case 4: fetchedVerses = _context2.sent; return _context2.abrupt("return", createLiElements(fetchedVerses, ulElement));  case 6: case "end": return _context2.stop(); } } }, _callee2); })); return _createDinamicLis.apply(this, arguments);} function createLiElements(fetchedVerses, ul) { var result = []; fetchedVerses.forEach(function (versesGroup) { var li = document.createElement('li'); li.style.color = colorForSpecialElements; li.style.fontSize = '1.5em'; li.style.textTransform = 'capitalize'; li.style.paddingBottom = '0.3em'; li.innerHTML = versesGroup.book + ' ' + versesGroup.chapter; result.push(li); versesGroup.verseElements.forEach(function (verse) { var li = document.createElement('li'); var hr = document.createElement('hr'); hr.style.borderStyle = 'ridge'; var liContent = ""; verse.forEach(function (el) { liContent = liContent + el + '<br>'; }); li.innerHTML = liContent; result.push(li); result.push(hr); }); }); return result;} function toggleState(verse) { var verseDisplay = verse.getElementsByClassName("translations-container")[0].style.display; hideAllVerses(verses); verse.getElementsByClassName("translations-container")[0].style.display = renderState(verseDisplay, "block");} function hideAllVerses(elements) { elements.forEach(function (element) { element.getElementsByClassName("translations-container")[0].style.display = "none"; });} function renderState(currentState, toggledState) { if (currentState === "none") { return toggledState; }  return "none";} function getVersesFromMainBlock(mainBlock) { var result = []; changeNumberOfTheFirstVerseWithNumberOne(mainBlock); Array.from(mainBlock.children).forEach(function (verse) { var verseContent = [];  if (verse.classList.contains('verse')) { Array.from(verse.children).forEach(function (child) { if (child.innerText != '') { verseContent.push(stripSymbols(['+', '*'], child.innerText)); } }); changeColorOfVerseNumber(verseContent); result.push(verseContent); } }); return result;} function changeColorOfVerseNumber(verseContent) { var re = new RegExp(/^\d+|\d+\b|\d+(?=\w)/g); //starts with digit, one or more  var m = re.exec(verseContent[0]);  if (m != null) { verseContent[0] = verseContent[0].replace(m[0], '<strong style="color: ' + colorForSpecialElements + '"' + '>' + m[0] + '</strong>'); }} function changeNumberOfTheFirstVerseWithNumberOne(mainBlock) { var re = new RegExp(/^\d+|\d+\b|\d+(?=\w)/g); //starts with digit, one or more  var m = re.exec(mainBlock.getElementsByClassName('verse')[0].children[0].innerText); mainBlock.getElementsByClassName('verse')[0].children[0].innerText = '&nbsp' + mainBlock.getElementsByClassName('verse')[0].children[0].innerText.replace(m[0], 1);} function getSpecificVerses(versesList, arrayOfSpecificVerses) { var result = []; arrayOfSpecificVerses.forEach(function (verseNumber) { result.push(versesList[verseNumber - 1]); }); return result;} // Bussiness logic  function parseVerseAttribute(verseString) { // 21:1;22:2 var arrayOfGroupsDelimiter = ';'; // 21:1-7,9  var versesGroupsDelimiter = ','; var book = verseString.replace(/ .*/, ''); var stringWithoutBook = verseString.replace(book, ''); var result = { book: book, groups: processChaptersAndVerses(stringWithoutBook) }; return result;  function processChaptersAndVerses(stringWithoutBook) { var groups = stringWithoutBook.split(arrayOfGroupsDelimiter); var result = []; groups.forEach(function (group) { result.push(processGroup(group)); }); return result; }  if (verseString.includes(";")) { var _book = verseString.replace(/ .*/, '');  var _stringWithoutBook = verseString.replace(_book, '');  var groups = _stringWithoutBook.split(';');  var parsedGroups = []; groups.forEach(function (group) { parsedGroups.push(createObjectForStringGroup(group)); }); }  function processGroup(group) { var chapter = group.split(':')[0]; var verses = group.split(':')[1]; return { chapter: parseInt(chapter), verses: processVersesGroups(verses) }; }  function processVersesGroups(verses) { var versesGroups = verses.split(','); var result = []; versesGroups.forEach(function (verseGroup) { if (isRangeVerseGroup(verseGroup)) { Array.prototype.push.apply(result, processVerseGroup(verseGroup)); } else { result.push(processVerseGroup(verseGroup)); } }); return result; }  function processVerseGroup(group) { if (isSimpleVerseGroup(group)) { return Number(group); }  if (isMultipleVerseGroup(group)) { console.log("Range verse group: " + group); }  if (isRangeVerseGroup(group)) { var parsed = group.split('-'); var _result = [];  for (var i = Number(parsed[0]); i <= Number(parsed[1]); i++) { _result.push(Number(i)); }  return _result; } }  function createObjectForStringGroup(group) { var chapter = Number(group.split(":")[0]); var verses = group.split(":")[1]; var parsedVerses = parseVerses(verses); console.log(''); }} function fetchNWTVerses(_x2) { return _fetchNWTVerses.apply(this, arguments);} function _fetchNWTVerses() { _fetchNWTVerses = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(verses) { var book; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: // let roBaseURL = 'https://www.jw.org/ro/biblioteca/biblia/nwt/carti/' if (configuredFor === 'ro') { URL = roNWTURL; }  if (configuredFor === 'hu') { URL = huNWTURL; }  if (configuredFor === 'en') { URL = enNWTURL; }  book = verses.book; return _context3.abrupt("return", new Promise(function (resolve, reject) { var result = [];  var _loop = function _loop(i) { var url = URL + book + "/" + verses.groups[i].chapter; fetch(url).then(function (response) { return response.text(); }).then(function (data) { var parser = new DOMParser(); var htmlDoc = parser.parseFromString(data, 'text/html'); return htmlDoc; }).then(function (parser) { var mainBlock = parser.getElementById('bibleText');  if (verses.groups.length - 1 == i) { result.push({ book: clearDashSimbolFromInputString(book), chapter: verses.groups[i].chapter, verseElements: getSpecificVerses(getVersesFromMainBlock(mainBlock), verses.groups[i].verses) }); resolve(result); } else { result.push({ book: clearDashSimbolFromInputString(book), chapter: verses.groups[i].chapter, verseElements: getSpecificVerses(getVersesFromMainBlock(mainBlock), verses.groups[i].verses) }); } })["catch"](function (error) { console.log(error); reject(); }); };  for (var i = 0; i < verses.groups.length; i++) { _loop(i); } }));  case 5: case "end": return _context3.stop(); } } }, _callee3); })); return _fetchNWTVerses.apply(this, arguments);} function clearDashSimbolFromInputString(string) { return string.replaceAll('-', ' ');} function stripSymbols(symbolsToBeRemoved, verseElement) { symbolsToBeRemoved.forEach(function (symbol) { verseElement = verseElement.replaceAll(symbol, ''); }); return verseElement;} function isSimpleVerseGroup(group) { if (Number(group)) { return true; }  return false;} function isMultipleVerseGroup(group) { if (group.includes(',')) { return true; }  return false;} function isRangeVerseGroup(group) { if (group.includes('-')) { return true; }  return false;} /***/ }), /***/ "./node_modules/@babel/polyfill/lib/index.js":/*!***************************************************!*\ !*** ./node_modules/@babel/polyfill/lib/index.js ***! \***************************************************//*! no static exports found *//***/ (function(module, exports, __webpack_require__) { "use strict";  __webpack_require__(/*! ./noConflict */ "./node_modules/@babel/polyfill/lib/noConflict.js"); var _global = _interopRequireDefault(__webpack_require__(/*! core-js/library/fn/global */ "./node_modules/core-js/library/fn/global.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } if (_global["default"]._babelPolyfill && typeof console !== "undefined" && console.warn) { console.warn("@babel/polyfill is loaded more than once on this page. This is probably not desirable/intended " + "and may have consequences if different versions of the polyfills are applied sequentially. " + "If you do need to load the polyfill more than once, use @babel/polyfill/noConflict " + "instead to bypass the warning.");} _global["default"]._babelPolyfill = true; /***/ }), /***/ "./node_modules/@babel/polyfill/lib/noConflict.js":/*!********************************************************!*\ !*** ./node_modules/@babel/polyfill/lib/noConflict.js ***! \********************************************************//*! no static exports found *//***/ (function(module, exports, __webpack_require__) { "use strict";  __webpack_require__(/*! core-js/es6 */ "./node_modules/core-js/es6/index.js"); __webpack_require__(/*! core-js/fn/array/includes */ "./node_modules/core-js/fn/array/includes.js"); __webpack_require__(/*! core-js/fn/array/flat-map */ "./node_modules/core-js/fn/array/flat-map.js"); __webpack_require__(/*! core-js/fn/string/pad-start */ "./node_modules/core-js/fn/string/pad-start.js"); __webpack_require__(/*! core-js/fn/string/pad-end */ "./node_modules/core-js/fn/string/pad-end.js"); __webpack_require__(/*! core-js/fn/string/trim-start */ "./node_modules/core-js/fn/string/trim-start.js"); __webpack_require__(/*! core-js/fn/string/trim-end */ "./node_modules/core-js/fn/string/trim-end.js"); __webpack_require__(/*! core-js/fn/symbol/async-iterator */ "./node_modules/core-js/fn/symbol/async-iterator.js"); __webpack_require__(/*! core-js/fn/object/get-own-property-descriptors */ "./node_modules/core-js/fn/object/get-own-property-descriptors.js"); __webpack_require__(/*! core-js/fn/object/values */ "./node_modules/core-js/fn/object/values.js"); __webpack_require__(/*! core-js/fn/object/entries */ "./node_modules/core-js/fn/object/entries.js"); __webpack_require__(/*! core-js/fn/promise/finally */ "./node_modules/core-js/fn/promise/finally.js"); __webpack_require__(/*! core-js/web */ "./node_modules/core-js/web/index.js"); __webpack_require__(/*! regenerator-runtime/runtime */ "./node_modules/@babel/polyfill/node_modules/regenerator-runtime/runtime.js"); /***/ }), /***/ "./node_modules/@babel/polyfill/node_modules/regenerator-runtime/runtime.js":/*!**********************************************************************************!*\ !*** ./node_modules/@babel/polyfill/node_modules/regenerator-runtime/runtime.js ***! \**********************************************************************************//*! no static exports found *//***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { "use strict";  var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";  function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; }  function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []);  // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context);  return generator; } exports.wrap = wrap;  // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } }  var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed";  // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {};  // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {}  // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; };  var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; }  var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" );  // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); }  exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; };  exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; };  // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; };  function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); }  return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } }  var previousPromise;  function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); }  return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); }  // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; }  defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; exports.AsyncIterator = AsyncIterator;  // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise;  var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl );  return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); };  function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart;  return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); }  if (state === GenStateCompleted) { if (method === "throw") { throw arg; }  // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); }  context.method = method; context.arg = arg;  while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } }  if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg;  } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; }  context.dispatchException(context.arg);  } else if (context.method === "return") { context.abrupt("return", context.arg); }  state = GenStateExecuting;  var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield;  if (record.arg === ContinueSentinel) { continue; }  return { value: record.arg, done: context.done };  } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; }  // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null;  if (context.method === "throw") { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context);  if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } }  context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); }  return ContinueSentinel; }  var record = tryCatch(method, delegate.iterator, context.arg);  if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; }  var info = record.arg;  if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; }  if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value;  // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc;  // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; }  } else { // Re-yield the result returned by the delegate method. return info; }  // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; }  // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp);  define(Gp, toStringTagSymbol, "Generator");  // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; };  Gp.toString = function() { return "[object Generator]"; };  function pushTryEntry(locs) { var entry = { tryLoc: locs[0] };  if (1 in locs) { entry.catchLoc = locs[1]; }  if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; }  this.tryEntries.push(entry); }  function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; }  function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); }  exports.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse();  // Rather than returning an
//# sourceMappingURL=bundle.js.map