UNPKG

@memori.ai/memori-webcomponent

Version:

WebComponent to integrate a Memori in your app or website

1,038 lines (1,012 loc) 8.04 MB
// modules are defined as an array // [ module function, map of requires ] // // map of requires is short require name -> numeric require // // anything defined in a previous bundle is accessed via the // orig method which is the require for previous bundles (function (modules, entry, mainEntry, parcelRequireName, globalName) { /* eslint-disable no-undef */ var globalObject = typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}; /* eslint-enable no-undef */ // Save the require from previous bundle to this closure if any var previousRequire = typeof globalObject[parcelRequireName] === 'function' && globalObject[parcelRequireName]; var cache = previousRequire.cache || {}; // Do not use `require` to prevent Webpack from trying to bundle this call var nodeRequire = typeof module !== 'undefined' && typeof module.require === 'function' && module.require.bind(module); function newRequire(name, jumped) { if (!cache[name]) { if (!modules[name]) { // if we cannot find the module within our internal map or // cache jump to the current global require ie. the last bundle // that was added to the page. var currentRequire = typeof globalObject[parcelRequireName] === 'function' && globalObject[parcelRequireName]; if (!jumped && currentRequire) { return currentRequire(name, true); } // If there are other bundles on this page the require from the // previous one is saved to 'previousRequire'. Repeat this as // many times as there are bundles until the module is found or // we exhaust the require chain. if (previousRequire) { return previousRequire(name, true); } // Try the node require function if it exists. if (nodeRequire && typeof name === 'string') { return nodeRequire(name); } var err = new Error("Cannot find module '" + name + "'"); err.code = 'MODULE_NOT_FOUND'; throw err; } localRequire.resolve = resolve; localRequire.cache = {}; var module = (cache[name] = new newRequire.Module(name)); modules[name][0].call( module.exports, localRequire, module, module.exports, this ); } return cache[name].exports; function localRequire(x) { var res = localRequire.resolve(x); return res === false ? {} : newRequire(res); } function resolve(x) { var id = modules[name][1][x]; return id != null ? id : x; } } function Module(moduleName) { this.id = moduleName; this.bundle = newRequire; this.exports = {}; } newRequire.isParcelRequire = true; newRequire.Module = Module; newRequire.modules = modules; newRequire.cache = cache; newRequire.parent = previousRequire; newRequire.register = function (id, exports) { modules[id] = [ function (require, module) { module.exports = exports; }, {}, ]; }; Object.defineProperty(newRequire, 'root', { get: function () { return globalObject[parcelRequireName]; }, }); globalObject[parcelRequireName] = newRequire; for (var i = 0; i < entry.length; i++) { newRequire(entry[i]); } if (mainEntry) { // Expose entry point to Node, AMD or browser globals // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js var mainExports = newRequire(mainEntry); // CommonJS if (typeof exports === 'object' && typeof module !== 'undefined') { module.exports = mainExports; // RequireJS } else if (typeof define === 'function' && define.amd) { define(function () { return mainExports; }); // <script> } else if (globalName) { this[globalName] = mainExports; } } })({"1xC6H":[function(require,module,exports) { var Refresh = require("react-refresh/runtime"); var ErrorOverlay = require("react-error-overlay"); Refresh.injectIntoGlobalHook(window); window.$RefreshReg$ = function() {}; window.$RefreshSig$ = function() { return function(type) { return type; }; }; ErrorOverlay.setEditorHandler(function editorHandler(errorLocation) { let file = `${errorLocation.fileName}:${errorLocation.lineNumber || 1}:${errorLocation.colNumber || 1}`; fetch(`/__parcel_launch_editor?file=${encodeURIComponent(file)}`); }); ErrorOverlay.startReportingRuntimeErrors({ onError: function() {} }); window.addEventListener("parcelhmraccept", ()=>{ ErrorOverlay.dismissRuntimeErrors(); }); },{"react-refresh/runtime":"786KC","react-error-overlay":"1dldy"}],"786KC":[function(require,module,exports) { "use strict"; module.exports = require("./cjs/react-refresh-runtime.development.js"); },{"./cjs/react-refresh-runtime.development.js":"hdge7"}],"hdge7":[function(require,module,exports) { /** @license React v0.9.0 * react-refresh-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ "use strict"; (function() { "use strict"; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var REACT_ELEMENT_TYPE = 0xeac7; var REACT_PORTAL_TYPE = 0xeaca; var REACT_FRAGMENT_TYPE = 0xeacb; var REACT_STRICT_MODE_TYPE = 0xeacc; var REACT_PROFILER_TYPE = 0xead2; var REACT_PROVIDER_TYPE = 0xeacd; var REACT_CONTEXT_TYPE = 0xeace; var REACT_FORWARD_REF_TYPE = 0xead0; var REACT_SUSPENSE_TYPE = 0xead1; var REACT_SUSPENSE_LIST_TYPE = 0xead8; var REACT_MEMO_TYPE = 0xead3; var REACT_LAZY_TYPE = 0xead4; var REACT_BLOCK_TYPE = 0xead9; var REACT_SERVER_BLOCK_TYPE = 0xeada; var REACT_FUNDAMENTAL_TYPE = 0xead5; var REACT_SCOPE_TYPE = 0xead7; var REACT_OPAQUE_ID_TYPE = 0xeae0; var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1; var REACT_OFFSCREEN_TYPE = 0xeae2; var REACT_LEGACY_HIDDEN_TYPE = 0xeae3; if (typeof Symbol === "function" && Symbol.for) { var symbolFor = Symbol.for; REACT_ELEMENT_TYPE = symbolFor("react.element"); REACT_PORTAL_TYPE = symbolFor("react.portal"); REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); REACT_PROFILER_TYPE = symbolFor("react.profiler"); REACT_PROVIDER_TYPE = symbolFor("react.provider"); REACT_CONTEXT_TYPE = symbolFor("react.context"); REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); REACT_MEMO_TYPE = symbolFor("react.memo"); REACT_LAZY_TYPE = symbolFor("react.lazy"); REACT_BLOCK_TYPE = symbolFor("react.block"); REACT_SERVER_BLOCK_TYPE = symbolFor("react.server.block"); REACT_FUNDAMENTAL_TYPE = symbolFor("react.fundamental"); REACT_SCOPE_TYPE = symbolFor("react.scope"); REACT_OPAQUE_ID_TYPE = symbolFor("react.opaque.id"); REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); } var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map; // We never remove these associations. // It's OK to reference families, but use WeakMap/Set for types. var allFamiliesByID = new Map(); var allFamiliesByType = new PossiblyWeakMap(); var allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families // that have actually been edited here. This keeps checks fast. // $FlowIssue var updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call. // It is an array of [Family, NextType] tuples. var pendingUpdates = []; // This is injected by the renderer via DevTools global hook. var helpersByRendererID = new Map(); var helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates. var mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit. var failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root. // It needs to be weak because we do this even for roots that failed to mount. // If there is no WeakMap, we won't attempt to do retrying. // $FlowIssue var rootElements = typeof WeakMap === "function" ? new WeakMap() : null; var isPerformingRefresh = false; function computeFullKey(signature) { if (signature.fullKey !== null) return signature.fullKey; var fullKey = signature.ownKey; var hooks; try { hooks = signature.getCustomHooks(); } catch (err) { // This can happen in an edge case, e.g. if expression like Foo.useSomething // depends on Foo which is lazily initialized during rendering. // In that case just assume we'll have to remount. signature.forceReset = true; signature.fullKey = fullKey; return fullKey; } for(var i = 0; i < hooks.length; i++){ var hook = hooks[i]; if (typeof hook !== "function") { // Something's wrong. Assume we need to remount. signature.forceReset = true; signature.fullKey = fullKey; return fullKey; } var nestedHookSignature = allSignaturesByType.get(hook); if (nestedHookSignature === undefined) continue; var nestedHookKey = computeFullKey(nestedHookSignature); if (nestedHookSignature.forceReset) signature.forceReset = true; fullKey += "\n---\n" + nestedHookKey; } signature.fullKey = fullKey; return fullKey; } function haveEqualSignatures(prevType, nextType) { var prevSignature = allSignaturesByType.get(prevType); var nextSignature = allSignaturesByType.get(nextType); if (prevSignature === undefined && nextSignature === undefined) return true; if (prevSignature === undefined || nextSignature === undefined) return false; if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) return false; if (nextSignature.forceReset) return false; return true; } function isReactClass(type) { return type.prototype && type.prototype.isReactComponent; } function canPreserveStateBetween(prevType, nextType) { if (isReactClass(prevType) || isReactClass(nextType)) return false; if (haveEqualSignatures(prevType, nextType)) return true; return false; } function resolveFamily(type) { // Only check updated types to keep lookups fast. return updatedFamiliesByType.get(type); } // If we didn't care about IE11, we could use new Map/Set(iterable). function cloneMap(map) { var clone = new Map(); map.forEach(function(value, key) { clone.set(key, value); }); return clone; } function cloneSet(set) { var clone = new Set(); set.forEach(function(value) { clone.add(value); }); return clone; } function performReactRefresh() { if (pendingUpdates.length === 0) return null; if (isPerformingRefresh) return null; isPerformingRefresh = true; try { var staleFamilies = new Set(); var updatedFamilies = new Set(); var updates = pendingUpdates; pendingUpdates = []; updates.forEach(function(_ref) { var family = _ref[0], nextType = _ref[1]; // Now that we got a real edit, we can create associations // that will be read by the React reconciler. var prevType = family.current; updatedFamiliesByType.set(prevType, family); updatedFamiliesByType.set(nextType, family); family.current = nextType; // Determine whether this should be a re-render or a re-mount. if (canPreserveStateBetween(prevType, nextType)) updatedFamilies.add(family); else staleFamilies.add(family); }); // TODO: rename these fields to something more meaningful. var update = { updatedFamilies: updatedFamilies, // Families that will re-render preserving state staleFamilies: staleFamilies // Families that will be remounted }; helpersByRendererID.forEach(function(helpers) { // Even if there are no roots, set the handler on first update. // This ensures that if *new* roots are mounted, they'll use the resolve handler. helpers.setRefreshHandler(resolveFamily); }); var didError = false; var firstError = null; // We snapshot maps and sets that are mutated during commits. // If we don't do this, there is a risk they will be mutated while // we iterate over them. For example, trying to recover a failed root // may cause another root to be added to the failed list -- an infinite loop. var failedRootsSnapshot = cloneSet(failedRoots); var mountedRootsSnapshot = cloneSet(mountedRoots); var helpersByRootSnapshot = cloneMap(helpersByRoot); failedRootsSnapshot.forEach(function(root) { var helpers = helpersByRootSnapshot.get(root); if (helpers === undefined) throw new Error("Could not find helpers for a root. This is a bug in React Refresh."); failedRoots.has(root); if (rootElements === null) return; if (!rootElements.has(root)) return; var element = rootElements.get(root); try { helpers.scheduleRoot(root, element); } catch (err) { if (!didError) { didError = true; firstError = err; } // Keep trying other roots. } }); mountedRootsSnapshot.forEach(function(root) { var helpers = helpersByRootSnapshot.get(root); if (helpers === undefined) throw new Error("Could not find helpers for a root. This is a bug in React Refresh."); mountedRoots.has(root); try { helpers.scheduleRefresh(root, update); } catch (err) { if (!didError) { didError = true; firstError = err; } // Keep trying other roots. } }); if (didError) throw firstError; return update; } finally{ isPerformingRefresh = false; } } function register(type, id) { if (type === null) return; if (typeof type !== "function" && typeof type !== "object") return; // This can happen in an edge case, e.g. if we register // return value of a HOC but it returns a cached component. // Ignore anything but the first registration for each type. if (allFamiliesByType.has(type)) return; // Create family or remember to update it. // None of this bookkeeping affects reconciliation // until the first performReactRefresh() call above. var family = allFamiliesByID.get(id); if (family === undefined) { family = { current: type }; allFamiliesByID.set(id, family); } else pendingUpdates.push([ family, type ]); allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them. if (typeof type === "object" && type !== null) switch(type.$$typeof){ case REACT_FORWARD_REF_TYPE: register(type.render, id + "$render"); break; case REACT_MEMO_TYPE: register(type.type, id + "$type"); break; } } function setSignature(type, key) { var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined; allSignaturesByType.set(type, { forceReset: forceReset, ownKey: key, fullKey: null, getCustomHooks: getCustomHooks || function() { return []; } }); } // This is lazily called during first render for a type. // It captures Hook list at that time so inline requires don't break comparisons. function collectCustomHooksForSignature(type) { var signature = allSignaturesByType.get(type); if (signature !== undefined) computeFullKey(signature); } function getFamilyByID(id) { return allFamiliesByID.get(id); } function getFamilyByType(type) { return allFamiliesByType.get(type); } function findAffectedHostInstances(families) { var affectedInstances = new Set(); mountedRoots.forEach(function(root) { var helpers = helpersByRoot.get(root); if (helpers === undefined) throw new Error("Could not find helpers for a root. This is a bug in React Refresh."); var instancesForRoot = helpers.findHostInstancesForRefresh(root, families); instancesForRoot.forEach(function(inst) { affectedInstances.add(inst); }); }); return affectedInstances; } function injectIntoGlobalHook(globalObject) { // For React Native, the global hook will be set up by require('react-devtools-core'). // That code will run before us. So we need to monkeypatch functions on existing hook. // For React Web, the global hook will be set up by the extension. // This will also run before us. var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook === undefined) { // However, if there is no DevTools extension, we'll need to set up the global hook ourselves. // Note that in this case it's important that renderer code runs *after* this method call. // Otherwise, the renderer will think that there is no global hook, and won't do the injection. var nextID = 0; globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = { renderers: new Map(), supportsFiber: true, inject: function(injected) { return nextID++; }, onScheduleFiberRoot: function(id, root, children) {}, onCommitFiberRoot: function(id, root, maybePriorityLevel, didError) {}, onCommitFiberUnmount: function() {} }; } // Here, we just want to get a reference to scheduleRefresh. var oldInject = hook.inject; hook.inject = function(injected) { var id = oldInject.apply(this, arguments); if (typeof injected.scheduleRefresh === "function" && typeof injected.setRefreshHandler === "function") // This version supports React Refresh. helpersByRendererID.set(id, injected); return id; }; // Do the same for any already injected roots. // This is useful if ReactDOM has already been initialized. // https://github.com/facebook/react/issues/17626 hook.renderers.forEach(function(injected, id) { if (typeof injected.scheduleRefresh === "function" && typeof injected.setRefreshHandler === "function") // This version supports React Refresh. helpersByRendererID.set(id, injected); }); // We also want to track currently mounted roots. var oldOnCommitFiberRoot = hook.onCommitFiberRoot; var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function() {}; hook.onScheduleFiberRoot = function(id, root, children) { if (!isPerformingRefresh) { // If it was intentionally scheduled, don't attempt to restore. // This includes intentionally scheduled unmounts. failedRoots.delete(root); if (rootElements !== null) rootElements.set(root, children); } return oldOnScheduleFiberRoot.apply(this, arguments); }; hook.onCommitFiberRoot = function(id, root, maybePriorityLevel, didError) { var helpers = helpersByRendererID.get(id); if (helpers === undefined) return; helpersByRoot.set(root, helpers); var current = root.current; var alternate = current.alternate; // We need to determine whether this root has just (un)mounted. // This logic is copy-pasted from similar logic in the DevTools backend. // If this breaks with some refactoring, you'll want to update DevTools too. if (alternate !== null) { var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null; var isMounted = current.memoizedState != null && current.memoizedState.element != null; if (!wasMounted && isMounted) { // Mount a new root. mountedRoots.add(root); failedRoots.delete(root); } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) { // Unmount an existing root. mountedRoots.delete(root); if (didError) // We'll remount it on future edits. failedRoots.add(root); else helpersByRoot.delete(root); } else if (!wasMounted && !isMounted) { if (didError) // We'll remount it on future edits. failedRoots.add(root); } } else // Mount a new root. mountedRoots.add(root); return oldOnCommitFiberRoot.apply(this, arguments); }; } function hasUnrecoverableErrors() { // TODO: delete this after removing dependency in RN. return false; } // Exposed for testing. function _getMountedRootCount() { return mountedRoots.size; } // This is a wrapper over more primitive functions for setting signature. // Signatures let us decide whether the Hook order has changed on refresh. // // This function is intended to be used as a transform target, e.g.: // var _s = createSignatureFunctionForTransform() // // function Hello() { // const [foo, setFoo] = useState(0); // const value = useCustomHook(); // _s(); /* Second call triggers collecting the custom Hook list. // * This doesn't happen during the module evaluation because we // * don't want to change the module order with inline requires. // * Next calls are noops. */ // return <h1>Hi</h1>; // } // // /* First call specifies the signature: */ // _s( // Hello, // 'useState{[foo, setFoo]}(0)', // () => [useCustomHook], /* Lazy to avoid triggering inline requires */ // ); function createSignatureFunctionForTransform() { // We'll fill in the signature in two steps. // First, we'll know the signature itself. This happens outside the component. // Then, we'll know the references to custom Hooks. This happens inside the component. // After that, the returned function will be a fast path no-op. var status = "needsSignature"; var savedType; var hasCustomHooks; return function(type, key, forceReset, getCustomHooks) { switch(status){ case "needsSignature": if (type !== undefined) { // If we received an argument, this is the initial registration call. savedType = type; hasCustomHooks = typeof getCustomHooks === "function"; setSignature(type, key, forceReset, getCustomHooks); // The next call we expect is from inside a function, to fill in the custom Hooks. status = "needsCustomHooks"; } break; case "needsCustomHooks": if (hasCustomHooks) collectCustomHooksForSignature(savedType); status = "resolved"; break; } return type; }; } function isLikelyComponentType(type) { switch(typeof type){ case "function": // First, deal with classes. if (type.prototype != null) { if (type.prototype.isReactComponent) // React class. return true; var ownNames = Object.getOwnPropertyNames(type.prototype); if (ownNames.length > 1 || ownNames[0] !== "constructor") // This looks like a class. return false; // eslint-disable-next-line no-proto if (type.prototype.__proto__ !== Object.prototype) // It has a superclass. return false; // Pass through. // This looks like a regular function with empty prototype. } // For plain functions and arrows, use name as a heuristic. var name = type.name || type.displayName; return typeof name === "string" && /^[A-Z]/.test(name); case "object": if (type != null) switch(type.$$typeof){ case REACT_FORWARD_REF_TYPE: case REACT_MEMO_TYPE: // Definitely React components. return true; default: return false; } return false; default: return false; } } exports._getMountedRootCount = _getMountedRootCount; exports.collectCustomHooksForSignature = collectCustomHooksForSignature; exports.createSignatureFunctionForTransform = createSignatureFunctionForTransform; exports.findAffectedHostInstances = findAffectedHostInstances; exports.getFamilyByID = getFamilyByID; exports.getFamilyByType = getFamilyByType; exports.hasUnrecoverableErrors = hasUnrecoverableErrors; exports.injectIntoGlobalHook = injectIntoGlobalHook; exports.isLikelyComponentType = isLikelyComponentType; exports.performReactRefresh = performReactRefresh; exports.register = register; exports.setSignature = setSignature; })(); },{}],"1dldy":[function(require,module,exports) { var process = require("process"); !function(e, t) { module.exports = t(); }(window, function() { return function(e) { var t = {}; function r(n) { if (t[n]) return t[n].exports; var o = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(o.exports, o, o.exports, r), o.l = !0, o.exports; } return r.m = e, r.c = t, r.d = function(e, t, n) { r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }); }, r.r = function(e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }, r.t = function(e, t) { if (1 & t && (e = r(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for(var o in e)r.d(n, o, (function(t) { return e[t]; }).bind(null, o)); return n; }, r.n = function(e) { var t = e && e.__esModule ? function() { return e.default; } : function() { return e; }; return r.d(t, "a", t), t; }, r.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t); }, r.p = "", r(r.s = 15); }([ function(e, t, r) { e.exports = r(8); }, function(e, t) { t.getArg = function(e, t, r) { if (t in e) return e[t]; if (3 === arguments.length) return r; throw new Error('"' + t + '" is a required argument.'); }; var r = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/, n = /^data:.+\,.+$/; function o(e) { var t = e.match(r); return t ? { scheme: t[1], auth: t[2], host: t[3], port: t[4], path: t[5] } : null; } function a(e) { var t = ""; return e.scheme && (t += e.scheme + ":"), t += "//", e.auth && (t += e.auth + "@"), e.host && (t += e.host), e.port && (t += ":" + e.port), e.path && (t += e.path), t; } function i(e) { var r = e, n = o(e); if (n) { if (!n.path) return e; r = n.path; } for(var i, l = t.isAbsolute(r), u = r.split(/\/+/), c = 0, s = u.length - 1; s >= 0; s--)"." === (i = u[s]) ? u.splice(s, 1) : ".." === i ? c++ : c > 0 && ("" === i ? (u.splice(s + 1, c), c = 0) : (u.splice(s, 2), c--)); return "" === (r = u.join("/")) && (r = l ? "/" : "."), n ? (n.path = r, a(n)) : r; } t.urlParse = o, t.urlGenerate = a, t.normalize = i, t.join = function(e, t) { "" === e && (e = "."), "" === t && (t = "."); var r = o(t), l = o(e); if (l && (e = l.path || "/"), r && !r.scheme) return l && (r.scheme = l.scheme), a(r); if (r || t.match(n)) return t; if (l && !l.host && !l.path) return l.host = t, a(l); var u = "/" === t.charAt(0) ? t : i(e.replace(/\/+$/, "") + "/" + t); return l ? (l.path = u, a(l)) : u; }, t.isAbsolute = function(e) { return "/" === e.charAt(0) || !!e.match(r); }, t.relative = function(e, t) { "" === e && (e = "."), e = e.replace(/\/$/, ""); for(var r = 0; 0 !== t.indexOf(e + "/");){ var n = e.lastIndexOf("/"); if (n < 0) return t; if ((e = e.slice(0, n)).match(/^([^\/]+:\/)?\/*$/)) return t; ++r; } return Array(r + 1).join("../") + t.substr(e.length + 1); }; var l = !("__proto__" in Object.create(null)); function u(e) { return e; } function c(e) { if (!e) return !1; var t = e.length; if (t < 9) return !1; if (95 !== e.charCodeAt(t - 1) || 95 !== e.charCodeAt(t - 2) || 111 !== e.charCodeAt(t - 3) || 116 !== e.charCodeAt(t - 4) || 111 !== e.charCodeAt(t - 5) || 114 !== e.charCodeAt(t - 6) || 112 !== e.charCodeAt(t - 7) || 95 !== e.charCodeAt(t - 8) || 95 !== e.charCodeAt(t - 9)) return !1; for(var r = t - 10; r >= 0; r--)if (36 !== e.charCodeAt(r)) return !1; return !0; } function s(e, t) { return e === t ? 0 : e > t ? 1 : -1; } t.toSetString = l ? u : function(e) { return c(e) ? "$" + e : e; }, t.fromSetString = l ? u : function(e) { return c(e) ? e.slice(1) : e; }, t.compareByOriginalPositions = function(e, t, r) { var n = e.source - t.source; return 0 !== n ? n : 0 !== (n = e.originalLine - t.originalLine) ? n : 0 !== (n = e.originalColumn - t.originalColumn) || r ? n : 0 !== (n = e.generatedColumn - t.generatedColumn) ? n : 0 !== (n = e.generatedLine - t.generatedLine) ? n : e.name - t.name; }, t.compareByGeneratedPositionsDeflated = function(e, t, r) { var n = e.generatedLine - t.generatedLine; return 0 !== n ? n : 0 !== (n = e.generatedColumn - t.generatedColumn) || r ? n : 0 !== (n = e.source - t.source) ? n : 0 !== (n = e.originalLine - t.originalLine) ? n : 0 !== (n = e.originalColumn - t.originalColumn) ? n : e.name - t.name; }, t.compareByGeneratedPositionsInflated = function(e, t) { var r = e.generatedLine - t.generatedLine; return 0 !== r ? r : 0 !== (r = e.generatedColumn - t.generatedColumn) ? r : 0 !== (r = s(e.source, t.source)) ? r : 0 !== (r = e.originalLine - t.originalLine) ? r : 0 !== (r = e.originalColumn - t.originalColumn) ? r : s(e.name, t.name); }; }, function(e, t) { function r(e, t) { for(var r = 0, n = e.length - 1; n >= 0; n--){ var o = e[n]; "." === o ? e.splice(n, 1) : ".." === o ? (e.splice(n, 1), r++) : r && (e.splice(n, 1), r--); } if (t) for(; r--; r)e.unshift(".."); return e; } function n(e, t) { if (e.filter) return e.filter(t); for(var r = [], n = 0; n < e.length; n++)t(e[n], n, e) && r.push(e[n]); return r; } t.resolve = function() { for(var e = "", t = !1, o = arguments.length - 1; o >= -1 && !t; o--){ var a = o >= 0 ? arguments[o] : process.cwd(); if ("string" != typeof a) throw new TypeError("Arguments to path.resolve must be strings"); a && (e = a + "/" + e, t = "/" === a.charAt(0)); } return (t ? "/" : "") + (e = r(n(e.split("/"), function(e) { return !!e; }), !t).join("/")) || "."; }, t.normalize = function(e) { var a = t.isAbsolute(e), i = "/" === o(e, -1); return (e = r(n(e.split("/"), function(e) { return !!e; }), !a).join("/")) || a || (e = "."), e && i && (e += "/"), (a ? "/" : "") + e; }, t.isAbsolute = function(e) { return "/" === e.charAt(0); }, t.join = function() { var e = Array.prototype.slice.call(arguments, 0); return t.normalize(n(e, function(e, t) { if ("string" != typeof e) throw new TypeError("Arguments to path.join must be strings"); return e; }).join("/")); }, t.relative = function(e, r) { function n(e) { for(var t = 0; t < e.length && "" === e[t]; t++); for(var r = e.length - 1; r >= 0 && "" === e[r]; r--); return t > r ? [] : e.slice(t, r - t + 1); } e = t.resolve(e).substr(1), r = t.resolve(r).substr(1); for(var o = n(e.split("/")), a = n(r.split("/")), i = Math.min(o.length, a.length), l = i, u = 0; u < i; u++)if (o[u] !== a[u]) { l = u; break; } var c = []; for(u = l; u < o.length; u++)c.push(".."); return (c = c.concat(a.slice(l))).join("/"); }, t.sep = "/", t.delimiter = ":", t.dirname = function(e) { if ("string" != typeof e && (e += ""), 0 === e.length) return "."; for(var t = e.charCodeAt(0), r = 47 === t, n = -1, o = !0, a = e.length - 1; a >= 1; --a)if (47 === (t = e.charCodeAt(a))) { if (!o) { n = a; break; } } else o = !1; return -1 === n ? r ? "/" : "." : r && 1 === n ? "/" : e.slice(0, n); }, t.basename = function(e, t) { var r = function(e) { "string" != typeof e && (e += ""); var t, r = 0, n = -1, o = !0; for(t = e.length - 1; t >= 0; --t)if (47 === e.charCodeAt(t)) { if (!o) { r = t + 1; break; } } else -1 === n && (o = !1, n = t + 1); return -1 === n ? "" : e.slice(r, n); }(e); return t && r.substr(-1 * t.length) === t && (r = r.substr(0, r.length - t.length)), r; }, t.extname = function(e) { "string" != typeof e && (e += ""); for(var t = -1, r = 0, n = -1, o = !0, a = 0, i = e.length - 1; i >= 0; --i){ var l = e.charCodeAt(i); if (47 !== l) -1 === n && (o = !1, n = i + 1), 46 === l ? -1 === t ? t = i : 1 !== a && (a = 1) : -1 !== t && (a = -1); else if (!o) { r = i + 1; break; } } return -1 === t || -1 === n || 0 === a || 1 === a && t === n - 1 && t === r + 1 ? "" : e.slice(t, n); }; var o = "b" === "ab".substr(-1) ? function(e, t, r) { return e.substr(t, r); } : function(e, t, r) { return t < 0 && (t = e.length + t), e.substr(t, r); }; }, function(e, t, r) { t.SourceMapGenerator = r(4).SourceMapGenerator, t.SourceMapConsumer = r(11).SourceMapConsumer, t.SourceNode = r(14).SourceNode; }, function(e, t, r) { var n = r(5), o = r(1), a = r(6).ArraySet, i = r(10).MappingList; function l(e) { e || (e = {}), this._file = o.getArg(e, "file", null), this._sourceRoot = o.getArg(e, "sourceRoot", null), this._skipValidation = o.getArg(e, "skipValidation", !1), this._sources = new a, this._names = new a, this._mappings = new i, this._sourcesContents = null; } l.prototype._version = 3, l.fromSourceMap = function(e) { var t = e.sourceRoot, r = new l({ file: e.file, sourceRoot: t }); return e.eachMapping(function(e) { var n = { generated: { line: e.generatedLine, column: e.generatedColumn } }; null != e.source && (n.source = e.source, null != t && (n.source = o.relative(t, n.source)), n.original = { line: e.originalLine, column: e.originalColumn }, null != e.name && (n.name = e.name)), r.addMapping(n); }), e.sources.forEach(function(t) { var n = e.sourceContentFor(t); null != n && r.setSourceContent(t, n); }), r; }, l.prototype.addMapping = function(e) { var t = o.getArg(e, "generated"), r = o.getArg(e, "original", null), n = o.getArg(e, "source", null), a = o.getArg(e, "name", null); this._skipValidation || this._validateMapping(t, r, n, a), null != n && (n = String(n), this._sources.has(n) || this._sources.add(n)), null != a && (a = String(a), this._names.has(a) || this._names.add(a)), this._mappings.add({ generatedLine: t.line, generatedColumn: t.column, originalLine: null != r && r.line, originalColumn: null != r && r.column, source: n, name: a }); }, l.prototype.setSourceContent = function(e, t) { var r = e; null != this._sourceRoot && (r = o.relative(this._sourceRoot, r)), null != t ? (this._sourcesContents || (this._sourcesContents = Object.create(null)), this._sourcesContents[o.toSetString(r)] = t) : this._sourcesContents && (delete this._sourcesContents[o.toSetString(r)], 0 === Object.keys(this._sourcesContents).length && (this._sourcesContents = null)); }, l.prototype.applySourceMap = function(e, t, r) { var n = t; if (null == t) { if (null == e.file) throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.'); n = e.file; } var i = this._sourceRoot; null != i && (n = o.relative(i, n)); var l = new a, u = new a; this._mappings.unsortedForEach(function(t) { if (t.source === n && null != t.originalLine) { var a = e.originalPositionFor({ line: t.originalLine, column: t.originalColumn }); null != a.source && (t.source = a.source, null != r && (t.source = o.join(r, t.source)), null != i && (t.source = o.relative(i, t.source)), t.originalLine = a.line, t.originalColumn = a.column, null != a.name && (t.name = a.name)); } var c = t.source; null == c || l.has(c) || l.add(c); var s = t.name; null == s || u.has(s) || u.add(s); }, this), this._sources = l, this._names = u, e.sources.forEach(function(t) { var n = e.sourceContentFor(t); null != n && (null != r && (t = o.join(r, t)), null != i && (t = o.relative(i, t)), this.setSourceContent(t, n)); }, this); }, l.prototype._validateMapping = function(e, t, r, n) { if (t && "number" != typeof t.line && "number" != typeof t.column) throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."); if ((!(e && "line" in e && "column" in e && e.line > 0 && e.column >= 0) || t || r || n) && !(e && "line" in e && "column" in e && t && "line" in t && "column" in t && e.line > 0 && e.column >= 0 && t.line > 0 && t.column >= 0 && r)) throw new Error("Invalid mapping: " + JSON.stringify({ generated: e, source: r, original: t, name: n })); }, l.prototype._serializeMappings = function() { for(var e, t, r, a, i = 0, l = 1, u = 0, c = 0, s = 0, f = 0, d = "", p = this._mappings.toArray(), h = 0, g = p.length; h < g; h++){ if (e = "", (t = p[h]).generatedLine !== l) for(i = 0; t.generatedLine !== l;)e += ";", l++; else if (h > 0) { if (!o.compareByGeneratedPositionsInflated(t, p[h - 1])) continue; e += ","; } e += n.encode(t.generatedColumn - i), i = t.generatedColumn, null != t.source && (a = this._sources.indexOf(t.source), e += n.encode(a - f), f = a, e += n.encode(t.originalLine - 1 - c), c = t.originalLine - 1, e += n.encode(t.originalColumn - u), u = t.originalColumn, null != t.name && (r = this._names.indexOf(t.name), e += n.encode(r - s), s = r)), d += e; } return d; }, l.prototype._generateSourcesContent = function(e, t) { return e.map(function(e) { if (!this._sourcesContents) return null; null != t && (e = o.relative(t, e)); var r = o.toSetString(e); return Object.prototype.hasOwnProperty.call(this._sourcesContents, r) ? this._sourcesContents[r] : null; }, this); }, l.prototype.toJSON = function() { var e = { version: this._version, sources: this._sources.toArray(), names: this._names.toArray(), mappings: this._serializeMappings() }; return null != this._file && (e.file = this._file), null != this._sourceRoot && (e.sourceRoot = this._sourceRoot), this._sourcesContents && (e.sourcesContent = this._generateSourcesContent(e.sources, e.sourceRoot)), e; }, l.prototype.toString = function() { return JSON.stringify(this.toJSON()); }, t.SourceMapGenerator = l; }, function(e, t, r) { var n = r(9); t.encode = function(e) { var t, r = "", o = function(e) { return e < 0 ? 1 + (-e << 1) : 0 + (e << 1); }(e); do t = 31 & o, (o >>>= 5) > 0 && (t |= 32), r += n.encode(t); while (o > 0); return r; }, t.decode = function(e, t, r) { var o, a, i, l, u = e.length, c = 0, s = 0; do { if (t >= u) throw new Error("Expected more digits in base 64 VLQ value."); if (-1 === (a = n.decode(e.charCodeAt(t++)))) throw new Error("Invalid base64 digit: " + e.charAt(t - 1)); o = !!(32 & a), c += (a &= 31) << s, s += 5; }while (o); r.value = (l = (i = c) >> 1, 1 == (1 & i) ? -l : l), r.rest = t; }; }, function(e, t, r) { var n = r(1), o = Object.prototype.hasOwnProperty, a = "undefined" != typeof Map; function i() { this._array = [], this._set = a ? new Map : Object.create(null); } i.fromArray = function(e, t) { for(var r = new i, n = 0, o = e.length; n < o; n++)r.add(e[n], t); return r; }, i.prototype.size = function() { return a ? this._set.size : Object.getOwnPropertyNames(this._set).length; }, i.prototype.add = function(e, t) { var r = a ? e : n.toSetString(e), i = a ? this.has(e) : o.call(this._set, r), l = this._array.length; i && !t || this._array.push(e), i || (a ? this._set.set(e, l) : this._set[r] = l); }, i.prototype.has = function(e) { if (a) return this._set.has(e); var t = n.toSetString(e); return o.call(this._set, t); }, i.prototype.indexOf = function(e) { if (a) { var t = this._set.get(e); if (t >= 0) return t; } else { var r = n.toSetString(e); if (o.call(this._set, r)) return this._set[r]; } throw new Error('"' + e + '" is not in the set.'); }, i.prototype.at = function(e) { if (e >= 0 && e < this._array.length) return this._array[e]; throw new Error("No element indexed by " + e); }, i.prototype.toArray = function() { return this._array.slice(); }, t.ArraySet = i; }, function(e, t, r) { "use strict"; function n(e) { return Array.isArray(e) || (e = [ e ]), Promise.all(e.map(function(e) { return e.then(function(e) { return { isFulfilled: !0, isRejected: !1, value: e }; }).catch(function(e) { return { isFulfilled: !1, isRejected: !0, reason: e }; }); })); } Object.defineProperty(t, "__esModule", { value: !0 }), t.settle = n, t.default = n; }, function(e, t, r) { var n = function(e) { "use strict"; var t, r = Object.prototype, n = r.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, a = o.iterator || "@@iterator", i = o.asyncIterator || "@@asyncIterator", l = o.toStringTag || "@@toStringTag"; function u(e, t, r) { return Object.defineProperty(e, t, {